xunge/DecIR huggingface dataset:
/* Type definitions */
struct fat16_fs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct fat16_fs_struct *);
void fat16_close(struct fat16_fs_struct *fs) {
  if (!fs)
    return;
  free(fs);
}


x86 assembly (clang, -O0):
<fat16_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <fat16_close+0x1c>
jmp    1135 <fat16_close+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat16_close>:
test   %rdi,%rdi
je     111a <fat16_close+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.fat16_fs_struct = type { i32 }
define void @fat16_close(%struct.fat16_fs_struct* %0) {
%2 = alloca %struct.fat16_fs_struct*
store %struct.fat16_fs_struct* %0, %struct.fat16_fs_struct** %2
%3 = load %struct.fat16_fs_struct*, %struct.fat16_fs_struct** %2
%4 = icmp ne %struct.fat16_fs_struct* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.fat16_fs_struct*, %struct.fat16_fs_struct** %2
%8 = call i32 @free(%struct.fat16_fs_struct* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.fat16_fs_struct = type { i32 }
define void @fat16_close(%struct.fat16_fs_struct* %0) {
%2 = icmp eq %struct.fat16_fs_struct* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.fat16_fs_struct* %0)
br label %5
5: ; preds = %1, %3
ret void
}
int arm_machinereg(int reg) {
  if (reg < 5)
    return reg + 4;
  return reg + 5;
}


x86 assembly (clang, -O0):
<arm_machinereg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    111f <arm_machinereg+0x1f>
mov    -0x8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    1128 <arm_machinereg+0x28>
mov    -0x8(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_machinereg>:
xor    %eax,%eax
cmp    $0x5,%edi
setl   %al
neg    %eax
add    %edi,%eax
add    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @arm_machinereg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 4
store i32 %8, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 5
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @arm_machinereg(i32 %0) {
%2 = icmp slt i32 %0, 5
%3 = select i1 %2, i32 4, i32 5
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printUsage() {
  printf("GCMTool %s- A utility for working with Nintendo GameCube DVD "
         "images.\n\tgcmtool.sourceforge.net\n\n",
         "");
  printf("Usage:");
  printf("  gcmtool [ options ] <filename>\n\n");
  printf("Use -? for extended usage.\n\n");
}


x86 assembly (clang, -O0):
<printUsage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xf84(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printUsage>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf30(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf23(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf1c(%rip),%rdi
call   1030 <puts@plt>
lea    0xf32(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [96 x i8] c"GCMTool %s- A utility for working with Nintendo GameCube DVD images.\0A\09gcmtool.sourceforge.net\0A\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [7 x i8] c"Usage:\00"
@.str.3 = [35 x i8] c" gcmtool [ options ] <filename>\0A\0A\00"
@.str.4 = [29 x i8] c"Use -? for extended usage.\0A\0A\00"
define void @printUsage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [96 x i8] c"GCMTool %s- A utility for working with Nintendo GameCube DVD images.\0A\09gcmtool.sourceforge.net\0A\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [7 x i8] c"Usage:\00"
@str = [34 x i8] c" gcmtool [ options ] <filename>\0A\00"
@str.5 = [28 x i8] c"Use -? for extended usage.\0A\00"
define void @printUsage() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.5, i64 0, i64 0))
ret void
}
__attribute__((__unused__)) int isdigit(int c) {
  return (('0' <= (c)) && ((c) <= '9'));
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isdigit+0x24>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 48, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int cmp_f(const void *pa, const void *pb) {
  const double *a = pa, *b = pb;
  if (*a < *b)
    return -1;
  if (*a > *b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1142 <cmp_f+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <cmp_f+0x6b>
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x28(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1164 <cmp_f+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <cmp_f+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_f>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_f(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double*
%7 = alloca double*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
store double* %9, double** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to double*
store double* %11, double** %7
%12 = load double*, double** %6
%13 = load double, double* %12
%14 = load double*, double** %7
%15 = load double, double* %14
%16 = fcmp olt double %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %26
18: ; preds = %2
%19 = load double*, double** %6
%20 = load double, double* %19
%21 = load double*, double** %7
%22 = load double, double* %21
%23 = fcmp ogt double %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @cmp_f(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = bitcast i8* %1 to double*
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = fcmp ogt double %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
__attribute__((always_)) int test_and_clear_bit(int nr,
                                                volatile unsigned long *addr) {
  int oldbit;
  asm volatile(".section .smp_locks,\"a\"\n"
               " "
               ".balign 8"
               " "
               "\n"
               " "
               ".quad"
               " "
               "661f\n"
               ".previous\n"
               "661:\n\tlock; "
               "btr %2,%1\n\t"
               "sbb %0,%0"
               : "=r"(oldbit), "+m"(*(volatile long *)(addr))
               : "Ir"(nr)
               : "memory");
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_clear_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
lock btr %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_clear_bit>:
lock btr %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_clear_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm sideeffect ".section .smp_locks,\22a\22\0A .balign 8 \0A .quad 661f\0A.previous\0A661:\0A\09lock; btr $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_and_clear_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm sideeffect ".section .smp_locks,\22a\22\0A .balign 8 \0A .quad 661f\0A.previous\0A661:\0A\09lock; btr $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0, i64* elementtype(i64) %1)
ret i32 %3
}
int id(int x) {
  if (x == 0)
    return 0;
  int ret = id(x - 1) + 1;
  if (ret > 2)
    return 2;
  return ret;
}


x86 assembly (clang, -O0):
<id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <id+0x21>
movl   $0x0,-0x4(%rbp)
jmp    115e <id+0x4e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <id@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jle    1158 <id+0x48>
movl   $0x2,-0x4(%rbp)
jmp    115e <id+0x4e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<id>:
test   %edi,%edi
je     1130 <id+0x20>
push   %rax
add    $0xffffffff,%edi
call   1030 <id@plt>
lea    0x1(%rax),%ecx
cmp    $0x2,%eax
mov    $0x2,%eax
cmovl  %ecx,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @id(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %18
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @id(i32 %10)
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp sgt i32 %13, 2
br i1 %14, label %15, label %16
15: ; preds = %8
store i32 2, i32* %2
br label %18
16: ; preds = %8
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %18
18: ; preds = %16, %15, %7
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @id(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i32 [ %10, %5 ], [ 0, %1 ]
ret i32 %4
5: ; preds = %1
%6 = add nsw i32 %0, -1
%7 = tail call i32 @id(i32 %6)
%8 = add nsw i32 %7, 1
%9 = icmp slt i32 %7, 2
%10 = select i1 %9, i32 %8, i32 2
br label %3
}
int monitor_supported(void) { return -1; }


x86 assembly (clang, -O0):
<monitor_supported>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<monitor_supported>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @monitor_supported() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @monitor_supported() {
ret i32 -1
}
void GB_ABS_f_FP64(double *z, const double *x) {
  (*z) = ((((*x)) >= 0) ? ((*x)) : (-((*x))));
}


x86 assembly (clang, -O0):
<GB_ABS_f_FP64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <GB_ABS_f_FP64+0x33>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <GB_ABS_f_FP64+0x57>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GB_ABS_f_FP64>:
movsd  (%rsi),%xmm0
movapd 0xef4(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpnlesd %xmm0,%xmm2
andpd  %xmm2,%xmm1
andnpd %xmm0,%xmm2
orpd   %xmm1,%xmm2
movlpd %xmm2,(%rdi)
ret

LLVM IR (-O0):
define void @GB_ABS_f_FP64(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = fcmp oge double %6, 0.000000e+00
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load double*, double** %4
%10 = load double, double* %9
br label %15
11: ; preds = %2
%12 = load double*, double** %4
%13 = load double, double* %12
%14 = fneg double %13
br label %15
15: ; preds = %11, %8
%16 = phi double [ %10, %8 ], [ %14, %11 ]
%17 = load double*, double** %3
store double %16, double* %17
ret void
}

LLVM IR (-O2):
define void @GB_ABS_f_FP64(double* nocapture writeonly %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = fcmp ult double %3, 0.000000e+00
%5 = fneg double %3
%6 = select i1 %4, double %5, double %3
store double %6, double* %0
ret void
}
int test_imm_11uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x11 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_11uint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x11,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_11uint64_lowword_mem>:
testb  $0x11,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_11uint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 17
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_11uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 17
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ outb(int, int);
void set_mode(int mode) {
  outb(5, 0x3ce);
  outb(mode, 0x3cf);
}


x86 assembly (clang, -O0):
<set_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    -0x4(%rbp),%edi
mov    $0x3cf,%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mode>:
push   %rbx
mov    %edi,%ebx
mov    $0x5,%edi
mov    $0x3ce,%esi
call   1030 <outb@plt>
mov    %ebx,%edi
mov    $0x3cf,%esi
pop    %rbx
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @set_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @outb(i32 5, i32 974)
%4 = load i32, i32* %2
%5 = call i32 @outb(i32 %4, i32 975)
ret void
}

LLVM IR (-O2):
define void @set_mode(i32 %0) {
%2 = tail call i32 @outb(i32 5, i32 974)
%3 = tail call i32 @outb(i32 %0, i32 975)
ret void
}
long C_dbg_hook(long dummy) { return dummy; }


x86 assembly (clang, -O0):
<C_dbg_hook>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_dbg_hook>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @C_dbg_hook(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @C_dbg_hook(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
double floor(double);
double sqrt(int);
bool is_perfect_square(int n) {
  double sq = sqrt(n);
  return (sq == floor(sq)) ? true : false;
}


x86 assembly (clang, -O0):
<is_perfect_square>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sqrt@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_perfect_square>:
push   %rax
call   1030 <sqrt@plt>
movsd  %xmm0,(%rsp)
call   1040 <floor@plt>
cmpeqsd (%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_perfect_square(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call double @sqrt(i32 %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = load double, double* %3
%8 = call double @llvm.floor.f64(double %7)
%9 = fcmp oeq double %6, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 1, i32 0
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_perfect_square(i32 %0) {
%2 = tail call double @sqrt(i32 %0)
%3 = tail call double @llvm.floor.f64(double %2)
%4 = fcmp oeq double %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
union sigval {
  scalar_t__ sival_ptr;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void thread_timer(union sigval value) {
  static int count = 10;
  printf("%s\n", (char *)value.sival_ptr);
  if (--count <= 0)
    exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<thread_timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eee(%rip),%eax
add    $0xffffffff,%eax
mov    %eax,0x2ee5(%rip)
cmp    $0x0,%eax
jg     1162 <thread_timer+0x42>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_timer>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2efa(%rip),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x2ef1(%rip)
cmp    $0x1,%eax
jle    1146 <thread_timer+0x26>
pop    %rax
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%union.sigval = type { i64 }
@thread_timer.count = internal global i32 10
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define void @thread_timer(i64 %0) {
%2 = alloca %union.sigval
%3 = getelementptr inbounds %union.sigval, %union.sigval* %2, i32 0, i32 0
store i64 %0, i64* %3
%4 = bitcast %union.sigval* %2 to i64*
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @thread_timer.count
%9 = add nsw i32 %8, -1
store i32 %9, i32* @thread_timer.count
%10 = icmp sle i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
ret void
}

LLVM IR (-O2):
@thread_timer.count = internal unnamed_addr global i32 10
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define void @thread_timer(i64 %0) {
%2 = inttoptr i64 %0 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @thread_timer.count
%5 = add nsw i32 %4, -1
store i32 %5, i32* @thread_timer.count
%6 = icmp slt i32 %4, 2
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @EXIT_SUCCESS
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
void *__softboundmpx_load_base_shadow_stack(int);
void *__softboundmpx_load_bound_shadow_stack(int);
int /*<<< orphan*/ __softboundmpx_metadata_store(char **, void *, void *,
                                                 char *);
__attribute__((__weak__, __always___)) void
__softboundmpx_read_shadow_stack_metadata_store(char **endptr, int arg_num) {
  void *nptr_base = __softboundmpx_load_base_shadow_stack(arg_num);
  void *nptr_bound = __softboundmpx_load_bound_shadow_stack(arg_num);
  __softboundmpx_metadata_store(endptr, nptr_base, nptr_bound, (*endptr));
}


x86 assembly (clang, -O0):
<__softboundmpx_read_shadow_stack_metadata_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <__softboundmpx_load_base_shadow_stack@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <__softboundmpx_load_bound_shadow_stack@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
call   1050 <__softboundmpx_metadata_store@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundmpx_read_shadow_stack_metadata_store>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <__softboundmpx_load_base_shadow_stack@plt>
mov    %rax,%r15
mov    %ebx,%edi
call   1030 <__softboundmpx_load_bound_shadow_stack@plt>
mov    (%r14),%rcx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <__softboundmpx_metadata_store@plt>

LLVM IR (-O0):
define weak void @__softboundmpx_read_shadow_stack_metadata_store(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call i8* @__softboundmpx_load_base_shadow_stack(i32 %7)
store i8* %8, i8** %5
%9 = load i32, i32* %4
%10 = call i8* @__softboundmpx_load_bound_shadow_stack(i32 %9)
store i8* %10, i8** %6
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = call i32 @__softboundmpx_metadata_store(i8** %11, i8* %12, i8* %13, i8* %15)
ret void
}

LLVM IR (-O2):
define weak void @__softboundmpx_read_shadow_stack_metadata_store(i8** %0, i32 %1) {
%3 = tail call i8* @__softboundmpx_load_base_shadow_stack(i32 %1)
%4 = tail call i8* @__softboundmpx_load_bound_shadow_stack(i32 %1)
%5 = load i8*, i8** %0
%6 = tail call i32 @__softboundmpx_metadata_store(i8** %0, i8* %3, i8* %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int *, int *);
void fn2(int a) {
  int b = 10, c;
  c = a + b;
  printf("fn2(): a=%p, b=%p, c=%p\n", &a, &b, &c);
}


x86 assembly (clang, -O0):
<fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
lea    0xece(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn2>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
movl   $0xa,0x10(%rsp)
add    $0xa,%edi
mov    %edi,0xc(%rsp)
lea    0xed2(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"fn2(): a=%p, b=%p, c=%p\0A\00"
define void @fn2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 10, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"fn2(): a=%p, b=%p, c=%p\0A\00"
define void @fn2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%6 = bitcast i32* %4 to i8*
%7 = add nsw i32 %0, 10
store i32 %7, i32* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_u32x4_murmur32v_data32(int /*<<< orphan*/ const *,
                                               size_t, uintptr_t,
                                               int /*<<< orphan*/ *);
void rgph_u32x4_murmur32v_u32a(const uint32_t *key, size_t len, uintptr_t seed,
                               uint32_t *h) {
  rgph_u32x4_murmur32v_data32(key, len, seed, h);
}


x86 assembly (clang, -O0):
<rgph_u32x4_murmur32v_u32a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <rgph_u32x4_murmur32v_data32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32x4_murmur32v_u32a>:
jmp    1030 <rgph_u32x4_murmur32v_data32@plt>

LLVM IR (-O0):
define void @rgph_u32x4_murmur32v_u32a(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
store i32* %0, i32** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i32*, i32** %8
%13 = call i32 @rgph_u32x4_murmur32v_data32(i32* %9, i64 %10, i64 %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @rgph_u32x4_murmur32v_u32a(i32* %0, i64 %1, i64 %2, i32* %3) {
%5 = tail call i32 @rgph_u32x4_murmur32v_data32(i32* %0, i64 %1, i64 %2, i32* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wint_t;

/* Variables and functions */
int __infer_nondet_int();
int iswalpha(wint_t wc) { return __infer_nondet_int(); }


x86 assembly (clang, -O0):
<iswalpha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswalpha>:
xor    %eax,%eax
jmp    1030 <__infer_nondet_int@plt>

LLVM IR (-O0):
define i32 @iswalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @iswalpha(i32 %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s\n", "hello unicode 👾");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee5(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [19 x i8] c"hello unicode \F0\9F\91\BE\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [19 x i8] c"hello unicode \F0\9F\91\BE\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; ++i) {
    (void)puts(argv[i]);
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
mov    0x2e81(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @puts(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = load i32, i32* @EXIT_SUCCESS
ret i32 %22
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}
double LAI_carlson(double NDVI, double NDVImin, double NDVImax) {
  double tNDVI, LAI;
  tNDVI = (NDVI - NDVImin) / (NDVImax - NDVImin);
  LAI = tNDVI * tNDVI;
  return (LAI);
}


x86 assembly (clang, -O0):
<LAI_carlson>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LAI_carlson>:
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @LAI_carlson(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%9 = load double, double* %4
%10 = load double, double* %5
%11 = fsub double %9, %10
%12 = load double, double* %6
%13 = load double, double* %5
%14 = fsub double %12, %13
%15 = fdiv double %11, %14
store double %15, double* %7
%16 = load double, double* %7
%17 = load double, double* %7
%18 = fmul double %16, %17
store double %18, double* %8
%19 = load double, double* %8
ret double %19
}

LLVM IR (-O2):
define double @LAI_carlson(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fsub double %2, %1
%6 = fdiv double %4, %5
%7 = fmul double %6, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ output_token();
int /*<<< orphan*/ pretty_print_string();
int /*<<< orphan*/ printf(char *);
void bquote(void) {
  output_token();
  pretty_print_string();
  printf("\n");
}


x86 assembly (clang, -O0):
<bquote>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <output_token@plt>
mov    $0x0,%al
call   1030 <pretty_print_string@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bquote>:
push   %rax
xor    %eax,%eax
call   1050 <output_token@plt>
xor    %eax,%eax
call   1040 <pretty_print_string@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define void @bquote() {
%1 = call i32 (...) @output_token()
%2 = call i32 (...) @pretty_print_string()
%3 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @bquote() {
%1 = tail call i32 (...) @output_token()
%2 = tail call i32 (...) @pretty_print_string()
%3 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv[]) {
  fprintf(stderr, "Usage: %s <kernel-bzimage>\n", argv[0]);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    (%rdi),%rdx
lea    0xecc(%rip),%rsi
mov    %eax,%edi
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s <kernel-bzimage>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [28 x i8] c"Usage: %s <kernel-bzimage>\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
char *strcpy(char *dest, const char *src) {
  printf("%s: not implemented\n", __func__);
  return 0;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
lea    0xee7(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef6(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s: not implemented\0A\00"
@__func__.strcpy = [7 x i8] c"strcpy\00"
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.strcpy, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s: not implemented\0A\00"
@__func__.strcpy = [7 x i8] c"strcpy\00"
define noalias i8* @strcpy(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__func__.strcpy, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
scalar_t__ errno;
char *strerror(scalar_t__);
char *get_error() {
  if (errno == 0)
    return "None";
  return strerror(errno);
}


x86 assembly (clang, -O0):
<get_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
cmpq   $0x0,(%rax)
jne    1139 <get_error+0x29>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <get_error+0x3c>
mov    0x2ea0(%rip),%rax
mov    (%rax),%rdi
call   1030 <strerror@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_error>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
je     1124 <get_error+0x14>
jmp    1030 <strerror@plt>
lea    0xed5(%rip),%rax
ret

LLVM IR (-O0):
@errno = global i64 0
@.str = [5 x i8] c"None\00"
define i8* @get_error() {
%1 = alloca i8*
%2 = load i64, i64* @errno
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
5: ; preds = %0
%6 = load i64, i64* @errno
%7 = call i8* @strerror(i64 %6)
store i8* %7, i8** %1
br label %8
8: ; preds = %5, %4
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [5 x i8] c"None\00"
define i8* @get_error() {
%1 = load i64, i64* @errno
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i8* @strerror(i64 %1)
br label %5
5: ; preds = %0, %3
%6 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %0 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void *func(void *data) {
  printf("Hello World\n");
  exit(1);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define i8* @func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define noalias i8* @func(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct dirent {
  char *d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
struct dirent *readdir(int /*<<< orphan*/ *);
char *ntx_dread(DIR *dir) {
  struct dirent *dirp;
  dirp = readdir(dir);
  if (!dirp)
    return NULL;
  return dirp->d_name;
}


x86 assembly (clang, -O0):
<ntx_dread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <readdir@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <ntx_dread+0x31>
movq   $0x0,-0x8(%rbp)
jmp    114c <ntx_dread+0x3c>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntx_dread>:
push   %rax
call   1030 <readdir@plt>
test   %rax,%rax
je     1120 <ntx_dread+0x10>
mov    (%rax),%rax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i8* @ntx_dread(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca %struct.dirent*
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call %struct.dirent* @readdir(i32* %5)
store %struct.dirent* %6, %struct.dirent** %4
%7 = load %struct.dirent*, %struct.dirent** %4
%8 = icmp ne %struct.dirent* %7, null
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %14
10: ; preds = %1
%11 = load %struct.dirent*, %struct.dirent** %4
%12 = getelementptr inbounds %struct.dirent, %struct.dirent* %11, i32 0, i32 0
%13 = load i8*, i8** %12
store i8* %13, i8** %2
br label %14
14: ; preds = %10, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i8* @ntx_dread(i32* %0) {
%2 = tail call %struct.dirent* @readdir(i32* %0)
%3 = icmp eq %struct.dirent* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ null, %1 ]
ret i8* %8
}
/* Variables and functions */
scalar_t__ Char_3d_array(int, int, int);
unsigned short ***Ushort_3d_array(int i_size, int j_size, int k_size) {
  return ((unsigned short ***)Char_3d_array(i_size, j_size,
                                            k_size * sizeof(unsigned short)));
}


x86 assembly (clang, -O0):
<Ushort_3d_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
movslq -0xc(%rbp),%rax
shl    $0x1,%rax
mov    %eax,%edx
call   1030 <Char_3d_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ushort_3d_array>:
add    %edx,%edx
jmp    1030 <Char_3d_array@plt>

LLVM IR (-O0):
define i16*** @Ushort_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 2
%12 = trunc i64 %11 to i32
%13 = call i64 @Char_3d_array(i32 %7, i32 %8, i32 %12)
%14 = inttoptr i64 %13 to i16***
ret i16*** %14
}

LLVM IR (-O2):
define i16*** @Ushort_3d_array(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 1
%5 = tail call i64 @Char_3d_array(i32 %0, i32 %1, i32 %4)
%6 = inttoptr i64 %5 to i16***
ret i16*** %6
}
/* Variables and functions */
int my_put_unsigned_int_base(unsigned int, int, int /*<<< orphan*/);
int my_put_unsigned_int(unsigned int ui) {
  return (my_put_unsigned_int_base(ui, 10, 0));
}


x86 assembly (clang, -O0):
<my_put_unsigned_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xa,%esi
xor    %edx,%edx
call   1030 <my_put_unsigned_int_base@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_put_unsigned_int>:
mov    $0xa,%esi
xor    %edx,%edx
jmp    1030 <my_put_unsigned_int_base@plt>

LLVM IR (-O0):
define i32 @my_put_unsigned_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @my_put_unsigned_int_base(i32 %3, i32 10, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @my_put_unsigned_int(i32 %0) {
%2 = tail call i32 @my_put_unsigned_int_base(i32 %0, i32 10, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *, long long, long long);
long long sumJohn(int);
void dotestsumJohn(int n, long long exp) {
  long long act = sumJohn(n);
  if (act != exp)
    printf("Error. Expected %llu\n but got %llu\n", exp, act);
  assert(act == exp);
}


x86 assembly (clang, -O0):
<dotestsumJohn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <sumJohn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     116d <dotestsumJohn+0x3d>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotestsumJohn>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <sumJohn@plt>
mov    %rax,%rbx
cmp    %r14,%rax
je     1156 <dotestsumJohn+0x26>
lea    0xeb5(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %edi,%edi
cmp    %r14,%rbx
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"Error. Expected %llu\0A but got %llu\0A\00"
define void @dotestsumJohn(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i32, i32* %3
%7 = call i64 @sumJohn(i32 %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %13)
br label %15
15: ; preds = %11, %2
%16 = load i64, i64* %5
%17 = load i64, i64* %4
%18 = icmp eq i64 %16, %17
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Error. Expected %llu\0A but got %llu\0A\00"
define void @dotestsumJohn(i32 %0, i64 %1) {
%3 = tail call i64 @sumJohn(i32 %0)
%4 = icmp eq i64 %3, %1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i64 %1, i64 %3)
br label %7
7: ; preds = %5, %2
%8 = zext i1 %4 to i32
%9 = tail call i32 @assert(i32 %8)
ret void
}
unsigned long SIO1_readStat32(void) { return 0; }


x86 assembly (clang, -O0):
<SIO1_readStat32>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SIO1_readStat32>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @SIO1_readStat32() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1_readStat32() {
ret i64 0
}
/* Type definitions */
typedef int lirc_t;

/* Variables and functions */
int PULSE_BIT;
int is_pulse(lirc_t data) { return (data & PULSE_BIT ? 1 : 0); }


x86 assembly (clang, -O0):
<is_pulse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    0x2ecf(%rip),%rax
and    (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_pulse>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
test   %edi,(%rcx)
setne  %al
ret

LLVM IR (-O0):
@PULSE_BIT = global i32 0
define i32 @is_pulse(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @PULSE_BIT
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
@PULSE_BIT = global i32 0
define i32 @is_pulse(i32 %0) {
%2 = load i32, i32* @PULSE_BIT
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int f_fseek(void *fp, off_t offset, int whence) {
  return fseek((FILE *)fp, offset, whence);
}


x86 assembly (clang, -O0):
<f_fseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_fseek>:
jmp    1030 <fseek@plt>

LLVM IR (-O0):
define i32 @f_fseek(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fseek(i32* %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @f_fseek(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i32*
%5 = tail call i32 @fseek(i32* %4, i32 %1, i32 %2)
ret i32 %5
}