xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int /*<<< orphan*/ do_cow_open(int, char const *, int);
int do_generic_openat(int dirfd, char const *name, int flags, mode_t mode,
                      int (*open_proc)(int, char const *, int, ...)) {
  do_cow_open(dirfd, name, flags);
  do {
  } while (0);
  return open_proc(dirfd, name, flags, mode);
}


x86 assembly (clang, -O0):
<do_generic_openat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <do_cow_open@plt>
jmp    113d <do_generic_openat+0x2d>
mov    -0x20(%rbp),%r8
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x0,%al
call   *%r8
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_generic_openat>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r12
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %edi,%ebp
call   1030 <do_cow_open@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
mov    %r12,%r8
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    *%r8

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

LLVM IR (-O2):
define i32 @do_generic_openat(i32 %0, i8* %1, i32 %2, i32 %3, i32 (i32, i8*, i32, ...)* nocapture %4) {
%6 = tail call i32 @do_cow_open(i32 %0, i8* %1, i32 %2)
%7 = tail call i32 (i32, i8*, i32, ...) %4(i32 %0, i8* %1, i32 %2, i32 %3)
ret i32 %7
}
void test() {
#pragma omp target
  ;
}


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

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

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

LLVM IR (-O2):
define void @test() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int htonl(int /*<<< orphan*/);
uint64_t hton64p(const uint8_t *p) {
  uint64_t ret = (htonl(*(uint32_t *)(p)));
  ret <<= 32;
  ret |= (htonl(*(uint32_t *)(p + 4)));
  return ret;
}


x86 assembly (clang, -O0):
<hton64p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <htonl@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%edi
call   1030 <htonl@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hton64p>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <htonl@plt>
mov    0x10(%rbx),%edi
pop    %rbx
jmp    1030 <htonl@plt>

LLVM IR (-O0):
define i32 @hton64p(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @htonl(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = shl i32 %7, 32
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = load i32, i32* %10
%12 = call i32 @htonl(i32 %11)
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @hton64p(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @htonl(i32 %2)
%4 = getelementptr inbounds i32, i32* %0, i64 4
%5 = load i32, i32* %4
%6 = tail call i32 @htonl(i32 %5)
ret i32 poison
}
void swap(int *p, int *q) {
  int temp = *p;
  *p = *q;
  *q = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void adcinit(void) {
  (*((volatile uint32_t *)0x400FE638)) |= 0x00000001;
  while (((*((volatile uint32_t *)0x400FEA38)) & 0x01) == 0) {
  };
  (*((volatile uint32_t *)0x40038FC4)) &= ~0xF;
  (*((volatile uint32_t *)0x40038FC4)) |= 0x1;
  (*((volatile uint32_t *)0x40038020)) = 0x3210;
}


x86 assembly (clang, -O0):
<adcinit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe638,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x400fe638,%eax
mov    %ecx,(%rax)
mov    $0x400fea38,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    112d <adcinit+0x2d>
jmp    1115 <adcinit+0x15>
mov    $0x40038fc4,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
mov    $0x40038fc4,%eax
mov    %ecx,(%rax)
mov    $0x40038fc4,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x40038fc4,%eax
mov    %ecx,(%rax)
mov    $0x40038020,%eax
movl   $0x3210,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<adcinit>:
orl    $0x1,0x400fe638
01
nopl   0x0(%rax,%rax,1)
testl  $0x1,0x400fea38
je     1110 <adcinit+0x10>
andl   $0xfffffff0,0x40038fc4
f0
orl    $0x1,0x40038fc4
01
movl   $0x3210,0x40038020
ret

LLVM IR (-O0):
define void @adcinit() {
%1 = load volatile i32, i32* inttoptr (i64 1074783800 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1074783800 to i32*)
br label %3
3: ; preds = %7, %0
%4 = load volatile i32, i32* inttoptr (i64 1074784824 to i32*)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load volatile i32, i32* inttoptr (i64 1073975236 to i32*)
%10 = and i32 %9, -16
store volatile i32 %10, i32* inttoptr (i64 1073975236 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 1073975236 to i32*)
%12 = or i32 %11, 1
store volatile i32 %12, i32* inttoptr (i64 1073975236 to i32*)
store volatile i32 12816, i32* inttoptr (i64 1073971232 to i32*)
ret void
}

LLVM IR (-O2):
define void @adcinit() {
%1 = load volatile i32, i32* inttoptr (i64 1074783800 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1074783800 to i32*)
br label %3
3: ; preds = %3, %0
%4 = load volatile i32, i32* inttoptr (i64 1074784824 to i32*)
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = load volatile i32, i32* inttoptr (i64 1073975236 to i32*)
%9 = and i32 %8, -16
store volatile i32 %9, i32* inttoptr (i64 1073975236 to i32*)
%10 = load volatile i32, i32* inttoptr (i64 1073975236 to i32*)
%11 = or i32 %10, 1
store volatile i32 %11, i32* inttoptr (i64 1073975236 to i32*)
store volatile i32 12816, i32* inttoptr (i64 1073971232 to i32*)
ret void
}
void g_option_context_add_main_entries() {}


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

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

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

LLVM IR (-O2):
define void @g_option_context_add_main_entries() {
ret void
}
int sum_4_5() { return 4 + 5; }


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

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

LLVM IR (-O0):
define i32 @sum_4_5() {
ret i32 9
}

LLVM IR (-O2):
define i32 @sum_4_5() {
ret i32 9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("suma=%d", a + b);
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [8 x i8] c"suma=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [8 x i8] c"suma=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
int comp(const void *b, const void *a) { return *(int *)a - *(int *)b; }


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int timespec_get(struct timespec *ts, int base) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.timespec = type opaque
define i32 @timespec_get(%struct.timespec* nocapture readnone %0, i32 %1) {
ret i32 0
}
int f1(void) { return 11; }


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

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

LLVM IR (-O0):
define i32 @f1() {
ret i32 11
}

LLVM IR (-O2):
define i32 @f1() {
ret i32 11
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ socket_close(int);
void *close_socket(void *data) {
  assert(data);
  int *sfd = (int *)data;
  socket_close(*sfd);
  return NULL;
}


x86 assembly (clang, -O0):
<close_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <socket_close@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_socket>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    (%rbx),%edi
call   1030 <socket_close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @close_socket(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @assert(i8* %4)
%6 = load i8*, i8** %2
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @socket_close(i32 %9)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @close_socket(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @socket_close(i32 %4)
ret i8* null
}
int cmp_char(const void *a, const void *b) {
  if (*(char *)a > *(char *)b)
    return -1;
  else if (*(char *)a < *(char *)b)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jle    112e <cmp_char+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <cmp_char+0x5c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    1150 <cmp_char+0x50>
movl   $0x1,-0x4(%rbp)
jmp    115c <cmp_char+0x5c>
jmp    1155 <cmp_char+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_char>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setl   %cl
mov    $0xffffffff,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp sgt i8 %3, %4
%6 = icmp slt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ SystemCall(int);
void LZ77UnCompVram(void *source, void *dest) { SystemCall(18); }


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

x86 assembly (clang, -O2):
<LZ77UnCompVram>:
mov    $0x12,%edi
jmp    1030 <SystemCall@plt>

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

LLVM IR (-O2):
define void @LZ77UnCompVram(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @SystemCall(i32 18)
ret void
}
/* Variables and functions */
int juniper_fpga_partition_read_flag(int, int, char *);
int juniper_fpga_partition_interrupted(int devNo, int partNo) {
  return juniper_fpga_partition_read_flag(devNo, partNo, "accel_interrupted");
}


x86 assembly (clang, -O0):
<juniper_fpga_partition_interrupted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0xed5(%rip),%rdx
call   1030 <juniper_fpga_partition_read_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<juniper_fpga_partition_interrupted>:
lea    0xee9(%rip),%rdx
jmp    1030 <juniper_fpga_partition_read_flag@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"accel_interrupted\00"
define i32 @juniper_fpga_partition_interrupted(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 = call i32 @juniper_fpga_partition_read_flag(i32 %5, i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@.str = [18 x i8] c"accel_interrupted\00"
define i32 @juniper_fpga_partition_interrupted(i32 %0, i32 %1) {
%3 = tail call i32 @juniper_fpga_partition_read_flag(i32 %0, i32 %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
int compareLong(const void *a, const void *b) {
  long *arg1 = (long *)a;
  long *arg2 = (long *)b;
  if (*arg1 < *arg2)
    return -1;
  else if (*arg1 == *arg2)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compareLong>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jge    113c <compareLong+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <compareLong+0x63>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%rax
jne    115c <compareLong+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1163 <compareLong+0x63>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareLong>:
mov    (%rdi),%rax
xor    %ecx,%ecx
cmp    (%rsi),%rax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compareLong(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp slt i64 %5, %6
%8 = icmp ne i64 %5, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
long max(long a, long b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ CreateEntryDialog();
void MenuCreateEntry(const char *key) { CreateEntryDialog(); }


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

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

LLVM IR (-O0):
define void @MenuCreateEntry(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @CreateEntryDialog()
ret void
}

LLVM IR (-O2):
define void @MenuCreateEntry(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @CreateEntryDialog()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
uint8_t be8(uint8_t *p) { return *p; }


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

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

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

LLVM IR (-O2):
define i32 @be8(i32* nocapture %0) {
%2 = load i32, i32* %0
ret i32 %2
}
/* Variables and functions */
int INT_MIN;
int test4(int x) {
  int y = INT_MIN;
  return x ^ y;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
mov    %edi,%eax
mov    0x2edf(%rip),%rcx
xor    (%rcx),%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @test4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @INT_MIN
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @test4(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = xor i32 %2, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ getpid();
void test(void) {
  pid_t pid;
  pid = getpid();
}


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

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

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = call i32 (...) @getpid()
store i32 %2, i32* %1
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 (...) @getpid()
ret void
}
void reapchild(int sig) { (void)sig; }


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

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

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

LLVM IR (-O2):
define void @reapchild(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ prinf(char *);
void dev_open() { prinf("device is open successfully"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"device is open successfully\00"
define void @dev_open() {
%1 = call i32 @prinf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"device is open successfully\00"
define void @dev_open() {
%1 = tail call i32 @prinf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
double su_get_br_val(double bc, double gs) { return (bc / gs); }


x86 assembly (clang, -O0):
<su_get_br_val>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @su_get_br_val(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @su_get_br_val(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
int square(const int x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void doOpenFile() {
  FILE *fp = fopen("oh.txt", "w");
  if (fp != NULL)
    fclose(fp);
}


x86 assembly (clang, -O0):
<doOpenFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1153 <doOpenFile+0x33>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doOpenFile>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1142 <doOpenFile+0x22>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"oh.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @doOpenFile() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @fclose(i32* %1)
br label %5
5: ; preds = %3, %0
ret void
}
void lfence(void) { __asm volatile("lfence"); }


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

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

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

LLVM IR (-O2):
define void @lfence() {
tail call void asm sideeffect "lfence", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
long long int foo() {
  long long int i = 1, sn = 0;
  unsigned int n = 100;
  while (i <= n) {
    sn = sn + i;
    i++;
  }
  return sn;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x64,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
cmp    %rcx,%rax
jg     1148 <foo+0x48>
mov    -0x10(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111b <foo+0x1b>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @foo() {
ret i64 5050
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  int A[2048];
  int B[2048];
  int i;
  int tmp;
  for (i = 0; i < 2048; i++) {
    tmp = A[i];
    B[i] = tmp;
  }
  __VERIFIER_assert(A[2048 / 2] == B[2048 / 2]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4020,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4014(%rbp)
cmpl   $0x800,-0x4014(%rbp)
jge    1178 <main+0x68>
movslq -0x4014(%rbp),%rax
mov    -0x2010(%rbp,%rax,4),%eax
mov    %eax,-0x4018(%rbp)
mov    -0x4018(%rbp),%ecx
movslq -0x4014(%rbp),%rax
mov    %ecx,-0x4010(%rbp,%rax,4)
mov    -0x4014(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4014(%rbp)
jmp    112c <main+0x1c>
mov    -0x1010(%rbp),%eax
cmp    -0x3010(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x4020,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [2048 x i32]
%3 = alloca [2048 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2048
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [2048 x i32], [2048 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %16
store i32 %14, i32* %17
br label %18
18: ; preds = %9
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %6
21: ; preds = %6
%22 = getelementptr inbounds [2048 x i32], [2048 x i32]* %2, i64 0, i64 1024
%23 = load i32, i32* %22
%24 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 1024
%25 = load i32, i32* %24
%26 = icmp eq i32 %23, %25
%27 = zext i1 %26 to i32
%28 = call i32 @__VERIFIER_assert(i32 %27)
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
void games_init_cobra(void *game_state) { return; }


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

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

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

LLVM IR (-O2):
define void @games_init_cobra(i8* nocapture %0) {
ret void
}
int do_032() { return 32; }


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

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

LLVM IR (-O0):
define i32 @do_032() {
ret i32 32
}

LLVM IR (-O2):
define i32 @do_032() {
ret i32 32
}
/* Variables and functions */
int count_bits(unsigned long);
int NTZ(unsigned long x) { return count_bits((x & -x) - 1); }


x86 assembly (clang, -O0):
<NTZ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
sub    -0x8(%rbp),%rax
and    %rax,%rdi
sub    $0x1,%rdi
call   1030 <count_bits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NTZ>:
mov    %rdi,%rax
neg    %rax
and    %rax,%rdi
add    $0xffffffffffffffff,%rdi
jmp    1030 <count_bits@plt>

LLVM IR (-O0):
define i32 @NTZ(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = sub i64 0, %4
%6 = and i64 %3, %5
%7 = sub i64 %6, 1
%8 = call i32 @count_bits(i64 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @NTZ(i64 %0) {
%2 = sub i64 0, %0
%3 = and i64 %2, %0
%4 = add i64 %3, -1
%5 = tail call i32 @count_bits(i64 %4)
ret i32 %5
}
/* Type definitions */
struct iter {
  int dummy;
};

/* Variables and functions */
int window_get_sel(void *, struct iter *);
int simple_track_search_get_current(void *data, struct iter *iter) {
  return window_get_sel(data, iter);
}


x86 assembly (clang, -O0):
<simple_track_search_get_current>:
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 <window_get_sel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_track_search_get_current>:
jmp    1030 <window_get_sel@plt>

LLVM IR (-O0):
%struct.iter = type { i32 }
define i32 @simple_track_search_get_current(i8* %0, %struct.iter* %1) {
%3 = alloca i8*
%4 = alloca %struct.iter*
store i8* %0, i8** %3
store %struct.iter* %1, %struct.iter** %4
%5 = load i8*, i8** %3
%6 = load %struct.iter*, %struct.iter** %4
%7 = call i32 @window_get_sel(i8* %5, %struct.iter* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.iter = type { i32 }
define i32 @simple_track_search_get_current(i8* %0, %struct.iter* %1) {
%3 = tail call i32 @window_get_sel(i8* %0, %struct.iter* %1)
ret i32 %3
}
RX0I1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cmp    $0x21,%eax
jg     1140 <RX0I1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <RX0I1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpw   $0x22,(%r8,%rcx,2)
setl   %al
ret

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

LLVM IR (-O2):
define i32 @RX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = icmp slt i16 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
int le(int a, int b) { return a <= b; }


x86 assembly (clang, -O0):
<le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

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

LLVM IR (-O2):
define i32 @le(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t reverse_bitorder(uint8_t b) {
  b = (b & 0xF0) >> 4 | (b & 0x0F) << 4;
  b = (b & 0xCC) >> 2 | (b & 0x33) << 2;
  b = (b & 0xAA) >> 1 | (b & 0x55) << 1;
  return b;
}


x86 assembly (clang, -O0):
<reverse_bitorder>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
shl    $0x4,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xcc,%eax
sar    $0x2,%eax
mov    -0x4(%rbp),%ecx
and    $0x33,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xaa,%eax
sar    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x55,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_bitorder>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @reverse_bitorder(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 240
%5 = ashr i32 %4, 4
%6 = load i32, i32* %2
%7 = and i32 %6, 15
%8 = shl i32 %7, 4
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = and i32 %10, 204
%12 = ashr i32 %11, 2
%13 = load i32, i32* %2
%14 = and i32 %13, 51
%15 = shl i32 %14, 2
%16 = or i32 %12, %15
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = and i32 %17, 170
%19 = ashr i32 %18, 1
%20 = load i32, i32* %2
%21 = and i32 %20, 85
%22 = shl i32 %21, 1
%23 = or i32 %19, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @reverse_bitorder(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() {
  printf("mark target options:\n"
         " --mark-set value     : Set nfmark value\n"
         " --mark-or  value     : Or nfmark with value (nfmark |= value)\n"
         " --mark-and value     : And nfmark with value (nfmark &= value)\n"
         " --mark-xor value     : Xor nfmark with value (nfmark ^= value)\n"
         " --mark-target target : ACCEPT, DROP, RETURN or CONTINUE\n");
}


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

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

LLVM IR (-O0):
@.str = [311 x i8] c"mark target options:\0A --mark-set value : Set nfmark value\0A --mark-or value : Or nfmark with value (nfmark |= value)\0A --mark-and value : And nfmark with value (nfmark &= value)\0A --mark-xor value : Xor nfmark with value (nfmark ^= value)\0A --mark-target target : ACCEPT, DROP, RETURN or CONTINUE\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([311 x i8], [311 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [310 x i8] c"mark target options:\0A --mark-set value : Set nfmark value\0A --mark-or value : Or nfmark with value (nfmark |= value)\0A --mark-and value : And nfmark with value (nfmark &= value)\0A --mark-xor value : Xor nfmark with value (nfmark ^= value)\0A --mark-target target : ACCEPT, DROP, RETURN or CONTINUE\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([310 x i8], [310 x i8]* @str, i64 0, i64 0))
ret void
}
const char *hw_get_device_model_name(void) { return "Ben NanoNote"; }


x86 assembly (clang, -O0):
<hw_get_device_model_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hw_get_device_model_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Ben NanoNote\00"
define i8* @hw_get_device_model_name() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"Ben NanoNote\00"
define i8* @hw_get_device_model_name() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}
int b() {
  int __int128_t;
  int __uint128_t;
}


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

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

LLVM IR (-O0):
define i32 @b() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @b() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ uspin(int);
int /*<<< orphan*/ write(long, char *, int);
void _SendChar(long port, char ch) {
  char buf = ch;
  write(port, &buf, 1);
  uspin(100);
}


x86 assembly (clang, -O0):
<_SendChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x64,%edi
call   1040 <uspin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_SendChar>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1040 <uspin@plt>

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

LLVM IR (-O2):
define void @_SendChar(i64 %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @write(i64 %0, i8* %3, i32 1)
%5 = tail call i32 @uspin(i32 100)
ret void
}
void js_ConsoleLine(const char *message) {}


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

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

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

LLVM IR (-O2):
define void @js_ConsoleLine(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int findLower(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int vector[] = {10, 5, 2, -9, 8, 4, 9};
  printf("%d\n", findLower(vector, 7));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1040 <findLower@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
call   1040 <findLower@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.vector = [7 x i32] [i32 10, i32 5, i32 2, i32 -9, i32 8, i32 4, i32 9]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @findLower(i32* %3, i32 7)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int f149(int *);
int f150(int *p) { return f149(p); }


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

x86 assembly (clang, -O2):
<f150>:
jmp    1030 <f149@plt>

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

LLVM IR (-O2):
define i32 @f150(i32* %0) {
%2 = tail call i32 @f149(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *tokenizer_next_string(char *);
char *tokenizer_next_unquoted(char *);
char *tokenizer_next_param(char *input_p) {
  assert(input_p != NULL);
  if (*input_p == '"')
    return tokenizer_next_string(input_p);
  else
    return tokenizer_next_unquoted(input_p);
}


x86 assembly (clang, -O0):
<tokenizer_next_param>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x22,%eax
jne    1170 <tokenizer_next_param+0x40>
mov    -0x10(%rbp),%rdi
call   1050 <tokenizer_next_string@plt>
mov    %rax,-0x8(%rbp)
jmp    117d <tokenizer_next_param+0x4d>
mov    -0x10(%rbp),%rdi
call   1030 <tokenizer_next_unquoted@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenizer_next_param>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
cmpb   $0x22,(%rbx)
jne    1150 <tokenizer_next_param+0x20>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <tokenizer_next_string@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <tokenizer_next_unquoted@plt>

LLVM IR (-O0):
define i8* @tokenizer_next_param(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 34
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i8* @tokenizer_next_string(i8* %13)
store i8* %14, i8** %2
br label %18
15: ; preds = %1
%16 = load i8*, i8** %3
%17 = call i8* @tokenizer_next_unquoted(i8* %16)
store i8* %17, i8** %2
br label %18
18: ; preds = %15, %12
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @tokenizer_next_param(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 34
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i8* @tokenizer_next_string(i8* %0)
br label %11
9: ; preds = %1
%10 = tail call i8* @tokenizer_next_unquoted(i8* %0)
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ %8, %7 ], [ %10, %9 ]
ret i8* %12
}
void foo410(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo410(i32 %0) {
ret void
}