xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int compare(int, int *, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char **argv) {
  uint64_t state = 0xF00000100U;
  uint32_t last = 0x101U;
  int ret = compare(state, &last, 0x01);
  if (ret != 0)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x100,-0x14(%rbp)
movl   $0x101,-0x18(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1050 <compare@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1179 <main+0x49>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x101,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x100,%edi
mov    $0x1,%edx
call   1050 <compare@plt>
test   %eax,%eax
jne    1158 <main+0x28>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 256, i32* %6
store i32 257, i32* %7
%9 = load i32, i32* %6
%10 = call i32 @compare(i32 %9, i32* %7, i32 1)
store i32 %10, i32* %8
%11 = load i32, i32* %8
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @abort()
unreachable
15: ; preds = %2
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 257, i32* %3
%5 = call i32 @compare(i32 256, i32* %3, i32 1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %2
%10 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *ThreadBody1(void *arg) {
  int i;
  for (i = 0; i < 100; i++) {
    printf("Thread 1: %d\n", i);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<ThreadBody1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x64,-0xc(%rbp)
jge    114a <ThreadBody1+0x3a>
mov    -0xc(%rbp),%esi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ThreadBody1+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreadBody1>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <ThreadBody1+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Thread 1: %d\0A\00"
define noalias i8* @ThreadBody1(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 100
br i1 %6, label %7, label %2
7: ; preds = %2
ret i8* null
}
/* Variables and functions */
long long rint(double);
__attribute__((always_)) long long llrint(double x) { return rint(x); }


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

x86 assembly (clang, -O2):
<llrint>:
jmp    1030 <rint@plt>

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

LLVM IR (-O2):
define i64 @llrint(double %0) {
%2 = tail call i64 @rint(double %0)
ret i64 %2
}
/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ move(scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void die(int sig) {
  signal(sig, SIG_IGN);
  move((LINES - 1), 0);
  refresh();
  endwin();
  exit(0);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e75(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
xor    %esi,%esi
call   1070 <move@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<die>:
push   %rax
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   1070 <move@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <endwin@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
@LINES = global i64 0
define void @die(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @signal(i32 %3, i32 %4)
%6 = load i64, i64* @LINES
%7 = sub nsw i64 %6, 1
%8 = call i32 @move(i64 %7, i32 0)
%9 = call i32 (...) @refresh()
%10 = call i32 (...) @endwin()
%11 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
@LINES = global i64 0
define void @die(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %0, i32 %2)
%4 = load i64, i64* @LINES
%5 = add nsw i64 %4, -1
%6 = tail call i32 @move(i64 %5, i32 0)
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 (...) @endwin()
%9 = tail call i32 @exit(i32 0)
unreachable
}
void REOFifo_noop(void *unused) { (void)unused; }


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

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

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

LLVM IR (-O2):
define void @REOFifo_noop(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t I2CFIFODataGet(uint32_t ui32Base) {
  ;
  while ((*((volatile uint32_t *)(ui32Base + 0x00000F08))) & 0x00010000) {
  }
  return ((*((volatile uint32_t *)(ui32Base + 0x00000F00))));
}


x86 assembly (clang, -O0):
<I2CFIFODataGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf08,%eax
cltq
mov    (%rax),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
je     1126 <I2CFIFODataGet+0x26>
jmp    1107 <I2CFIFODataGet+0x7>
mov    -0x4(%rbp),%eax
add    $0xf00,%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CFIFODataGet>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x10000,0xf08(%rax)
jne    1110 <I2CFIFODataGet+0x10>
mov    0xf00(%rax),%eax
ret

LLVM IR (-O0):
define i32 @I2CFIFODataGet(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %11, %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 3848
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 65536
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
br label %3
12: ; preds = %3
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 3840
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @I2CFIFODataGet(i32 %0) {
%2 = add nsw i32 %0, 3848
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
br label %5
5: ; preds = %5, %1
%6 = load volatile i32, i32* %4
%7 = and i32 %6, 65536
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %5
9: ; preds = %5
%10 = add nsw i32 %0, 3840
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void XrtVideo_ConnectionChangedSink(char *PeerConnection) {
  printf("XrtVideo_ConnectionChanged: PeerConnection = %s\r\n", PeerConnection);
}


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

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

LLVM IR (-O0):
@.str = [50 x i8] c"XrtVideo_ConnectionChanged: PeerConnection = %s\0D\0A\00"
define void @XrtVideo_ConnectionChangedSink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"XrtVideo_ConnectionChanged: PeerConnection = %s\0D\0A\00"
define void @XrtVideo_ConnectionChangedSink(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ __list_del_entry(struct list_head *);
void clist_del_init(struct list_head *entry) {
  __list_del_entry(entry);
  INIT_LIST_HEAD(entry);
}


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

x86 assembly (clang, -O2):
<clist_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <__list_del_entry@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @clist_del_init(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @__list_del_entry(%struct.list_head* %3)
%5 = load %struct.list_head*, %struct.list_head** %2
%6 = call i32 @INIT_LIST_HEAD(%struct.list_head* %5)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @clist_del_init(%struct.list_head* %0) {
%2 = tail call i32 @__list_del_entry(%struct.list_head* %0)
%3 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int lpc_uart_reg_read(int);
int lpc_uart_tx_full(void) { return !(lpc_uart_reg_read(5) & 0x20); }


x86 assembly (clang, -O0):
<lpc_uart_tx_full>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <lpc_uart_reg_read@plt>
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lpc_uart_tx_full>:
push   %rax
mov    $0x5,%edi
call   1030 <lpc_uart_reg_read@plt>
xor    %ecx,%ecx
test   $0x20,%al
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lpc_uart_tx_full() {
%1 = call i32 @lpc_uart_reg_read(i32 5)
%2 = and i32 %1, 32
%3 = icmp ne i32 %2, 0
%4 = xor i1 %3, true
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @lpc_uart_tx_full() {
%1 = tail call i32 @lpc_uart_reg_read(i32 5)
%2 = lshr i32 %1, 5
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Type definitions */
struct roff_node {
  int dummy;
};
struct roff_meta {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_offs(char *, int /*<<< orphan*/);
int pre_dl(const struct roff_meta *meta, struct roff_node *n) {
  print_offs("6n", 0);
  return 1;
}


x86 assembly (clang, -O0):
<pre_dl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rdi
xor    %esi,%esi
call   1030 <print_offs@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pre_dl>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <print_offs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
@.str = [3 x i8] c"6n\00"
define i32 @pre_dl(%struct.roff_meta* %0, %struct.roff_node* %1) {
%3 = alloca %struct.roff_meta*
%4 = alloca %struct.roff_node*
store %struct.roff_meta* %0, %struct.roff_meta** %3
store %struct.roff_node* %1, %struct.roff_node** %4
%5 = call i32 @print_offs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 1
}

LLVM IR (-O2):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
@.str = [3 x i8] c"6n\00"
define i32 @pre_dl(%struct.roff_meta* nocapture readnone %0, %struct.roff_node* nocapture readnone %1) {
%3 = tail call i32 @print_offs(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 1
}
/* Variables and functions */
double audit(bool (*result)(void)) {
  long tests = 999983;
  long head_count = 0;
  while (tests-- > 0) {
    if (result() == true)
      head_count++;
  }
  return (double)head_count / 999983;
}


x86 assembly (clang, -O0):
<audit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0xf422f,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jle    1152 <audit+0x52>
call   *-0x8(%rbp)
cmp    $0x1,%eax
jne    114d <audit+0x4d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <audit+0x1c>
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0xf4230,%ebx
xor    %r15d,%r15d
call   *%r14
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %rcx,%r15
add    $0xffffffffffffffff,%rbx
cmp    $0x1,%rbx
ja     1110 <audit+0x10>
cvtsi2sd %r15,%xmm0
divsd  0xecb(%rip),%xmm0
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define double @audit(i32 ()* %0) {
%2 = alloca i32 ()*
%3 = alloca i64
%4 = alloca i64
store i32 ()* %0, i32 ()** %2
store i64 999983, i64* %3
store i64 0, i64* %4
br label %5
5: ; preds = %16, %1
%6 = load i64, i64* %3
%7 = add nsw i64 %6, -1
store i64 %7, i64* %3
%8 = icmp sgt i64 %6, 0
br i1 %8, label %9, label %17
9: ; preds = %5
%10 = load i32 ()*, i32 ()** %2
%11 = call i32 %10()
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i64, i64* %4
%15 = add nsw i64 %14, 1
store i64 %15, i64* %4
br label %16
16: ; preds = %13, %9
br label %5
17: ; preds = %5
%18 = load i64, i64* %4
%19 = sitofp i64 %18 to double
%20 = fdiv double %19, 9.999830e+05
ret double %20
}

LLVM IR (-O2):
define double @audit(i32 ()* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %9, %2 ]
%4 = phi i64 [ 999983, %1 ], [ %5, %2 ]
%5 = add nsw i64 %4, -1
%6 = tail call i32 %0()
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i64
%9 = add nuw nsw i64 %3, %8
%10 = icmp ugt i64 %4, 1
br i1 %10, label %2, label %11
11: ; preds = %2
%12 = sitofp i64 %9 to double
%13 = fdiv double %12, 9.999830e+05
ret double %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char const *, char const *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
FILE *safe_fopen(const char *fn, const char *mode) {
  FILE *fd = fopen(fn, mode);
  if (fd == NULL) {
    fprintf(stderr, "(util) ERROR: cannot open file: %s\n", fn);
    exit(2);
  }
  return fd;
}


x86 assembly (clang, -O0):
<safe_fopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <safe_fopen+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fopen>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <safe_fopen+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"(util) ERROR: cannot open file: %s\0A\00"
define i32* @safe_fopen(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = call i32 @exit(i32 2)
unreachable
16: ; preds = %2
%17 = load i32*, i32** %5
ret i32* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"(util) ERROR: cannot open file: %s\0A\00"
define noalias i32* @safe_fopen(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 2)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_CUR;
scalar_t__ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
off_t sqImageFilePosition(int f) {
  off_t pos = lseek(f, 0, SEEK_CUR);
  if (pos == (off_t)-1)
    perror("sqImageFilePosition lseek");
  return pos;
}


x86 assembly (clang, -O0):
<sqImageFilePosition>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0xffffffffffffffff,-0x10(%rbp)
jne    1159 <sqImageFilePosition+0x39>
lea    0xeac(%rip),%rdi
call   1040 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqImageFilePosition>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
je     113f <sqImageFilePosition+0x1f>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xeba(%rip),%rdi
call   1040 <perror@plt>
jmp    113a <sqImageFilePosition+0x1a>

LLVM IR (-O0):
@SEEK_CUR = global i32 0
@.str = [26 x i8] c"sqImageFilePosition lseek\00"
define i64 @sqImageFilePosition(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SEEK_CUR
%6 = call i64 @lseek(i32 %4, i32 0, i32 %5)
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp eq i64 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@SEEK_CUR = global i32 0
@.str = [26 x i8] c"sqImageFilePosition lseek\00"
define i64 @sqImageFilePosition(i32 %0) {
%2 = load i32, i32* @SEEK_CUR
%3 = tail call i64 @lseek(i32 %0, i32 0, i32 %2)
%4 = icmp eq i64 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i64 %3
}
void seg_init() {}


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

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

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

LLVM IR (-O2):
define void @seg_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void boop() { printf("boop"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"boop\00"
define void @boop() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void rdu_unlock(struct rdu *p) {}


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

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

LLVM IR (-O0):
%struct.rdu = type opaque
define void @rdu_unlock(%struct.rdu* %0) {
%2 = alloca %struct.rdu*
store %struct.rdu* %0, %struct.rdu** %2
ret void
}

LLVM IR (-O2):
%struct.rdu = type opaque
define void @rdu_unlock(%struct.rdu* nocapture %0) {
ret void
}
void rcln_init() { ; }


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

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

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

LLVM IR (-O2):
define void @rcln_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void warn(char *s) { fprintf(stderr, "Warning: %s\n", s); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @warn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"Warning: %s\0A\00"
define void @warn(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
FILE *open_file_for_reading(char *externalname) {
  FILE *fd;
  fd = fopen(externalname, "r");
  if (fd == NULL) {
    fprintf(stderr, "Cannot open file %s\n", externalname);
    exit(1);
  }
  return fd;
}


x86 assembly (clang, -O0):
<open_file_for_reading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117e <open_file_for_reading+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe93(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file_for_reading>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <open_file_for_reading+0x17>
pop    %rbx
ret
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [21 x i8] c"Cannot open file %s\0A\00"
define i32* @open_file_for_reading(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i8*, i8** %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %1
%14 = load i32*, i32** %3
ret i32* %14
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.1 = [21 x i8] c"Cannot open file %s\0A\00"
define noalias i32* @open_file_for_reading(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ cterm();
int /*<<< orphan*/ cterms();
void bterm() {
  cterm();
  cterms();
}


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

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

LLVM IR (-O0):
define void @bterm() {
%1 = call i32 (...) @cterm()
%2 = call i32 (...) @cterms()
ret void
}

LLVM IR (-O2):
define void @bterm() {
%1 = tail call i32 (...) @cterm()
%2 = tail call i32 (...) @cterms()
ret void
}
char *_ecvt(value, ndigit, decpt, sign)
double value;
int ndigit, *decpt, *sign;
{ return cvt(value, ndigit, decpt, sign, 1); }


x86 assembly (clang, -O0):
<_ecvt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ecvt>:
push   %rax
mov    $0x1,%ecx
mov    $0x1,%al
call   1030 <cvt@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @_ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca double
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store double %0, double* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load double, double* %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %9, i32 %10, i32* %11, i32* %12, i32 1)
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @_ecvt(double %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 (double, i32, i32*, i32*, i32, ...) bitcast (i32 (...)* @cvt to i32 (double, i32, i32*, i32*, i32, ...)*)(double %0, i32 %1, i32* %2, i32* %3, i32 1)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
char *mallo(n) {
  register char *p;
  p = malloc(n);
  if (!p) {
    printf("Out of memory !");
    exit(-1);
  }
  return (p);
}


x86 assembly (clang, -O0):
<mallo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116b <mallo+0x3b>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mallo>:
push   %rax
movslq %edi,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <mallo+0x10>
pop    %rcx
ret
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Out of memory !\00"
define i8* @mallo(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = call i8* @malloc(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 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"Out of memory !\00"
define noalias i8* @mallo(i32 %0) {
%2 = sext i32 %0 to i64
%3 = tail call i8* @malloc(i64 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
tail call void @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %3
}
/* Type definitions */
struct stat {
  int st_size;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int get_file_size(const char *filename) {
  struct stat buf;
  if (stat(filename, &buf) < 0) {
    return 0;
  }
  return buf.st_size;
}


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

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1126 <get_file_size+0x16>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_file_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float a, b;
  scanf("%f %f", &a, &b);
  printf("%.2f", a / b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
lea    0xeb2(%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>
movss  0x4(%rsp),%xmm0
divss  (%rsp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [5 x i8] c"%.2f\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %1
%7 = load float, float* %2
%8 = fdiv float %6, %7
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %8)
ret i32 0
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int);
int get_list(int *list, int len) {
  srand(374676);
  int i = 0;
  for (i = 0; i < len; i++) {
    list[i] = rand() % (len * 20);
  }
  return 0;
}


x86 assembly (clang, -O0):
<get_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x5b794,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117a <get_list+0x5a>
mov    $0x0,%al
call   1040 <rand@plt>
imul   $0x14,-0xc(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1147 <get_list+0x27>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_list>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    $0x5b794,%edi
call   1030 <srand@plt>
test   %r14d,%r14d
jle    1168 <get_list+0x48>
lea    0x0(,%r14,4),%eax
lea    (%rax,%rax,4),%r12d
mov    %r14d,%ebx
xor    %ebp,%ebp
xchg   %ax,%ax
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %r12d
mov    %edx,(%r15,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1150 <get_list+0x30>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_list(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 @srand(i32 374676)
store i32 0, i32* %5
store i32 0, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = call i32 (...) @rand()
%13 = load i32, i32* %4
%14 = mul nsw i32 %13, 20
%15 = srem i32 %12, %14
%16 = load i32*, i32** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @get_list(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @srand(i32 374676)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = mul nsw i32 %1, 20
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ 0, %5 ], [ %13, %8 ]
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, %6
%12 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %11, i32* %12
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %2
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_fits(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void mpz_check_fit(mpz_t z, uint32_t k) {
  if (!mpz_fits(z, k)) {
    printf("*** BUG: check_fit failed ***\n");
    fflush(stdout);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<mpz_check_fit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1060 <mpz_fits@plt>
cmp    $0x0,%eax
jne    1186 <mpz_check_fit+0x46>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_check_fit>:
push   %rax
call   1060 <mpz_fits@plt>
test   %eax,%eax
je     114c <mpz_check_fit+0xc>
pop    %rax
ret
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"*** BUG: check_fit failed ***\0A\00"
@stdout = global i32 0
define void @mpz_check_fit(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 @mpz_fits(i32 %5, i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [30 x i8] c"*** BUG: check_fit failed ***\00"
define void @mpz_check_fit(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_fits(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %2
ret void
}
void pci_dpc_init(struct pci_dev *pdev) {}


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

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

LLVM IR (-O0):
%struct.pci_dev = type opaque
define void @pci_dpc_init(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_dpc_init(%struct.pci_dev* nocapture %0) {
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t __rbeu32(uint8_t *buffer) {
  return ((uint32_t)buffer[0] << 24) | ((uint32_t)buffer[1] << 16) |
         ((uint32_t)buffer[2] << 8) | ((uint32_t)buffer[3] << 0);
}


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

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

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

LLVM IR (-O2):
define i32 @__rbeu32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i64, i64* %0, i64 2
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i64, i64* %0, i64 3
%16 = load i64, i64* %15
%17 = trunc i64 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ RAND_pseudo_bytes(unsigned char *, int);
int Rand(void) {
  unsigned char x[2];
  RAND_pseudo_bytes(x, 2);
  return (x[0] + 2 * x[1]);
}


x86 assembly (clang, -O0):
<Rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x2(%rbp),%rdi
mov    $0x2,%esi
call   1030 <RAND_pseudo_bytes@plt>
movzbl -0x2(%rbp),%eax
movzbl -0x1(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rand>:
push   %rax
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <RAND_pseudo_bytes@plt>
movzbl 0x6(%rsp),%eax
movzbl 0x7(%rsp),%ecx
lea    (%rax,%rcx,2),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Rand() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @RAND_pseudo_bytes(i8* %2, i32 2)
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = mul nsw i32 2, %9
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @Rand() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = call i32 @RAND_pseudo_bytes(i8* %2, i32 2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 1
%10 = add nuw nsw i32 %9, %5
ret i32 %10
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct datafile_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_free(struct genlist *);
void datafile_list_free(struct datafile_list *tthis) {
  genlist_free(((struct genlist *)(tthis)));
}


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

x86 assembly (clang, -O2):
<datafile_list_free>:
jmp    1030 <genlist_free@plt>

LLVM IR (-O0):
%struct.datafile_list = type { i32 }
%struct.genlist = type { i32 }
define void @datafile_list_free(%struct.datafile_list* %0) {
%2 = alloca %struct.datafile_list*
store %struct.datafile_list* %0, %struct.datafile_list** %2
%3 = load %struct.datafile_list*, %struct.datafile_list** %2
%4 = bitcast %struct.datafile_list* %3 to %struct.genlist*
%5 = call i32 @genlist_free(%struct.genlist* %4)
ret void
}

LLVM IR (-O2):
%struct.datafile_list = type { i32 }
%struct.genlist = type { i32 }
define void @datafile_list_free(%struct.datafile_list* %0) {
%2 = bitcast %struct.datafile_list* %0 to %struct.genlist*
%3 = tail call i32 @genlist_free(%struct.genlist* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage() {
  fprintf(stderr, "Usage: compress [-fvc] [-b maxbits] [file ...]\n");
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: compress [-fvc] [-b maxbits] [file ...]\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: compress [-fvc] [-b maxbits] [file ...]\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t inv_31(uint8_t a) {
  static const uint8_t _inv[32] = {0,  1,  16, 21, 8,  25, 26, 9,  4,  7,  28,
                                   17, 13, 12, 20, 29, 2,  11, 19, 18, 14, 3,
                                   24, 27, 22, 5,  6,  23, 10, 15, 30, 0};
  return _inv[a & 0x1f];
}


x86 assembly (clang, -O0):
<inv_31>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
movslq %eax,%rcx
lea    0xee9(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_31>:
and    $0x1f,%edi
lea    0xef6(%rip),%rax
mov    (%rax,%rdi,4),%eax
ret

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

LLVM IR (-O2):
@inv_31._inv = internal unnamed_addr constant [32 x i32] [i32 0, i32 1, i32 16, i32 21, i32 8, i32 25, i32 26, i32 9, i32 4, i32 7, i32 28, i32 17, i32 13, i32 12, i32 20, i32 29, i32 2, i32 11, i32 19, i32 18, i32 14, i32 3, i32 24, i32 27, i32 22, i32 5, i32 6, i32 23, i32 10, i32 15, i32 30, i32 0]
define i32 @inv_31(i32 %0) {
%2 = and i32 %0, 31
%3 = zext i32 %2 to i64
%4 = getelementptr inbounds [32 x i32], [32 x i32]* @inv_31._inv, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
size_t minipack_sizeof_double() { return 9; }


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

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

LLVM IR (-O0):
define i64 @minipack_sizeof_double() {
ret i64 9
}

LLVM IR (-O2):
define i64 @minipack_sizeof_double() {
ret i64 9
}
void disable_ext_interrupt(void) {
  (*(volatile unsigned long *)(((0xFFFFF000) + 0x014))) = 0x4000;
  (*(volatile unsigned long *)((0xE002C004))) = 0x0;
  (*(volatile unsigned long *)((0xE01FC140))) = 0x1;
}


x86 assembly (clang, -O0):
<disable_ext_interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffff014,%eax
movq   $0x4000,(%rax)
mov    $0xe002c004,%eax
movq   $0x0,(%rax)
mov    $0xe01fc140,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_ext_interrupt>:
mov    $0xe002c004,%eax
movq   $0x4000,0x1ffd3010(%rax)
movq   $0x0,(%rax)
movq   $0x1,0x1d013c(%rax)
ret

LLVM IR (-O0):
define void @disable_ext_interrupt() {
store volatile i64 16384, i64* inttoptr (i64 4294963220 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758276612 to i64*)
store volatile i64 1, i64* inttoptr (i64 3760177472 to i64*)
ret void
}

LLVM IR (-O2):
define void @disable_ext_interrupt() {
store volatile i64 16384, i64* inttoptr (i64 4294963220 to i64*)
store volatile i64 0, i64* inttoptr (i64 3758276612 to i64*)
store volatile i64 1, i64* inttoptr (i64 3760177472 to i64*)
ret void
}