xunge/DecIR huggingface dataset:
int main() {
  int a = 13;
  int b = 6;
  return a - b;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 7
}
void initZero(int tab[], int taille) {
  int i;
  for (i = 0; i < taille; i++) {
    tab[i] = 0;
  }
}


x86 assembly (clang, -O0):
<initZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <initZero+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <initZero+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initZero>:
test   %esi,%esi
jle    1126 <initZero+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @initZero(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 0, i32* %5
br label %6
6: ; preds = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
store i32 0, i32* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @initZero(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void convert_16_bit_to_byte_array(uint16_t value, uint8_t *data) {
  data[0] = value & 0xFF;
  data[1] = (value >> 8) & 0xFF;
}


x86 assembly (clang, -O0):
<convert_16_bit_to_byte_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_16_bit_to_byte_array>:
mov    %edi,%eax
movzbl %al,%ecx
mov    %ecx,(%rsi)
movzbl %ah,%eax
mov    %eax,0x4(%rsi)
ret

LLVM IR (-O0):
define void @convert_16_bit_to_byte_array(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 = and i32 %5, 255
%7 = load i32*, i32** %4
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 %6, i32* %8
%9 = load i32, i32* %3
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @convert_16_bit_to_byte_array(i32 %0, i32* nocapture writeonly %1) {
%3 = and i32 %0, 255
store i32 %3, i32* %1
%4 = lshr i32 %0, 8
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %6
ret void
}
int point_in_circle(double px, double py, double cx, double cy, double cr) {
  double xdist = px - cx;
  double ydist = py - cy;
  return xdist * xdist + ydist * ydist < cr * cr;
}


x86 assembly (clang, -O0):
<point_in_circle>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_in_circle>:
subsd  %xmm2,%xmm0
subsd  %xmm3,%xmm1
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm4
xor    %eax,%eax
ucomisd %xmm0,%xmm4
seta   %al
ret

LLVM IR (-O0):
define i32 @point_in_circle(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%13 = load double, double* %6
%14 = load double, double* %8
%15 = fsub double %13, %14
store double %15, double* %11
%16 = load double, double* %7
%17 = load double, double* %9
%18 = fsub double %16, %17
store double %18, double* %12
%19 = load double, double* %11
%20 = load double, double* %11
%21 = load double, double* %12
%22 = load double, double* %12
%23 = fmul double %21, %22
%24 = call double @llvm.fmuladd.f64(double %19, double %20, double %23)
%25 = load double, double* %10
%26 = load double, double* %10
%27 = fmul double %25, %26
%28 = fcmp olt double %24, %27
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @point_in_circle(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %2
%7 = fsub double %1, %3
%8 = fmul double %7, %7
%9 = tail call double @llvm.fmuladd.f64(double %6, double %6, double %8)
%10 = fmul double %4, %4
%11 = fcmp olt double %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int myfunmultiply(int, int);
int myfunsum(int, int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello world!!!\n");
  printf("2+3=%d\n", myfunsum(2, 3));
  printf("2*3=%d\n", myfunmultiply(2, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1030 <myfunsum@plt>
mov    %eax,%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1050 <myfunmultiply@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1040 <myfunsum@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2,%edi
mov    $0x3,%esi
call   1060 <myfunmultiply@plt>
lea    0xe86(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Hello world!!!\0A\00"
@.str.1 = [8 x i8] c"2+3=%d\0A\00"
@.str.2 = [8 x i8] c"2*3=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @myfunsum(i32 2, i32 3)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @myfunmultiply(i32 2, i32 3)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"2+3=%d\0A\00"
@.str.2 = [8 x i8] c"2*3=%d\0A\00"
@str = [15 x i8] c"Hello world!!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @myfunsum(i32 2, i32 3)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @myfunmultiply(i32 2, i32 3)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unlinkat(int, char *, int /*<<< orphan*/);
void _unlock(int dirfd, char *file) { unlinkat(dirfd, file, 0); }


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

x86 assembly (clang, -O2):
<_unlock>:
xor    %edx,%edx
jmp    1030 <unlinkat@plt>

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

LLVM IR (-O2):
define void @_unlock(i32 %0, i8* %1) {
%3 = tail call i32 @unlinkat(i32 %0, i8* %1, i32 0)
ret void
}
/* Variables and functions */
int DatosValidos(int, int, int);
int /*<<< orphan*/ EntradaDatos(int *, int *, int *);
void LeerFecha(int *dia, int *mes, int *anyo) {
  int datos_validos;
  do {
    EntradaDatos(dia, mes, anyo);
    datos_validos = DatosValidos(*dia, *mes, *anyo);
  } while (!datos_validos);
}


x86 assembly (clang, -O0):
<LeerFecha>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <EntradaDatos@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1040 <DatosValidos@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1134 <LeerFecha+0x14>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LeerFecha>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <EntradaDatos@plt>
mov    (%rbx),%edi
mov    (%r15),%esi
mov    (%r14),%edx
call   1040 <DatosValidos@plt>
test   %eax,%eax
je     1130 <LeerFecha+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @LeerFecha(i32* %0, i32* %1, i32* %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @EntradaDatos(i32* %0, i32* %1, i32* %2)
%6 = load i32, i32* %0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = tail call i32 @DatosValidos(i32 %6, i32 %7, i32 %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %4, label %11
11: ; preds = %4
ret void
}
void vmi_init(void) {}


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

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

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

LLVM IR (-O2):
define void @vmi_init() {
ret void
}
/* Variables and functions */
int magic_index(int *, int /*<<< orphan*/, int);
int test_magic_index_at_end() {
  int array[] = {-1, 0, 1, 2, 4};
  return 4 == magic_index(array, 0, 4);
}


x86 assembly (clang, -O0):
<test_magic_index_at_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <magic_index@plt>
mov    %eax,%ecx
mov    $0x4,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_magic_index_at_end>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <magic_index@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_magic_index_at_end.array = [5 x i32] [i32 -1, i32 0, i32 1, i32 2, i32 4]
define i32 @test_magic_index_at_end() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @magic_index(i32* %3, i32 0, i32 4)
%5 = icmp eq i32 4, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@__const.test_magic_index_at_end.array = [5 x i32] [i32 -1, i32 0, i32 1, i32 2, i32 4]
define i32 @test_magic_index_at_end() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @magic_index(i32* %3, i32 0, i32 4)
%5 = icmp eq i32 %4, 4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ dotest(double, double);
int main() {
  dotest(2.6e-08, 1.29999999155e-08);
  dotest(1.4e-09, 6.999999997549999e-10);
  dotest(5.0e-06, 2.499996875007812e-06);
  dotest(2.4e-07, 1.1999999280000085e-07);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsd  0xf14(%rip),%xmm0
movsd  0xf14(%rip),%xmm1
call   1030 <dotest@plt>
movsd  0xeef(%rip),%xmm0
movsd  0xeef(%rip),%xmm1
call   1030 <dotest@plt>
movsd  0xeca(%rip),%xmm0
movsd  0xeca(%rip),%xmm1
call   1030 <dotest@plt>
movsd  0xea5(%rip),%xmm0
movsd  0xea5(%rip),%xmm1
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <dotest@plt>
movsd  0xee2(%rip),%xmm0
movsd  0xee2(%rip),%xmm1
call   1030 <dotest@plt>
movsd  0xedd(%rip),%xmm0
movsd  0xedd(%rip),%xmm1
call   1030 <dotest@plt>
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
call   1030 <dotest@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @dotest(double 2.600000e-08, double 0x3E4BEAD35633BCB6)
%2 = call i32 @dotest(double 1.400000e-09, double 0x3E080D43DE789E2C)
%3 = call i32 @dotest(double 5.000000e-06, double 0x3EC4F8B3D115B361)
%4 = call i32 @dotest(double 2.400000e-07, double 0x3E801B2B196DE4D6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @dotest(double 2.600000e-08, double 0x3E4BEAD35633BCB6)
%2 = tail call i32 @dotest(double 1.400000e-09, double 0x3E080D43DE789E2C)
%3 = tail call i32 @dotest(double 5.000000e-06, double 0x3EC4F8B3D115B361)
%4 = tail call i32 @dotest(double 2.400000e-07, double 0x3E801B2B196DE4D6)
ret i32 0
}
/* Variables and functions */
int op_if(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ op_not(int);
int op_xor(int a, int b) { return op_if(a, op_not(b), b); }


x86 assembly (clang, -O0):
<op_xor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <op_not@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1040 <op_if@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_xor>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <op_not@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <op_if@plt>

LLVM IR (-O0):
define i32 @op_xor(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @op_not(i32 %6)
%8 = load i32, i32* %4
%9 = call i32 @op_if(i32 %5, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @op_xor(i32 %0, i32 %1) {
%3 = tail call i32 @op_not(i32 %1)
%4 = tail call i32 @op_if(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
int get_input(void) {
  int input = 0;
  return input;
}


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

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

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

LLVM IR (-O2):
define i32 @get_input() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C67_asm(char *, int /*<<< orphan*/, int, int);
void C67_DPTRUNC(int r, int v) { C67_asm("DPTRUNC.L", 0, r, v); }


x86 assembly (clang, -O0):
<C67_DPTRUNC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1030 <C67_asm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<C67_DPTRUNC>:
mov    %esi,%ecx
mov    %edi,%edx
lea    0xee5(%rip),%rdi
xor    %esi,%esi
jmp    1030 <C67_asm@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"DPTRUNC.L\00"
define void @C67_DPTRUNC(i32 %0, i32 %1) {
%3 = tail call i32 @C67_asm(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 0, i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void NotExportedFunction() { printf("This function is NOT exported\n"); }


x86 assembly (clang, -O0):
<NotExportedFunction>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"This function is NOT exported\0A\00"
define void @NotExportedFunction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"This function is NOT exported\00"
define void @NotExportedFunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int crc64_big(int, void *, size_t);
int crc64_little(int, void *, size_t);
uint64_t crc64(uint64_t crc, void *buf, size_t len) {
  uint64_t n = 1;
  return *(char *)&n ? crc64_little(crc, buf, len) : crc64_big(crc, buf, len);
}


x86 assembly (clang, -O0):
<crc64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
movsbl -0x1c(%rbp),%eax
cmp    $0x0,%eax
je     115f <crc64+0x3f>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <crc64_little@plt>
mov    %eax,-0x20(%rbp)
jmp    1172 <crc64+0x52>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <crc64_big@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc64>:
jmp    1030 <crc64_little@plt>

LLVM IR (-O0):
define i32 @crc64(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
store i32 1, i32* %7
%8 = bitcast i32* %7 to i8*
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = call i32 @crc64_little(i32 %13, i8* %14, i64 %15)
br label %22
17: ; preds = %3
%18 = load i32, i32* %4
%19 = load i8*, i8** %5
%20 = load i64, i64* %6
%21 = call i32 @crc64_big(i32 %18, i8* %19, i64 %20)
br label %22
22: ; preds = %17, %12
%23 = phi i32 [ %16, %12 ], [ %21, %17 ]
ret i32 %23
}

LLVM IR (-O2):
define i32 @crc64(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @crc64_little(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void function_d() { printf("How can you get here?\n"); }


x86 assembly (clang, -O0):
<function_d>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"How can you get here?\0A\00"
define void @function_d() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"How can you get here?\00"
define void @function_d() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
size_t read_FP_BE(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
size_t uint32ReadFromFP(FILE *fp, uint32_t *data) {
  return read_FP_BE(fp, data, sizeof(uint32_t));
}


x86 assembly (clang, -O0):
<uint32ReadFromFP>:
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    $0x4,%edx
call   1030 <read_FP_BE@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint32ReadFromFP>:
mov    $0x4,%edx
jmp    1030 <read_FP_BE@plt>

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

LLVM IR (-O2):
define i64 @uint32ReadFromFP(i32* %0, i32* %1) {
%3 = tail call i64 @read_FP_BE(i32* %0, i32* %1, i32 4)
ret i64 %3
}
int do_518() { return 518; }


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

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

LLVM IR (-O0):
define i32 @do_518() {
ret i32 518
}

LLVM IR (-O2):
define i32 @do_518() {
ret i32 518
}
void RGBColorTableRow_X86() {}


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

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

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

LLVM IR (-O2):
define void @RGBColorTableRow_X86() {
ret void
}
void anc_max14744_start_charge(void) { return; }


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

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

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

LLVM IR (-O2):
define void @anc_max14744_start_charge() {
ret void
}
int readboard() { return (0); }


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

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

LLVM IR (-O0):
define i32 @readboard() {
ret i32 0
}

LLVM IR (-O2):
define i32 @readboard() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ev_default_loop(int /*<<< orphan*/);
int /*<<< orphan*/ ev_loop_fork(int /*<<< orphan*/);
void __attribute__((unused)) ev_default_fork(void) {
  ev_loop_fork(ev_default_loop(0));
}


x86 assembly (clang, -O0):
<ev_default_fork>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <ev_default_loop@plt>
mov    %eax,%edi
call   1030 <ev_loop_fork@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ev_default_fork() {
%1 = call i32 @ev_default_loop(i32 0)
%2 = call i32 @ev_loop_fork(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ev_default_fork() {
%1 = tail call i32 @ev_default_loop(i32 0)
%2 = tail call i32 @ev_loop_fork(i32 %1)
ret void
}
int B256ToB32Bytes(int numB256Bytes) { return (numB256Bytes * 8 + 4) / 5; }


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

x86 assembly (clang, -O2):
<B256ToB32Bytes>:
lea    0x4(,%rdi,8),%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @B256ToB32Bytes(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = or i32 %2, 4
%4 = sdiv i32 %3, 5
ret i32 %4
}
/* Variables and functions */
double radDeg(double);
double mercLon(double x) { return radDeg(x) / 6378137.0; }


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

x86 assembly (clang, -O2):
<mercLon>:
push   %rax
call   1030 <radDeg@plt>
divsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @mercLon(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @radDeg(double %3)
%5 = fdiv double %4, 0x415854A640000000
ret double %5
}

LLVM IR (-O2):
define double @mercLon(double %0) {
%2 = tail call double @radDeg(double %0)
%3 = fdiv double %2, 0x415854A640000000
ret double %3
}
/* Variables and functions */
scalar_t__ is_CL_both_case(unsigned int);
unsigned int to_upper(unsigned int);
unsigned int CL_to_upper(unsigned int ch) {
  return (is_CL_both_case(ch) ? to_upper(ch) : ch);
}


x86 assembly (clang, -O0):
<CL_to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_CL_both_case@plt>
cmp    $0x0,%rax
je     114d <CL_to_upper+0x2d>
mov    -0x4(%rbp),%edi
call   1040 <to_upper@plt>
mov    %eax,-0x8(%rbp)
jmp    1153 <CL_to_upper+0x33>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CL_to_upper>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_CL_both_case@plt>
test   %rax,%rax
je     1135 <CL_to_upper+0x15>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <to_upper@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CL_to_upper(i32 %0) {
%2 = tail call i64 @is_CL_both_case(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @to_upper(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %0, %1 ]
ret i32 %7
}
/* Variables and functions */
size_t getMinSize() { return 32768; }


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

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

LLVM IR (-O0):
define i64 @getMinSize() {
ret i64 32768
}

LLVM IR (-O2):
define i64 @getMinSize() {
ret i64 32768
}
/* Variables and functions */
int /*<<< orphan*/ calloc(size_t, size_t);
void *tree_zmalloc_init(int /*<<< orphan*/, void *);
void *tree_zcalloc(size_t num, size_t size, void *parent) {
  return tree_zmalloc_init(calloc(num, size + (sizeof(void *) * 3)), parent);
}


x86 assembly (clang, -O0):
<tree_zcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x18,%rsi
call   1040 <calloc@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
call   1030 <tree_zmalloc_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_zcalloc>:
push   %rbx
mov    %rdx,%rbx
add    $0x18,%rsi
call   1040 <calloc@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <tree_zmalloc_init@plt>

LLVM IR (-O0):
define i8* @tree_zcalloc(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = add i64 %8, 24
%10 = call i32 @calloc(i64 %7, i64 %9)
%11 = load i8*, i8** %6
%12 = call i8* @tree_zmalloc_init(i32 %10, i8* %11)
ret i8* %12
}

LLVM IR (-O2):
define i8* @tree_zcalloc(i64 %0, i64 %1, i8* %2) {
%4 = add i64 %1, 24
%5 = tail call i32 @calloc(i64 %0, i64 %4)
%6 = tail call i8* @tree_zmalloc_init(i32 %5, i8* %2)
ret i8* %6
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ partition(struct TreeNode *);
void flatten(struct TreeNode *root) { partition(root); }


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

x86 assembly (clang, -O2):
<flatten>:
jmp    1030 <partition@plt>

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define void @flatten(%struct.TreeNode* %0) {
%2 = alloca %struct.TreeNode*
store %struct.TreeNode* %0, %struct.TreeNode** %2
%3 = load %struct.TreeNode*, %struct.TreeNode** %2
%4 = call i32 @partition(%struct.TreeNode* %3)
ret void
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define void @flatten(%struct.TreeNode* %0) {
%2 = tail call i32 @partition(%struct.TreeNode* %0)
ret void
}
int test_imm_80int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x80 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_80int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 549755813888
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ printf(char *, void *, long);
void *realloc(void *, size_t);
void *checkedRealloc(void *ptr, size_t size) {
  void *retVal = realloc(ptr, size);
  if ((!retVal) && size) {
    printf("realloc failed ptr %p size %ld\n", ptr, (long)size);
    abort();
  }
  return retVal;
}


x86 assembly (clang, -O0):
<checkedRealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1182 <checkedRealloc+0x52>
cmpq   $0x0,-0x10(%rbp)
je     1182 <checkedRealloc+0x52>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkedRealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1050 <realloc@plt>
test   %rbx,%rbx
je     1149 <checkedRealloc+0x19>
test   %rax,%rax
je     1151 <checkedRealloc+0x21>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xea8(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"realloc failed ptr %p size %ld\0A\00"
define i8* @checkedRealloc(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 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %19, label %11
11: ; preds = %2
%12 = load i64, i64* %4
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = load i8*, i8** %3
%16 = load i64, i64* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %15, i64 %16)
%18 = call i32 (...) @abort()
unreachable
19: ; preds = %11, %2
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [32 x i8] c"realloc failed ptr %p size %ld\0A\00"
define noalias i8* @checkedRealloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %1, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int d, c;
  while (1) {
    scanf("%d\t", &d);
    printf("[%d]\n", d);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xec8(%rip),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [6 x i8] c"[%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %0, %4
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
@.str.1 = [6 x i8] c"[%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %3
}
void InitLbxReqStats() {}


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

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

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

LLVM IR (-O2):
define void @InitLbxReqStats() {
ret void
}
/* Variables and functions */
int heroes_main(int, char **);
int main(int argc, char *argv[]) { return heroes_main(argc, argv); }


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    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <heroes_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
jmp    1030 <heroes_main@plt>

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 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @heroes_main(i32 %6, i8** %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @heroes_main(i32 %0, i8** %1)
ret i32 %3
}
void av_buffer_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_alloc() {
ret void
}
__attribute__((__format__(__printf__, 1, 0))) void
vprintdbg_dummy(char const *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @vprintdbg_dummy(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *__strdup(const char *str) {
  char *tmp;
  tmp = malloc(strlen(str) + 1);
  if (!tmp)
    return NULL;
  strcpy(tmp, str);
  return tmp;
}


x86 assembly (clang, -O0):
<__strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <__strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <__strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <__strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @__strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %1
store i8* null, i8** %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %11
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @__strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Variables and functions */
unsigned int fibo(unsigned int);
void fibo_array(unsigned int *results, unsigned int limit) {
  for (unsigned int n = 1; n <= limit; n++)
    results[n - 1] = fibo(n);
}


x86 assembly (clang, -O0):
<fibo_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
ja     1159 <fibo_array+0x49>
mov    -0x10(%rbp),%edi
call   1030 <fibo@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fibo_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibo_array>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1145 <fibo_array+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <fibo@plt>
lea    -0x1(%rbx),%ecx
mov    %eax,(%r14,%rcx,4)
add    $0x1,%ebx
cmp    %ebp,%ebx
jbe    1130 <fibo_array+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @fibo_array(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 = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ule i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32, i32* %5
%12 = call i32 @fibo(i32 %11)
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sub i32 %14, 1
%16 = zext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
store i32 %12, i32* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @fibo_array(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %11, %5 ], [ 1, %2 ]
%7 = tail call i32 @fibo(i32 %6)
%8 = add i32 %6, -1
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %7, i32* %10
%11 = add i32 %6, 1
%12 = icmp ugt i32 %11, %1
br i1 %12, label %4, label %5
}
/* Variables and functions */
size_t PIXREGION_SZOF(size_t);
void *malloc(size_t);
void *allocData(size_t n) {
  size_t sz = PIXREGION_SZOF(n);
  if (!sz)
    return NULL;
  return malloc(sz);
}


x86 assembly (clang, -O0):
<allocData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <PIXREGION_SZOF@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1151 <allocData+0x31>
movq   $0x0,-0x8(%rbp)
jmp    115e <allocData+0x3e>
mov    -0x18(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocData>:
push   %rax
call   1040 <PIXREGION_SZOF@plt>
test   %rax,%rax
je     1134 <allocData+0x14>
mov    %rax,%rdi
pop    %rax
jmp    1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @allocData(i64 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = call i64 @PIXREGION_SZOF(i64 %5)
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = icmp ne i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i8* null, i8** %2
br label %13
10: ; preds = %1
%11 = load i64, i64* %4
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %2
br label %13
13: ; preds = %10, %9
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @allocData(i64 %0) {
%2 = tail call i64 @PIXREGION_SZOF(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i8* @malloc(i64 %2)
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ null, %1 ]
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void mus_lint_to_char(unsigned char *j, int x) {
  unsigned char *ox = (unsigned char *)&x;
  memcpy((void *)j, (void *)ox, 4);
}


x86 assembly (clang, -O0):
<mus_lint_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_lint_to_char>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mus_lint_to_char(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = bitcast i32* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = call i32 @memcpy(i8* %7, i8* %8, i32 4)
ret void
}

LLVM IR (-O2):
define void @mus_lint_to_char(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = bitcast i32* %3 to i8*
%5 = call i32 @memcpy(i8* %0, i8* %4, i32 4)
ret void
}
/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ getcwd(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char cwd[PATH_MAX];
  getcwd(cwd, PATH_MAX);
  printf("%s\n", cwd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x18(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%esi
call   1040 <getcwd@plt>
mov    -0x18(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rsp
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
mov    %rsi,%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdi
call   1040 <getcwd@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i64
%3 = load i32, i32* @PATH_MAX
%4 = zext i32 %3 to i64
%5 = call i8* @llvm.stacksave()
store i8* %5, i8** %1
%6 = alloca i8, i64 %4
store i64 %4, i64* %2
%7 = load i32, i32* @PATH_MAX
%8 = call i32 @getcwd(i8* %6, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%10 = load i8*, i8** %1
ret i32 0
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = load i32, i32* @PATH_MAX
%2 = zext i32 %1 to i64
%3 = alloca i8, i64 %2
%4 = call i32 @getcwd(i8* %3, i32 %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t lfsrandom64(uint64_t *r) {
  return *r = ((*r) >> 1) ^ (-((*r) & 1u) & (0xd800000000000000u));
}


x86 assembly (clang, -O0):
<lfsrandom64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
sar    $0x1,%eax
cltq
mov    -0x8(%rbp),%rcx
mov    (%rcx),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
mov    %ecx,%ecx
movabs $0xd800000000000000,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lfsrandom64(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = ashr i32 %4, 1
%6 = sext i32 %5 to i64
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = and i32 %8, 1
%10 = sub i32 0, %9
%11 = zext i32 %10 to i64
%12 = and i64 %11, -2882303761517117440
%13 = xor i64 %6, %12
%14 = trunc i64 %13 to i32
%15 = load i32*, i32** %2
store i32 %14, i32* %15
ret i32 %14
}

LLVM IR (-O2):
define i32 @lfsrandom64(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = ashr i32 %2, 1
store i32 %3, i32* %0
ret i32 %3
}