xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void *start_empathy(void *p) {
  system("empathy");
  return NULL;
}


x86 assembly (clang, -O0):
<start_empathy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"empathy\00"
define noalias i8* @start_empathy(i8* nocapture readnone %0) {
%2 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ ot(char *);
do_dseg() {
  ot(";-; SECTION .dseg align=16 ;; commented out for .com version");
}


x86 assembly (clang, -O0):
<do_dseg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <ot@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [61 x i8] c";-; SECTION .dseg align=16 ;; commented out for .com version\00"
define i32 @do_dseg() {
%1 = alloca i32
%2 = call i32 @ot(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [61 x i8] c";-; SECTION .dseg align=16 ;; commented out for .com version\00"
define i32 @do_dseg() {
%1 = tail call i32 @ot(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void bisect_prob(int *n, int *A, int *n0, int *A0, double *psi, double *prob) {
  double bisect_recur(int n, int A, int n0, int A0, double psi);
  *prob = bisect_recur(*n, *A, *n0, *A0, *psi);
}


x86 assembly (clang, -O0):
<bisect_prob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <bisect_recur@plt>
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bisect_prob>:
push   %rbx
mov    %r9,%rbx
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
movsd  (%r8),%xmm0
call   1030 <bisect_recur@plt>
movsd  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @bisect_prob(i32* %0, i32* %1, i32* %2, i32* %3, double* %4, double* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca double*
%12 = alloca double*
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store double* %4, double** %11
store double* %5, double** %12
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = load double*, double** %11
%22 = load double, double* %21
%23 = call double @bisect_recur(i32 %14, i32 %16, i32 %18, i32 %20, double %22)
%24 = load double*, double** %12
store double %23, double* %24
ret void
}

LLVM IR (-O2):
define void @bisect_prob(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, double* nocapture %4, double* nocapture writeonly %5) {
%7 = load i32, i32* %0
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load double, double* %4
%12 = tail call double @bisect_recur(i32 %7, i32 %8, i32 %9, i32 %10, double %11)
store double %12, double* %5
ret void
}
/* Variables and functions */
int SIGSEGV;
int /*<<< orphan*/ dbg_abort(char *);
void sigsegv_handler(int signal) {
  if (signal == SIGSEGV)
    dbg_abort("catched SIGSEGV");
}


x86 assembly (clang, -O0):
<sigsegv_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ec3(%rip),%rcx
cmp    (%rcx),%eax
jne    1139 <sigsegv_handler+0x29>
lea    0xecc(%rip),%rdi
call   1030 <dbg_abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigsegv_handler>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jne    1127 <sigsegv_handler+0x17>
lea    0xede(%rip),%rdi
jmp    1030 <dbg_abort@plt>
ret

LLVM IR (-O0):
@SIGSEGV = global i32 0
@.str = [16 x i8] c"catched SIGSEGV\00"
define void @sigsegv_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGSEGV
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @dbg_abort(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGSEGV = global i32 0
@.str = [16 x i8] c"catched SIGSEGV\00"
define void @sigsegv_handler(i32 %0) {
%2 = load i32, i32* @SIGSEGV
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @dbg_abort(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vio_server_stop_(int /*<<< orphan*/);
void vio_server_stop(void) { vio_server_stop_(0); }


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

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

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

LLVM IR (-O2):
define void @vio_server_stop() {
%1 = tail call i32 @vio_server_stop_(i32 0)
ret void
}
unsigned int SwapLong(unsigned int val) {
  union {
    unsigned int i;
    unsigned char c[4];
  } v;
  unsigned char s;
  v.i = val;
  s = v.c[0];
  v.c[0] = v.c[3];
  v.c[3] = s;
  s = v.c[1];
  v.c[1] = v.c[2];
  v.c[2] = s;
  return v.i;
}


x86 assembly (clang, -O0):
<SwapLong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x5(%rbp),%al
mov    %al,-0x8(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x7(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x7(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0x6(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SwapLong>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define i32 @SwapLong(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
%4 = alloca i8
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to [4 x i8]*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%9 = load i8, i8* %8
store i8 %9, i8* %4
%10 = bitcast %union.anon* %3 to [4 x i8]*
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 3
%12 = load i8, i8* %11
%13 = bitcast %union.anon* %3 to [4 x i8]*
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %13, i64 0, i64 0
store i8 %12, i8* %14
%15 = load i8, i8* %4
%16 = bitcast %union.anon* %3 to [4 x i8]*
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 3
store i8 %15, i8* %17
%18 = bitcast %union.anon* %3 to [4 x i8]*
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 1
%20 = load i8, i8* %19
store i8 %20, i8* %4
%21 = bitcast %union.anon* %3 to [4 x i8]*
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %21, i64 0, i64 2
%23 = load i8, i8* %22
%24 = bitcast %union.anon* %3 to [4 x i8]*
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %24, i64 0, i64 1
store i8 %23, i8* %25
%26 = load i8, i8* %4
%27 = bitcast %union.anon* %3 to [4 x i8]*
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %27, i64 0, i64 2
store i8 %26, i8* %28
%29 = bitcast %union.anon* %3 to i32*
%30 = load i32, i32* %29
ret i32 %30
}

LLVM IR (-O2):
define i32 @SwapLong(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void soru_2(int dizi[], int N) {}


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

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

LLVM IR (-O0):
define void @soru_2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @soru_2(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int strlen(char *);
char lastchar(char *str) {
  int l = strlen(str);
  return ((l > 0) ? str[l - 1] : 0);
}


x86 assembly (clang, -O0):
<lastchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    114b <lastchar+0x3b>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <lastchar+0x45>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1155 <lastchar+0x45>
mov    -0x10(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastchar>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1125 <lastchar+0x15>
add    $0xffffffff,%eax
mov    (%rbx,%rax,1),%al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @lastchar(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
br label %17
16: ; preds = %1
br label %17
17: ; preds = %16, %8
%18 = phi i32 [ %15, %8 ], [ 0, %16 ]
%19 = trunc i32 %18 to i8
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @lastchar(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = add nsw i32 %2, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
br label %9
9: ; preds = %1, %4
%10 = phi i8 [ %8, %4 ], [ 0, %1 ]
ret i8 %10
}
void AT91F_Default_FIQ_handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<AT91F_Default_FIQ_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <AT91F_Default_FIQ_handler+0x9>
jmp    1109 <AT91F_Default_FIQ_handler+0x9>

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

LLVM IR (-O0):
define void @AT91F_Default_FIQ_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @AT91F_Default_FIQ_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void store_asdf_data_(void) {}


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

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

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

LLVM IR (-O2):
define void @store_asdf_data_() {
ret void
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number, k;
  scanf("%d", &number);
  if (number <= 2) {
    printf("0 \n");
  } else {
    printf("%d \n", exact_square(number));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jg     116c <main+0x3c>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1184 <main+0x54>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
cmp    $0x2,%edi
jg     1169 <main+0x29>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
jmp    117e <main+0x3e>
call   1050 <exact_square@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"0 \0A\00"
@.str.2 = [5 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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %13
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @exact_square(i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"%d \0A\00"
@str = [3 x i8] c"0 \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 3
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %11
8: ; preds = %0
%9 = call i32 @exact_square(i32 %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
g() {
  struct {
    int i;
    struct {
      int j, k;
    } a;
  } b = {1, 2, 3};
  if (!(b.i == 1))
    abort();
  if (!(b.a.j == 2))
    abort();
  if (!(b.a.k == 3))
    abort();
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x10(%rbp)
je     113d <g+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x2,-0xc(%rbp)
je     114e <g+0x3e>
mov    $0x0,%al
call   1030 <abort@plt>
cmpl   $0x3,-0x8(%rbp)
je     115f <g+0x4f>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.anon = type { i32, %struct.anon.0 }
%struct.anon.0 = type { i32, i32 }
@__const.g.b = %struct.anon { i32 1, %struct.anon.0 { i32 2, i32 3 } }
define i32 @g() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = bitcast %struct.anon* %2 to i8*
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 1
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %0
%10 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%11 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, 2
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = call i32 (...) @abort()
unreachable
16: ; preds = %9
%17 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%18 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %17, i32 0, i32 1
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 3
br i1 %20, label %23, label %21
21: ; preds = %16
%22 = call i32 (...) @abort()
unreachable
23: ; preds = %16
%24 = load i32, i32* %1
ret i32 %24
}

LLVM IR (-O2):
define i32 @g() {
ret i32 undef
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int get_size(const char *path) {
  struct stat st;
  int ssize;
  if ((stat(path, &st)) < 0) {
    ssize = -1;
  } else {
    ssize = st.st_size;
  }
  return ssize;
}


x86 assembly (clang, -O0):
<get_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <get_size+0x2f>
movl   $0xffffffff,-0x14(%rbp)
jmp    1145 <get_size+0x35>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1129 <get_size+0x19>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @stat(i8* %5, %struct.stat* %3)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %4
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %4
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, size_t, char *, long double const);
bool cutils_cdar_DynamicArray_long_double_format(const long double *i, char **b,
                                                 size_t *s) {
  snprintf(*b, *s, "%Lf", *i);
  return true;
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_long_double_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x8(%rbp),%rax
fldt   (%rax)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xebc(%rip),%rdx
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_long_double_format>:
sub    $0x18,%rsp
mov    (%rsi),%rax
mov    (%rdx),%rsi
fldt   (%rdi)
fstpt  (%rsp)
lea    0xeda(%rip),%rdx
mov    %rax,%rdi
call   1030 <snprintf@plt>
mov    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%Lf\00"
define i32 @cutils_cdar_DynamicArray_long_double_format(x86_fp80* %0, i8** %1, i64* %2) {
%4 = alloca x86_fp80*
%5 = alloca i8**
%6 = alloca i64*
store x86_fp80* %0, x86_fp80** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = load i64*, i64** %6
%10 = load i64, i64* %9
%11 = load x86_fp80*, x86_fp80** %4
%12 = load x86_fp80, x86_fp80* %11
%13 = call i32 @snprintf(i8* %8, i64 %10, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %12)
ret i32 1
}

LLVM IR (-O2):
@.str = [4 x i8] c"%Lf\00"
define i32 @cutils_cdar_DynamicArray_long_double_format(x86_fp80* nocapture %0, i8** nocapture %1, i64* nocapture %2) {
%4 = load i8*, i8** %1
%5 = load i64, i64* %2
%6 = load x86_fp80, x86_fp80* %0
%7 = tail call i32 @snprintf(i8* %4, i64 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), x86_fp80 %6)
ret i32 1
}
/* Variables and functions */
scalar_t__ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t);
void *xcalloc(size_t num, size_t size) {
  void *ptr_new = xmalloc(num * size);
  ((void)memset(ptr_new, 0, num * size));
  return ptr_new;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
imul   -0x10(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
imul   -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = mul i64 %6, %7
%9 = call i8* @xmalloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = mul i64 %11, %12
%14 = call i64 @memset(i8* %10, i32 0, i64 %13)
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @xmalloc(i64 %3)
%5 = tail call i64 @memset(i8* %4, i32 0, i64 %3)
ret i8* %4
}
int min(a, b)
int a, b;
{ return (a > b) ? b : a; }


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

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

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
int egsy_csr_busy_signal_set(unsigned int dev_id,
                             union egsy_csr_busy_signal_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<egsy_csr_busy_signal_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.egsy_csr_busy_signal_u = type opaque
define i32 @egsy_csr_busy_signal_set(i32 %0, %union.egsy_csr_busy_signal_u* %1) {
%3 = alloca i32
%4 = alloca %union.egsy_csr_busy_signal_u*
store i32 %0, i32* %3
store %union.egsy_csr_busy_signal_u* %1, %union.egsy_csr_busy_signal_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.egsy_csr_busy_signal_u = type opaque
define i32 @egsy_csr_busy_signal_set(i32 %0, %union.egsy_csr_busy_signal_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
float SoftParticleDepth(float const);
float DepthToDestAlpha(const float flProjZ) {
  return SoftParticleDepth(flProjZ);
}


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

x86 assembly (clang, -O2):
<DepthToDestAlpha>:
jmp    1030 <SoftParticleDepth@plt>

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

LLVM IR (-O2):
define float @DepthToDestAlpha(float %0) {
%2 = tail call float @SoftParticleDepth(float %0)
ret float %2
}
/* Variables and functions */
int foo();
int /*<<< orphan*/ getNSGetExecutablePath(char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, const char *argv[]) {
  printf("-- main() returns libfoo:foo() --\n");
  getNSGetExecutablePath((char *)argv[0]);
  return foo();
}


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)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <getNSGetExecutablePath@plt>
mov    $0x0,%al
call   1040 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdi
call   1050 <getNSGetExecutablePath@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <foo@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"-- main() returns libfoo:foo() --\0A\00"
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 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @getNSGetExecutablePath(i8* %9)
%11 = call i32 (...) @foo()
ret i32 %11
}

LLVM IR (-O2):
@str = [34 x i8] c"-- main() returns libfoo:foo() --\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = load i8*, i8** %1
%5 = tail call i32 @getNSGetExecutablePath(i8* %4)
%6 = tail call i32 (...) @foo()
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(
      stderr,
      "\n"
      "usage: upgrade [options] <destination> <file_name>\n"
      "\n"
      "<destination>  : FQDN or IP address of destination.\n"
      "<file_name>    : name of the file to send.\n"
      "-h             : display this message\n"
      "-v             : display the version\n"
      "-p port_number : use a different port.  Default = UDP port 69\n"
      "-a <mac_addr>  : specify the mac address to get a faster connection\n"
      "                 (not implemented yet)\n"
      "\n"
      "All transfers are binary.\n"
      "Retry 2 times every second.\n"
      "Timeout after 30 seconds.\n"
      "\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 = [475 x i8] c"\0Ausage: upgrade [options] <destination> <file_name>\0A\0A<destination> : FQDN or IP address of destination.\0A<file_name> : name of the file to send.\0A-h : display this message\0A-v : display the version\0A-p port_number : use a different port. Default = UDP port 69\0A-a <mac_addr> : specify the mac address to get a faster connection\0A (not implemented yet)\0A\0AAll transfers are binary.\0ARetry 2 times every second.\0ATimeout after 30 seconds.\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([475 x i8], [475 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [475 x i8] c"\0Ausage: upgrade [options] <destination> <file_name>\0A\0A<destination> : FQDN or IP address of destination.\0A<file_name> : name of the file to send.\0A-h : display this message\0A-v : display the version\0A-p port_number : use a different port. Default = UDP port 69\0A-a <mac_addr> : specify the mac address to get a faster connection\0A (not implemented yet)\0A\0AAll transfers are binary.\0ARetry 2 times every second.\0ATimeout after 30 seconds.\0A\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([475 x i8], [475 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int ffsll(int /*<<< orphan*/);
int /*<<< orphan*/ htonll(long long);
int flsll(long long int i) { return i ? 65 - ffsll(htonll(i)) : 0; }


x86 assembly (clang, -O0):
<flsll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <flsll+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <htonll@plt>
mov    %eax,%edi
call   1030 <ffsll@plt>
mov    %eax,%ecx
mov    $0x41,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <flsll+0x42>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <flsll+0x42>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flsll>:
test   %rdi,%rdi
je     1134 <flsll+0x24>
push   %rax
call   1030 <htonll@plt>
bsf    %eax,%ecx
mov    $0x40,%edx
sub    %ecx,%edx
test   %eax,%eax
mov    $0x41,%eax
cmovne %edx,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @flsll(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i32 @htonll(i64 %0)
%5 = tail call i32 @llvm.cttz.i32(i32 %4, i1 true)
%6 = icmp eq i32 %4, 0
%7 = sub nuw nsw i32 64, %5
%8 = select i1 %6, i32 65, i32 %7
br label %9
9: ; preds = %1, %3
%10 = phi i32 [ %8, %3 ], [ 0, %1 ]
ret i32 %10
}
int quelmode(char codeascii) {
  int mode = 901;
  if ((codeascii == '\t') || (codeascii == '\n') || (codeascii == '\r') ||
      ((codeascii >= ' ') && (codeascii <= '~'))) {
    mode = 900;
  } else if ((codeascii >= '0') && (codeascii <= '9')) {
    mode = 902;
  }
  return mode;
}


x86 assembly (clang, -O0):
<quelmode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x385,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
je     1152 <quelmode+0x52>
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
je     1152 <quelmode+0x52>
movsbl -0x1(%rbp),%eax
cmp    $0xd,%eax
je     1152 <quelmode+0x52>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
jl     115e <quelmode+0x5e>
movsbl -0x1(%rbp),%eax
cmp    $0x7e,%eax
jg     115e <quelmode+0x5e>
movl   $0x384,-0x8(%rbp)
jmp    1184 <quelmode+0x84>
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     117f <quelmode+0x7f>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     117f <quelmode+0x7f>
movl   $0x386,-0x8(%rbp)
jmp    1184 <quelmode+0x84>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quelmode>:
cmp    $0xd,%dil
ja     111b <quelmode+0x1b>
mov    $0x384,%eax
movzbl %dil,%ecx
mov    $0x2600,%edx
bt     %rcx,%rdx
jae    111b <quelmode+0x1b>
ret
lea    -0x20(%rdi),%eax
cmp    $0x5f,%al
mov    $0x385,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @quelmode(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 901, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 9
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 10
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 13
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 32
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 126
br i1 %22, label %23, label %24
23: ; preds = %19, %11, %7, %1
store i32 900, i32* %3
br label %34
24: ; preds = %19, %15
%25 = load i8, i8* %2
%26 = sext i8 %25 to i32
%27 = icmp sge i32 %26, 48
br i1 %27, label %28, label %33
28: ; preds = %24
%29 = load i8, i8* %2
%30 = sext i8 %29 to i32
%31 = icmp sle i32 %30, 57
br i1 %31, label %32, label %33
32: ; preds = %28
store i32 902, i32* %3
br label %33
33: ; preds = %32, %28, %24
br label %34
34: ; preds = %33, %23
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
define i32 @quelmode(i8 signext %0) {
switch i8 %0, label %2 [
i8 13, label %6
i8 10, label %6
i8 9, label %6
]
2: ; preds = %1
%3 = add i8 %0, -32
%4 = icmp ult i8 %3, 95
%5 = select i1 %4, i32 900, i32 901
br label %6
6: ; preds = %2, %1, %1, %1
%7 = phi i32 [ 900, %1 ], [ 900, %1 ], [ 900, %1 ], [ %5, %2 ]
ret i32 %7
}
/* Variables and functions */
double _expm1(double);
double expm1(double x) { return _expm1(x); }


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

x86 assembly (clang, -O2):
<expm1>:
jmp    1030 <_expm1@plt>

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

LLVM IR (-O2):
define double @expm1(double %0) {
%2 = tail call double @_expm1(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
long solve(char *);
int main(int args, char **argv) {
  long answer = 0;
  answer = solve("./input.txt");
  printf("%ld\n", answer);
  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)
movq   $0x0,-0x18(%rbp)
lea    0xebb(%rip),%rdi
call   1030 <solve@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"./input.txt\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
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
store i64 0, i64* %6
%7 = call i64 @solve(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i64 %7, i64* %6
%8 = load i64, i64* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"./input.txt\00"
@.str.1 = [5 x i8] c"%ld\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @solve(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %3)
ret i32 0
}
void chpl__heapAllocateGlobals(void) { return; }


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

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

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

LLVM IR (-O2):
define void @chpl__heapAllocateGlobals() {
ret void
}
/* Variables and functions */
scalar_t__ strncmp(char *, char *, int);
void strncmp_constant_and_var_1() {
  char *x = "123";
  if (strncmp("123", x, 3) != 0)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncmp_constant_and_var_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed2(%rip),%rdi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     1142 <strncmp_constant_and_var_1+0x32>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncmp_constant_and_var_1>:
lea    0xee9(%rip),%rdi
mov    %rdi,%rsi
mov    $0x3,%edx
jmp    1030 <strncmp@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strncmp_constant_and_var_1() {
%1 = alloca i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2, i32 3)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i8, i8* null
br label %7
7: ; preds = %5, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strncmp_constant_and_var_1() {
%1 = tail call i64 @strncmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
int f2(int *pf21, int *pf22) {
  int *stuff;
  stuff = (int *)calloc(1, sizeof(int));
  if (!stuff)
    exit(-1);
  *stuff = 0xDEADBEEF;
  printf("stuff[@%X]=%X\n", stuff, *stuff);
  *pf21 = stuff;
  *pf22 = *stuff;
  return 0;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <f2+0x38>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
movl   $0xdeadbeef,(%rax)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x1,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
test   %rax,%rax
je     117e <f2+0x4e>
mov    %rax,%rbx
movl   $0xdeadbeef,(%rax)
lea    0xea1(%rip),%rdi
mov    %rax,%rsi
mov    $0xdeadbeef,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,(%r15)
mov    (%rbx),%eax
mov    %eax,(%r14)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"stuff[@%X]=%X\0A\00"
define i32 @f2(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i8* @calloc(i64 1, i64 4)
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = icmp ne i32* %8, null
br i1 %9, label %11, label %10
10: ; preds = %2
unreachable
11: ; preds = %2
%12 = load i32*, i32** %5
store i32 -559038737, i32* %12
%13 = load i32*, i32** %5
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32* %13, i32 %15)
%17 = load i32*, i32** %5
%18 = ptrtoint i32* %17 to i32
%19 = load i32*, i32** %3
store i32 %18, i32* %19
%20 = load i32*, i32** %5
%21 = load i32, i32* %20
%22 = load i32*, i32** %4
store i32 %21, i32* %22
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"stuff[@%X]=%X\0A\00"
define i32 @f2(i32* nocapture writeonly %0, i32* nocapture writeonly %1) {
%3 = tail call dereferenceable_or_null(4) i8* @calloc(i64 1, i64 4)
%4 = bitcast i8* %3 to i32*
%5 = icmp eq i8* %3, null
br i1 %5, label %6, label %7
6: ; preds = %2
tail call void @exit(i32 -1)
unreachable
7: ; preds = %2
store i32 -559038737, i32* %4
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3, i32 -559038737)
%9 = ptrtoint i8* %3 to i64
%10 = trunc i64 %9 to i32
store i32 %10, i32* %0
%11 = load i32, i32* %4
store i32 %11, i32* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stderr;
void error(const char *str) {
  fprintf(stderr, "%s%s\n", "\x1B[31m", str);
  exit(1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xec0(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rcx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xecb(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s%s\0A\00"
@.str.1 = [6 x i8] c"\1B[31m\00"
define void @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
const char *method_name(int method) {
  switch (method) {
  case 1:
    return "mono";
  case 2:
    return "dual";
  default:
    return "unknown";
  }
}


x86 assembly (clang, -O0):
<method_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     112c <method_name+0x2c>
jmp    111b <method_name+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     113c <method_name+0x3c>
jmp    114c <method_name+0x4c>
lea    0xecd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <method_name+0x57>
lea    0xec2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1157 <method_name+0x57>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<method_name>:
cmp    $0x2,%edi
lea    0xefb(%rip),%rax
lea    0xef9(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"mono\00"
@.str.1 = [5 x i8] c"dual\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @method_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 1, label %5
i32 2, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"mono\00"
@.str.1 = [5 x i8] c"dual\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @method_name(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int path_is_absolute_b(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ str_len(char const *);
int path_is_absolute(const char *p) {
  return path_is_absolute_b(p, str_len(p));
}


x86 assembly (clang, -O0):
<path_is_absolute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <str_len@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <path_is_absolute_b@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_is_absolute>:
push   %rbx
mov    %rdi,%rbx
call   1040 <str_len@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <path_is_absolute_b@plt>

LLVM IR (-O0):
define i32 @path_is_absolute(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @str_len(i8* %4)
%6 = call i32 @path_is_absolute_b(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @path_is_absolute(i8* %0) {
%2 = tail call i32 @str_len(i8* %0)
%3 = tail call i32 @path_is_absolute_b(i8* %0, i32 %2)
ret i32 %3
}
int get_number_of_sons(const int i, const int n) {
  int nb_leafs = (n + 1) / 2;
  if (i > n - nb_leafs)
    return 0;
  else if (i == n - nb_leafs && !(n % 2))
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<get_number_of_sons>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jle    1138 <get_number_of_sons+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1170 <get_number_of_sons+0x70>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jne    1169 <get_number_of_sons+0x69>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1169 <get_number_of_sons+0x69>
movl   $0x1,-0x4(%rbp)
jmp    1170 <get_number_of_sons+0x70>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number_of_sons>:
lea    0x1(%rsi),%eax
shr    $0x1f,%eax
add    %esi,%eax
add    $0x1,%eax
sar    %eax
mov    %esi,%ecx
sub    %eax,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
jl     112a <get_number_of_sons+0x2a>
xor    %edi,%ecx
and    $0x1,%esi
xor    %edx,%edx
or     %ecx,%esi
sete   %dl
mov    $0x2,%eax
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_number_of_sons(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = add nsw i32 %7, 1
%9 = sdiv i32 %8, 2
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
%14 = icmp sgt i32 %10, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 0, i32* %3
br label %28
16: ; preds = %2
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %27
22: ; preds = %16
%23 = load i32, i32* %5
%24 = srem i32 %23, 2
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %22
store i32 1, i32* %3
br label %28
27: ; preds = %22, %16
store i32 2, i32* %3
br label %28
28: ; preds = %27, %26, %15
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @get_number_of_sons(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = sdiv i32 %3, -2
%5 = add i32 %4, %1
%6 = icmp slt i32 %5, %0
br i1 %6, label %13, label %7
7: ; preds = %2
%8 = icmp eq i32 %5, %0
%9 = and i32 %1, 1
%10 = icmp eq i32 %9, 0
%11 = and i1 %10, %8
%12 = select i1 %11, i32 1, i32 2
br label %13
13: ; preds = %7, %2
%14 = phi i32 [ 0, %2 ], [ %12, %7 ]
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ strlen(char *);
uint8_t opdi_uint16_to_str(uint16_t value, char *msgBuf) {
  snprintf(msgBuf, 5, "%u", value);
  return strlen(msgBuf);
}


x86 assembly (clang, -O0):
<opdi_uint16_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x5,%esi
lea    0xebe(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opdi_uint16_to_str>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ecx
lea    0xed3(%rip),%rdx
mov    %rsi,%rdi
mov    $0x5,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <strlen@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @opdi_uint16_to_str(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = call i32 @snprintf(i8* %5, i32 5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @opdi_uint16_to_str(i32 %0, i8* %1) {
%3 = tail call i32 @snprintf(i8* %1, i32 5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @strlen(i8* %1)
ret i32 %4
}