#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void print_index_type(FILE *list, int index_type) {
  if (index_type == 0)
    fprintf(list, "user");
  else if (index_type == 2)
    fprintf(list, "free_lc");
  else if (index_type == 1)
    fprintf(list, "free_rec");
  else
    fprintf(list, "unknown");
}


x86 assembly (clang, -O0):
<print_index_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <print_index_type+0x2e>
mov    -0x8(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1196 <print_index_type+0x86>
cmpl   $0x2,-0xc(%rbp)
jne    115d <print_index_type+0x4d>
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1191 <print_index_type+0x81>
cmpl   $0x1,-0xc(%rbp)
jne    117c <print_index_type+0x6c>
mov    -0x8(%rbp),%rdi
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
jmp    118c <print_index_type+0x7c>
mov    -0x8(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1191 <print_index_type+0x81>
jmp    1196 <print_index_type+0x86>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_index_type>:
mov    %rdi,%rcx
cmp    $0x2,%esi
je     1137 <print_index_type+0x27>
cmp    $0x1,%esi
je     1140 <print_index_type+0x30>
test   %esi,%esi
jne    1156 <print_index_type+0x46>
lea    0xed8(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>
lea    0xec7(%rip),%rdi
jmp    115d <print_index_type+0x4d>
lea    0xec6(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>
lea    0xeb9(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"user\00"
@.str.1 = [8 x i8] c"free_lc\00"
@.str.2 = [9 x i8] c"free_rec\00"
@.str.3 = [8 x i8] c"unknown\00"
define void @print_index_type(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %27
10: ; preds = %2
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32*, i32** %3
%15 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %26
16: ; preds = %10
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32*, i32** %3
%21 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %25
22: ; preds = %16
%23 = load i32*, i32** %3
%24 = call i32 @fprintf(i32* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %22, %19
br label %26
26: ; preds = %25, %13
br label %27
27: ; preds = %26, %7
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"user\00"
@.str.1 = [8 x i8] c"free_lc\00"
@.str.2 = [9 x i8] c"free_rec\00"
@.str.3 = [8 x i8] c"unknown\00"
define void @print_index_type(i32* nocapture %0, i32 %1) {
switch i32 %1, label %9 [
i32 0, label %3
i32 2, label %5
i32 1, label %7
]
3: ; preds = %2
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
br label %11
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i64 7, i64 1, i32* %0)
br label %11
7: ; preds = %2
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 8, i64 1, i32* %0)
br label %11
9: ; preds = %2
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i64 7, i64 1, i32* %0)
br label %11
11: ; preds = %5, %9, %7, %3
ret void
}