xunge/DecIR huggingface dataset:
/* Variables and functions */
int _xdg_mime_mime_type_equal(char const *, char const *);
int /*<<< orphan*/ xdg_mime_init();
int xdg_mime_mime_type_equal(const char *mime_a, const char *mime_b) {
  xdg_mime_init();
  return _xdg_mime_mime_type_equal(mime_a, mime_b);
}


x86 assembly (clang, -O0):
<xdg_mime_mime_type_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <xdg_mime_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <_xdg_mime_mime_type_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdg_mime_mime_type_equal>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <xdg_mime_init@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <_xdg_mime_mime_type_equal@plt>

LLVM IR (-O0):
define i32 @xdg_mime_mime_type_equal(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @xdg_mime_init()
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @_xdg_mime_mime_type_equal(i8* %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @xdg_mime_mime_type_equal(i8* %0, i8* %1) {
%3 = tail call i32 (...) @xdg_mime_init()
%4 = tail call i32 @_xdg_mime_mime_type_equal(i8* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
double yp(double, double);
double ypp(double x, double y) { return (y + yp(x, y) * x + 1); }


x86 assembly (clang, -O0):
<ypp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <yp@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ypp>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <yp@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
addsd  0xec7(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @ypp(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = call double @yp(double %6, double %7)
%9 = load double, double* %3
%10 = call double @llvm.fmuladd.f64(double %8, double %9, double %5)
%11 = fadd double %10, 1.000000e+00
ret double %11
}

LLVM IR (-O2):
define double @ypp(double %0, double %1) {
%3 = tail call double @yp(double %0, double %1)
%4 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %1)
%5 = fadd double %4, 1.000000e+00
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ close_end(int /*<<< orphan*/);
int getch();
void check_input() {
  int c = 0;
  while (c != -1) {
    c = getch();
    if (c == 4 || c == 'q') {
      close_end(0);
    }
  }
}


x86 assembly (clang, -O0):
<check_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
je     1163 <check_input+0x43>
mov    $0x0,%al
call   1040 <getch@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
je     1157 <check_input+0x37>
cmpl   $0x71,-0x4(%rbp)
jne    115e <check_input+0x3e>
xor    %edi,%edi
call   1030 <close_end@plt>
jmp    112f <check_input+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_input>:
push   %rax
jmp    1137 <check_input+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
call   1030 <close_end@plt>
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0x4,%eax
je     1130 <check_input+0x10>
cmp    $0x71,%eax
je     1130 <check_input+0x10>
cmp    $0xffffffff,%eax
jne    1137 <check_input+0x17>
pop    %rax
ret

LLVM IR (-O0):
define void @check_input() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %14, %0
%3 = load i32, i32* %1
%4 = icmp ne i32 %3, -1
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = call i32 (...) @getch()
store i32 %6, i32* %1
%7 = load i32, i32* %1
%8 = icmp eq i32 %7, 4
br i1 %8, label %12, label %9
9: ; preds = %5
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 113
br i1 %11, label %12, label %14
12: ; preds = %9, %5
%13 = call i32 @close_end(i32 0)
br label %14
14: ; preds = %12, %9
br label %2
15: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @check_input() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getch()
switch i32 %2, label %5 [
i32 113, label %3
i32 4, label %3
i32 -1, label %6
]
3: ; preds = %1, %1
%4 = tail call i32 @close_end(i32 0)
br label %5
5: ; preds = %3, %1
br label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int fib();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[], char *envp[]) {
  int g3;
  int local0;
  printf("Input number: ");
  scanf("%d", &local0);
  g3 = fib();
  printf("fibonacci(%d) = %d\n", local0, g3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x0,%al
call   1050 <fib@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
call   1050 <fib@plt>
mov    0x4(%rsp),%esi
lea    0xeb0(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Input number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"fibonacci(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%12 = call i32 (...) @fib()
store i32 %12, i32* %8
%13 = load i32, i32* %9
%14 = load i32, i32* %8
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Input number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [20 x i8] c"fibonacci(%d) = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%8 = call i32 (...) @fib()
%9 = load i32, i32* %4
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %8)
ret i32 0
}
void gtk_menu_item_get_type() {}


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

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

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

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

/* Variables and functions */
int verify_callback(int i, X509_STORE_CTX *ctx) {
  (void)(i), (void)(ctx);
  return 1;
}


x86 assembly (clang, -O0):
<verify_callback>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @verify_callback(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
ret i32 1
}

LLVM IR (-O2):
define i32 @verify_callback(i32 %0, i32* nocapture readnone %1) {
ret i32 1
}
int min(int a, int b) { return (a < b ? a : b); }


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <min+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @min(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 = icmp slt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ FAPI_function0();
int /*<<< orphan*/ FAPI_function1();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigHandler(int signal) {
  printf("\n>> Kill signal detected, exiting program.\n\n");
  FAPI_function0();
  FAPI_function1();
  exit(0);
}


x86 assembly (clang, -O0):
<sigHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <FAPI_function0@plt>
mov    $0x0,%al
call   1060 <FAPI_function1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<sigHandler>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <FAPI_function0@plt>
xor    %eax,%eax
call   1060 <FAPI_function1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"\0A>> Kill signal detected, exiting program.\0A\0A\00"
define void @sigHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @FAPI_function0()
%5 = call i32 (...) @FAPI_function1()
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [44 x i8] c"\0A>> Kill signal detected, exiting program.\0A\00"
define void @sigHandler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @FAPI_function0()
%4 = tail call i32 (...) @FAPI_function1()
%5 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_A8uint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xA8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A8uint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 11010048
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_a();
int /*<<< orphan*/ do_b();
int /*<<< orphan*/ do_c();
scalar_t__ test_condition();
void test_dowhile() {
  do_a();
  do
    do_b();
  while (test_condition());
  do_c();
}


x86 assembly (clang, -O0):
<test_dowhile>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <do_a@plt>
mov    $0x0,%al
call   1040 <do_b@plt>
mov    $0x0,%al
call   1030 <test_condition@plt>
cmp    $0x0,%rax
jne    114b <test_dowhile+0xb>
mov    $0x0,%al
call   1060 <do_c@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dowhile>:
push   %rax
xor    %eax,%eax
call   1050 <do_a@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <do_b@plt>
xor    %eax,%eax
call   1030 <test_condition@plt>
test   %rax,%rax
jne    1150 <test_dowhile+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1060 <do_c@plt>

LLVM IR (-O0):
define void @test_dowhile() {
%1 = call i32 (...) @do_a()
br label %2
2: ; preds = %4, %0
%3 = call i32 (...) @do_b()
br label %4
4: ; preds = %2
%5 = call i64 (...) @test_condition()
%6 = icmp ne i64 %5, 0
br i1 %6, label %2, label %7
7: ; preds = %4
%8 = call i32 (...) @do_c()
ret void
}

LLVM IR (-O2):
define void @test_dowhile() {
%1 = tail call i32 (...) @do_a()
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @do_b()
%4 = tail call i64 (...) @test_condition()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 (...) @do_c()
ret void
}
int get_flash_params_count(void) { return 90; }


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

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

LLVM IR (-O0):
define i32 @get_flash_params_count() {
ret i32 90
}

LLVM IR (-O2):
define i32 @get_flash_params_count() {
ret i32 90
}
/* Variables and functions */
char toupper(char);
char digit_to_char(unsigned int digit, unsigned int use_uppercase) {
  const char lowercase_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
  char c;
  c = lowercase_digits[digit];
  if (use_uppercase)
    c = toupper(c);
  return c;
}


x86 assembly (clang, -O0):
<digit_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec7(%rip),%rsi
mov    $0x25,%edx
call   1040 <memcpy@plt>
mov    -0x4(%rbp),%eax
mov    -0x30(%rbp,%rax,1),%al
mov    %al,-0x31(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1163 <digit_to_char+0x43>
movsbl -0x31(%rbp),%edi
call   1030 <toupper@plt>
mov    %al,-0x31(%rbp)
movsbl -0x31(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit_to_char>:
mov    %edi,%eax
lea    0xee7(%rip),%rcx
mov    (%rax,%rcx,1),%al
test   %esi,%esi
je     1128 <digit_to_char+0x18>
movsbl %al,%edi
jmp    1030 <toupper@plt>
ret

LLVM IR (-O0):
@__const.digit_to_char.lowercase_digits = [37 x i8] c"0123456789abcdefghijklmnopqrstuvwxyz\00"
define signext i8 @digit_to_char(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [37 x i8]
%6 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = bitcast [37 x i8]* %5 to i8*
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [37 x i8], [37 x i8]* %5, i64 0, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %6
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i8, i8* %6
%16 = call signext i8 @toupper(i8 signext %15)
store i8 %16, i8* %6
br label %17
17: ; preds = %14, %2
%18 = load i8, i8* %6
ret i8 %18
}

LLVM IR (-O2):
@__const.digit_to_char.lowercase_digits = [37 x i8] c"0123456789abcdefghijklmnopqrstuvwxyz\00"
define signext i8 @digit_to_char(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = getelementptr inbounds [37 x i8], [37 x i8]* @__const.digit_to_char.lowercase_digits, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i32 %1, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call signext i8 @toupper(i8 signext %5)
br label %9
9: ; preds = %7, %2
%10 = phi i8 [ %8, %7 ], [ %5, %2 ]
ret i8 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double x, y;
  x = 1e16;
  y = (x + 1) - x;
  printf("%e\n", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xee1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xecc(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
store double 1.000000e+16, double* %2
%4 = load double, double* %2
%5 = fadd double %4, 1.000000e+00
%6 = load double, double* %2
%7 = fsub double %5, %6
store double %7, double* %3
%8 = load double, double* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%e\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
ret i32 0
}
/* Variables and functions */
double lt2ts();
int lt2tsi() { return ((int)(lt2ts() - 946684800.0)); }


x86 assembly (clang, -O0):
<lt2tsi>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lt2ts@plt>
movsd  0xedd(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt2tsi>:
push   %rax
xor    %eax,%eax
call   1030 <lt2ts@plt>
addsd  0xee0(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lt2tsi() {
%1 = call double (...) @lt2ts()
%2 = fsub double %1, 0x41CC36A1C0000000
%3 = fptosi double %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @lt2tsi() {
%1 = tail call double (...) @lt2ts()
%2 = fadd double %1, 0xC1CC36A1C0000000
%3 = fptosi double %2 to i32
ret i32 %3
}
double ls_cost_nm3_twice(double x) { return x + x; }


x86 assembly (clang, -O0):
<ls_cost_nm3_twice>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm3_twice>:
addsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm3_twice(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fadd double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_cost_nm3_twice(double %0) {
%2 = fadd double %0, %0
ret double %2
}
void imv_window_get_size(struct imv_window *window, int *w, int *h) {
  (void)window;
  (void)w;
  (void)h;
}


x86 assembly (clang, -O0):
<imv_window_get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.imv_window = type opaque
define void @imv_window_get_size(%struct.imv_window* %0, i32* %1, i32* %2) {
%4 = alloca %struct.imv_window*
%5 = alloca i32*
%6 = alloca i32*
store %struct.imv_window* %0, %struct.imv_window** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.imv_window*, %struct.imv_window** %4
%8 = load i32*, i32** %5
%9 = load i32*, i32** %6
ret void
}

LLVM IR (-O2):
%struct.imv_window = type opaque
define void @imv_window_get_size(%struct.imv_window* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
ret void
}
/* Type definitions */
typedef char uint32_t;

/* Variables and functions */
uint32_t calculate_sum(char *word) {
  uint32_t sum = 0;
  while (*word) {
    sum += *word;
    word++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<calculate_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <calculate_sum+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
movsbl -0x9(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <calculate_sum+0xc>
movsbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculate_sum>:
mov    (%rdi),%cl
test   %cl,%cl
je     111e <calculate_sum+0x1e>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    %cl,%al
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <calculate_sum+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @calculate_sum(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = add nsw i32 %13, %11
%15 = trunc i32 %14 to i8
store i8 %15, i8* %3
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %4
18: ; preds = %4
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @calculate_sum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8 [ %8, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = add i8 %5, %6
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
%13 = phi i8 [ 0, %1 ], [ %8, %4 ]
ret i8 %13
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int i = 0;
  if (i != 0) {
    printf("True\n");
  } else {
    printf("False\n");
  }
  if (i != 0)
    printf("True\n");
  else
    printf("False\n");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1148 <main+0x38>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    1154 <main+0x44>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
je     116f <main+0x5f>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <main+0x6b>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
add    $0x20,%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    0x2eb1(%rip),%rax
mov    (%rax),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"True\0A\00"
@.str.1 = [7 x i8] c"False\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %6
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %20
18: ; preds = %13
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str.2 = [6 x i8] c"False\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0))
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
/* Variables and functions */
__attribute__((visibility("default"))) const char *
sd_bus_message_get_member(void *m) {
  return NULL;
}


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

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

LLVM IR (-O0):
define i8* @sd_bus_message_get_member(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @sd_bus_message_get_member(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
#define SIGALRM 128
int /*<<< orphan*/ printf(char *, ...);
void handle(int sig) {
  switch (sig) {
  case SIGALRM:
    printf("signal : [SIGALRM]\n");
    break;
  default:
    printf("unknown signal : [%d]\n", sig);
  }
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x80,%eax
jne    1141 <handle+0x31>
jmp    112e <handle+0x1e>
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1152 <handle+0x42>
mov    -0x4(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
cmp    $0x80,%edi
jne    1134 <handle+0x14>
lea    0xee8(%rip),%rdi
jmp    1030 <puts@plt>
mov    %edi,%esi
lea    0xec3(%rip),%rdi
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"signal : [SIGALRM]\0A\00"
@.str.1 = [23 x i8] c"unknown signal : [%d]\0A\00"
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %6 [
i32 128, label %4
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"unknown signal : [%d]\0A\00"
@str = [19 x i8] c"signal : [SIGALRM]\00"
define void @handle(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_binaries();
int /*<<< orphan*/ test_core();
int /*<<< orphan*/ test_interpret();
int /*<<< orphan*/ test_nonvalid();
int /*<<< orphan*/ test_relooper();
int /*<<< orphan*/ test_tracing();
int /*<<< orphan*/ test_types();
int main() {
  test_types();
  test_core();
  test_relooper();
  test_binaries();
  test_interpret();
  test_nonvalid();
  test_tracing();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_types@plt>
mov    $0x0,%al
call   1040 <test_core@plt>
mov    $0x0,%al
call   1070 <test_relooper@plt>
mov    $0x0,%al
call   1090 <test_binaries@plt>
mov    $0x0,%al
call   1060 <test_interpret@plt>
mov    $0x0,%al
call   1050 <test_nonvalid@plt>
mov    $0x0,%al
call   1080 <test_tracing@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_types@plt>
xor    %eax,%eax
call   1040 <test_core@plt>
xor    %eax,%eax
call   1070 <test_relooper@plt>
xor    %eax,%eax
call   1090 <test_binaries@plt>
xor    %eax,%eax
call   1060 <test_interpret@plt>
xor    %eax,%eax
call   1050 <test_nonvalid@plt>
xor    %eax,%eax
call   1080 <test_tracing@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_types()
%3 = call i32 (...) @test_core()
%4 = call i32 (...) @test_relooper()
%5 = call i32 (...) @test_binaries()
%6 = call i32 (...) @test_interpret()
%7 = call i32 (...) @test_nonvalid()
%8 = call i32 (...) @test_tracing()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_types()
%2 = tail call i32 (...) @test_core()
%3 = tail call i32 (...) @test_relooper()
%4 = tail call i32 (...) @test_binaries()
%5 = tail call i32 (...) @test_interpret()
%6 = tail call i32 (...) @test_nonvalid()
%7 = tail call i32 (...) @test_tracing()
ret i32 0
}
/* Variables and functions */
unsigned long long bam_swap_endian_8(unsigned long long);
void *bam_swap_endian_8p(void *x) {
  *(unsigned long long *)x = bam_swap_endian_8(*(unsigned long long *)x);
  return x;
}


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

x86 assembly (clang, -O2):
<bam_swap_endian_8p>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <bam_swap_endian_8@plt>
mov    %rax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @bam_swap_endian_8p(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i64*
%5 = load i64, i64* %4
%6 = call i64 @bam_swap_endian_8(i64 %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i64*
store i64 %6, i64* %8
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
define i8* @bam_swap_endian_8p(i8* returned %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = tail call i64 @bam_swap_endian_8(i64 %3)
store i64 %4, i64* %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ demoQueue();
int /*<<< orphan*/ demoRing();
int /*<<< orphan*/ demoStack();
int /*<<< orphan*/ printf(char *);
int main(void) {
  demoQueue();
  printf("\n\n");
  demoStack();
  printf("\n\n");
  demoRing();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <demoQueue@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <demoStack@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <demoRing@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <demoQueue@plt>
lea    0xeb1(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <demoStack@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <demoRing@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @demoQueue()
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @demoStack()
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @demoRing()
ret i32 0
}

LLVM IR (-O2):
@str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @demoQueue()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.1, i64 0, i64 0))
%3 = tail call i32 (...) @demoStack()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.1, i64 0, i64 0))
%5 = tail call i32 (...) @demoRing()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t read_u8(const void *const ptr) { return *(uint8_t *)ptr; }


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

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

LLVM IR (-O0):
define i32 @read_u8(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @read_u8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void qwrite(int fd, const char *message) {
  write(fd, message, strlen(message));
}


x86 assembly (clang, -O0):
<qwrite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qwrite>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @qwrite(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @write(i32 %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
define void @qwrite(i32 %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %3)
ret void
}
int atoi_rec(char *inputstr, int n) {
  if (n == 1) {
    return *inputstr - '0';
  }
  return (10 * atoi_rec(inputstr, n - 1) + inputstr[n - 1] - '0');
}


x86 assembly (clang, -O0):
<atoi_rec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    113b <atoi_rec+0x2b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <atoi_rec+0x56>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
sub    $0x1,%esi
call   1030 <atoi_rec@plt>
imul   $0xa,%eax,%eax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi_rec>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
cmp    $0x1,%esi
jne    1121 <atoi_rec+0x11>
movsbl (%rbx),%eax
jmp    113c <atoi_rec+0x2c>
movslq %esi,%r14
lea    -0x1(%r14),%rsi
mov    %rbx,%rdi
call   1030 <atoi_rec@plt>
lea    (%rax,%rax,4),%eax
movsbl -0x1(%rbx,%r14,1),%ecx
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @atoi_rec(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
store i32 %12, i32* %3
br label %28
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = call i32 @atoi_rec(i8* %14, i32 %16)
%18 = mul nsw i32 10, %17
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = add nsw i32 %18, %25
%27 = sub nsw i32 %26, 48
store i32 %27, i32* %3
br label %28
28: ; preds = %13, %8
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @atoi_rec(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
br label %16
7: ; preds = %2
%8 = add nsw i32 %1, -1
%9 = tail call i32 @atoi_rec(i8* %0, i32 %8)
%10 = mul nsw i32 %9, 10
%11 = sext i32 %8 to i64
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = add nsw i32 %10, %14
br label %16
16: ; preds = %7, %4
%17 = phi i32 [ %6, %4 ], [ %15, %7 ]
%18 = add nsw i32 %17, -48
ret i32 %18
}
/* Type definitions */
struct hle_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hvqm2_decode(struct hle_t *, int);
void hvqm2_decode_sp2_task(struct hle_t *hle) { hvqm2_decode(hle, 1); }


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

x86 assembly (clang, -O2):
<hvqm2_decode_sp2_task>:
mov    $0x1,%esi
jmp    1030 <hvqm2_decode@plt>

LLVM IR (-O0):
%struct.hle_t = type { i32 }
define void @hvqm2_decode_sp2_task(%struct.hle_t* %0) {
%2 = alloca %struct.hle_t*
store %struct.hle_t* %0, %struct.hle_t** %2
%3 = load %struct.hle_t*, %struct.hle_t** %2
%4 = call i32 @hvqm2_decode(%struct.hle_t* %3, i32 1)
ret void
}

LLVM IR (-O2):
%struct.hle_t = type { i32 }
define void @hvqm2_decode_sp2_task(%struct.hle_t* %0) {
%2 = tail call i32 @hvqm2_decode(%struct.hle_t* %0, i32 1)
ret void
}
/* Variables and functions */
char *aeApiName();
char *aeGetApiName(void) { return aeApiName(); }


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

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

LLVM IR (-O0):
define i8* @aeGetApiName() {
%1 = call i8* (...) @aeApiName()
ret i8* %1
}

LLVM IR (-O2):
define i8* @aeGetApiName() {
%1 = tail call i8* (...) @aeApiName()
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ pow(double, double);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  printf("%lf\n", pow(2.0, 10.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
call   1040 <pow@plt>
mov    %eax,%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1040 <pow@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @pow(double 2.000000e+00, double 1.000000e+01)
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = tail call i32 @pow(double 2.000000e+00, double 1.000000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int compare_fn(const void *a, const void *b) {
  const int *ia = (const int *)a;
  const int *ib = (const int *)b;
  return *ia - *ib;
}


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

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

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

LLVM IR (-O2):
define i32 @compare_fn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
void refresh() {}


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

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

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

LLVM IR (-O2):
define void @refresh() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mdbm_log_init_syslog();
int /*<<< orphan*/ syslog(int, char *);
void mdbm_log_core_syslog(const char *file, int line, int level, char *msg,
                          int msglen) {
  mdbm_log_init_syslog();
  syslog(level, msg);
}


x86 assembly (clang, -O0):
<mdbm_log_core_syslog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <mdbm_log_init_syslog@plt>
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1040 <syslog@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdbm_log_core_syslog>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
xor    %eax,%eax
call   1030 <mdbm_log_init_syslog@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <syslog@plt>

LLVM IR (-O0):
define void @mdbm_log_core_syslog(i8* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = call i32 (...) @mdbm_log_init_syslog()
%12 = load i32, i32* %8
%13 = load i8*, i8** %9
%14 = call i32 @syslog(i32 %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @mdbm_log_core_syslog(i8* nocapture readnone %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 (...) @mdbm_log_init_syslog()
%7 = tail call i32 @syslog(i32 %2, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(void) { printf("hugo\r\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hugo\0D\00"
define void @main() {
%1 = 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*/ isspace(char const);
const char *skipNonWhite(const char *inString) {
  const char *retval = inString;
  while ('\0' != *retval && !isspace(*retval)) {
    retval++;
  }
  return retval;
}


x86 assembly (clang, -O0):
<skipNonWhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
xor    %ecx,%ecx
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     1151 <skipNonWhite+0x41>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1161 <skipNonWhite+0x51>
jmp    1172 <skipNonWhite+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <skipNonWhite+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipNonWhite>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <skipNonWhite+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <skipNonWhite+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skipNonWhite+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skipNonWhite(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %18, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 0, %8
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = call i32 @isspace(i8 signext %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %5
%17 = phi i1 [ false, %5 ], [ %15, %10 ]
br i1 %17, label %18, label %21
18: ; preds = %16
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %5
21: ; preds = %16
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @skipNonWhite(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
void stop_frame() {}


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

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

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

LLVM IR (-O2):
define void @stop_frame() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xoprintf(char *);
int main() {
  xoprintf("Hello, World!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @xoprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i32 @main() {
%1 = tail call i32 @xoprintf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int func1(long x) {
  int ret = 0;
  if (x & (x - 1)) {
    ret = 0;
  } else {
    ret = 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     1134 <func1+0x34>
movl   $0x0,-0xc(%rbp)
jmp    113b <func1+0x3b>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func1>:
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @func1(i64 %0) {
%2 = tail call i64 @llvm.ctpop.i64(i64 %0)
%3 = icmp ult i64 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}