xunge/DecIR huggingface dataset:
void _Jv_ResolvePoolEntry() {}


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

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

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

LLVM IR (-O2):
define void @_Jv_ResolvePoolEntry() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char **cz(int sz) { return (char **)malloc(sizeof(char *) * sz); }


x86 assembly (clang, -O0):
<cz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cz>:
shl    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8** @cz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 8, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8**
ret i8** %8
}

LLVM IR (-O2):
define i8** @cz(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i8**
ret i8** %4
}
/* Variables and functions */
void *sfxnew(char const *);
void *sfxload(const char *path, void *_ignrd) { return sfxnew(path); }


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

x86 assembly (clang, -O2):
<sfxload>:
jmp    1030 <sfxnew@plt>

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

LLVM IR (-O2):
define i8* @sfxload(i8* %0, i8* nocapture readnone %1) {
%3 = tail call i8* @sfxnew(i8* %0)
ret i8* %3
}
/* Variables and functions */
int strlen(char const *);
extern int NCstrlen(const char *x) { return strlen(x); }


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

x86 assembly (clang, -O2):
<NCstrlen>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @NCstrlen(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int __send_to_ppe(int, int, int *);
int getchar() {
  int ret;
  ;
  return __send_to_ppe(0x2100, 20, &ret);
}


x86 assembly (clang, -O0):
<getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2100,%edi
mov    $0x14,%esi
lea    -0x4(%rbp),%rdx
call   1030 <__send_to_ppe@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchar>:
push   %rax
lea    0x4(%rsp),%rdx
mov    $0x2100,%edi
mov    $0x14,%esi
call   1030 <__send_to_ppe@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getchar() {
%1 = alloca i32
%2 = call i32 @__send_to_ppe(i32 8448, i32 20, i32* %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @getchar() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @__send_to_ppe(i32 8448, i32 20, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int);
void buf_int(char *buf, int val) { snprintf(buf, 4096, "%d", val); }


x86 assembly (clang, -O0):
<buf_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x1000,%esi
lea    0xece(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_int>:
mov    %esi,%ecx
lea    0xee7(%rip),%rdx
mov    $0x1000,%esi
jmp    1030 <snprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @buf_int(i8* %0, i32 %1) {
%3 = tail call i32 @snprintf(i8* %0, i32 4096, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
size_t max(size_t lhs, size_t rhs) { return lhs < rhs ? rhs : lhs; }


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
jae    1127 <max+0x27>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rdi,%rax
cmp    %rsi,%rdi
cmovb  %rsi,%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 ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %4
br label %12
10: ; preds = %2
%11 = load i64, i64* %3
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 ult i64 %0, %1
%4 = select i1 %3, i64 %1, i64 %0
ret i64 %4
}
__attribute__((always_)) void vmk_CPUMemFenceRead(void) {
  asm volatile("lfence" ::: "memory");
}


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

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

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

LLVM IR (-O2):
define void @vmk_CPUMemFenceRead() {
tail call void asm sideeffect "lfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello() { printf("test/include hello()!\n"); }


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

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

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

LLVM IR (-O2):
@str = [22 x i8] c"test/include hello()!\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, char *);
scalar_t__ file_exists(char *);
int /*<<< orphan*/ unlink(char *);
int file_remove(char *filename) {
  if (file_exists(filename)) {
    debug("Removing file '%s'...", filename);
    return (!unlink(filename));
  }
  return 1;
}


x86 assembly (clang, -O0):
<file_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <file_exists@plt>
cmp    $0x0,%rax
je     117d <file_remove+0x4d>
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <debug@plt>
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <file_remove+0x54>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_remove>:
push   %rbx
mov    %rdi,%rbx
call   1040 <file_exists@plt>
test   %rax,%rax
je     1160 <file_remove+0x30>
lea    0xebb(%rip),%rdi
mov    %rbx,%rsi
call   1050 <debug@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Removing file '%s'...\00"
define i32 @file_remove(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @file_exists(i8* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @debug(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %3
%11 = call i32 @unlink(i8* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
store i32 %14, i32* %2
br label %16
15: ; preds = %1
store i32 1, i32* %2
br label %16
16: ; preds = %15, %7
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@.str = [22 x i8] c"Removing file '%s'...\00"
define i32 @file_remove(i8* %0) {
%2 = tail call i64 @file_exists(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 @debug(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @unlink(i8* %0)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 1, %1 ]
ret i32 %10
}
void winconstraints_() {}


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

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

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

LLVM IR (-O2):
define void @winconstraints_() {
ret void
}
double ldexp(double value, int exp) {
  double temp, texp, temp2;
  texp = exp;
  __asm("fscale " : "=u"(temp2), "=t"(temp) : "0"(texp), "1"(value));
  return (temp);
}


x86 assembly (clang, -O0):
<ldexp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  %xmm1,-0x30(%rbp)
movsd  %xmm0,-0x38(%rbp)
fldl   -0x30(%rbp)
fldl   -0x38(%rbp)
fscale
fstpl  -0x48(%rbp)
fstpl  -0x40(%rbp)
movsd  -0x48(%rbp),%xmm0
movsd  -0x40(%rbp),%xmm1
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldexp>:
cvtsi2sd %edi,%xmm1
movsd  %xmm0,-0x8(%rsp)
movsd  %xmm1,-0x10(%rsp)
fldl   -0x8(%rsp)
fldl   -0x10(%rsp)
fxch   %st(1)
fscale
fstp   %st(1)
fstpl  -0x18(%rsp)
movsd  -0x18(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @ldexp(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
store double %9, double* %6
%10 = load double, double* %6
%11 = load double, double* %3
%12 = call { double, double } asm "fscale ", "={st(1)},={st},0,1,~{dirflag},~{fpsr},~{flags}"(double %10, double %11)
%13 = extractvalue { double, double } %12, 0
%14 = extractvalue { double, double } %12, 1
store double %13, double* %7
store double %14, double* %5
%15 = load double, double* %5
ret double %15
}

LLVM IR (-O2):
define double @ldexp(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = tail call { double, double } asm "fscale ", "={st(1)},={st},0,1,~{dirflag},~{fpsr},~{flags}"(double %3, double %0)
%5 = extractvalue { double, double } %4, 1
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ STD_opts_help();
void print_help(void (*user_help)()) {
  STD_opts_help();
  if (user_help)
    user_help();
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <STD_opts_help@plt>
cmpq   $0x0,-0x8(%rbp)
je     1133 <print_help+0x23>
mov    $0x0,%al
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <STD_opts_help@plt>
test   %rbx,%rbx
je     1128 <print_help+0x18>
mov    %rbx,%rcx
xor    %eax,%eax
pop    %rbx
jmp    *%rcx
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_help(void (...)* %0) {
%2 = tail call i32 (...) @STD_opts_help()
%3 = icmp eq void (...)* %0, null
br i1 %3, label %5, label %4
4: ; preds = %1
tail call void (...) %0()
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int LPCChannelValid(unsigned long);
unsigned long LPCChannelStatusGet(unsigned long ulBase,
                                  unsigned long ulChannel) {
  DEBUG_ASSERT(ulBase == 0x40080000);
  DEBUG_ASSERT(LPCChannelValid(ulChannel));
  return ((
      *((volatile unsigned long *)(ulBase + 0x00000014 + (ulChannel * 0x10)))));
}


x86 assembly (clang, -O0):
<LPCChannelStatusGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40080000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rdi
call   1040 <LPCChannelValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCChannelStatusGet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40080000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    %rbx,%rdi
call   1040 <LPCChannelValid@plt>
mov    %eax,%edi
call   1030 <DEBUG_ASSERT@plt>
shl    $0x4,%rbx
mov    0x14(%r14,%rbx,1),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @LPCChannelStatusGet(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 = icmp eq i64 %5, 1074266112
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = call i32 @LPCChannelValid(i64 %9)
%11 = call i32 @DEBUG_ASSERT(i32 %10)
%12 = load i64, i64* %3
%13 = add i64 %12, 20
%14 = load i64, i64* %4
%15 = mul i64 %14, 16
%16 = add i64 %13, %15
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
ret i64 %18
}

LLVM IR (-O2):
define i64 @LPCChannelStatusGet(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074266112
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = tail call i32 @LPCChannelValid(i64 %1)
%7 = tail call i32 @DEBUG_ASSERT(i32 %6)
%8 = add i64 %0, 20
%9 = shl i64 %1, 4
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
ret i64 %12
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ showcard(int);
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int x, c;
  srand((unsigned)time(NULL));
  for (x = 0; x < 52; x++) {
    c = rand() % 52;
    showcard(c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x34,-0x8(%rbp)
jge    1198 <main+0x58>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x34,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <showcard@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x26>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x34,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rdi
imul   $0x4ec4ec4f,%rdi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
imul   $0x34,%eax,%eax
sub    %eax,%edi
call   1050 <showcard@plt>
add    $0xffffffff,%ebx
jne    1160 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i64 @time(i32* null)
%5 = trunc i64 %4 to i32
%6 = call i32 @srand(i32 %5)
store i32 0, i32* %2
br label %7
7: ; preds = %15, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 52
br i1 %9, label %10, label %18
10: ; preds = %7
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 52
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = call i32 @showcard(i32 %13)
br label %15
15: ; preds = %10
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %7
18: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %9, %4 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 52
%8 = tail call i32 @showcard(i32 %7)
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, 52
br i1 %10, label %11, label %4
11: ; preds = %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ delay_us(int);
void delay_ms(unsigned int time) {
  while (time--) {
    delay_us(1000);
  }
}


x86 assembly (clang, -O0):
<delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113e <delay_ms+0x2e>
mov    $0x3e8,%edi
call   1030 <delay_us@plt>
jmp    111b <delay_ms+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_ms>:
push   %rbx
test   %edi,%edi
je     112f <delay_ms+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <delay_us@plt>
add    $0xffffffff,%ebx
jne    1120 <delay_ms+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @delay_ms(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add i32 %4, -1
%6 = tail call i32 @delay_us(i32 1000)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rgph_d2u64(double);
int /*<<< orphan*/ rgph_u64_t1ha64s_u64(int /*<<< orphan*/, uintptr_t);
uint64_t rgph_u64_t1ha64s_f64(double value, uintptr_t seed) {
  return rgph_u64_t1ha64s_u64(rgph_d2u64(value), seed);
}


x86 assembly (clang, -O0):
<rgph_u64_t1ha64s_f64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <rgph_u64_t1ha64s_u64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u64_t1ha64s_f64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <rgph_d2u64@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <rgph_u64_t1ha64s_u64@plt>

LLVM IR (-O0):
define i32 @rgph_u64_t1ha64s_f64(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load double, double* %3
%6 = call i32 @rgph_d2u64(double %5)
%7 = load i64, i64* %4
%8 = call i32 @rgph_u64_t1ha64s_u64(i32 %6, i64 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @rgph_u64_t1ha64s_f64(double %0, i64 %1) {
%3 = tail call i32 @rgph_d2u64(double %0)
%4 = tail call i32 @rgph_u64_t1ha64s_u64(i32 %3, i64 %1)
ret i32 %4
}
void prime3(void) {
  extern int foo3;
  extern int bar3(int);
  extern int baz3;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
float ntohf(uint32_t netfloat) {
  union {
    float _float;
    uint32_t _int;
  } val;
  val._int = ntohl(netfloat);
  return val._float;
}


x86 assembly (clang, -O0):
<ntohf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ntohf>:
push   %rax
call   1030 <ntohl@plt>
movd   %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%union.anon = type { float }
define float @ntohf(i32 %0) {
%2 = alloca i32
%3 = alloca %union.anon
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ntohl(i32 %4)
%6 = bitcast %union.anon* %3 to i32*
store i32 %5, i32* %6
%7 = bitcast %union.anon* %3 to float*
%8 = load float, float* %7
ret float %8
}

LLVM IR (-O2):
define float @ntohf(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
%3 = bitcast i32 %2 to float
ret float %3
}
/* Variables and functions */
int random_int(int);
int get_next_engine_index(int engines_length, int previous_engine_index) {
  int ret = previous_engine_index;
  while (ret == previous_engine_index) {
    ret = random_int(engines_length);
  }
  return ret;
}


x86 assembly (clang, -O0):
<get_next_engine_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1140 <get_next_engine_index+0x30>
mov    -0x4(%rbp),%edi
call   1030 <random_int@plt>
mov    %eax,-0xc(%rbp)
jmp    1124 <get_next_engine_index+0x14>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_engine_index>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <random_int@plt>
cmp    %ebx,%eax
je     1120 <get_next_engine_index+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_next_engine_index(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* %4
store i32 %6, i32* %5
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = call i32 @random_int(i32 %12)
store i32 %13, i32* %5
br label %7
14: ; preds = %7
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_next_engine_index(i32 %0, i32 %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @random_int(i32 %0)
%5 = icmp eq i32 %4, %1
br i1 %5, label %3, label %6
6: ; preds = %3
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, int, int);
char *stats_filename(int q, int n) {
  char *filename = malloc(sizeof(char *) * 20);
  sprintf(filename, "%s_q%d_n%d", "output", q, n);
  return filename;
}


x86 assembly (clang, -O0):
<stats_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xa0,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
lea    0xeb2(%rip),%rsi
lea    0xeb6(%rip),%rdx
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stats_filename>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    $0xa0,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec3(%rip),%rsi
lea    0xec7(%rip),%rdx
mov    %rax,%rdi
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1040 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%s_q%d_n%d\00"
@.str.1 = [7 x i8] c"output\00"
define i8* @stats_filename(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i8* @malloc(i32 160)
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s_q%d_n%d\00"
@.str.1 = [7 x i8] c"output\00"
define noalias i8* @stats_filename(i32 %0, i32 %1) {
%3 = tail call dereferenceable_or_null(160) i8* @malloc(i32 160)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %1)
ret i8* %3
}
unsigned xrop3_33_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_33_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_33_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    $0xff,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_33_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = xor i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_33_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = or i32 %7, %4
%9 = xor i32 %8, -1
%10 = or i32 %9, %3
ret i32 %10
}
/* Variables and functions */
int yywrap();
int defwrap(void) { return yywrap(); }


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

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

LLVM IR (-O0):
define i32 @defwrap() {
%1 = call i32 (...) @yywrap()
ret i32 %1
}

LLVM IR (-O2):
define i32 @defwrap() {
%1 = tail call i32 (...) @yywrap()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int SET_ERRNO(int /*<<< orphan*/);
int chown(const char *path, uid_t owner, gid_t group) {
  (void)path;
  (void)owner;
  (void)group;
  return SET_ERRNO(ENOSYS);
}


x86 assembly (clang, -O0):
<chown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
call   1030 <SET_ERRNO@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chown>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <SET_ERRNO@plt>

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @chown(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @ENOSYS
%11 = call i32 @SET_ERRNO(i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @chown(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @SET_ERRNO(i32 %4)
ret i32 %5
}
void maple_wait_dma() {
  while ((*(volatile unsigned long *)(0xa05f6c00 + (0x18))) & 1)
    ;
}


x86 assembly (clang, -O0):
<maple_wait_dma>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <maple_wait_dma+0x9>
mov    $0xa05f6c18,%eax
mov    (%rax),%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     1124 <maple_wait_dma+0x24>
jmp    1109 <maple_wait_dma+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<maple_wait_dma>:
mov    $0xa05f6c18,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rax),%rcx
test   $0x1,%cl
jne    1110 <maple_wait_dma+0x10>
ret

LLVM IR (-O0):
define void @maple_wait_dma() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i64, i64* inttoptr (i64 2690608152 to i64*)
%3 = and i64 %2, 1
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @maple_wait_dma() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 2690608152 to i64*)
%3 = and i64 %2, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ serial;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xselection_serial(void *_p) {
  return (unsigned long)((XEvent *)_p)->xselection.serial;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xselection_serial(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
double InBeta(long, long, double);
double cdfBinomial(long n, double p, long x) {
  if (x < n)
    return (1.0 - InBeta(x + 1, n - x, p));
  else
    return (1.0);
}


x86 assembly (clang, -O0):
<cdfBinomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1166 <cdfBinomial+0x56>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
sub    -0x20(%rbp),%rsi
movsd  -0x18(%rbp),%xmm0
call   1030 <InBeta@plt>
movaps %xmm0,%xmm1
movsd  0xea8(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1173 <cdfBinomial+0x63>
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdfBinomial>:
push   %rax
mov    %rdi,%rax
sub    %rsi,%rax
jle    113a <cdfBinomial+0x2a>
add    $0x1,%rsi
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <InBeta@plt>
movapd %xmm0,%xmm1
movsd  0xecc(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rax
ret
movsd  0xebe(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @cdfBinomial(i64 %0, double %1, i64 %2) {
%4 = alloca double
%5 = alloca i64
%6 = alloca double
%7 = alloca i64
store i64 %0, i64* %5
store double %1, double* %6
store i64 %2, i64* %7
%8 = load i64, i64* %7
%9 = load i64, i64* %5
%10 = icmp slt i64 %8, %9
br i1 %10, label %11, label %20
11: ; preds = %3
%12 = load i64, i64* %7
%13 = add nsw i64 %12, 1
%14 = load i64, i64* %5
%15 = load i64, i64* %7
%16 = sub nsw i64 %14, %15
%17 = load double, double* %6
%18 = call double @InBeta(i64 %13, i64 %16, double %17)
%19 = fsub double 1.000000e+00, %18
store double %19, double* %4
br label %21
20: ; preds = %3
store double 1.000000e+00, double* %4
br label %21
21: ; preds = %20, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @cdfBinomial(i64 %0, double %1, i64 %2) {
%4 = icmp sgt i64 %0, %2
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = add nsw i64 %2, 1
%7 = sub nsw i64 %0, %2
%8 = tail call double @InBeta(i64 %6, i64 %7, double %1)
%9 = fsub double 1.000000e+00, %8
br label %10
10: ; preds = %3, %5
%11 = phi double [ %9, %5 ], [ 1.000000e+00, %3 ]
ret double %11
}
int get4() { return 4; }


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

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

LLVM IR (-O0):
define i32 @get4() {
ret i32 4
}

LLVM IR (-O2):
define i32 @get4() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void setnonblocking(int fd) {
  int flag = fcntl(fd, F_GETFL, 0);
  fcntl(fd, F_SETFL, flag | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<setnonblocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setnonblocking>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @setnonblocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @setnonblocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret void
}
const char *get_version(void) { return ("0.1"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"0.1\00"
define i8* @get_version() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ write(int, char *, int);
void _start(void) {
  write(1, "Hello World\n", 12);
  exit(0);
}


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xed0(%rip),%rsi
mov    $0xc,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0xc,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
define void @_start() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello World\0A\00"
define void @_start() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12)
%2 = tail call i32 @exit(i32 0)
unreachable
}
void ASN1_INTEGER_free(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_INTEGER_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char const *);
__attribute__((no)) void puts(const char *str) {
  print(str);
  print("\n");
}


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

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1030 <print@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <print@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @puts(i8* %0) {
%2 = tail call i32 @print(i8* %0)
%3 = tail call i32 @print(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned xrop3_114_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = T ^ S;
  stk2 = D | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_114_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_114_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
shl    $0x8,%esi
xor    %eax,%esi
or     %edi,%eax
lea    0xff(%rsi),%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_114_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = xor i32 %7, %4
%9 = or i32 %8, 255
%10 = xor i32 %5, -1
%11 = and i32 %9, %10
%12 = or i32 %11, %3
ret i32 %12
}
/* Variables and functions */
scalar_t__ Eoln();
scalar_t__ IsCommandSeparator(int /*<<< orphan*/);
int /*<<< orphan*/ NextCh();
int DwEoln(void) { return Eoln() || IsCommandSeparator(NextCh()); }


x86 assembly (clang, -O0):
<DwEoln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Eoln@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x1(%rbp)
jne    1169 <DwEoln+0x39>
mov    $0x0,%al
call   1040 <NextCh@plt>
mov    %eax,%edi
call   1050 <IsCommandSeparator@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DwEoln>:
push   %rax
xor    %eax,%eax
call   1030 <Eoln@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1147 <DwEoln+0x17>
pop    %rcx
ret
xor    %eax,%eax
call   1040 <NextCh@plt>
mov    %eax,%edi
call   1050 <IsCommandSeparator@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DwEoln() {
%1 = call i64 (...) @Eoln()
%2 = icmp ne i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i32 (...) @NextCh()
%5 = call i64 @IsCommandSeparator(i32 %4)
%6 = icmp ne i64 %5, 0
br label %7
7: ; preds = %3, %0
%8 = phi i1 [ true, %0 ], [ %6, %3 ]
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @DwEoln() {
%1 = tail call i64 (...) @Eoln()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 (...) @NextCh()
%5 = tail call i64 @IsCommandSeparator(i32 %4)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %0
%9 = phi i32 [ 1, %0 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr(char *);
void ft_putminint(void) { ft_putstr("-2147483648"); }


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"-2147483648\00"
define void @ft_putminint() {
%1 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret void
}
int getMedian(int arr[], int n) {
  if (n % 2 == 0)
    return (arr[n / 2 - 1] + arr[n / 2]) / 2;
  else
    return arr[n / 2];
}


x86 assembly (clang, -O0):
<getMedian>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    116e <getMedian+0x6e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x18(%rbp),%eax
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1190 <getMedian+0x90>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMedian>:
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
cltq
test   $0x1,%sil
jne    1122 <getMedian+0x22>
mov    (%rdi,%rax,4),%ecx
add    -0x4(%rdi,%rax,4),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getMedian(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = srem i32 %6, 2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %2
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = sdiv i32 %11, 2
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %10, i64 %14
%16 = load i32, i32* %15
%17 = load i32*, i32** %4
%18 = load i32, i32* %5
%19 = sdiv i32 %18, 2
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %17, i64 %20
%22 = load i32, i32* %21
%23 = add nsw i32 %16, %22
%24 = sdiv i32 %23, 2
store i32 %24, i32* %3
br label %32
25: ; preds = %2
%26 = load i32*, i32** %4
%27 = load i32, i32* %5
%28 = sdiv i32 %27, 2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i32, i32* %26, i64 %29
%31 = load i32, i32* %30
store i32 %31, i32* %3
br label %32
32: ; preds = %25, %9
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @getMedian(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
%5 = sdiv i32 %1, 2
br i1 %4, label %6, label %16
6: ; preds = %2
%7 = add nsw i32 %5, -1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = sext i32 %5 to i64
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %10
%15 = sdiv i32 %14, 2
br label %20
16: ; preds = %2
%17 = sext i32 %5 to i64
%18 = getelementptr inbounds i32, i32* %0, i64 %17
%19 = load i32, i32* %18
br label %20
20: ; preds = %16, %6
%21 = phi i32 [ %15, %6 ], [ %19, %16 ]
ret i32 %21
}
long gvpriw(long index) {
  extern long *iwork;
  return *(iwork + index);
}


x86 assembly (clang, -O0):
<gvpriw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gvpriw>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
mov    (%rax,%rdi,8),%rax
ret

LLVM IR (-O0):
@iwork = external global i64*
define i64 @gvpriw(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64*, i64** @iwork
%4 = load i64, i64* %2
%5 = getelementptr inbounds i64, i64* %3, i64 %4
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
@iwork = external global i64*
define i64 @gvpriw(i64 %0) {
%2 = load i64*, i64** @iwork
%3 = getelementptr inbounds i64, i64* %2, i64 %0
%4 = load i64, i64* %3
ret i64 %4
}
void double_dtor(double *self) {}


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

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

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

LLVM IR (-O2):
define void @double_dtor(double* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test3() { printf("test3\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"test3\00"
define void @test3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}