xunge/DecIR huggingface dataset:
void wait() {
  int i = 0;
  for (; i < 0x1FFFFFFF; i++)
    ;
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1fffffff,-0x4(%rbp)
jge    112b <wait+0x2b>
jmp    111d <wait+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <wait+0xb>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @wait() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void deleteMemory(void *Memory) { free(Memory); }


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

x86 assembly (clang, -O2):
<deleteMemory>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @deleteMemory(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void notused() {}


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

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

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

LLVM IR (-O2):
define void @notused() {
ret void
}
int delete_tkwindow() { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @delete_tkwindow() {
ret i32 1
}
/* Variables and functions */
size_t strutil_index_of(char *string, char character) {
  size_t i = 0;
  while (string[i] != character && string[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<strutil_index_of>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
movsbl -0x9(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
je     1148 <strutil_index_of+0x48>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1158 <strutil_index_of+0x58>
jmp    1169 <strutil_index_of+0x69>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <strutil_index_of+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strutil_index_of>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
cmp    %sil,%cl
je     1122 <strutil_index_of+0x22>
test   %cl,%cl
jne    1110 <strutil_index_of+0x10>
ret

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

LLVM IR (-O2):
define i64 @strutil_index_of(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %10, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = icmp eq i8 %6, 0
%9 = or i1 %7, %8
%10 = add i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[5][5];
  int(*p)[4];
  p = a;
  printf("%d\n", &p[4][2] - &a[4][2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
add    $0x40,%rax
add    $0x8,%rax
lea    -0x70(%rbp),%rcx
add    $0x50,%rcx
add    $0x8,%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%esi
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ clr_gui_vfx(long, long);
void clr_gui_vfx_all(void) {
  long x, y;
  for (y = 0; y < (20 * 4); y++)
    for (x = 0; x < (20 * 4); x++)
      clr_gui_vfx(x, y);
}


x86 assembly (clang, -O0):
<clr_gui_vfx_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x10(%rbp)
cmpq   $0x50,-0x10(%rbp)
jge    1172 <clr_gui_vfx_all+0x62>
movq   $0x0,-0x8(%rbp)
cmpq   $0x50,-0x8(%rbp)
jge    115c <clr_gui_vfx_all+0x4c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <clr_gui_vfx@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1133 <clr_gui_vfx_all+0x23>
jmp    1161 <clr_gui_vfx_all+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <clr_gui_vfx_all+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_gui_vfx_all>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <clr_gui_vfx@plt>
add    $0x1,%rbx
cmp    $0x50,%rbx
jne    1130 <clr_gui_vfx_all+0x20>
add    $0x1,%r14
cmp    $0x50,%r14
jne    1120 <clr_gui_vfx_all+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @clr_gui_vfx_all() {
br label %1
1: ; preds = %0, %8
%2 = phi i64 [ 0, %0 ], [ %9, %8 ]
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %6, %3 ]
%5 = tail call i32 @clr_gui_vfx(i64 %4, i64 %2)
%6 = add nuw nsw i64 %4, 1
%7 = icmp eq i64 %6, 80
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = add nuw nsw i64 %2, 1
%10 = icmp eq i64 %9, 80
br i1 %10, label %11, label %1
11: ; preds = %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _pmu(int);
int pigpio_command(int, int, unsigned int, unsigned int, int /*<<< orphan*/);
int recvMax(int, char *, unsigned int, int);
int file_read(int pi, unsigned handle, char *buf, unsigned count) {
  int bytes;
  bytes = pigpio_command(pi, 106, handle, count, 0);
  if (bytes > 0) {
    bytes = recvMax(pi, buf, count, bytes);
  }
  _pmu(pi);
  return bytes;
}


x86 assembly (clang, -O0):
<file_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    $0x6a,%esi
xor    %r8d,%r8d
call   1040 <pigpio_command@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    117d <file_read+0x4d>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1050 <recvMax@plt>
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <_pmu@plt>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_read>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%edx
mov    %edi,%ebx
mov    $0x6a,%esi
xor    %r8d,%r8d
call   1040 <pigpio_command@plt>
mov    %eax,%ebp
test   %eax,%eax
jle    1165 <file_read+0x35>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14d,%edx
mov    %ebp,%ecx
call   1050 <recvMax@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <_pmu@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @file_read(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = tail call i32 @pigpio_command(i32 %0, i32 106, i32 %1, i32 %3, i32 0)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @recvMax(i32 %0, i8* %2, i32 %3, i32 %5)
br label %9
9: ; preds = %7, %4
%10 = phi i32 [ %8, %7 ], [ %5, %4 ]
%11 = tail call i32 @_pmu(i32 %0)
ret i32 %10
}
/* Variables and functions */
int __builtin_mips_cabs_ngt_d(double, double);
int test15(double a, double b) { return __builtin_mips_cabs_ngt_d(a, b); }


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

x86 assembly (clang, -O2):
<test15>:
jmp    1030 <__builtin_mips_cabs_ngt_d@plt>

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

LLVM IR (-O2):
define i32 @test15(double %0, double %1) {
%3 = tail call i32 @__builtin_mips_cabs_ngt_d(double %0, double %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xa3() {
  Assert_real((isspace(163) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              820, ("isspace should be 0 for 0xa3"));
}


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

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

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

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


x86 assembly (clang, -O0):
<mutate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i8** @mutate(i32 %0, i32 %1, i8** nocapture readnone %2) {
ret i8** undef
}
char is_type_r(int inst) { return !(inst & 0xFC000000 != 0); }


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

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

LLVM IR (-O0):
define signext i8 @is_type_r(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @is_type_r(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = and i8 %2, 1
%4 = xor i8 %3, 1
ret i8 %4
}
int max(int misc, int other) { return (misc > other) ? misc : other; }


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

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

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ get_mem(int);
int /*<<< orphan*/ id_to_rom_size(int /*<<< orphan*/);
uint16_t get_rom_size() {
  uint8_t id = get_mem(0x0148);
  return id_to_rom_size(id);
}


x86 assembly (clang, -O0):
<get_rom_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x148,%edi
call   1040 <get_mem@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <id_to_rom_size@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rom_size>:
push   %rax
mov    $0x148,%edi
call   1040 <get_mem@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <id_to_rom_size@plt>

LLVM IR (-O0):
define i32 @get_rom_size() {
%1 = alloca i32
%2 = call i32 @get_mem(i32 328)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @id_to_rom_size(i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_rom_size() {
%1 = tail call i32 @get_mem(i32 328)
%2 = tail call i32 @id_to_rom_size(i32 %1)
ret i32 %2
}
double CMtoMM(double CM) { return CM * 10; }


x86 assembly (clang, -O0):
<CMtoMM>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMtoMM>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @CMtoMM(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.000000e+01
ret double %4
}

LLVM IR (-O2):
define double @CMtoMM(double %0) {
%2 = fmul double %0, 1.000000e+01
ret double %2
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_is_nullfunc(__le16 fc) {
  return (fc & cpu_to_le16(0x000c | 0x00f0)) == cpu_to_le16(0x0008 | 0x0040);
}


x86 assembly (clang, -O0):
<ieee80211_is_nullfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x48,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_is_nullfunc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0xfc,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ebp
and    %ebx,%ebp
mov    $0x48,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
cmp    %eax,%ebp
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ieee80211_is_nullfunc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 252)
%5 = and i32 %3, %4
%6 = call i32 @cpu_to_le16(i32 72)
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @ieee80211_is_nullfunc(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 252)
%3 = and i32 %2, %0
%4 = tail call i32 @cpu_to_le16(i32 72)
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned int getHash(const char *key) {
  unsigned int hash;
  for (hash = 0; *key != '\0'; key++)
    hash += *key + (hash << 5);
  return hash % 64;
}


x86 assembly (clang, -O0):
<getHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <getHash+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <getHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x3f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <getHash+0x2b>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movzbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <getHash+0x10>
and    $0x3f,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @getHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = zext i8 %5 to i32
%9 = mul i32 %6, 33
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %10, 63
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
scalar_t__ ceil(double);
double drand48();
double pow(double, int);
int Power_law_no_hops(double delta, double H) {
  int hop;
  double ran;
  ran = drand48();
  hop = (int)ceil(delta * pow(ran, 1 / H));
  return (hop);
}


x86 assembly (clang, -O0):
<Power_law_no_hops>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1050 <drand48@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe9b(%rip),%xmm1
divsd  -0x10(%rbp),%xmm1
cvttsd2si %xmm1,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Power_law_no_hops>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
xor    %eax,%eax
call   1050 <drand48@plt>
movsd  0xeb1(%rip),%xmm1
divsd  0x8(%rsp),%xmm1
cvttsd2si %xmm1,%edi
call   1040 <pow@plt>
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @Power_law_no_hops(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store double %1, double* %4
%7 = call double (...) @drand48()
store double %7, double* %6
%8 = load double, double* %3
%9 = load double, double* %6
%10 = load double, double* %4
%11 = fdiv double 1.000000e+00, %10
%12 = fptosi double %11 to i32
%13 = call double @pow(double %9, i32 %12)
%14 = fmul double %8, %13
%15 = call i64 @ceil(double %14)
%16 = trunc i64 %15 to i32
store i32 %16, i32* %5
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
define i32 @Power_law_no_hops(double %0, double %1) {
%3 = tail call double (...) @drand48()
%4 = fdiv double 1.000000e+00, %1
%5 = fptosi double %4 to i32
%6 = tail call double @pow(double %3, i32 %5)
%7 = fmul double %6, %0
%8 = tail call i64 @ceil(double %7)
%9 = trunc i64 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char const *, char const *);
void arg1_handler(int index, const char *arg_name_, const char *arg_val_) {
  printf("arg_handler1 val:[%d %s %s]\n", index, arg_name_, arg_val_);
}


x86 assembly (clang, -O0):
<arg1_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg1_handler>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"arg_handler1 val:[%d %s %s]\0A\00"
define void @arg1_handler(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"arg_handler1 val:[%d %s %s]\0A\00"
define void @arg1_handler(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i8* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int /*<<< orphan*/ top;
};
typedef TYPE_1__ ERR_STATE;

/* Variables and functions */
int /*<<< orphan*/ err_clear(TYPE_1__ *, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int /*<<< orphan*/ err_get_slot(TYPE_1__ *);
TYPE_1__ *err_get_state_int();
void ERR_new(void) {
  ERR_STATE *es;
  es = err_get_state_int();
  if (es == NULL)
    return;
  err_get_slot(es);
  err_clear(es, es->top, 0);
}


x86 assembly (clang, -O0):
<ERR_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <err_get_state_int@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <ERR_new+0x23>
jmp    116d <ERR_new+0x3d>
mov    -0x8(%rbp),%rdi
call   1030 <err_get_slot@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <err_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERR_new>:
push   %rbx
xor    %eax,%eax
call   1050 <err_get_state_int@plt>
test   %rax,%rax
je     1155 <ERR_new+0x25>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <err_get_slot@plt>
mov    (%rbx),%esi
mov    %rbx,%rdi
xor    %edx,%edx
pop    %rbx
jmp    1040 <err_clear@plt>
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32 }
define void @ERR_new() {
%1 = alloca %struct.TYPE_5__*
%2 = call %struct.TYPE_5__* (...) @err_get_state_int()
store %struct.TYPE_5__* %2, %struct.TYPE_5__** %1
%3 = load %struct.TYPE_5__*, %struct.TYPE_5__** %1
%4 = icmp eq %struct.TYPE_5__* %3, null
br i1 %4, label %5, label %6
5: ; preds = %0
br label %14
6: ; preds = %0
%7 = load %struct.TYPE_5__*, %struct.TYPE_5__** %1
%8 = call i32 @err_get_slot(%struct.TYPE_5__* %7)
%9 = load %struct.TYPE_5__*, %struct.TYPE_5__** %1
%10 = load %struct.TYPE_5__*, %struct.TYPE_5__** %1
%11 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @err_clear(%struct.TYPE_5__* %9, i32 %12, i32 0)
br label %14
14: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32 }
define void @ERR_new() {
%1 = tail call %struct.TYPE_5__* (...) @err_get_state_int()
%2 = icmp eq %struct.TYPE_5__* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @err_get_slot(%struct.TYPE_5__* %1)
%5 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @err_clear(%struct.TYPE_5__* %1, i32 %6, i32 0)
br label %8
8: ; preds = %0, %3
ret void
}
void err_unboundvar(s) const char *s;
{ report_error("%s: unbound variable", s); }


x86 assembly (clang, -O0):
<err_unboundvar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<err_unboundvar>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <report_error@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s: unbound variable\00"
define void @err_unboundvar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @report_error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s: unbound variable\00"
define void @err_unboundvar(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @report_error to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void envoyerTrame(int socket, char *message) {
  char *trame = (char *)malloc(sizeof(message) + 2);
  sprintf(trame, "%c%s%c", 0x02, message, 0x03);
  write(socket, trame, strlen(trame));
}


x86 assembly (clang, -O0):
<envoyerTrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rcx
lea    0xe94(%rip),%rsi
mov    $0x2,%edx
mov    $0x3,%r8d
mov    $0x0,%al
call   1060 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
mov    $0x0,%al
call   1030 <write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<envoyerTrame>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%r14d
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbp
lea    0xea2(%rip),%rsi
mov    %rax,%rdi
mov    $0x2,%edx
mov    %rbx,%rcx
mov    $0x3,%r8d
xor    %eax,%eax
call   1060 <sprintf@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %rax,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%c%s%c\00"
define void @envoyerTrame(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call i8* @malloc(i64 10)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, i8* %8, i32 3)
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i8*, i8** %5
%13 = call i64 @strlen(i8* %12)
%14 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %10, i8* %11, i64 %13)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%c%s%c\00"
define void @envoyerTrame(i32 %0, i8* %1) {
%3 = tail call dereferenceable_or_null(10) i8* @malloc(i64 10)
%4 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2, i8* %1, i32 3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%6 = tail call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %0, i8* %3, i64 %5)
ret void
}
/* Variables and functions */
float circular_in(float, float, float);
float circular_f_in(float step, float max_steps, float max_val) {
  return circular_in(step, max_steps, max_val);
}


x86 assembly (clang, -O0):
<circular_f_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
call   1030 <circular_in@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<circular_f_in>:
jmp    1030 <circular_in@plt>

LLVM IR (-O0):
define float @circular_f_in(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @circular_in(float %7, float %8, float %9)
ret float %10
}

LLVM IR (-O2):
define float @circular_f_in(float %0, float %1, float %2) {
%4 = tail call float @circular_in(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
double log(int);
double fpu_fyl2x(double a, double b) {
  double c;
  c = b * (log(a) / log(2));
  return c;
}


x86 assembly (clang, -O0):
<fpu_fyl2x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
cvttsd2si -0x8(%rbp),%edi
call   1030 <log@plt>
movsd  %xmm0,-0x28(%rbp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  -0x28(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpu_fyl2x>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
mov    $0x2,%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
mulsd  0x10(%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fpu_fyl2x(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fptosi double %7 to i32
%9 = call double @log(i32 %8)
%10 = call double @log(i32 2)
%11 = fdiv double %9, %10
%12 = fmul double %6, %11
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @fpu_fyl2x(double %0, double %1) {
%3 = fptosi double %0 to i32
%4 = tail call double @log(i32 %3)
%5 = tail call double @log(i32 2)
%6 = fdiv double %4, %5
%7 = fmul double %6, %1
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int very_big();
int main() {
  int num = very_big();
  printf("Result: 0x%x\n", num);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"Result: 0x%x\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @very_big()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int ftruncate(int, int /*<<< orphan*/);
int native_fallocate(int fd, uint64_t len) { return ftruncate(fd, len); }


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

x86 assembly (clang, -O2):
<native_fallocate>:
jmp    1030 <ftruncate@plt>

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

LLVM IR (-O2):
define i32 @native_fallocate(i32 %0, i32 %1) {
%3 = tail call i32 @ftruncate(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t simple_hash(const void *key, uint32_t size) {
  uintptr_t k = (uintptr_t)key;
  return ((13 + k) * 6367) % size;
}


x86 assembly (clang, -O0):
<simple_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xd,%rax
imul   $0x18df,%rax,%rax
movslq -0xc(%rbp),%rcx
xor    %edx,%edx
div    %rcx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_hash>:
imul   $0x18df,%rdi,%rax
add    $0x14353,%rax
movslq %esi,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     1125 <simple_hash+0x25>
xor    %edx,%edx
div    %rcx
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @simple_hash(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = add i64 13, %8
%10 = mul i64 %9, 6367
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = urem i64 %10, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @simple_hash(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = mul i64 %3, 6367
%5 = add i64 %4, 82771
%6 = sext i32 %1 to i64
%7 = urem i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}
void entry_no_free(void *e) {}


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

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

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

LLVM IR (-O2):
define void @entry_no_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_mem(void **);
void c_destructor(void **tag, void **cell) {
  if (*tag == *cell) {
    free_mem(tag);
  } else {
    free_mem(tag);
    free_mem(cell);
  }
}


x86 assembly (clang, -O0):
<c_destructor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jne    1142 <c_destructor+0x32>
mov    -0x8(%rbp),%rdi
call   1030 <free_mem@plt>
jmp    1154 <c_destructor+0x44>
mov    -0x8(%rbp),%rdi
call   1030 <free_mem@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free_mem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_destructor>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%r14
mov    (%rsi),%r15
call   1030 <free_mem@plt>
cmp    %r15,%r14
je     1135 <c_destructor+0x25>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free_mem@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @c_destructor(i8** %0, i8** %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = icmp eq i8* %3, %4
%6 = tail call i32 @free_mem(i8** %0)
br i1 %5, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @free_mem(i8** %1)
br label %9
9: ; preds = %2, %7
ret void
}
__attribute__((always_)) int strcmp(const char *cs, const char *ct) {
  int d0, d1;
  register int __res;
  __asm__ __volatile__("1:\tlodsb\n\t"
                       "scasb\n\t"
                       "jne 2f\n\t"
                       "testb %%al,%%al\n\t"
                       "jne 1b\n\t"
                       "xorl %%eax,%%eax\n\t"
                       "jmp 3f\n"
                       "2:\tsbbl %%eax,%%eax\n\t"
                       "orb $1,%%al\n"
                       "3:"
                       : "=a"(__res), "=&S"(d0), "=&D"(d1)
                       : "1"(cs), "2"(ct)
                       : "memory");
  return __res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112b <strcmp+0x2b>
test   %al,%al
jne    1114 <strcmp+0x14>
xor    %eax,%eax
jmp    112f <strcmp+0x2f>
sbb    %eax,%eax
or     $0x1,%al
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x14(%rbp)
mov    %edi,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1115 <strcmp+0x15>
test   %al,%al
jne    1109 <strcmp+0x9>
xor    %eax,%eax
jmp    1119 <strcmp+0x19>
sbb    %eax,%eax
or     $0x1,%al
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i32, i8*, i8* } %10, 0
%12 = extractvalue { i32, i8*, i8* } %10, 1
%13 = extractvalue { i32, i8*, i8* } %10, 2
store i32 %11, i32* %7
%14 = ptrtoint i8* %12 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %13 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i32, i8*, i8* } %3, 0
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void platform_delay(uint32_t ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<platform_delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @platform_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @platform_delay(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
double fabs(a)
double a;
{ return (a < 0 ? -a : a); }


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ pmemccpy(char *, char const *, int /*<<< orphan*/, int);
char *strcpy(char *s1, const char *s2) {
  char *os1;
  os1 = s1;
  while (!pmemccpy(s1, s2, 0, 10000)) {
    s1 += 10000;
    s2 += 10000;
  }
  return os1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x2710,%ecx
call   1030 <pmemccpy@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1151 <strcpy+0x41>
jmp    1172 <strcpy+0x62>
mov    -0x8(%rbp),%rax
add    $0x2710,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x2710,%rax
mov    %rax,-0x10(%rbp)
jmp    1128 <strcpy+0x18>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
xor    %edx,%edx
mov    $0x2710,%ecx
call   1030 <pmemccpy@plt>
test   %eax,%eax
jne    1164 <strcpy+0x54>
lea    0x2710(%r14),%rbx
add    $0x2710,%r15
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %edx,%edx
mov    $0x2710,%ecx
call   1030 <pmemccpy@plt>
add    $0x2710,%rbx
add    $0x2710,%r15
test   %eax,%eax
je     1140 <strcpy+0x30>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %13, %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @pmemccpy(i8* %8, i8* %9, i32 0, i32 10000)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %18
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 10000
store i8* %15, i8** %3
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 10000
store i8* %17, i8** %4
br label %7
18: ; preds = %7
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @strcpy(i8* returned %0, i8* %1) {
%3 = tail call i32 @pmemccpy(i8* %0, i8* %1, i32 0, i32 10000)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %0, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 10000
%9 = getelementptr inbounds i8, i8* %7, i64 10000
%10 = tail call i32 @pmemccpy(i8* %8, i8* %9, i32 0, i32 10000)
%11 = icmp eq i32 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %5, %2
ret i8* %0
}
int sscanf(const char *_s, const char *_format, ...) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @sscanf(i8* nocapture readnone %0, i8* nocapture readnone %1, ...) {
ret i32 0
}