xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ds_set_boolean(int /*<<< orphan*/, int, int);
void snmp_set_dump_packet(int x) { ds_set_boolean(0, 4, x); }


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

x86 assembly (clang, -O2):
<snmp_set_dump_packet>:
mov    %edi,%edx
xor    %edi,%edi
mov    $0x4,%esi
jmp    1030 <ds_set_boolean@plt>

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

LLVM IR (-O2):
define void @snmp_set_dump_packet(i32 %0) {
%2 = tail call i32 @ds_set_boolean(i32 0, i32 4, i32 %0)
ret void
}
void dcache_clean_invalidate_all(void) {}


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

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

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

LLVM IR (-O2):
define void @dcache_clean_invalidate_all() {
ret void
}
/* Variables and functions */
double sqrt(double);
double Sqrt(double value) { return sqrt(value); }


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

x86 assembly (clang, -O2):
<Sqrt>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     111f <Sqrt+0xf>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

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

LLVM IR (-O2):
define double @Sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
ret double %2
}
char *test_mySub_large(const char **_ja_name) {
  do {
    *_ja_name = __func__;
    if (!(mySub(2000, 1000) == 1000))
      return "2000 - 1000 == 1000";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_mySub_large>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
mov    %rcx,(%rax)
mov    $0x7d0,%edi
mov    $0x3e8,%esi
mov    $0x0,%al
call   1030 <mySub@plt>
cmp    $0x3e8,%eax
je     1156 <test_mySub_large+0x46>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <test_mySub_large+0x53>
jmp    115b <test_mySub_large+0x4b>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mySub_large>:
push   %rbx
lea    0xee8(%rip),%rax
mov    %rax,(%rdi)
xor    %ebx,%ebx
mov    $0x7d0,%edi
mov    $0x3e8,%esi
xor    %eax,%eax
call   1030 <mySub@plt>
cmp    $0x3e8,%eax
lea    0xed7(%rip),%rax
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@__func__.test_mySub_large = [17 x i8] c"test_mySub_large\00"
@.str = [20 x i8] c"2000 - 1000 == 1000\00"
define i8* @test_mySub_large(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8** %0, i8*** %3
br label %4
4: ; preds = %1
%5 = load i8**, i8*** %3
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.test_mySub_large, i64 0, i64 0), i8** %5
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @mySub to i32 (i32, i32, ...)*)(i32 2000, i32 1000)
%7 = icmp eq i32 %6, 1000
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %2
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@__func__.test_mySub_large = [17 x i8] c"test_mySub_large\00"
@.str = [20 x i8] c"2000 - 1000 == 1000\00"
define i8* @test_mySub_large(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.test_mySub_large, i64 0, i64 0), i8** %0
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @mySub to i32 (i32, i32, ...)*)(i32 2000, i32 1000)
%3 = icmp eq i32 %2, 1000
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void moveCursorToLeftBy(int n) {
  if (n > 0)
    printf("%c[%dD", 27, n);
}


x86 assembly (clang, -O0):
<moveCursorToLeftBy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1139 <moveCursorToLeftBy+0x29>
mov    -0x4(%rbp),%edx
lea    0xed1(%rip),%rdi
mov    $0x1b,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveCursorToLeftBy>:
test   %edi,%edi
jle    1127 <moveCursorToLeftBy+0x17>
mov    %edi,%edx
lea    0xee3(%rip),%rdi
mov    $0x1b,%esi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%c[%dD\00"
define void @moveCursorToLeftBy(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 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c[%dD\00"
define void @moveCursorToLeftBy(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 27, i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_and_change_bit(int nr, volatile void *addr) {
  int oldbit;
  asm volatile(""
               "btcl %2,%1\n\tsbbl %0,%0"
               : "=r"(oldbit), "=m"((*(volatile long *)addr))
               : "Ir"(nr), "m"((*(volatile long *)addr))
               : "memory");
  return oldbit;
}


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

x86 assembly (clang, -O2):
<test_and_change_bit>:
btc    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_change_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i32, i32* %3
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
%11 = call i32 asm sideeffect "btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %7, i32 %8, i64* elementtype(i64) %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_and_change_bit(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i64*
%4 = tail call i32 asm sideeffect "btcl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %3, i32 %0, i64* elementtype(i64) %3)
ret i32 %4
}
void lockevent_pv_hop(int hopcnt) {}


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

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

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

LLVM IR (-O2):
define void @lockevent_pv_hop(i32 %0) {
ret void
}
/* Type definitions */
typedef char *int64_t;

/* Variables and functions */
int64_t rdtsc(void) {
  asm("xorl %eax,%eax; cpuid; rdtsc; ret");
  return 0;
}


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

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

LLVM IR (-O0):
define i8* @rdtsc() {
ret i8* null
}

LLVM IR (-O2):
define i8* @rdtsc() {
tail call void asm sideeffect "xorl %eax,%eax; cpuid; rdtsc; ret", "~{dirflag},~{fpsr},~{flags}"()
ret i8* null
}
/* Variables and functions */
float sqrt(int);
float sq_diagonal_area(float area) {
  float square_root_2 = sqrt(2);
  float diagonal = square_root_2 * area;
  return diagonal;
}


x86 assembly (clang, -O0):
<sq_diagonal_area>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sq_diagonal_area>:
push   %rax
movss  %xmm0,0x4(%rsp)
mov    $0x2,%edi
call   1030 <sqrt@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @sq_diagonal_area(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
%5 = call float @sqrt(i32 2)
store float %5, float* %3
%6 = load float, float* %3
%7 = load float, float* %2
%8 = fmul float %6, %7
store float %8, float* %4
%9 = load float, float* %4
ret float %9
}

LLVM IR (-O2):
define float @sq_diagonal_area(float %0) {
%2 = tail call float @sqrt(i32 2)
%3 = fmul float %2, %0
ret float %3
}
/* Variables and functions */
int MAP_FIXED;
int MAP_PRIVATE;
int /*<<< orphan*/ PROT_NONE;
int /*<<< orphan*/ mmap(void *, int, int /*<<< orphan*/, int,
                        int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ munmap(void *, int);
void munmap_reserve(void *page, int size) {
  munmap(page, size);
  mmap(page, size, PROT_NONE, MAP_PRIVATE | MAP_FIXED, 0, 0);
}


x86 assembly (clang, -O0):
<munmap_reserve>:
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   1040 <munmap@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    0x2e86(%rip),%rax
mov    (%rax),%ecx
mov    0x2e75(%rip),%rax
or     (%rax),%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <mmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<munmap_reserve>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <munmap@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
mov    0x2e9b(%rip),%rax
mov    0x2e8c(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FIXED = global i32 0
define void @munmap_reserve(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @munmap(i8* %5, i32 %6)
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = load i32, i32* @PROT_NONE
%11 = load i32, i32* @MAP_PRIVATE
%12 = load i32, i32* @MAP_FIXED
%13 = or i32 %11, %12
%14 = call i32 @mmap(i8* %8, i32 %9, i32 %10, i32 %13, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FIXED = global i32 0
define void @munmap_reserve(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
%4 = load i32, i32* @PROT_NONE
%5 = load i32, i32* @MAP_PRIVATE
%6 = load i32, i32* @MAP_FIXED
%7 = or i32 %6, %5
%8 = tail call i32 @mmap(i8* %0, i32 %1, i32 %4, i32 %7, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ decimalBinario(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Introduzca un valor decimal:");
  scanf("%d", &num);
  decimalBinario(num);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <decimalBinario@plt>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <decimalBinario@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Introduzca un valor decimal:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @decimalBinario(i32 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Introduzca un valor decimal:\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @decimalBinario(i32 %5)
%7 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ adjust_heap_min(int *, int, int);
void build_heap_min(int matrix[], int length) {
  int i;
  for (i = length / 2 - 1; i >= 0; i--) {
    adjust_heap_min(matrix, i, length);
  }
}


x86 assembly (clang, -O0):
<build_heap_min>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <build_heap_min+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <adjust_heap_min@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <build_heap_min+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_heap_min>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <build_heap_min+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%esi
mov    %r14,%rdi
mov    %ebp,%edx
call   1030 <adjust_heap_min@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <build_heap_min+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @build_heap_min(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %6
6: ; preds = %4, %6
%7 = phi i32 [ %8, %6 ], [ %5, %4 ]
%8 = add nsw i32 %7, -1
%9 = tail call i32 @adjust_heap_min(i32* %0, i32 %8, i32 %1)
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %2
ret void
}
void X509V3_EXT_i2d(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_EXT_i2d() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int doTest(int test, char *methodName) {
  if (test) {
    printf("failure during test of %s\n", methodName);
  } else {
    printf("%s passed tests\n", methodName);
  }
  return test;
}


x86 assembly (clang, -O0):
<doTest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <doTest+0x2e>
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
jmp    114e <doTest+0x3e>
mov    -0x10(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doTest>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
lea    0xeff(%rip),%rax
lea    0xedd(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"failure during test of %s\0A\00"
@.str.1 = [17 x i8] c"%s passed tests\0A\00"
define i32 @doTest(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %13
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %11)
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@.str = [27 x i8] c"failure during test of %s\0A\00"
@.str.1 = [17 x i8] c"%s passed tests\0A\00"
define i32 @doTest(i32 returned %0, i8* %1) {
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @printf(i8* %4, i8* %1)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ glutPostRedisplay();
int /*<<< orphan*/ help();
int /*<<< orphan*/ pfunc();
void key(unsigned char key, int x, int y) {
  switch (key) {
  case 'p':
    pfunc();
    break;
  case 'h':
    help();
    break;
  case '\033':
    exit(EXIT_SUCCESS);
    break;
  default:
    break;
  }
  glutPostRedisplay();
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1b,%eax
je     11a3 <key+0x63>
jmp    1169 <key+0x29>
mov    -0x10(%rbp),%eax
sub    $0x68,%eax
je     1197 <key+0x57>
jmp    117a <key+0x3a>
mov    -0x10(%rbp),%eax
sub    $0x70,%eax
jne    11b1 <key+0x71>
jmp    118b <key+0x4b>
mov    $0x0,%al
call   1030 <pfunc@plt>
jmp    11b6 <key+0x76>
mov    $0x0,%al
call   1050 <help@plt>
jmp    11b6 <key+0x76>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
jmp    11b6 <key+0x76>
mov    $0x0,%al
call   1040 <glutPostRedisplay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
push   %rax
cmp    $0x68,%dil
je     1161 <key+0x21>
cmp    $0x70,%dil
je     116a <key+0x2a>
cmp    $0x1b,%dil
jne    1171 <key+0x31>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
xor    %eax,%eax
call   1050 <help@plt>
jmp    1171 <key+0x31>
xor    %eax,%eax
call   1030 <pfunc@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glutPostRedisplay@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
switch i32 %8, label %16 [
i32 112, label %9
i32 104, label %11
i32 27, label %13
]
9: ; preds = %3
%10 = call i32 (...) @pfunc()
br label %17
11: ; preds = %3
%12 = call i32 (...) @help()
br label %17
13: ; preds = %3
%14 = load i32, i32* @EXIT_SUCCESS
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %3
br label %17
17: ; preds = %16, %11, %9
%18 = call i32 (...) @glutPostRedisplay()
ret void
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
switch i8 %0, label %11 [
i8 112, label %4
i8 104, label %6
i8 27, label %8
]
4: ; preds = %3
%5 = tail call i32 (...) @pfunc()
br label %11
6: ; preds = %3
%7 = tail call i32 (...) @help()
br label %11
8: ; preds = %3
%9 = load i32, i32* @EXIT_SUCCESS
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %3, %6, %4
%12 = tail call i32 (...) @glutPostRedisplay()
ret void
}
/* Variables and functions */
char toascii(int c) { return (c & 0x7F); }


x86 assembly (clang, -O0):
<toascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toascii>:
mov    %edi,%eax
and    $0x7f,%al
ret

LLVM IR (-O0):
define signext i8 @toascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @toascii(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = and i8 %2, 127
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ _libC_fini();
void libC_fini(void) { _libC_fini(); }


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

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

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

LLVM IR (-O2):
define void @libC_fini() {
%1 = tail call i32 (...) @_libC_fini()
ret void
}
/* Variables and functions */
int endswith(char *, char *);
char *test3() {
  int res = endswith("endswith", "offendswith");
  char *message =
      "test3 failed: endswith(\"offendswith\", \"swith\") should return 0";
  do {
    if (!(res == 0))
      return message;
  } while (0);
  return NULL;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xee4(%rip),%rdi
lea    0xeda(%rip),%rsi
call   1030 <endswith@plt>
mov    %eax,-0xc(%rbp)
lea    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1150 <test3+0x40>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115d <test3+0x4d>
jmp    1155 <test3+0x45>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %rax
lea    0xeeb(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <endswith@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xedd(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"endswith\00"
@.str.1 = [12 x i8] c"offendswith\00"
@.str.2 = [63 x i8] c"test3 failed: endswith(\22offendswith\22, \22swith\22) should return 0\00"
define i8* @test3() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i8*
%4 = call i32 @endswith(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %2
store i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %5
5: ; preds = %0
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = load i8*, i8** %3
store i8* %9, i8** %1
br label %12
10: ; preds = %5
br label %11
11: ; preds = %10
store i8* null, i8** %1
br label %12
12: ; preds = %11, %8
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"endswith\00"
@.str.1 = [12 x i8] c"offendswith\00"
@.str.2 = [63 x i8] c"test3 failed: endswith(\22offendswith\22, \22swith\22) should return 0\00"
define i8* @test3() {
%1 = tail call i32 @endswith(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  if (x > 0 && x < 2)
    __VERIFIER_assert(x == 1);
  else
    __VERIFIER_assert(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1163 <main+0x43>
cmpl   $0x2,-0x8(%rbp)
jge    1163 <main+0x43>
cmpl   $0x1,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <__VERIFIER_assert@plt>
jmp    116d <main+0x4d>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    $0x1,%edi
call   1040 <__VERIFIER_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
%13 = call i32 @__VERIFIER_assert(i32 %12)
br label %16
14: ; preds = %6, %0
%15 = call i32 @__VERIFIER_assert(i32 1)
br label %16
16: ; preds = %14, %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @__VERIFIER_assert(i32 1)
ret i32 0
}
_Complex double test_ctanh(_Complex double x) { return __builtin_ctanh(x); }


x86 assembly (clang, -O0):
<test_ctanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <ctanh@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ctanh>:
jmp    1030 <ctanh@plt>

LLVM IR (-O0):
define { double, double } @test_ctanh(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca { double, double }
%5 = alloca { double, double }
%6 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
store double %0, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
store double %1, double* %7
%8 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 0
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %4, i32 0, i32 1
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%13 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
store double %9, double* %12
store double %11, double* %13
%14 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %5, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @ctanh(double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%22 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %19, double* %21
store double %20, double* %22
%23 = load { double, double }, { double, double }* %3
ret { double, double } %23
}

LLVM IR (-O2):
define { double, double } @test_ctanh(double %0, double %1) {
%3 = tail call { double, double } @ctanh(double %0, double %1)
ret { double, double } %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
main() {
  int I, SOMMA;
  SOMMA = 0;
  I = 1;
  while (I <= 100) {
    SOMMA = SOMMA + I;
    I = I + 1;
  }
  printf("\n %d", SOMMA);
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     115e <main+0x3e>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x13ba,%esi
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"\0A %d\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 1, i32* %2
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 100
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0A %d\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 5050)
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int tgetflag(id)
char *id;
{
  if (find(id, ':')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tgetflag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
mov    $0x0,%al
call   1030 <find@plt>
cmp    $0x0,%eax
je     1141 <tgetflag+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <tgetflag+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tgetflag>:
push   %rax
mov    $0x3a,%esi
xor    %eax,%eax
call   1030 <find@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tgetflag(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @find to i32 (i8*, i32, ...)*)(i8* %4, i32 58)
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @tgetflag(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @find to i32 (i8*, i32, ...)*)(i8* %0, i32 58)
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int log2f(float);
unsigned frequencyToMidiNote(float f) {
  return (unsigned)(69 + (12 * log2f(f / 440.0)));
}


x86 assembly (clang, -O0):
<frequencyToMidiNote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <log2f@plt>
imul   $0xc,%eax,%eax
add    $0x45,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frequencyToMidiNote>:
push   %rax
divss  0xee7(%rip),%xmm0
call   1030 <log2f@plt>
lea    (%rax,%rax,2),%eax
lea    0x45(,%rax,4),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @frequencyToMidiNote(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 4.400000e+02
%6 = fptrunc double %5 to float
%7 = call i32 @log2f(float %6)
%8 = mul nsw i32 12, %7
%9 = add nsw i32 69, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @frequencyToMidiNote(float %0) {
%2 = fdiv float %0, 4.400000e+02
%3 = tail call i32 @log2f(float %2)
%4 = mul nsw i32 %3, 12
%5 = add nsw i32 %4, 69
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void is_hidden() { printf("hidden one\n"); }


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

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

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

LLVM IR (-O2):
@str = [11 x i8] c"hidden one\00"
define void @is_hidden() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
ret void
}
void swap(int a[], int index1, int index2) {
  int temp = a[index1];
  a[index1] = a[index2];
  a[index2] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void smp_cache_call(unsigned long opr_mask, unsigned long addr,
                    unsigned long end) {}


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

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

LLVM IR (-O0):
define void @smp_cache_call(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @smp_cache_call(i64 %0, i64 %1, i64 %2) {
ret void
}
void foo_1_2_1_1_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_2_1_1_1_2_1_1_1() {
ret void
}
void g_tree_height() {}


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

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

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

LLVM IR (-O2):
define void @g_tree_height() {
ret void
}
int registerFunc(int argc, char **argv) {}


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

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

LLVM IR (-O0):
define i32 @registerFunc(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @registerFunc(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int yas_bma250_write_reg(unsigned char, unsigned char *, int);
int yas_bma250_write_reg_byte(int adr, int val) {
  return yas_bma250_write_reg((unsigned char)adr, (unsigned char *)&val, 1);
}


x86 assembly (clang, -O0):
<yas_bma250_write_reg_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
movzbl %al,%edi
call   1030 <yas_bma250_write_reg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yas_bma250_write_reg_byte>:
push   %rax
mov    %esi,0x4(%rsp)
movzbl %dil,%edi
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <yas_bma250_write_reg@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @yas_bma250_write_reg_byte(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 = trunc i32 %5 to i8
%7 = bitcast i32* %4 to i8*
%8 = call i32 @yas_bma250_write_reg(i8 zeroext %6, i8* %7, i32 1)
ret i32 %8
}

LLVM IR (-O2):
define i32 @yas_bma250_write_reg_byte(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = trunc i32 %0 to i8
%5 = bitcast i32* %3 to i8*
%6 = call i32 @yas_bma250_write_reg(i8 zeroext %4, i8* %5, i32 1)
ret i32 %6
}
void free(void *ptr) {
  asm volatile("movl $0x5, %%eax; int $0x80"
               :
               : "b"(ptr)
               : "%eax", "ecx", "edx", "cc", "memory");
}


x86 assembly (clang, -O0):
<free>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rbx
mov    $0x5,%eax
int    $0x80
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<free>:
push   %rbx
mov    %rdi,%rbx
mov    $0x5,%eax
int    $0x80
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free(i8* %0) {
tail call void asm sideeffect "movl $$0x5, %eax; int $$0x80", "{bx},~{eax},~{ecx},~{edx},~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
/* Type definitions */
struct remote_msg_t {
  int dummy;
};

/* Variables and functions */
size_t write(int, struct remote_msg_t *, int);
size_t fn_send(int fd, struct remote_msg_t *msg) { return write(fd, msg, 15); }


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

x86 assembly (clang, -O2):
<fn_send>:
mov    $0xf,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
%struct.remote_msg_t = type { i32 }
define i64 @fn_send(i32 %0, %struct.remote_msg_t* %1) {
%3 = alloca i32
%4 = alloca %struct.remote_msg_t*
store i32 %0, i32* %3
store %struct.remote_msg_t* %1, %struct.remote_msg_t** %4
%5 = load i32, i32* %3
%6 = load %struct.remote_msg_t*, %struct.remote_msg_t** %4
%7 = call i64 @write(i32 %5, %struct.remote_msg_t* %6, i32 15)
ret i64 %7
}

LLVM IR (-O2):
%struct.remote_msg_t = type { i32 }
define i64 @fn_send(i32 %0, %struct.remote_msg_t* nocapture %1) {
%3 = tail call i64 @write(i32 %0, %struct.remote_msg_t* %1, i32 15)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
void line_Comment(FILE *source_file) {
  int c = fgetc(source_file);
  while ((10 != c) && (13 != c)) {
    c = fgetc(source_file);
  }
}


x86 assembly (clang, -O0):
<line_Comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
mov    $0xa,%ecx
cmp    -0xc(%rbp),%ecx
mov    %al,-0xd(%rbp)
je     1149 <line_Comment+0x39>
mov    $0xd,%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1159 <line_Comment+0x49>
jmp    116a <line_Comment+0x5a>
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
jmp    1128 <line_Comment+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line_Comment>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xd,%eax
je     1132 <line_Comment+0x22>
cmp    $0xa,%eax
jne    1120 <line_Comment+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @line_Comment(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %14, %1
%7 = load i32, i32* %3
%8 = icmp ne i32 10, %7
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp ne i32 13, %10
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %17
14: ; preds = %12
%15 = load i32*, i32** %2
%16 = call i32 @fgetc(i32* %15)
store i32 %16, i32* %3
br label %6
17: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @line_Comment(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
switch i32 %3, label %2 [
i32 13, label %4
i32 10, label %4
]
4: ; preds = %2, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _XReply() {
  printf("_XReply called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"_XReply called\00"
define i32 @_XReply() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int biFg(char *name, char **args, char **environ) {
  printf("Not realized\n");
  return 1;
}


x86 assembly (clang, -O0):
<biFg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Not realized\00"
define i32 @biFg(i8* nocapture readnone %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
double __infer_nondet_double();
double floor(double x) { return __infer_nondet_double(); }


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

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

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

LLVM IR (-O2):
define double @floor(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Introduction() {
  printf("Welcome to The Land of CS 344 Adventure.\n\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [43 x i8] c"Welcome to The Land of CS 344 Adventure.\0A\0A\00"
define void @Introduction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [42 x i8] c"Welcome to The Land of CS 344 Adventure.\0A\00"
define void @Introduction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char getc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void exp_commands() {
  char command = '!', mid = ' ';
  do {
    command = getc(stdin);
    if (command == mid)
      break;
    mid = command;
  } while (command == '!');
}


x86 assembly (clang, -O0):
<exp_commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x21,-0x1(%rbp)
movb   $0x20,-0x2(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%edi
call   1030 <getc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
jne    1146 <exp_commands+0x36>
jmp    1159 <exp_commands+0x49>
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x21,%eax
je     1120 <exp_commands+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_commands>:
push   %rbx
mov    0x2ed0(%rip),%rbx
mov    (%rbx),%edi
call   1030 <getc@plt>
cmp    $0x21,%al
jne    112b <exp_commands+0x1b>
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <getc@plt>
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define void @exp_commands() {
%1 = alloca i8
%2 = alloca i8
store i8 33, i8* %1
store i8 32, i8* %2
br label %3
3: ; preds = %14, %0
%4 = load i32, i32* @stdin
%5 = call signext i8 @getc(i32 %4)
store i8 %5, i8* %1
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %3
br label %18
12: ; preds = %3
%13 = load i8, i8* %1
store i8 %13, i8* %2
br label %14
14: ; preds = %12
%15 = load i8, i8* %1
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 33
br i1 %17, label %3, label %18
18: ; preds = %14, %11
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
define void @exp_commands() {
%1 = load i32, i32* @stdin
%2 = tail call signext i8 @getc(i32 %1)
%3 = icmp eq i8 %2, 33
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = load i32, i32* @stdin
%6 = tail call signext i8 @getc(i32 %5)
br label %7
7: ; preds = %4, %0
ret void
}
unsigned int step(unsigned int x) {
  if (x % 2 == 0) {
    return (x / 2);
  } else {
    return (3 * x + 1);
  }
}


x86 assembly (clang, -O0):
<step>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1124 <step+0x24>
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <step+0x2e>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<step>:
mov    %edi,%ecx
shr    %ecx
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @step(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = lshr i32 %0, 1
%5 = mul i32 %0, 3
%6 = add i32 %5, 1
%7 = select i1 %3, i32 %4, i32 %6
ret i32 %7
}