xunge/DecIR huggingface dataset:
int fib(int x) {
  if (x <= 1)
    return x;
  return fib(x - 1) + fib(x - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1130 <fib+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <fib+0x43>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1120 <fib+0x10>
mov    %ebx,%ecx
jmp    1144 <fib+0x34>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <fib+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

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


x86 assembly (clang, -O0):
<Joy_Beta_Fire2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <Joy_Beta_Fire2+0x24>
mov    $0x65,%edi
call   1030 <cpc_key_press@plt>
jmp    114e <Joy_Beta_Fire2+0x2e>
mov    $0x65,%edi
call   1040 <cpc_key_unpress@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Joy_Beta_Fire2>:
test   %edi,%edi
je     112e <Joy_Beta_Fire2+0xe>
mov    $0x65,%edi
jmp    1030 <cpc_key_press@plt>
mov    $0x65,%edi
jmp    1040 <cpc_key_unpress@plt>

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

LLVM IR (-O2):
define void @Joy_Beta_Fire2(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @cpc_key_press(i32 101)
br label %7
5: ; preds = %1
%6 = tail call i32 @cpc_key_unpress(i32 101)
br label %7
7: ; preds = %5, %3
ret void
}
int do_563() { return 563; }


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

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

LLVM IR (-O0):
define i32 @do_563() {
ret i32 563
}

LLVM IR (-O2):
define i32 @do_563() {
ret i32 563
}
void gtk_invisible_set_screen() {}


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

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

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

LLVM IR (-O2):
define void @gtk_invisible_set_screen() {
ret void
}
void foo561() {}


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

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

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

LLVM IR (-O2):
define void @foo561() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ flick_reg(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int);
void i_rox_reg(void) { flick_reg("ro", 0, 0, 0, 1); }


x86 assembly (clang, -O0):
<i_rox_reg>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <flick_reg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_rox_reg>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <flick_reg@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"ro\00"
define void @i_rox_reg() {
%1 = call i32 @flick_reg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"ro\00"
define void @i_rox_reg() {
%1 = tail call i32 @flick_reg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0, i32 0, i32 0, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(unsigned int, int /*<<< orphan*/ *);
void PutLong(unsigned int *val, FILE *fp) {
  fputc(*val & 0xFF, fp);
  fputc((*val >> 0x08) & 0xFF, fp);
  fputc((*val >> 0x10) & 0xFF, fp);
  fputc((*val >> 0x18) & 0xFF, fp);
}


x86 assembly (clang, -O0):
<PutLong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
shr    $0x8,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
shr    $0x10,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
shr    $0x18,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutLong>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movzbl (%rdi),%edi
call   1030 <fputc@plt>
movzbl 0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl 0x2(%rbx),%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl 0x3(%rbx),%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @PutLong(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* %5
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = call i32 @fputc(i32 %7, i32* %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
%14 = load i32*, i32** %4
%15 = call i32 @fputc(i32 %13, i32* %14)
%16 = load i32*, i32** %3
%17 = load i32, i32* %16
%18 = lshr i32 %17, 16
%19 = and i32 %18, 255
%20 = load i32*, i32** %4
%21 = call i32 @fputc(i32 %19, i32* %20)
%22 = load i32*, i32** %3
%23 = load i32, i32* %22
%24 = lshr i32 %23, 24
%25 = and i32 %24, 255
%26 = load i32*, i32** %4
%27 = call i32 @fputc(i32 %25, i32* %26)
ret void
}

LLVM IR (-O2):
define void @PutLong(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, 255
%5 = tail call i32 @fputc(i32 %4, i32* %1)
%6 = load i32, i32* %0
%7 = lshr i32 %6, 8
%8 = and i32 %7, 255
%9 = tail call i32 @fputc(i32 %8, i32* %1)
%10 = load i32, i32* %0
%11 = lshr i32 %10, 16
%12 = and i32 %11, 255
%13 = tail call i32 @fputc(i32 %12, i32* %1)
%14 = load i32, i32* %0
%15 = lshr i32 %14, 24
%16 = tail call i32 @fputc(i32 %15, i32* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ AES_KEY;

/* Variables and functions */
int /*<<< orphan*/ AES_encrypt(int /*<<< orphan*/ const *, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
int /*<<< orphan*/ AES_set_encrypt_key(int /*<<< orphan*/ const *, int,
                                       int /*<<< orphan*/ *);
void aes(uint8_t out[16], const uint8_t k[16], const uint8_t blk[16]) {
  AES_KEY expkey;
  AES_set_encrypt_key(k, 128, &expkey);
  AES_encrypt(blk, out, &expkey);
}


x86 assembly (clang, -O0):
<aes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x80,%esi
lea    -0x1c(%rbp),%rdx
call   1030 <AES_set_encrypt_key@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <AES_encrypt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0xc(%rsp),%r15
mov    %rsi,%rdi
mov    $0x80,%esi
mov    %r15,%rdx
call   1030 <AES_set_encrypt_key@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1040 <AES_encrypt@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @aes(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %5
%9 = call i32 @AES_set_encrypt_key(i32* %8, i32 128, i32* %7)
%10 = load i32*, i32** %6
%11 = load i32*, i32** %4
%12 = call i32 @AES_encrypt(i32* %10, i32* %11, i32* %7)
ret void
}

LLVM IR (-O2):
define void @aes(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @AES_set_encrypt_key(i32* %1, i32 128, i32* %4)
%7 = call i32 @AES_encrypt(i32* %2, i32* %0, i32* %4)
ret void
}
void sd_notify(int unset_environment, const char *state) {
  (void)unset_environment;
  (void)state;
  return;
}


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

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

LLVM IR (-O0):
define void @sd_notify(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
ret void
}

LLVM IR (-O2):
define void @sd_notify(i32 %0, i8* nocapture %1) {
ret void
}
int bint11(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @bint11() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ evil_exception(char *, int);
int /*<<< orphan*/ finish_exception();
void do_not_used(void) {
  evil_exception("not used", 5);
  finish_exception();
}


x86 assembly (clang, -O0):
<do_not_used>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x5,%esi
call   1030 <evil_exception@plt>
mov    $0x0,%al
call   1040 <finish_exception@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_not_used>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x5,%esi
call   1030 <evil_exception@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <finish_exception@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"not used\00"
define void @do_not_used() {
%1 = call i32 @evil_exception(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = call i32 (...) @finish_exception()
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"not used\00"
define void @do_not_used() {
%1 = tail call i32 @evil_exception(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 (...) @finish_exception()
ret void
}
void crashdump_init(const char *path) {}


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

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

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

LLVM IR (-O2):
define void @crashdump_init(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void printfMmapAddr(char *nameChar, char *mmapChar) {
  printf("%s'address = %p\n", nameChar, mmapChar);
}


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

x86 assembly (clang, -O2):
<printfMmapAddr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"%s'address = %p\0A\00"
define void @printfMmapAddr(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 i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s'address = %p\0A\00"
define void @printfMmapAddr(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
void decom(int flag) {
  if (flag)
    sm("?6");
  else
    rm("?6");
}


x86 assembly (clang, -O0):
<decom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <decom+0x26>
lea    0xec4(%rip),%rdi
call   1040 <sm@plt>
jmp    1152 <decom+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <rm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decom>:
test   %edi,%edi
je     1130 <decom+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <sm@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <rm@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"?6\00"
define void @decom(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @rm(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
char *allocate(n)
unsigned n;
{
  register char *p;
  p = (char *)calloc((unsigned)1, n);
  if (!p)
    no_space();
  return (p);
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <allocate+0x30>
mov    $0x0,%al
call   1030 <no_space@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
mov    %edi,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <allocate+0x1c>
xor    %eax,%eax
call   1030 <no_space@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @allocate(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = call i8* @calloc(i64 1, i64 %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 (...) @no_space()
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @allocate(i32 %0) {
%2 = zext i32 %0 to i64
%3 = tail call i8* @calloc(i64 1, i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (...) @no_space()
br label %7
7: ; preds = %5, %1
ret i8* %3
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double timer(void) {
  struct timeval t;
  gettimeofday(&t, NULL);
  return t.tv_sec + t.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  0xec9(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
divsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @timer() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = fdiv double %6, 1.000000e+06
%8 = fadd double %4, %7
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @timer() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = fadd double %5, %8
ret double %9
}
int point_in_rectangle(float point_x, float point_y, float min_x, float min_y,
                       float max_x, float max_y) {
  return (min_x <= point_x && point_x <= max_x && min_y <= point_y &&
          point_y <= max_y);
}


x86 assembly (clang, -O0):
<point_in_rectangle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     117d <point_in_rectangle+0x7d>
movss  -0x4(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     117d <point_in_rectangle+0x7d>
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     117d <point_in_rectangle+0x7d>
movss  -0x8(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<point_in_rectangle>:
ucomiss %xmm2,%xmm0
setae  %al
ucomiss %xmm0,%xmm4
setae  %cl
and    %al,%cl
ucomiss %xmm3,%xmm1
setae  %al
ucomiss %xmm1,%xmm5
setae  %dl
and    %al,%dl
and    %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @point_in_rectangle(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %9
%14 = load float, float* %7
%15 = fcmp ole float %13, %14
br i1 %15, label %16, label %28
16: ; preds = %6
%17 = load float, float* %7
%18 = load float, float* %11
%19 = fcmp ole float %17, %18
br i1 %19, label %20, label %28
20: ; preds = %16
%21 = load float, float* %10
%22 = load float, float* %8
%23 = fcmp ole float %21, %22
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load float, float* %8
%26 = load float, float* %12
%27 = fcmp ole float %25, %26
br label %28
28: ; preds = %24, %20, %16, %6
%29 = phi i1 [ false, %20 ], [ false, %16 ], [ false, %6 ], [ %27, %24 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @point_in_rectangle(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = fcmp ugt float %2, %0
%8 = fcmp ugt float %0, %4
%9 = or i1 %7, %8
%10 = fcmp ugt float %3, %1
%11 = or i1 %10, %9
%12 = fcmp ole float %1, %5
%13 = xor i1 %11, true
%14 = and i1 %12, %13
%15 = zext i1 %14 to i32
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ cancel;

/* Variables and functions */
int /*<<< orphan*/ TCIOFLUSH;
int /*<<< orphan*/ tcdrain(int);
int /*<<< orphan*/ tcflush(int, int /*<<< orphan*/);
int write(int, unsigned char const *, int);
void cancel_send(int fd) {
  static const unsigned char cancel[] = {0x18, 0x18, 0x18};
  if (write(fd, cancel, sizeof(cancel)) == sizeof(cancel))
    if (!tcdrain(fd))
      tcflush(fd, TCIOFLUSH);
}


x86 assembly (clang, -O0):
<cancel_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xebb(%rip),%rsi
mov    $0x3,%edx
call   1040 <write@plt>
cltq
cmp    $0x3,%rax
jne    1182 <cancel_send+0x52>
mov    -0x4(%rbp),%edi
call   1030 <tcdrain@plt>
cmp    $0x0,%eax
jne    117d <cancel_send+0x4d>
mov    -0x4(%rbp),%edi
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
call   1050 <tcflush@plt>
jmp    1182 <cancel_send+0x52>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cancel_send>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rsi
mov    $0x3,%edx
call   1040 <write@plt>
cmp    $0x3,%eax
jne    1154 <cancel_send+0x24>
mov    %ebx,%edi
call   1030 <tcdrain@plt>
test   %eax,%eax
je     1156 <cancel_send+0x26>
pop    %rbx
ret
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
pop    %rbx
jmp    1050 <tcflush@plt>

LLVM IR (-O0):
@cancel_send.cancel = internal constant [3 x i8] c"\18\18\18"
@TCIOFLUSH = global i32 0
define void @cancel_send(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @cancel_send.cancel, i64 0, i64 0), i32 3)
%5 = sext i32 %4 to i64
%6 = icmp eq i64 %5, 3
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i32, i32* %2
%9 = call i32 @tcdrain(i32 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = load i32, i32* @TCIOFLUSH
%14 = call i32 @tcflush(i32 %12, i32 %13)
br label %15
15: ; preds = %11, %7
br label %16
16: ; preds = %15, %1
ret void
}

LLVM IR (-O2):
@cancel_send.cancel = internal constant [3 x i8] c"\18\18\18"
@TCIOFLUSH = global i32 0
define void @cancel_send(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @cancel_send.cancel, i64 0, i64 0), i32 3)
%3 = icmp eq i32 %2, 3
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i32 @tcdrain(i32 %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* @TCIOFLUSH
%9 = tail call i32 @tcflush(i32 %0, i32 %8)
br label %10
10: ; preds = %4, %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ iif();
void iwhile() { iif(); }


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

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

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

LLVM IR (-O2):
define void @iwhile() {
%1 = tail call i32 (...) @iif()
ret void
}
/* Variables and functions */
float fmodf(float, float);
void mod_fff(float *ret, float a, float b) {
  float f;
  f = fmodf(a, b);
  (*ret) = f;
}


x86 assembly (clang, -O0):
<mod_fff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1030 <fmodf@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_fff>:
push   %rbx
mov    %rdi,%rbx
call   1030 <fmodf@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @mod_fff(float* %0, float %1, float %2) {
%4 = alloca float*
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float* %0, float** %4
store float %1, float* %5
store float %2, float* %6
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float @fmodf(float %8, float %9)
store float %10, float* %7
%11 = load float, float* %7
%12 = load float*, float** %4
store float %11, float* %12
ret void
}

LLVM IR (-O2):
define void @mod_fff(float* nocapture writeonly %0, float %1, float %2) {
%4 = tail call float @fmodf(float %1, float %2)
store float %4, float* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CG_Error(char const *);
char *COM_Parse(char **);
char *CG_MustParse(char **pString, const char *pErrorMsg) {
  char *token = COM_Parse(pString);
  if (!*token) {
    CG_Error(pErrorMsg);
  }
  return token;
}


x86 assembly (clang, -O0):
<CG_MustParse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <COM_Parse@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1153 <CG_MustParse+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <CG_Error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_MustParse>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <COM_Parse@plt>
mov    %rax,%rbx
cmpb   $0x0,(%rax)
jne    113c <CG_MustParse+0x1c>
mov    %r14,%rdi
call   1030 <CG_Error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @CG_MustParse(i8** %0, i8* %1) {
%3 = tail call i8* @COM_Parse(i8** %0)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @CG_Error(i8* %1)
br label %8
8: ; preds = %6, %2
ret i8* %3
}
int execute_fchown() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_fchown() {
ret i32 0
}
B2(x) {
  int y[9949];
  return 3 + x;
}


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

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

LLVM IR (-O0):
define i32 @B2(i32 %0) {
%2 = alloca i32
%3 = alloca [9949 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @B2(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
void freeBitArray(char **arr) {
  for (int i = 0; i < 257; i++)
    free(arr[i]);
  free(arr);
}


x86 assembly (clang, -O0):
<freeBitArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x101,-0xc(%rbp)
jge    114f <freeBitArray+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <freeBitArray+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeBitArray>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    $0x101,%rbx
jne    1120 <freeBitArray+0x10>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeBitArray(i8** nocapture %0) {
br label %4
2: ; preds = %4
%3 = bitcast i8** %0 to i8*
tail call void @free(i8* %3)
ret void
4: ; preds = %1, %4
%5 = phi i64 [ 0, %1 ], [ %8, %4 ]
%6 = getelementptr inbounds i8*, i8** %0, i64 %5
%7 = load i8*, i8** %6
tail call void @free(i8* %7)
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i64 %8, 257
br i1 %9, label %2, label %4
}
/* Type definitions */
typedef scalar_t__ uint64_t;
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t get_time(void) {
  struct timespec tp;
  clock_gettime(CLOCK_MONOTONIC, &tp);
  return ((tp).tv_sec * 1000000000 + (tp).tv_nsec);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <clock_gettime@plt>
movslq 0x8(%rsp),%rax
imul   $0x3b9aca00,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @get_time() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
@CLOCK_MONOTONIC = global i32 0
define i64 @get_time() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000000
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = add nsw i64 %10, %8
ret i64 %11
}
DISCRETE_RESET(dss_constant) { set_output(0, DISCRETE_INPUT(0)); }


x86 assembly (clang, -O0):
<DISCRETE_RESET>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x0,%al
call   1030 <DISCRETE_INPUT@plt>
mov    %eax,%esi
xor    %edi,%edi
mov    $0x0,%al
call   1040 <set_output@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DISCRETE_RESET>:
push   %rax
xor    %edi,%edi
xor    %eax,%eax
call   1030 <DISCRETE_INPUT@plt>
xor    %edi,%edi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1040 <set_output@plt>

LLVM IR (-O0):
define i32 @DISCRETE_RESET(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 0)
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output to i32 (i32, i32, ...)*)(i32 0, i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @DISCRETE_RESET(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @DISCRETE_INPUT to i32 (i32, ...)*)(i32 0)
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @set_output to i32 (i32, i32, ...)*)(i32 0, i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ errno;
int close(int file) {
  errno = EBADF;
  return -1;
}


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EBADF = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @EBADF
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EBADF = global i32 0
@errno = global i32 0
define i32 @close(i32 %0) {
%2 = load i32, i32* @EBADF
store i32 %2, i32* @errno
ret i32 -1
}
unsigned int pack_half_float(int r16, int g16) {
  return (unsigned int)r16 | ((unsigned int)g16 << 16);
}


x86 assembly (clang, -O0):
<pack_half_float>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_half_float>:
mov    %esi,%eax
shl    $0x10,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @pack_half_float(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 = shl i32 %6, 16
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @pack_half_float(i32 %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
scalar_t__ test0(char const *const);
int test() {
  const char *const str = "abvsport";
  int len;
  if (str[2] != 'v') {
    return 1;
  }
  if ("test"[0] == 't') {
    return 2;
  }
  if (test0(str) != 0) {
    return 3;
  }
  len = 0;
  while (str[len])
    len++;
  return (len == 8 ? 0 : 4);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    $0x2,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"abvsport\00"
define i32 @test() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
ret i32 2
}

LLVM IR (-O2):
define i32 @test() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f2(float f1, float f2) {
  if (f1 != 2.5f || f2 != 3.5f)
    abort();
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xed1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    115f <f2+0x4f>
jp     115f <f2+0x4f>
movss  -0x8(%rbp),%xmm0
movss  0xeb9(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    115f <f2+0x4f>
jp     115f <f2+0x4f>
jmp    1166 <f2+0x56>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
ucomiss 0xee8(%rip),%xmm0
jne    1129 <f2+0x19>
jp     1129 <f2+0x19>
ucomiss 0xee1(%rip),%xmm1
jne    1129 <f2+0x19>
jp     1129 <f2+0x19>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f2(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = fcmp une float %5, 2.500000e+00
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load float, float* %4
%9 = fcmp une float %8, 3.500000e+00
br i1 %9, label %10, label %12
10: ; preds = %7, %2
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @f2(float %0, float %1) {
%3 = fcmp une float %0, 2.500000e+00
%4 = fcmp une float %1, 3.500000e+00
%5 = or i1 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %2
ret void
}
int color_offset_f4(int x, int y) {
  return (((y << 10) + (((x << 10) * 337) / 106) - (12601 << 10)) >> 10);
}


x86 assembly (clang, -O0):
<color_offset_f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xa,%eax
imul   $0x151,%eax,%eax
mov    $0x6a,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0xc4e400,%eax
sar    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<color_offset_f4>:
shl    $0xa,%esi
imul   $0x54400,%edi,%eax
cltq
imul   $0x4d4873ed,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
add    %esi,%eax
add    $0xff3b1c00,%eax
sar    $0xa,%eax
ret

LLVM IR (-O0):
define i32 @color_offset_f4(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 = shl i32 %5, 10
%7 = load i32, i32* %3
%8 = shl i32 %7, 10
%9 = mul nsw i32 %8, 337
%10 = sdiv i32 %9, 106
%11 = add nsw i32 %6, %10
%12 = sub nsw i32 %11, 12903424
%13 = ashr i32 %12, 10
ret i32 %13
}

LLVM IR (-O2):
define i32 @color_offset_f4(i32 %0, i32 %1) {
%3 = shl i32 %1, 10
%4 = mul i32 %0, 345088
%5 = sdiv i32 %4, 106
%6 = add nsw i32 %5, -12903424
%7 = add i32 %6, %3
%8 = ashr i32 %7, 10
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int HLine(int length) {
  int i;
  for (i = 1; i <= length; i++)
    printf("-");
  printf("\n");
  return (i);
}


x86 assembly (clang, -O0):
<HLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1148 <HLine+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <HLine+0x12>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HLine>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1131 <HLine+0x21>
mov    %edi,%ebx
lea    0x1(%rbx),%ebp
nopl   0x0(%rax)
mov    $0x2d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <HLine+0x10>
jmp    1136 <HLine+0x26>
mov    $0x1,%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @HLine(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = add nuw i32 %0, 1
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 1, %3 ]
%7 = tail call i32 @putchar(i32 45)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %6, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
%11 = phi i32 [ 1, %1 ], [ %4, %5 ]
%12 = tail call i32 @putchar(i32 10)
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ err(int, char *);
scalar_t__ fork();
pid_t xfork(void) {
  pid_t pid = fork();
  if (pid == (pid_t)-1)
    err(1, "fork");
  return pid;
}


x86 assembly (clang, -O0):
<xfork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0xffffffffffffffff,-0x8(%rbp)
jne    114f <xfork+0x2f>
mov    $0x1,%edi
lea    0xeb6(%rip),%rsi
call   1030 <err@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfork>:
push   %rbx
xor    %eax,%eax
call   1040 <fork@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
jne    1142 <xfork+0x22>
lea    0xec8(%rip),%rsi
mov    $0x1,%edi
call   1030 <err@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"fork\00"
define i64 @xfork() {
%1 = tail call i64 (...) @fork()
%2 = icmp eq i64 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i64 %1
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putstr_fd(char const *s, int fd) {
  int len;
  len = ft_strlen(s);
  write(fd, s, len);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* %0, i32 %1) {
%3 = tail call i32 @ft_strlen(i8* %0)
%4 = tail call i32 @write(i32 %1, i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void android_free(void *block) {
  if (block)
    free(block);
}


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

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

LLVM IR (-O0):
define void @android_free(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)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @android_free(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 RTDbgModSegmentSize(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgModSegmentSize() {
ret void
}
int val_to_tt(int val, int ply) {
  if (val >= ((29000) - (127)))
    val += ply;
  else if (val <= -((29000) - (127)))
    val -= ply;
  return val;
}


x86 assembly (clang, -O0):
<val_to_tt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x70c9,-0x4(%rbp)
jl     1125 <val_to_tt+0x25>
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <val_to_tt+0x42>
cmpl   $0xffff8f37,-0x4(%rbp)
jg     113d <val_to_tt+0x3d>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <val_to_tt+0x42>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_to_tt>:
xor    %eax,%eax
cmp    $0xffff8f38,%edi
cmovl  %esi,%eax
neg    %eax
cmp    $0x70c9,%edi
cmovge %esi,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @val_to_tt(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, 28872
%4 = icmp slt i32 %0, -28872
%5 = select i1 %4, i32 %1, i32 0
%6 = sub i32 0, %5
%7 = select i1 %3, i32 %1, i32 %6
%8 = add i32 %7, %0
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void blip() {
  fflush(stdout);
  fprintf(stderr, "blip!\n");
  fflush(stderr);
}


x86 assembly (clang, -O0):
<blip>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
lea    0xebe(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<blip>:
push   %rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2eaa(%rip),%rbx
mov    (%rbx),%edi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [7 x i8] c"blip!\0A\00"
define void @blip() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fflush(i32 %5)
ret void
}
long long llrint(double x) {
  long long retval = 0ll;
  __asm__ __volatile__("fistpll %0" : "=m"(retval) : "t"(x) : "st");
  return retval;
}


x86 assembly (clang, -O0):
<llrint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
fistpll -0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llrint>:
movq   $0x0,-0x10(%rsp)
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fistpll -0x10(%rsp)
mov    -0x10(%rsp),%rax
ret

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

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = load i64, i64* %2
ret i64 %4
}