xunge/DecIR huggingface dataset:
/* Type definitions */
struct ptrlist_struct {
  int dummy;
};
struct elasticarray {
  int dummy;
};

/* Variables and functions */
int elasticarray_append(struct elasticarray *, void const *, size_t, int);
int ptrlist_append(struct ptrlist_struct *EA, const void *buf, size_t nrec) {
  return (elasticarray_append((struct elasticarray *)EA, buf, nrec,
                              sizeof(void *)));
}


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

x86 assembly (clang, -O2):
<ptrlist_append>:
mov    $0x8,%ecx
jmp    1030 <elasticarray_append@plt>

LLVM IR (-O0):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i32 @ptrlist_append(%struct.ptrlist_struct* %0, i8* %1, i64 %2) {
%4 = alloca %struct.ptrlist_struct*
%5 = alloca i8*
%6 = alloca i64
store %struct.ptrlist_struct* %0, %struct.ptrlist_struct** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.ptrlist_struct*, %struct.ptrlist_struct** %4
%8 = bitcast %struct.ptrlist_struct* %7 to %struct.elasticarray*
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @elasticarray_append(%struct.elasticarray* %8, i8* %9, i64 %10, i32 8)
ret i32 %11
}

LLVM IR (-O2):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i32 @ptrlist_append(%struct.ptrlist_struct* %0, i8* %1, i64 %2) {
%4 = bitcast %struct.ptrlist_struct* %0 to %struct.elasticarray*
%5 = tail call i32 @elasticarray_append(%struct.elasticarray* %4, i8* %1, i64 %2, i32 8)
ret i32 %5
}
/* Variables and functions */
int cos(double);
double my_sec(double x) { return 1 / cos(x); }


x86 assembly (clang, -O0):
<my_sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sec>:
push   %rax
call   1030 <cos@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @my_sec(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @cos(double %3)
%5 = sdiv i32 1, %4
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
define double @my_sec(double %0) {
%2 = tail call i32 @cos(double %0)
%3 = add i32 %2, 1
%4 = icmp ult i32 %3, 3
%5 = select i1 %4, i32 %2, i32 0
%6 = sitofp i32 %5 to double
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int read_input(int *, int **);
int /*<<< orphan*/ solve(int, int *);
int /*<<< orphan*/ system(char *);
int main(int argc, char *argv[]) {
  int n;
  int *adjMtx;
  if (read_input(&n, &adjMtx) == 1) {
    solve(n, adjMtx);
    free(adjMtx);
  }
  system("pause");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1060 <read_input@plt>
cmp    $0x1,%eax
jne    1181 <main+0x41>
mov    -0x14(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1030 <solve@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
lea    0xe78(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1060 <read_input@plt>
cmp    $0x1,%eax
jne    1170 <main+0x30>
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%rsi
call   1030 <solve@plt>
mov    0x10(%rsp),%rdi
call   1040 <free@plt>
lea    0xe89(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32** %4 to i8*
%7 = call i32 @read_input(i32* %3, i32** %4)
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32*, i32** %4
%12 = call i32 @solve(i32 %10, i32* %11)
%13 = load i32*, i32** %4
%14 = call i32 @free(i32* %13)
br label %15
15: ; preds = %9, %2
%16 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int hpctimer_gettsc();
int /*<<< orphan*/ sleep(int);
uint64_t hpctimer_calibrate_sleep(uint64_t overhead) {
  uint64_t count;
  int delay = 3;
  count = hpctimer_gettsc();
  sleep(delay);
  count = hpctimer_gettsc() - count - overhead;
  return count / delay;
}


x86 assembly (clang, -O0):
<hpctimer_calibrate_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x3,-0xc(%rbp)
mov    $0x0,%al
call   1030 <hpctimer_gettsc@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
mov    $0x0,%al
call   1030 <hpctimer_gettsc@plt>
sub    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpctimer_calibrate_sleep>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <hpctimer_gettsc@plt>
mov    %eax,%ebp
mov    $0x3,%edi
call   1040 <sleep@plt>
xor    %eax,%eax
call   1030 <hpctimer_gettsc@plt>
add    %ebx,%ebp
sub    %ebp,%eax
cltq
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @hpctimer_calibrate_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 3, i32* %4
%5 = call i32 (...) @hpctimer_gettsc()
store i32 %5, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @sleep(i32 %6)
%8 = call i32 (...) @hpctimer_gettsc()
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sdiv i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @hpctimer_calibrate_sleep(i32 %0) {
%2 = tail call i32 (...) @hpctimer_gettsc()
%3 = tail call i32 @sleep(i32 3)
%4 = tail call i32 (...) @hpctimer_gettsc()
%5 = add i32 %2, %0
%6 = sub i32 %4, %5
%7 = sdiv i32 %6, 3
ret i32 %7
}
const char *stub_String_cstr() {
  unsigned long long instr_ptr = 0;
  asm("call "
      "String"
      "_"
      "cstr"
      "_jmp\n\t"
      "String"
      "_"
      "cstr"
      "_jmp: popq %%rax\n\t"
      "movq %%rax, %0\n"
      : "=r"(instr_ptr)
      :
      : "%rax");
  ;
  unsigned long long t = ((instr_ptr) / 1024) * 1024;
  unsigned long long *record = (unsigned long long *)(t);
  register const char *(*k)(void *) = 0;
  void *this = 0;
  k = (void *)record[0];
  this = (void *)record[1];
  return (const char *)k(this);
}


x86 assembly (clang, -O0):
<stub_String_cstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x8(%rbp)
call   1115 <String_cstr_jmp>

x86 assembly (clang, -O2):
<stub_String_cstr>:
call   1105 <String_cstr_jmp>

LLVM IR (-O0):
define i8* @stub_String_cstr() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64*
%4 = alloca i8* (i8*)*
%5 = alloca i8*
store i64 0, i64* %1
%6 = call i64 asm "call String_cstr_jmp\0A\09String_cstr_jmp: popq %rax\0A\09movq %rax, $0\0A", "=r,~{rax},~{dirflag},~{fpsr},~{flags}"()
store i64 %6, i64* %1
%7 = load i64, i64* %1
%8 = udiv i64 %7, 1024
%9 = mul i64 %8, 1024
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = inttoptr i64 %10 to i64*
store i64* %11, i64** %3
store i8* (i8*)* null, i8* (i8*)** %4
store i8* null, i8** %5
%12 = load i64*, i64** %3
%13 = getelementptr inbounds i64, i64* %12, i64 0
%14 = load i64, i64* %13
%15 = inttoptr i64 %14 to i8*
%16 = bitcast i8* %15 to i8* (i8*)*
store i8* (i8*)* %16, i8* (i8*)** %4
%17 = load i64*, i64** %3
%18 = getelementptr inbounds i64, i64* %17, i64 1
%19 = load i64, i64* %18
%20 = inttoptr i64 %19 to i8*
store i8* %20, i8** %5
%21 = load i8* (i8*)*, i8* (i8*)** %4
%22 = load i8*, i8** %5
%23 = call i8* %21(i8* %22)
ret i8* %23
}

LLVM IR (-O2):
define i8* @stub_String_cstr() {
%1 = tail call i64 asm "call String_cstr_jmp\0A\09String_cstr_jmp: popq %rax\0A\09movq %rax, $0\0A", "=r,~{rax},~{dirflag},~{fpsr},~{flags}"()
%2 = and i64 %1, -1024
%3 = inttoptr i64 %2 to i64*
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to i8* (i8*)*
%6 = getelementptr inbounds i64, i64* %3, i64 1
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
%9 = tail call i8* %5(i8* %8)
ret i8* %9
}
/* Variables and functions */
int factorial(int);
int combination(int n, int r) {
  return factorial(n) / (factorial(r) * factorial(n - r));
  ;
}


x86 assembly (clang, -O0):
<combination>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<combination>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <factorial@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <factorial@plt>
mov    %eax,%r15d
sub    %ebx,%ebp
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
imul   %r15d,%ecx
mov    %r14d,%eax
cltd
idiv   %ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @combination(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 = call i32 @factorial(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @factorial(i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
%12 = call i32 @factorial(i32 %11)
%13 = mul nsw i32 %8, %12
%14 = sdiv i32 %6, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @combination(i32 %0, i32 %1) {
%3 = tail call i32 @factorial(i32 %0)
%4 = tail call i32 @factorial(i32 %1)
%5 = sub nsw i32 %0, %1
%6 = tail call i32 @factorial(i32 %5)
%7 = mul nsw i32 %6, %4
%8 = sdiv i32 %3, %7
ret i32 %8
}
/* Variables and functions */
int random();
int get_random(int rng) {
  if (rng < 1) {
    return 0;
  }
  return (int)(random() % rng);
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1131 <get_random+0x21>
movl   $0x0,-0x4(%rbp)
jmp    113f <get_random+0x2f>
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
test   %edi,%edi
jle    1125 <get_random+0x15>
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_random(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @random()
%5 = srem i32 %4, %0
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ modelview_load(float **);
int /*<<< orphan*/ modelview_push();
void modelview_load_push(float m[4][4]) {
  modelview_push();
  modelview_load(m);
}


x86 assembly (clang, -O0):
<modelview_load_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <modelview_push@plt>
mov    -0x8(%rbp),%rdi
call   1040 <modelview_load@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modelview_load_push>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <modelview_push@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <modelview_load@plt>

LLVM IR (-O0):
define void @modelview_load_push([4 x float]* %0) {
%2 = alloca [4 x float]*
store [4 x float]* %0, [4 x float]** %2
%3 = call i32 (...) @modelview_push()
%4 = load [4 x float]*, [4 x float]** %2
%5 = bitcast [4 x float]* %4 to float**
%6 = call i32 @modelview_load(float** %5)
ret void
}

LLVM IR (-O2):
define void @modelview_load_push([4 x float]* %0) {
%2 = tail call i32 (...) @modelview_push()
%3 = bitcast [4 x float]* %0 to float**
%4 = tail call i32 @modelview_load(float** %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int S_ISFIFO(int /*<<< orphan*/);
int s_isfifo(mode_t mode) { return S_ISFIFO(mode); }


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

x86 assembly (clang, -O2):
<s_isfifo>:
jmp    1030 <S_ISFIFO@plt>

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

LLVM IR (-O2):
define i32 @s_isfifo(i32 %0) {
%2 = tail call i32 @S_ISFIFO(i32 %0)
ret i32 %2
}
/* Variables and functions */
double M_PI;
double deg2rad(double ang) { return M_PI * ang / 180.0; }


x86 assembly (clang, -O0):
<deg2rad>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    0x2ed8(%rip),%rax
movsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<deg2rad>:
mov    0x2ee1(%rip),%rax
mulsd  (%rax),%xmm0
divsd  0xeed(%rip),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = load double, double* %2
%5 = fmul double %3, %4
%6 = fdiv double %5, 1.800000e+02
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @deg2rad(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, %0
%4 = fdiv double %3, 1.800000e+02
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void printarray_1(int (*ptr)[4]) {
  int *p, count;
  p = (int *)ptr;
  for (count = 0; count < 4; count++)
    printf("\n%d", *p++);
}


x86 assembly (clang, -O0):
<printarray_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1160 <printarray_1+0x50>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <printarray_1+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printarray_1>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%esi
lea    0xee0(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0xc(%rbx),%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
define void @printarray_1([4 x i32]* nocapture %0) {
%2 = getelementptr [4 x i32], [4 x i32]* %0, i64 0, i64 0
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 1
%4 = load i32, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 2
%7 = load i32, i32* %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %0, i64 0, i64 3
%10 = load i32, i32* %6
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %9
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  int i = 0;
  while (i < argc) {
    printf("%s\n", argv[i]);
    ++i;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t get_adc_value(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_adc_value() {
ret i32 0
}
void acpi_watchdog_init(void) {}


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

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

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

LLVM IR (-O2):
define void @acpi_watchdog_init() {
ret void
}
void f96(void) {
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  goto a;
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  0;
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @TMTimerGetMilli() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, long);
long strtol(char *, int /*<<< orphan*/ *, int);
int main(int argc, char **argv) {
  long n = strtol(argv[1], NULL, 10);
  printf("Parsed as %ld\n", n);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtol@plt>
lea    0xec8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Parsed as %ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i64 @strtol(i8* %9, i32* null, i32 10)
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@.str = [15 x i8] c"Parsed as %ld\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i64 @strtol(i8* nocapture %4, i32* null, i32 10)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i64 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n1, n2;
  scanf("%d %d", &n1, &n2);
  printf("%d\n", (n1 + n2));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %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):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
unsigned strv_length(char **l) {
  unsigned n = 0;
  if (!l)
    return 0;
  for (; *l; l++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<strv_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1126 <strv_length+0x26>
movl   $0x0,-0x4(%rbp)
jmp    1159 <strv_length+0x59>
jmp    112b <strv_length+0x2b>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1153 <strv_length+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112b <strv_length+0x2b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strv_length>:
xor    %eax,%eax
test   %rdi,%rdi
je     111c <strv_length+0x1c>
cmpq   $0x0,(%rdi)
je     111c <strv_length+0x1c>
xor    %eax,%eax
nop
cmpq   $0x0,0x8(%rdi,%rax,8)
lea    0x1(%rax),%rax
jne    1110 <strv_length+0x10>
ret

LLVM IR (-O0):
define i32 @strv_length(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 0, i32* %4
%5 = load i8**, i8*** %3
%6 = icmp ne i8** %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %21
8: ; preds = %1
br label %9
9: ; preds = %16, %8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add i32 %14, 1
store i32 %15, i32* %4
br label %16
16: ; preds = %13
%17 = load i8**, i8*** %3
%18 = getelementptr inbounds i8*, i8** %17, i32 1
store i8** %18, i8*** %3
br label %9
19: ; preds = %9
%20 = load i32, i32* %4
store i32 %20, i32* %2
br label %21
21: ; preds = %19, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @strv_length(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i8** [ %10, %6 ], [ %0, %3 ]
%9 = add i32 %7, 1
%10 = getelementptr inbounds i8*, i8** %8, i64 1
%11 = load i8*, i8** %10
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %6
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
void gtk_text_buffer_move_mark() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_move_mark() {
ret void
}
double normalize(double x, double lbound, double ubound) {
  return (((x - lbound) * (1.0 - 0.0)) / (ubound - lbound));
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
subsd  %xmm1,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @normalize(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fsub double %7, %8
%10 = fmul double %9, 1.000000e+00
%11 = load double, double* %6
%12 = load double, double* %5
%13 = fsub double %11, %12
%14 = fdiv double %10, %13
ret double %14
}

LLVM IR (-O2):
define double @normalize(double %0, double %1, double %2) {
%4 = fsub double %0, %1
%5 = fsub double %2, %1
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "Options:\n"
                  " -H <host>  -  host to connect to\n"
                  " -P <port>  -  remote port to connect to\n"
                  " -L <port>  -  local to send from\n\n"
                  "All following data will be sent as message body\n");
}


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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [168 x i8] c"Options:\0A -H <host> - host to connect to\0A -P <port> - remote port to connect to\0A -L <port> - local to send from\0A\0AAll following data will be sent as message body\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [168 x i8] c"Options:\0A -H <host> - host to connect to\0A -P <port> - remote port to connect to\0A -L <port> - local to send from\0A\0AAll following data will be sent as message body\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void _start(uint32_t info[]) { _exit(0xCAFEBABE); }


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0xcafebabe,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
mov    $0xcafebabe,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @_start(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @_exit(i32 -889275714)
unreachable
}

LLVM IR (-O2):
define void @_start(i32* nocapture readnone %0) {
%2 = tail call i32 @_exit(i32 -889275714)
unreachable
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void get_config_dir(char *config_dir) {
  sprintf(config_dir, "%s%s", getenv("HOME"), "/.kbpm");
}


x86 assembly (clang, -O0):
<get_config_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb2(%rip),%rsi
lea    0xeb5(%rip),%rcx
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_config_dir>:
push   %rbx
mov    %rdi,%rbx
lea    0xeda(%rip),%rdi
call   1030 <getenv@plt>
lea    0xec9(%rip),%rsi
lea    0xecc(%rip),%rcx
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [7 x i8] c"/.kbpm\00"
define void @get_config_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [5 x i8] c"HOME\00"
@.str.2 = [7 x i8] c"/.kbpm\00"
define void @get_config_dir(i8* nocapture writeonly %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_numbers();
int /*<<< orphan*/ sieve_of_eratosthenes();
int main() {
  sieve_of_eratosthenes();
  print_numbers();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sieve_of_eratosthenes()
%2 = tail call i32 (...) @print_numbers()
ret i32 0
}
void tu_init() {}


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

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

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

LLVM IR (-O2):
define void @tu_init() {
ret void
}
void srx(char *n, char l, void (*fn)(char *, char)) {
  if (!(l >>= 1)) {
    return;
  }
  (*fn)(n, l);
  srx(n, l, fn);
}


x86 assembly (clang, -O0):
<srx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x9(%rbp)
cmp    $0x0,%al
jne    113d <srx+0x2d>
jmp    115e <srx+0x4e>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   *%rax
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x18(%rbp),%rdx
movsbl %al,%esi
call   1030 <srx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srx>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
cmp    $0x2,%bpl
jb     1133 <srx+0x33>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %ebp,%ebx
nopw   0x0(%rax,%rax,1)
sar    %bl
movsbl %bl,%esi
mov    %r15,%rdi
call   *%r14
cmp    $0x3,%bpl
mov    %ebx,%ebp
ja     1120 <srx+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @srx(i8* %0, i8 signext %1, void (i8*, i8)* %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca void (i8*, i8)*
store i8* %0, i8** %4
store i8 %1, i8* %5
store void (i8*, i8)* %2, void (i8*, i8)** %6
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = ashr i32 %8, 1
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = icmp ne i8 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %3
br label %20
13: ; preds = %3
%14 = load void (i8*, i8)*, void (i8*, i8)** %6
%15 = load i8*, i8** %4
%16 = load i8, i8* %5
%17 = load i8*, i8** %4
%18 = load i8, i8* %5
%19 = load void (i8*, i8)*, void (i8*, i8)** %6
br label %20
20: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @srx(i8* %0, i8 signext %1, void (i8*, i8)* nocapture %2) {
%4 = icmp ult i8 %1, 2
br i1 %4, label %9, label %5
5: ; preds = %3, %5
%6 = phi i8 [ %7, %5 ], [ %1, %3 ]
%7 = ashr i8 %6, 1
tail call void %2(i8* %0, i8 signext %7)
%8 = icmp ult i8 %6, 4
br i1 %8, label %9, label %5
9: ; preds = %5, %3
ret void
}
char f3a(char ***x) { return ***x; }


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

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

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

LLVM IR (-O2):
define signext i8 @f3a(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
ret i8 %4
}
int xh_ptr_equal(const void *key1, const void *key2, void *data) {
  (void)data;
  return *(const void **)key1 == *(const void **)key2;
}


x86 assembly (clang, -O0):
<xh_ptr_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xh_ptr_equal>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
sete   %al
ret

LLVM IR (-O0):
define i32 @xh_ptr_equal(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i8**
%13 = load i8*, i8** %12
%14 = icmp eq i8* %10, %13
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @xh_ptr_equal(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i8**
%5 = load i8*, i8** %4
%6 = bitcast i8* %1 to i8**
%7 = load i8*, i8** %6
%8 = icmp eq i8* %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int BIT(int);
unsigned long smmu_pmd_addr_end_lpae(unsigned long addr, unsigned long end) {
  unsigned long boundary = (addr + BIT((21))) & (~(BIT((21)) - 1));
  return (boundary - 1 < end - 1) ? boundary : end;
}


x86 assembly (clang, -O0):
<smmu_pmd_addr_end_lpae>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x15,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    $0x15,%edi
call   1030 <BIT@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
xor    $0xffffffff,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    1188 <smmu_pmd_addr_end_lpae+0x78>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1190 <smmu_pmd_addr_end_lpae+0x80>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smmu_pmd_addr_end_lpae>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x15,%edi
call   1030 <BIT@plt>
movslq %eax,%rbx
add    %r14,%rbx
mov    $0x15,%edi
call   1030 <BIT@plt>
neg    %eax
cltq
and    %rbx,%rax
lea    -0x1(%rax),%rcx
lea    -0x1(%r15),%rdx
cmp    %rdx,%rcx
cmovae %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @smmu_pmd_addr_end_lpae(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = call i32 @BIT(i32 21)
%8 = sext i32 %7 to i64
%9 = add i64 %6, %8
%10 = call i32 @BIT(i32 21)
%11 = sub nsw i32 %10, 1
%12 = xor i32 %11, -1
%13 = sext i32 %12 to i64
%14 = and i64 %9, %13
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = sub i64 %15, 1
%17 = load i64, i64* %4
%18 = sub i64 %17, 1
%19 = icmp ult i64 %16, %18
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = load i64, i64* %5
br label %24
22: ; preds = %2
%23 = load i64, i64* %4
br label %24
24: ; preds = %22, %20
%25 = phi i64 [ %21, %20 ], [ %23, %22 ]
ret i64 %25
}

LLVM IR (-O2):
define i64 @smmu_pmd_addr_end_lpae(i64 %0, i64 %1) {
%3 = tail call i32 @BIT(i32 21)
%4 = sext i32 %3 to i64
%5 = add i64 %4, %0
%6 = tail call i32 @BIT(i32 21)
%7 = sub i32 0, %6
%8 = sext i32 %7 to i64
%9 = and i64 %5, %8
%10 = add i64 %9, -1
%11 = add i64 %1, -1
%12 = icmp ult i64 %10, %11
%13 = select i1 %12, i64 %9, i64 %1
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ worker(int);
int main(int argc, char *argv[]) {
  worker(1);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @worker(i32 1)
ret i32 0
}
void foo498(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo498(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void usage(void) {
  fputs("usage: qls path\n", stderr);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"usage: qls path\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [17 x i8] c"usage: qls path\0A\00"
@stderr = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void func(int *ptr) { *ptr = 7; }


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

x86 assembly (clang, -O2):
<func>:
movl   $0x7,(%rdi)
ret

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

LLVM IR (-O2):
define void @func(i32* nocapture writeonly %0) {
store i32 7, i32* %0
ret void
}
void nmi_handler(void) { return; }


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

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

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

LLVM IR (-O2):
define void @nmi_handler() {
ret void
}
/* Variables and functions */
long double __qsin(long double);
long double __q_sin(long double *arg) { return (__qsin(*arg)); }


x86 assembly (clang, -O0):
<__q_sin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__qsin@plt>
fld    %st(0)
fstp   %st(0)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__q_sin>:
sub    $0x18,%rsp
fldt   (%rdi)
fstpt  (%rsp)
call   1030 <__qsin@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define x86_fp80 @__q_sin(x86_fp80* %0) {
%2 = alloca x86_fp80*
store x86_fp80* %0, x86_fp80** %2
%3 = load x86_fp80*, x86_fp80** %2
%4 = load x86_fp80, x86_fp80* %3
%5 = call x86_fp80 @__qsin(x86_fp80 %4)
ret x86_fp80 %5
}

LLVM IR (-O2):
define x86_fp80 @__q_sin(x86_fp80* nocapture %0) {
%2 = load x86_fp80, x86_fp80* %0
%3 = tail call x86_fp80 @__qsin(x86_fp80 %2)
ret x86_fp80 %3
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool is_terminal(const char *terminal, const char *token) {
  if (strcmp(terminal, token) == 0) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_terminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <is_terminal+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <is_terminal+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_terminal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ glWindowPos4f(short const, short const, short const,
                                 short const);
void glWindowPos4sv(const short v[4]) { glWindowPos4f(v[0], v[1], v[2], v[3]); }


x86 assembly (clang, -O0):
<glWindowPos4sv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%si
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%dx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%cx
mov    -0x8(%rbp),%rax
movswl %si,%edi
movswl %dx,%esi
movswl %cx,%edx
movswl 0x6(%rax),%ecx
call   1030 <glWindowPos4f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glWindowPos4sv>:
movswl (%rdi),%eax
movswl 0x2(%rdi),%esi
movswl 0x4(%rdi),%edx
movswl 0x6(%rdi),%ecx
mov    %eax,%edi
jmp    1030 <glWindowPos4f@plt>

LLVM IR (-O0):
define void @glWindowPos4sv(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = getelementptr inbounds i16, i16* %3, i64 0
%5 = load i16, i16* %4
%6 = load i16*, i16** %2
%7 = getelementptr inbounds i16, i16* %6, i64 1
%8 = load i16, i16* %7
%9 = load i16*, i16** %2
%10 = getelementptr inbounds i16, i16* %9, i64 2
%11 = load i16, i16* %10
%12 = load i16*, i16** %2
%13 = getelementptr inbounds i16, i16* %12, i64 3
%14 = load i16, i16* %13
%15 = call i32 @glWindowPos4f(i16 signext %5, i16 signext %8, i16 signext %11, i16 signext %14)
ret void
}

LLVM IR (-O2):
define void @glWindowPos4sv(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = getelementptr inbounds i16, i16* %0, i64 1
%4 = load i16, i16* %3
%5 = getelementptr inbounds i16, i16* %0, i64 2
%6 = load i16, i16* %5
%7 = getelementptr inbounds i16, i16* %0, i64 3
%8 = load i16, i16* %7
%9 = tail call i32 @glWindowPos4f(i16 signext %2, i16 signext %4, i16 signext %6, i16 signext %8)
ret void
}