xunge/DecIR huggingface dataset:
void vsub(const float *src1, const float *src2, float *dst) {
  dst[0] = src1[0] - src2[0];
  dst[1] = src1[1] - src2[1];
  dst[2] = src1[2] - src2[2];
}


x86 assembly (clang, -O0):
<vsub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsub>:
movss  (%rdi),%xmm0
subss  (%rsi),%xmm0
movss  %xmm0,(%rdx)
movss  0x4(%rdi),%xmm0
subss  0x4(%rsi),%xmm0
movss  %xmm0,0x4(%rdx)
movss  0x8(%rdi),%xmm0
subss  0x8(%rsi),%xmm0
movss  %xmm0,0x8(%rdx)
ret

LLVM IR (-O0):
define void @vsub(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** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %6
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %4
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %5
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %6
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %4
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %5
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %6
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vsub(float* nocapture %0, float* nocapture %1, float* nocapture writeonly %2) {
%4 = load float, float* %0
%5 = load float, float* %1
%6 = fsub float %4, %5
store float %6, float* %2
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %2, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %0, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %2, i64 2
store float %17, float* %18
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gfarm_timeval_normalize(struct timeval *);
void gfarm_timeval_add(struct timeval *t1, const struct timeval *t2) {
  t1->tv_sec += t2->tv_sec;
  t1->tv_usec += t2->tv_usec;
  gfarm_timeval_normalize(t1);
}


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

x86 assembly (clang, -O2):
<gfarm_timeval_add>:
movdqu (%rsi),%xmm0
movdqu (%rdi),%xmm1
paddq  %xmm0,%xmm1
movdqu %xmm1,(%rdi)
jmp    1030 <gfarm_timeval_normalize@plt>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define void @gfarm_timeval_add(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%7 = load i64, i64* %6
%8 = load %struct.timeval*, %struct.timeval** %3
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %8, i32 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %10, %7
store i64 %11, i64* %9
%12 = load %struct.timeval*, %struct.timeval** %4
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = load %struct.timeval*, %struct.timeval** %3
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 0
%17 = load i64, i64* %16
%18 = add nsw i64 %17, %14
store i64 %18, i64* %16
%19 = load %struct.timeval*, %struct.timeval** %3
%20 = call i32 @gfarm_timeval_normalize(%struct.timeval* %19)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define void @gfarm_timeval_add(%struct.timeval* %0, %struct.timeval* nocapture %1) {
%3 = bitcast %struct.timeval* %1 to <2 x i64>*
%4 = load <2 x i64>, <2 x i64>* %3
%5 = bitcast %struct.timeval* %0 to <2 x i64>*
%6 = load <2 x i64>, <2 x i64>* %5
%7 = add nsw <2 x i64> %6, %4
%8 = bitcast %struct.timeval* %0 to <2 x i64>*
store <2 x i64> %7, <2 x i64>* %8
%9 = tail call i32 @gfarm_timeval_normalize(%struct.timeval* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ parse_wkb(char const **);
void alloc_wkb(const char *parser) {
  ((void)0);
  parse_wkb(&parser);
}


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

x86 assembly (clang, -O2):
<alloc_wkb>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <parse_wkb@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @alloc_wkb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @parse_wkb(i8** %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup_screen();
int /*<<< orphan*/ draw_string(int /*<<< orphan*/, int /*<<< orphan*/, char *);
int /*<<< orphan*/ setup_screen();
int /*<<< orphan*/ show_screen();
int /*<<< orphan*/ sleep(int);
int main(void) {
  setup_screen();
  draw_string(0, 0, "Hello CAB202.");
  show_screen();
  sleep(10);
  cleanup_screen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <setup_screen@plt>
xor    %esi,%esi
lea    0xe91(%rip),%rdx
mov    %esi,%edi
call   1060 <draw_string@plt>
mov    $0x0,%al
call   1040 <show_screen@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
mov    $0x0,%al
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <setup_screen@plt>
lea    0xea1(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <draw_string@plt>
xor    %eax,%eax
call   1040 <show_screen@plt>
mov    $0xa,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
call   1030 <cleanup_screen@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello CAB202.\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @setup_screen()
%3 = call i32 @draw_string(i32 0, i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @show_screen()
%5 = call i32 @sleep(i32 10)
%6 = call i32 (...) @cleanup_screen()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello CAB202.\00"
define i32 @main() {
%1 = tail call i32 (...) @setup_screen()
%2 = tail call i32 @draw_string(i32 0, i32 0, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @show_screen()
%4 = tail call i32 @sleep(i32 10)
%5 = tail call i32 (...) @cleanup_screen()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(short *, short const *, int);
scalar_t__ space(int);
short *copy_pair_table(const short *pt) {
  short *table = (short *)space(sizeof(short) * (pt[0] + 2));
  memcpy(table, pt, sizeof(short) * (pt[0] + 2));
  return table;
}


x86 assembly (clang, -O0):
<copy_pair_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
add    $0x2,%eax
cltq
shl    $0x1,%rax
mov    %eax,%edi
call   1030 <space@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
add    $0x2,%eax
cltq
shl    $0x1,%rax
mov    %eax,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_pair_table>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movswl (%rdi),%eax
lea    (%rax,%rax,1),%edi
add    $0x4,%edi
call   1030 <space@plt>
mov    %rax,%r14
movswl (%rbx),%eax
lea    (%rax,%rax,1),%edx
add    $0x4,%edx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <memcpy@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i16* @copy_pair_table(i16* %0) {
%2 = alloca i16*
%3 = alloca i16*
store i16* %0, i16** %2
%4 = load i16*, i16** %2
%5 = getelementptr inbounds i16, i16* %4, i64 0
%6 = load i16, i16* %5
%7 = sext i16 %6 to i32
%8 = add nsw i32 %7, 2
%9 = sext i32 %8 to i64
%10 = mul i64 2, %9
%11 = trunc i64 %10 to i32
%12 = call i64 @space(i32 %11)
%13 = inttoptr i64 %12 to i16*
store i16* %13, i16** %3
%14 = load i16*, i16** %3
%15 = load i16*, i16** %2
%16 = load i16*, i16** %2
%17 = getelementptr inbounds i16, i16* %16, i64 0
%18 = load i16, i16* %17
%19 = sext i16 %18 to i32
%20 = add nsw i32 %19, 2
%21 = sext i32 %20 to i64
%22 = mul i64 2, %21
%23 = trunc i64 %22 to i32
%24 = call i32 @memcpy(i16* %14, i16* %15, i32 %23)
%25 = load i16*, i16** %3
ret i16* %25
}

LLVM IR (-O2):
define i16* @copy_pair_table(i16* %0) {
%2 = load i16, i16* %0
%3 = sext i16 %2 to i32
%4 = shl nsw i32 %3, 1
%5 = add nsw i32 %4, 4
%6 = tail call i64 @space(i32 %5)
%7 = inttoptr i64 %6 to i16*
%8 = load i16, i16* %0
%9 = sext i16 %8 to i32
%10 = shl nsw i32 %9, 1
%11 = add nsw i32 %10, 4
%12 = tail call i32 @memcpy(i16* %7, i16* %0, i32 %11)
ret i16* %7
}
/* Variables and functions */
int /*<<< orphan*/ mdfour(unsigned char *, unsigned char *, int);
unsigned Com_BlockChecksum(void *buffer, int length) {
  int digest[4];
  unsigned val;
  mdfour((unsigned char *)digest, (unsigned char *)buffer, length);
  val = digest[0] ^ digest[1] ^ digest[2] ^ digest[3];
  return val;
}


x86 assembly (clang, -O0):
<Com_BlockChecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <mdfour@plt>
mov    -0x20(%rbp),%eax
xor    -0x1c(%rbp),%eax
xor    -0x18(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_BlockChecksum>:
sub    $0x18,%rsp
mov    %esi,%edx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <mdfour@plt>
movdqa (%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
pxor   %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
pxor   %xmm1,%xmm0
movd   %xmm0,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @Com_BlockChecksum(i8* %0, i32 %1) {
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to i8*
%5 = call i32 @mdfour(i8* %4, i8* %0, i32 %1)
%6 = load <4 x i32>, <4 x i32>* %3
%7 = call i32 @llvm.vector.reduce.xor.v4i32(<4 x i32> %6)
ret i32 %7
}
long long int dummy_number_generator() { return -346565474575675; }


x86 assembly (clang, -O0):
<dummy_number_generator>:
push   %rbp
mov    %rsp,%rbp
movabs $0xfffec4ccefff1ac5,%rax
c4 fe ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_number_generator>:
movabs $0xfffec4ccefff1ac5,%rax
c4 fe ff
ret

LLVM IR (-O0):
define i64 @dummy_number_generator() {
ret i64 -346565474575675
}

LLVM IR (-O2):
define i64 @dummy_number_generator() {
ret i64 -346565474575675
}
void FPUDisable(void) {
  (*((volatile unsigned long *)(0xE000ED88))) =
      (((*((volatile unsigned long *)(0xE000ED88))) &
        ~(0x00300000 | 0x00C00000)) |
       0x00000000 | 0x00000000);
}


x86 assembly (clang, -O0):
<FPUDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ed88,%eax
mov    (%rax),%rcx
and    $0xffffffffff0fffff,%rcx
or     $0x0,%rcx
or     $0x0,%rcx
mov    $0xe000ed88,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FPUDisable>:
mov    $0xe000ed88,%eax
andq   $0xffffffffff0fffff,(%rax)
ret

LLVM IR (-O0):
define void @FPUDisable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157192 to i64*)
%2 = and i64 %1, -15728641
%3 = or i64 %2, 0
%4 = or i64 %3, 0
store volatile i64 %4, i64* inttoptr (i64 3758157192 to i64*)
ret void
}

LLVM IR (-O2):
define void @FPUDisable() {
%1 = load volatile i64, i64* inttoptr (i64 3758157192 to i64*)
%2 = and i64 %1, -15728641
store volatile i64 %2, i64* inttoptr (i64 3758157192 to i64*)
ret void
}
/* Variables and functions */
double exp(double);
double dBbp5a(double x) { return exp(-x) * (1.0 - x) - exp(-2.0 * x); }


x86 assembly (clang, -O0):
<dBbp5a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  0xebd(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movsd  -0x18(%rbp),%xmm2
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dBbp5a>:
sub    $0x28,%rsp
movaps %xmm0,%xmm1
movaps %xmm0,0x10(%rsp)
movaps 0xedd(%rip),%xmm0
xorps  %xmm1,%xmm0
call   1030 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xed7(%rip),%xmm1
movapd 0x10(%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mulsd  0xec8(%rip),%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm1
mulsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @dBbp5a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @exp(double %4)
%6 = load double, double* %2
%7 = fsub double 1.000000e+00, %6
%8 = load double, double* %2
%9 = fmul double -2.000000e+00, %8
%10 = call double @exp(double %9)
%11 = fneg double %10
%12 = call double @llvm.fmuladd.f64(double %5, double %7, double %11)
ret double %12
}

LLVM IR (-O2):
define double @dBbp5a(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
%4 = fsub double 1.000000e+00, %0
%5 = fmul double %0, -2.000000e+00
%6 = tail call double @exp(double %5)
%7 = fneg double %6
%8 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %7)
ret double %8
}
/* Type definitions */
struct XorrisO {
  int dummy;
};

/* Variables and functions */
int Xorriso_list_extras(struct XorrisO *, char *, int /*<<< orphan*/);
int Xorriso_option_list_extras(struct XorrisO *xorriso, char *mode, int flag) {
  int ret;
  ret = Xorriso_list_extras(xorriso, mode, 0);
  return (ret);
}


x86 assembly (clang, -O0):
<Xorriso_option_list_extras>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <Xorriso_list_extras@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_list_extras(%struct.XorrisO* %0, i8* %1, i32 %2) {
%4 = alloca %struct.XorrisO*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.XorrisO* %0, %struct.XorrisO** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load %struct.XorrisO*, %struct.XorrisO** %4
%9 = load i8*, i8** %5
%10 = call i32 @Xorriso_list_extras(%struct.XorrisO* %8, i8* %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %7
ret i32 %11
}

LLVM IR (-O2):
%struct.XorrisO = type { i32 }
define i32 @Xorriso_option_list_extras(%struct.XorrisO* %0, i8* %1, i32 %2) {
%4 = tail call i32 @Xorriso_list_extras(%struct.XorrisO* %0, i8* %1, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_hello() {
  fprintf(stdout, "Hello, world!\n");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<print_hello>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hello>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @print_hello() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [15 x i8] c"Hello, world!\0A\00"
define void @print_hello() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Variables and functions */
long long __lsign(long long, long long);
long long intr_wrap_470(long long p1, long long p2) { return __lsign(p1, p2); }


x86 assembly (clang, -O0):
<intr_wrap_470>:
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 <__lsign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_470>:
jmp    1030 <__lsign@plt>

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

LLVM IR (-O2):
define i64 @intr_wrap_470(i64 %0, i64 %1) {
%3 = tail call i64 @__lsign(i64 %0, i64 %1)
ret i64 %3
}
unsigned xrop3_95_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D & T;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_95_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_95_0_0>:
mov    %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_95_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%8 = load i8, i8* %4
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = and i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = xor i32 %17, -1
store i32 %18, i32* %7
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @xrop3_95_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int random();
int flip() {
  if (random() % 1000 < 500)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<flip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <random@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cmp    $0x1f4,%edx
jge    113f <flip+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <flip+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip>:
push   %rax
xor    %eax,%eax
call   1030 <random@plt>
movslq %eax,%rcx
imul   $0x10624dd3,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
imul   $0x3e8,%eax,%eax
sub    %eax,%ecx
xor    %eax,%eax
cmp    $0x1f4,%ecx
setge  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @flip() {
%1 = alloca i32
%2 = call i32 (...) @random()
%3 = srem i32 %2, 1000
%4 = icmp slt i32 %3, 500
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %7
6: ; preds = %0
store i32 1, i32* %1
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @flip() {
%1 = tail call i32 (...) @random()
%2 = srem i32 %1, 1000
%3 = icmp sgt i32 %2, 499
%4 = zext i1 %3 to i32
ret i32 %4
}
int lowest_of(int arg1, int arg2) {
  if (arg1 <= arg2)
    return arg1;
  else
    return arg2;
}


x86 assembly (clang, -O0):
<lowest_of>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <lowest_of+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <lowest_of+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowest_of>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @lowest_of(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void cam_library_delete(void *handle) {
  fprintf(stderr, "This library should not be used\n");
  abort();
}


x86 assembly (clang, -O0):
<cam_library_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<cam_library_delete>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"This library should not be used\0A\00"
define void @cam_library_delete(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"This library should not be used\0A\00"
define void @cam_library_delete(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @abort()
unreachable
}
int test_bang(int x) { return !x; }


x86 assembly (clang, -O0):
<test_bang>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bang>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @test_bang(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_bang(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ strcpy(char *, char const *);
size_t strlen(char const *);
char *mystrdup(const char *src) {
  size_t len = strlen(src);
  char *dst = malloc(len + 1);
  if (dst)
    strcpy(dst, src);
  return dst;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <mystrdup+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
void tegra30_init_speedo_data(struct tegra_sku_info *sku_info) {}


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

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

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

LLVM IR (-O2):
%struct.tegra_sku_info = type opaque
define void @tegra30_init_speedo_data(%struct.tegra_sku_info* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ EISDIR;
int /*<<< orphan*/ errno;
int readlink(char *, char *, int);
int /*<<< orphan*/ report_test(int, int /*<<< orphan*/, int /*<<< orphan*/,
                               char *);
void readlink_dir(void) {
  char buf[128];
  int rv;
  rv = readlink(".", buf, sizeof(buf));
  report_test(rv, errno, EISDIR, "readlink on .");
}


x86 assembly (clang, -O0):
<readlink_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x80,%edx
call   1040 <readlink@plt>
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
mov    0x2e8c(%rip),%rax
mov    (%rax),%edx
lea    0xe9b(%rip),%rcx
call   1030 <report_test@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readlink_dir>:
sub    $0x88,%rsp
lea    0xede(%rip),%rdi
mov    %rsp,%rsi
mov    $0x80,%edx
call   1040 <readlink@plt>
mov    0x2e96(%rip),%rcx
mov    (%rcx),%esi
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%edx
lea    0xeac(%rip),%rcx
mov    %eax,%edi
add    $0x88,%rsp
jmp    1030 <report_test@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@errno = global i32 0
@EISDIR = global i32 0
@.str.1 = [14 x i8] c"readlink on .\00"
define void @readlink_dir() {
%1 = alloca [128 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%4 = call i32 @readlink(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %3, i32 128)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* @errno
%7 = load i32, i32* @EISDIR
%8 = call i32 @report_test(i32 %5, i32 %6, i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@errno = global i32 0
@EISDIR = global i32 0
@.str.1 = [14 x i8] c"readlink on .\00"
define void @readlink_dir() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = call i32 @readlink(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* %2, i32 128)
%4 = load i32, i32* @errno
%5 = load i32, i32* @EISDIR
%6 = tail call i32 @report_test(i32 %3, i32 %4, i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
void HandleKey(int keycode, int bDown) {
  if (keycode == 27)
    exit(0);
  printf("Key: %d -> %d\n", keycode, bDown);
}


x86 assembly (clang, -O0):
<HandleKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1b,-0x4(%rbp)
jne    113f <HandleKey+0x1f>
xor    %edi,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HandleKey>:
cmp    $0x1b,%edi
je     1135 <HandleKey+0x15>
mov    %esi,%edx
mov    %edi,%esi
lea    0xed0(%rip),%rdi
jmp    1030 <printf@plt>
push   %rax
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Key: %d -> %d\0A\00"
define void @HandleKey(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 27
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Key: %d -> %d\0A\00"
define void @HandleKey(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 27
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 0)
unreachable
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ epr_free_string(char *);
void epr_free_and_null_string(char **str) {
  if (*str == NULL)
    return;
  epr_free_string(*str);
  *str = NULL;
}


x86 assembly (clang, -O0):
<epr_free_and_null_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    112f <epr_free_and_null_string+0x1f>
jmp    1146 <epr_free_and_null_string+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <epr_free_string@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epr_free_and_null_string>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <epr_free_and_null_string+0x18>
call   1030 <epr_free_string@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @epr_free_and_null_string(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i8**, i8*** %2
%9 = load i8*, i8** %8
%10 = call i32 @epr_free_string(i8* %9)
%11 = load i8**, i8*** %2
store i8* null, i8** %11
br label %12
12: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
define void @epr_free_and_null_string(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @epr_free_string(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %1, %4
ret void
}
/* Variables and functions */
int factorielle(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("\n%d\n", factorielle(5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
call   1040 <factorielle@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x5,%edi
call   1040 <factorielle@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = tail call i32 @factorielle(i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void SHAREMIND_MAP_KEY_FREE_signed_char(signed char *const dest) { (void)dest; }


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

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

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

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_signed_char(i8* nocapture %0) {
ret void
}
int test_imm_89uint8_mem(unsigned char *val) {
  return ((*val) & (0x89 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_89uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0x89,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_89uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -119
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int __PHYSFS_platformInit(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @__PHYSFS_platformInit() {
ret i32 1
}
/* Variables and functions */
void _exit(int code) {
  (void)code;
  while (true)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

x86 assembly (clang, -O2):
<_exit>:
jmp    1100 <_exit>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
br label %4
4: ; preds = %1, %4
br label %4
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gumbo_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<gumbo_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @gumbo_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int OK;
int /*<<< orphan*/ printf(char *);
int beep(void) {
  printf("\a");
  return OK;
}


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

x86 assembly (clang, -O2):
<beep>:
push   %rax
mov    $0x7,%edi
call   1030 <putchar@plt>
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\07\00"
@OK = global i32 0
define i32 @beep() {
%1 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @OK
ret i32 %2
}

LLVM IR (-O2):
@OK = global i32 0
define i32 @beep() {
%1 = tail call i32 @putchar(i32 7)
%2 = load i32, i32* @OK
ret i32 %2
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t len = 0;
  while (*(str + len) != '\0') {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test4() { printf("Test 4: Handle cycles.\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Test 4: Handle cycles.\0A\00"
define void @test4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Test 4: Handle cycles.\00"
define void @test4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
unsigned int send(unsigned int, char *, unsigned int, int /*<<< orphan*/);
unsigned int ffi_send(unsigned int sock, unsigned int n, char *buffer) {
  ssize_t ret;
  ret = send(sock, buffer, n, 0);
  if (ret < 0 || ret > n) {
    exit(-1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<ffi_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jb     115c <ffi_send+0x3c>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1166 <ffi_send+0x46>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffi_send>:
push   %rbx
mov    %esi,%ebx
mov    %rdx,%rsi
mov    %ebx,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    %ebx,%eax
ja     1135 <ffi_send+0x15>
pop    %rbx
ret
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @ffi_send(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %6
%10 = load i32, i32* %5
%11 = call i32 @send(i32 %8, i8* %9, i32 %10, i32 0)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp ult i32 %12, 0
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = load i32, i32* %7
%16 = load i32, i32* %5
%17 = icmp ugt i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14, %3
%19 = call i32 @exit(i32 -1)
unreachable
20: ; preds = %14
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @ffi_send(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @send(i32 %0, i8* %2, i32 %1, i32 0)
%5 = icmp ugt i32 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %3
ret i32 %4
}
IR0IR1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*p0) = (*p1); }


x86 assembly (clang, -O0):
<IR0IR1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0IR1>:
movzwl (%r9),%eax
mov    %ax,(%r8)
ret

LLVM IR (-O0):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = load i16, i16* %16
%18 = load i16*, i16** %12
store i16 %17, i16* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @IR0IR1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture %5) {
%7 = load i16, i16* %5
store i16 %7, i16* %4
ret i32 undef
}
int fib(int i) {
  if (i == 0)
    return 1;
  if (i == 1)
    return 1;
  return fib(i - 1) + fib(i - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%ebp
cmp    $0x2,%edi
jb     1145 <fib+0x35>
mov    %edi,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    $0xfffffffe,%ebx
add    %eax,%ebp
cmp    $0x1,%ebx
ja     1130 <fib+0x20>
add    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = tail call i32 @fib(i32 %6)
%8 = add nsw i32 %4, -2
%9 = add nsw i32 %7, %5
%10 = icmp ult i32 %8, 2
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i32 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ sendbyte(unsigned char);
void put_c(unsigned char c) { sendbyte(c); }


x86 assembly (clang, -O0):
<put_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <sendbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_c>:
jmp    1030 <sendbyte@plt>

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

LLVM IR (-O2):
define void @put_c(i8 zeroext %0) {
%2 = tail call i32 @sendbyte(i8 zeroext %0)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime_r(struct tm const *, char *);
char *Parrot_asctime_r(const struct tm *tm, char *buffer) {
  return asctime_r(tm, buffer);
}


x86 assembly (clang, -O0):
<Parrot_asctime_r>:
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 <asctime_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Parrot_asctime_r>:
jmp    1030 <asctime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define i8* @Parrot_asctime_r(%struct.tm* %0, i8* %1) {
%3 = alloca %struct.tm*
%4 = alloca i8*
store %struct.tm* %0, %struct.tm** %3
store i8* %1, i8** %4
%5 = load %struct.tm*, %struct.tm** %3
%6 = load i8*, i8** %4
%7 = call i8* @asctime_r(%struct.tm* %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i8* @Parrot_asctime_r(%struct.tm* %0, i8* %1) {
%3 = tail call i8* @asctime_r(%struct.tm* %0, i8* %1)
ret i8* %3
}