xunge/DecIR huggingface dataset:
/* Variables and functions */
int ssds_add_group_item(int, char *, int /*<<< orphan*/ *, char *, int);
int ssds_create_group(int pcfd, char *list_name, char *res, int rlen) {
  return ssds_add_group_item(pcfd, list_name, NULL, res, rlen);
}


x86 assembly (clang, -O0):
<ssds_create_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edx
call   1030 <ssds_add_group_item@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_create_group>:
mov    %ecx,%r8d
mov    %rdx,%rcx
xor    %edx,%edx
jmp    1030 <ssds_add_group_item@plt>

LLVM IR (-O0):
define i32 @ssds_create_group(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i32 @ssds_add_group_item(i32 %9, i8* %10, i32* null, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @ssds_create_group(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i32 @ssds_add_group_item(i32 %0, i8* %1, i32* null, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int);
void init(int *a, int size) {
  int i;
  srand(1);
  for (i = 0; i < size; i++) {
    a[i] = rand() % (size);
  }
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <init+0x50>
mov    $0x0,%al
call   1040 <rand@plt>
cltd
idivl  -0xc(%rbp)
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    1140 <init+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r15d
mov    %rdi,%r14
mov    $0x1,%edi
call   1030 <srand@plt>
test   %r15d,%r15d
jle    1168 <init+0x48>
mov    %r15d,%ebx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
cltd
idiv   %r15d
mov    %edx,(%r14,%rbp,4)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1150 <init+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @init(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 1)
store i32 0, i32* %5
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = call i32 (...) @rand()
%13 = load i32, i32* %4
%14 = srem i32 %12, %13
%15 = load i32*, i32** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i32, i32* %15, i64 %17
store i32 %14, i32* %18
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @init(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @srand(i32 1)
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, %1
%11 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %10, i32* %11
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ seq_engine_set_kbtrans(int);
void seq_ctrl_set_kbtrans(int kbtrans) { seq_engine_set_kbtrans(kbtrans); }


x86 assembly (clang, -O0):
<seq_ctrl_set_kbtrans>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <seq_engine_set_kbtrans@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_ctrl_set_kbtrans>:
jmp    1030 <seq_engine_set_kbtrans@plt>

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

LLVM IR (-O2):
define void @seq_ctrl_set_kbtrans(i32 %0) {
%2 = tail call i32 @seq_engine_set_kbtrans(i32 %0)
ret void
}
void test_buffer_17() {
  ;
  { return; };
}


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

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

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

LLVM IR (-O2):
define void @test_buffer_17() {
ret void
}
int compare_ascend(int one, int other) { return other - one; }


x86 assembly (clang, -O0):
<compare_ascend>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_ascend>:
mov    %esi,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @compare_ascend(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @compare_ascend(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ operation_sleep();
int /*<<< orphan*/ set_wakeup_timer(int, int, int /*<<< orphan*/);
int main() {
  delay(10000);
  set_wakeup_timer(100, 1, 0);
  operation_sleep();
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2710,%edi
call   1030 <delay@plt>
mov    $0x64,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <set_wakeup_timer@plt>
mov    $0x0,%al
call   1040 <operation_sleep@plt>
jmp    1161 <main+0x31>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2710,%edi
call   1030 <delay@plt>
mov    $0x64,%edi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <set_wakeup_timer@plt>
xor    %eax,%eax
call   1040 <operation_sleep@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
jmp    1160 <main+0x30>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @delay(i32 10000)
%3 = call i32 @set_wakeup_timer(i32 100, i32 1, i32 0)
%4 = call i32 (...) @operation_sleep()
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @delay(i32 10000)
%2 = tail call i32 @set_wakeup_timer(i32 100, i32 1, i32 0)
%3 = tail call i32 (...) @operation_sleep()
br label %4
4: ; preds = %0, %4
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ GL_UNPACK_ALIGNMENT;
int /*<<< orphan*/ glClearColor(double, double, double, double);
int /*<<< orphan*/ glPixelStorei(int /*<<< orphan*/, int);
void init(void) {
  glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
  glClearColor(0.0, 0.0, 0.0, 0.0);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <glPixelStorei@plt>
xorps  %xmm3,%xmm3
movaps %xmm3,%xmm0
movaps %xmm3,%xmm1
movaps %xmm3,%xmm2
call   1040 <glClearColor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%esi
call   1030 <glPixelStorei@plt>
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
xorps  %xmm3,%xmm3
pop    %rax
jmp    1040 <glClearColor@plt>

LLVM IR (-O0):
@GL_UNPACK_ALIGNMENT = global i32 0
define void @init() {
%1 = load i32, i32* @GL_UNPACK_ALIGNMENT
%2 = call i32 @glPixelStorei(i32 %1, i32 1)
%3 = call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}

LLVM IR (-O2):
@GL_UNPACK_ALIGNMENT = global i32 0
define void @init() {
%1 = load i32, i32* @GL_UNPACK_ALIGNMENT
%2 = tail call i32 @glPixelStorei(i32 %1, i32 1)
%3 = tail call i32 @glClearColor(double 0.000000e+00, double 0.000000e+00, double 0.000000e+00, double 0.000000e+00)
ret void
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
size_t chooseRandomIndex(const size_t arrayLen) {
  const double fRand = (double)rand() / (1.0 + RAND_MAX);
  return arrayLen * fRand;
}


x86 assembly (clang, -O0):
<chooseRandomIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb9(%rip),%rax
movsd  (%rax),%xmm1
movsd  0xec5(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movaps 0xec1(%rip),%xmm1
movq   -0x8(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xec0(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movaps %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
movsd  0xe79(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rcx
and    %rdx,%rcx
or     %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chooseRandomIndex>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
movsd  (%rax),%xmm1
addsd  0xecd(%rip),%xmm1
movq   %rbx,%xmm2
punpckldq 0xed0(%rip),%xmm2
divsd  %xmm1,%xmm0
subpd  0xed4(%rip),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xe98(%rip),%xmm1
cvttsd2si %xmm1,%rax
and    %rdx,%rax
or     %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define i64 @chooseRandomIndex(i64 %0) {
%2 = alloca i64
%3 = alloca double
store i64 %0, i64* %2
%4 = call i64 (...) @rand()
%5 = sitofp i64 %4 to double
%6 = load double, double* @RAND_MAX
%7 = fadd double 1.000000e+00, %6
%8 = fdiv double %5, %7
store double %8, double* %3
%9 = load i64, i64* %2
%10 = uitofp i64 %9 to double
%11 = load double, double* %3
%12 = fmul double %10, %11
%13 = fptoui double %12 to i64
ret i64 %13
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define i64 @chooseRandomIndex(i64 %0) {
%2 = tail call i64 (...) @rand()
%3 = sitofp i64 %2 to double
%4 = load double, double* @RAND_MAX
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %3, %5
%7 = uitofp i64 %0 to double
%8 = fmul double %6, %7
%9 = fptoui double %8 to i64
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void sysMemCopy(void *in_destination, void *in_source, size_t in_size) {
  memcpy(in_destination, in_source, in_size);
}


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

x86 assembly (clang, -O2):
<sysMemCopy>:
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @sysMemCopy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @sysMemCopy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int rls_log_init();
int rls_module_init(void) {
  int error;
  if ((error = rls_log_init()) < 0) {
    return error;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rls_module_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rls_log_init@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jge    1136 <rls_module_init+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113d <rls_module_init+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rls_module_init>:
push   %rax
xor    %eax,%eax
call   1030 <rls_log_init@plt>
mov    %eax,%ecx
sar    $0x1f,%ecx
and    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rls_module_init() {
%1 = tail call i32 (...) @rls_log_init()
%2 = icmp slt i32 %1, 0
%3 = select i1 %2, i32 %1, i32 0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void base64_freebuf(unsigned char *src) {
  if (src)
    free(src);
}


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

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

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

LLVM IR (-O2):
define void @base64_freebuf(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ BotFreeCharacter2(int);
int /*<<< orphan*/ LibVarGetValue(char *);
void BotFreeCharacter(int handle) {
  if (!LibVarGetValue("bot_reloadcharacters")) {
    return;
  }
  BotFreeCharacter2(handle);
}


x86 assembly (clang, -O0):
<BotFreeCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <LibVarGetValue@plt>
cmp    $0x0,%eax
jne    1145 <BotFreeCharacter+0x25>
jmp    114d <BotFreeCharacter+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <BotFreeCharacter2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BotFreeCharacter>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <LibVarGetValue@plt>
test   %eax,%eax
je     113b <BotFreeCharacter+0x1b>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <BotFreeCharacter2@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"bot_reloadcharacters\00"
define void @BotFreeCharacter(i32 %0) {
%2 = tail call i32 @LibVarGetValue(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @BotFreeCharacter2(i32 %0)
br label %6
6: ; preds = %1, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(unsigned char *);
void LSQ_FreePalette(unsigned char *data) { free(data); }


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

x86 assembly (clang, -O2):
<LSQ_FreePalette>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @LSQ_FreePalette(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int posix_spawn_file_actions_destroy(posix_spawn_file_actions_t *file_actions) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<posix_spawn_file_actions_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawn_file_actions_destroy>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawn_file_actions_destroy(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
void vga_dirty_log_stop(void *s) {}


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

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

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

LLVM IR (-O2):
define void @vga_dirty_log_stop(i8* nocapture %0) {
ret void
}
char printable(char c) {
  if ((c < ' ') || (c > 0x7f)) {
    return '.';
  }
  return c;
}


x86 assembly (clang, -O0):
<printable>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     1124 <printable+0x24>
movsbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jle    112d <printable+0x2d>
movb   $0x2e,-0x1(%rbp)
jmp    1133 <printable+0x33>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<printable>:
cmp    $0x20,%dil
mov    $0x2e,%eax
cmovge %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @printable(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 32
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 127
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i8 46, i8* %2
br label %14
12: ; preds = %7
%13 = load i8, i8* %3
store i8 %13, i8* %2
br label %14
14: ; preds = %12, %11
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @printable(i8 signext %0) {
%2 = icmp slt i8 %0, 32
%3 = select i1 %2, i8 46, i8 %0
ret i8 %3
}
void eapol_sm_notify_cached(struct eapol_sm *sm) {}


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

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

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

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define void @eapol_sm_notify_cached(%struct.eapol_sm* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ open(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  {
    int i;
    for (i = 3; i < 64; i++)
      close(i);
  };
  open("/dev/null", O_RDONLY);
  return 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   $0x3,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    115d <main+0x3d>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
mov    0x2e84(%rip),%rax
mov    (%rax),%esi
lea    0xe93(%rip),%rdi
call   1040 <open@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x3,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <close@plt>
add    $0x1,%ebx
cmp    $0x40,%ebx
jne    1130 <main+0x10>
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
lea    0xeb1(%rip),%rdi
call   1040 <open@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 3, i32* %6
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 64
br i1 %9, label %10, label %16
10: ; preds = %7
%11 = load i32, i32* %6
%12 = call i32 @close(i32 %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
br label %7
16: ; preds = %7
%17 = load i32, i32* @O_RDONLY
%18 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/null\00"
@O_RDONLY = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 3, %2 ], [ %6, %3 ]
%5 = tail call i32 @close(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 64
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = load i32, i32* @O_RDONLY
%10 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(void) {
  extern const char *__progname;
  fprintf(stderr, "usage: %s [-n total files] [-v] empty-directory\n",
          __progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%rdx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdx
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"usage: %s [-n total files] [-v] empty-directory\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"usage: %s [-n total files] [-v] empty-directory\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i32, i32* @stderr
%2 = load i8*, i8** @__progname
%3 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_rsa1024();
int /*<<< orphan*/ test_rsa_1();
int /*<<< orphan*/ test_rsa_2();
int /*<<< orphan*/ test_rsa_3();
int main() {
  printf("\n");
  printf("Testing RSA encryption implemented with bignum. \n");
  test_rsa_1();
  test_rsa_2();
  test_rsa_3();
  test_rsa1024();
  printf("\n");
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <test_rsa_1@plt>
mov    $0x0,%al
call   1050 <test_rsa_2@plt>
mov    $0x0,%al
call   1030 <test_rsa_3@plt>
mov    $0x0,%al
call   1060 <test_rsa1024@plt>
lea    0xe96(%rip),%rdi
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe8e(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1080 <test_rsa_1@plt>
xor    %eax,%eax
call   1060 <test_rsa_2@plt>
xor    %eax,%eax
call   1040 <test_rsa_3@plt>
xor    %eax,%eax
call   1070 <test_rsa1024@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@.str.1 = [50 x i8] c"Testing RSA encryption implemented with bignum. \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (...) @test_rsa_1()
%5 = call i32 (...) @test_rsa_2()
%6 = call i32 (...) @test_rsa_3()
%7 = call i32 (...) @test_rsa1024()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [49 x i8] c"Testing RSA encryption implemented with bignum. \00"
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @test_rsa_1()
%4 = tail call i32 (...) @test_rsa_2()
%5 = tail call i32 (...) @test_rsa_3()
%6 = tail call i32 (...) @test_rsa1024()
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ lfs_fromle32(int /*<<< orphan*/);
uint32_t lfs_tole32(uint32_t a) { return lfs_fromle32(a); }


x86 assembly (clang, -O0):
<lfs_tole32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <lfs_fromle32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lfs_tole32>:
jmp    1030 <lfs_fromle32@plt>

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

LLVM IR (-O2):
define i32 @lfs_tole32(i32 %0) {
%2 = tail call i32 @lfs_fromle32(i32 %0)
ret i32 %2
}
/* Variables and functions */
char *ft_strchr(const char *s, int c) {
  while (*s != (char)c) {
    if (*s == '\0')
      return (NULL);
    s++;
  }
  return ((char *)s);
}


x86 assembly (clang, -O0):
<ft_strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x14(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
je     114e <ft_strchr+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    113d <ft_strchr+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1156 <ft_strchr+0x56>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <ft_strchr+0xb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strchr>:
mov    %rdi,%rax
movsbl %sil,%ecx
movsbl (%rdi),%edx
cmp    %edx,%ecx
je     1120 <ft_strchr+0x20>
xchg   %ax,%ax
test   %dl,%dl
je     1121 <ft_strchr+0x21>
movsbl 0x1(%rax),%edx
add    $0x1,%rax
cmp    %edx,%ecx
jne    1110 <ft_strchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @ft_strchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %4, %6
br i1 %7, label %17, label %8
8: ; preds = %2, %12
%9 = phi i8 [ %14, %12 ], [ %5, %2 ]
%10 = phi i8* [ %13, %12 ], [ %0, %2 ]
%11 = icmp eq i8 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %4, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ], [ null, %8 ]
ret i8* %18
}
/* Variables and functions */
char putchar(char);
int main() {
  char string[] = "Hello, there!\n";
  char *s;
  s = string;
  while (putchar(*s) != '\0')
    s++;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
movsbl %al,%eax
cmp    $0x0,%eax
je     1178 <main+0x68>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    114f <main+0x3f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0xa216572656874,%rax
mov    %rax,0x7(%rsp)
movabs $0x74202c6f6c6c6548,%rax
2c 20 74
mov    %rax,(%rsp)
mov    $0x48,%edi
call   1030 <putchar@plt>
test   %al,%al
je     1160 <main+0x50>
lea    0x1(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl (%rbx),%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
test   %al,%al
jne    1150 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.string = [15 x i8] c"Hello, there!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [15 x i8]* %2 to i8*
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
store i8* %5, i8** %3
br label %6
6: ; preds = %12, %0
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = call signext i8 @putchar(i8 signext %8)
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %6
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
br label %6
15: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@__const.main.string = [15 x i8] c"Hello, there!\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = tail call signext i8 @putchar(i8 signext 72)
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %0
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 1
br label %7
7: ; preds = %5, %7
%8 = phi i8* [ %6, %5 ], [ %12, %7 ]
%9 = load i8, i8* %8
%10 = tail call signext i8 @putchar(i8 signext %9)
%11 = icmp eq i8 %10, 0
%12 = getelementptr inbounds i8, i8* %8, i64 1
br i1 %11, label %13, label %7
13: ; preds = %7, %0
ret i32 0
}
/* Type definitions */
struct avl_tree_node {
  int dummy;
};

/* Variables and functions */
struct avl_tree_node *
avl_tree_next_or_prev_in_order(struct avl_tree_node const *, int);
struct avl_tree_node *avl_tree_next_in_order(const struct avl_tree_node *node) {
  return avl_tree_next_or_prev_in_order(node, 1);
}


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

x86 assembly (clang, -O2):
<avl_tree_next_in_order>:
mov    $0x1,%esi
jmp    1030 <avl_tree_next_or_prev_in_order@plt>

LLVM IR (-O0):
%struct.avl_tree_node = type { i32 }
define %struct.avl_tree_node* @avl_tree_next_in_order(%struct.avl_tree_node* %0) {
%2 = alloca %struct.avl_tree_node*
store %struct.avl_tree_node* %0, %struct.avl_tree_node** %2
%3 = load %struct.avl_tree_node*, %struct.avl_tree_node** %2
%4 = call %struct.avl_tree_node* @avl_tree_next_or_prev_in_order(%struct.avl_tree_node* %3, i32 1)
ret %struct.avl_tree_node* %4
}

LLVM IR (-O2):
%struct.avl_tree_node = type { i32 }
define %struct.avl_tree_node* @avl_tree_next_in_order(%struct.avl_tree_node* %0) {
%2 = tail call %struct.avl_tree_node* @avl_tree_next_or_prev_in_order(%struct.avl_tree_node* %0, i32 1)
ret %struct.avl_tree_node* %2
}
/* Variables and functions */
float RAND_MAX;
float rand();
float randFloat(float min, float max) {
  float range = (max - min);
  float div = RAND_MAX / range;
  return min + (rand() / div);
}


x86 assembly (clang, -O0):
<randFloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
movss  (%rax),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  -0x10(%rbp),%xmm1
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randFloat>:
push   %rax
movss  %xmm0,0x4(%rsp)
subss  %xmm0,%xmm1
mov    0x2ec6(%rip),%rax
movss  (%rax),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
divss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define float @randFloat(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %4
%8 = load float, float* %3
%9 = fsub float %7, %8
store float %9, float* %5
%10 = load float, float* @RAND_MAX
%11 = load float, float* %5
%12 = fdiv float %10, %11
store float %12, float* %6
%13 = load float, float* %3
%14 = call float (...) @rand()
%15 = load float, float* %6
%16 = fdiv float %14, %15
%17 = fadd float %13, %16
ret float %17
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define float @randFloat(float %0, float %1) {
%3 = fsub float %1, %0
%4 = load float, float* @RAND_MAX
%5 = fdiv float %4, %3
%6 = tail call float (...) @rand()
%7 = fdiv float %6, %5
%8 = fadd float %7, %0
ret float %8
}
/* Variables and functions */
int strcmp(char const *, char const *);
int key_cmp(const void *x, const void *y) {
  return strcmp((const char *)x, (const char *)y);
}


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

x86 assembly (clang, -O2):
<key_cmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @key_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_note {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_ref(struct i8x_object *);
struct i8x_note *__attribute__((always_)) i8x_note_ref(struct i8x_note *x) {
  return (struct i8x_note *)i8x_ob_ref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_note_ref>:
jmp    1030 <i8x_ob_ref@plt>

LLVM IR (-O0):
%struct.i8x_note = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_note* @i8x_note_ref(%struct.i8x_note* %0) {
%2 = alloca %struct.i8x_note*
store %struct.i8x_note* %0, %struct.i8x_note** %2
%3 = load %struct.i8x_note*, %struct.i8x_note** %2
%4 = bitcast %struct.i8x_note* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_ref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_note*
ret %struct.i8x_note* %6
}

LLVM IR (-O2):
%struct.i8x_note = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_note* @i8x_note_ref(%struct.i8x_note* %0) {
%2 = bitcast %struct.i8x_note* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_ref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_note*
ret %struct.i8x_note* %4
}
double divide(double left, double right) { return left / right; }


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

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

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

LLVM IR (-O2):
define double @divide(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int32_t WriteUint8Le(uint8_t value, void *out) {
  assert(out != NULL);
  uint8_t *buf = (uint8_t *)out;
  buf[0] = value;
  return 1;
}


x86 assembly (clang, -O0):
<WriteUint8Le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WriteUint8Le>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %edi,%edi
test   %rsi,%rsi
setne  %dil
call   1030 <assert@plt>
mov    %ebp,(%rbx)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @WriteUint8Le(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %5
%12 = load i32, i32* %3
%13 = load i32*, i32** %5
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
ret i32 1
}

LLVM IR (-O2):
define i32 @WriteUint8Le(i32 %0, i8* writeonly %1) {
%3 = icmp ne i8* %1, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = bitcast i8* %1 to i32*
store i32 %0, i32* %6
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xaa() {
  Assert_real((islower(170) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              855, ("islower should be 0 for 0xaa"));
}


x86 assembly (clang, -O0):
<t_islower_0xaa>:
push   %rbp
mov    %rsp,%rbp
mov    $0xaa,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x357,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xaa>:
push   %rax
mov    $0xaa,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x357,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xaa\00"
define void @t_islower_0xaa() {
%1 = call i64 @islower(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xaa\00"
define void @t_islower_0xaa() {
%1 = tail call i64 @islower(i32 170)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 855, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char const *cgi_getnentrystr(char const *, int /*<<< orphan*/);
const char *cgi_getentrystr(const char *field_name) {
  return cgi_getnentrystr(field_name, 0);
}


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

x86 assembly (clang, -O2):
<cgi_getentrystr>:
xor    %esi,%esi
jmp    1030 <cgi_getnentrystr@plt>

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

LLVM IR (-O2):
define i8* @cgi_getentrystr(i8* %0) {
%2 = tail call i8* @cgi_getnentrystr(i8* %0, i32 0)
ret i8* %2
}
void x86_64_cpuid_primop() {
  asm("movq %%rbx, %%rax\n\t"
      "cpuid\n\t"
      "movq %%rbx, %%r14\n\t"
      "movq %%rax, %%rbx\n\t"
      "movq %%rdx, %%rdi\n\t"
      "movq %%rcx, %%rsi\n\t"
      "jmp * (%%rbp)\n\t" ::
          :);
}


x86 assembly (clang, -O0):
<x86_64_cpuid_primop>:
push   %rbp
mov    %rsp,%rbp
mov    %rbx,%rax
cpuid
mov    %rbx,%r14
mov    %rax,%rbx
mov    %rdx,%rdi
mov    %rcx,%rsi
jmp    *0x0(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_64_cpuid_primop>:
mov    %rbx,%rax
cpuid
mov    %rbx,%r14
mov    %rax,%rbx
mov    %rdx,%rdi
mov    %rcx,%rsi
jmp    *0x0(%rbp)
ret

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

LLVM IR (-O2):
define void @x86_64_cpuid_primop() {
tail call void asm sideeffect "movq %rbx, %rax\0A\09cpuid\0A\09movq %rbx, %r14\0A\09movq %rax, %rbx\0A\09movq %rdx, %rdi\0A\09movq %rcx, %rsi\0A\09jmp * (%rbp)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nouveau_drm_screen_create();
int /*<<< orphan*/ printf(char *);
void __driDriverGetExtensions_foo(void) {
  printf("DRI: entry point\n");
  nouveau_drm_screen_create();
}


x86 assembly (clang, -O0):
<__driDriverGetExtensions_foo>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <nouveau_drm_screen_create@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__driDriverGetExtensions_foo>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <nouveau_drm_screen_create@plt>

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

LLVM IR (-O2):
@str = [17 x i8] c"DRI: entry point\00"
define void @__driDriverGetExtensions_foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @nouveau_drm_screen_create()
ret void
}
unsigned int ELMNumOfErrsGet(unsigned int baseAddr) {
  unsigned int numOfErrs;
  numOfErrs =
      ((*((volatile unsigned int *)(baseAddr + (0x800)))) & (0x0000001Fu));
  return (numOfErrs);
}


x86 assembly (clang, -O0):
<ELMNumOfErrsGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x800,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ELMNumOfErrsGet>:
add    $0x800,%edi
mov    (%rdi),%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @ELMNumOfErrsGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 2048
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 31
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @ELMNumOfErrsGet(i32 %0) {
%2 = add i32 %0, 2048
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 31
ret i32 %6
}
int compare(void *a, void *b) {
  unsigned long x = (unsigned long)a;
  unsigned long y = (unsigned long)b;
  return (int)(y - x);
}


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

x86 assembly (clang, -O2):
<compare>:
mov    %rsi,%rax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %7 to i64
store i64 %8, i64* %5
%9 = load i8*, i8** %4
%10 = ptrtoint i8* %9 to i64
store i64 %10, i64* %6
%11 = load i64, i64* %6
%12 = load i64, i64* %5
%13 = sub i64 %11, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @compare(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %4, %3
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
unsigned char *mm_put_str(unsigned char *str) {
  if (str == NULL)
    return "";
  else
    return str;
}


x86 assembly (clang, -O0):
<mm_put_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <mm_put_str+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112b <mm_put_str+0x2b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_put_str>:
test   %rdi,%rdi
lea    0xef6(%rip),%rax
cmovne %rdi,%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @mm_put_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
%8 = load i8*, i8** %3
store i8* %8, i8** %2
br label %9
9: ; preds = %7, %6
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @mm_put_str(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %0
ret i8* %3
}