xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ make_r_type_inst(int, int, int, int);
int /*<<< orphan*/ store_instruction(int /*<<< orphan*/);
void r_type_inst(int opcode, int rd, int rs, int rt) {
  store_instruction(make_r_type_inst(opcode, rd, rs, rt));
}


x86 assembly (clang, -O0):
<r_type_inst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <make_r_type_inst@plt>
mov    %eax,%edi
call   1040 <store_instruction@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_type_inst>:
push   %rax
call   1030 <make_r_type_inst@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <store_instruction@plt>

LLVM IR (-O0):
define void @r_type_inst(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @make_r_type_inst(i32 %9, i32 %10, i32 %11, i32 %12)
%14 = call i32 @store_instruction(i32 %13)
ret void
}

LLVM IR (-O2):
define void @r_type_inst(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @make_r_type_inst(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @store_instruction(i32 %5)
ret void
}
int test_imm_7Cint16_mem(short *val) {
  return ((*val) & (-0x7C << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_7Cint16_mem>:
movzwl (%rdi),%eax
test   $0xff84,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_7Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -124
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void max(int x, int y, int z, int *maxx) {
  *maxx = x > y ? (x > z ? x : z) : (y > z ? y : z);
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1145 <max+0x45>
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1134 <max+0x34>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <max+0x3a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    1168 <max+0x68>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    115c <max+0x5c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    1162 <max+0x62>
mov    -0xc(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
cmp    %edx,%edi
cmovg  %edi,%edx
cmp    %esi,%edx
cmovle %esi,%edx
mov    %edx,(%rcx)
ret

LLVM IR (-O0):
define void @max(i32 %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp sgt i32 %9, %10
br i1 %11, label %12, label %22
12: ; preds = %4
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = icmp sgt i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = load i32, i32* %5
br label %20
18: ; preds = %12
%19 = load i32, i32* %7
br label %20
20: ; preds = %18, %16
%21 = phi i32 [ %17, %16 ], [ %19, %18 ]
br label %32
22: ; preds = %4
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = icmp sgt i32 %23, %24
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = load i32, i32* %6
br label %30
28: ; preds = %22
%29 = load i32, i32* %7
br label %30
30: ; preds = %28, %26
%31 = phi i32 [ %27, %26 ], [ %29, %28 ]
br label %32
32: ; preds = %30, %20
%33 = phi i32 [ %21, %20 ], [ %31, %30 ]
%34 = load i32*, i32** %8
store i32 %33, i32* %34
ret void
}

LLVM IR (-O2):
define void @max(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %0, i32 %2
%7 = icmp sgt i32 %6, %1
%8 = select i1 %7, i32 %6, i32 %1
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bsdthread_create();
void ft_threadcreate(void) { bsdthread_create(); }


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

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

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

LLVM IR (-O2):
define void @ft_threadcreate() {
%1 = tail call i32 (...) @bsdthread_create()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void stub1();
void regSet() {
  volatile uint32_t *entry = (uint32_t *)0x1FFFFFF8;
  *((volatile uint32_t *)0x10202240) = 0x39;
  *((volatile uint32_t *)0x10202A40) = 0x39;
  *entry = 0;
  while (!*entry)
    ;
  ((void (*)()) * entry)();
}


x86 assembly (clang, -O0):
<regSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1ffffff8,%eax
mov    %rax,-0x8(%rbp)
mov    $0x10202240,%eax
movl   $0x39,(%rax)
mov    $0x10202a40,%eax
movl   $0x39,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114c <regSet+0x4c>
jmp    1151 <regSet+0x51>
jmp    1131 <regSet+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
movslq %eax,%rcx
mov    $0x0,%al
call   *%rcx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<regSet>:
movl   $0x39,0x10202240
movl   $0x39,0x10202a40
movl   $0x0,0x1ffffff8
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,0x1ffffff8
je     1130 <regSet+0x30>
movslq 0x1ffffff8,%rcx
1f
xor    %eax,%eax
jmp    *%rcx

LLVM IR (-O0):
define void @regSet() {
%1 = alloca i32*
store i32* inttoptr (i64 536870904 to i32*), i32** %1
store volatile i32 57, i32* inttoptr (i64 270541376 to i32*)
store volatile i32 57, i32* inttoptr (i64 270543424 to i32*)
%2 = load i32*, i32** %1
store volatile i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32*, i32** %1
%5 = load volatile i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32*, i32** %1
%11 = load volatile i32, i32* %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to void (...)*
ret void
}

LLVM IR (-O2):
define void @regSet() {
store volatile i32 57, i32* inttoptr (i64 270541376 to i32*)
store volatile i32 57, i32* inttoptr (i64 270543424 to i32*)
store volatile i32 0, i32* inttoptr (i64 536870904 to i32*)
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 536870904 to i32*)
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = load volatile i32, i32* inttoptr (i64 536870904 to i32*)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to void (...)*
tail call void (...) %7()
ret void
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
uint32_t align(size_t x, size_t pow2) {
  size_t r = x & (pow2 - 1);
  if (!r)
    return 0;
  return pow2 - r;
}


x86 assembly (clang, -O0):
<align>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1137 <align+0x37>
movq   $0x0,-0x8(%rbp)
jmp    1143 <align+0x43>
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align>:
lea    -0x1(%rsi),%rax
and    %rdi,%rax
sub    %rax,%rsi
test   %rax,%rax
cmovne %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @align(i64 %0, i64 %1) {
%3 = add i64 %1, -1
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, 0
%6 = sub i64 %1, %4
%7 = select i1 %5, i64 0, i64 %6
ret i64 %7
}
int main(int argc, char **argv) {
  int i = 0, x = 0;
  asm volatile("int3");
  asm volatile("int3");
  for (i = 0; i < 10; i++)
    x = x + 1;
  asm volatile("int3");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
int3
int3
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    114a <main+0x4a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <main+0x29>
int3
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int3", "~{dirflag},~{fpsr},~{flags}"()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stop_rpc();
void terminate(int signo) {
  stop_rpc();
  exit(0);
}


x86 assembly (clang, -O0):
<terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <stop_rpc@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<terminate>:
push   %rax
xor    %eax,%eax
call   1030 <stop_rpc@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @stop_rpc()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @terminate(i32 %0) {
%2 = tail call i32 (...) @stop_rpc()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ get_next_argpl(char ***, char *);
int get_next_argpi(char ***argv, char *arg) {
  return (int)get_next_argpl(argv, arg);
}


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

x86 assembly (clang, -O2):
<get_next_argpi>:
jmp    1030 <get_next_argpl@plt>

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

LLVM IR (-O2):
define i32 @get_next_argpi(i8*** %0, i8* %1) {
%3 = tail call i64 @get_next_argpl(i8*** %0, i8* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ BDP_SUB_CHECK();
void bdp_sub_check() { BDP_SUB_CHECK(); }


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

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

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

LLVM IR (-O2):
define void @bdp_sub_check() {
%1 = tail call i32 (...) @BDP_SUB_CHECK()
ret void
}
void f16() {}


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

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

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

LLVM IR (-O2):
define void @f16() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t read16(uint8_t *buf) {
  return (uint16_t)buf[0] | ((uint16_t)buf[1] << 8);
}


x86 assembly (clang, -O0):
<read16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read16>:
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read16(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = getelementptr inbounds i64, i64* %3, i64 0
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 8
%12 = or i32 %6, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @read16(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
ret i32 %8
}
unsigned _hash_combine(unsigned x, unsigned y) {
  unsigned hash = ((2166136261U) * 16777619U);
  hash ^= x;
  hash = ((hash)*16777619U);
  hash ^= y;
  return hash;
}


x86 assembly (clang, -O0):
<_hash_combine>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x50c5d1f,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
imul   $0x1000193,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hash_combine>:
xor    $0x50c5d1f,%edi
imul   $0x1000193,%edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @_hash_combine(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 84696351, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %5
%8 = xor i32 %7, %6
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = mul i32 %9, 16777619
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = xor i32 %12, %11
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @_hash_combine(i32 %0, i32 %1) {
%3 = xor i32 %0, 84696351
%4 = mul i32 %3, 16777619
%5 = xor i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Clear();
int /*<<< orphan*/ system(char *);
int main(void) {
  Clear();
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Clear@plt>
lea    0xece(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = call i32 (...) @Clear()
%2 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 (...) @Clear()
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void clear_response_reg(uint32_t *emmc) {
  *(emmc + 0x10 / 4) = 0x0;
  *(emmc + 0x14 / 4) = 0x0;
  *(emmc + 0x18 / 4) = 0x0;
  *(emmc + 0x1C / 4) = 0x0;
}


x86 assembly (clang, -O0):
<clear_response_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x10(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x14(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x18(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_response_reg>:
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rdi)
ret

LLVM IR (-O0):
define void @clear_response_reg(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 4
store i32 0, i32* %4
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 5
store i32 0, i32* %6
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 6
store i32 0, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 7
store i32 0, i32* %10
ret void
}

LLVM IR (-O2):
define void @clear_response_reg(i32* nocapture writeonly %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = bitcast i32* %2 to i8*
ret void
}
/* Variables and functions */
int rand();
int getRandom(void) {
  int target = (rand() % (100 - 10 + 1)) + 10;
  return target;
}


x86 assembly (clang, -O0):
<getRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x5b,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandom>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0xffffffffb40b40b5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x5b,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getRandom() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 91
%4 = add nsw i32 %3, 10
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @getRandom() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 91
%3 = add nsw i32 %2, 10
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void my_thread(void) {
  printf("in my_thread\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"in my_thread\00"
define void @my_thread() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void blink_dummy_func(void) {
  static int i;
  printf("blink_dummy_func: Counter = %d\n", i++);
}


x86 assembly (clang, -O0):
<blink_dummy_func>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f12(%rip),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,0x2f07(%rip)
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink_dummy_func>:
mov    0x2f16(%rip),%esi
lea    0x1(%rsi),%eax
mov    %eax,0x2f0d(%rip)
lea    0xeda(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@blink_dummy_func.i = internal global i32 0
@.str = [32 x i8] c"blink_dummy_func: Counter = %d\0A\00"
define void @blink_dummy_func() {
%1 = load i32, i32* @blink_dummy_func.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @blink_dummy_func.i
%3 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@blink_dummy_func.i = internal unnamed_addr global i32 0
@.str = [32 x i8] c"blink_dummy_func: Counter = %d\0A\00"
define void @blink_dummy_func() {
%1 = load i32, i32* @blink_dummy_func.i
%2 = add nsw i32 %1, 1
store i32 %2, i32* @blink_dummy_func.i
%3 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double rand01() { return ((double)rand() / RAND_MAX); }


x86 assembly (clang, -O0):
<rand01>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand01>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand01() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = load double, double* @RAND_MAX
%4 = fdiv double %2, %3
ret double %4
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int syscall(int, void *, int, int, struct timespec *, void *, int);
int sys_futex(void *addr1, int op, int val1, struct timespec *timeout,
              void *addr2, int val3) {
  return syscall(202, addr1, op, val1, timeout, addr2, val3);
}


x86 assembly (clang, -O0):
<sys_futex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    $0xca,%edi
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_futex>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    %r9d,(%rsp)
mov    $0xca,%edi
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @sys_futex(i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.timespec* %3, %struct.timespec** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load %struct.timespec*, %struct.timespec** %10
%17 = load i8*, i8** %11
%18 = load i32, i32* %12
%19 = call i32 @syscall(i32 202, i8* %13, i32 %14, i32 %15, %struct.timespec* %16, i8* %17, i32 %18)
ret i32 %19
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @sys_futex(i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5) {
%7 = tail call i32 @syscall(i32 202, i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5)
ret i32 %7
}
int test2(int *a) {
  a = __builtin_assume_aligned(a, 32, 0);
  return a[0];
}


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

x86 assembly (clang, -O2):
<test2>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @test2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = bitcast i32* %3 to i8*
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @test2(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = load i32, i32* %0
ret i32 %3
}
float back_out(float step, float max_steps, float max_val) {
  float s = 1.70158f;
  float ratio = (step / max_steps) - 1;
  return max_val * (ratio * ratio * ((s + 1) * ratio + s) + 1);
}


x86 assembly (clang, -O0):
<back_out>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xee9(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
movss  0xece(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
mulss  -0x14(%rbp),%xmm1
movss  0xeae(%rip),%xmm2
addss  -0x10(%rbp),%xmm2
movss  -0x14(%rbp),%xmm4
movss  -0x10(%rbp),%xmm3
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
mulss  %xmm2,%xmm1
movss  0xe8b(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<back_out>:
divss  %xmm1,%xmm0
addss  0xef4(%rip),%xmm0
movaps %xmm0,%xmm1
mulss  %xmm0,%xmm1
mulss  0xee9(%rip),%xmm0
addss  0xee5(%rip),%xmm0
mulss  %xmm1,%xmm0
addss  0xedd(%rip),%xmm0
mulss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @back_out(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
store float 0x3FFB39AC00000000, float* %7
%9 = load float, float* %4
%10 = load float, float* %5
%11 = fdiv float %9, %10
%12 = fsub float %11, 1.000000e+00
store float %12, float* %8
%13 = load float, float* %6
%14 = load float, float* %8
%15 = load float, float* %8
%16 = fmul float %14, %15
%17 = load float, float* %7
%18 = fadd float %17, 1.000000e+00
%19 = load float, float* %8
%20 = load float, float* %7
%21 = call float @llvm.fmuladd.f32(float %18, float %19, float %20)
%22 = call float @llvm.fmuladd.f32(float %16, float %21, float 1.000000e+00)
%23 = fmul float %13, %22
ret float %23
}

LLVM IR (-O2):
define float @back_out(float %0, float %1, float %2) {
%4 = fdiv float %0, %1
%5 = fadd float %4, -1.000000e+00
%6 = fmul float %5, %5
%7 = tail call float @llvm.fmuladd.f32(float %5, float 0x40059CD600000000, float 0x3FFB39AC00000000)
%8 = tail call float @llvm.fmuladd.f32(float %6, float %7, float 1.000000e+00)
%9 = fmul float %8, %2
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, char *);
char *MP(int ProbeSequenceNumber, char *Payload) {
  static char str[32100];
  sprintf(str, "m %d %s\n", ProbeSequenceNumber, Payload);
  return str;
}


x86 assembly (clang, -O0):
<MP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0x2f13(%rip),%rdi
lea    0xecc(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f00(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MP>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%edx
lea    0x2f23(%rip),%rbx
lea    0xedc(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@MP.str = internal global [32100 x i8] zeroinitializer
@.str = [9 x i8] c"m %d %s\0A\00"
define i8* @MP(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 @sprintf(i8* getelementptr inbounds ([32100 x i8], [32100 x i8]* @MP.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret i8* getelementptr inbounds ([32100 x i8], [32100 x i8]* @MP.str, i64 0, i64 0)
}

LLVM IR (-O2):
@MP.str = internal global [32100 x i8] zeroinitializer
@.str = [9 x i8] c"m %d %s\0A\00"
define i8* @MP(i32 %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32100 x i8], [32100 x i8]* @MP.str, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret i8* getelementptr inbounds ([32100 x i8], [32100 x i8]* @MP.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ curs_clear();
int /*<<< orphan*/ curs_refresh();
void wipe_all(void) {
  curs_clear();
  curs_refresh();
}


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

x86 assembly (clang, -O2):
<wipe_all>:
push   %rax
xor    %eax,%eax
call   1030 <curs_clear@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <curs_refresh@plt>

LLVM IR (-O0):
define void @wipe_all() {
%1 = call i32 (...) @curs_clear()
%2 = call i32 (...) @curs_refresh()
ret void
}

LLVM IR (-O2):
define void @wipe_all() {
%1 = tail call i32 (...) @curs_clear()
%2 = tail call i32 (...) @curs_refresh()
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode *arrayToBST(int *, int /*<<< orphan*/, int);
struct TreeNode *sortedArrayToBST(int *nums, int numsSize) {
  return arrayToBST(nums, 0, numsSize - 1);
}


x86 assembly (clang, -O0):
<sortedArrayToBST>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <arrayToBST@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortedArrayToBST>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <arrayToBST@plt>

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @sortedArrayToBST(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 = sub nsw i32 %6, 1
%8 = call %struct.TreeNode* @arrayToBST(i32* %5, i32 0, i32 %7)
ret %struct.TreeNode* %8
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode* @sortedArrayToBST(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call %struct.TreeNode* @arrayToBST(i32* %0, i32 0, i32 %3)
ret %struct.TreeNode* %4
}
I0AR1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (22 <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<I0AR1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    $0x16,%eax
cmp    0x10f444(%rcx),%eax
jg     1139 <I0AR1+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1140 <I0AR1+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I0AR1>:
xor    %eax,%eax
cmpl   $0x16,0x10f444(%r9)
16
setge  %al
ret

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

LLVM IR (-O2):
define i32 @I0AR1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = getelementptr inbounds i32, i32* %5, i64 277777
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 21
%10 = zext i1 %9 to i32
ret i32 %10
}
int _cmpatom(const void *x, const void *y) { return x != y; }


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

x86 assembly (clang, -O2):
<_cmpatom>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

LLVM IR (-O0):
define i32 @_cmpatom(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp ne i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @_cmpatom(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float sinf_c(float);
float cosf_c(float x) { return sinf_c(x + 1.57079632679489661923); }


x86 assembly (clang, -O0):
<cosf_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sinf_c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cosf_c>:
cvtss2sd %xmm0,%xmm0
addsd  0xee4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
jmp    1030 <sinf_c@plt>

LLVM IR (-O0):
define float @cosf_c(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fadd double %4, 0x3FF921FB54442D18
%6 = fptrunc double %5 to float
%7 = call float @sinf_c(float %6)
ret float %7
}

LLVM IR (-O2):
define float @cosf_c(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, 0x3FF921FB54442D18
%4 = fptrunc double %3 to float
%5 = tail call float @sinf_c(float %4)
ret float %5
}
/* Type definitions */
struct wsgi_request {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ uwsgi_num2str2(int, char *);
int uwsgi_response_prepare_headers(struct wsgi_request *, char *, int);
int uwsgi_response_prepare_headers_int(struct wsgi_request *wsgi_req,
                                       int status) {
  char status_str[11];
  uwsgi_num2str2(status, status_str);
  return uwsgi_response_prepare_headers(wsgi_req, status_str, 3);
}


x86 assembly (clang, -O0):
<uwsgi_response_prepare_headers_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x17(%rbp),%rsi
call   1040 <uwsgi_num2str2@plt>
mov    -0x8(%rbp),%rdi
lea    -0x17(%rbp),%rsi
mov    $0x3,%edx
call   1030 <uwsgi_response_prepare_headers@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_response_prepare_headers_int>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xd(%rsp),%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1040 <uwsgi_num2str2@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
call   1030 <uwsgi_response_prepare_headers@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.wsgi_request = type { i32 }
define i32 @uwsgi_response_prepare_headers_int(%struct.wsgi_request* %0, i32 %1) {
%3 = alloca %struct.wsgi_request*
%4 = alloca i32
%5 = alloca [11 x i8]
store %struct.wsgi_request* %0, %struct.wsgi_request** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%8 = call i32 @uwsgi_num2str2(i32 %6, i8* %7)
%9 = load %struct.wsgi_request*, %struct.wsgi_request** %3
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%11 = call i32 @uwsgi_response_prepare_headers(%struct.wsgi_request* %9, i8* %10, i32 3)
ret i32 %11
}

LLVM IR (-O2):
%struct.wsgi_request = type { i32 }
define i32 @uwsgi_response_prepare_headers_int(%struct.wsgi_request* %0, i32 %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = call i32 @uwsgi_num2str2(i32 %1, i8* %4)
%6 = call i32 @uwsgi_response_prepare_headers(%struct.wsgi_request* %0, i8* %4, i32 3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_ccf(void) { op_write1(0x3f); }


x86 assembly (clang, -O0):
<op_enc_ccf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f,%edi
call   1030 <op_write1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_enc_ccf>:
mov    $0x3f,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_ccf() {
%1 = call i32 @op_write1(i32 63)
ret void
}

LLVM IR (-O2):
define void @op_enc_ccf() {
%1 = tail call i32 @op_write1(i32 63)
ret void
}
void func_e() {
  int i;
  for (i = 0; i < 5 * (1000 * 1000); i++) {
  }
}


x86 assembly (clang, -O0):
<func_e>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x4c4b40,-0x4(%rbp)
jge    112b <func_e+0x2b>
jmp    111d <func_e+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <func_e+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func_e() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 5000000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @func_e() {
ret void
}
int test_imm_69uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x69,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_69uint64_highword_reg>:
movabs $0x6900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_69uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 105
%6 = icmp ne i64 %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_69uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 450971566080
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double pair_tailcorr_switch3_chargetransferslater1s1s(void *pair_data,
                                                      long center_index,
                                                      long other_index,
                                                      double rcut,
                                                      double width) {
  double t1 = 0;
  return t1;
}


x86 assembly (clang, -O0):
<pair_tailcorr_switch3_chargetransferslater1s1s>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_tailcorr_switch3_chargetransferslater1s1s>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @pair_tailcorr_switch3_chargetransferslater1s1s(i8* %0, i64 %1, i64 %2, double %3, double %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i8* %0, i8** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store double %3, double* %9
store double %4, double* %10
store double 0.000000e+00, double* %11
%12 = load double, double* %11
ret double %12
}

LLVM IR (-O2):
define double @pair_tailcorr_switch3_chargetransferslater1s1s(i8* nocapture readnone %0, i64 %1, i64 %2, double %3, double %4) {
ret double 0.000000e+00
}
void do_while_2_Bad() {
  int count = 10;
  int a[count];
  int i = 0;
  do {
    a[i] = 0;
  } while (i++ < count);
}


x86 assembly (clang, -O0):
<do_while_2_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1c(%rbp)
cmp    -0x4(%rbp),%eax
jl     113d <do_while_2_Bad+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @do_while_2_Bad() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i32
store i32 10, i32* %1
%5 = load i32, i32* %1
%6 = zext i32 %5 to i64
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %2
%8 = alloca i32, i64 %6
store i64 %6, i64* %3
store i32 0, i32* %4
br label %9
9: ; preds = %13, %0
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %8, i64 %11
store i32 0, i32* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
%16 = load i32, i32* %1
%17 = icmp slt i32 %14, %16
br i1 %17, label %9, label %18
18: ; preds = %13
%19 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @do_while_2_Bad() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ progress_bar(int);
void progress(int maxvalue, int progress) {
  static int last_value, value;
  value = (progress * 100) / maxvalue;
  if (value != last_value)
    progress_bar(value);
  last_value = value;
}


x86 assembly (clang, -O0):
<progress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x64,-0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,0x2f04(%rip)
mov    0x2efe(%rip),%eax
cmp    0x2ef4(%rip),%eax
je     1149 <progress+0x39>
mov    0x2eec(%rip),%edi
call   1030 <progress_bar@plt>
mov    0x2ee1(%rip),%eax
mov    %eax,0x2ed7(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<progress>:
push   %rax
imul   $0x64,%esi,%eax
cltd
idiv   %edi
mov    %eax,0x2f13(%rip)
cmp    0x2f09(%rip),%eax
je     1132 <progress+0x22>
mov    %eax,%edi
call   1030 <progress_bar@plt>
mov    0x2efe(%rip),%eax
mov    %eax,0x2ef4(%rip)
pop    %rax
ret

LLVM IR (-O0):
@progress.last_value = internal global i32 0
@progress.value = internal global i32 0
define void @progress(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 100
%7 = load i32, i32* %3
%8 = sdiv i32 %6, %7
store i32 %8, i32* @progress.value
%9 = load i32, i32* @progress.value
%10 = load i32, i32* @progress.last_value
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load i32, i32* @progress.value
%14 = call i32 @progress_bar(i32 %13)
br label %15
15: ; preds = %12, %2
%16 = load i32, i32* @progress.value
store i32 %16, i32* @progress.last_value
ret void
}

LLVM IR (-O2):
@progress.last_value = internal unnamed_addr global i32 0
@progress.value = internal unnamed_addr global i32 0
define void @progress(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, 100
%4 = sdiv i32 %3, %0
store i32 %4, i32* @progress.value
%5 = load i32, i32* @progress.last_value
%6 = icmp eq i32 %4, %5
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = tail call i32 @progress_bar(i32 %4)
%9 = load i32, i32* @progress.value
br label %10
10: ; preds = %7, %2
%11 = phi i32 [ %9, %7 ], [ %4, %2 ]
store i32 %11, i32* @progress.last_value
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freep(void **ptrp) {
  if (*ptrp != 0) {
    free(*ptrp);
    *ptrp = 0;
  }
}


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

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

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

LLVM IR (-O2):
define void @freep(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free(i8* %2)
store i8* null, i8** %0
br label %6
6: ; preds = %4, %1
ret void
}
int maxi(int a, int b) {
  if (a < b)
    return b;
  else
    return a;
}


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

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

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

LLVM IR (-O2):
define i32 @maxi(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *runtime_alloc(void *that, size_t bytes) { return malloc(bytes); }


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

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

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

LLVM IR (-O2):
define noalias i8* @runtime_alloc(i8* nocapture readnone %0, i64 %1) {
%3 = tail call i8* @malloc(i64 %1)
ret i8* %3
}
int saturate(int x) { return x < 0 ? 0 : (x > 255 ? 255 : x); }


x86 assembly (clang, -O0):
<saturate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111b <saturate+0x1b>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <saturate+0x41>
cmpl   $0xff,-0x4(%rbp)
jle    1135 <saturate+0x35>
mov    $0xff,%eax
mov    %eax,-0xc(%rbp)
jmp    113b <saturate+0x3b>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saturate>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @saturate(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}