xunge/DecIR huggingface dataset:
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int GetTimerTicks(void) {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return (tv.tv_sec & 0xffffff) * 18.2 + tv.tv_usec * 18.2 / 1000000;
}


x86 assembly (clang, -O0):
<GetTimerTicks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
and    $0xffffff,%eax
cvtsi2sd %eax,%xmm0
movsd  0xec7(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xec2(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xeae(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTimerTicks>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
mov    $0xffffff,%eax
and    0x8(%rsp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeca(%rip),%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm1,%xmm2
divsd  0xec0(%rip),%xmm2
mulsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
cvttsd2si %xmm0,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, double }
%struct.timezone = type { i32 }
define i32 @GetTimerTicks() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = and i32 %5, 16777215
%7 = sitofp i32 %6 to double
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%9 = load double, double* %8
%10 = fmul double %9, 1.820000e+01
%11 = fdiv double %10, 1.000000e+06
%12 = call double @llvm.fmuladd.f64(double %7, double 1.820000e+01, double %11)
%13 = fptosi double %12 to i32
ret i32 %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, double }
%struct.timezone = type { i32 }
define i32 @GetTimerTicks() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, 16777215
%9 = sitofp i32 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load double, double* %10
%12 = fmul double %11, 1.820000e+01
%13 = fdiv double %12, 1.000000e+06
%14 = tail call double @llvm.fmuladd.f64(double %9, double 1.820000e+01, double %13)
%15 = fptosi double %14 to i32
ret i32 %15
}
int addDigits(int num) {
  if (num < 10) {
    return num;
  }
  int sum = 0;
  while (num > 0) {
    sum += num % 10;
    num = num / 10;
  }
  return addDigits(sum);
}


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1130 <addDigits+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <addDigits+0x60>
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1165 <addDigits+0x55>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0xc(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    1137 <addDigits+0x27>
mov    -0xc(%rbp),%edi
call   1030 <addDigits@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
cmp    $0xa,%edi
jge    1109 <addDigits+0x9>
mov    %edi,%eax
jmp    114d <addDigits+0x4d>
xor    %edx,%edx
mov    $0xcccccccd,%r8d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edi,%esi
imul   %r8,%rsi
shr    $0x23,%rsi
lea    (%rsi,%rsi,1),%eax
lea    (%rax,%rax,4),%eax
mov    %edi,%ecx
sub    %eax,%ecx
mov    %edx,%eax
add    %ecx,%eax
mov    %eax,%edx
cmp    $0xa,%edi
mov    %esi,%edi
jae    1120 <addDigits+0x20>
mov    $0x0,%edx
mov    %eax,%edi
cmp    $0xa,%eax
jae    1120 <addDigits+0x20>
ret

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

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %15, label %5
3: ; preds = %5
%4 = icmp ult i32 %9, 10
br i1 %4, label %15, label %12
5: ; preds = %1, %12
%6 = phi i32 [ %13, %12 ], [ 0, %1 ]
%7 = phi i32 [ %14, %12 ], [ %0, %1 ]
%8 = urem i32 %7, 10
%9 = add nuw nsw i32 %6, %8
%10 = udiv i32 %7, 10
%11 = icmp ult i32 %7, 10
br i1 %11, label %3, label %12
12: ; preds = %5, %3
%13 = phi i32 [ %9, %5 ], [ 0, %3 ]
%14 = phi i32 [ %10, %5 ], [ %9, %3 ]
br label %5
15: ; preds = %3, %1
%16 = phi i32 [ %0, %1 ], [ %9, %3 ]
ret i32 %16
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *);
void teclaEnter() {
  getchar();
  do {
    printf("Pressione <ENTER> para continuar");
  } while (10 != getchar());
}


x86 assembly (clang, -O0):
<teclaEnter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
jne    112b <teclaEnter+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<teclaEnter>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xed1(%rip),%rbx
nop
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
jne    1130 <teclaEnter+0x10>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Pressione <ENTER> para continuar\00"
define void @teclaEnter() {
%1 = call i32 (...) @getchar()
br label %2
2: ; preds = %4, %0
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %2
%5 = call i32 (...) @getchar()
%6 = icmp ne i32 10, %5
br i1 %6, label %2, label %7
7: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Pressione <ENTER> para continuar\00"
define void @teclaEnter() {
%1 = tail call i32 (...) @getchar()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
double aa_fdeadzone(double val, double min, double max, double deadval) {
  if (min < val && max > val)
    return deadval;
  else
    return val;
}


x86 assembly (clang, -O0):
<aa_fdeadzone>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114b <aa_fdeadzone+0x4b>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    114b <aa_fdeadzone+0x4b>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1155 <aa_fdeadzone+0x55>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_fdeadzone>:
movapd %xmm0,%xmm4
cmpltsd %xmm2,%xmm4
andpd  %xmm4,%xmm3
andnpd %xmm0,%xmm4
orpd   %xmm3,%xmm4
cmpltsd %xmm0,%xmm1
andpd  %xmm1,%xmm4
andnpd %xmm0,%xmm1
orpd   %xmm1,%xmm4
movapd %xmm4,%xmm0
ret

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

LLVM IR (-O2):
define double @aa_fdeadzone(double %0, double %1, double %2, double %3) {
%5 = fcmp olt double %1, %0
%6 = fcmp ogt double %2, %0
%7 = and i1 %5, %6
%8 = select i1 %7, double %3, double %0
ret double %8
}
void heap_run_gc(void) {}


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

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

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

LLVM IR (-O2):
define void @heap_run_gc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("-mtune=native -DHAVE_IEEE_754 -DBSD -DSIZEOF_VOID_P=8 "
         "-DSIZEOF_LONG=8 -DCUDD_COMPILER_OPTIONS_SET\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [99 x i8] c"-mtune=native -DHAVE_IEEE_754 -DBSD -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DCUDD_COMPILER_OPTIONS_SET\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [98 x i8] c"-mtune=native -DHAVE_IEEE_754 -DBSD -DSIZEOF_VOID_P=8 -DSIZEOF_LONG=8 -DCUDD_COMPILER_OPTIONS_SET\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *U_WMRCORENONE_set(char *);
char *U_WMR63_set(void) { return U_WMRCORENONE_set("U_WMR63"); }


x86 assembly (clang, -O0):
<U_WMR63_set>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <U_WMRCORENONE_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_WMR63_set>:
lea    0xee9(%rip),%rdi
jmp    1030 <U_WMRCORENONE_set@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"U_WMR63\00"
define i8* @U_WMR63_set() {
%1 = call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [8 x i8] c"U_WMR63\00"
define i8* @U_WMR63_set() {
%1 = tail call i8* @U_WMRCORENONE_set(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ st7036_clear();
void lcd_clear(void) { st7036_clear(); }


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

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

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

LLVM IR (-O2):
define void @lcd_clear() {
%1 = tail call i32 (...) @st7036_clear()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int usage(void) {
  (void)fprintf(
      stderr, "usage: cmp [-l | -s | -x] [-hz] file1 file2 [skip1 [skip2]]\n");
  return 2;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [61 x i8] c"usage: cmp [-l | -s | -x] [-hz] file1 file2 [skip1 [skip2]]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [61 x i8] c"usage: cmp [-l | -s | -x] [-hz] file1 file2 [skip1 [skip2]]\0A\00"
define i32 @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 2
}
void DebugBreak() {}


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

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

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

LLVM IR (-O2):
define void @DebugBreak() {
ret void
}
/* Variables and functions */
long foo(long, long, void *);
long bar(long x, long y, long z) { return foo(x, y, (void *)z); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i64 @bar(i64 %0, i64 %1, i64 %2) {
%4 = inttoptr i64 %2 to i8*
%5 = tail call i64 @foo(i64 %0, i64 %1, i8* %4)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0x1b() {
  Assert_real((islower(27) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              140, ("islower should be 0 for 0x1b"));
}


x86 assembly (clang, -O0):
<t_islower_0x1b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x8c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0x1b>:
push   %rax
mov    $0x1b,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x8c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x1b\00"
define void @t_islower_0x1b() {
%1 = call i64 @islower(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0x1b\00"
define void @t_islower_0x1b() {
%1 = tail call i64 @islower(i32 27)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void g_param_spec_pool_list_owned() {}


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

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

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

LLVM IR (-O2):
define void @g_param_spec_pool_list_owned() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int sqlite3_column_int(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_prepare_v2(int /*<<< orphan*/ *, char const *, int,
                                      int /*<<< orphan*/ **,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ sqlite3_step(int /*<<< orphan*/ *);
long db_retrieval(sqlite3 *db, const char *sql) {
  sqlite3_stmt *stmt;
  sqlite3_prepare_v2(db, sql, -1, &stmt, NULL);
  sqlite3_step(stmt);
  int value = sqlite3_column_int(stmt, 0);
  sqlite3_finalize(stmt);
  return value;
}


x86 assembly (clang, -O0):
<db_retrieval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0xffffffff,%edx
lea    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1060 <sqlite3_prepare_v2@plt>
mov    -0x18(%rbp),%rdi
call   1040 <sqlite3_step@plt>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
call   1030 <sqlite3_column_int@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <sqlite3_finalize@plt>
movslq -0x1c(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_retrieval>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rcx
mov    $0xffffffff,%edx
xor    %r8d,%r8d
call   1060 <sqlite3_prepare_v2@plt>
mov    0x8(%rsp),%rdi
call   1040 <sqlite3_step@plt>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <sqlite3_column_int@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1050 <sqlite3_finalize@plt>
movslq %ebx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i64 @db_retrieval(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i32 @sqlite3_prepare_v2(i32* %7, i8* %8, i32 -1, i32** %5, i32* null)
%10 = load i32*, i32** %5
%11 = call i32 @sqlite3_step(i32* %10)
%12 = load i32*, i32** %5
%13 = call i32 @sqlite3_column_int(i32* %12, i32 0)
store i32 %13, i32* %6
%14 = load i32*, i32** %5
%15 = call i32 @sqlite3_finalize(i32* %14)
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
ret i64 %17
}

LLVM IR (-O2):
define i64 @db_retrieval(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = bitcast i32** %3 to i8*
%5 = call i32 @sqlite3_prepare_v2(i32* %0, i8* %1, i32 -1, i32** %3, i32* null)
%6 = load i32*, i32** %3
%7 = call i32 @sqlite3_step(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @sqlite3_column_int(i32* %8, i32 0)
%10 = load i32*, i32** %3
%11 = call i32 @sqlite3_finalize(i32* %10)
%12 = sext i32 %9 to i64
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ func_a();
int /*<<< orphan*/ printf(char *);
int func_b() {
  printf("func b\n");
  func_a();
  return 0;
}


x86 assembly (clang, -O0):
<func_b>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <func_a@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_b>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <func_a@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"func b\0A\00"
define i32 @func_b() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @func_a()
ret i32 0
}

LLVM IR (-O2):
@str = [7 x i8] c"func b\00"
define i32 @func_b() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @func_a()
ret i32 0
}
int bcm_2708_power_on() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @bcm_2708_power_on() {
ret i32 -1
}
/* Variables and functions */
int chmod(char *, int);
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
int main() {
  int rc;
  rc = chmod("file.txt", 0777);
  if (rc == -1) {
    fprintf(stderr, "chmod failed, errno = %d\n", errno);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x1ff,%esi
call   1040 <chmod@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    116b <main+0x4b>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x1ff,%esi
call   1040 <chmod@plt>
cmp    $0xffffffff,%eax
jne    1155 <main+0x35>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    0x2e91(%rip),%rax
mov    (%rax),%edx
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"file.txt\00"
@stderr = global i32 0
@.str.1 = [26 x i8] c"chmod failed, errno = %d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @chmod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 511)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"file.txt\00"
@stderr = global i32 0
@.str.1 = [26 x i8] c"chmod failed, errno = %d\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = tail call i32 @chmod(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 511)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = load i32, i32* @errno
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_configure_baud_rate(int, int);
int /*<<< orphan*/ serial_configure_fifo(int);
int /*<<< orphan*/ serial_configure_line(int);
int /*<<< orphan*/ serial_configure_modem(int);
void serial_init() {
  serial_configure_baud_rate(0x3F8, 1);
  serial_configure_line(0x3F8);
  serial_configure_fifo(0x3F8);
  serial_configure_modem(0x3F8);
}


x86 assembly (clang, -O0):
<serial_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f8,%edi
mov    $0x1,%esi
call   1050 <serial_configure_baud_rate@plt>
mov    $0x3f8,%edi
call   1040 <serial_configure_line@plt>
mov    $0x3f8,%edi
call   1060 <serial_configure_fifo@plt>
mov    $0x3f8,%edi
call   1030 <serial_configure_modem@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_init>:
push   %rax
mov    $0x3f8,%edi
mov    $0x1,%esi
call   1050 <serial_configure_baud_rate@plt>
mov    $0x3f8,%edi
call   1040 <serial_configure_line@plt>
mov    $0x3f8,%edi
call   1060 <serial_configure_fifo@plt>
mov    $0x3f8,%edi
pop    %rax
jmp    1030 <serial_configure_modem@plt>

LLVM IR (-O0):
define void @serial_init() {
%1 = call i32 @serial_configure_baud_rate(i32 1016, i32 1)
%2 = call i32 @serial_configure_line(i32 1016)
%3 = call i32 @serial_configure_fifo(i32 1016)
%4 = call i32 @serial_configure_modem(i32 1016)
ret void
}

LLVM IR (-O2):
define void @serial_init() {
%1 = tail call i32 @serial_configure_baud_rate(i32 1016, i32 1)
%2 = tail call i32 @serial_configure_line(i32 1016)
%3 = tail call i32 @serial_configure_fifo(i32 1016)
%4 = tail call i32 @serial_configure_modem(i32 1016)
ret void
}
char *info_HCSR04() {
  return "HCSR04 - Ultrasonic Sensor Information\nOperating Voltage: 5V DC "
         "\nOperating Current: 15mA \nMeasure Angle: 15°\nRanging Distance: "
         "2cm - 4m\nVCC (Power), Trig (Trigger), Echo (Receive), GND (Ground).";
}


x86 assembly (clang, -O0):
<info_HCSR04>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_HCSR04>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [196 x i8] c"HCSR04 - Ultrasonic Sensor Information\0AOperating Voltage: 5V DC \0AOperating Current: 15mA \0AMeasure Angle: 15\C2\B0\0ARanging Distance: 2cm - 4m\0AVCC (Power), Trig (Trigger), Echo (Receive), GND (Ground).\00"
define i8* @info_HCSR04() {
ret i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [196 x i8] c"HCSR04 - Ultrasonic Sensor Information\0AOperating Voltage: 5V DC \0AOperating Current: 15mA \0AMeasure Angle: 15\C2\B0\0ARanging Distance: 2cm - 4m\0AVCC (Power), Trig (Trigger), Echo (Receive), GND (Ground).\00"
define i8* @info_HCSR04() {
ret i8* getelementptr inbounds ([196 x i8], [196 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ esc_prn(char *, char *);
int help_shut(int argc, char **argv) {
  esc_prn("\n{H%s}, shutdown the process (only in daemon mode)\n", argv[0]);
  return 1;
}


x86 assembly (clang, -O0):
<help_shut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed3(%rip),%rdi
call   1030 <esc_prn@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help_shut>:
push   %rax
mov    (%rsi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <esc_prn@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"\0A{H%s}, shutdown the process (only in daemon mode)\0A\00"
define i32 @help_shut(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @esc_prn(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %7)
ret i32 1
}

LLVM IR (-O2):
@.str = [52 x i8] c"\0A{H%s}, shutdown the process (only in daemon mode)\0A\00"
define i32 @help_shut(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @esc_prn(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}
void mistura(semente, buffer) unsigned char *semente;
unsigned char *buffer;
{
  while (*semente) {
    *semente += *buffer - '0';
    if (*semente > '9')
      *semente -= 10;
    ++semente;
    ++buffer;
  }
}


x86 assembly (clang, -O0):
<mistura>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <mistura+0x67>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edx
sub    $0x30,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x39,%eax
jle    114a <mistura+0x4a>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
sub    $0xa,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <mistura+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mistura>:
mov    (%rdi),%cl
test   %cl,%cl
je     1135 <mistura+0x35>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    (%rsi,%rax,1),%cl
lea    -0x30(%rcx),%edx
add    $0xc6,%cl
cmp    $0x3a,%dl
movzbl %cl,%ecx
movzbl %dl,%edx
cmovae %ecx,%edx
mov    %dl,(%rdi,%rax,1)
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <mistura+0x10>
ret

LLVM IR (-O0):
define void @mistura(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %29, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %34
9: ; preds = %5
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = add nsw i32 %16, %13
%18 = trunc i32 %17 to i8
store i8 %18, i8* %14
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = icmp sgt i32 %21, 57
br i1 %22, label %23, label %29
23: ; preds = %9
%24 = load i8*, i8** %3
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = sub nsw i32 %26, 10
%28 = trunc i32 %27 to i8
store i8 %28, i8* %24
br label %29
29: ; preds = %23, %9
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %3
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %4
br label %5
34: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @mistura(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %17, %5 ], [ %3, %2 ]
%7 = phi i8* [ %16, %5 ], [ %1, %2 ]
%8 = phi i8* [ %15, %5 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = add i8 %6, -48
%11 = add i8 %10, %9
%12 = icmp ugt i8 %11, 57
%13 = add i8 %11, -10
%14 = select i1 %12, i8 %13, i8 %11
store i8 %14, i8* %8
%15 = getelementptr inbounds i8, i8* %8, i64 1
%16 = getelementptr inbounds i8, i8* %7, i64 1
%17 = load i8, i8* %15
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ copro_opc6_write_io(int /*<<< orphan*/, int /*<<< orphan*/);
void dbg_iowrite(uint32_t addr, uint32_t value) {
  copro_opc6_write_io(addr, value);
}


x86 assembly (clang, -O0):
<dbg_iowrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <copro_opc6_write_io@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_iowrite>:
jmp    1030 <copro_opc6_write_io@plt>

LLVM IR (-O0):
define void @dbg_iowrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @copro_opc6_write_io(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @dbg_iowrite(i32 %0, i32 %1) {
%3 = tail call i32 @copro_opc6_write_io(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int open(char *, int /*<<< orphan*/);
int init_console() { return open("/dev/console", 0); }


x86 assembly (clang, -O0):
<init_console>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_console>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"/dev/console\00"
define i32 @init_console() {
%1 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %1
}

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/console\00"
define i32 @init_console() {
%1 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %1
}
void main() {
  int a;
  a = _return_ab(2, 4);
  printf(a);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
mov    $0x4,%esi
mov    $0x0,%al
call   1040 <_return_ab@plt>
mov    %eax,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <_return_ab@plt>
movslq %eax,%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = call i32 (i32, i32, ...) bitcast (i32 (...)* @_return_ab to i32 (i32, i32, ...)*)(i32 2, i32 4)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i8*
%6 = call i32 (i8*, ...) @printf(i8* %5)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @_return_ab to i32 (i32, i32, ...)*)(i32 2, i32 4)
%2 = sext i32 %1 to i64
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %3)
ret void
}
int number_puncts(int punct_result, int current_number_puncts) {
  if (punct_result == 9) {
    current_number_puncts++;
  }
  return current_number_puncts;
}


x86 assembly (clang, -O0):
<number_puncts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x9,-0x4(%rbp)
jne    111d <number_puncts+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_puncts>:
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
add    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @number_puncts(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 9
%4 = zext i1 %3 to i32
%5 = add nsw i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int x = 20, y = 30;
  if ((x == 20) && (y == 30)) {
    printf("value of x is 20, and value of y is 30.");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
movl   $0x1e,-0xc(%rbp)
cmpl   $0x14,-0x8(%rbp)
jne    114d <main+0x3d>
cmpl   $0x1e,-0xc(%rbp)
jne    114d <main+0x3d>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [40 x i8] c"value of x is 20, and value of y is 30.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
store i32 30, i32* %3
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 20
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 30
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6, %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [40 x i8] c"value of x is 20, and value of y is 30.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int new_event(int);
int recv_msg(int fd) { return new_event(fd); }


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

x86 assembly (clang, -O2):
<recv_msg>:
jmp    1030 <new_event@plt>

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

LLVM IR (-O2):
define i32 @recv_msg(i32 %0) {
%2 = tail call i32 @new_event(i32 %0)
ret i32 %2
}
unsigned short add_shorts(short one, short two) { return one + two; }


x86 assembly (clang, -O0):
<add_shorts>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
add    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_shorts>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define zeroext i16 @add_shorts(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = add nsw i32 %6, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @add_shorts(i16 signext %0, i16 signext %1) {
%3 = add i16 %1, %0
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_channel_args_destroy() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_channel_args_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_channel_args_destroy>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_args_destroy() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_channel_args_destroy() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int RB_DISABLE_CAD;
int RB_ENABLE_CAD;
int /*<<< orphan*/ reboot(int);
int main() {
  reboot(RB_ENABLE_CAD);
  reboot(RB_DISABLE_CAD);
  reboot(-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
mov    $0xffffffff,%edi
call   1030 <reboot@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <reboot@plt>
mov    $0xffffffff,%edi
call   1030 <reboot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@RB_ENABLE_CAD = global i32 0
@RB_DISABLE_CAD = global i32 0
define i32 @main() {
%1 = load i32, i32* @RB_ENABLE_CAD
%2 = call i32 @reboot(i32 %1)
%3 = load i32, i32* @RB_DISABLE_CAD
%4 = call i32 @reboot(i32 %3)
%5 = call i32 @reboot(i32 -1)
ret i32 0
}

LLVM IR (-O2):
@RB_ENABLE_CAD = global i32 0
@RB_DISABLE_CAD = global i32 0
define i32 @main() {
%1 = load i32, i32* @RB_ENABLE_CAD
%2 = tail call i32 @reboot(i32 %1)
%3 = load i32, i32* @RB_DISABLE_CAD
%4 = tail call i32 @reboot(i32 %3)
%5 = tail call i32 @reboot(i32 -1)
ret i32 0
}
int in_area(const void *buf, const void *start, const void *end) {
  return buf >= start && buf <= end;
}


x86 assembly (clang, -O0):
<in_area>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jb     1131 <in_area+0x31>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setbe  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in_area>:
cmp    %rsi,%rdi
setae  %al
cmp    %rdx,%rdi
setbe  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @in_area(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp uge i8* %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i8*, i8** %4
%12 = load i8*, i8** %6
%13 = icmp ule i8* %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @in_area(i8* readnone %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp uge i8* %0, %1
%5 = icmp ule i8* %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
struct sockaddr_in {
  int /*<<< orphan*/ sin_addr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET6;
int /*<<< orphan*/ inet_pton(int /*<<< orphan*/, char *, int /*<<< orphan*/ *);
void appendIpv4(char *ip4Addr, char *ip4Mask, char *tmpStr) {
  static struct sockaddr_in sockaddrtemp;
  inet_pton(AF_INET6, ip4Addr, &sockaddrtemp.sin_addr);
}


x86 assembly (clang, -O0):
<appendIpv4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    0x2ef4(%rip),%rdx
call   1030 <inet_pton@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appendIpv4>:
mov    %rdi,%rsi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
lea    0x2f09(%rip),%rdx
jmp    1030 <inet_pton@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@appendIpv4.sockaddrtemp = internal global %struct.sockaddr_in zeroinitializer
@AF_INET6 = global i32 0
define void @appendIpv4(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @AF_INET6
%8 = load i8*, i8** %4
%9 = call i32 @inet_pton(i32 %7, i8* %8, i32* getelementptr inbounds (%struct.sockaddr_in, %struct.sockaddr_in* @appendIpv4.sockaddrtemp, i32 0, i32 0))
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@appendIpv4.sockaddrtemp = internal global %struct.sockaddr_in zeroinitializer
@AF_INET6 = global i32 0
define void @appendIpv4(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = load i32, i32* @AF_INET6
%5 = tail call i32 @inet_pton(i32 %4, i8* %0, i32* getelementptr inbounds (%struct.sockaddr_in, %struct.sockaddr_in* @appendIpv4.sockaddrtemp, i64 0, i32 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fg(long long, int);
void ff(int y, long long z) { fg(z, 1); }


x86 assembly (clang, -O0):
<ff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <fg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ff>:
mov    %rsi,%rdi
mov    $0x1,%esi
jmp    1030 <fg@plt>

LLVM IR (-O0):
define void @ff(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i32 @fg(i64 %5, i32 1)
ret void
}

LLVM IR (-O2):
define void @ff(i32 %0, i64 %1) {
%3 = tail call i32 @fg(i64 %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo() { printf("Exiting!\n"); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [9 x i8] c"Exiting!\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int x44_process_synack(struct mypacket *packet) { return 0; }


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

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

LLVM IR (-O0):
%struct.mypacket = type opaque
define i32 @x44_process_synack(%struct.mypacket* %0) {
%2 = alloca %struct.mypacket*
store %struct.mypacket* %0, %struct.mypacket** %2
ret i32 0
}

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x44_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
void my_suite_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @my_suite_setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int isatty(int /*<<< orphan*/);
int unix_is_interactive(void) { return (isatty(STDIN_FILENO) == 1); }


x86 assembly (clang, -O0):
<unix_is_interactive>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <isatty@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_is_interactive>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <isatty@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define i32 @unix_is_interactive() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @isatty(i32 %1)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define i32 @unix_is_interactive() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @isatty(i32 %1)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
ret i32 %4
}
int NextP2(int a) {
  int rval = 1;
  while (rval < a)
    rval <<= 1;
  return rval;
}


x86 assembly (clang, -O0):
<NextP2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <NextP2+0x28>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <NextP2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextP2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jl     1110 <NextP2+0x10>
ret

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

LLVM IR (-O2):
define i32 @NextP2(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 1, %1 ], [ %5, %2 ]
%4 = icmp slt i32 %3, %0
%5 = shl i32 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i32 %3
}