xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
long _gzsize_f(int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
long _gzsize(const char *input_file) {
  FILE *f = NULL;
  long size = -1;
  if (NULL == (f = fopen(input_file, "rb"))) {
    return -1;
  }
  size = _gzsize_f(f);
  fclose(f);
  return size;
}


x86 assembly (clang, -O0):
<_gzsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
mov    -0x10(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
cmp    %rcx,%rax
jne    117b <_gzsize+0x4b>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1199 <_gzsize+0x69>
mov    -0x18(%rbp),%rdi
call   1030 <_gzsize_f@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gzsize>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1160 <_gzsize+0x30>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <_gzsize_f@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rax
jmp    1167 <_gzsize+0x37>
mov    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i64 @_gzsize(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i64
store i8* %0, i8** %3
store i32* null, i32** %4
store i64 -1, i64* %5
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = icmp eq i32* null, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i64 -1, i64* %2
br label %16
10: ; preds = %1
%11 = load i32*, i32** %4
%12 = call i64 @_gzsize_f(i32* %11)
store i64 %12, i64* %5
%13 = load i32*, i32** %4
%14 = call i32 @fclose(i32* %13)
%15 = load i64, i64* %5
store i64 %15, i64* %2
br label %16
16: ; preds = %10, %9
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i64 @_gzsize(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i64 @_gzsize_f(i32* %2)
%6 = tail call i32 @fclose(i32* %2)
br label %7
7: ; preds = %1, %4
%8 = phi i64 [ %5, %4 ], [ -1, %1 ]
ret i64 %8
}
int apic_id_registered(void) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @apic_id_registered() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ inputint(char *);
double media(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
int main() { printf("%f\n", media(inputint("quanti numeri vuoi inserire?"))); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec9(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,%edi
call   1050 <media@plt>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecc(%rip),%rdi
call   1040 <inputint@plt>
mov    %eax,%edi
call   1050 <media@plt>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [29 x i8] c"quanti numeri vuoi inserire?\00"
define i32 @main() {
%1 = call i32 @inputint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%2 = call double @media(i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [29 x i8] c"quanti numeri vuoi inserire?\00"
define i32 @main() {
%1 = tail call i32 @inputint(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call double @media(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ outbyte(char);
prefix() { outbyte('_'); }


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

x86 assembly (clang, -O2):
<prefix>:
mov    $0x5f,%edi
jmp    1030 <outbyte@plt>

LLVM IR (-O0):
define i32 @prefix() {
%1 = alloca i32
%2 = call i32 @outbyte(i8 signext 95)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @prefix() {
%1 = tail call i32 @outbyte(i8 signext 95)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
void hashsg_cpy(char *s1, const char *s2) {
  memcpy(s1, s2, 20);
  s1[20] = 0;
}


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

x86 assembly (clang, -O2):
<hashsg_cpy>:
push   %rbx
mov    %rdi,%rbx
mov    $0x14,%edx
call   1030 <memcpy@plt>
movb   $0x0,0x14(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @hashsg_cpy(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 @memcpy(i8* %5, i8* %6, i32 20)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 20
store i8 0, i8* %9
ret void
}

LLVM IR (-O2):
define void @hashsg_cpy(i8* %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %0, i8* %1, i32 20)
%4 = getelementptr inbounds i8, i8* %0, i64 20
store i8 0, i8* %4
ret void
}
int Int_bit_MINUS_shift_MINUS_left(int x, int y) { return x << y; }


x86 assembly (clang, -O0):
<Int_bit_MINUS_shift_MINUS_left>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int_bit_MINUS_shift_MINUS_left>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @Int_bit_MINUS_shift_MINUS_left(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int ErrorBlas(char *srname, int *info) {
  printf("** On entry to %6s, parameter number %d had an illegal value\n",
         srname, *info);
  return 0;
}


x86 assembly (clang, -O0):
<ErrorBlas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ErrorBlas>:
push   %rax
mov    %rdi,%rax
mov    (%rsi),%edx
lea    0xee3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"** On entry to %6s, parameter number %d had an illegal value\0A\00"
define i32 @ErrorBlas(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [62 x i8] c"** On entry to %6s, parameter number %d had an illegal value\0A\00"
define i32 @ErrorBlas(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkdir(const char *dirname, mode_t mode) {
  int rc;
  return rc;
}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mkdir(i8* nocapture readnone %0, i32 %1) {
ret i32 undef
}
void INT_Excep_VBATT_VBTLVDI(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_VBATT_VBTLVDI() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t clampX(uint32_t x) { return x >= 640 ? 640 - 1 : x; }


x86 assembly (clang, -O0):
<clampX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x280,-0x4(%rbp)
jl     1121 <clampX+0x21>
mov    $0x27f,%eax
mov    %eax,-0x8(%rbp)
jmp    1127 <clampX+0x27>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clampX>:
cmp    $0x27f,%edi
mov    $0x27f,%eax
cmovl  %edi,%eax
ret

LLVM IR (-O0):
define i32 @clampX(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 640
br i1 %4, label %5, label %6
5: ; preds = %1
br label %8
6: ; preds = %1
%7 = load i32, i32* %2
br label %8
8: ; preds = %6, %5
%9 = phi i32 [ 639, %5 ], [ %7, %6 ]
ret i32 %9
}

LLVM IR (-O2):
define i32 @clampX(i32 %0) {
%2 = icmp slt i32 %0, 639
%3 = select i1 %2, i32 %0, i32 639
ret i32 %3
}
/* Variables and functions */
int dwarf_get_CHILDREN_name(unsigned int, char const **);
char const *ellipname(int, unsigned int, char const *, char *, int);
const char *get_CHILDREN_name(unsigned int val_in, int printonerr) {
  const char *v = 0;
  int res = dwarf_get_CHILDREN_name(val_in, &v);
  return ellipname(res, val_in, v, "CHILDREN", printonerr);
}


x86 assembly (clang, -O0):
<get_CHILDREN_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1030 <dwarf_get_CHILDREN_name@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%r8d
lea    0xea6(%rip),%rcx
call   1040 <ellipname@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_CHILDREN_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
movq   $0x0,(%rsp)
mov    %rsp,%rsi
call   1030 <dwarf_get_CHILDREN_name@plt>
mov    (%rsp),%rdx
lea    0xebe(%rip),%rcx
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
call   1040 <ellipname@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"CHILDREN\00"
define i8* @get_CHILDREN_name(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* null, i8** %5
%7 = load i32, i32* %3
%8 = call i32 @dwarf_get_CHILDREN_name(i32 %7, i8** %5)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %3
%11 = load i8*, i8** %5
%12 = load i32, i32* %4
%13 = call i8* @ellipname(i32 %9, i32 %10, i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i8* %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"CHILDREN\00"
define i8* @get_CHILDREN_name(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = call i32 @dwarf_get_CHILDREN_name(i32 %0, i8** %3)
%6 = load i8*, i8** %3
%7 = call i8* @ellipname(i32 %5, i32 %0, i8* %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i8* %7
}
int bitXor(int x, int y) { return ~(~(~x & y) & ~(x & ~y)); }


x86 assembly (clang, -O0):
<bitXor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bitXor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = xor i32 %5, -1
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = xor i32 %8, -1
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %11, -1
%13 = and i32 %10, %12
%14 = xor i32 %13, -1
%15 = and i32 %9, %14
%16 = xor i32 %15, -1
ret i32 %16
}

LLVM IR (-O2):
define i32 @bitXor(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fn2();
int main() {
  fn2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn2()
ret i32 0
}
/* Variables and functions */
char *strrchr(char *, char);
char *Basename(char *str) {
  char *cp = strrchr(str, '/');
  return cp ? cp + 1 : str;
}


x86 assembly (clang, -O0):
<Basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <Basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <Basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @Basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *prg) {
  fprintf(stderr,
          "Usage: %s ALPHA BETA K NT EPS <u GAMMA|a GAMMA|t DEPTH> TTHRESH "
          "RESOLUTION DATASET [SEED]\n",
          prg);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [91 x i8] c"Usage: %s ALPHA BETA K NT EPS <u GAMMA|a GAMMA|t DEPTH> TTHRESH RESOLUTION DATASET [SEED]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [91 x i8] c"Usage: %s ALPHA BETA K NT EPS <u GAMMA|a GAMMA|t DEPTH> TTHRESH RESOLUTION DATASET [SEED]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
/* Variables and functions */
double atan(double);
double log2(double);
double strling(double n) {
  return log2(2 * (4.0 * atan(1.0)) * n) / 2 + n * log2(n / 2.718281828);
}


x86 assembly (clang, -O0):
<strling>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
call   1040 <atan@plt>
movsd  0xece(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <log2@plt>
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xe7c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <log2@plt>
movsd  -0x18(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strling>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xece(%rip),%xmm0
call   1040 <atan@plt>
movsd  0xec9(%rip),%xmm0
mulsd  0x8(%rsp),%xmm0
call   1030 <log2@plt>
mulsd  0xebe(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
divsd  0xeb2(%rip),%xmm0
call   1030 <log2@plt>
mulsd  0x8(%rsp),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @strling(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double @atan(double 1.000000e+00)
%4 = fmul double 4.000000e+00, %3
%5 = fmul double 2.000000e+00, %4
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = call double @log2(double %7)
%9 = fdiv double %8, 2.000000e+00
%10 = load double, double* %2
%11 = load double, double* %2
%12 = fdiv double %11, 0x4005BF0A8B04919B
%13 = call double @log2(double %12)
%14 = call double @llvm.fmuladd.f64(double %10, double %13, double %9)
ret double %14
}

LLVM IR (-O2):
define double @strling(double %0) {
%2 = tail call double @atan(double 1.000000e+00)
%3 = fmul double %0, 0x401921FB54442D18
%4 = tail call double @log2(double %3)
%5 = fmul double %4, 5.000000e-01
%6 = fdiv double %0, 0x4005BF0A8B04919B
%7 = tail call double @log2(double %6)
%8 = tail call double @llvm.fmuladd.f64(double %0, double %7, double %5)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main(int argc, char *argv[]) { printf("Hello, World!\n"); }


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Hello, World!\00"
define void @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long __builtin_wasm_memory_size(int /*<<< orphan*/);
long unsigned int memory_size(void) { return __builtin_wasm_memory_size(0); }


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

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

LLVM IR (-O0):
define i64 @memory_size() {
%1 = call i64 @__builtin_wasm_memory_size(i32 0)
ret i64 %1
}

LLVM IR (-O2):
define i64 @memory_size() {
%1 = tail call i64 @__builtin_wasm_memory_size(i32 0)
ret i64 %1
}
/* Type definitions */
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffer_cleanup(struct buffer *);
int /*<<< orphan*/ free(struct buffer *);
void free_buffer(struct buffer *buffer) {
  buffer_cleanup(buffer);
  free(buffer);
}


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

x86 assembly (clang, -O2):
<free_buffer>:
push   %rbx
mov    %rdi,%rbx
call   1040 <buffer_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @free_buffer(%struct.buffer* %0) {
%2 = alloca %struct.buffer*
store %struct.buffer* %0, %struct.buffer** %2
%3 = load %struct.buffer*, %struct.buffer** %2
%4 = call i32 @buffer_cleanup(%struct.buffer* %3)
%5 = load %struct.buffer*, %struct.buffer** %2
%6 = call i32 @free(%struct.buffer* %5)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @free_buffer(%struct.buffer* %0) {
%2 = tail call i32 @buffer_cleanup(%struct.buffer* %0)
%3 = tail call i32 @free(%struct.buffer* %0)
ret void
}
OP(ed, ea) {}


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
ret i32 undef
}
void ExttSSLCertAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttSSLCertAuxTable() {
ret void
}
/* Variables and functions */
char *strdup(char const *);
size_t strlen(char const *);
char *my_strndup(const char *s, size_t n) {
  char *r = strdup(s);
  if (strlen(s) > n)
    r[n] = '\0';
  return r;
}


x86 assembly (clang, -O0):
<my_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    -0x10(%rbp),%rax
jbe    115c <my_strndup+0x3c>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strdup@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <strlen@plt>
cmp    %r14,%rax
jbe    1145 <my_strndup+0x25>
movb   $0x0,(%r15,%r14,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @my_strndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = call i64 @strlen(i8* %8)
%10 = load i64, i64* %4
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = load i64, i64* %4
%15 = getelementptr inbounds i8, i8* %13, i64 %14
store i8 0, i8* %15
br label %16
16: ; preds = %12, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define noalias i8* @my_strndup(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @strdup(i8* %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ugt i64 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 %1
store i8 0, i8* %7
br label %8
8: ; preds = %6, %2
ret i8* %3
}
int channel_digit_end(struct ast_channel *channel, char digit,
                      unsigned int duration) {
  return 0;
}


x86 assembly (clang, -O0):
<channel_digit_end>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.ast_channel = type opaque
define i32 @channel_digit_end(%struct.ast_channel* nocapture readnone %0, i8 signext %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void death() {
  printf("\n\nUnfortunately, you have died. Try to make your choices according "
         "to your highest ranking skills.");
  exit(0);
}


x86 assembly (clang, -O0):
<death>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<death>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [99 x i8] c"\0A\0AUnfortunately, you have died. Try to make your choices according to your highest ranking skills.\00"
define void @death() {
%1 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [99 x i8] c"\0A\0AUnfortunately, you have died. Try to make your choices according to your highest ranking skills.\00"
define void @death() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([99 x i8], [99 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
unsigned int ipow(int base, int exp) {
  unsigned int result = 1;
  while (exp) {
    if (exp & 1)
      result *= base;
    exp >>= 1;
    base *= base;
  }
  return result;
}


x86 assembly (clang, -O0):
<ipow>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114c <ipow+0x4c>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1134 <ipow+0x34>
mov    -0x4(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1111 <ipow+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipow>:
test   %esi,%esi
je     113a <ipow+0x3a>
mov    $0x1,%r8d
mov    $0x1,%eax
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
test   $0x1,%sil
mov    %edi,%ecx
cmove  %r8d,%ecx
imul   %ecx,%eax
sar    %edx
imul   %edi,%edi
cmp    $0x1,%esi
mov    %edx,%esi
ja     1120 <ipow+0x20>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @ipow(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 1, %2 ]
%6 = phi i32 [ %12, %4 ], [ %1, %2 ]
%7 = phi i32 [ %13, %4 ], [ %0, %2 ]
%8 = and i32 %6, 1
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 1, i32 %7
%11 = mul i32 %10, %5
%12 = ashr i32 %6, 1
%13 = mul nsw i32 %7, %7
%14 = icmp ult i32 %6, 2
br i1 %14, label %15, label %4
15: ; preds = %4, %2
%16 = phi i32 [ 1, %2 ], [ %11, %4 ]
ret i32 %16
}
int leafNodeSize(int blockSize) { return (4) + (32) * blockSize; }


x86 assembly (clang, -O0):
<leafNodeSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x5,%eax
add    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<leafNodeSize>:
shl    $0x5,%edi
lea    0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @leafNodeSize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 32, %3
%5 = add nsw i32 4, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @leafNodeSize(i32 %0) {
%2 = shl nsw i32 %0, 5
%3 = or i32 %2, 4
ret i32 %3
}
int main(argc, argv)
int argc;
char **argv;
{
  if (init_()) {
    game_();
  }
  exit_();
}


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 <init_@plt>
cmp    $0x0,%eax
je     115d <main+0x2d>
mov    $0x0,%al
call   1040 <game_@plt>
mov    $0x0,%al
call   1050 <exit_@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <init_@plt>
test   %eax,%eax
je     1143 <main+0x13>
xor    %eax,%eax
call   1040 <game_@plt>
xor    %eax,%eax
call   1050 <exit_@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 (...) @init_()
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @game_()
br label %10
10: ; preds = %8, %2
%11 = call i32 (...) @exit_()
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @game_()
br label %7
7: ; preds = %5, %2
%8 = tail call i32 (...) @exit_()
ret i32 0
}
/* Variables and functions */
int syscall(int, char *);
int umount(char *dev) { return syscall(46, dev); }


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

x86 assembly (clang, -O2):
<umount>:
mov    %rdi,%rsi
mov    $0x2e,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @umount(i8* %0) {
%2 = tail call i32 @syscall(i32 46, i8* %0)
ret i32 %2
}
unsigned char APPL_StopMailboxHandler(void) { return 0; }


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

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

LLVM IR (-O0):
define zeroext i8 @APPL_StopMailboxHandler() {
ret i8 0
}

LLVM IR (-O2):
define zeroext i8 @APPL_StopMailboxHandler() {
ret i8 0
}
void nsa310_init(void) {}


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

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

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

LLVM IR (-O2):
define void @nsa310_init() {
ret void
}
/* Type definitions */
struct prem_model {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ prem_get_rho(double *, double, struct prem_model *);
double fm(double rnd, double *rho, struct prem_model *prem) {
  const double fac =
      4 * 3.1415926535897932384626433832795 * 6371.0087714 * 6371.0087714 * 1e9;
  prem_get_rho(rho, rnd, prem);
  return fac * rnd * rnd * (*rho);
}


x86 assembly (clang, -O0):
<fm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  0xed3(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
call   1030 <prem_get_rho@plt>
movsd  0xeb4(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mulsd  (%rax),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fm>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <prem_get_rho@plt>
movsd  0xed5(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  (%rbx),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.prem_model = type { i32 }
define double @fm(double %0, double* %1, %struct.prem_model* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca %struct.prem_model*
%7 = alloca double
store double %0, double* %4
store double* %1, double** %5
store %struct.prem_model* %2, %struct.prem_model** %6
store double 0x439C5078D939E930, double* %7
%8 = load double*, double** %5
%9 = load double, double* %4
%10 = load %struct.prem_model*, %struct.prem_model** %6
%11 = call i32 @prem_get_rho(double* %8, double %9, %struct.prem_model* %10)
%12 = load double, double* %4
%13 = fmul double 0x439C5078D939E930, %12
%14 = load double, double* %4
%15 = fmul double %13, %14
%16 = load double*, double** %5
%17 = load double, double* %16
%18 = fmul double %15, %17
ret double %18
}

LLVM IR (-O2):
%struct.prem_model = type { i32 }
define double @fm(double %0, double* %1, %struct.prem_model* %2) {
%4 = tail call i32 @prem_get_rho(double* %1, double %0, %struct.prem_model* %2)
%5 = fmul double %0, 0x439C5078D939E930
%6 = fmul double %5, %0
%7 = load double, double* %1
%8 = fmul double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void check_alloc(void *pnt) {
  if (pnt == NULL) {
    fprintf(stderr, "check_alloc: Couldn't allocate enough memory. Exiting\n");
    exit(7);
  }
}


x86 assembly (clang, -O0):
<check_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <check_alloc+0x36>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x7,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_alloc>:
test   %rdi,%rdi
je     1126 <check_alloc+0x6>
ret
push   %rax
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x7,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"check_alloc: Couldn't allocate enough memory. Exiting\0A\00"
define void @check_alloc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 7)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"check_alloc: Couldn't allocate enough memory. Exiting\0A\00"
define void @check_alloc(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 7)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MARun();
int main(int argc, char **argv) {
  MARun();
  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 <MARun@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <MARun@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 (...) @MARun()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @MARun()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *new (int);
int main() {
  int n = 100;
  char *p;
  p = new (n);
  free(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @new(i32 100)
%2 = tail call i32 @free(i8* %1)
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_trace_grid_diagnostics(double *err, double *dis) {
  int *a, *b, fail;
  double c[2];
  fail = _ada_use_c2phc4c(56, a, b, c, 0);
  *err = c[0];
  *dis = c[1];
  return fail;
}


x86 assembly (clang, -O0):
<standard_trace_grid_diagnostics>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x40(%rbp),%rcx
mov    $0x38,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x24(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_trace_grid_diagnostics>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rcx
mov    $0x38,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
movsd  (%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @standard_trace_grid_diagnostics(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca [2 x double]
store double* %0, double** %3
store double* %1, double** %4
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%12 = call i32 @_ada_use_c2phc4c(i32 56, i32* %9, i32* %10, double* %11, i32 0)
store i32 %12, i32* %7
%13 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%14 = load double, double* %13
%15 = load double*, double** %3
store double %14, double* %15
%16 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%17 = load double, double* %16
%18 = load double*, double** %4
store double %17, double* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @standard_trace_grid_diagnostics(double* nocapture writeonly %0, double* nocapture writeonly %1) {
%3 = alloca [2 x double]
%4 = bitcast [2 x double]* %3 to i8*
%5 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 0
%6 = call i32 @_ada_use_c2phc4c(i32 56, i32* undef, i32* undef, double* %5, i32 0)
%7 = load double, double* %5
store double %7, double* %0
%8 = getelementptr inbounds [2 x double], [2 x double]* %3, i64 0, i64 1
%9 = load double, double* %8
store double %9, double* %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_fdecl();
int /*<<< orphan*/ test_op();
int /*<<< orphan*/ test_tdecl_struct();
int /*<<< orphan*/ test_tdecl_union();
int main(void) {
  test_fdecl();
  test_tdecl_struct();
  test_tdecl_union();
  test_op();
  puts("Success");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <test_fdecl@plt>
mov    $0x0,%al
call   1060 <test_tdecl_struct@plt>
mov    $0x0,%al
call   1050 <test_tdecl_union@plt>
mov    $0x0,%al
call   1030 <test_op@plt>
lea    0xe7e(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <test_fdecl@plt>
xor    %eax,%eax
call   1060 <test_tdecl_struct@plt>
xor    %eax,%eax
call   1050 <test_tdecl_union@plt>
xor    %eax,%eax
call   1030 <test_op@plt>
lea    0xe8c(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_fdecl()
%3 = call i32 (...) @test_tdecl_struct()
%4 = call i32 (...) @test_tdecl_union()
%5 = call i32 (...) @test_op()
%6 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 (...) @test_fdecl()
%2 = tail call i32 (...) @test_tdecl_struct()
%3 = tail call i32 (...) @test_tdecl_union()
%4 = tail call i32 (...) @test_op()
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
float findAreaCircle(float radius) {
  float area;
  area = 3.142 * radius * radius;
  return area;
}


x86 assembly (clang, -O0):
<findAreaCircle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<findAreaCircle>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @findAreaCircle(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to double
%6 = fmul double 3.142000e+00, %5
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double %6, %8
%10 = fptrunc double %9 to float
store float %10, float* %3
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @findAreaCircle(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.142000e+00
%4 = fmul double %3, %2
%5 = fptrunc double %4 to float
ret float %5
}
void Reset_WMOPS_counter(void) {}


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

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

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

LLVM IR (-O2):
define void @Reset_WMOPS_counter() {
ret void
}
void foo(void) { __builtin_trap(); }


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

x86 assembly (clang, -O2):
<foo>:
ud2

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

LLVM IR (-O2):
define void @foo() {
tail call void @llvm.trap()
unreachable
}
void buf_set_uint16_le(void *buf, unsigned long addr, unsigned short val) {
  unsigned char *tmp = (unsigned char *)buf + addr;
  tmp[0] = val & 0xff;
  tmp[1] = (val >> 8) & 0xff;
}


x86 assembly (clang, -O0):
<buf_set_uint16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movzwl -0x12(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x12(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @buf_set_uint16_le(i8* %0, i64 %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i16
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i16 %2, i16* %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 i16, i16* %6
%12 = zext i16 %11 to i32
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %7
%16 = getelementptr inbounds i8, i8* %15, i64 0
store i8 %14, i8* %16
%17 = load i16, i16* %6
%18 = zext i16 %17 to i32
%19 = ashr i32 %18, 8
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %7
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8 %21, i8* %23
ret void
}

LLVM IR (-O2):
define void @buf_set_uint16_le(i8* nocapture writeonly %0, i64 %1, i16 zeroext %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 %1
%5 = trunc i16 %2 to i8
store i8 %5, i8* %4
%6 = lshr i16 %2, 8
%7 = trunc i16 %6 to i8
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %8
ret void
}
/* Variables and functions */
int atoi(char *);
int main(int argc, char const *argv[]) {
  char str[] = "12";
  if (atoi(str) != 12) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed3(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xecb(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x13(%rbp),%rdi
call   1030 <atoi@plt>
cmp    $0xc,%eax
je     1158 <main+0x48>
movl   $0x1,-0x4(%rbp)
jmp    115f <main+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.str = [3 x i8] c"12\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [3 x i8]* %6 to i8*
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%9 = call i32 @atoi(i8* %8)
%10 = icmp ne i32 %9, 12
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %13
12: ; preds = %2
store i32 0, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void vla_arg_func(int n, int array[n]) {
  (void)n;
  (void)array;
}


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

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

LLVM IR (-O0):
define void @vla_arg_func(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = load i32, i32* %3
%8 = load i32*, i32** %4
ret void
}

LLVM IR (-O2):
define void @vla_arg_func(i32 %0, i32* nocapture %1) {
ret void
}