xunge/DecIR huggingface dataset:
double eval_A(int i, int j) {
  return 1.0 / ((i + j) * (i + j + 1) / 2 + i + 1);
}


x86 assembly (clang, -O0):
<eval_A>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeca(%rip),%xmm0
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval_A>:
lea    (%rsi,%rdi,1),%eax
lea    (%rsi,%rdi,1),%ecx
add    $0x1,%ecx
imul   %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    %edi,%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeda(%rip),%xmm0
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @eval_A(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 = add nsw i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = mul nsw i32 %7, %11
%13 = sdiv i32 %12, 2
%14 = load i32, i32* %3
%15 = add nsw i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = sitofp i32 %16 to double
%18 = fdiv double 1.000000e+00, %17
ret double %18
}

LLVM IR (-O2):
define double @eval_A(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = add nsw i32 %3, 1
%5 = mul nsw i32 %4, %3
%6 = sdiv i32 %5, 2
%7 = add i32 %0, 1
%8 = add i32 %7, %6
%9 = sitofp i32 %8 to double
%10 = fdiv double 1.000000e+00, %9
ret double %10
}
extern int f() { return 3; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 3
}

LLVM IR (-O2):
define i32 @f() {
ret i32 3
}
/* Variables and functions */
scalar_t__ isdigit(int);
char tolower(int);
int hex_to_int(int chr) {
  return isdigit(chr) ? (chr - '0') : (tolower(chr) - 'a' + 10);
}


x86 assembly (clang, -O0):
<hex_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     114b <hex_to_int+0x2b>
mov    -0x4(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    115f <hex_to_int+0x3f>
mov    -0x4(%rbp),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_int>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
je     1132 <hex_to_int+0x12>
add    $0xffffffd0,%ebx
jmp    113f <hex_to_int+0x1f>
mov    %ebx,%edi
call   1040 <tolower@plt>
movsbl %al,%ebx
add    $0xffffffa9,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hex_to_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 48
br label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = call signext i8 @tolower(i32 %10)
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 97
%14 = add nsw i32 %13, 10
br label %15
15: ; preds = %9, %6
%16 = phi i32 [ %8, %6 ], [ %14, %9 ]
ret i32 %16
}

LLVM IR (-O2):
define i32 @hex_to_int(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add nsw i32 %0, -48
br label %10
6: ; preds = %1
%7 = tail call signext i8 @tolower(i32 %0)
%8 = sext i8 %7 to i32
%9 = add nsw i32 %8, -87
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %5, %4 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ boot_init_thread();
int /*<<< orphan*/ reschedule();
int /*<<< orphan*/ unmask_interrupt(int);
void __attribute__((noreturn)) thread_n_main(void) {
  boot_init_thread();
  unmask_interrupt(1);
  for (;;)
    reschedule();
}


x86 assembly (clang, -O0):
<thread_n_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <boot_init_thread@plt>
mov    $0x1,%edi
call   1050 <unmask_interrupt@plt>
mov    $0x0,%al
call   1030 <reschedule@plt>
jmp    1145 <thread_n_main+0x15>

x86 assembly (clang, -O2):
<thread_n_main>:
push   %rax
xor    %eax,%eax
call   1040 <boot_init_thread@plt>
mov    $0x1,%edi
call   1050 <unmask_interrupt@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <reschedule@plt>
jmp    1150 <thread_n_main+0x20>

LLVM IR (-O0):
define void @thread_n_main() {
%1 = call i32 (...) @boot_init_thread()
%2 = call i32 @unmask_interrupt(i32 1)
br label %3
3: ; preds = %3, %0
%4 = call i32 (...) @reschedule()
br label %3
}

LLVM IR (-O2):
define void @thread_n_main() {
%1 = tail call i32 (...) @boot_init_thread()
%2 = tail call i32 @unmask_interrupt(i32 1)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @reschedule()
br label %3
}
void InsertI4(unsigned char *buf, int x) {
  buf[0] = ((unsigned int)x) >> 24;
  buf[1] = ((unsigned int)x) >> 16;
  buf[2] = ((unsigned int)x) >> 8;
  buf[3] = ((unsigned int)x);
}


x86 assembly (clang, -O0):
<InsertI4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<InsertI4>:
bswap  %esi
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @InsertI4(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int fib1 = 13;
  int fib2 = 21;
  int fib3;
  printf("\n\nThe first numbers in the Fibonacci series are: \t0, 1, 1, 2, 3, "
         "5, 8, 13, 21.");
  fib3 = fib1 + fib2;
  fib1 = fib2 + fib3;
  fib2 = fib3 + fib1;
  printf("\nThe next three numbers in the series are: \t%d, %d, %d.\n\n", fib3,
         fib1, fib2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
movl   $0x15,-0xc(%rbp)
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xee9(%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    0xee8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf29(%rip),%rdi
mov    $0x22,%esi
mov    $0x37,%edx
mov    $0x59,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [79 x i8] c"\0A\0AThe first numbers in the Fibonacci series are: \090, 1, 1, 2, 3, 5, 8, 13, 21.\00"
@.str.1 = [58 x i8] c"\0AThe next three numbers in the series are: \09%d, %d, %d.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 13, i32* %2
store i32 21, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
store i32 %11, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = add nsw i32 %12, %13
store i32 %14, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [79 x i8] c"\0A\0AThe first numbers in the Fibonacci series are: \090, 1, 1, 2, 3, 5, 8, 13, 21.\00"
@.str.1 = [58 x i8] c"\0AThe next three numbers in the series are: \09%d, %d, %d.\0A\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0), i32 34, i32 55, i32 89)
ret i32 0
}
void snd_attack(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_drag_set_icon_pixbuf() {
ret void
}
unsigned long b_mem_allocate(unsigned long *mem, unsigned long nbr) {
  unsigned long tlong;
  asm volatile("call *0x00100040" : "=a"(*(mem)), "=c"(tlong) : "c"(nbr));
  return tlong;
}


x86 assembly (clang, -O0):
<b_mem_allocate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
call   *0x100040
mov    %rax,%rdx
mov    -0x20(%rbp),%rax
mov    %rdx,(%rax)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_mem_allocate>:
mov    %rsi,%rcx
call   *0x100040
mov    %rax,(%rdi)
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_mem_allocate(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 = load i64, i64* %4
%8 = call { i64, i64 } asm sideeffect "call *0x00100040", "={ax},={cx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %7)
%9 = extractvalue { i64, i64 } %8, 0
%10 = extractvalue { i64, i64 } %8, 1
store i64 %9, i64* %6
store i64 %10, i64* %5
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
define i64 @b_mem_allocate(i64* nocapture writeonly %0, i64 %1) {
%3 = tail call { i64, i64 } asm sideeffect "call *0x00100040", "={ax},={cx},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %1)
%4 = extractvalue { i64, i64 } %3, 0
%5 = extractvalue { i64, i64 } %3, 1
store i64 %4, i64* %0
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
void wrap_DlClose(sqlite3_vfs *pVfs, void *pHandle) { return; }


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

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

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

LLVM IR (-O2):
define void @wrap_DlClose(i32* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ openfileavatar();
void button_avatar_onpress(void) { openfileavatar(); }


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

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

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

LLVM IR (-O2):
define void @button_avatar_onpress() {
%1 = tail call i32 (...) @openfileavatar()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGHUP;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
void sighup() {
  signal(SIGHUP, sighup);
  printf("CHILD: I have received a SIGHUP\n");
}


x86 assembly (clang, -O0):
<sighup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rsi
call   1040 <signal@plt>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sighup>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rsi
call   1040 <signal@plt>
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@SIGHUP = global i32 0
@.str = [33 x i8] c"CHILD: I have received a SIGHUP\0A\00"
define void @sighup() {
%1 = load i32, i32* @SIGHUP
%2 = call i32 @signal(i32 %1, void (...)* bitcast (void ()* @sighup to void (...)*))
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIGHUP = global i32 0
@str = [32 x i8] c"CHILD: I have received a SIGHUP\00"
define void @sighup() {
%1 = load i32, i32* @SIGHUP
%2 = tail call i32 @signal(i32 %1, void (...)* bitcast (void ()* @sighup to void (...)*))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
int enclave_mkdir() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @enclave_mkdir() {
ret i32 0
}
int foo(int a) { return a + 7; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    0x7(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add nsw i32 %0, 7
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ pthread_t;
typedef scalar_t__ pid_t;

/* Variables and functions */
scalar_t__ getpid();
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ pthread_self();
int main() {
  pid_t pid;
  pid = getpid();
  pthread_t tid;
  tid = pthread_self();
  printf("pid = %d tid = %d\n", (int)pid, (int)tid);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xeb7(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"pid = %d tid = %d\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @getpid()
store i64 %3, i64* %1
%4 = call i64 (...) @pthread_self()
store i64 %4, i64* %2
%5 = load i64, i64* %1
%6 = trunc i64 %5 to i32
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"pid = %d tid = %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getpid()
%2 = tail call i64 (...) @pthread_self()
%3 = trunc i64 %1 to i32
%4 = trunc i64 %2 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ const *);
struct tm *gmtime_r(const time_t *timep, struct tm *result) {
  struct tm *s = gmtime(timep);
  if (s == NULL)
    return NULL;
  *result = *s;
  return result;
}


x86 assembly (clang, -O0):
<gmtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <gmtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1145 <gmtime_r+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1159 <gmtime_r+0x49>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <gmtime@plt>
test   %rax,%rax
je     1124 <gmtime_r+0x14>
mov    (%rax),%eax
mov    %eax,(%rbx)
jmp    1126 <gmtime_r+0x16>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @gmtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca %struct.tm*
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca %struct.tm*
store i32* %0, i32** %4
store %struct.tm* %1, %struct.tm** %5
%7 = load i32*, i32** %4
%8 = call %struct.tm* @gmtime(i32* %7)
store %struct.tm* %8, %struct.tm** %6
%9 = load %struct.tm*, %struct.tm** %6
%10 = icmp eq %struct.tm* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store %struct.tm* null, %struct.tm** %3
br label %18
12: ; preds = %2
%13 = load %struct.tm*, %struct.tm** %5
%14 = load %struct.tm*, %struct.tm** %6
%15 = bitcast %struct.tm* %13 to i8*
%16 = bitcast %struct.tm* %14 to i8*
%17 = load %struct.tm*, %struct.tm** %5
store %struct.tm* %17, %struct.tm** %3
br label %18
18: ; preds = %12, %11
%19 = load %struct.tm*, %struct.tm** %3
ret %struct.tm* %19
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @gmtime_r(i32* %0, %struct.tm* writeonly %1) {
%3 = tail call %struct.tm* @gmtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%7 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%8 = load i32, i32* %6
store i32 %8, i32* %7
br label %9
9: ; preds = %2, %5
%10 = phi %struct.tm* [ %1, %5 ], [ null, %2 ]
ret %struct.tm* %10
}
/* Variables and functions */
int /*<<< orphan*/ body();
int kkmode() { body(); }


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

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

LLVM IR (-O0):
define i32 @kkmode() {
%1 = alloca i32
%2 = call i32 (...) @body()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @kkmode() {
%1 = tail call i32 (...) @body()
ret i32 undef
}
__attribute__((unused)) char *__fconv(char *a) { return a; }


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

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

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

LLVM IR (-O2):
define i8* @__fconv(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int think(int ID) {
  printf("Philosoper [%d] is thinking... \n", ID);
  return 0;
}


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

x86 assembly (clang, -O2):
<think>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Philosoper [%d] is thinking... \0A\00"
define i32 @think(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Philosoper [%d] is thinking... \0A\00"
define i32 @think(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit;
int /*<<< orphan*/ syscall1(int /*<<< orphan*/, int);
void exit(int result) { syscall1(SYS_exit, result); }


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall1@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    %edi,%esi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall1@plt>

LLVM IR (-O0):
@SYS_exit = global i32 0
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_exit
%4 = load i32, i32* %2
%5 = call i32 @syscall1(i32 %3, i32 %4)
unreachable
}

LLVM IR (-O2):
@SYS_exit = global i32 0
define void @exit(i32 %0) {
%2 = load i32, i32* @SYS_exit
%3 = tail call i32 @syscall1(i32 %2, i32 %0)
unreachable
}
void d2i_ASN1_NULL(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_ASN1_NULL() {
ret void
}
int cmp1(const void *x, const void *y) {
  double xx = *(double *)x, yy = *(double *)y;
  if (xx < yy)
    return -1;
  if (xx > yy)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1146 <cmp1+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <cmp1+0x69>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1162 <cmp1+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <cmp1+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp1>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp1(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
store double %10, double* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to double*
%13 = load double, double* %12
store double %13, double* %7
%14 = load double, double* %6
%15 = load double, double* %7
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load double, double* %6
%20 = load double, double* %7
%21 = fcmp ogt double %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp1(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void release(void *ptr) {
  if (ptr) {
    free(ptr);
    ptr = NULL;
  }
}


x86 assembly (clang, -O0):
<release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <release+0x28>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release>:
test   %rdi,%rdi
je     111a <release+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @release(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
store i8* null, i8** %2
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @release(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void uncurry_noreturn(void *arg, void *fun) {
  register void *(*func)(void *) = fun;
  func(arg);
}


x86 assembly (clang, -O0):
<uncurry_noreturn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uncurry_noreturn>:
jmp    *%rsi

LLVM IR (-O0):
define void @uncurry_noreturn(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8* (i8*)*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i8* (i8*)*
store i8* (i8*)* %7, i8* (i8*)** %5
%8 = load i8* (i8*)*, i8* (i8*)** %5
%9 = load i8*, i8** %3
%10 = call i8* %8(i8* %9)
ret void
}

LLVM IR (-O2):
define void @uncurry_noreturn(i8* %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8* (i8*)*
%4 = tail call i8* %3(i8* %0)
ret void
}
int isLess(int x, int y) {
  int sign_x = (x >> 31) & 1;
  int sign_y = (y >> 31) & 1;
  int temp = (~x + y) >> 31;
  return (sign_x & !sign_y) | !(temp & 1) & (!(sign_y & !sign_x));
}


x86 assembly (clang, -O0):
<isLess>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1f,%eax
and    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
add    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmpl   $0x0,-0x10(%rbp)
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
mov    -0x14(%rbp),%ecx
and    $0x1,%ecx
cmp    $0x0,%ecx
setne  %cl
xor    $0xff,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    -0x10(%rbp),%edx
cmpl   $0x0,-0xc(%rbp)
setne  %sil
xor    $0xff,%sil
and    $0x1,%sil
movzbl %sil,%esi
and    %esi,%edx
cmp    $0x0,%edx
setne  %dl
xor    $0xff,%dl
and    $0x1,%dl
movzbl %dl,%edx
and    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLess>:
mov    %esi,%eax
not    %eax
mov    %eax,%ecx
and    %edi,%ecx
shr    $0x1f,%ecx
xor    %edx,%edx
cmp    %esi,%edi
setl   %dl
or     %edi,%eax
shr    $0x1f,%eax
and    %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @isLess(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = ashr i32 %8, 31
%10 = and i32 %9, 1
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = ashr i32 %11, 31
%13 = and i32 %12, 1
store i32 %13, i32* %6
%14 = load i32, i32* %3
%15 = xor i32 %14, -1
%16 = load i32, i32* %4
%17 = add nsw i32 %15, %16
%18 = ashr i32 %17, 31
store i32 %18, i32* %7
%19 = load i32, i32* %5
%20 = load i32, i32* %6
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
%24 = and i32 %19, %23
%25 = load i32, i32* %7
%26 = and i32 %25, 1
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
%29 = zext i1 %28 to i32
%30 = load i32, i32* %6
%31 = load i32, i32* %5
%32 = icmp ne i32 %31, 0
%33 = xor i1 %32, true
%34 = zext i1 %33 to i32
%35 = and i32 %30, %34
%36 = icmp ne i32 %35, 0
%37 = xor i1 %36, true
%38 = zext i1 %37 to i32
%39 = and i32 %29, %38
%40 = or i32 %24, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @isLess(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
%5 = lshr i32 %4, 31
%6 = icmp slt i32 %0, %1
%7 = zext i1 %6 to i32
%8 = or i32 %3, %0
%9 = lshr i32 %8, 31
%10 = and i32 %9, %7
%11 = or i32 %10, %5
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "usage: %s [options] input_file output_file\n", argv0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [options] input_file output_file\0A\00"
define void @usage(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 ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"usage: %s [options] input_file output_file\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
int /*<<< orphan*/ wscreenrect();
void basWScreenRect() { pushNumber(wscreenrect()); }


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

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

LLVM IR (-O0):
define void @basWScreenRect() {
%1 = call i32 (...) @wscreenrect()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basWScreenRect() {
%1 = tail call i32 (...) @wscreenrect()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float floorf(float x) { return __infer_nondet_float(); }


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

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

LLVM IR (-O0):
define float @floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call float (...) @__infer_nondet_float()
ret float %3
}

LLVM IR (-O2):
define float @floorf(float %0) {
%2 = tail call float (...) @__infer_nondet_float()
ret float %2
}
int test_imm_06int32_reg(int val) { return ((val) & (0x06 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_06int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_06int32_reg>:
test   $0x6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_06int32_reg(i32 %0) {
%2 = and i32 %0, 6
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
double pchisq(double, unsigned int const);
double LRT(const double lk0, const double lk1, const unsigned n0,
           const unsigned n1) {
  double delta = 2 * (lk1 - lk0);
  if (delta <= 0)
    return 1;
  return 1 - pchisq(delta, (n1 - n0));
}


x86 assembly (clang, -O0):
<LRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x28(%rbp),%xmm0
jb     1163 <LRT+0x53>
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1187 <LRT+0x77>
movsd  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%edi
sub    -0x1c(%rbp),%edi
call   1030 <pchisq@plt>
movaps %xmm0,%xmm1
movsd  0xe8a(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LRT>:
push   %rax
subsd  %xmm0,%xmm1
addsd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jae    1142 <LRT+0x32>
sub    %edi,%esi
movapd %xmm1,%xmm0
mov    %esi,%edi
call   1030 <pchisq@plt>
movapd %xmm0,%xmm1
movsd  0xec4(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret
movsd  0xeb6(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @LRT(double %0, double %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load double, double* %7
%12 = load double, double* %6
%13 = fsub double %11, %12
%14 = fmul double 2.000000e+00, %13
store double %14, double* %10
%15 = load double, double* %10
%16 = fcmp ole double %15, 0.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %4
store double 1.000000e+00, double* %5
br label %25
18: ; preds = %4
%19 = load double, double* %10
%20 = load i32, i32* %9
%21 = load i32, i32* %8
%22 = sub i32 %20, %21
%23 = call double @pchisq(double %19, i32 %22)
%24 = fsub double 1.000000e+00, %23
store double %24, double* %5
br label %25
25: ; preds = %18, %17
%26 = load double, double* %5
ret double %26
}

LLVM IR (-O2):
define double @LRT(double %0, double %1, i32 %2, i32 %3) {
%5 = fsub double %1, %0
%6 = fmul double %5, 2.000000e+00
%7 = fcmp ugt double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = sub i32 %3, %2
%10 = tail call double @pchisq(double %6, i32 %9)
%11 = fsub double 1.000000e+00, %10
br label %12
12: ; preds = %4, %8
%13 = phi double [ %11, %8 ], [ 1.000000e+00, %4 ]
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ write(int, void *, size_t);
void ft_putmemchar_fd(void *ptr, size_t n, int fd) { write(fd, ptr, n); }


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

x86 assembly (clang, -O2):
<ft_putmemchar_fd>:
mov    %edx,%eax
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putmemchar_fd(i8* nocapture %0, i64 %1, i32 %2) {
%4 = tail call i32 @write(i32 %2, i8* %0, i64 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_path_from_pid(int, char *);
char *malloc(int);
int /*<<< orphan*/ overlay(char *);
int secapp_ovl_by_pid(int pid) {
  char *path;
  path = malloc(1024 * sizeof(char));
  get_path_from_pid(pid, path);
  overlay(path);
}


x86 assembly (clang, -O0):
<secapp_ovl_by_pid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <get_path_from_pid@plt>
mov    -0x10(%rbp),%rdi
call   1030 <overlay@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<secapp_ovl_by_pid>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
mov    %rax,%rsi
call   1040 <get_path_from_pid@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <overlay@plt>

LLVM IR (-O0):
define i32 @secapp_ovl_by_pid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
%5 = call i8* @malloc(i32 1024)
store i8* %5, i8** %4
%6 = load i32, i32* %3
%7 = load i8*, i8** %4
%8 = call i32 @get_path_from_pid(i32 %6, i8* %7)
%9 = load i8*, i8** %4
%10 = call i32 @overlay(i8* %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @secapp_ovl_by_pid(i32 %0) {
%2 = tail call dereferenceable_or_null(1024) i8* @malloc(i32 1024)
%3 = tail call i32 @get_path_from_pid(i32 %0, i8* %2)
%4 = tail call i32 @overlay(i8* %2)
ret i32 undef
}
char *strcopy(char *dst, const char *str) {
  while (*str)
    *dst++ = *str++;
  return dst;
}


x86 assembly (clang, -O0):
<strcopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <strcopy+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <strcopy+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcopy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1121 <strcopy+0x21>
add    $0x1,%rsi
nopl   (%rax)
mov    %cl,(%rax)
add    $0x1,%rax
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <strcopy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcopy(i8* writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
ret i8* %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void print_comment(FILE *out, const char *comment) {
  fprintf(out,
          "\n//"
          "--------------------------------------------------------------------"
          "-------\n// "
          "%s\n//"
          "--------------------------------------------------------------------"
          "-------\n\n",
          comment);
}


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

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

LLVM IR (-O0):
@.str = [165 x i8] c"\0A//---------------------------------------------------------------------------\0A// %s\0A//---------------------------------------------------------------------------\0A\0A\00"
define void @print_comment(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [165 x i8] c"\0A//---------------------------------------------------------------------------\0A// %s\0A//---------------------------------------------------------------------------\0A\0A\00"
define void @print_comment(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_t0();
void write_0() { write_t0(); }


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

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

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

LLVM IR (-O2):
define void @write_0() {
%1 = tail call i32 (...) @write_t0()
ret void
}
void tdata_gtfsrt_not_available() {}


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

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

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

LLVM IR (-O2):
define void @tdata_gtfsrt_not_available() {
ret void
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
size_t strlen(char const *);
char *xstrdup(const char *s) {
  size_t n = strlen(s);
  char *p = malloc(n + 1);
  memcpy(p, s, n);
  p[n] = '\0';
  return p;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %rax,%r15
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strlen(i8* %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = add i64 %7, 1
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %4
%10 = load i8*, i8** %4
%11 = load i8*, i8** %2
%12 = load i64, i64* %3
%13 = call i32 @memcpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %4
%15 = load i64, i64* %3
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i64 %2)
%6 = getelementptr inbounds i8, i8* %4, i64 %2
store i8 0, i8* %6
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int do_test() { printf("Module WOOOOOORRRRRRKK!\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Module WOOOOOORRRRRRKK!\0A\00"
define i32 @do_test() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [24 x i8] c"Module WOOOOOORRRRRRKK!\00"
define i32 @do_test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_57uint8_reg(unsigned char val) {
  return ((val) & (-0x57 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_57uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffa9,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_57uint8_reg>:
test   $0xa9,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_57uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -87
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FUTEX_WAIT;
int __futex(void volatile *, int /*<<< orphan*/, int, struct timespec const *,
            int /*<<< orphan*/);
int __futex_wait(volatile void *ftx, int value,
                 const struct timespec *timeout) {
  return __futex(ftx, FUTEX_WAIT, value, timeout, 0);
}


x86 assembly (clang, -O0):
<__futex_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <__futex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__futex_wait>:
mov    %rdx,%rcx
mov    %esi,%edx
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
xor    %r8d,%r8d
jmp    1030 <__futex@plt>

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

LLVM IR (-O2):
%struct.timespec = type { i32 }
@FUTEX_WAIT = global i32 0
define i32 @__futex_wait(i8* %0, i32 %1, %struct.timespec* %2) {
%4 = load i32, i32* @FUTEX_WAIT
%5 = tail call i32 @__futex(i8* %0, i32 %4, i32 %1, %struct.timespec* %2, i32 0)
ret i32 %5
}