xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ pf_init();
void pf_constructor() { pf_init(); }


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

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

LLVM IR (-O0):
define void @pf_constructor() {
%1 = call i32 (...) @pf_init()
ret void
}

LLVM IR (-O2):
define void @pf_constructor() {
%1 = tail call i32 (...) @pf_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_1_or_2_operandsl_vartext(char *, char *);
void special_fdivrl(void) { emit_1_or_2_operandsl_vartext("fdivr", "fdiv"); }


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

x86 assembly (clang, -O2):
<special_fdivrl>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <emit_1_or_2_operandsl_vartext@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"fdivr\00"
@.str.1 = [5 x i8] c"fdiv\00"
define void @special_fdivrl() {
%1 = call i32 @emit_1_or_2_operandsl_vartext(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"fdivr\00"
@.str.1 = [5 x i8] c"fdiv\00"
define void @special_fdivrl() {
%1 = tail call i32 @emit_1_or_2_operandsl_vartext(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ glob_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int glob(const char *pattern, int flags, int (*errfunc)(const char *, int),
         glob_t *pglob) {
  abort();
  return -1;
}


x86 assembly (clang, -O0):
<glob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<glob>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @glob(i8* %0, i32 %1, i32 (i8*, i32)* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32 (i8*, i32)*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 (i8*, i32)* %2, i32 (i8*, i32)** %7
store i32* %3, i32** %8
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @glob(i8* nocapture readnone %0, i32 %1, i32 (i8*, i32)* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void print_usage() {
  fputs("Usage: best-match TABLE QUERIES [OPTION]*"
        "\n",
        stderr);
  fputs("    TABLE is a file used for lookup."
        "\n",
        stderr);
  fputs("    QUERIES is a file, each line prompts an output of the closest "
        "match from TABLE."
        "\n",
        stderr);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
lea    0xef2(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    0xf03(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xefc(%rip),%rdi
call   1030 <fputs@plt>
mov    (%rbx),%esi
lea    0xf14(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: best-match TABLE QUERIES [OPTION]*\0A\00"
@stderr = global i32 0
@.str.1 = [38 x i8] c" TABLE is a file used for lookup.\0A\00"
@.str.2 = [85 x i8] c" QUERIES is a file, each line prompts an output of the closest match from TABLE.\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stderr
%4 = call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Usage: best-match TABLE QUERIES [OPTION]*\0A\00"
@stderr = global i32 0
@.str.1 = [38 x i8] c" TABLE is a file used for lookup.\0A\00"
@.str.2 = [85 x i8] c" QUERIES is a file, each line prompts an output of the closest match from TABLE.\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPSVelocityHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void GPSVelocityRequestUpdate() { UAVObjRequestUpdate(GPSVelocityHandle()); }


x86 assembly (clang, -O0):
<GPSVelocityRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GPSVelocityHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @GPSVelocityRequestUpdate() {
%1 = call i32 (...) @GPSVelocityHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @GPSVelocityRequestUpdate() {
%1 = tail call i32 (...) @GPSVelocityHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
float sub9(float f, float g, float h) { return h ? f : g; }


x86 assembly (clang, -O0):
<sub9>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112f <sub9+0x2f>
jp     112f <sub9+0x2f>
jmp    113e <sub9+0x3e>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1148 <sub9+0x48>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub9>:
xorps  %xmm3,%xmm3
cmpneqss %xmm2,%xmm3
andps  %xmm3,%xmm0
andnps %xmm1,%xmm3
orps   %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @sub9(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %6
%8 = fcmp une float %7, 0.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = load float, float* %4
br label %13
11: ; preds = %3
%12 = load float, float* %5
br label %13
13: ; preds = %11, %9
%14 = phi float [ %10, %9 ], [ %12, %11 ]
ret float %14
}

LLVM IR (-O2):
define float @sub9(float %0, float %1, float %2) {
%4 = fcmp une float %2, 0.000000e+00
%5 = select i1 %4, float %0, float %1
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int /*<<< orphan*/ putchar(char);
void print_int_array(const int *array, size_t len) {
  size_t i;
  for (i = 0; i < len; i++)
    printf("%d | ", array[i]);
  putchar('\n');
}


x86 assembly (clang, -O0):
<print_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    116e <print_int_array+0x4e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <print_int_array+0x18>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_int_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1155 <print_int_array+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xec4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_int_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%d | \00"
define void @print_int_array(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d | \00"
define void @print_int_array(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = add nuw i64 %5, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = tail call i32 @putchar(i8 signext 10)
ret void
}
/* Variables and functions */
int lmc_um_mark(void *, char *, size_t, size_t);
int lmc_um_mark_allocated(void *base, char *bf, size_t va) {
  size_t real_va = va - sizeof(size_t);
  size_t s = *(size_t *)(base + real_va);
  int r = lmc_um_mark(base, bf, real_va, s);
  return r;
}


x86 assembly (clang, -O0):
<lmc_um_mark_allocated>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rax,%rcx,1),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <lmc_um_mark@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lmc_um_mark_allocated>:
mov    -0x8(%rdi,%rdx,1),%rcx
add    $0xfffffffffffffff8,%rdx
jmp    1030 <lmc_um_mark@plt>

LLVM IR (-O0):
define i32 @lmc_um_mark_allocated(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%10 = load i64, i64* %6
%11 = sub i64 %10, 8
store i64 %11, i64* %7
%12 = load i8*, i8** %4
%13 = load i64, i64* %7
%14 = getelementptr i8, i8* %12, i64 %13
%15 = bitcast i8* %14 to i64*
%16 = load i64, i64* %15
store i64 %16, i64* %8
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = load i64, i64* %7
%20 = load i64, i64* %8
%21 = call i32 @lmc_um_mark(i8* %17, i8* %18, i64 %19, i64 %20)
store i32 %21, i32* %9
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @lmc_um_mark_allocated(i8* %0, i8* %1, i64 %2) {
%4 = add i64 %2, -8
%5 = getelementptr i8, i8* %0, i64 %4
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
%8 = tail call i32 @lmc_um_mark(i8* %0, i8* %1, i64 %4, i64 %7)
ret i32 %8
}
/* Type definitions */
typedef int __u8;
typedef int __u32;

/* Variables and functions */
__u32 num2ip(const __u8 a1, const __u8 a2, const __u8 a3, const __u8 a4) {
  __u32 r = a1;
  r <<= 8;
  r |= a2;
  r <<= 8;
  r |= a3;
  r <<= 8;
  r |= a4;
  return r;
}


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

x86 assembly (clang, -O2):
<num2ip>:
mov    %esi,%eax
shl    $0x10,%edi
shl    $0x8,%eax
or     %edi,%eax
or     %edx,%eax
shl    $0x8,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @num2ip(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
store i32 %10, i32* %9
%11 = load i32, i32* %9
%12 = shl i32 %11, 8
store i32 %12, i32* %9
%13 = load i32, i32* %6
%14 = load i32, i32* %9
%15 = or i32 %14, %13
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = shl i32 %16, 8
store i32 %17, i32* %9
%18 = load i32, i32* %7
%19 = load i32, i32* %9
%20 = or i32 %19, %18
store i32 %20, i32* %9
%21 = load i32, i32* %9
%22 = shl i32 %21, 8
store i32 %22, i32* %9
%23 = load i32, i32* %8
%24 = load i32, i32* %9
%25 = or i32 %24, %23
store i32 %25, i32* %9
%26 = load i32, i32* %9
ret i32 %26
}

LLVM IR (-O2):
define i32 @num2ip(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %0, 16
%6 = shl i32 %1, 8
%7 = or i32 %6, %5
%8 = or i32 %7, %2
%9 = shl i32 %8, 8
%10 = or i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int munmap(void *, int);
int msvd_unmap_extmem(void *extmem) {
  return munmap(extmem, (8 * 1024 * 1024));
}


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

x86 assembly (clang, -O2):
<msvd_unmap_extmem>:
mov    $0x800000,%esi
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @msvd_unmap_extmem(i8* %0) {
%2 = tail call i32 @munmap(i8* %0, i32 8388608)
ret i32 %2
}
/* Variables and functions */
double omp_get_wtime();
double get_time(void) { return omp_get_wtime(); }


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

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

LLVM IR (-O0):
define double @get_time() {
%1 = call double (...) @omp_get_wtime()
ret double %1
}

LLVM IR (-O2):
define double @get_time() {
%1 = tail call double (...) @omp_get_wtime()
ret double %1
}
/* Variables and functions */
void const *fdt_getprop_namelen(void const *, int, char const *,
                                int /*<<< orphan*/, int *);
int /*<<< orphan*/ strlen(char const *);
const void *fdt_getprop(const void *fdt, int nodeoffset, const char *name,
                        int *lenp) {
  return fdt_getprop_namelen(fdt, nodeoffset, name, strlen(name), lenp);
}


x86 assembly (clang, -O0):
<fdt_getprop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
mov    -0x20(%rbp),%r8
call   1040 <fdt_getprop_namelen@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdt_getprop>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%rbp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
mov    %r14,%r8
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fdt_getprop_namelen@plt>

LLVM IR (-O0):
define i8* @fdt_getprop(i8* %0, i32 %1, i8* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %7
%13 = call i32 @strlen(i8* %12)
%14 = load i32*, i32** %8
%15 = call i8* @fdt_getprop_namelen(i8* %9, i32 %10, i8* %11, i32 %13, i32* %14)
ret i8* %15
}

LLVM IR (-O2):
define i8* @fdt_getprop(i8* %0, i32 %1, i8* %2, i32* %3) {
%5 = tail call i32 @strlen(i8* %2)
%6 = tail call i8* @fdt_getprop_namelen(i8* %0, i32 %1, i8* %2, i32 %5, i32* %3)
ret i8* %6
}
/* Type definitions */
struct bpsem_t {
  int dummy;
};

/* Variables and functions */
struct bpsem_t *bpInit(char *);
int /*<<< orphan*/ fatal(char *);
int /*<<< orphan*/ perror(char *);
struct bpsem_t *semBuild(char *path) {
  struct bpsem_t *sem;
  sem = bpInit(path);
  if (sem == NULL) {
    perror("bpInit");
    fatal("Error creating semaphore");
  }
  return sem;
}


x86 assembly (clang, -O0):
<semBuild>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <bpInit@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116c <semBuild+0x3c>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
lea    0xea0(%rip),%rdi
call   1050 <fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semBuild>:
push   %rbx
call   1030 <bpInit@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1143 <semBuild+0x13>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xeb6(%rip),%rdi
call   1040 <perror@plt>
lea    0xeb1(%rip),%rdi
call   1050 <fatal@plt>
jmp    113e <semBuild+0xe>

LLVM IR (-O0):
%struct.bpsem_t = type { i32 }
@.str = [7 x i8] c"bpInit\00"
@.str.1 = [25 x i8] c"Error creating semaphore\00"
define %struct.bpsem_t* @semBuild(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.bpsem_t*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.bpsem_t* @bpInit(i8* %4)
store %struct.bpsem_t* %5, %struct.bpsem_t** %3
%6 = load %struct.bpsem_t*, %struct.bpsem_t** %3
%7 = icmp eq %struct.bpsem_t* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
%12 = load %struct.bpsem_t*, %struct.bpsem_t** %3
ret %struct.bpsem_t* %12
}

LLVM IR (-O2):
%struct.bpsem_t = type { i32 }
@.str = [7 x i8] c"bpInit\00"
@.str.1 = [25 x i8] c"Error creating semaphore\00"
define %struct.bpsem_t* @semBuild(i8* %0) {
%2 = tail call %struct.bpsem_t* @bpInit(i8* %0)
%3 = icmp eq %struct.bpsem_t* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret %struct.bpsem_t* %2
}
int find_degree(double *v, int dim, double xi) {
  int i;
  i = 0;
  while (xi > v[i])
    i++;
  return i;
}


x86 assembly (clang, -O0):
<find_degree>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jbe    113d <find_degree+0x3d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <find_degree+0x17>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_degree>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
ucomisd (%rdi),%xmm0
lea    0x8(%rdi),%rdi
ja     1110 <find_degree+0x10>
ret

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

LLVM IR (-O2):
define i32 @find_degree(double* nocapture %0, i32 %1, double %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i64 [ %9, %4 ], [ 0, %3 ]
%6 = getelementptr inbounds double, double* %0, i64 %5
%7 = load double, double* %6
%8 = fcmp olt double %7, %2
%9 = add nuw i64 %5, 1
br i1 %8, label %4, label %10
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ uart_puts(char *);
void OS_CPU_FIQ_ISR_Handler(void) {
  uart_puts("\nFIQ");
  while (1)
    ;
  return;
}


x86 assembly (clang, -O0):
<OS_CPU_FIQ_ISR_Handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <uart_puts@plt>
jmp    1120 <OS_CPU_FIQ_ISR_Handler+0x10>

x86 assembly (clang, -O2):
<OS_CPU_FIQ_ISR_Handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <uart_puts@plt>
nopl   (%rax)
jmp    1120 <OS_CPU_FIQ_ISR_Handler+0x10>

LLVM IR (-O0):
@.str = [5 x i8] c"\0AFIQ\00"
define void @OS_CPU_FIQ_ISR_Handler() {
%1 = call i32 @uart_puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [5 x i8] c"\0AFIQ\00"
define void @OS_CPU_FIQ_ISR_Handler() {
%1 = tail call i32 @uart_puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Type definitions */
struct mpd_buffer {
  int dummy;
};

/* Variables and functions */
scalar_t__ mpd_buffer_room(struct mpd_buffer const *);
bool mpd_buffer_full(const struct mpd_buffer *buffer) {
  return mpd_buffer_room(buffer) == 0;
}


x86 assembly (clang, -O0):
<mpd_buffer_full>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <mpd_buffer_room@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpd_buffer_full>:
push   %rax
call   1030 <mpd_buffer_room@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mpd_buffer = type { i32 }
define i32 @mpd_buffer_full(%struct.mpd_buffer* %0) {
%2 = alloca %struct.mpd_buffer*
store %struct.mpd_buffer* %0, %struct.mpd_buffer** %2
%3 = load %struct.mpd_buffer*, %struct.mpd_buffer** %2
%4 = call i64 @mpd_buffer_room(%struct.mpd_buffer* %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.mpd_buffer = type { i32 }
define i32 @mpd_buffer_full(%struct.mpd_buffer* %0) {
%2 = tail call i64 @mpd_buffer_room(%struct.mpd_buffer* %0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ stderr;
void fatal_error_free(char *error) {
  fputs(error, stderr);
  fputc('\n', stderr);
  free(error);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal_error_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1050 <fputc@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    0x2e57(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e92(%rip),%r14
mov    (%r14),%esi
call   1040 <fputs@plt>
mov    (%r14),%esi
mov    $0xa,%edi
call   1050 <fputc@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal_error_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputc(i8 signext 10, i32 %6)
%8 = load i8*, i8** %2
%9 = call i32 @free(i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@EXIT_FAILURE = global i32 0
define void @fatal_error_free(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
%6 = tail call i32 @free(i8* %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
main() { system("whoami"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"whoami\00"
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"whoami\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *realloc(void *, size_t);
void *mem_realloc(void *p, size_t size) { return realloc(p, size); }


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

x86 assembly (clang, -O2):
<mem_realloc>:
jmp    1030 <realloc@plt>

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

LLVM IR (-O2):
define noalias i8* @mem_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void stralloc(char **dest, char *src) {
  *dest = malloc(strlen(src) + 1);
  strcpy(*dest, src);
}


x86 assembly (clang, -O0):
<stralloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @stralloc(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
%9 = load i8**, i8*** %3
store i8* %8, i8** %9
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = load i8*, i8** %4
%13 = call i32 @strcpy(i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
define void @stralloc(i8** nocapture writeonly %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @malloc(i64 %4)
store i8* %5, i8** %0
%6 = tail call i32 @strcpy(i8* %5, i8* %1)
ret void
}
void foo04() {}


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

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

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

LLVM IR (-O2):
define void @foo04() {
ret void
}
void CreateCDistList(Schema, A) struct univStruct *Schema;
struct Teacher **A;
{
  AssignTeacherCDistListFirst(A, 0);
}


x86 assembly (clang, -O0):
<CreateCDistList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <AssignTeacherCDistListFirst@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CreateCDistList>:
mov    %rsi,%rdi
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <AssignTeacherCDistListFirst@plt>

LLVM IR (-O0):
%struct.univStruct = type opaque
%struct.Teacher = type opaque
define void @CreateCDistList(%struct.univStruct* %0, %struct.Teacher** %1) {
%3 = alloca %struct.univStruct*
%4 = alloca %struct.Teacher**
store %struct.univStruct* %0, %struct.univStruct** %3
store %struct.Teacher** %1, %struct.Teacher*** %4
%5 = load %struct.Teacher**, %struct.Teacher*** %4
%6 = call i32 (%struct.Teacher**, i32, ...) bitcast (i32 (...)* @AssignTeacherCDistListFirst to i32 (%struct.Teacher**, i32, ...)*)(%struct.Teacher** %5, i32 0)
ret void
}

LLVM IR (-O2):
%struct.univStruct = type opaque
%struct.Teacher = type opaque
define void @CreateCDistList(%struct.univStruct* nocapture readnone %0, %struct.Teacher** %1) {
%3 = tail call i32 (%struct.Teacher**, i32, ...) bitcast (i32 (...)* @AssignTeacherCDistListFirst to i32 (%struct.Teacher**, i32, ...)*)(%struct.Teacher** %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_hello(void) { printf("hello world\n"); }


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
define void @print_hello() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [12 x i8] c"hello world\00"
define void @print_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void *magic(void *p) { return p; }


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

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

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

LLVM IR (-O2):
define i8* @magic(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ f1(int);
int /*<<< orphan*/ f2(int);
int main(void) {
  f1(10);
  f2(12);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <f1@plt>
mov    $0xc,%edi
call   1030 <f2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 10)
%3 = call i32 @f2(i32 12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 10)
%2 = tail call i32 @f2(i32 12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_hex(int);
void main() {
  print_hex(0xDE);
  print_hex(0xAD);
  print_hex(0xBE);
  print_hex(0xEF);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xde,%edi
call   1030 <print_hex@plt>
mov    $0xad,%edi
call   1030 <print_hex@plt>
mov    $0xbe,%edi
call   1030 <print_hex@plt>
mov    $0xef,%edi
call   1030 <print_hex@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xde,%edi
call   1030 <print_hex@plt>
mov    $0xad,%edi
call   1030 <print_hex@plt>
mov    $0xbe,%edi
call   1030 <print_hex@plt>
mov    $0xef,%edi
pop    %rax
jmp    1030 <print_hex@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @print_hex(i32 222)
%2 = call i32 @print_hex(i32 173)
%3 = call i32 @print_hex(i32 190)
%4 = call i32 @print_hex(i32 239)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @print_hex(i32 222)
%2 = tail call i32 @print_hex(i32 173)
%3 = tail call i32 @print_hex(i32 190)
%4 = tail call i32 @print_hex(i32 239)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ computeCubeSum(int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
scalar_t__ scanf(char *, int *);
int main(void) {
  int N;
  while (scanf("%d", &N) > 0) {
    printf("%lld\n", computeCubeSum(N));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%rax
jle    1174 <main+0x44>
mov    -0x8(%rbp),%edi
call   1040 <computeCubeSum@plt>
mov    %eax,%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jle    1193 <main+0x63>
lea    0xead(%rip),%r14
lea    0xea3(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
call   1040 <computeCubeSum@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jg     1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = load i32, i32* %1
%7 = call i32 @computeCubeSum(i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void test_stdout() { fprintf(stdout, "hello world"); }


x86 assembly (clang, -O0):
<test_stdout>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_stdout>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [12 x i8] c"hello world\00"
define void @test_stdout() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [12 x i8] c"hello world\00"
define void @test_stdout() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
int my_mod(int nb1, int nb2) {
  int result;
  result = nb1 % nb2;
  return (result);
}


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

x86 assembly (clang, -O2):
<my_mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @my_mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned sancus_urll(long long v, long long a, long long b) {
  assert((v >= a) && (v <= b));
  return (unsigned)v;
}


x86 assembly (clang, -O0):
<sancus_urll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jl     1145 <sancus_urll+0x35>
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_urll>:
push   %rbx
mov    %rdi,%rbx
cmp    %rsi,%rdi
setge  %al
cmp    %rdx,%rdi
setle  %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sancus_urll(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = icmp sge i64 %7, %8
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load i64, i64* %4
%12 = load i64, i64* %6
%13 = icmp sle i64 %11, %12
br label %14
14: ; preds = %10, %3
%15 = phi i1 [ false, %3 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @sancus_urll(i64 %0, i64 %1, i64 %2) {
%4 = icmp sge i64 %0, %1
%5 = icmp sle i64 %0, %2
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = trunc i64 %0 to i32
ret i32 %9
}
/* Variables and functions */
short abs(short);
short internal_abs_s(short value) { return abs(value); }


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

x86 assembly (clang, -O2):
<internal_abs_s>:
mov    %edi,%eax
neg    %ax
cmovs  %di,%ax
ret

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

LLVM IR (-O2):
define signext i16 @internal_abs_s(i16 signext %0) {
%2 = tail call i16 @llvm.abs.i16(i16 %0, i1 true)
ret i16 %2
}
void destroy_heap(struct heap *p_heap) {
  if (!p_heap) {
    printf("malloc failed in function %s()!\n", __FUNCTION__);
    return;
  }
  free(p_heap);
}


x86 assembly (clang, -O0):
<destroy_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <destroy_heap+0x31>
lea    0xec2(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    115a <destroy_heap+0x3a>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_heap>:
test   %rdi,%rdi
je     112a <destroy_heap+0xa>
jmp    1030 <free@plt>
lea    0xecf(%rip),%rdi
lea    0xee9(%rip),%rsi
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.heap = type opaque
@.str = [33 x i8] c"malloc failed in function %s()!\0A\00"
@__FUNCTION__.destroy_heap = [13 x i8] c"destroy_heap\00"
define void @destroy_heap(%struct.heap* %0) {
%2 = alloca %struct.heap*
store %struct.heap* %0, %struct.heap** %2
%3 = load %struct.heap*, %struct.heap** %2
%4 = icmp ne %struct.heap* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.destroy_heap, i64 0, i64 0))
br label %10
7: ; preds = %1
%8 = load %struct.heap*, %struct.heap** %2
%9 = bitcast %struct.heap* %8 to i8*
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
%struct.heap = type opaque
@.str = [33 x i8] c"malloc failed in function %s()!\0A\00"
@__FUNCTION__.destroy_heap = [13 x i8] c"destroy_heap\00"
define void @destroy_heap(%struct.heap* %0) {
%2 = icmp eq %struct.heap* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.destroy_heap, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = bitcast %struct.heap* %0 to i8*
tail call void @free(i8* %6)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ expr();
int /*<<< orphan*/ get_lexval();
int yyselect();
array_complete_dcl() {
  switch (yyselect()) {
  case 68: {
    get_lexval();
    expr();
    get_lexval();
  } break;
  case 69: {
    get_lexval();
    expr();
    get_lexval();
    array_complete_dcl();
  } break;
  }
}


x86 assembly (clang, -O0):
<array_complete_dcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <yyselect@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
sub    $0x44,%eax
je     1173 <array_complete_dcl+0x33>
jmp    1162 <array_complete_dcl+0x22>
mov    -0x8(%rbp),%eax
sub    $0x45,%eax
je     118d <array_complete_dcl+0x4d>
jmp    11a7 <array_complete_dcl+0x67>
mov    $0x0,%al
call   1050 <get_lexval@plt>
mov    $0x0,%al
call   1060 <expr@plt>
mov    $0x0,%al
call   1050 <get_lexval@plt>
jmp    11a7 <array_complete_dcl+0x67>
mov    $0x0,%al
call   1050 <get_lexval@plt>
mov    $0x0,%al
call   1060 <expr@plt>
mov    $0x0,%al
call   1050 <get_lexval@plt>
call   1030 <array_complete_dcl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_complete_dcl>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <yyselect@plt>
cmp    $0x45,%eax
jne    1163 <array_complete_dcl+0x33>
xor    %eax,%eax
call   1040 <get_lexval@plt>
xor    %eax,%eax
call   1050 <expr@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
jmp    1140 <array_complete_dcl+0x10>
cmp    $0x44,%eax
jne    117d <array_complete_dcl+0x4d>
xor    %eax,%eax
call   1040 <get_lexval@plt>
xor    %eax,%eax
call   1050 <expr@plt>
xor    %eax,%eax
call   1040 <get_lexval@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @array_complete_dcl() {
%1 = alloca i32
%2 = call i32 (...) @yyselect()
switch i32 %2, label %12 [
i32 68, label %3
i32 69, label %7
]
3: ; preds = %0
%4 = call i32 (...) @get_lexval()
%5 = call i32 (...) @expr()
%6 = call i32 (...) @get_lexval()
br label %12
7: ; preds = %0
%8 = call i32 (...) @get_lexval()
%9 = call i32 (...) @expr()
%10 = call i32 (...) @get_lexval()
%11 = call i32 @array_complete_dcl()
br label %12
12: ; preds = %0, %7, %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @array_complete_dcl() {
br label %1
1: ; preds = %7, %0
%2 = tail call i32 (...) @yyselect()
switch i32 %2, label %11 [
i32 68, label %3
i32 69, label %7
]
3: ; preds = %1
%4 = tail call i32 (...) @get_lexval()
%5 = tail call i32 (...) @expr()
%6 = tail call i32 (...) @get_lexval()
br label %11
7: ; preds = %1
%8 = tail call i32 (...) @get_lexval()
%9 = tail call i32 (...) @expr()
%10 = tail call i32 (...) @get_lexval()
br label %1
11: ; preds = %1, %3
ret i32 undef
}
void ARGBToARGB4444Row_C() {}


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

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

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

LLVM IR (-O2):
define void @ARGBToARGB4444Row_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ModuleSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void ModuleSettingsRequestUpdate() {
  UAVObjRequestUpdate(ModuleSettingsHandle());
}


x86 assembly (clang, -O0):
<ModuleSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <ModuleSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ModuleSettingsRequestUpdate() {
%1 = call i32 (...) @ModuleSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @ModuleSettingsRequestUpdate() {
%1 = tail call i32 (...) @ModuleSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ deleteln();
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_return(int /*<<< orphan*/);
void cmd_deleteln(int nargs, char **args) {
  if (check_arg_count(nargs, 0) == 1)
    return;
  report_count(1);
  report_return(deleteln());
}


x86 assembly (clang, -O0):
<cmd_deleteln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1167 <cmd_deleteln+0x27>
jmp    117f <cmd_deleteln+0x3f>
mov    $0x1,%edi
call   1050 <report_count@plt>
mov    $0x0,%al
call   1060 <deleteln@plt>
mov    %eax,%edi
call   1030 <report_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_deleteln>:
push   %rax
xor    %esi,%esi
call   1040 <check_arg_count@plt>
cmp    $0x1,%eax
jne    114f <cmd_deleteln+0xf>
pop    %rax
ret
mov    $0x1,%edi
call   1050 <report_count@plt>
xor    %eax,%eax
call   1060 <deleteln@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <report_return@plt>

LLVM IR (-O0):
define void @cmd_deleteln(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 = call i32 @check_arg_count(i32 %5, i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %13
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 (...) @deleteln()
%12 = call i32 @report_return(i32 %11)
br label %13
13: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
define void @cmd_deleteln(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 0)
%4 = icmp eq i32 %3, 1
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 (...) @deleteln()
%8 = tail call i32 @report_return(i32 %7)
br label %9
9: ; preds = %2, %5
ret void
}
/* Variables and functions */
void PERQTFlush(void) {}


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

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

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

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