xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fn1();
int /*<<< orphan*/ fn10();
int /*<<< orphan*/ fn11();
int /*<<< orphan*/ fn12(int);
int /*<<< orphan*/ fn2();
int /*<<< orphan*/ fn3();
int /*<<< orphan*/ fn4();
int /*<<< orphan*/ fn5();
int /*<<< orphan*/ fn6();
int /*<<< orphan*/ fn7();
int /*<<< orphan*/ fn8();
int /*<<< orphan*/ fn9();
int main(void) {
  fn1();
  fn2();
  fn3();
  fn4();
  fn5();
  fn6();
  fn7();
  fn8();
  fn9();
  fn10();
  fn11();
  fn12(5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <fn1@plt>
mov    $0x0,%al
call   10e0 <fn2@plt>
mov    $0x0,%al
call   1080 <fn3@plt>
mov    $0x0,%al
call   10d0 <fn4@plt>
mov    $0x0,%al
call   1090 <fn5@plt>
mov    $0x0,%al
call   10c0 <fn6@plt>
mov    $0x0,%al
call   1050 <fn7@plt>
mov    $0x0,%al
call   10b0 <fn8@plt>
mov    $0x0,%al
call   1070 <fn9@plt>
mov    $0x0,%al
call   1040 <fn10@plt>
mov    $0x0,%al
call   10a0 <fn11@plt>
mov    $0x5,%edi
call   1030 <fn12@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <fn1@plt>
xor    %eax,%eax
call   10e0 <fn2@plt>
xor    %eax,%eax
call   1080 <fn3@plt>
xor    %eax,%eax
call   10d0 <fn4@plt>
xor    %eax,%eax
call   1090 <fn5@plt>
xor    %eax,%eax
call   10c0 <fn6@plt>
xor    %eax,%eax
call   1050 <fn7@plt>
xor    %eax,%eax
call   10b0 <fn8@plt>
xor    %eax,%eax
call   1070 <fn9@plt>
xor    %eax,%eax
call   1040 <fn10@plt>
xor    %eax,%eax
call   10a0 <fn11@plt>
mov    $0x5,%edi
call   1030 <fn12@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fn1()
%3 = call i32 (...) @fn2()
%4 = call i32 (...) @fn3()
%5 = call i32 (...) @fn4()
%6 = call i32 (...) @fn5()
%7 = call i32 (...) @fn6()
%8 = call i32 (...) @fn7()
%9 = call i32 (...) @fn8()
%10 = call i32 (...) @fn9()
%11 = call i32 (...) @fn10()
%12 = call i32 (...) @fn11()
%13 = call i32 @fn12(i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn1()
%2 = tail call i32 (...) @fn2()
%3 = tail call i32 (...) @fn3()
%4 = tail call i32 (...) @fn4()
%5 = tail call i32 (...) @fn5()
%6 = tail call i32 (...) @fn6()
%7 = tail call i32 (...) @fn7()
%8 = tail call i32 (...) @fn8()
%9 = tail call i32 (...) @fn9()
%10 = tail call i32 (...) @fn10()
%11 = tail call i32 (...) @fn11()
%12 = tail call i32 @fn12(i32 5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ get_pci_addr(int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ inl(int);
int /*<<< orphan*/ outl(int, int /*<<< orphan*/);
uint32_t pci_read_conf_dword(uint8_t bus, uint8_t dev, uint8_t func,
                             uint8_t offset) {
  uint32_t addr = get_pci_addr(bus, dev, func, offset);
  outl(0x0CF8, addr);
  return inl(0x0CFC);
}


x86 assembly (clang, -O0):
<pci_read_conf_dword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1050 <get_pci_addr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0xcf8,%edi
call   1030 <outl@plt>
mov    $0xcfc,%edi
call   1040 <inl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pci_read_conf_dword>:
push   %rax
call   1050 <get_pci_addr@plt>
mov    $0xcf8,%edi
mov    %eax,%esi
call   1030 <outl@plt>
mov    $0xcfc,%edi
pop    %rax
jmp    1040 <inl@plt>

LLVM IR (-O0):
define i32 @pci_read_conf_dword(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @get_pci_addr(i32 %10, i32 %11, i32 %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = call i32 @outl(i32 3320, i32 %15)
%17 = call i32 @inl(i32 3324)
ret i32 %17
}

LLVM IR (-O2):
define i32 @pci_read_conf_dword(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @get_pci_addr(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @outl(i32 3320, i32 %5)
%7 = tail call i32 @inl(i32 3324)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int const);
void seven(int a, const int b) {
  while (a != b) {
    a++;
  }
  printf("%d is now equal to %d\n", a, b);
}


x86 assembly (clang, -O0):
<seven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1138 <seven+0x28>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111e <seven+0xe>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"%d is now equal to %d\0A\00"
define void @seven(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
void bzero1_null() {
  char *a = 0;
  bzero(a, 10);
}


x86 assembly (clang, -O0):
<bzero1_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <bzero@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero1_null>:
xor    %edi,%edi
mov    $0xa,%esi
jmp    1030 <bzero@plt>

LLVM IR (-O0):
define void @bzero1_null() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @bzero(i8* %2, i32 10)
ret void
}

LLVM IR (-O2):
define void @bzero1_null() {
%1 = tail call i32 @bzero(i8* null, i32 10)
ret void
}
int count_char(char *str, char c) {
  int vkupno = 0;
  while (*str != '\0') {
    vkupno += (*str == c);
    str++;
  }
  return vkupno;
}


x86 assembly (clang, -O0):
<count_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1151 <count_char+0x51>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1115 <count_char+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <count_char+0x26>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
xor    %edx,%edx
cmp    %sil,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <count_char+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @count_char(i8* nocapture %0, i8 signext %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 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %11, %5 ], [ 0, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%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 %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %11, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void f(int signum) { printf("Shut up.\n"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Shut up.\0A\00"
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"Shut up.\00"
define void @f(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ load_menu();
int main(int argc, char **argv) {
  load_menu();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <load_menu@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <load_menu@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @load_menu()
ret i32 0
}
int test_imm_32int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x32 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_32int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 3276800
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x7c() {
  Assert_real((iscntrl(124) == 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_iscntrl.c",
              625, ("iscntrl should be 0 for |"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0x7c>:
push   %rax
mov    $0x7c,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x271,%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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for |\00"
define void @t_iscntrl_0x7c() {
%1 = call i64 @iscntrl(i32 124)
%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 625, i8* getelementptr inbounds ([26 x i8], [26 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for |\00"
define void @t_iscntrl_0x7c() {
%1 = tail call i64 @iscntrl(i32 124)
%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 625, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  setlocale(LC_ALL, "");
  initscr();
  printw("안녕하세요!");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
lea    0xe8a(%rip),%rsi
call   1060 <setlocale@plt>
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe67(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1070 <getch@plt>
mov    $0x0,%al
call   1080 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe9f(%rip),%rsi
call   1060 <setlocale@plt>
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xe7c(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1070 <getch@plt>
xor    %eax,%eax
call   1080 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [17 x i8] c"\EC\95\88\EB\85\95\ED\95\98\EC\84\B8\EC\9A\94!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @LC_ALL
%7 = call i32 @setlocale(i32 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @initscr()
%9 = call i32 @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (...) @refresh()
%11 = call i32 (...) @getch()
%12 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [1 x i8] zeroinitializer
@.str.1 = [17 x i8] c"\EC\95\88\EB\85\95\ED\95\98\EC\84\B8\EC\9A\94!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @LC_ALL
%4 = tail call i32 @setlocale(i32 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @initscr()
%6 = tail call i32 @printw(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 (...) @getch()
%9 = tail call i32 (...) @endwin()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void hf_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<hf_free>:
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):
<hf_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @hf_free(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 @hf_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int tribus(const int version, const int a, const int b, const int c) {
  int RetVal;
  RetVal = c;
  if (version < 10) {
    RetVal = a;
  }
  if ((version >= 10) && (version <= 26)) {
    RetVal = b;
  }
  return RetVal;
}


x86 assembly (clang, -O0):
<tribus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1126 <tribus+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0xa,-0x4(%rbp)
jl     1140 <tribus+0x40>
cmpl   $0x1a,-0x4(%rbp)
jg     1140 <tribus+0x40>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tribus>:
mov    %esi,%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
add    $0xfffffff6,%edi
cmp    $0x11,%edi
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @tribus(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
store i32 %10, i32* %9
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %4
%14 = load i32, i32* %6
store i32 %14, i32* %9
br label %15
15: ; preds = %13, %4
%16 = load i32, i32* %5
%17 = icmp sge i32 %16, 10
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp sle i32 %19, 26
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32, i32* %7
store i32 %22, i32* %9
br label %23
23: ; preds = %21, %18, %15
%24 = load i32, i32* %9
ret i32 %24
}

LLVM IR (-O2):
define i32 @tribus(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %0, 10
%6 = select i1 %5, i32 %1, i32 %3
%7 = add i32 %0, -10
%8 = icmp ult i32 %7, 17
%9 = select i1 %8, i32 %2, i32 %6
ret i32 %9
}
int prevhad(int n, int a[], int i) {
  if (i == 0)
    return 0;
  for (i--; i >= 0; i--)
    if (a[i] == n)
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<prevhad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1124 <prevhad+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1171 <prevhad+0x71>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     116a <prevhad+0x6a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1157 <prevhad+0x57>
movl   $0x1,-0x4(%rbp)
jmp    1171 <prevhad+0x71>
jmp    115c <prevhad+0x5c>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <prevhad+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prevhad>:
xor    %eax,%eax
test   %edx,%edx
je     1126 <prevhad+0x26>
mov    %edx,%ecx
nopl   0x0(%rax,%rax,1)
test   %ecx,%ecx
jle    1126 <prevhad+0x26>
lea    -0x1(%rcx),%rdx
cmp    %edi,-0x4(%rsi,%rcx,4)
mov    %rdx,%rcx
jne    1110 <prevhad+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @prevhad(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %16, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ %6, %5 ], [ %9, %12 ]
%9 = add nsw i64 %8, -1
%10 = trunc i64 %8 to i32
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = getelementptr inbounds i32, i32* %1, i64 %9
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, %0
br i1 %15, label %16, label %7
16: ; preds = %7, %12, %3
%17 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %12 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *game(unsigned long long);
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
void dotest(unsigned long long n, char *expr) {
  char *act = game(n);
  if (strcmp(act, expr) != 0)
    printf("Error. Expected %s but got %s\n", expr, act);
  assert(strcmp(act, expr) == 0);
}


x86 assembly (clang, -O0):
<dotest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <game@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1188 <dotest+0x48>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotest>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1060 <game@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1171 <dotest+0x31>
lea    0xe9a(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <assert@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Error. Expected %s but got %s\0A\00"
define void @dotest(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%6 = load i64, i64* %3
%7 = call i8* @game(i64 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i8*, i8** %4
%10 = call i64 @strcmp(i8* %8, i8* %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14)
br label %16
16: ; preds = %12, %2
%17 = load i8*, i8** %5
%18 = load i8*, i8** %4
%19 = call i64 @strcmp(i8* %17, i8* %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error. Expected %s but got %s\0A\00"
define void @dotest(i64 %0, i8* %1) {
%3 = tail call i8* @game(i64 %0)
%4 = tail call i64 @strcmp(i8* %3, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %3)
br label %8
8: ; preds = %6, %2
%9 = tail call i64 @strcmp(i8* %3, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t Endian_byteSwap16_manual(uint16_t input) {
  return (input << 8) | (input >> 8);
}


x86 assembly (clang, -O0):
<Endian_byteSwap16_manual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Endian_byteSwap16_manual>:
mov    %edi,%eax
shl    $0x8,%eax
sar    $0x8,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @Endian_byteSwap16_manual(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %2
%6 = ashr i32 %5, 8
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @Endian_byteSwap16_manual(i32 %0) {
%2 = shl i32 %0, 8
%3 = ashr i32 %0, 8
%4 = or i32 %2, %3
ret i32 %4
}
void eglCreatePbufferFromClientBuffer(void) { return; }


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

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

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

LLVM IR (-O2):
define void @eglCreatePbufferFromClientBuffer() {
ret void
}
int bar(int x, int y, int z, int w) {
  int qqq = x + y + z + w;
  return qqq;
}


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

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

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = add nsw i32 %10, %11
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
%15 = load i32, i32* %8
%16 = add nsw i32 %14, %15
store i32 %16, i32* %9
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %1, %0
%6 = add nsw i32 %5, %2
%7 = add nsw i32 %6, %3
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("Usage for program %s\n", name);
  printf("1 argument required: 1) the float value (prob 0-1) to be converted "
         "to -10log10(val).\n");
}


x86 assembly (clang, -O0):
<usage>:
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 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Usage for program %s\0A\00"
@.str.1 = [86 x i8] c"1 argument required: 1) the float value (prob 0-1) to be converted to -10log10(val).\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Usage for program %s\0A\00"
@str = [85 x i8] c"1 argument required: 1) the float value (prob 0-1) to be converted to -10log10(val).\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([85 x i8], [85 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
short __hsign(short, short);
short intr_wrap_468(short p1, short p2) { return __hsign(p1, p2); }


x86 assembly (clang, -O0):
<intr_wrap_468>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
movswl %ax,%edi
movswl -0x4(%rbp),%esi
call   1030 <__hsign@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_468>:
jmp    1030 <__hsign@plt>

LLVM IR (-O0):
define signext i16 @intr_wrap_468(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = load i16, i16* %4
%7 = call signext i16 @__hsign(i16 signext %5, i16 signext %6)
ret i16 %7
}

LLVM IR (-O2):
define signext i16 @intr_wrap_468(i16 signext %0, i16 signext %1) {
%3 = tail call signext i16 @__hsign(i16 signext %0, i16 signext %1)
ret i16 %3
}
unsigned int hashtbl_int64_hash(const void *k) {
  return (unsigned int)*(long long *)k;
}


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

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

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

LLVM IR (-O2):
define i32 @hashtbl_int64_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  write(1, "Hello World!\n", 13);
  write(2, "STD ERR LINE\n", 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    0xece(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
mov    $0x2,%edi
lea    0xec6(%rip),%rsi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0xd,%edx
call   1030 <write@plt>
lea    0xee0(%rip),%rsi
mov    $0x2,%edi
mov    $0xd,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [14 x i8] c"STD ERR LINE\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%7 = call i32 @write(i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [14 x i8] c"STD ERR LINE\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 13)
%4 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t ffi_reinterpret_uint8_t(void *result) { return (uint8_t)result; }


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

x86 assembly (clang, -O2):
<ffi_reinterpret_uint8_t>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32 @ffi_reinterpret_uint8_t(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ idc(int *);
int test12(int *q) {
  int *p = q;
  idc(q);
  return *p;
}


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

x86 assembly (clang, -O2):
<test12>:
push   %rbx
mov    %rdi,%rbx
call   1030 <idc@plt>
mov    (%rbx),%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @test12(i32* %0) {
%2 = tail call i32 @idc(i32* %0)
%3 = load i32, i32* %0
ret i32 %3
}
void gtk_dialog_response() {}


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

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

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

LLVM IR (-O2):
define void @gtk_dialog_response() {
ret void
}
/* Variables and functions */
int g();
void f(int k) { k = g(); }


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

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

LLVM IR (-O0):
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @g()
store i32 %3, i32* %2
ret void
}

LLVM IR (-O2):
define void @f(i32 %0) {
%2 = tail call i32 (...) @g()
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
int strlen(char *);
void rtrim(char *string) {
  char *c = string + strlen(string);
  while (c > string && isspace(*(c - 1)))
    --c;
  *c = 0;
}


x86 assembly (clang, -O0):
<rtrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
cmp    -0x8(%rbp),%rcx
mov    %al,-0x19(%rbp)
jbe    1177 <rtrim+0x57>
mov    -0x10(%rbp),%rax
movsbl -0x1(%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1187 <rtrim+0x67>
jmp    1198 <rtrim+0x78>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    114d <rtrim+0x2d>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtrim>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
movslq %eax,%r15
add    %r14,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rbx
cmp    %r14,%r15
jbe    115a <rtrim+0x3a>
lea    -0x1(%rbx),%r15
movsbl -0x1(%rbx),%edi
call   1040 <isspace@plt>
test   %rax,%rax
jne    1140 <rtrim+0x20>
movb   $0x0,(%rbx)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @rtrim(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
br label %5
5: ; preds = %8, %1
%6 = phi i8* [ %4, %1 ], [ %9, %8 ]
%7 = icmp ugt i8* %6, %0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = getelementptr inbounds i8, i8* %6, i64 -1
%10 = load i8, i8* %9
%11 = tail call i64 @isspace(i8 signext %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %8
store i8 0, i8* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  bar();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <bar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int dcloadsyscall(int, int, struct stat *);
int fstat(int file, struct stat *st) {
  if (*(unsigned int *)0x8c004004 == 0xdeadbeef)
    return dcloadsyscall(10, file, st);
  else
    return -1;
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    1149 <fstat+0x39>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0xa,%edi
call   1030 <dcloadsyscall@plt>
mov    %eax,-0x4(%rbp)
jmp    1150 <fstat+0x40>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstat>:
mov    $0x8c004004,%eax
cmpl   $0xdeadbeef,(%rax)
jne    112c <fstat+0x1c>
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0xa,%edi
jmp    1030 <dcloadsyscall@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.stat*
store i32 %0, i32* %4
store %struct.stat* %1, %struct.stat** %5
%6 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%7 = icmp eq i32 %6, -559038737
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %4
%10 = load %struct.stat*, %struct.stat** %5
%11 = call i32 @dcloadsyscall(i32 10, i32 %9, %struct.stat* %10)
store i32 %11, i32* %3
br label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = load i32, i32* inttoptr (i64 2348826628 to i32*)
%4 = icmp eq i32 %3, -559038737
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @dcloadsyscall(i32 10, i32 %0, %struct.stat* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ -1, %2 ]
ret i32 %8
}
int ExtractI4(const unsigned char *buf) {
  int x;
  x = buf[0];
  x <<= 8;
  x |= buf[1];
  x <<= 8;
  x |= buf[2];
  x <<= 8;
  x |= buf[3];
  return x;
}


x86 assembly (clang, -O0):
<ExtractI4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ExtractI4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = shl i32 %8, 8
store i32 %9, i32* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = shl i32 %16, 8
store i32 %17, i32* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i32, i32* %3
%23 = or i32 %22, %21
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = shl i32 %24, 8
store i32 %25, i32* %3
%26 = load i8*, i8** %2
%27 = getelementptr inbounds i8, i8* %26, i64 3
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = load i32, i32* %3
%31 = or i32 %30, %29
store i32 %31, i32* %3
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @ExtractI4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %3, 16
%8 = shl nuw nsw i32 %6, 8
%9 = or i32 %8, %7
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = or i32 %9, %12
%14 = shl nuw i32 %13, 8
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ i2cslave_ClearSlaveWREQ(int /*<<< orphan*/);
void i2c0slave_ClearSlaveWREQ(void) { i2cslave_ClearSlaveWREQ(0); }


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

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

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

LLVM IR (-O2):
define void @i2c0slave_ClearSlaveWREQ() {
%1 = tail call i32 @i2cslave_ClearSlaveWREQ(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_pta();
int /*<<< orphan*/ init_ptb();
int /*<<< orphan*/ init_writeOnce();
void init_system() {
  init_writeOnce();
  init_pta();
  init_ptb();
}


x86 assembly (clang, -O0):
<init_system>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <init_writeOnce@plt>
mov    $0x0,%al
call   1040 <init_pta@plt>
mov    $0x0,%al
call   1030 <init_ptb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_system>:
push   %rax
xor    %eax,%eax
call   1050 <init_writeOnce@plt>
xor    %eax,%eax
call   1040 <init_pta@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <init_ptb@plt>

LLVM IR (-O0):
define void @init_system() {
%1 = call i32 (...) @init_writeOnce()
%2 = call i32 (...) @init_pta()
%3 = call i32 (...) @init_ptb()
ret void
}

LLVM IR (-O2):
define void @init_system() {
%1 = tail call i32 (...) @init_writeOnce()
%2 = tail call i32 (...) @init_pta()
%3 = tail call i32 (...) @init_ptb()
ret void
}
int get_salt_size(void) { return 80; }


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

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

LLVM IR (-O0):
define i32 @get_salt_size() {
ret i32 80
}

LLVM IR (-O2):
define i32 @get_salt_size() {
ret i32 80
}
int mount_thin_mosaic(struct mosaic *m, const char *path, int mount_flags) {
  return -1;
}


x86 assembly (clang, -O0):
<mount_thin_mosaic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mosaic = type opaque
define i32 @mount_thin_mosaic(%struct.mosaic* %0, i8* %1, i32 %2) {
%4 = alloca %struct.mosaic*
%5 = alloca i8*
%6 = alloca i32
store %struct.mosaic* %0, %struct.mosaic** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 -1
}

LLVM IR (-O2):
%struct.mosaic = type opaque
define i32 @mount_thin_mosaic(%struct.mosaic* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 -1
}
/* Variables and functions */
unsigned long long simple_strtoull(char const *, char **, int);
unsigned long long int strtoull(const char *nptr, char **endptr, int base) {
  return simple_strtoull(nptr, endptr, base);
}


x86 assembly (clang, -O0):
<strtoull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <simple_strtoull@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoull>:
jmp    1030 <simple_strtoull@plt>

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

LLVM IR (-O2):
define i64 @strtoull(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @simple_strtoull(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
char const *gai_strerror(int);
const char *get_addrinfo_error(int errorCode) {
  return gai_strerror(errorCode);
}


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

x86 assembly (clang, -O2):
<get_addrinfo_error>:
jmp    1030 <gai_strerror@plt>

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

LLVM IR (-O2):
define i8* @get_addrinfo_error(i32 %0) {
%2 = tail call i8* @gai_strerror(i32 %0)
ret i8* %2
}
int Cannonball(int height) {
  if (height == 0) {
    return 0;
  } else {
    return (height + Cannonball(height - 1));
  }
}


x86 assembly (clang, -O0):
<Cannonball>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <Cannonball+0x21>
movl   $0x0,-0x4(%rbp)
jmp    114c <Cannonball+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <Cannonball@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cannonball>:
test   %edi,%edi
je     1119 <Cannonball+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Cannonball(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}