#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_geo(const char *label, uint32_t val) {
  uint16_t assoc;
  printf("%s line size:  %#10x       ", label, val & 0xFFFF);
  assoc = val >> 16;
  if (assoc)
    printf("%u-way", assoc);
  else
    printf("fully");
  printf(" associative\n");
}


x86 assembly (clang, -O0):
<print_geo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
and    $0xffff,%edx
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1163 <print_geo+0x53>
mov    -0x10(%rbp),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1171 <print_geo+0x61>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_geo>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
movzwl %bx,%edx
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x10000,%ebx
jae    114f <print_geo+0x2f>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1162 <print_geo+0x42>
sar    $0x10,%ebx
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec0(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%s line size: %x \00"
@.str.1 = [7 x i8] c"%u-way\00"
@.str.2 = [6 x i8] c"fully\00"
@.str.3 = [14 x i8] c" associative\0A\00"
define void @print_geo(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = and i32 %7, 65535
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %8)
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* %5
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"%s line size: %x \00"
@.str.1 = [7 x i8] c"%u-way\00"
@.str.2 = [6 x i8] c"fully\00"
@str = [13 x i8] c" associative\00"
define void @print_geo(i8* %0, i32 %1) {
%3 = and i32 %1, 65535
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
%5 = icmp ult i32 %1, 65536
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = ashr i32 %1, 16
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}