xunge/DecIR huggingface dataset:
/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  void *mem = calloc(1000, 100000000);
  printf("mem: %p\n");
  if (mem != NULL) {
    free(mem);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
mov    $0x5f5e100,%esi
call   1050 <calloc@plt>
mov    %rax,-0x10(%rbp)
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
cmpq   $0x0,-0x10(%rbp)
je     1172 <main+0x42>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3e8,%edi
mov    $0x5f5e100,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
test   %rbx,%rbx
je     115c <main+0x2c>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"mem: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @calloc(i32 1000, i32 100000000)
store i8* %3, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"mem: %p\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(100000000000) i8* @calloc(i32 1000, i32 100000000)
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %4, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void syserror(const char *msg) {
  perror(msg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<syserror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<syserror>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @syserror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @syserror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ inthash();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ strhash();
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  strhash();
  inthash();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <strhash@plt>
mov    $0x0,%al
call   1060 <inthash@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <strhash@plt>
xor    %eax,%eax
call   1060 <inthash@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @strhash()
%5 = call i32 (...) @inthash()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @strhash()
%4 = tail call i32 (...) @inthash()
ret i32 0
}
/* Variables and functions */
size_t game_data_size();
size_t retro_serialize_size(void) { return game_data_size(); }


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

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

LLVM IR (-O0):
define i64 @retro_serialize_size() {
%1 = call i64 (...) @game_data_size()
ret i64 %1
}

LLVM IR (-O2):
define i64 @retro_serialize_size() {
%1 = tail call i64 (...) @game_data_size()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int sprintf(char *, char *, int);
void main() {
  char buff[10];
  int per = 0;
  int x = 123;
  per = sprintf(buff, "%i", x);
  printf("per = %d;\nstring = %s;\n", per, buff);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x10(%rbp)
movl   $0x7b,-0x14(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xebc(%rip),%rsi
call   1040 <sprintf@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    -0xa(%rbp),%rdx
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rsi
lea    0x6(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x7b,%edx
call   1040 <sprintf@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
mov    %rbx,%rdx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [24 x i8] c"per = %d;\0Astring = %s;\0A\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 123, i32* %3
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = load i32, i32* %3
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [24 x i8] c"per = %d;\0Astring = %s;\0A\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 123)
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %3, i8* %2)
ret void
}
/* Variables and functions */
double floor(double const);
double frac(const double x) { return x - floor(x); }


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

x86 assembly (clang, -O2):
<frac>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @frac(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.floor.f64(double %4)
%6 = fsub double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @frac(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
ret double %3
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *create_node(int /*<<< orphan*/, int /*<<< orphan*/);
struct node *create_tree() {
  struct node *n = create_node(0, 0);
  return n;
}


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

x86 assembly (clang, -O2):
<create_tree>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <create_node@plt>

LLVM IR (-O0):
%struct.node = type { i32 }
define %struct.node* @create_tree() {
%1 = alloca %struct.node*
%2 = call %struct.node* @create_node(i32 0, i32 0)
store %struct.node* %2, %struct.node** %1
%3 = load %struct.node*, %struct.node** %1
ret %struct.node* %3
}

LLVM IR (-O2):
%struct.node = type { i32 }
define %struct.node* @create_tree() {
%1 = tail call %struct.node* @create_node(i32 0, i32 0)
ret %struct.node* %1
}
/* Variables and functions */
int /*<<< orphan*/ my__stpcpy(char *, char const *);
char *my_strcpy(char *restrict dest, const char *restrict src) {
  my__stpcpy(dest, src);
  return dest;
}


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

x86 assembly (clang, -O2):
<my_strcpy>:
push   %rbx
mov    %rdi,%rbx
call   1030 <my__stpcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @my_strcpy(i8* noalias returned %0, i8* noalias %1) {
%3 = tail call i32 @my__stpcpy(i8* %0, i8* %1)
ret i8* %0
}
int fib(int a) {
  if (a <= 0) {
    return 0;
  }
  if (a == 1 || a == 2) {
    return 1;
  }
  return fib(a - 1) + fib(a - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jg     1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1174 <fib+0x64>
cmpl   $0x1,-0x8(%rbp)
je     1145 <fib+0x35>
cmpl   $0x2,-0x8(%rbp)
jne    1151 <fib+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1174 <fib+0x64>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@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):
<fib>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1146 <fib+0x36>
mov    %edi,%ebp
add    $0xffffffff,%ebp
mov    $0x1,%ebx
cmp    $0x2,%ebp
jb     1148 <fib+0x38>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <fib@plt>
add    %eax,%ebx
add    $0xfffffffe,%ebp
cmp    $0x1,%ebp
ja     1130 <fib+0x20>
add    $0x1,%ebx
jmp    1148 <fib+0x38>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %17, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = icmp ult i32 %4, 2
br i1 %5, label %17, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %13, %6 ], [ %4, %3 ]
%8 = phi i32 [ %12, %6 ], [ 0, %3 ]
%9 = phi i32 [ %11, %6 ], [ %0, %3 ]
%10 = tail call i32 @fib(i32 %7)
%11 = add nsw i32 %9, -2
%12 = add nsw i32 %10, %8
%13 = add nsw i32 %9, -3
%14 = icmp ult i32 %13, 2
br i1 %14, label %15, label %6
15: ; preds = %6
%16 = add i32 %12, 1
br label %17
17: ; preds = %3, %15, %1
%18 = phi i32 [ 0, %1 ], [ %16, %15 ], [ 1, %3 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x5e() {
  Assert_real((isupper(94) == 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_isupper.c",
              475, ("isupper should be 0 for ^"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x5e>:
push   %rax
mov    $0x5e,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1db,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for ^\00"
define void @t_isupper_0x5e() {
%1 = call i64 @isupper(i32 94)
%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 475, 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 0 for ^\00"
define void @t_isupper_0x5e() {
%1 = tail call i64 @isupper(i32 94)
%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 475, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int gff3PhaseToFrame(int phase) {
  switch (phase) {
  case 0:
    return 0;
  case 1:
    return 2;
  case 2:
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<gff3PhaseToFrame>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
test   %eax,%eax
je     113c <gff3PhaseToFrame+0x3c>
jmp    111a <gff3PhaseToFrame+0x1a>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
je     1148 <gff3PhaseToFrame+0x48>
jmp    112b <gff3PhaseToFrame+0x2b>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     1154 <gff3PhaseToFrame+0x54>
jmp    1160 <gff3PhaseToFrame+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1167 <gff3PhaseToFrame+0x67>
movl   $0x2,-0x4(%rbp)
jmp    1167 <gff3PhaseToFrame+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1167 <gff3PhaseToFrame+0x67>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gff3PhaseToFrame>:
mov    $0xffffffff,%eax
cmp    $0x2,%edi
ja     1117 <gff3PhaseToFrame+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @gff3PhaseToFrame(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i32 0, i32* %2
br label %9
6: ; preds = %1
store i32 2, i32* %2
br label %9
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@switch.table.gff3PhaseToFrame = [3 x i32] [i32 0, i32 2, i32 1]
define i32 @gff3PhaseToFrame(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.gff3PhaseToFrame, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ -1, %1 ]
ret i32 %8
}
/* Type definitions */
struct Cspace {
  int dummy;
};

/* Variables and functions */
scalar_t__ allocPage();
struct Cspace *allocCspace() {
  return (struct Cspace *)allocPage();
}


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

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

LLVM IR (-O0):
%struct.Cspace = type { i32 }
define %struct.Cspace* @allocCspace() {
%1 = call i64 (...) @allocPage()
%2 = inttoptr i64 %1 to %struct.Cspace*
ret %struct.Cspace* %2
}

LLVM IR (-O2):
%struct.Cspace = type { i32 }
define %struct.Cspace* @allocCspace() {
%1 = tail call i64 (...) @allocPage()
%2 = inttoptr i64 %1 to %struct.Cspace*
ret %struct.Cspace* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void zcfree(void *opaque, void *ptr) {
  (void)opaque;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<zcfree>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @zcfree(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Good afternoon gentlemen.  I am a HAL 9000 computer.\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 = [54 x i8] c"Good afternoon gentlemen. I am a HAL 9000 computer.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [53 x i8] c"Good afternoon gentlemen. I am a HAL 9000 computer.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int compare(const void *m, const void *n) {
  int *a, *b;
  a = (int *)m;
  b = (int *)n;
  if (*a < *b)
    return -1;
  if (*a == *b)
    return 0;
  if (*a > *b)
    return 1;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    113a <compare+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <compare+0x71>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    1158 <compare+0x58>
movl   $0x0,-0x4(%rbp)
jmp    1171 <compare+0x71>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    1171 <compare+0x71>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
%8 = icmp ne i32 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
unsigned int m68ki_get_ea_pcdi();
int /*<<< orphan*/ m68ki_push_32(unsigned int);
void m68k_op_pea_32_pcdi(void) {
  unsigned int ea = m68ki_get_ea_pcdi();
  m68ki_push_32(ea);
}


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

x86 assembly (clang, -O2):
<m68k_op_pea_32_pcdi>:
push   %rax
xor    %eax,%eax
call   1040 <m68ki_get_ea_pcdi@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <m68ki_push_32@plt>

LLVM IR (-O0):
define void @m68k_op_pea_32_pcdi() {
%1 = alloca i32
%2 = call i32 (...) @m68ki_get_ea_pcdi()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @m68ki_push_32(i32 %3)
ret void
}

LLVM IR (-O2):
define void @m68k_op_pea_32_pcdi() {
%1 = tail call i32 (...) @m68ki_get_ea_pcdi()
%2 = tail call i32 @m68ki_push_32(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int /*<<< orphan*/);
void myputs(char *s) {
  while (*s)
    putchar(*s++);
}


x86 assembly (clang, -O0):
<myputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <myputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <myputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myputs>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <myputs+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <myputs+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @myputs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %7, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @putchar(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @myputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putchar(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int rand();
int getDirection0() { return rand() % 4; }


x86 assembly (clang, -O0):
<getDirection0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDirection0>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getDirection0() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 4
ret i32 %2
}

LLVM IR (-O2):
define i32 @getDirection0() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 4
ret i32 %2
}
/* Variables and functions */
double exp(double);
double sqrt(double);
double e_tu(double tu) {
  if (tu > 100)
    return 5.0;
  else {
    double a = -0.01139 * tu;
    double b = -0.04917 * sqrt(tu);
    double c = a + b;
    return 97.34 * exp(c);
  }
}


x86 assembly (clang, -O0):
<e_tu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1156 <e_tu+0x36>
movsd  0xed4(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11b3 <e_tu+0x93>
movsd  0xeba(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xe93(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xe5e(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_tu>:
push   %rax
ucomisd 0xedf(%rip),%xmm0
jbe    1135 <e_tu+0x15>
movsd  0xecd(%rip),%xmm0
pop    %rax
ret
movsd  0xed3(%rip),%xmm2
mulsd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1151 <e_tu+0x31>
sqrtsd %xmm0,%xmm0
jmp    1160 <e_tu+0x40>
movsd  %xmm2,(%rsp)
call   1040 <sqrt@plt>
movsd  (%rsp),%xmm2
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm0,%xmm2
movapd %xmm2,%xmm0
call   1030 <exp@plt>
mulsd  0xea3(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @e_tu(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %3
%7 = load double, double* %3
%8 = fcmp ogt double %7, 1.000000e+02
br i1 %8, label %9, label %10
9: ; preds = %1
store double 5.000000e+00, double* %2
br label %22
10: ; preds = %1
%11 = load double, double* %3
%12 = fmul double -1.139000e-02, %11
store double %12, double* %4
%13 = load double, double* %3
%14 = call double @sqrt(double %13)
%15 = fmul double -4.917000e-02, %14
store double %15, double* %5
%16 = load double, double* %4
%17 = load double, double* %5
%18 = fadd double %16, %17
store double %18, double* %6
%19 = load double, double* %6
%20 = call double @exp(double %19)
%21 = fmul double 9.734000e+01, %20
store double %21, double* %2
br label %22
22: ; preds = %10, %9
%23 = load double, double* %2
ret double %23
}

LLVM IR (-O2):
define double @e_tu(double %0) {
%2 = fcmp ogt double %0, 1.000000e+02
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = fmul double %0, -1.139000e-02
%5 = tail call double @sqrt(double %0)
%6 = fmul double %5, 4.917000e-02
%7 = fsub double %4, %6
%8 = tail call double @exp(double %7)
%9 = fmul double %8, 9.734000e+01
br label %10
10: ; preds = %1, %3
%11 = phi double [ %9, %3 ], [ 5.000000e+00, %1 ]
ret double %11
}
int ls_cost_nm2_n_out(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @ls_cost_nm2_n_out() {
ret i32 2
}

LLVM IR (-O2):
define i32 @ls_cost_nm2_n_out() {
ret i32 2
}
double _orbita_models_plummer_Mt(const void *par) {
  double M = *((double *)par);
  return M;
}


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

x86 assembly (clang, -O2):
<_orbita_models_plummer_Mt>:
movsd  (%rdi),%xmm0
ret

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

LLVM IR (-O2):
define double @_orbita_models_plummer_Mt(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
void buf_set_uint8(void *buf, unsigned long addr, unsigned char val) {
  unsigned char *tmp = (unsigned char *)buf + addr;
  tmp[0] = val;
}


x86 assembly (clang, -O0):
<buf_set_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x11(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_set_uint8>:
mov    %dl,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @buf_set_uint8(i8* %0, i64 %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8 %2, i8* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %5
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8* %10, i8** %7
%11 = load i8, i8* %6
%12 = load i8*, i8** %7
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
ret void
}

LLVM IR (-O2):
define void @buf_set_uint8(i8* nocapture writeonly %0, i64 %1, i8 zeroext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
store i8 %2, i8* %4
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_16(int);
uint16_t beptr2me_16(uint8_t *x) { return bswap_16(x[1] << 8 | x[0]); }


x86 assembly (clang, -O0):
<beptr2me_16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
shl    $0x8,%edi
mov    -0x8(%rbp),%rax
or     (%rax),%edi
call   1030 <bswap_16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beptr2me_16>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
mov    %eax,%edi
jmp    1030 <bswap_16@plt>

LLVM IR (-O0):
define i32 @beptr2me_16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 8
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = or i32 %6, %9
%11 = call i32 @bswap_16(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @beptr2me_16(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %0
%6 = or i32 %4, %5
%7 = tail call i32 @bswap_16(i32 %6)
ret i32 %7
}
double wavg2(double x, double y, double w) { return (x + (y - x) * w); }


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

x86 assembly (clang, -O2):
<wavg2>:
subsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @wavg2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %4
%10 = fsub double %8, %9
%11 = load double, double* %6
%12 = call double @llvm.fmuladd.f64(double %10, double %11, double %7)
ret double %12
}

LLVM IR (-O2):
define double @wavg2(double %0, double %1, double %2) {
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %2, double %0)
ret double %5
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t cmp32(uint32_t a, uint32_t b) { return a - b; }


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

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

LLVM IR (-O0):
define i64 @cmp32(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 = sub nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @cmp32(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int INT_MAX;
f3() {
  int b = INT_MAX;
  return b >= INT_MAX;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @f3() {
%1 = alloca i32
%2 = load i32, i32* @INT_MAX
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @INT_MAX
%5 = icmp sge i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @f3() {
ret i32 1
}
/* Type definitions */
struct LamportQueue {
  int dummy;
};

/* Variables and functions */
scalar_t__ LamportQueue_push(struct LamportQueue *, int);
void *producer(void *p) {
  struct LamportQueue *queue = (struct LamportQueue *)p;
  int i;
  for (i = 0; i < 100;) {
    if (LamportQueue_push(queue, 36))
      ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<producer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    115b <producer+0x4b>
mov    -0x10(%rbp),%rdi
mov    $0x24,%esi
call   1030 <LamportQueue_push@plt>
cmp    $0x0,%rax
je     1156 <producer+0x46>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <producer+0x1b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<producer>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x24,%esi
call   1030 <LamportQueue_push@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
cmp    $0x64,%ebp
jb     1120 <producer+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.LamportQueue = type { i32 }
define i8* @producer(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.LamportQueue*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to %struct.LamportQueue*
store %struct.LamportQueue* %6, %struct.LamportQueue** %3
store i32 0, i32* %4
br label %7
7: ; preds = %17, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = load %struct.LamportQueue*, %struct.LamportQueue** %3
%12 = call i64 @LamportQueue_push(%struct.LamportQueue* %11, i32 36)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %17
17: ; preds = %14, %10
br label %7
18: ; preds = %7
ret i8* null
}

LLVM IR (-O2):
%struct.LamportQueue = type { i32 }
define noalias i8* @producer(i8* %0) {
%2 = bitcast i8* %0 to %struct.LamportQueue*
br label %3
3: ; preds = %1, %3
%4 = phi i32 [ 0, %1 ], [ %8, %3 ]
%5 = tail call i64 @LamportQueue_push(%struct.LamportQueue* %2, i32 36)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
%8 = add nuw nsw i32 %4, %7
%9 = icmp ult i32 %8, 100
br i1 %9, label %3, label %10
10: ; preds = %3
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ clearerr(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void crash_clearerr() {
  FILE *f;
  f = fopen("this_file_doesnt_exist", "r");
  clearerr(f);
  fclose(f);
}


x86 assembly (clang, -O0):
<crash_clearerr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clearerr@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crash_clearerr>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <clearerr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_clearerr() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @clearerr(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @fclose(i32* %5)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
define void @crash_clearerr() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @clearerr(i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void _speex_putc(int ch, void *file) {
  FILE *f = (FILE *)file;
  fprintf(f, "%c", ch);
}


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

x86 assembly (clang, -O2):
<_speex_putc>:
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @_speex_putc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %3
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
define void @_speex_putc(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = tail call i32 @fputc(i32 %0, i32* %3)
ret void
}
/* Type definitions */
struct tree {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
struct node *tree_RB_INSERT(struct tree *, struct node *);
__attribute__((unused)) struct node *tree_insert_node(struct tree *t,
                                                      struct node *e) {
  return tree_RB_INSERT(t, e);
}


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

x86 assembly (clang, -O2):
<tree_insert_node>:
jmp    1030 <tree_RB_INSERT@plt>

LLVM IR (-O0):
%struct.tree = type { i32 }
%struct.node = type { i32 }
define %struct.node* @tree_insert_node(%struct.tree* %0, %struct.node* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.node*
store %struct.tree* %0, %struct.tree** %3
store %struct.node* %1, %struct.node** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = load %struct.node*, %struct.node** %4
%7 = call %struct.node* @tree_RB_INSERT(%struct.tree* %5, %struct.node* %6)
ret %struct.node* %7
}

LLVM IR (-O2):
%struct.tree = type { i32 }
%struct.node = type { i32 }
define %struct.node* @tree_insert_node(%struct.tree* %0, %struct.node* %1) {
%3 = tail call %struct.node* @tree_RB_INSERT(%struct.tree* %0, %struct.node* %1)
ret %struct.node* %3
}
/* Variables and functions */
int popType();
int /*<<< orphan*/ verifyTypes2(int, int, int, long, long);
int verifyTypes(int operator, long expr_start, long expr_end) {
  int op2 = popType();
  int op1 = popType();
  verifyTypes2(op1, operator, op2, expr_start, expr_end);
}


x86 assembly (clang, -O0):
<verifyTypes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1040 <popType@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <popType@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1030 <verifyTypes2@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verifyTypes>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <popType@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <popType@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r15,%rcx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <verifyTypes2@plt>

LLVM IR (-O0):
define i32 @verifyTypes(i32 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%10 = call i32 (...) @popType()
store i32 %10, i32* %8
%11 = call i32 (...) @popType()
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = load i32, i32* %5
%14 = load i32, i32* %8
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = call i32 @verifyTypes2(i32 %12, i32 %13, i32 %14, i64 %15, i64 %16)
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @verifyTypes(i32 %0, i64 %1, i64 %2) {
%4 = tail call i32 (...) @popType()
%5 = tail call i32 (...) @popType()
%6 = tail call i32 @verifyTypes2(i32 %5, i32 %0, i32 %4, i64 %1, i64 %2)
ret i32 undef
}
void gdk_keymap_get_entries_for_keycode() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keymap_get_entries_for_keycode() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ receber_matriz(int, int);
int main() {
  int l = 3;
  int c = 3;
  receber_matriz(l, c);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 3, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @receber_matriz(i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @receber_matriz(i32 3, i32 3)
ret i32 0
}
void cnt(int sig) {}


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

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

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

LLVM IR (-O2):
define void @cnt(i32 %0) {
ret void
}
int get_first(int bit_flag) {
  int bin[12];
  int k = bit_flag;
  int i = 0;
  while (k > 0) {
    bin[i] = k % 2;
    k = k / 2;
    i++;
  }
  return bin[6];
}


x86 assembly (clang, -O0):
<get_first>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x0,-0x44(%rbp)
jle    114d <get_first+0x4d>
mov    -0x44(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq -0x48(%rbp),%rax
mov    %edx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1114 <get_first+0x14>
mov    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_first>:
test   %edi,%edi
jle    1129 <get_first+0x29>
lea    -0x38(%rsp),%rax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
mov    %edx,(%rax)
shr    %ecx
add    $0x4,%rax
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <get_first+0x10>
mov    -0x20(%rsp),%eax
ret
ret

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

LLVM IR (-O2):
define i32 @get_first(i32 %0) {
%2 = alloca [12 x i32]
%3 = bitcast [12 x i32]* %2 to i8*
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %16
5: ; preds = %1, %5
%6 = phi i64 [ %11, %5 ], [ 0, %1 ]
%7 = phi i32 [ %10, %5 ], [ %0, %1 ]
%8 = and i32 %7, 1
%9 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 %6
store i32 %8, i32* %9
%10 = lshr i32 %7, 1
%11 = add nuw nsw i64 %6, 1
%12 = icmp ult i32 %7, 2
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = getelementptr inbounds [12 x i32], [12 x i32]* %2, i64 0, i64 6
%15 = load i32, i32* %14
br label %16
16: ; preds = %13, %1
%17 = phi i32 [ %15, %13 ], [ undef, %1 ]
ret i32 %17
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XKeymapEvent;

/* Variables and functions */
void set_XKeymapEvent_send_event(void *_p, int _v) {
  ((XKeymapEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeymapEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XKeymapEvent_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeymapEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned short vax_to_local_short_(const unsigned short *s) { return *s; }


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

x86 assembly (clang, -O2):
<vax_to_local_short_>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @vax_to_local_short_(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @vax_to_local_short_(i16* nocapture %0) {
%2 = load i16, i16* %0
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ BinarySearchTest();
int main() {
  BinarySearchTest();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @BinarySearchTest()
ret i32 0
}