xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ getchar();
scalar_t__ putchar(int /*<<< orphan*/);
int main(void) {
  char *s, string[] = "Is it supposed to smell that way?";
  s = string;
  while (putchar(*s++))
    ;
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x22,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
cmp    $0x0,%rax
je     1182 <main+0x52>
jmp    115c <main+0x2c>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x3f,0x20(%rsp)
mov    $0x49,%edi
call   1030 <putchar@plt>
test   %rax,%rax
je     1171 <main+0x51>
lea    0x1(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
add    $0x1,%rbx
call   1030 <putchar@plt>
test   %rax,%rax
jne    1160 <main+0x40>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.string = [34 x i8] c"Is it supposed to smell that way?\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [34 x i8]
store i32 0, i32* %1
%4 = bitcast [34 x i8]* %3 to i8*
%5 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
store i8* %5, i8** %2
br label %6
6: ; preds = %13, %0
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %2
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = call i64 @putchar(i32 %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %6
br label %6
14: ; preds = %6
%15 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [34 x i8] c"Is it supposed to smell that way?\00"
define i32 @main() {
%1 = alloca [34 x i8]
%2 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 0
%3 = tail call i64 @putchar(i32 73)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %0
%6 = getelementptr inbounds [34 x i8], [34 x i8]* %1, i64 0, i64 1
br label %7
7: ; preds = %5, %7
%8 = phi i8* [ %6, %5 ], [ %10, %7 ]
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = sext i8 %9 to i32
%12 = tail call i64 @putchar(i32 %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %0
%15 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int iscntrl(int c __attribute__((__unused__))) { abort(); }


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

x86 assembly (clang, -O2):
<iscntrl>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ SYS_personality;
int syscall1(int /*<<< orphan*/, unsigned long);
int sys_personality(unsigned long persona) {
  return syscall1(SYS_personality, persona);
}


x86 assembly (clang, -O0):
<sys_personality>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <syscall1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_personality>:
mov    %rdi,%rsi
mov    0x2ede(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
@SYS_personality = global i32 0
define i32 @sys_personality(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @SYS_personality
%4 = load i64, i64* %2
%5 = call i32 @syscall1(i32 %3, i64 %4)
ret i32 %5
}

LLVM IR (-O2):
@SYS_personality = global i32 0
define i32 @sys_personality(i64 %0) {
%2 = load i32, i32* @SYS_personality
%3 = tail call i32 @syscall1(i32 %2, i64 %0)
ret i32 %3
}
int start_bmp() {}


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

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

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

LLVM IR (-O2):
define i32 @start_bmp() {
ret i32 undef
}
void test_7809123(void) {
  struct {
    int i5 : 5;
  } a;
  a.i5 = 36;
}


x86 assembly (clang, -O0):
<test_7809123>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%al
and    $0xe0,%al
or     $0x4,%al
mov    %al,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i8, [3 x i8] }
define void @test_7809123() {
%1 = alloca %struct.anon
%2 = bitcast %struct.anon* %1 to i8*
%3 = load i8, i8* %2
%4 = and i8 %3, -32
%5 = or i8 %4, 4
store i8 %5, i8* %2
ret void
}

LLVM IR (-O2):
define void @test_7809123() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stdout;
void version(const char *p) { fprintf(stdout, "%s %s\n", p, "0.2"); }


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

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [4 x i8] c"0.2\00"
define void @version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [4 x i8] c"0.2\00"
define void @version(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Unload_ISO();
void FILE_End(void) { Unload_ISO(); }


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

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

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

LLVM IR (-O2):
define void @FILE_End() {
%1 = tail call i32 (...) @Unload_ISO()
ret void
}
int num_leap_years(int year) { return year / 4 - year / 100 + year / 400; }


x86 assembly (clang, -O0):
<num_leap_years>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_leap_years>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
movslq %edi,%rcx
imul   $0xffffffffae147ae1,%rcx,%rdx
mov    %rdx,%rsi
shr    $0x3f,%rsi
sar    $0x25,%rdx
add    %esi,%edx
add    %eax,%edx
imul   $0x51eb851f,%rcx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @num_leap_years(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 4
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 100
%7 = sub nsw i32 %4, %6
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 400
%10 = add nsw i32 %7, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @num_leap_years(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = sdiv i32 %0, -100
%4 = add nsw i32 %3, %2
%5 = sdiv i32 %0, 400
%6 = add nsw i32 %4, %5
ret i32 %6
}
int test_06(int x) { return x > 0 ? x + 1 : x; }


x86 assembly (clang, -O0):
<test_06>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    111f <test_06+0x1f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <test_06+0x25>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_06>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test_06(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int tun_alloc(char *);
int tun_open() { return (tun_alloc("/dev/net/tun")); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"/dev/net/tun\00"
define i32 @tun_open() {
%1 = tail call i32 @tun_alloc(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ test(float);
int main(void) {
  if (test(1.0f) != 0)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
call   1040 <test@plt>
cmp    $0x0,%rax
je     114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
call   1040 <test@plt>
test   %rax,%rax
jne    1137 <main+0x17>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @test(float 1.000000e+00)
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @test(float 1.000000e+00)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int pechochar(int /*<<< orphan*/ *, int /*<<< orphan*/ const);
int __darwin_pechochar(WINDOW *w, const uint32_t c) { return pechochar(w, c); }


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

x86 assembly (clang, -O2):
<__darwin_pechochar>:
jmp    1030 <pechochar@plt>

LLVM IR (-O0):
define i32 @__darwin_pechochar(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 @pechochar(i32* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__darwin_pechochar(i32* %0, i32 %1) {
%3 = tail call i32 @pechochar(i32* %0, i32 %1)
ret i32 %3
}
double brot_scale_value(double value, double high, double low) {
  return ((value - low) / (high - low));
}


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

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

LLVM IR (-O0):
define double @brot_scale_value(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fsub double %7, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = fdiv double %9, %12
ret double %13
}

LLVM IR (-O2):
define double @brot_scale_value(double %0, double %1, double %2) {
%4 = fsub double %0, %2
%5 = fsub double %1, %2
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int floor(int);
int uniform();
int basepick_with_errors(double errate, int inbase) {
  int outbase;
  if (uniform() < errate) {
    while ((outbase = (floor(4 * uniform()))) == inbase)
      ;
    return outbase;
  } else
    return inbase;
}


x86 assembly (clang, -O0):
<basepick_with_errors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    $0x0,%al
call   1030 <uniform@plt>
cvtsi2sd %eax,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    117c <basepick_with_errors+0x5c>
jmp    114f <basepick_with_errors+0x2f>
mov    $0x0,%al
call   1030 <uniform@plt>
mov    %eax,%edi
shl    $0x2,%edi
call   1040 <floor@plt>
mov    %eax,-0x18(%rbp)
cmp    -0x14(%rbp),%eax
jne    1171 <basepick_with_errors+0x51>
jmp    114f <basepick_with_errors+0x2f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <basepick_with_errors+0x62>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basepick_with_errors>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <uniform@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    1169 <basepick_with_errors+0x49>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <uniform@plt>
lea    0x0(,%rax,4),%edi
call   1040 <floor@plt>
cmp    %ebx,%eax
je     1150 <basepick_with_errors+0x30>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @basepick_with_errors(double %0, i32 %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%7 = call i32 (...) @uniform()
%8 = sitofp i32 %7 to double
%9 = load double, double* %4
%10 = fcmp olt double %8, %9
br i1 %10, label %11, label %21
11: ; preds = %2
br label %12
12: ; preds = %18, %11
%13 = call i32 (...) @uniform()
%14 = mul nsw i32 4, %13
%15 = call i32 @floor(i32 %14)
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %19
18: ; preds = %12
br label %12
19: ; preds = %12
%20 = load i32, i32* %6
store i32 %20, i32* %3
br label %23
21: ; preds = %2
%22 = load i32, i32* %5
store i32 %22, i32* %3
br label %23
23: ; preds = %21, %19
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @basepick_with_errors(double %0, i32 %1) {
%3 = tail call i32 (...) @uniform()
%4 = sitofp i32 %3 to double
%5 = fcmp olt double %4, %0
br i1 %5, label %6, label %11
6: ; preds = %2, %6
%7 = tail call i32 (...) @uniform()
%8 = shl nsw i32 %7, 2
%9 = tail call i32 @floor(i32 %8)
%10 = icmp eq i32 %9, %1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
%12 = phi i32 [ %1, %2 ], [ %9, %6 ]
ret i32 %12
}
/* Variables and functions */
int syscall(int, char *, int /*<<< orphan*/);
int unlink(char *file) { return syscall(24, file, 0); }


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x18,%edi
xor    %edx,%edx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
mov    %rdi,%rsi
mov    $0x18,%edi
xor    %edx,%edx
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @unlink(i8* %0) {
%2 = tail call i32 @syscall(i32 24, i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ HplAtmRfa1TimerMacP__CompareB__stop();
void AtmegaCompareP__1__AtmegaCompare__stop(void) {
  HplAtmRfa1TimerMacP__CompareB__stop();
}


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

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

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

LLVM IR (-O2):
define void @AtmegaCompareP__1__AtmegaCompare__stop() {
%1 = tail call i32 (...) @HplAtmRfa1TimerMacP__CompareB__stop()
ret void
}
int int_size_is_at_least_16(void) {
  int t = 0x8000;
  return t;
}


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

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

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

LLVM IR (-O2):
define i32 @int_size_is_at_least_16() {
ret i32 32768
}
/* Variables and functions */
char *sysfs_get_freq_driver(unsigned int);
char *cpufreq_get_driver(unsigned int cpu) {
  return sysfs_get_freq_driver(cpu);
}


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

x86 assembly (clang, -O2):
<cpufreq_get_driver>:
jmp    1030 <sysfs_get_freq_driver@plt>

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

LLVM IR (-O2):
define i8* @cpufreq_get_driver(i32 %0) {
%2 = tail call i8* @sysfs_get_freq_driver(i32 %0)
ret i8* %2
}
unsigned long HibernateWakeGet(void) {
  return ((*((volatile unsigned long *)(0x400FC010))) & (0x10 | 0x08));
}


x86 assembly (clang, -O0):
<HibernateWakeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc010,%eax
mov    (%rax),%rax
and    $0x18,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateWakeGet>:
mov    0x400fc010,%rax
40
and    $0x18,%eax
ret

LLVM IR (-O0):
define i64 @HibernateWakeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, 24
ret i64 %2
}

LLVM IR (-O2):
define i64 @HibernateWakeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074774032 to i64*)
%2 = and i64 %1, 24
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void syntax(void) {
  printf("oao3emu [<flags>] [binary.img]:\n");
  printf("  -h             this help\n");
  printf("  -d             enter debugger on startup\n");
  exit(1);
}


x86 assembly (clang, -O0):
<syntax>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [33 x i8] c"oao3emu [<flags>] [binary.img]:\0A\00"
@.str.1 = [28 x i8] c" -h this help\0A\00"
@.str.2 = [44 x i8] c" -d enter debugger on startup\0A\00"
define void @syntax() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [32 x i8] c"oao3emu [<flags>] [binary.img]:\00"
@str.3 = [27 x i8] c" -h this help\00"
@str.4 = [43 x i8] c" -d enter debugger on startup\00"
define void @syntax() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct re_pattern_buffer {
  int dummy;
};

/* Variables and functions */
int byte_re_compile_fastmap(struct re_pattern_buffer *);
int re_compile_fastmap(struct re_pattern_buffer *bufp) {
  return byte_re_compile_fastmap(bufp);
}


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

x86 assembly (clang, -O2):
<re_compile_fastmap>:
jmp    1030 <byte_re_compile_fastmap@plt>

LLVM IR (-O0):
%struct.re_pattern_buffer = type { i32 }
define i32 @re_compile_fastmap(%struct.re_pattern_buffer* %0) {
%2 = alloca %struct.re_pattern_buffer*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %2
%3 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %2
%4 = call i32 @byte_re_compile_fastmap(%struct.re_pattern_buffer* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type { i32 }
define i32 @re_compile_fastmap(%struct.re_pattern_buffer* %0) {
%2 = tail call i32 @byte_re_compile_fastmap(%struct.re_pattern_buffer* %0)
ret i32 %2
}
int __fls(unsigned long x) {
  int r;
  asm("	bsrl	%1, %0;"
      "	jnz	1f;"
      "	movl	$-1, %0;"
      "1:"
      : "=r"(r)
      : "rm"(x));
  return r + 1;
}


x86 assembly (clang, -O0):
<__fls>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
bsr    -0x18(%rbp),%eax
jne    111f <__fls+0x1f>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @__fls(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i32 asm "\09bsrl\09$1, $0;\09jnz\091f;\09movl\09$$-1, $0;1:", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i64 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cmd_ps(int argc, char *argv[]) {
  printf("This command is not supported on this operating system.\n");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"This command is not supported on this operating system.\0A\00"
define void @cmd_ps(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [56 x i8] c"This command is not supported on this operating system.\00"
define void @cmd_ps(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
struct timeval tst_ms_to_timeval(long long ms) {
  struct timeval ret;
  ret.tv_sec = ms / 1000;
  ret.tv_usec = (ms % 1000) * 1000;
  return ret;
}


x86 assembly (clang, -O0):
<tst_ms_to_timeval>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x7,%rax
add    %rdx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   %rcx
mov    -0x20(%rbp),%rax
mov    %rdx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x7,%rcx
add    %rdx,%rcx
imul   $0x3e8,%rcx,%rcx
sub    %rcx,%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<tst_ms_to_timeval>:
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mov    %rdi,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
imul   $0x3e8,%rax,%rcx
sub    %rcx,%rdi
imul   $0x3e8,%rdi,%rdx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define { i64, i64 } @tst_ms_to_timeval(i64 %0) {
%2 = alloca %struct.timeval
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = sdiv i64 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %3
%8 = srem i64 %7, 1000
%9 = mul nsw i64 %8, 1000
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 %9, i64* %10
%11 = bitcast %struct.timeval* %2 to { i64, i64 }*
%12 = load { i64, i64 }, { i64, i64 }* %11
ret { i64, i64 } %12
}

LLVM IR (-O2):
define { i64, i64 } @tst_ms_to_timeval(i64 %0) {
%2 = sdiv i64 %0, 1000
%3 = srem i64 %0, 1000
%4 = mul nsw i64 %3, 1000
%5 = insertvalue { i64, i64 } poison, i64 %2, 0
%6 = insertvalue { i64, i64 } %5, i64 %4, 1
ret { i64, i64 } %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int i = 0;
  int sum = 0;
  switch (i) {
  case 1:
  case 3:
  case 5:
  case 7:
  case 9:
  default:
    sum += 2;
  }
  printf("%d\t", sum);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     117e <main+0x6e>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     117e <main+0x6e>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x5,%eax
je     117e <main+0x6e>
jmp    115c <main+0x4c>
mov    -0xc(%rbp),%eax
sub    $0x7,%eax
je     117e <main+0x6e>
jmp    116d <main+0x5d>
mov    -0xc(%rbp),%eax
sub    $0x9,%eax
jne    1183 <main+0x73>
jmp    117e <main+0x6e>
jmp    1183 <main+0x73>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
int getchar();
void b_getchar_32(int idx, int *cells, int size) { cells[idx] = getchar(); }


x86 assembly (clang, -O0):
<b_getchar_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_getchar_32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <getchar@plt>
movslq %ebp,%rcx
mov    %eax,(%rbx,%rcx,4)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @b_getchar_32(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = call i32 (...) @getchar()
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
store i32 %7, i32* %11
ret void
}

LLVM IR (-O2):
define void @b_getchar_32(i32 %0, i32* nocapture writeonly %1, i32 %2) {
%4 = tail call i32 (...) @getchar()
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
store i32 %4, i32* %6
ret void
}
int timeout(void *data) {
  struct user_info *user = (struct user_info *)data;
  if (user) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1120 <timeout+0x20>
jmp    1120 <timeout+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.user_info = type opaque
define i32 @timeout(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.user_info*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.user_info*
store %struct.user_info* %5, %struct.user_info** %3
%6 = load %struct.user_info*, %struct.user_info** %3
%7 = icmp ne %struct.user_info* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @timeout(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void crcopy(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


x86 assembly (clang, -O0):
<crcopy>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crcopy>:
xor    %edi,%edi
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
define void @crcopy() {
%1 = call i32 @nsc_assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @crcopy() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
/* Variables and functions */
bool nrf53_errata_107(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf53_errata_107() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_107() {
ret i32 0
}
int compareDoubles(void *p1, void *p2) {
  double d1 = *(double *)p1;
  double d2 = *(double *)p2;
  return (d1 < d2) ? -1 : ((d1 > d2) ? 1 : 0);
}


x86 assembly (clang, -O0):
<compareDoubles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1147 <compareDoubles+0x47>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1162 <compareDoubles+0x62>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compareDoubles(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Type definitions */
struct Stack {
  int dummy;
};
struct Node {
  int dummy;
};

/* Variables and functions */
struct Stack *createStack(int);
int /*<<< orphan*/ dfs(struct Stack *, struct Node *);
struct Node *new_node(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(int argc, char const *argv[]) {
  struct Node *root = new_node(12, NULL, NULL);
  struct Stack *stack = createStack(100);
  dfs(stack, root);
  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    $0xc,%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <new_node@plt>
mov    %rax,-0x18(%rbp)
mov    $0x64,%edi
call   1030 <createStack@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <dfs@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xc,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <new_node@plt>
mov    %rax,%rbx
mov    $0x64,%edi
call   1030 <createStack@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <dfs@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.Node = type { i32 }
%struct.Stack = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.Node*
%7 = alloca %struct.Stack*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call %struct.Node* @new_node(i32 12, i32* null, i32* null)
store %struct.Node* %8, %struct.Node** %6
%9 = call %struct.Stack* @createStack(i32 100)
store %struct.Stack* %9, %struct.Stack** %7
%10 = load %struct.Stack*, %struct.Stack** %7
%11 = load %struct.Node*, %struct.Node** %6
%12 = call i32 @dfs(%struct.Stack* %10, %struct.Node* %11)
ret i32 0
}

LLVM IR (-O2):
%struct.Node = type { i32 }
%struct.Stack = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.Node* @new_node(i32 12, i32* null, i32* null)
%4 = tail call %struct.Stack* @createStack(i32 100)
%5 = tail call i32 @dfs(%struct.Stack* %4, %struct.Node* %3)
ret i32 0
}
int one_more(int value1, int value2, int value3) {
  return value1 + value2 + value3;
}


x86 assembly (clang, -O0):
<one_more>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @one_more(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @one_more(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Type definitions */
struct tree_root {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __tree_print(struct tree_root *,
                                void (*)(struct tree_root *), int);
void tree_print(struct tree_root *root, void (*callback)(struct tree_root *)) {
  if (root)
    __tree_print(root, callback, 1);
}


x86 assembly (clang, -O0):
<tree_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113d <tree_print+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <__tree_print@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_print>:
test   %rdi,%rdi
je     111f <tree_print+0xf>
mov    $0x1,%edx
jmp    1030 <__tree_print@plt>
ret

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

LLVM IR (-O2):
%struct.tree_root = type { i32 }
define void @tree_print(%struct.tree_root* %0, void (%struct.tree_root*)* %1) {
%3 = icmp eq %struct.tree_root* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @__tree_print(%struct.tree_root* %0, void (%struct.tree_root*)* %1, i32 1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_goldfish_events();
void module_init() { init_goldfish_events(); }


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

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

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

LLVM IR (-O2):
define void @module_init() {
%1 = tail call i32 (...) @init_goldfish_events()
ret void
}
void register_fs() {}


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

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

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

LLVM IR (-O2):
define void @register_fs() {
ret void
}
int PpapiPluginMain() { return 0; }


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

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

LLVM IR (-O0):
define i32 @PpapiPluginMain() {
ret i32 0
}

LLVM IR (-O2):
define i32 @PpapiPluginMain() {
ret i32 0
}
/* Type definitions */
struct statvfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int fstatvfs(int fd, struct statvfs *buf) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<fstatvfs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstatvfs>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.statvfs = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstatvfs(i32 %0, %struct.statvfs* %1) {
%3 = alloca i32
%4 = alloca %struct.statvfs*
store i32 %0, i32* %3
store %struct.statvfs* %1, %struct.statvfs** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @fstatvfs(i32 %0, %struct.statvfs* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int mem_set_funcs(void *(*)(size_t, size_t), void *(*)(size_t),
                  void (*)(void *));
int vis5d_mem_set_funcs(void *(*calloc_func)(size_t nmemb, size_t size),
                        void *(*malloc_func)(size_t size),
                        void (*free_func)(void *ptr)) {
  return mem_set_funcs(calloc_func, malloc_func, free_func);
}


x86 assembly (clang, -O0):
<vis5d_mem_set_funcs>:
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 <mem_set_funcs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vis5d_mem_set_funcs>:
jmp    1030 <mem_set_funcs@plt>

LLVM IR (-O0):
define i32 @vis5d_mem_set_funcs(i8* (i64, i64)* %0, i8* (i64)* %1, void (i8*)* %2) {
%4 = alloca i8* (i64, i64)*
%5 = alloca i8* (i64)*
%6 = alloca void (i8*)*
store i8* (i64, i64)* %0, i8* (i64, i64)** %4
store i8* (i64)* %1, i8* (i64)** %5
store void (i8*)* %2, void (i8*)** %6
%7 = load i8* (i64, i64)*, i8* (i64, i64)** %4
%8 = load i8* (i64)*, i8* (i64)** %5
%9 = load void (i8*)*, void (i8*)** %6
%10 = call i32 @mem_set_funcs(i8* (i64, i64)* %7, i8* (i64)* %8, void (i8*)* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @vis5d_mem_set_funcs(i8* (i64, i64)* %0, i8* (i64)* %1, void (i8*)* %2) {
%4 = tail call i32 @mem_set_funcs(i8* (i64, i64)* %0, i8* (i64)* %1, void (i8*)* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ print_verbose(char *);
char *strdup(char *);
char *pong() {
  print_verbose("pong\n");
  return strdup("pong\n");
}


x86 assembly (clang, -O0):
<pong>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <print_verbose@plt>
lea    0xec9(%rip),%rdi
call   1040 <strdup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pong>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_verbose@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdup@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"pong\0A\00"
define i8* @pong() {
%1 = call i32 @print_verbose(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}

LLVM IR (-O2):
@.str = [6 x i8] c"pong\0A\00"
define noalias i8* @pong() {
%1 = tail call i32 @print_verbose(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(6) i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *);
void show_message(const char *msg) {
  char buf[80];
  sprintf(buf, "Message: %.64s\n", msg);
  printf(buf);
}


x86 assembly (clang, -O0):
<show_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xec5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_message>:
push   %rbx
sub    $0x50,%rsp
mov    %rdi,%rdx
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Message: %.64s\0A\00"
define void @show_message(i8* %0) {
%2 = alloca i8*
%3 = alloca [80 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Message: %.64s\0A\00"
define void @show_message(i8* %0) {
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @printf(i8* %3)
ret void
}
void ece391_memset(void *memory, char c, int n) {
  char *mem = (char *)memory;
  int i;
  for (i = 0; i < n; i++) {
    mem[i] = c;
  }
}


x86 assembly (clang, -O0):
<ece391_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1148 <ece391_memset+0x48>
mov    -0x9(%rbp),%dl
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1120 <ece391_memset+0x20>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ece391_memset>:
test   %edx,%edx
jle    1124 <ece391_memset+0x14>
push   %rax
mov    %edx,%edx
movzbl %sil,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @ece391_memset(i8* nocapture writeonly %0, i8 signext %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setenv(char *, char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void set_multi_threaded_BLAS(int nths) {
  char nths_str[256];
  snprintf(nths_str, 256, "%d", nths);
  setenv("OMP_NUM_THREADS", nths_str, 1);
}


x86 assembly (clang, -O0):
<set_multi_threaded_BLAS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
lea    0xebc(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x110(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_multi_threaded_BLAS>:
push   %rbx
sub    $0x100,%rsp
mov    %edi,%ecx
lea    0xecf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1040 <snprintf@plt>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"OMP_NUM_THREADS\00"
define void @set_multi_threaded_BLAS(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 256, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %7, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"OMP_NUM_THREADS\00"
define void @set_multi_threaded_BLAS(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 256, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @setenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 1)
ret void
}