xunge/DecIR huggingface dataset:
/* Variables and functions */
double config_get_flt(char *, double);
double produceexp_chance(void) {
  return config_get_flt("study.from_use", 1.0 / 3);
}


x86 assembly (clang, -O0):
<produceexp_chance>:
push   %rbp
mov    %rsp,%rbp
lea    0xeed(%rip),%rdi
movsd  0xedd(%rip),%xmm0
call   1030 <config_get_flt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<produceexp_chance>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
jmp    1030 <config_get_flt@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"study.from_use\00"
define double @produceexp_chance() {
%1 = call double @config_get_flt(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 0x3FD5555555555555)
ret double %1
}

LLVM IR (-O2):
@.str = [15 x i8] c"study.from_use\00"
define double @produceexp_chance() {
%1 = tail call double @config_get_flt(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 0x3FD5555555555555)
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ output(char);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ sync_output();
int funend(char opcode, int fundef) {
  if (fundef) {
    fundef = 0;
    output(opcode);
    sync_output();
  } else {
    fprintf(stderr, "?\n");
  }
  return fundef;
}


x86 assembly (clang, -O0):
<funend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1167 <funend+0x37>
movl   $0x0,-0x8(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <output@plt>
mov    $0x0,%al
call   1050 <sync_output@plt>
jmp    117c <funend+0x4c>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funend>:
push   %rax
test   %esi,%esi
je     1147 <funend+0x17>
movsbl %dil,%edi
call   1030 <output@plt>
xor    %eax,%eax
call   1050 <sync_output@plt>
jmp    115c <funend+0x2c>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
lea    0xea9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"?\0A\00"
define i32 @funend(i8 signext %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @output(i8 signext %0)
%6 = tail call i32 (...) @sync_output()
br label %10
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %4
ret i32 0
}
void defaultenv_append(void *buf, unsigned int size, const char *name) {}


x86 assembly (clang, -O0):
<defaultenv_append>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @defaultenv_append(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret void
}

LLVM IR (-O2):
define void @defaultenv_append(i8* nocapture %0, i32 %1, i8* nocapture %2) {
ret void
}
double dbl_min1(double a, double b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<dbl_min1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <dbl_min1+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <dbl_min1+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_min1>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dbl_min1(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 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @dbl_min1(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ say(char *, int);
void talk(void) { say("Man, party in this house!", 1); }


x86 assembly (clang, -O0):
<talk>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1,%esi
call   1030 <say@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<talk>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <say@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Man, party in this house!\00"
define void @talk() {
%1 = call i32 @say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Man, party in this house!\00"
define void @talk() {
%1 = tail call i32 @say(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
double f(double z) { return z - 1.111111111112; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
addsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @f(double %0) {
%2 = fadd double %0, 0xBFF1C71C71C72C15
ret double %2
}
void execve(char *path, int argc_l, char **argv_l, int yield) {
  __asm__("nop" ::"b"(path));
  __asm__("nop" ::"d"(argc_l));
  __asm__("nop" ::"c"(argv_l));
  __asm__("int $0x82" ::"a"(4));
  if (yield) {
    __asm__("mov $0x02, %eax");
    __asm__("int $0x82");
  }
}


x86 assembly (clang, -O0):
<execve>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rbx
nop
mov    -0x14(%rbp),%edx
nop
mov    -0x20(%rbp),%rcx
nop
mov    $0x4,%eax
int    $0x82
cmpl   $0x0,-0x24(%rbp)
je     1139 <execve+0x39>
mov    $0x2,%eax
int    $0x82
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<execve>:
push   %rbx
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %esi,%edx
mov    %rdi,%rbx
nop
nop
nop
mov    $0x4,%eax
int    $0x82
test   %r8d,%r8d
je     1122 <execve+0x22>
mov    $0x2,%eax
int    $0x82
pop    %rbx
ret

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

LLVM IR (-O2):
define void @execve(i8* %0, i32 %1, i8** %2, i32 %3) {
tail call void asm sideeffect "nop", "{bx},~{dirflag},~{fpsr},~{flags}"(i8* %0)
tail call void asm sideeffect "nop", "{dx},~{dirflag},~{fpsr},~{flags}"(i32 %1)
tail call void asm sideeffect "nop", "{cx},~{dirflag},~{fpsr},~{flags}"(i8** %2)
tail call void asm sideeffect "int $$0x82", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 4)
%5 = icmp eq i32 %3, 0
br i1 %5, label %7, label %6
6: ; preds = %4
tail call void asm sideeffect "mov $$0x02, %eax", "~{dirflag},~{fpsr},~{flags}"()
tail call void asm sideeffect "int $$0x82", "~{dirflag},~{fpsr},~{flags}"()
br label %7
7: ; preds = %6, %4
ret void
}
/* Type definitions */
struct rq_fx_leg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rq_fx_leg *);
int /*<<< orphan*/ rq_fx_leg_clear(struct rq_fx_leg *);
void rq_fx_leg_free(struct rq_fx_leg *p) {
  rq_fx_leg_clear(p);
  free(p);
}


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

x86 assembly (clang, -O2):
<rq_fx_leg_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <rq_fx_leg_clear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rq_fx_leg = type { i32 }
define void @rq_fx_leg_free(%struct.rq_fx_leg* %0) {
%2 = alloca %struct.rq_fx_leg*
store %struct.rq_fx_leg* %0, %struct.rq_fx_leg** %2
%3 = load %struct.rq_fx_leg*, %struct.rq_fx_leg** %2
%4 = call i32 @rq_fx_leg_clear(%struct.rq_fx_leg* %3)
%5 = load %struct.rq_fx_leg*, %struct.rq_fx_leg** %2
%6 = call i32 @free(%struct.rq_fx_leg* %5)
ret void
}

LLVM IR (-O2):
%struct.rq_fx_leg = type { i32 }
define void @rq_fx_leg_free(%struct.rq_fx_leg* %0) {
%2 = tail call i32 @rq_fx_leg_clear(%struct.rq_fx_leg* %0)
%3 = tail call i32 @free(%struct.rq_fx_leg* %0)
ret void
}
int teste() { return 42; }


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

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

LLVM IR (-O0):
define i32 @teste() {
ret i32 42
}

LLVM IR (-O2):
define i32 @teste() {
ret i32 42
}
void SSL_write(void) {}


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

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

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

LLVM IR (-O2):
define void @SSL_write() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GenPrintInstr1Operand(int, int /*<<< orphan*/, int,
                                         int /*<<< orphan*/);
int /*<<< orphan*/ GenPrintInstr2Operands(int, int /*<<< orphan*/, int,
                                          int /*<<< orphan*/, int,
                                          int /*<<< orphan*/);
void GenFxnProlog(void) {
  GenPrintInstr1Operand(0x05, 0, 0x09, 0);
  GenPrintInstr2Operands(0x00, 0, 0x09, 0, 0x0A, 0);
}


x86 assembly (clang, -O0):
<GenFxnProlog>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
xor    %ecx,%ecx
mov    $0x9,%edx
mov    %ecx,%esi
call   1040 <GenPrintInstr1Operand@plt>
xor    %r9d,%r9d
mov    $0x9,%edx
mov    $0xa,%r8d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%ecx
call   1030 <GenPrintInstr2Operands@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenFxnProlog>:
push   %rax
mov    $0x5,%edi
xor    %esi,%esi
mov    $0x9,%edx
xor    %ecx,%ecx
call   1040 <GenPrintInstr1Operand@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0x9,%edx
xor    %ecx,%ecx
mov    $0xa,%r8d
xor    %r9d,%r9d
pop    %rax
jmp    1030 <GenPrintInstr2Operands@plt>

LLVM IR (-O0):
define void @GenFxnProlog() {
%1 = call i32 @GenPrintInstr1Operand(i32 5, i32 0, i32 9, i32 0)
%2 = call i32 @GenPrintInstr2Operands(i32 0, i32 0, i32 9, i32 0, i32 10, i32 0)
ret void
}

LLVM IR (-O2):
define void @GenFxnProlog() {
%1 = tail call i32 @GenPrintInstr1Operand(i32 5, i32 0, i32 9, i32 0)
%2 = tail call i32 @GenPrintInstr2Operands(i32 0, i32 0, i32 9, i32 0, i32 10, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ list_selectswap();
void button_transfer_onpress(void) { list_selectswap(); }


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

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

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

LLVM IR (-O2):
define void @button_transfer_onpress() {
%1 = tail call i32 (...) @list_selectswap()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
void uninivar_scanf(void) {
  char *format;
  char str[42];
  (void)scanf(format, str);
}


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

x86 assembly (clang, -O2):
<uninivar_scanf>:
sub    $0x38,%rsp
mov    %rsp,%rsi
call   1030 <scanf@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @uninivar_scanf() {
%1 = alloca i8*
%2 = alloca [42 x i8]
%3 = load i8*, i8** %1
%4 = getelementptr inbounds [42 x i8], [42 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_scanf() {
%1 = alloca [42 x i8]
%2 = getelementptr inbounds [42 x i8], [42 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* undef, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void gp_do_exit(int exit_status) { exit(exit_status); }


x86 assembly (clang, -O0):
<gp_do_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<gp_do_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @gp_do_exit(i32 %0) {
%2 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
float fmin(float, float);
float fminf(float x, float y) { return fmin(x, y); }


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

x86 assembly (clang, -O2):
<fminf>:
movaps %xmm0,%xmm2
cmpunordss %xmm0,%xmm2
movaps %xmm2,%xmm3
andps  %xmm1,%xmm3
minss  %xmm0,%xmm1
andnps %xmm1,%xmm2
orps   %xmm3,%xmm2
movaps %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @fminf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @fmin(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @fminf(float %0, float %1) {
%3 = tail call nsz float @llvm.minnum.f32(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void Usage() {
  fprintf(stderr, "Usage:  ./a.out <mq name>\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<Usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<Usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: ./a.out <mq name>\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: ./a.out <mq name>\0A\00"
define void @Usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XButtonEvent;

/* Variables and functions */
void set_XButtonEvent_x(void *_p, int _v) { ((XButtonEvent *)_p)->x = (int)_v; }


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

x86 assembly (clang, -O2):
<set_XButtonEvent_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XButtonEvent_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XButtonEvent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int void_comp(const void *number1, const void *number2) {
  int n1 = (int)number1;
  int n2 = (int)number2;
  return n1 - n2;
}


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

x86 assembly (clang, -O2):
<void_comp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @void_comp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = trunc i64 %3 to i32
%5 = ptrtoint i8* %1 to i64
%6 = trunc i64 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ li;
typedef int /*<<< orphan*/ i;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void bit_test_main2() {
  int i = 1;
  short int li = 1;
  printf("sizeof:int: %d\n", sizeof(i));
  printf("sizeof:int: %d\n", sizeof(li));
}


x86 assembly (clang, -O0):
<bit_test_main2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
lea    0xed4(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test_main2>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"sizeof:int: %d\0A\00"
define void @bit_test_main2() {
%1 = alloca i32
%2 = alloca i16
store i32 1, i32* %1
store i16 1, i16* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4)
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"sizeof:int: %d\0A\00"
define void @bit_test_main2() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
/* Variables and functions */
bool is_numeric(char c) {
  bool result = ((c >= '0') && (c <= '9'));
  return (result);
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x9(%rbp)
jl     1129 <is_numeric+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_numeric(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br label %11
11: ; preds = %7, %1
%12 = phi i1 [ false, %1 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_numeric(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
__attribute__((always_)) const int xisminf(double x) {
  return x == -__builtin_inf();
}


x86 assembly (clang, -O0):
<xisminf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisminf>:
movsd  0xef8(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setae  %al
ret

LLVM IR (-O0):
define i32 @xisminf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double %3, 0xFFF0000000000000
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @xisminf(double %0) {
%2 = fcmp oeq double %0, 0xFFF0000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ oled_send_start_byte(int /*<<< orphan*/);
void oled_send_cmd(void) { oled_send_start_byte(0); }


x86 assembly (clang, -O0):
<oled_send_cmd>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <oled_send_start_byte@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<oled_send_cmd>:
xor    %edi,%edi
jmp    1030 <oled_send_start_byte@plt>

LLVM IR (-O0):
define void @oled_send_cmd() {
%1 = call i32 @oled_send_start_byte(i32 0)
ret void
}

LLVM IR (-O2):
define void @oled_send_cmd() {
%1 = tail call i32 @oled_send_start_byte(i32 0)
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int stat(char *, struct stat *);
void create_dir(char *dir) {
  struct stat st = {0};
  if (stat(dir, &st) == -1) {
    mkdir(dir, 0700);
  }
}


x86 assembly (clang, -O0):
<create_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <stat@plt>
cmp    $0xffffffff,%eax
jne    1170 <create_dir+0x40>
mov    -0x8(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_dir>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rsi
call   1040 <stat@plt>
cmp    $0xffffffff,%eax
je     1145 <create_dir+0x25>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x1c0,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define void @create_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = bitcast %struct.stat* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @stat(i8* %5, %struct.stat* %3)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @mkdir(i8* %9, i32 448)
br label %11
11: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define void @create_dir(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
store i32 0, i32* %4
%5 = call i32 @stat(i8* %0, %struct.stat* %2)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @mkdir(i8* %0, i32 448)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int recapn(char const *, char const *, size_t, int /*<<< orphan*/ *);
int rematchn(const char *re, const char *text, size_t textn) {
  return recapn(re, text, textn, NULL);
}


x86 assembly (clang, -O0):
<rematchn>:
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
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <recapn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rematchn>:
xor    %ecx,%ecx
jmp    1030 <recapn@plt>

LLVM IR (-O0):
define i32 @rematchn(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 @recapn(i8* %7, i8* %8, i64 %9, i32* null)
ret i32 %10
}

LLVM IR (-O2):
define i32 @rematchn(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @recapn(i8* %0, i8* %1, i64 %2, i32* null)
ret i32 %4
}
int offsetFromWidth(int lineWidth) { return ((int)lineWidth >> 1); }


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

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

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

LLVM IR (-O2):
define i32 @offsetFromWidth(i32 %0) {
%2 = ashr i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ NoDepAFunction();
void NoDepBFunction() { NoDepAFunction(); }


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

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

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

LLVM IR (-O2):
define void @NoDepBFunction() {
%1 = tail call i32 (...) @NoDepAFunction()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DelayMS(int);
void Delay(int wolfticks) {
  if (wolfticks > 0)
    DelayMS(wolfticks * 100 / 7);
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1138 <Delay+0x28>
imul   $0x64,-0x4(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <DelayMS@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
test   %edi,%edi
jle    1136 <Delay+0x26>
imul   $0x64,%edi,%eax
movslq %eax,%rdi
imul   $0xffffffff92492493,%rdi,%rax
shr    $0x20,%rax
add    %eax,%edi
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0x2,%edi
add    %eax,%edi
jmp    1030 <DelayMS@plt>
ret

LLVM IR (-O0):
define void @Delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 100
%8 = sdiv i32 %7, 7
%9 = call i32 @DelayMS(i32 %8)
br label %10
10: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @Delay(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = mul nsw i32 %0, 100
%5 = sdiv i32 %4, 7
%6 = tail call i32 @DelayMS(i32 %5)
br label %7
7: ; preds = %3, %1
ret void
}
void badfmt(fmt) char *fmt;
{ errx(1, "\"%s\": bad format", fmt); }


x86 assembly (clang, -O0):
<badfmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x1,%edi
lea    0xed4(%rip),%rsi
mov    $0x0,%al
call   1030 <errx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<badfmt>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rsi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\22%s\22: bad format\00"
define void @badfmt(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @errx to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\22%s\22: bad format\00"
define void @badfmt(i8* %0) {
%2 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @errx to i32 (i32, i8*, i8*, ...)*)(i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *malloc_(size_t size) {
  void *result;
  result = malloc(size);
  if (result == NULL) {
    perror("malloc_");
    exit(-2);
  }
  return result;
}


x86 assembly (clang, -O0):
<malloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116a <malloc_+0x3a>
lea    0xea5(%rip),%rdi
call   1040 <perror@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_>:
push   %rax
call   1030 <malloc@plt>
test   %rax,%rax
je     113d <malloc_+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"malloc_\00"
define noalias i8* @malloc_(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -2)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ console_write(char *, int);
void console_eraseeol(void) { console_write("\033[K", 3); }


x86 assembly (clang, -O0):
<console_eraseeol>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x3,%esi
call   1030 <console_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_eraseeol>:
lea    0xee9(%rip),%rdi
mov    $0x3,%esi
jmp    1030 <console_write@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[K\00"
define void @console_eraseeol() {
%1 = tail call i32 @console_write(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
/* Variables and functions */
char *__kernel_strcpy(char *, char const *);
int strlen(char *);
char *strcat(char *dest, const char *src) {
  return __kernel_strcpy(dest + strlen(dest), src);
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
cltq
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__kernel_strcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
movslq %eax,%rdi
add    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <__kernel_strcpy@plt>

LLVM IR (-O0):
define i8* @strcat(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** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8*, i8** %4
%11 = call i8* @__kernel_strcpy(i8* %9, i8* %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @strcat(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i8* @__kernel_strcpy(i8* %5, i8* %1)
ret i8* %6
}
int __test() { return ((4 * 2) + (4 + 2)); }


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

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

LLVM IR (-O0):
define i32 @__test() {
ret i32 14
}

LLVM IR (-O2):
define i32 @__test() {
ret i32 14
}
unsigned num_digits(unsigned num) {
  unsigned count = 0;
  while (num) {
    ++count;
    num /= 10;
  }
  return count;
}


x86 assembly (clang, -O0):
<num_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1135 <num_digits+0x35>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <num_digits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_digits>:
xor    %eax,%eax
test   %edi,%edi
je     1124 <num_digits+0x24>
mov    $0xcccccccd,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <num_digits+0x10>
ret

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

LLVM IR (-O2):
define i32 @num_digits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add i32 %4, 1
%7 = udiv i32 %5, 10
%8 = icmp ult i32 %5, 10
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ net_base_recv(int, int /*<<< orphan*/ *, size_t,
                                 int /*<<< orphan*/ *, int);
ssize_t net_dgram_recv(int sock, uint8_t *buffer, size_t size, int timeout_ms) {
  return net_base_recv(sock, buffer, size, NULL, timeout_ms);
}


x86 assembly (clang, -O0):
<net_dgram_recv>:
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),%rdx
mov    -0x1c(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <net_base_recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_dgram_recv>:
mov    %ecx,%r8d
xor    %ecx,%ecx
jmp    1030 <net_base_recv@plt>

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

LLVM IR (-O2):
define i32 @net_dgram_recv(i32 %0, i32* %1, i64 %2, i32 %3) {
%5 = tail call i32 @net_base_recv(i32 %0, i32* %1, i64 %2, i32* null, i32 %3)
ret i32 %5
}
void iniIdJugadores(int idJugadores[4]) {
  int i;
  for (i = 0; i < 4; i++)
    idJugadores[i] = -1;
}


x86 assembly (clang, -O0):
<iniIdJugadores>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1136 <iniIdJugadores+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <iniIdJugadores+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<iniIdJugadores>:
pcmpeqd %xmm0,%xmm0
movdqu %xmm0,(%rdi)
ret

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

LLVM IR (-O2):
define void @iniIdJugadores(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to i8*
ret void
}
void gdk_window_set_type_hint() {}


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

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

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

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

/* Variables and functions */
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  time_t timeval;
  (void)time(&timeval);
  printf("The date is: %s", ctime(&timeval));
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <time@plt>
lea    -0x8(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <time@plt>
mov    %rbx,%rdi
call   1030 <ctime@plt>
lea    0xe9f(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"The date is: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @time(i32* %2)
%4 = call i8* @ctime(i32* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [16 x i8] c"The date is: %s\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = call i8* @ctime(i32* %1)
%5 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
void bar(int n) {
  int a[2], i, j = 0;
  for (i = 0; i < 2; i += j + 1)
    for (j = 0; j < (n ? 1 : 2); ++j)
      foo(a[i] + a[j]);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1191 <bar+0x81>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x4(%rbp),%esi
mov    $0x2,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
cmp    %ecx,%eax
jge    117b <bar+0x6b>
movslq -0x10(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%edi
movslq -0x14(%rbp),%rax
add    -0xc(%rbp,%rax,4),%edi
call   1030 <foo@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <bar+0x2a>
jmp    1180 <bar+0x70>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1129 <bar+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rbx
cmp    $0x1,%edi
mov    $0x1,%ebx
adc    $0x0,%rbx
nopl   (%rax)
call   1030 <foo@plt>
add    $0xffffffffffffffff,%rbx
jne    1120 <bar+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @bar(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %5
store i32 0, i32* %4
br label %6
6: ; preds = %32, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %37
9: ; preds = %6
store i32 0, i32* %5
br label %10
10: ; preds = %28, %9
%11 = load i32, i32* %5
%12 = load i32, i32* %2
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 2
%16 = icmp slt i32 %11, %15
br i1 %16, label %17, label %31
17: ; preds = %10
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = add nsw i32 %21, %25
%27 = call i32 @foo(i32 %26)
br label %28
28: ; preds = %17
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %10
31: ; preds = %10
br label %32
32: ; preds = %31
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
%35 = load i32, i32* %4
%36 = add nsw i32 %35, %34
store i32 %36, i32* %4
br label %6
37: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @bar(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i64 2, i64 1
br label %4
4: ; preds = %4, %1
%5 = phi i64 [ 0, %1 ], [ %7, %4 ]
%6 = tail call i32 @foo(i32 undef)
%7 = add nuw nsw i64 %5, 1
%8 = icmp eq i64 %7, %3
br i1 %8, label %9, label %4
9: ; preds = %4
ret void
}
void sched_affinity_set(struct affinity *a, int mask) {}


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

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

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

LLVM IR (-O2):
%struct.affinity = type opaque
define void @sched_affinity_set(%struct.affinity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ route_flush_all_routes();
int /*<<< orphan*/ route_flush_all_tracks();
void route_flush_all() {
  route_flush_all_tracks();
  route_flush_all_routes();
}


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

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

LLVM IR (-O0):
define void @route_flush_all() {
%1 = call i32 (...) @route_flush_all_tracks()
%2 = call i32 (...) @route_flush_all_routes()
ret void
}

LLVM IR (-O2):
define void @route_flush_all() {
%1 = tail call i32 (...) @route_flush_all_tracks()
%2 = tail call i32 (...) @route_flush_all_routes()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getgid();
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ perror(char *);
int setgid(int /*<<< orphan*/);
int setuid(int /*<<< orphan*/);
int deescalate(void) {
  if (setgid(getgid()) == -1 || setuid(getuid()) == -1) {
    perror("nsdo"
           ": set[gu]id");
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<deescalate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getgid@plt>
mov    %eax,%edi
call   1050 <setgid@plt>
cmp    $0xffffffff,%eax
je     1186 <deescalate+0x36>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%edi
call   1070 <setuid@plt>
cmp    $0xffffffff,%eax
jne    119e <deescalate+0x4e>
lea    0xe73(%rip),%rdi
call   1060 <perror@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <deescalate+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<deescalate>:
push   %rax
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %eax,%edi
call   1050 <setgid@plt>
cmp    $0xffffffff,%eax
je     1180 <deescalate+0x30>
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%edi
call   1070 <setuid@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0xffffffff,%ecx
je     1180 <deescalate+0x30>
pop    %rcx
ret
lea    0xe79(%rip),%rdi
call   1060 <perror@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"nsdo: set[gu]id\00"
define i32 @deescalate() {
%1 = alloca i32
%2 = call i32 (...) @getgid()
%3 = call i32 @setgid(i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = call i32 (...) @getuid()
%7 = call i32 @setuid(i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %5, %0
%10 = call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %12
11: ; preds = %5
store i32 1, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [16 x i8] c"nsdo: set[gu]id\00"
define i32 @deescalate() {
%1 = tail call i32 (...) @getgid()
%2 = tail call i32 @setgid(i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 (...) @getuid()
%6 = tail call i32 @setuid(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %4, %0
%9 = tail call i32 @perror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ 0, %8 ], [ 1, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ error_quit(char *);
int socket(int, int, int);
int Socket(int domain, int type, int prot) {
  int sockfd;
  if ((sockfd = socket(domain, type, prot)) == -1)
    error_quit("Socket");
  return sockfd;
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmp    $0xffffffff,%eax
jne    1157 <Socket+0x37>
lea    0xeae(%rip),%rdi
call   1030 <error_quit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    1139 <Socket+0x19>
lea    0xecc(%rip),%rdi
call   1030 <error_quit@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"Socket\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error_quit(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
void _Z80SimProtectedCodeEnds(void) {}


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

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

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

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