xunge/DecIR huggingface dataset:
/* Variables and functions */
int find_type(char const *);
int is_sound_file(const char *name) { return find_type(name) != -1 ? 1 : 0; }


x86 assembly (clang, -O0):
<is_sound_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <find_type@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0xffffffff,%edx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sound_file>:
push   %rax
call   1030 <find_type@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_sound_file(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @find_type(i8* %3)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_sound_file(i8* %0) {
%2 = tail call i32 @find_type(i8* %0)
%3 = icmp ne i32 %2, -1
%4 = zext i1 %3 to i32
ret i32 %4
}
int compare(const void *a, const void *b) { return *(int *)b - *(int *)a; }


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

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
unsigned long pjw_hash(const char *s) {
  unsigned long h = 0;
  unsigned long high = 0;
  while (*s) {
    h = (h << 4) + *s++;
    if ((high = h & 0xF0000000)) {
      h ^= high >> 24;
    }
    h &= ~high;
  }
  return h;
}


x86 assembly (clang, -O0):
<pjw_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1188 <pjw_hash+0x88>
mov    -0x10(%rbp),%rax
shl    $0x4,%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movabs $0xf0000000,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1173 <pjw_hash+0x73>
mov    -0x18(%rbp),%rax
shr    $0x18,%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <pjw_hash+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pjw_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113e <pjw_hash+0x3e>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
shl    $0x4,%rax
movsbq %cl,%rcx
add    %rax,%rcx
mov    %ecx,%eax
and    $0xf0000000,%eax
mov    %rax,%rdx
shr    $0x18,%rdx
xor    %rcx,%rdx
not    %rax
and    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <pjw_hash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @pjw_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %17, %4 ], [ %2, %1 ]
%6 = phi i64 [ %16, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i64 %6, 4
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i64
%11 = add i64 %8, %10
%12 = and i64 %11, 4026531840
%13 = lshr exact i64 %12, 24
%14 = xor i64 %13, %11
%15 = xor i64 %12, -1
%16 = and i64 %14, %15
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %4
19: ; preds = %4, %1
%20 = phi i64 [ 0, %1 ], [ %16, %4 ]
ret i64 %20
}
/* Variables and functions */
int /*<<< orphan*/ init_palette();
int /*<<< orphan*/ init_screen(char *, int, int);
int /*<<< orphan*/ io_hlt();
void HariMain(void) {
  char *vram;
  int xsize, ysize;
  short *binfo_scrnx, *binfo_scrny;
  int *binfo_vram;
  init_palette();
  binfo_scrnx = (short *)0x0ff4;
  binfo_scrny = (short *)0x0ff6;
  binfo_vram = (int *)0x0ff8;
  xsize = *binfo_scrnx;
  ysize = *binfo_scrny;
  vram = (char *)*binfo_vram;
  init_screen(vram, xsize, ysize);
  for (;;) {
    io_hlt();
  }
}


x86 assembly (clang, -O0):
<HariMain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x0,%al
call   1050 <init_palette@plt>
mov    $0xff4,%eax
mov    %rax,-0x18(%rbp)
mov    $0xff6,%eax
mov    %rax,-0x20(%rbp)
mov    $0xff8,%eax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x20(%rbp),%rax
movswl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x28(%rbp),%rax
movslq (%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <init_screen@plt>
mov    $0x0,%al
call   1040 <io_hlt@plt>
jmp    1188 <HariMain+0x58>

x86 assembly (clang, -O2):
<HariMain>:
push   %rax
xor    %eax,%eax
call   1050 <init_palette@plt>
movswl 0xff4,%esi
movswl 0xff6,%edx
movslq 0xff8,%rdi
call   1030 <init_screen@plt>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <io_hlt@plt>
jmp    1160 <HariMain+0x30>

LLVM IR (-O0):
define void @HariMain() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i32*
%7 = call i32 (...) @init_palette()
store i16* inttoptr (i64 4084 to i16*), i16** %4
store i16* inttoptr (i64 4086 to i16*), i16** %5
store i32* inttoptr (i64 4088 to i32*), i32** %6
%8 = load i16*, i16** %4
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
store i32 %10, i32* %2
%11 = load i16*, i16** %5
%12 = load i16, i16* %11
%13 = sext i16 %12 to i32
store i32 %13, i32* %3
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %1
%18 = load i8*, i8** %1
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @init_screen(i8* %18, i32 %19, i32 %20)
br label %22
22: ; preds = %22, %0
%23 = call i32 (...) @io_hlt()
br label %22
}

LLVM IR (-O2):
define void @HariMain() {
%1 = tail call i32 (...) @init_palette()
%2 = load i16, i16* inttoptr (i64 4084 to i16*)
%3 = sext i16 %2 to i32
%4 = load i16, i16* inttoptr (i64 4086 to i16*)
%5 = sext i16 %4 to i32
%6 = load i32, i32* inttoptr (i64 4088 to i32*)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @init_screen(i8* %8, i32 %3, i32 %5)
br label %10
10: ; preds = %10, %0
%11 = tail call i32 (...) @io_hlt()
br label %10
}
/* Variables and functions */
int geteuid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
void print_user() { printf("euid = %4d uid = %4d\n", geteuid(), getuid()); }


x86 assembly (clang, -O0):
<print_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_user>:
push   %rbx
xor    %eax,%eax
call   1050 <geteuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getuid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"euid = %4d uid = %4d\0A\00"
define void @print_user() {
%1 = call i32 (...) @geteuid()
%2 = call i32 (...) @getuid()
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"euid = %4d uid = %4d\0A\00"
define void @print_user() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call i32 (...) @getuid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
int _pico_strchcount(char *str, int ch) {
  int count = 0;
  while (*str++)
    if (*str == ch)
      count++;
  return count;
}


x86 assembly (clang, -O0):
<_pico_strchcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1148 <_pico_strchcount+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1143 <_pico_strchcount+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <_pico_strchcount+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pico_strchcount>:
cmpb   $0x0,(%rdi)
je     1125 <_pico_strchcount+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsbl (%rdi),%ecx
xor    %edx,%edx
cmp    %esi,%ecx
sete   %dl
add    %edx,%eax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <_pico_strchcount+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @_pico_strchcount(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %8, %5 ], [ %0, %2 ]
%7 = phi i32 [ %13, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, %1
%12 = zext i1 %11 to i32
%13 = add nuw nsw i32 %7, %12
%14 = icmp eq i8 %9, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int n;
  int triangularNumber = 0;
  for (n = 1; n <= 200; triangularNumber += n, n++)
    ;
  printf("The 200th triangular number is %i\n", triangularNumber);
  return 0;
}


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   $0xc8,-0x8(%rbp)
jg     1156 <main+0x46>
jmp    113f <main+0x2f>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\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 = %8, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 200
br i1 %6, label %7, label %14
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
%16 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The 200th triangular number is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 20100)
ret i32 0
}
int test_imm_7Dint64_lowword_mem(long long *val) {
  return ((*val) & (0x7D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Dint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 125
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
long Long__PLUS_(long x, long y) { return x + y; }


x86 assembly (clang, -O0):
<Long__PLUS_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @Long__PLUS_(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @Long__PLUS_(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char, int);
int /*<<< orphan*/ stderr;
void v(int x) { fprintf(stderr, "%c%d\n", 'v', x); }


x86 assembly (clang, -O0):
<v>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%ecx
lea    0xed2(%rip),%rsi
mov    $0x76,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v>:
mov    %edi,%ecx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
mov    $0x76,%edx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @v(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 118, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%c%d\0A\00"
define void @v(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 118, i32 %0)
ret void
}
double k2c(double tkelvin) {
  double tcelsius;
  tcelsius = tkelvin - 273.15;
  return (tcelsius);
}


x86 assembly (clang, -O0):
<k2c>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @k2c(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fsub double %4, 2.731500e+02
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @k2c(double %0) {
%2 = fadd double %0, -2.731500e+02
ret double %2
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t EEPROMSizeGet(void) {
  return ((((((*((volatile unsigned long *)(0x400AF000)))) & 0x0000FFFF) >> 0) *
           4));
}


x86 assembly (clang, -O0):
<EEPROMSizeGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400af000,%eax
mov    (%rax),%rax
and    $0xffff,%rax
shr    $0x0,%rax
shl    $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMSizeGet>:
mov    0x400af000,%rax
40
movzwl %ax,%eax
shl    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @EEPROMSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%2 = and i64 %1, 65535
%3 = lshr i64 %2, 0
%4 = mul i64 %3, 4
ret i64 %4
}

LLVM IR (-O2):
define i64 @EEPROMSizeGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074458624 to i64*)
%2 = shl i64 %1, 2
%3 = and i64 %2, 262140
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *handleShutdown(void *void_ptr) {
  int *sd = (int *)void_ptr;
  sleep(9);
  printf("Goodbye!\n");
  close(*sd);
  exit(1);
}


x86 assembly (clang, -O0):
<handleShutdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x9,%edi
call   1060 <sleep@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1040 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handleShutdown>:
push   %rbx
mov    %rdi,%rbx
mov    $0x9,%edi
call   1060 <sleep@plt>
lea    0xeab(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
call   1040 <close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Goodbye!\0A\00"
define i8* @handleShutdown(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = call i32 @sleep(i32 9)
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @close(i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [9 x i8] c"Goodbye!\00"
define noalias i8* @handleShutdown(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @sleep(i32 9)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = tail call i32 @close(i32 %5)
%7 = tail call i32 @exit(i32 1)
unreachable
}
float get_PBS(double in_t_1, double in_t_2, double out_t) {
  float PBS;
  PBS = ((in_t_1 + in_t_2 - out_t) / 2.);
  return PBS;
}


x86 assembly (clang, -O0):
<get_PBS>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_PBS>:
addsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
mulsd  0xef0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @get_PBS(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca float
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %4
%9 = load double, double* %5
%10 = fadd double %8, %9
%11 = load double, double* %6
%12 = fsub double %10, %11
%13 = fdiv double %12, 2.000000e+00
%14 = fptrunc double %13 to float
store float %14, float* %7
%15 = load float, float* %7
ret float %15
}

LLVM IR (-O2):
define float @get_PBS(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fsub double %4, %2
%6 = fmul double %5, 5.000000e-01
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ pthread_self();
void tau_trace_exit(int id) {
  printf("%#lx: tau_trace_exit: id = %d\n", pthread_self(), id);
}


x86 assembly (clang, -O0):
<tau_trace_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <pthread_self@plt>
mov    %eax,%esi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tau_trace_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%#lx: tau_trace_exit: id = %d\0A\00"
define void @tau_trace_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @pthread_self()
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%#lx: tau_trace_exit: id = %d\0A\00"
define void @tau_trace_exit(i32 %0) {
%2 = tail call i32 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0)
ret void
}
void VirtualizeTimerC$0$TimerFrom$fired(void) {
  VirtualizeTimerC$0$fireTimers(VirtualizeTimerC$0$TimerFrom$getNow());
}


x86 assembly (clang, -O0):
<VirtualizeTimerC$0$TimerFrom$fired>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <VirtualizeTimerC$0$TimerFrom$getNow@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1030 <VirtualizeTimerC$0$fireTimers@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VirtualizeTimerC$0$TimerFrom$fired>:
push   %rax
xor    %eax,%eax
call   1040 <VirtualizeTimerC$0$TimerFrom$getNow@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <VirtualizeTimerC$0$fireTimers@plt>

LLVM IR (-O0):
define void @"VirtualizeTimerC$0$TimerFrom$fired"() {
%1 = call i32 (...) @"VirtualizeTimerC$0$TimerFrom$getNow"()
%2 = call i32 (i32, ...) bitcast (i32 (...)* @"VirtualizeTimerC$0$fireTimers" to i32 (i32, ...)*)(i32 %1)
ret void
}

LLVM IR (-O2):
define void @"VirtualizeTimerC$0$TimerFrom$fired"() {
%1 = tail call i32 (...) @"VirtualizeTimerC$0$TimerFrom$getNow"()
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @"VirtualizeTimerC$0$fireTimers" to i32 (i32, ...)*)(i32 %1)
ret void
}
void X509_STORE_load_locations(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_STORE_load_locations() {
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int rand();
int /*<<< orphan*/ srand(scalar_t__);
int getrandom(int from, int to) {
  struct timeval t;
  gettimeofday(&t, NULL);
  srand(t.tv_sec + t.tv_usec);
  return rand() % ((to + 1) - from) + from;
}


x86 assembly (clang, -O0):
<getrandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x10(%rbp),%rdi
add    -0x18(%rbp),%rdi
call   1040 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrandom>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %esi,%ebp
mov    %edi,%ebx
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x8(%rsp),%rdi
add    0x10(%rsp),%rdi
call   1040 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
sub    %ebx,%ebp
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i32 @getrandom(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.timeval
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @gettimeofday(%struct.timeval* %5, i32* null)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%8 = load i64, i64* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%10 = load i64, i64* %9
%11 = add nsw i64 %8, %10
%12 = call i32 @srand(i64 %11)
%13 = call i32 (...) @rand()
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
%18 = srem i32 %13, %17
%19 = load i32, i32* %3
%20 = add nsw i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i32 @getrandom(i32 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %3, i32* null)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
%7 = load i64, i64* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
%11 = tail call i32 @srand(i64 %10)
%12 = tail call i32 (...) @rand()
%13 = sub i32 1, %0
%14 = add i32 %13, %1
%15 = srem i32 %12, %14
%16 = add nsw i32 %15, %0
ret i32 %16
}
/* Variables and functions */
int func();
int call_foo() { return func() == 1 ? 42 : 0; }


x86 assembly (clang, -O0):
<call_foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x2a,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_foo>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <func@plt>
cmp    $0x1,%eax
mov    $0x2a,%eax
cmovne %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @call_foo() {
%1 = call i32 (...) @func()
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 42, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @call_foo() {
%1 = tail call i32 (...) @func()
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i32 42, i32 0
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ os_printf(char *, scalar_t__);
uint32_t functionYO(uint32_t x, uint32_t y) {
  int a = 100;
  int b = 40000;
  os_printf("%d\n", x + y);
  return x + y;
}


x86 assembly (clang, -O0):
<functionYO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
movl   $0x9c40,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
add    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <os_printf@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionYO>:
push   %rbx
lea    (%rsi,%rdi,1),%rbx
lea    0xee4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <os_printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i64 @functionYO(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
store i32 100, i32* %5
store i32 40000, i32* %6
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = add nsw i64 %7, %8
%10 = call i32 @os_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = add nsw i64 %11, %12
ret i64 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i64 @functionYO(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
%4 = tail call i32 @os_printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i64 %3
}
void avs_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @avs_disable() {
ret void
}
void numberFormattingAsYesNo(unsigned char number, char *output) {
  if (number) {
    *(output++) = 'Y';
    *(output++) = 'e';
    *output = 's';
  } else {
    *(output++) = 'N';
    *(output++) = 'o';
    *output = ' ';
  }
}


x86 assembly (clang, -O0):
<numberFormattingAsYesNo>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1148 <numberFormattingAsYesNo+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x59,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x65,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x73,(%rax)
jmp    1173 <numberFormattingAsYesNo+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x4e,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x6f,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberFormattingAsYesNo>:
test   %edi,%edi
mov    $0x4e,%eax
mov    $0x59,%ecx
cmove  %eax,%ecx
mov    $0x6f,%eax
mov    $0x65,%edx
cmove  %eax,%edx
mov    $0x20,%eax
mov    $0x73,%edi
cmove  %eax,%edi
mov    %cl,(%rsi)
mov    %dl,0x1(%rsi)
mov    %dil,0x2(%rsi)
ret

LLVM IR (-O0):
define void @numberFormattingAsYesNo(i8 zeroext %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 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
store i8 89, i8* %8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
store i8 101, i8* %10
%12 = load i8*, i8** %4
store i8 115, i8* %12
br label %19
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
store i8 78, i8* %14
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
store i8 111, i8* %16
%18 = load i8*, i8** %4
store i8 32, i8* %18
br label %19
19: ; preds = %13, %7
ret void
}

LLVM IR (-O2):
define void @numberFormattingAsYesNo(i8 zeroext %0, i8* nocapture writeonly %1) {
%3 = icmp eq i8 %0, 0
%4 = select i1 %3, i8 78, i8 89
%5 = select i1 %3, i8 111, i8 101
%6 = select i1 %3, i8 32, i8 115
store i8 %4, i8* %1
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %7
%8 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %6, i8* %8
ret void
}
int table_convert_char(void *baton, int from, int *to) {
  int *table = (int *)baton;
  if (0 <= from && from <= 255 && table[from] != -1) {
    *to = table[from];
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<table_convert_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x14(%rbp),%eax
jg     115e <table_convert_char+0x5e>
cmpl   $0xff,-0x14(%rbp)
jg     115e <table_convert_char+0x5e>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     115e <table_convert_char+0x5e>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1165 <table_convert_char+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<table_convert_char>:
xor    %eax,%eax
cmp    $0xff,%esi
ja     111b <table_convert_char+0x1b>
mov    %esi,%ecx
mov    (%rdi,%rcx,4),%ecx
cmp    $0xffffffff,%ecx
je     111b <table_convert_char+0x1b>
mov    %ecx,(%rdx)
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @table_convert_char(i8* nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = icmp ult i32 %1, 256
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = bitcast i8* %0 to i32*
%7 = zext i32 %1 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, -1
br i1 %10, label %12, label %11
11: ; preds = %5
store i32 %9, i32* %2
br label %12
12: ; preds = %3, %5, %11
%13 = phi i32 [ 1, %11 ], [ 0, %5 ], [ 0, %3 ]
ret i32 %13
}
/* Variables and functions */
double ceil(double);
__attribute__((__weak__, __always___)) double softboundmpx_ceil(double x) {
  return ceil(x);
}


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

x86 assembly (clang, -O2):
<softboundmpx_ceil>:
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define weak double @softboundmpx_ceil(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.ceil.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define weak double @softboundmpx_ceil(double %0) {
%2 = tail call double @llvm.ceil.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void check_oh_i(char *oh_i) { printf("c: %c\n", *oh_i); }


x86 assembly (clang, -O0):
<check_oh_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xed9(%rip),%rdi
movsbl (%rax),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_oh_i>:
movsbl (%rdi),%esi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"c: %c\0A\00"
define void @check_oh_i(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8 signext %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int /*<<< orphan*/ longjmp(int /*<<< orphan*/, char *);
void jmpfunction(jmp_buf env_buf) { longjmp(env_buf, "www.Linkerist.com\n"); }


x86 assembly (clang, -O0):
<jmpfunction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xedb(%rip),%rsi
call   1030 <longjmp@plt>

x86 assembly (clang, -O2):
<jmpfunction>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <longjmp@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"www.Linkerist.com\0A\00"
define void @jmpfunction(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @longjmp(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [19 x i8] c"www.Linkerist.com\0A\00"
define void @jmpfunction(i32 %0) {
%2 = tail call i32 @longjmp(i32 %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ ulong;

/* Variables and functions */
ulong ret_ulong(ulong arg1) { return arg1; }


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

x86 assembly (clang, -O2):
<ret_ulong>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ret_ulong(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int mixer_get(int);
int mixer_get_avg(int i) {
  int v = mixer_get(i);
  return ((v >> 8) + (v & 0xFF)) / 2;
}


x86 assembly (clang, -O0):
<mixer_get_avg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mixer_get@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%ecx
and    $0xff,%ecx
add    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixer_get_avg>:
push   %rax
call   1030 <mixer_get@plt>
movzbl %al,%ecx
sar    $0x8,%eax
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mixer_get_avg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @mixer_get(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = ashr i32 %6, 8
%8 = load i32, i32* %3
%9 = and i32 %8, 255
%10 = add nsw i32 %7, %9
%11 = sdiv i32 %10, 2
ret i32 %11
}

LLVM IR (-O2):
define i32 @mixer_get_avg(i32 %0) {
%2 = tail call i32 @mixer_get(i32 %0)
%3 = ashr i32 %2, 8
%4 = and i32 %2, 255
%5 = add nsw i32 %3, %4
%6 = sdiv i32 %5, 2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  1 + 5;
  printf("hello eyu\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"hello eyu\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [10 x i8] c"hello eyu\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int main() {
  while (1) {
    return 5;
  }
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0
ret i32 5
}

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
void r(long v) {
  long b;
  asm("lea %0, 256(%1)" : "=r"(b) : "r"(v));
}


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

LLVM IR (-O0):
LLVM IR (-O2):
define void @r(i64 %0) {
%2 = tail call i64 asm "lea $0, 256($1)", "=r,r,~{dirflag},~{fpsr},~{flags}"(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bobwidth(int);
int popNumber();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basBobWidth() {
  int n;
  n = popNumber();
  pushNumber(bobwidth(n));
}


x86 assembly (clang, -O0):
<basBobWidth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <popNumber@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <bobwidth@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basBobWidth>:
push   %rax
xor    %eax,%eax
call   1050 <popNumber@plt>
mov    %eax,%edi
call   1030 <bobwidth@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basBobWidth() {
%1 = alloca i32
%2 = call i32 (...) @popNumber()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @bobwidth(i32 %3)
%5 = call i32 @pushNumber(i32 %4)
ret void
}

LLVM IR (-O2):
define void @basBobWidth() {
%1 = tail call i32 (...) @popNumber()
%2 = tail call i32 @bobwidth(i32 %1)
%3 = tail call i32 @pushNumber(i32 %2)
ret void
}
/* Variables and functions */
long keyctl(int);
long keyctl_session_to_parent(void) { return keyctl(18); }


x86 assembly (clang, -O0):
<keyctl_session_to_parent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12,%edi
call   1030 <keyctl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<keyctl_session_to_parent>:
mov    $0x12,%edi
jmp    1030 <keyctl@plt>

LLVM IR (-O0):
define i64 @keyctl_session_to_parent() {
%1 = call i64 @keyctl(i32 18)
ret i64 %1
}

LLVM IR (-O2):
define i64 @keyctl_session_to_parent() {
%1 = tail call i64 @keyctl(i32 18)
ret i64 %1
}
char *gs_creplace(char *string, char src, char repl) {
  char *save = string;
  while (*string) {
    if (*string == src)
      *string = repl;
    string++;
  }
  return save;
}


x86 assembly (clang, -O0):
<gs_creplace>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <gs_creplace+0x55>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1144 <gs_creplace+0x44>
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111b <gs_creplace+0x1b>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gs_creplace>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <gs_creplace+0x25>
lea    0x1(%rax),%rdi
jmp    111b <gs_creplace+0x1b>
nop
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
je     1125 <gs_creplace+0x25>
cmp    %sil,%cl
jne    1110 <gs_creplace+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <gs_creplace+0x10>
ret

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

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


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

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

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

LLVM IR (-O2):
define void @rcu_read_unlock() {
ret void
}
void INT_Excep_PERIB_INTB135(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB135() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int, int, int);
int /*<<< orphan*/ stderr;
scalar_t__ wzl_isTrue(int, char *, int);
void firstTest() {
  ((wzl_isTrue(1 == 1,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/84n4n4j03/winzling/refs/"
               "heads/master/example_simple.c",
               24))
       ?: fprintf(stderr, "\texpected:\t%d (0x%x)\n\tbut was:\t%d (0x%x)\n", 1,
                  1, 1, 1));
}


x86 assembly (clang, -O0):
<firstTest>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
mov    $0x18,%edx
call   1030 <wzl_isTrue@plt>
cmp    $0x0,%rax
je     1149 <firstTest+0x29>
jmp    116f <firstTest+0x4f>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xf37(%rip),%rsi
mov    $0x1,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1040 <fprintf@plt>
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<firstTest>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x18,%edx
call   1030 <wzl_isTrue@plt>
test   %rax,%rax
je     113e <firstTest+0x1e>
pop    %rax
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xf42(%rip),%rsi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/84n4n4j03/winzling/refs/heads/master/example_simple.c\00"
@stderr = global i32 0
@.str.1 = [42 x i8] c"\09expected:\09%d (0x%x)\0A\09but was:\09%d (0x%x)\0A\00"
define void @firstTest() {
%1 = call i64 @wzl_isTrue(i32 1, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %8
4: ; preds = %0
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, i32 1, i32 1)
%7 = sext i32 %6 to i64
br label %8
8: ; preds = %4, %3
%9 = phi i64 [ %1, %3 ], [ %7, %4 ]
ret void
}

LLVM IR (-O2):
@.str = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/84n4n4j03/winzling/refs/heads/master/example_simple.c\00"
@stderr = global i32 0
@.str.1 = [42 x i8] c"\09expected:\09%d (0x%x)\0A\09but was:\09%d (0x%x)\0A\00"
define void @firstTest() {
%1 = tail call i64 @wzl_isTrue(i32 1, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 1, i32 1, i32 1)
br label %6
6: ; preds = %0, %3
ret void
}