xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  static const int ans[] = {-1,
                            9,
                            9 + 9,
                            9 + 9 + 90,
                            9 + 9 + 90 + 90,
                            9 + 9 + 90 + 90 + 900,
                            9 + 9 + 90 + 90 + 900 + 900,
                            9 + 9 + 90 + 90 + 900 + 900 + 9000,
                            9 + 9 + 90 + 90 + 900 + 900 + 9000 + 9000,
                            9 + 9 + 90 + 90 + 900 + 900 + 9000 + 9000 + 90000,
                            9 + 9 + 90 + 90 + 900 + 900 + 9000 + 9000 + 90000 +
                                90000};
  int n;
  scanf("%d", &n);
  printf("%d\n", ans[n]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xef6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rcx
lea    0xeb6(%rip),%rax
mov    (%rax,%rcx,4),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf04(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
lea    0xec2(%rip),%rcx
mov    (%rcx,%rax,4),%esi
lea    0xee7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.ans = internal constant [11 x i32] [i32 -1, i32 9, i32 18, i32 108, i32 198, i32 1098, i32 1998, i32 10998, i32 19998, i32 109998, i32 199998]
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [11 x i32], [11 x i32]* @main.ans, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@main.ans = internal unnamed_addr constant [11 x i32] [i32 -1, i32 9, i32 18, i32 108, i32 198, i32 1098, i32 1998, i32 10998, i32 19998, i32 109998, i32 199998]
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [11 x i32], [11 x i32]* @main.ans, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
int pldummy_tk() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_tk() {
ret i32 0
}
void glDeleteSamplers(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDeleteSamplers() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_double_pair_instrs();
int /*<<< orphan*/ test_fcpsgn();
int /*<<< orphan*/ test_lfiwax();
int /*<<< orphan*/ test_parity_instrs();
int /*<<< orphan*/ test_reservation();
int main(void) {
  (void)test_reservation();
  test_fcpsgn();
  (void)test_double_pair_instrs();
  test_lfiwax();
  test_parity_instrs();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <test_reservation@plt>
mov    $0x0,%al
call   1070 <test_fcpsgn@plt>
mov    $0x0,%al
call   1060 <test_double_pair_instrs@plt>
mov    $0x0,%al
call   1050 <test_lfiwax@plt>
mov    $0x0,%al
call   1030 <test_parity_instrs@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_reservation@plt>
xor    %eax,%eax
call   1070 <test_fcpsgn@plt>
xor    %eax,%eax
call   1060 <test_double_pair_instrs@plt>
xor    %eax,%eax
call   1050 <test_lfiwax@plt>
xor    %eax,%eax
call   1030 <test_parity_instrs@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_reservation()
%3 = call i32 (...) @test_fcpsgn()
%4 = call i32 (...) @test_double_pair_instrs()
%5 = call i32 (...) @test_lfiwax()
%6 = call i32 (...) @test_parity_instrs()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_reservation()
%2 = tail call i32 (...) @test_fcpsgn()
%3 = tail call i32 (...) @test_double_pair_instrs()
%4 = tail call i32 (...) @test_lfiwax()
%5 = tail call i32 (...) @test_parity_instrs()
ret i32 0
}
double epb2jd(epoch)
double epoch;
{ return (2415020.31352 + ((epoch - 1900.0) * 365.242198781)); }


x86 assembly (clang, -O0):
<epb2jd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xede(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<epb2jd>:
addsd  0xef8(%rip),%xmm0
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @epb2jd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 1.900000e+03
%5 = call double @llvm.fmuladd.f64(double %4, double 0x4076D3E00BD4386B, double 0x41426CD628216C61)
ret double %5
}

LLVM IR (-O2):
define double @epb2jd(double %0) {
%2 = fadd double %0, -1.900000e+03
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x4076D3E00BD4386B, double 0x41426CD628216C61)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ ezilaitiniDistributionMultipliers();
int /*<<< orphan*/ ezilaitiniMemory();
int /*<<< orphan*/ ezilaitiniObjectiveRotationMatrix();
void ezilaitini(void) {
  ezilaitiniMemory();
  ezilaitiniDistributionMultipliers();
  ezilaitiniObjectiveRotationMatrix();
}


x86 assembly (clang, -O0):
<ezilaitini>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ezilaitiniMemory@plt>
mov    $0x0,%al
call   1040 <ezilaitiniDistributionMultipliers@plt>
mov    $0x0,%al
call   1050 <ezilaitiniObjectiveRotationMatrix@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ezilaitini>:
push   %rax
xor    %eax,%eax
call   1030 <ezilaitiniMemory@plt>
xor    %eax,%eax
call   1040 <ezilaitiniDistributionMultipliers@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ezilaitiniObjectiveRotationMatrix@plt>

LLVM IR (-O0):
define void @ezilaitini() {
%1 = call i32 (...) @ezilaitiniMemory()
%2 = call i32 (...) @ezilaitiniDistributionMultipliers()
%3 = call i32 (...) @ezilaitiniObjectiveRotationMatrix()
ret void
}

LLVM IR (-O2):
define void @ezilaitini() {
%1 = tail call i32 (...) @ezilaitiniMemory()
%2 = tail call i32 (...) @ezilaitiniDistributionMultipliers()
%3 = tail call i32 (...) @ezilaitiniObjectiveRotationMatrix()
ret void
}
void network_phase(unit) int unit;
{ start_networks(); }


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

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

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

LLVM IR (-O2):
define void @network_phase(i32 %0) {
%2 = tail call i32 (...) @start_networks()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int /*<<< orphan*/ LittleEndianWriteU32(int /*<<< orphan*/,
                                        int /*<<< orphan*/ *);
void LittleEndianWriteS32(int32_t value, uint8_t *bytes) {
  LittleEndianWriteU32((uint32_t)value, bytes);
}


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

x86 assembly (clang, -O2):
<LittleEndianWriteS32>:
jmp    1030 <LittleEndianWriteU32@plt>

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

LLVM IR (-O2):
define void @LittleEndianWriteS32(i64 %0, i32* %1) {
%3 = trunc i64 %0 to i32
%4 = tail call i32 @LittleEndianWriteU32(i32 %3, i32* %1)
ret void
}
int aeron_driver_receiver_do_work(void *clientd) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @aeron_driver_receiver_do_work(i8* nocapture readnone %0) {
ret i32 0
}
void task_id_to_ec_range(long id, long *base, long *len) {
  *base = id;
  *len = (0x1000);
  return;
}


x86 assembly (clang, -O0):
<task_id_to_ec_range>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x1000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_id_to_ec_range>:
mov    %rdi,(%rsi)
movq   $0x1000,(%rdx)
ret

LLVM IR (-O0):
define void @task_id_to_ec_range(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
store i64 %7, i64* %8
%9 = load i64*, i64** %6
store i64 4096, i64* %9
ret void
}

LLVM IR (-O2):
define void @task_id_to_ec_range(i64 %0, i64* nocapture writeonly %1, i64* nocapture writeonly %2) {
store i64 %0, i64* %1
store i64 4096, i64* %2
ret void
}
int efx_init_debugfs(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @efx_init_debugfs() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ serial_close(int /*<<< orphan*/);
void PIC16F877A_stop(void) {
  serial_close(0);
  ;
}


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

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

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

LLVM IR (-O2):
define void @PIC16F877A_stop() {
%1 = tail call i32 @serial_close(i32 0)
ret void
}
/* Variables and functions */
float random(int);
float random_determinate_with_percent(float randompercent) {
  randompercent *= 1000;
  if (randompercent > random(100000))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<random_determinate_with_percent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    $0x186a0,%edi
call   1030 <random@plt>
movaps %xmm0,%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1166 <random_determinate_with_percent+0x56>
movss  0xea8(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    116e <random_determinate_with_percent+0x5e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_determinate_with_percent>:
push   %rax
mulss  0xee7(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
mov    $0x186a0,%edi
call   1030 <random@plt>
cmpltss 0x4(%rsp),%xmm0
movss  0xecc(%rip),%xmm1
andps  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_determinate_with_percent(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fmul float %4, 1.000000e+03
store float %5, float* %3
%6 = load float, float* %3
%7 = call float @random(i32 100000)
%8 = fcmp ogt float %6, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store float 1.000000e+00, float* %2
br label %11
10: ; preds = %1
store float 0.000000e+00, float* %2
br label %11
11: ; preds = %10, %9
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @random_determinate_with_percent(float %0) {
%2 = fmul float %0, 1.000000e+03
%3 = tail call float @random(i32 100000)
%4 = fcmp ogt float %2, %3
%5 = select i1 %4, float 1.000000e+00, float 0.000000e+00
ret float %5
}
int rgb_convert(int color, int rmask, int gmask, int bmask) {
  return (((((color) >> 0) & 31) * rmask / 31) & rmask) |
         (((((color) >> 5) & 31) * gmask / 31) & gmask) |
         (((((color) >> 10) & 31) * bmask / 31) & bmask);
}


x86 assembly (clang, -O0):
<rgb_convert>:
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
sar    $0x0,%eax
and    $0x1f,%eax
imul   -0x8(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
and    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x5,%eax
and    $0x1f,%eax
imul   -0xc(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xa,%eax
and    $0x1f,%eax
imul   -0x10(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_convert>:
mov    %edi,%eax
and    $0x1f,%eax
imul   %esi,%eax
movslq %eax,%r8
imul   $0xffffffff84210843,%r8,%rax
shr    $0x20,%rax
add    %eax,%r8d
mov    %r8d,%eax
shr    $0x1f,%eax
sar    $0x4,%r8d
add    %eax,%r8d
and    %esi,%r8d
mov    %edi,%eax
shr    $0x5,%eax
and    $0x1f,%eax
imul   %edx,%eax
movslq %eax,%rsi
imul   $0xffffffff84210843,%rsi,%rax
shr    $0x20,%rax
add    %eax,%esi
mov    %esi,%eax
shr    $0x1f,%eax
sar    $0x4,%esi
add    %eax,%esi
and    %edx,%esi
or     %r8d,%esi
shr    $0xa,%edi
and    $0x1f,%edi
imul   %ecx,%edi
movslq %edi,%rax
imul   $0xffffffff84210843,%rax,%rdx
shr    $0x20,%rdx
add    %edx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x4,%eax
add    %edx,%eax
and    %ecx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @rgb_convert(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = ashr i32 %9, 0
%11 = and i32 %10, 31
%12 = load i32, i32* %6
%13 = mul nsw i32 %11, %12
%14 = sdiv i32 %13, 31
%15 = load i32, i32* %6
%16 = and i32 %14, %15
%17 = load i32, i32* %5
%18 = ashr i32 %17, 5
%19 = and i32 %18, 31
%20 = load i32, i32* %7
%21 = mul nsw i32 %19, %20
%22 = sdiv i32 %21, 31
%23 = load i32, i32* %7
%24 = and i32 %22, %23
%25 = or i32 %16, %24
%26 = load i32, i32* %5
%27 = ashr i32 %26, 10
%28 = and i32 %27, 31
%29 = load i32, i32* %8
%30 = mul nsw i32 %28, %29
%31 = sdiv i32 %30, 31
%32 = load i32, i32* %8
%33 = and i32 %31, %32
%34 = or i32 %25, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @rgb_convert(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %0, 31
%6 = mul nsw i32 %5, %1
%7 = sdiv i32 %6, 31
%8 = and i32 %7, %1
%9 = lshr i32 %0, 5
%10 = and i32 %9, 31
%11 = mul nsw i32 %10, %2
%12 = sdiv i32 %11, 31
%13 = and i32 %12, %2
%14 = or i32 %13, %8
%15 = lshr i32 %0, 10
%16 = and i32 %15, 31
%17 = mul nsw i32 %16, %3
%18 = sdiv i32 %17, 31
%19 = and i32 %18, %3
%20 = or i32 %14, %19
ret i32 %20
}
/* Variables and functions */
scalar_t__ malloc(int);
int *NewIntArray(int N) {
  int *vec;
  if (N <= 0)
    return (NULL);
  vec = NULL;
  vec = (int *)malloc(N * sizeof(int));
  return (vec);
}


x86 assembly (clang, -O0):
<NewIntArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1132 <NewIntArray+0x22>
movq   $0x0,-0x8(%rbp)
jmp    1155 <NewIntArray+0x45>
movq   $0x0,-0x18(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewIntArray>:
test   %edi,%edi
jle    1122 <NewIntArray+0x12>
push   %rax
shl    $0x2,%edi
call   1030 <malloc@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32* @NewIntArray(i32 %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32* null, i32** %2
br label %16
8: ; preds = %1
store i32* null, i32** %4
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %4
%15 = load i32*, i32** %4
store i32* %15, i32** %2
br label %16
16: ; preds = %8, %7
%17 = load i32*, i32** %2
ret i32* %17
}

LLVM IR (-O2):
define i32* @NewIntArray(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = shl i32 %0, 2
%5 = tail call i64 @malloc(i32 %4)
%6 = inttoptr i64 %5 to i32*
br label %7
7: ; preds = %1, %3
%8 = phi i32* [ %6, %3 ], [ null, %1 ]
ret i32* %8
}
int *f7c2(int *x) {
  int *p = 0;
  if (((void *)0) == x)
    p = qux();
  if (((void *)0) == x)
    return x;
  *p = 1;
  return x;
}


x86 assembly (clang, -O0):
<f7c2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    113d <f7c2+0x2d>
mov    $0x0,%al
call   1030 <qux@plt>
cltq
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1156 <f7c2+0x46>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <f7c2+0x58>
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32* @f7c2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* null, i32** %4
%5 = load i32*, i32** %3
%6 = icmp eq i32* null, %5
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 (...) @qux()
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i32*
store i32* %10, i32** %4
br label %11
11: ; preds = %7, %1
%12 = load i32*, i32** %3
%13 = icmp eq i32* null, %12
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = load i32*, i32** %3
store i32* %15, i32** %2
br label %19
16: ; preds = %11
%17 = load i32*, i32** %4
store i32 1, i32* %17
%18 = load i32*, i32** %3
store i32* %18, i32** %2
br label %19
19: ; preds = %16, %14
%20 = load i32*, i32** %2
ret i32* %20
}

LLVM IR (-O2):
define i32* @f7c2(i32* readnone returned %0) {
%2 = icmp eq i32* %0, null
tail call void @llvm.assume(i1 %2)
%3 = tail call i32 (...) @qux()
ret i32* null
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void header() {
  fprintf(stdout, "\n\n*************************  BMPHIDE  "
                  "*************************\n*********************************"
                  "****************************\n\n********************* "
                  "Initialising  *************************\n");
}


x86 assembly (clang, -O0):
<header>:
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):
<header>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [190 x i8] c"\0A\0A************************* BMPHIDE *************************\0A*************************************************************\0A\0A********************* Initialising *************************\0A\00"
define void @header() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct network {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ irc_send_raw(struct network *, char *, char const *);
void irc_join(struct network *net, const char *chan) {
  irc_send_raw(net, "JOIN %s", chan);
}


x86 assembly (clang, -O0):
<irc_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <irc_send_raw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_join>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <irc_send_raw@plt>

LLVM IR (-O0):
%struct.network = type { i32 }
@.str = [8 x i8] c"JOIN %s\00"
define void @irc_join(%struct.network* %0, i8* %1) {
%3 = alloca %struct.network*
%4 = alloca i8*
store %struct.network* %0, %struct.network** %3
store i8* %1, i8** %4
%5 = load %struct.network*, %struct.network** %3
%6 = load i8*, i8** %4
%7 = call i32 @irc_send_raw(%struct.network* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
%struct.network = type { i32 }
@.str = [8 x i8] c"JOIN %s\00"
define void @irc_join(%struct.network* %0, i8* %1) {
%3 = tail call i32 @irc_send_raw(%struct.network* %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
size_t sendMessage(int, char *);
size_t sendConfirmMsg(int sock) { return sendMessage(sock, "confirm"); }


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

x86 assembly (clang, -O2):
<sendConfirmMsg>:
lea    0xee9(%rip),%rsi
jmp    1030 <sendMessage@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"confirm\00"
define i64 @sendConfirmMsg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @sendMessage(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i64 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"confirm\00"
define i64 @sendConfirmMsg(i32 %0) {
%2 = tail call i64 @sendMessage(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i64 %2
}
void phy_led_triggers_unregister(struct phy_device *phy) {}


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

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

LLVM IR (-O0):
%struct.phy_device = type opaque
define void @phy_led_triggers_unregister(%struct.phy_device* %0) {
%2 = alloca %struct.phy_device*
store %struct.phy_device* %0, %struct.phy_device** %2
ret void
}

LLVM IR (-O2):
%struct.phy_device = type opaque
define void @phy_led_triggers_unregister(%struct.phy_device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putbyte(unsigned char);
void fourbyte(unsigned long co) {
  putbyte((unsigned char)((co >> 24) & 0xff));
  putbyte((unsigned char)((co >> 16) & 0xff));
  putbyte((unsigned char)((co >> 8) & 0xff));
  putbyte((unsigned char)(co & 0xff));
}


x86 assembly (clang, -O0):
<fourbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <putbyte@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <putbyte@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <putbyte@plt>
mov    -0x8(%rbp),%rax
and    $0xff,%rax
movzbl %al,%edi
call   1030 <putbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourbyte>:
push   %rbx
mov    %rdi,%rbx
mov    %ebx,%eax
shr    $0x18,%eax
mov    %eax,%edi
call   1030 <putbyte@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
call   1030 <putbyte@plt>
movzbl %bh,%edi
call   1030 <putbyte@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <putbyte@plt>

LLVM IR (-O0):
define void @fourbyte(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 24
%5 = and i64 %4, 255
%6 = trunc i64 %5 to i8
%7 = call i32 @putbyte(i8 zeroext %6)
%8 = load i64, i64* %2
%9 = lshr i64 %8, 16
%10 = and i64 %9, 255
%11 = trunc i64 %10 to i8
%12 = call i32 @putbyte(i8 zeroext %11)
%13 = load i64, i64* %2
%14 = lshr i64 %13, 8
%15 = and i64 %14, 255
%16 = trunc i64 %15 to i8
%17 = call i32 @putbyte(i8 zeroext %16)
%18 = load i64, i64* %2
%19 = and i64 %18, 255
%20 = trunc i64 %19 to i8
%21 = call i32 @putbyte(i8 zeroext %20)
ret void
}

LLVM IR (-O2):
define void @fourbyte(i64 %0) {
%2 = lshr i64 %0, 24
%3 = trunc i64 %2 to i8
%4 = tail call i32 @putbyte(i8 zeroext %3)
%5 = lshr i64 %0, 16
%6 = trunc i64 %5 to i8
%7 = tail call i32 @putbyte(i8 zeroext %6)
%8 = lshr i64 %0, 8
%9 = trunc i64 %8 to i8
%10 = tail call i32 @putbyte(i8 zeroext %9)
%11 = trunc i64 %0 to i8
%12 = tail call i32 @putbyte(i8 zeroext %11)
ret void
}
/* Variables and functions */
int partition(int *, int, int);
int /*<<< orphan*/ quick_sort(int *, int, int);
int _quick_sort_(int *array, int head, int tail) {
  int partNum;
  if (head < tail) {
    partNum = partition(array, head, tail);
    quick_sort(array, head, partNum - 1);
    quick_sort(array, partNum + 1, tail);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_quick_sort_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <_quick_sort_+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_quick_sort_>:
cmp    %edx,%esi
jge    1161 <_quick_sort_+0x41>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%r14
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
call   1040 <quick_sort@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_quick_sort_(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
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %26
11: ; preds = %3
%12 = load i32*, i32** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @partition(i32* %12, i32 %13, i32 %14)
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = call i32 @quick_sort(i32* %16, i32 %17, i32 %19)
%21 = load i32*, i32** %4
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = load i32, i32* %6
%25 = call i32 @quick_sort(i32* %21, i32 %23, i32 %24)
br label %26
26: ; preds = %11, %3
ret i32 0
}

LLVM IR (-O2):
define i32 @_quick_sort_(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3
%6 = tail call i32 @partition(i32* %0, i32 %1, i32 %2)
%7 = add nsw i32 %6, -1
%8 = tail call i32 @quick_sort(i32* %0, i32 %1, i32 %7)
%9 = add nsw i32 %6, 1
%10 = tail call i32 @quick_sort(i32* %0, i32 %9, i32 %2)
br label %11
11: ; preds = %5, %3
ret i32 0
}
unsigned int peak_transfer_master(const char *x) {
  (void)x;
  return (1);
}


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

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

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

LLVM IR (-O2):
define i32 @peak_transfer_master(i8* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printaddr(long const);
void print_epoll_event_array(struct tcb *tcp, const long addr, const long len) {
  printaddr(addr);
}


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

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

LLVM IR (-O0):
%struct.tcb = type { i32 }
define void @print_epoll_event_array(%struct.tcb* %0, i64 %1, i64 %2) {
%4 = alloca %struct.tcb*
%5 = alloca i64
%6 = alloca i64
store %struct.tcb* %0, %struct.tcb** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = call i32 @printaddr(i64 %7)
ret void
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define void @print_epoll_event_array(%struct.tcb* nocapture readnone %0, i64 %1, i64 %2) {
%4 = tail call i32 @printaddr(i64 %1)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
double rand();
double zrandom() { return rand() / ((double)RAND_MAX + 1); }


x86 assembly (clang, -O0):
<zrandom>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec6(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xed1(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<zrandom>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @zrandom() {
%1 = call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %1, %4
ret double %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @zrandom() {
%1 = tail call double (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = sitofp i64 %2 to double
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double %1, %4
ret double %5
}
int fun411() { return 411; }


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

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

LLVM IR (-O0):
define i32 @fun411() {
ret i32 411
}

LLVM IR (-O2):
define i32 @fun411() {
ret i32 411
}
/* Variables and functions */
int /*<<< orphan*/ example();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void key(unsigned char key, int x, int y) {
  if (key == 'q') {
    exit(0);
  } else {
    example();
  };
}


x86 assembly (clang, -O0):
<key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0x71,%eax
jne    1148 <key+0x28>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <example@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<key>:
cmp    $0x71,%dil
je     112d <key+0xd>
xor    %eax,%eax
jmp    1030 <example@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 113
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @exit(i32 0)
unreachable
12: ; preds = %3
%13 = call i32 (...) @example()
br label %14
14: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @key(i8 zeroext %0, i32 %1, i32 %2) {
%4 = icmp eq i8 %0, 113
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %3
%8 = tail call i32 (...) @example()
ret void
}
void handle_FPE(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_FPE(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void SortedListUnderflow() {
  printf(
      "\n\nERR: Sorted Doubly Linked List Underflow\nCannot Pop From List\n\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [66 x i8] c"\0A\0AERR: Sorted Doubly Linked List Underflow\0ACannot Pop From List\0A\0A\00"
define void @SortedListUnderflow() {
%1 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [65 x i8] c"\0A\0AERR: Sorted Doubly Linked List Underflow\0ACannot Pop From List\0A\00"
define void @SortedListUnderflow() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
ret void
}
void sdcard_init() {}


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

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

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

LLVM IR (-O2):
define void @sdcard_init() {
ret void
}
int args_no_stickless(void *user_data, const char *value) {
  (void)user_data;
  (void)value;
  return 0;
}


x86 assembly (clang, -O0):
<args_no_stickless>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @args_no_stickless(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
void bar(int i) { test(i); }


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

x86 assembly (clang, -O2):
<bar>:
jmp    1030 <test@plt>

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

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = tail call i32 @test(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rex_fatal_error(int, char const *, char const *);
void fatal_error(int id, const char *file, const char *msg) {
  rex_fatal_error(id, file, msg);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <rex_fatal_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal_error>:
jmp    1030 <rex_fatal_error@plt>

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

LLVM IR (-O2):
define void @fatal_error(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @rex_fatal_error(i32 %0, i8* %1, i8* %2)
ret void
}
/* Type definitions */
struct timeval {
  long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long long getMicroseconds() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (long long)tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<getMicroseconds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMicroseconds>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x10(%rsp),%rax
add    0x8(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @getMicroseconds() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = add nsw i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @getMicroseconds() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void conn_socket_close(int sockfd) { close(sockfd); }


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

x86 assembly (clang, -O2):
<conn_socket_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @conn_socket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ ENOSYS;
int /*<<< orphan*/ assert(int);
scalar_t__ errno;
int /*<<< orphan*/ printf(char *);
int syscall(int);
int main(void) {
  int rc = syscall(-1);
  assert(rc == -1);
  assert(errno == ENOSYS);
  printf("In example_prog2.c!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xffffffff,%edi
call   1050 <syscall@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%rax
mov    0x2e7a(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xffffffff,%edi
call   1050 <syscall@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1040 <assert@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%rax
mov    0x2e8e(%rip),%rcx
xor    %edi,%edi
cmp    (%rcx),%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe91(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@errno = global i64 0
@ENOSYS = global i64 0
@.str = [21 x i8] c"In example_prog2.c!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @syscall(i32 -1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i64, i64* @errno
%9 = load i64, i64* @ENOSYS
%10 = icmp eq i64 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@errno = global i64 0
@ENOSYS = global i64 0
@str = [20 x i8] c"In example_prog2.c!\00"
define i32 @main() {
%1 = tail call i32 @syscall(i32 -1)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i64, i64* @errno
%6 = load i64, i64* @ENOSYS
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
float tof(unsigned char a) {
  float b;
  b = a;
  b = b / 255;
  return b;
}


x86 assembly (clang, -O0):
<tof>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xedc(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<tof>:
cvtsi2ss %edi,%xmm0
divss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @tof(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca float
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = uitofp i8 %4 to float
store float %5, float* %3
%6 = load float, float* %3
%7 = fdiv float %6, 2.550000e+02
store float %7, float* %3
%8 = load float, float* %3
ret float %8
}

LLVM IR (-O2):
define float @tof(i8 zeroext %0) {
%2 = uitofp i8 %0 to float
%3 = fdiv float %2, 2.550000e+02
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void i_halt(void) {
  printf("HALT instruction!\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"HALT instruction!\0A\00"
define void @i_halt() {
%1 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [18 x i8] c"HALT instruction!\00"
define void @i_halt() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
int lm_data_size_sanlock(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @lm_data_size_sanlock() {
ret i32 -1
}
int triangleNumRec(int which) {
  if (which == 0)
    return 0;
  else
    return which + triangleNumRec(which - 1);
}


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

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

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

LLVM IR (-O2):
define i32 @triangleNumRec(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("C Rocks!");
  puts("in the vim!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"C Rocks!\00"
@.str.1 = [12 x i8] c"in the vim!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"C Rocks!\00"
@.str.1 = [12 x i8] c"in the vim!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}