xunge/DecIR huggingface dataset:
/* Variables and functions */
double log(int);
int sqrt(int);
double aSech(double x) { return log((1 + sqrt(1 - x * x)) / x); }


x86 assembly (clang, -O0):
<aSech>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xea6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
divsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aSech>:
push   %rax
movsd  %xmm0,(%rsp)
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeca(%rip),%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%edi
call   1040 <sqrt@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  (%rsp),%xmm0
cvttsd2si %xmm0,%edi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @aSech(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = call i32 @sqrt(i32 %7)
%9 = add nsw i32 1, %8
%10 = sitofp i32 %9 to double
%11 = load double, double* %2
%12 = fdiv double %10, %11
%13 = fptosi double %12 to i32
%14 = call double @log(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @aSech(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call i32 @sqrt(i32 %4)
%6 = add nsw i32 %5, 1
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, %0
%9 = fptosi double %8 to i32
%10 = tail call double @log(i32 %9)
ret double %10
}
/* Variables and functions */
void *malloc(size_t);
void *malloc_array_2(size_t n, size_t size) {
  size_t bytes = n * size;
  if (size && n != bytes / size)
    return NULL;
  return malloc(bytes);
}


x86 assembly (clang, -O0):
<malloc_array_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1169 <malloc_array_2+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1169 <malloc_array_2+0x59>
movq   $0x0,-0x8(%rbp)
jmp    1176 <malloc_array_2+0x66>
mov    -0x20(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_array_2>:
mov    %rsi,%rax
mul    %rdi
seto   %cl
test   %rsi,%rsi
je     1125 <malloc_array_2+0x15>
test   %cl,%cl
je     1125 <malloc_array_2+0x15>
xor    %eax,%eax
ret
mov    %rax,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @malloc_array_2(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = mul i64 %7, %8
store i64 %9, i64* %6
%10 = load i64, i64* %5
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %2
%13 = load i64, i64* %4
%14 = load i64, i64* %6
%15 = load i64, i64* %5
%16 = udiv i64 %14, %15
%17 = icmp ne i64 %13, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i8* null, i8** %3
br label %22
19: ; preds = %12, %2
%20 = load i64, i64* %6
%21 = call i8* @malloc(i64 %20)
store i8* %21, i8** %3
br label %22
22: ; preds = %19, %18
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define noalias i8* @malloc_array_2(i64 %0, i64 %1) {
%3 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%4 = extractvalue { i64, i1 } %3, 0
%5 = icmp eq i64 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = extractvalue { i64, i1 } %3, 1
br i1 %7, label %10, label %8
8: ; preds = %6, %2
%9 = tail call i8* @malloc(i64 %4)
br label %10
10: ; preds = %6, %8
%11 = phi i8* [ %9, %8 ], [ null, %6 ]
ret i8* %11
}
/* Variables and functions */
long fib(int);
long int fib1(int n) {
  if ((n == 1) || (n == 2)) {
    return 1;
  }
  return fib(n - 1) + fib(n - 2);
}


x86 assembly (clang, -O0):
<fib1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     112f <fib1+0x1f>
cmpl   $0x2,-0xc(%rbp)
jne    113c <fib1+0x2c>
movq   $0x1,-0x8(%rbp)
jmp    1164 <fib1+0x54>
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib1>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    -0x1(%rbx),%edi
mov    $0x1,%eax
cmp    $0x2,%edi
jb     1138 <fib1+0x28>
call   1030 <fib@plt>
mov    %rax,%r14
add    $0xfffffffe,%ebx
mov    %ebx,%edi
call   1030 <fib@plt>
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @fib1(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i64 @fib(i32 %2)
%6 = add nsw i32 %0, -2
%7 = tail call i64 @fib(i32 %6)
%8 = add nsw i64 %7, %5
br label %9
9: ; preds = %1, %4
%10 = phi i64 [ %8, %4 ], [ 1, %1 ]
ret i64 %10
}
void kill_split() {}


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

x86 assembly (clang, -O2):
<kill_split>:
ret

LLVM IR (-O0):
define void @kill_split() {
ret void
}

LLVM IR (-O2):
define void @kill_split() {
ret void
}
void test_index_merge() {}


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

x86 assembly (clang, -O2):
<test_index_merge>:
ret

LLVM IR (-O0):
define void @test_index_merge() {
ret void
}

LLVM IR (-O2):
define void @test_index_merge() {
ret void
}
/* Variables and functions */
int cmp_int(const void *a, const void *b) {
  return *(const int *)a - *(const int *)b;
}


x86 assembly (clang, -O0):
<cmp_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_int>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ *strchr(char *, char);
int isOp(char c) { return strchr("+-*/<>:=", c) != NULL; }


x86 assembly (clang, -O0):
<isOp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOp>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"+-*/<>:=\00"
define i32 @isOp(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [9 x i8] c"+-*/<>:=\00"
define i32 @isOp(i8 signext %0) {
%2 = tail call i32* @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
double __infer_nondet_double();
double log(double x) { return __infer_nondet_double(); }


x86 assembly (clang, -O0):
<log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define double @log(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @log(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
void init_full_scan_done(int level) {
  { return; }
}


x86 assembly (clang, -O0):
<init_full_scan_done>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_full_scan_done>:
ret

LLVM IR (-O0):
define void @init_full_scan_done(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @init_full_scan_done(i32 %0) {
ret void
}
int estPrioritaire(int op) {
  if ((op == 0) || (op == 1))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<estPrioritaire>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111b <estPrioritaire+0x1b>
cmpl   $0x1,-0x8(%rbp)
jne    1127 <estPrioritaire+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <estPrioritaire+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<estPrioritaire>:
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @estPrioritaire(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct genlist {
  int dummy;
};
struct fc_sockaddr_list_link {
  int dummy;
};
struct fc_sockaddr_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_erase(struct genlist *, struct genlist_link *);
void fc_sockaddr_list_erase(struct fc_sockaddr_list *tthis,
                            struct fc_sockaddr_list_link *plink) {
  genlist_erase((struct genlist *)tthis, (struct genlist_link *)plink);
}


x86 assembly (clang, -O0):
<fc_sockaddr_list_erase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <genlist_erase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc_sockaddr_list_erase>:
jmp    1030 <genlist_erase@plt>

LLVM IR (-O0):
%struct.fc_sockaddr_list = type { i32 }
%struct.fc_sockaddr_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @fc_sockaddr_list_erase(%struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list_link* %1) {
%3 = alloca %struct.fc_sockaddr_list*
%4 = alloca %struct.fc_sockaddr_list_link*
store %struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list** %3
store %struct.fc_sockaddr_list_link* %1, %struct.fc_sockaddr_list_link** %4
%5 = load %struct.fc_sockaddr_list*, %struct.fc_sockaddr_list** %3
%6 = bitcast %struct.fc_sockaddr_list* %5 to %struct.genlist*
%7 = load %struct.fc_sockaddr_list_link*, %struct.fc_sockaddr_list_link** %4
%8 = bitcast %struct.fc_sockaddr_list_link* %7 to %struct.genlist_link*
%9 = call i32 @genlist_erase(%struct.genlist* %6, %struct.genlist_link* %8)
ret void
}

LLVM IR (-O2):
%struct.fc_sockaddr_list = type { i32 }
%struct.fc_sockaddr_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @fc_sockaddr_list_erase(%struct.fc_sockaddr_list* %0, %struct.fc_sockaddr_list_link* %1) {
%3 = bitcast %struct.fc_sockaddr_list* %0 to %struct.genlist*
%4 = bitcast %struct.fc_sockaddr_list_link* %1 to %struct.genlist_link*
%5 = tail call i32 @genlist_erase(%struct.genlist* %3, %struct.genlist_link* %4)
ret void
}
void BN_swap(void) {}


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

x86 assembly (clang, -O2):
<BN_swap>:
ret

LLVM IR (-O0):
define void @BN_swap() {
ret void
}

LLVM IR (-O2):
define void @BN_swap() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void open_error(char *filename) {
  perror(filename);
  exit(0);
}


x86 assembly (clang, -O0):
<open_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<open_error>:
push   %rax
call   1030 <perror@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @open_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @open_error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprint_timespec(char *, struct tcb *, long);
int /*<<< orphan*/ tprints(char *);
void print_timespec(struct tcb *tcp, long addr) {
  char buf[(sizeof(long) * 3 * 2 + sizeof("{%u, %u}"))];
  sprint_timespec(buf, tcp, addr);
  tprints(buf);
}


x86 assembly (clang, -O0):
<print_timespec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <sprint_timespec@plt>
lea    -0x50(%rbp),%rdi
call   1040 <tprints@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_timespec>:
push   %rbx
sub    $0x40,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprint_timespec@plt>
mov    %rbx,%rdi
call   1040 <tprints@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tcb = type { i32 }
define void @print_timespec(%struct.tcb* %0, i64 %1) {
%3 = alloca %struct.tcb*
%4 = alloca i64
%5 = alloca [57 x i8]
store %struct.tcb* %0, %struct.tcb** %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [57 x i8], [57 x i8]* %5, i64 0, i64 0
%7 = load %struct.tcb*, %struct.tcb** %3
%8 = load i64, i64* %4
%9 = call i32 @sprint_timespec(i8* %6, %struct.tcb* %7, i64 %8)
%10 = getelementptr inbounds [57 x i8], [57 x i8]* %5, i64 0, i64 0
%11 = call i32 @tprints(i8* %10)
ret void
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define void @print_timespec(%struct.tcb* %0, i64 %1) {
%3 = alloca [57 x i8]
%4 = getelementptr inbounds [57 x i8], [57 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprint_timespec(i8* %4, %struct.tcb* %0, i64 %1)
%6 = call i32 @tprints(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
scalar_t__ system(int /*<<< orphan*/);
int /*<<< orphan*/ timlib_system_date_string();
void grace_output_screen_title(void) {
  printf("<h1>Grace Project Viewer<br>");
  fflush(stdout);
  if (system(timlib_system_date_string())) {
  };
  printf("</h1>\n");
}


x86 assembly (clang, -O0):
<grace_output_screen_title>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1060 <timlib_system_date_string@plt>
mov    %eax,%edi
call   1030 <system@plt>
cmp    $0x0,%rax
je     117b <grace_output_screen_title+0x3b>
jmp    117b <grace_output_screen_title+0x3b>
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<grace_output_screen_title>:
push   %rax
lea    0xea8(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
call   1070 <timlib_system_date_string@plt>
mov    %eax,%edi
call   1040 <system@plt>
lea    0xe9d(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"<h1>Grace Project Viewer<br>\00"
@stdout = global i32 0
@.str.1 = [7 x i8] c"</h1>\0A\00"
define void @grace_output_screen_title() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 (...) @timlib_system_date_string()
%5 = call i64 @system(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %0
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"<h1>Grace Project Viewer<br>\00"
@stdout = global i32 0
@str = [6 x i8] c"</h1>\00"
define void @grace_output_screen_title() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 (...) @timlib_system_date_string()
%5 = tail call i64 @system(i32 %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cough();
int main(void) {
  for (int i = 0; i < 3; i++) {
    cough();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <cough@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <cough@plt>
xor    %eax,%eax
call   1030 <cough@plt>
xor    %eax,%eax
call   1030 <cough@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @cough()
%2 = tail call i32 (...) @cough()
%3 = tail call i32 (...) @cough()
ret i32 0
}
/* Variables and functions */
int strlen(char const *);
size_t code128_estimate_len(const char *s) {
  return 10 + 11 + 11 * (strlen(s) * 11 / 10) + 11 + 13 + 10;
}


x86 assembly (clang, -O0):
<code128_estimate_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
imul   $0xb,%eax,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
imul   $0xb,%eax,%eax
add    $0x15,%eax
add    $0xb,%eax
add    $0xd,%eax
add    $0xa,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<code128_estimate_len>:
push   %rax
call   1030 <strlen@plt>
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,2),%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,4),%ecx
lea    (%rax,%rcx,2),%eax
add    $0x37,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @code128_estimate_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = mul nsw i32 %4, 11
%6 = sdiv i32 %5, 10
%7 = mul nsw i32 11, %6
%8 = add nsw i32 21, %7
%9 = add nsw i32 %8, 11
%10 = add nsw i32 %9, 13
%11 = add nsw i32 %10, 10
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @code128_estimate_len(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = mul nsw i32 %2, 11
%4 = sdiv i32 %3, 10
%5 = mul nsw i32 %4, 11
%6 = add nsw i32 %5, 55
%7 = sext i32 %6 to i64
ret i64 %7
}
int init_crypto(void) {
  int i = 0;
  return i;
}


x86 assembly (clang, -O0):
<init_crypto>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @init_crypto() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @init_crypto() {
ret i32 0
}
unsigned int recur_add(unsigned int n, unsigned int a) {
  if (n == 0)
    return a;
  if (n == 1)
    return ++a;
  else
    return recur_add(1, recur_add(--n, a));
}


x86 assembly (clang, -O0):
<recur_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1133 <recur_add+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <recur_add+0x5e>
cmpl   $0x1,-0x8(%rbp)
jne    114e <recur_add+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    116e <recur_add+0x5e>
mov    -0x8(%rbp),%edi
add    $0xffffffff,%edi
mov    %edi,-0x8(%rbp)
mov    -0xc(%rbp),%esi
call   1030 <recur_add@plt>
mov    %eax,%esi
mov    $0x1,%edi
call   1030 <recur_add@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recur_add>:
mov    %esi,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
add    %ecx,%edx
je     1123 <recur_add+0x23>
cmp    $0x1,%edx
je     1120 <recur_add+0x20>
add    $0xffffffff,%ecx
jmp    1110 <recur_add+0x10>
add    $0x1,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @recur_add(i32 %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i32 [ 0, %2 ], [ %10, %8 ]
%5 = phi i32 [ %0, %2 ], [ %9, %8 ]
switch i32 %5, label %8 [
i32 0, label %11
i32 1, label %6
]
6: ; preds = %3
%7 = add i32 %1, 1
br label %11
8: ; preds = %3
%9 = add i32 %5, -1
%10 = add i32 %4, 1
br label %3
11: ; preds = %3, %6
%12 = phi i32 [ %7, %6 ], [ %1, %3 ]
%13 = add i32 %12, %4
ret i32 %13
}
int test_option_b(int x) { return !x; }


x86 assembly (clang, -O0):
<test_option_b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_option_b>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @test_option_b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_option_b(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
void *realloc(void *, int);
void grow_array(void *p2array_uncast, int bytes_per_element,
                int element_count) {
  void **p2array = p2array_uncast;
  *p2array = realloc(*p2array, bytes_per_element * (element_count + 1));
}


x86 assembly (clang, -O0):
<grow_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
add    $0x1,%eax
imul   %eax,%esi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grow_array>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
lea    0x1(%rdx),%eax
imul   %eax,%esi
call   1030 <realloc@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @grow_array(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %7
%10 = load i8**, i8*** %7
%11 = load i8*, i8** %10
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %13, 1
%15 = mul nsw i32 %12, %14
%16 = call i8* @realloc(i8* %11, i32 %15)
%17 = load i8**, i8*** %7
store i8* %16, i8** %17
ret void
}

LLVM IR (-O2):
define void @grow_array(i8* nocapture %0, i32 %1, i32 %2) {
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = add nsw i32 %2, 1
%7 = mul nsw i32 %6, %1
%8 = tail call i8* @realloc(i8* %5, i32 %7)
store i8* %8, i8** %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("1: %d\n", 1);
  printf("1 & 0xff: %d\n", 1 & 0xff);
  printf("(1<<1) & 0xff: %d\n", (1 << 1) & 0xff);
  printf("(1<<3) & 0xff: %d\n", (1 << 3) & 0xff);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"1: %d\0A\00"
@.str.1 = [14 x i8] c"1 & 0xff: %d\0A\00"
@.str.2 = [19 x i8] c"(1<<1) & 0xff: %d\0A\00"
@.str.3 = [19 x i8] c"(1<<3) & 0xff: %d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 2)
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"1: %d\0A\00"
@.str.1 = [14 x i8] c"1 & 0xff: %d\0A\00"
@.str.2 = [19 x i8] c"(1<<1) & 0xff: %d\0A\00"
@.str.3 = [19 x i8] c"(1<<3) & 0xff: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}
int is_beg_string(int c) { return c == '\"' || c == '\''; }


x86 assembly (clang, -O0):
<is_beg_string>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x22,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <is_beg_string+0x20>
cmpl   $0x27,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_beg_string>:
cmp    $0x22,%edi
sete   %al
cmp    $0x27,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_beg_string(i32 %0) {
%2 = icmp eq i32 %0, 34
%3 = icmp eq i32 %0, 39
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  int i;
  for (i = 0; i < 10; ++i) {
    puts("Hello world!");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    114a <main+0x3a>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ b1_reset(unsigned int);
int /*<<< orphan*/ t1outp(unsigned int, int, int);
void t1_reset(unsigned int base) {
  b1_reset(base);
  t1outp(base, 0x02, 0x00);
  t1outp(base, 0x03, 0x00);
  t1outp(base, 0x12, 0x00);
  t1outp(base, 0x1f, 0xf);
}


x86 assembly (clang, -O0):
<t1_reset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <b1_reset@plt>
mov    -0x4(%rbp),%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <t1outp@plt>
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <t1outp@plt>
mov    -0x4(%rbp),%edi
mov    $0x12,%esi
xor    %edx,%edx
call   1040 <t1outp@plt>
mov    -0x4(%rbp),%edi
mov    $0x1f,%esi
mov    $0xf,%edx
call   1040 <t1outp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_reset>:
push   %rbx
mov    %edi,%ebx
call   1030 <b1_reset@plt>
mov    %ebx,%edi
mov    $0x2,%esi
xor    %edx,%edx
call   1040 <t1outp@plt>
mov    %ebx,%edi
mov    $0x3,%esi
xor    %edx,%edx
call   1040 <t1outp@plt>
mov    %ebx,%edi
mov    $0x12,%esi
xor    %edx,%edx
call   1040 <t1outp@plt>
mov    %ebx,%edi
mov    $0x1f,%esi
mov    $0xf,%edx
pop    %rbx
jmp    1040 <t1outp@plt>

LLVM IR (-O0):
define void @t1_reset(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @b1_reset(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @t1outp(i32 %5, i32 2, i32 0)
%7 = load i32, i32* %2
%8 = call i32 @t1outp(i32 %7, i32 3, i32 0)
%9 = load i32, i32* %2
%10 = call i32 @t1outp(i32 %9, i32 18, i32 0)
%11 = load i32, i32* %2
%12 = call i32 @t1outp(i32 %11, i32 31, i32 15)
ret void
}

LLVM IR (-O2):
define void @t1_reset(i32 %0) {
%2 = tail call i32 @b1_reset(i32 %0)
%3 = tail call i32 @t1outp(i32 %0, i32 2, i32 0)
%4 = tail call i32 @t1outp(i32 %0, i32 3, i32 0)
%5 = tail call i32 @t1outp(i32 %0, i32 18, i32 0)
%6 = tail call i32 @t1outp(i32 %0, i32 31, i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *);
int /*<<< orphan*/ stderr;
void finish_output_buffer(void *context, void *acquired_handle) {
  ((void)(context));
  fprintf(stderr, "finished output buffer, handle %p", acquired_handle);
}


x86 assembly (clang, -O0):
<finish_output_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish_output_buffer>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"finished output buffer, handle %p\00"
define void @finish_output_buffer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"finished output buffer, handle %p\00"
define void @finish_output_buffer(i8* nocapture readnone %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main();
void main2(void) { main(); }


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <main@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main2() {
%1 = call i32 (...) @main()
ret void
}

LLVM IR (-O2):
define void @main2() {
%1 = tail call i32 (...) @main()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int now_usec();
int vrrp_timer_fires(uint32_t value, uint32_t upbound) {
  int delta = value - now_usec();
  if (0 > delta || delta > upbound)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<vrrp_timer_fires>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <now_usec@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%eax
jg     114c <vrrp_timer_fires+0x3c>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1158 <vrrp_timer_fires+0x48>
movl   $0x1,-0x4(%rbp)
jmp    115f <vrrp_timer_fires+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrrp_timer_fires>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <now_usec@plt>
sub    %eax,%ebp
sets   %al
cmp    %ebx,%ebp
setg   %cl
or     %al,%cl
movzbl %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @vrrp_timer_fires(i32 %0, i32 %1) {
%3 = tail call i32 (...) @now_usec()
%4 = sub nsw i32 %0, %3
%5 = icmp slt i32 %4, 0
%6 = icmp sgt i32 %4, %1
%7 = or i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int bar(int);
int foo(int);
int main() { return foo(11) - 67 + bar(19) - 68; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xb,%edi
call   1040 <foo@plt>
sub    $0x43,%eax
mov    %eax,-0x8(%rbp)
mov    $0x13,%edi
call   1030 <bar@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
sub    $0x44,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xb,%edi
call   1040 <foo@plt>
mov    %eax,%ebx
mov    $0x13,%edi
call   1030 <bar@plt>
add    %ebx,%eax
add    $0xffffff79,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 11)
%3 = sub nsw i32 %2, 67
%4 = call i32 @bar(i32 19)
%5 = add nsw i32 %3, %4
%6 = sub nsw i32 %5, 68
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 11)
%2 = tail call i32 @bar(i32 19)
%3 = add i32 %1, -135
%4 = add i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ clock_init();
int /*<<< orphan*/ key_init();
int /*<<< orphan*/ mmu_init();
int /*<<< orphan*/ timer_init();
int /*<<< orphan*/ uart_init();
void board_init(void) {
  clock_init();
  uart_init();
  key_init();
  timer_init();
  mmu_init();
}


x86 assembly (clang, -O0):
<board_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <clock_init@plt>
mov    $0x0,%al
call   1040 <uart_init@plt>
mov    $0x0,%al
call   1030 <key_init@plt>
mov    $0x0,%al
call   1050 <timer_init@plt>
mov    $0x0,%al
call   1070 <mmu_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_init>:
push   %rax
xor    %eax,%eax
call   1060 <clock_init@plt>
xor    %eax,%eax
call   1040 <uart_init@plt>
xor    %eax,%eax
call   1030 <key_init@plt>
xor    %eax,%eax
call   1050 <timer_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <mmu_init@plt>

LLVM IR (-O0):
define void @board_init() {
%1 = call i32 (...) @clock_init()
%2 = call i32 (...) @uart_init()
%3 = call i32 (...) @key_init()
%4 = call i32 (...) @timer_init()
%5 = call i32 (...) @mmu_init()
ret void
}

LLVM IR (-O2):
define void @board_init() {
%1 = tail call i32 (...) @clock_init()
%2 = tail call i32 (...) @uart_init()
%3 = tail call i32 (...) @key_init()
%4 = tail call i32 (...) @timer_init()
%5 = tail call i32 (...) @mmu_init()
ret void
}
int is_digit(char cc) { return (cc <= '9') && (cc >= '0'); }


x86 assembly (clang, -O0):
<is_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jg     1129 <is_digit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
setge  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_digit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @is_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;

/* Variables and functions */
long SSL_CTX_set_options(int /*<<< orphan*/ *, long);
long SSL_CTX_set_session_cache_mode(int /*<<< orphan*/ *, long);
long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg) {
  switch (cmd) {
  case 32: {
    return SSL_CTX_set_options(ctx, larg);
  }
  case 44: {
    return SSL_CTX_set_session_cache_mode(ctx, larg);
  }
  default:
    break;
  }
  return -1;
}


x86 assembly (clang, -O0):
<SSL_CTX_ctrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x20,%eax
je     115c <SSL_CTX_ctrl+0x3c>
jmp    114b <SSL_CTX_ctrl+0x2b>
mov    -0x2c(%rbp),%eax
sub    $0x2c,%eax
je     1172 <SSL_CTX_ctrl+0x52>
jmp    1188 <SSL_CTX_ctrl+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <SSL_CTX_set_options@plt>
mov    %rax,-0x8(%rbp)
jmp    1195 <SSL_CTX_ctrl+0x75>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <SSL_CTX_set_session_cache_mode@plt>
mov    %rax,-0x8(%rbp)
jmp    1195 <SSL_CTX_ctrl+0x75>
jmp    118d <SSL_CTX_ctrl+0x6d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SSL_CTX_ctrl>:
cmp    $0x2c,%esi
je     1132 <SSL_CTX_ctrl+0x12>
cmp    $0x20,%esi
jne    113a <SSL_CTX_ctrl+0x1a>
mov    %rdx,%rsi
jmp    1030 <SSL_CTX_set_options@plt>
mov    %rdx,%rsi
jmp    1040 <SSL_CTX_set_session_cache_mode@plt>
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @SSL_CTX_ctrl(i32* %0, i32 %1, i64 %2, i8* %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i8*
store i32* %0, i32** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
%10 = load i32, i32* %7
switch i32 %10, label %19 [
i32 32, label %11
i32 44, label %15
]
11: ; preds = %4
%12 = load i32*, i32** %6
%13 = load i64, i64* %8
%14 = call i64 @SSL_CTX_set_options(i32* %12, i64 %13)
store i64 %14, i64* %5
br label %21
15: ; preds = %4
%16 = load i32*, i32** %6
%17 = load i64, i64* %8
%18 = call i64 @SSL_CTX_set_session_cache_mode(i32* %16, i64 %17)
store i64 %18, i64* %5
br label %21
19: ; preds = %4
br label %20
20: ; preds = %19
store i64 -1, i64* %5
br label %21
21: ; preds = %20, %15, %11
%22 = load i64, i64* %5
ret i64 %22
}

LLVM IR (-O2):
define i64 @SSL_CTX_ctrl(i32* %0, i32 %1, i64 %2, i8* nocapture readnone %3) {
switch i32 %1, label %9 [
i32 32, label %5
i32 44, label %7
]
5: ; preds = %4
%6 = tail call i64 @SSL_CTX_set_options(i32* %0, i64 %2)
br label %9
7: ; preds = %4
%8 = tail call i64 @SSL_CTX_set_session_cache_mode(i32* %0, i64 %2)
br label %9
9: ; preds = %4, %7, %5
%10 = phi i64 [ %8, %7 ], [ %6, %5 ], [ -1, %4 ]
ret i64 %10
}
void glutReshapeFunc(void (*func)(int width, int height)) {}


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

x86 assembly (clang, -O2):
<glutReshapeFunc>:
ret

LLVM IR (-O0):
define void @glutReshapeFunc(void (i32, i32)* %0) {
%2 = alloca void (i32, i32)*
store void (i32, i32)* %0, void (i32, i32)** %2
ret void
}

LLVM IR (-O2):
define void @glutReshapeFunc(void (i32, i32)* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
unsigned int hweight32_hakmem(uint32_t a) {
  uint32_t t;
  t = a - ((a >> 1) & 033333333333) - ((a >> 2) & 011111111111);
  return ((t + (t >> 3)) & 030707070707) % 63;
}


x86 assembly (clang, -O0):
<hweight32_hakmem>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
and    $0xdb6db6db,%ecx
sub    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x2,%ecx
and    $0x49249249,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x3,%ecx
add    %ecx,%eax
and    $0xc71c71c7,%eax
mov    $0x3f,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight32_hakmem>:
mov    %edi,%eax
sar    %eax
and    $0xdb6db6db,%eax
mov    %edi,%ecx
sar    $0x2,%ecx
and    $0x49249249,%ecx
add    %eax,%ecx
sub    %ecx,%edi
mov    %edi,%ecx
sar    $0x3,%ecx
add    %edi,%ecx
and    $0xc71c71c7,%ecx
imul   $0x4104105,%rcx,%rdx
shr    $0x20,%rdx
mov    %ecx,%eax
sub    %edx,%eax
shr    %eax
add    %edx,%eax
shr    $0x5,%eax
mov    %eax,%edx
shl    $0x6,%edx
sub    %edx,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight32_hakmem(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = and i32 %6, -613566757
%8 = sub i32 %4, %7
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = and i32 %10, 1227133513
%12 = sub i32 %8, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = ashr i32 %14, 3
%16 = add nsw i32 %13, %15
%17 = and i32 %16, -954437177
%18 = urem i32 %17, 63
ret i32 %18
}

LLVM IR (-O2):
define i32 @hweight32_hakmem(i32 %0) {
%2 = ashr i32 %0, 1
%3 = and i32 %2, -613566757
%4 = ashr i32 %0, 2
%5 = and i32 %4, 1227133513
%6 = add i32 %5, %3
%7 = sub i32 %0, %6
%8 = ashr i32 %7, 3
%9 = add nsw i32 %8, %7
%10 = and i32 %9, -954437177
%11 = urem i32 %10, 63
ret i32 %11
}