xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int open(char *, int /*<<< orphan*/);
void *internal_random_open(void *data) {
  (void)data;
  int fd = open("/dev/random", O_RDONLY);
  if (fd < 0) {
    return NULL;
  }
  return (void *)(intptr_t)fd;
}


x86 assembly (clang, -O0):
<internal_random_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xed4(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    114b <internal_random_open+0x3b>
movq   $0x0,-0x8(%rbp)
jmp    1153 <internal_random_open+0x43>
movslq -0x14(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internal_random_open>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <open@plt>
xor    %ecx,%ecx
test   %eax,%eax
cltq
cmovns %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"/dev/random\00"
@O_RDONLY = global i32 0
define i8* @internal_random_open(i8* nocapture readnone %0) {
%2 = load i32, i32* @O_RDONLY
%3 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = icmp slt i32 %3, 0
%5 = sext i32 %3 to i64
%6 = inttoptr i64 %5 to i8*
%7 = select i1 %4, i8* null, i8* %6
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *sqlite3_libversion();
char *sqlite3_sourceid();
int main(int argc, char **argv) {
  printf("SQLite version %s\n", sqlite3_libversion());
  printf("SQLite source  %s\n", sqlite3_sourceid());
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <sqlite3_libversion@plt>
mov    %rax,%rsi
lea    0xea9(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <sqlite3_sourceid@plt>
mov    %rax,%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <sqlite3_libversion@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <sqlite3_sourceid@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"SQLite version %s\0A\00"
@.str.1 = [19 x i8] c"SQLite source %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i8* (...) @sqlite3_libversion()
%7 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i8* (...) @sqlite3_sourceid()
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"SQLite version %s\0A\00"
@.str.1 = [19 x i8] c"SQLite source %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @sqlite3_libversion()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = tail call i8* (...) @sqlite3_sourceid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ testsize(int, int, int);
int main() {
  int NB = 48;
  testsize(256, 256, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x30,-0x8(%rbp)
mov    $0x100,%esi
mov    $0x5,%edx
mov    %esi,%edi
call   1030 <testsize@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x100,%edi
mov    $0x100,%esi
mov    $0x5,%edx
call   1030 <testsize@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 48, i32* %2
%3 = call i32 @testsize(i32 256, i32 256, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @testsize(i32 256, i32 256, i32 5)
ret i32 0
}
/* Variables and functions */
int apic_read(int);
int /*<<< orphan*/ apic_wait_icr_idle();
int /*<<< orphan*/ apic_write(int, int);
int /*<<< orphan*/ hlt();
void stop_this_cpu(void) {
  unsigned apicid;
  apicid = apic_read(0x020) >> 24;
  apic_write(0x310, ((apicid) << 24));
  apic_write(0x300, 0x08000 | 0x04000 | 0x00500);
  apic_wait_icr_idle();
  apic_write(0x310, ((apicid) << 24));
  apic_write(0x300, 0x08000 | 0x00500);
  apic_wait_icr_idle();
  for (;;) {
    hlt();
  }
}


x86 assembly (clang, -O0):
<stop_this_cpu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20,%edi
call   1050 <apic_read@plt>
sar    $0x18,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
shl    $0x18,%esi
mov    $0x310,%edi
call   1040 <apic_write@plt>
mov    $0x300,%edi
mov    $0xc500,%esi
call   1040 <apic_write@plt>
mov    $0x0,%al
call   1060 <apic_wait_icr_idle@plt>
mov    -0x4(%rbp),%esi
shl    $0x18,%esi
mov    $0x310,%edi
call   1040 <apic_write@plt>
mov    $0x300,%edi
mov    $0x8500,%esi
call   1040 <apic_write@plt>
mov    $0x0,%al
call   1060 <apic_wait_icr_idle@plt>
mov    $0x0,%al
call   1030 <hlt@plt>
jmp    11a4 <stop_this_cpu+0x64>

x86 assembly (clang, -O2):
<stop_this_cpu>:
push   %rbx
mov    $0x20,%edi
call   1050 <apic_read@plt>
mov    %eax,%ebx
and    $0xff000000,%ebx
mov    $0x310,%edi
mov    %ebx,%esi
call   1040 <apic_write@plt>
mov    $0x300,%edi
mov    $0xc500,%esi
call   1040 <apic_write@plt>
xor    %eax,%eax
call   1060 <apic_wait_icr_idle@plt>
mov    $0x310,%edi
mov    %ebx,%esi
call   1040 <apic_write@plt>
mov    $0x300,%edi
mov    $0x8500,%esi
call   1040 <apic_write@plt>
xor    %eax,%eax
call   1060 <apic_wait_icr_idle@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <hlt@plt>
jmp    11a0 <stop_this_cpu+0x60>

LLVM IR (-O0):
define void @stop_this_cpu() {
%1 = alloca i32
%2 = call i32 @apic_read(i32 32)
%3 = ashr i32 %2, 24
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = shl i32 %4, 24
%6 = call i32 @apic_write(i32 784, i32 %5)
%7 = call i32 @apic_write(i32 768, i32 50432)
%8 = call i32 (...) @apic_wait_icr_idle()
%9 = load i32, i32* %1
%10 = shl i32 %9, 24
%11 = call i32 @apic_write(i32 784, i32 %10)
%12 = call i32 @apic_write(i32 768, i32 34048)
%13 = call i32 (...) @apic_wait_icr_idle()
br label %14
14: ; preds = %14, %0
%15 = call i32 (...) @hlt()
br label %14
}

LLVM IR (-O2):
define void @stop_this_cpu() {
%1 = tail call i32 @apic_read(i32 32)
%2 = and i32 %1, -16777216
%3 = tail call i32 @apic_write(i32 784, i32 %2)
%4 = tail call i32 @apic_write(i32 768, i32 50432)
%5 = tail call i32 (...) @apic_wait_icr_idle()
%6 = tail call i32 @apic_write(i32 784, i32 %2)
%7 = tail call i32 @apic_write(i32 768, i32 34048)
%8 = tail call i32 (...) @apic_wait_icr_idle()
br label %9
9: ; preds = %9, %0
%10 = tail call i32 (...) @hlt()
br label %9
}
/* Variables and functions */
int /*<<< orphan*/ foo();
bar(int i, int partial, int args_addr) {
  int offset = 0;
  if (args_addr == 0)
    offset = 0;
  if (i >= offset)
    foo();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1139 <bar+0x29>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     114c <bar+0x3c>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
test   %edi,%edi
js     1120 <bar+0x10>
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 0, i32* %8
%9 = load i32, i32* %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 0, i32* %8
br label %12
12: ; preds = %11, %3
%13 = load i32, i32* %5
%14 = load i32, i32* %8
%15 = icmp sge i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 (...) @foo()
br label %18
18: ; preds = %16, %12
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, -1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (...) @foo()
br label %7
7: ; preds = %5, %3
ret i32 undef
}
float lgammaf(float __d) {
  signed int __local_signgam = 0;
  float return_value_lgammaf_r$1;
  return_value_lgammaf_r$1 = lgammaf_r(__d, &__local_signgam);
  return return_value_lgammaf_r$1;
}


x86 assembly (clang, -O0):
<lgammaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    -0x8(%rbp),%rdi
mov    $0x1,%al
call   1030 <lgammaf_r@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lgammaf>:
push   %rax
movl   $0x0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0x4(%rsp),%rdi
mov    $0x1,%al
call   1030 <lgammaf_r@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @lgammaf(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca float
store float %0, float* %2
store i32 0, i32* %3
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = call i32 (double, i32*, ...) bitcast (i32 (...)* @lgammaf_r to i32 (double, i32*, ...)*)(double %6, i32* %3)
%8 = sitofp i32 %7 to float
store float %8, float* %4
%9 = load float, float* %4
ret float %9
}

LLVM IR (-O2):
define float @lgammaf(float %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = fpext float %0 to double
%5 = call i32 (double, i32*, ...) bitcast (i32 (...)* @lgammaf_r to i32 (double, i32*, ...)*)(double %4, i32* %2)
%6 = sitofp i32 %5 to float
ret float %6
}
void example_NCC__unify(struct module *mod) {}


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

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

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

LLVM IR (-O2):
%struct.module = type opaque
define void @example_NCC__unify(%struct.module* nocapture %0) {
ret void
}
double reciprocal_estimate(double a) {
  int q = (int)(a * 512.0);
  double r = 1.0 / (((double)q + 0.5) / 512.0);
  int s = (int)(256.0 * r + 0.5);
  return (double)s / 256.0;
}


x86 assembly (clang, -O0):
<reciprocal_estimate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf07(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xede(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xea8(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea4(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
cvtsi2sdl -0x1c(%rbp),%xmm0
movsd  0xe84(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<reciprocal_estimate>:
mulsd  0xef8(%rip),%xmm0
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
movsd  0xef0(%rip),%xmm1
addsd  %xmm1,%xmm0
mulsd  0xeec(%rip),%xmm0
movsd  0xeec(%rip),%xmm2
divsd  %xmm0,%xmm2
mulsd  0xee8(%rip),%xmm2
addsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm0
cvtdq2pd %xmm0,%xmm0
mulsd  0xedc(%rip),%xmm0
ret

LLVM IR (-O0):
define double @reciprocal_estimate(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store double %0, double* %2
%6 = load double, double* %2
%7 = fmul double %6, 5.120000e+02
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sitofp i32 %9 to double
%11 = fadd double %10, 5.000000e-01
%12 = fdiv double %11, 5.120000e+02
%13 = fdiv double 1.000000e+00, %12
store double %13, double* %4
%14 = load double, double* %4
%15 = call double @llvm.fmuladd.f64(double 2.560000e+02, double %14, double 5.000000e-01)
%16 = fptosi double %15 to i32
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = sitofp i32 %17 to double
%19 = fdiv double %18, 2.560000e+02
ret double %19
}

LLVM IR (-O2):
define double @reciprocal_estimate(double %0) {
%2 = fmul double %0, 5.120000e+02
%3 = fptosi double %2 to i32
%4 = sitofp i32 %3 to double
%5 = fadd double %4, 5.000000e-01
%6 = fmul double %5, 0x3F60000000000000
%7 = fdiv double 1.000000e+00, %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 2.560000e+02, double 5.000000e-01)
%9 = fptosi double %8 to i32
%10 = sitofp i32 %9 to double
%11 = fmul double %10, 3.906250e-03
ret double %11
}
void XKeysymToKeycode() {}


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

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

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

LLVM IR (-O2):
define void @XKeysymToKeycode() {
ret void
}
/* Variables and functions */
unsigned long gfx_pci_config_read(int);
int /*<<< orphan*/ gfx_pci_config_write(int, unsigned long);
void I2CAL_set_data_for_output(void) {
  unsigned short reg;
  unsigned long value;
  value = gfx_pci_config_read(
      (0x80000000 | (0x00 << 16) | (0x12 << 11) | (0 << 8) | 0x90));
  reg = (unsigned short)value;
  reg |= 0x0008;
  value = reg;
  gfx_pci_config_write(
      (0x80000000 | (0x00 << 16) | (0x12 << 11) | (0 << 8) | 0x90), value);
}


x86 assembly (clang, -O0):
<I2CAL_set_data_for_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x80009090,%edi
call   1040 <gfx_pci_config_read@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
or     $0x8,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x80009090,%edi
call   1030 <gfx_pci_config_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CAL_set_data_for_output>:
push   %rax
mov    $0x80009090,%edi
call   1040 <gfx_pci_config_read@plt>
or     $0x8,%eax
movzwl %ax,%esi
mov    $0x80009090,%edi
pop    %rax
jmp    1030 <gfx_pci_config_write@plt>

LLVM IR (-O0):
define void @I2CAL_set_data_for_output() {
%1 = alloca i16
%2 = alloca i64
%3 = call i64 @gfx_pci_config_read(i32 -2147446640)
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = trunc i64 %4 to i16
store i16 %5, i16* %1
%6 = load i16, i16* %1
%7 = zext i16 %6 to i32
%8 = or i32 %7, 8
%9 = trunc i32 %8 to i16
store i16 %9, i16* %1
%10 = load i16, i16* %1
%11 = zext i16 %10 to i64
store i64 %11, i64* %2
%12 = load i64, i64* %2
%13 = call i32 @gfx_pci_config_write(i32 -2147446640, i64 %12)
ret void
}

LLVM IR (-O2):
define void @I2CAL_set_data_for_output() {
%1 = tail call i64 @gfx_pci_config_read(i32 -2147446640)
%2 = and i64 %1, 65527
%3 = or i64 %2, 8
%4 = tail call i32 @gfx_pci_config_write(i32 -2147446640, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __Pyx_PyAsyncGen_ClearFreeLists();
void __Pyx_PyAsyncGen_Fini(void) { __Pyx_PyAsyncGen_ClearFreeLists(); }


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

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

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

LLVM IR (-O2):
define void @__Pyx_PyAsyncGen_Fini() {
%1 = tail call i32 (...) @__Pyx_PyAsyncGen_ClearFreeLists()
ret void
}
/* Variables and functions */
char *strndup(char const *, int);
char *celix_utils_strdup(const char *str) {
  if (str != NULL) {
    return strndup(str, 1024 * 1024 * 1024);
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<celix_utils_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113e <celix_utils_strdup+0x2e>
mov    -0x10(%rbp),%rdi
mov    $0x40000000,%esi
call   1030 <strndup@plt>
mov    %rax,-0x8(%rbp)
jmp    1146 <celix_utils_strdup+0x36>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celix_utils_strdup>:
test   %rdi,%rdi
je     111f <celix_utils_strdup+0xf>
mov    $0x40000000,%esi
jmp    1030 <strndup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @celix_utils_strdup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @strndup(i8* %0, i32 1073741824)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ __NR_gettid;
int syscall(int /*<<< orphan*/);
int do_gettid(void) { return syscall(__NR_gettid); }


x86 assembly (clang, -O0):
<do_gettid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@__NR_gettid = global i32 0
define i32 @do_gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = call i32 @syscall(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@__NR_gettid = global i32 0
define i32 @do_gettid() {
%1 = load i32, i32* @__NR_gettid
%2 = tail call i32 @syscall(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_usage(void) {
  puts("Usage: iksroster [OPTIONS]\n"
       "This is a backup tool for your jabber roster.\n"
       " -b, --backup=JID    Download roster from the server.\n"
       " -r, --restore=JID   Upload roster to the server.\n"
       " -f, --file=FILE     Load/Save roster to this file.\n"
       " -t, --timeout=SECS  Set network timeout.\n"
       " -s, --secure        Use encrypted connection.\n"
       " -a, --sasl          Use SASL authentication.\n"
       " -l, --log           Print exchanged xml data.\n"
       " -h, --help          Print this text and exit.\n"
       " -V, --version       Print version and exit.\n"
       "(long options are not supported on your system)\n"
       "(secure connections are not supported on your system)\n"
       "Report bugs to <iksemel-dev@jabberstudio.org>.");
}


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

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

LLVM IR (-O0):
@.str = [652 x i8] c"Usage: iksroster [OPTIONS]\0AThis is a backup tool for your jabber roster.\0A -b, --backup=JID Download roster from the server.\0A -r, --restore=JID Upload roster to the server.\0A -f, --file=FILE Load/Save roster to this file.\0A -t, --timeout=SECS Set network timeout.\0A -s, --secure Use encrypted connection.\0A -a, --sasl Use SASL authentication.\0A -l, --log Print exchanged xml data.\0A -h, --help Print this text and exit.\0A -V, --version Print version and exit.\0A(long options are not supported on your system)\0A(secure connections are not supported on your system)\0AReport bugs to <iksemel-dev@jabberstudio.org>.\00"
define void @print_usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([652 x i8], [652 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [652 x i8] c"Usage: iksroster [OPTIONS]\0AThis is a backup tool for your jabber roster.\0A -b, --backup=JID Download roster from the server.\0A -r, --restore=JID Upload roster to the server.\0A -f, --file=FILE Load/Save roster to this file.\0A -t, --timeout=SECS Set network timeout.\0A -s, --secure Use encrypted connection.\0A -a, --sasl Use SASL authentication.\0A -l, --log Print exchanged xml data.\0A -h, --help Print this text and exit.\0A -V, --version Print version and exit.\0A(long options are not supported on your system)\0A(secure connections are not supported on your system)\0AReport bugs to <iksemel-dev@jabberstudio.org>.\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([652 x i8], [652 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeEPI(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000004, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeEPI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeEPI>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

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

LLVM IR (-O2):
define void @GPIOPinTypeEPI(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 4, i32 8)
ret void
}
unsigned int altera_a10_cdr_lookup_cp_current_pd(unsigned int fvco,
                                                 unsigned int lpd) {
  if (lpd == 1 && fvco < 12000000)
    return 3;
  else
    return 4;
}


x86 assembly (clang, -O0):
<altera_a10_cdr_lookup_cp_current_pd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    112d <altera_a10_cdr_lookup_cp_current_pd+0x2d>
cmpl   $0xb71b00,-0x8(%rbp)
jae    112d <altera_a10_cdr_lookup_cp_current_pd+0x2d>
movl   $0x3,-0x4(%rbp)
jmp    1134 <altera_a10_cdr_lookup_cp_current_pd+0x34>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<altera_a10_cdr_lookup_cp_current_pd>:
cmp    $0x1,%esi
sete   %al
cmp    $0xb71b00,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%ecx
mov    $0x4,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @altera_a10_cdr_lookup_cp_current_pd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 1
%4 = icmp ult i32 %0, 12000000
%5 = and i1 %4, %3
%6 = select i1 %5, i32 3, i32 4
ret i32 %6
}
/* Variables and functions */
char *chomp(int /*<<< orphan*/);
int /*<<< orphan*/ lchomp(char *);
char *tchomp(char *str) { return chomp(lchomp(str)); }


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

x86 assembly (clang, -O2):
<tchomp>:
push   %rax
call   1030 <lchomp@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <chomp@plt>

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

LLVM IR (-O2):
define i8* @tchomp(i8* %0) {
%2 = tail call i32 @lchomp(i8* %0)
%3 = tail call i8* @chomp(i32 %2)
ret i8* %3
}
char *str2lower(char *str) {
  char *p = str;
  while (*p) {
    if (*p >= 65 && *p <= 90) {
      *p += 32;
    }
    p++;
  }
  return str;
}


x86 assembly (clang, -O0):
<str2lower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <str2lower+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1149 <str2lower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1149 <str2lower+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <str2lower+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2lower>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <str2lower+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <str2lower+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <str2lower+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <str2lower+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <str2lower+0x10>
ret

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

LLVM IR (-O2):
define i8* @str2lower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int foo(int, int);
int main(int argc, char **argv) {
  int a = argc;
  a = foo(a, 5);
  return a;
}


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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x5,%esi
call   1030 <foo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x5,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
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
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @foo(i32 %8, i32 5)
store i32 %9, i32* %6
%10 = load i32, i32* %6
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 %0, i32 5)
ret i32 %3
}
int f(int k, int i1, int j1) {
  int *f1;
  if (k)
    f1 = &i1;
  else
    f1 = &j1;
  return *f1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1124 <f+0x24>
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112c <f+0x2c>
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char **);
int main(void) {
  char array[5];
  printf("    array = %p\n&array[0] = %p\n   &array = %p\n", array, &array[0],
         &array);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x9(%rbp),%rsi
lea    -0x9(%rbp),%rdx
lea    -0x9(%rbp),%rcx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x3(%rsp),%rcx
mov    %rcx,%rsi
mov    %rcx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c" array = %p\0A&array[0] = %p\0A &array = %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = bitcast [5 x i8]* %2 to i8**
%6 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4, i8** %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c" array = %p\0A&array[0] = %p\0A &array = %p\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = bitcast [5 x i8]* %1 to i8**
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %2, i8** %3)
ret i32 0
}
int isOperand(char c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}


x86 assembly (clang, -O0):
<isOperand>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <isOperand+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    114e <isOperand+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <isOperand+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isOperand>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isOperand(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 90
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isOperand(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int cleanup_realtime() { return 0; }


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

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

LLVM IR (-O0):
define i32 @cleanup_realtime() {
ret i32 0
}

LLVM IR (-O2):
define i32 @cleanup_realtime() {
ret i32 0
}
/* Type definitions */
struct winsize {
  scalar_t__ ws_col;
};

/* Variables and functions */
int /*<<< orphan*/ TIOCGWINSZ;
int ioctl(int, int /*<<< orphan*/, struct winsize *);
int getColumns(void) {
  struct winsize ws;
  if (ioctl(1, TIOCGWINSZ, &ws) == -1)
    return 4096;
  if (ws.ws_col == 0) {
    return 4096;
  }
  return ws.ws_col;
}


x86 assembly (clang, -O0):
<getColumns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
lea    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0xffffffff,%eax
jne    1144 <getColumns+0x34>
movl   $0x1000,-0x4(%rbp)
jmp    1162 <getColumns+0x52>
cmpq   $0x0,-0x10(%rbp)
jne    115b <getColumns+0x4b>
movl   $0x1000,-0x4(%rbp)
jmp    1162 <getColumns+0x52>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getColumns>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x1,%edi
call   1030 <ioctl@plt>
mov    (%rsp),%rcx
test   %rcx,%rcx
mov    $0x1000,%edx
cmove  %edx,%ecx
cmp    $0xffffffff,%eax
cmove  %edx,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i64 }
@TIOCGWINSZ = global i32 0
define i32 @getColumns() {
%1 = alloca i32
%2 = alloca %struct.winsize
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 1, i32 %3, %struct.winsize* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 4096, i32* %1
br label %16
7: ; preds = %0
%8 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 4096, i32* %1
br label %16
12: ; preds = %7
%13 = getelementptr inbounds %struct.winsize, %struct.winsize* %2, i32 0, i32 0
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
store i32 %15, i32* %1
br label %16
16: ; preds = %12, %11, %6
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
%struct.winsize = type { i64 }
@TIOCGWINSZ = global i32 0
define i32 @getColumns() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 1, i32 %3, %struct.winsize* %1)
%5 = icmp eq i32 %4, -1
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
%9 = trunc i64 %7 to i32
%10 = select i1 %5, i1 true, i1 %8
%11 = select i1 %10, i32 4096, i32 %9
ret i32 %11
}
int developer_mode_enabled(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @developer_mode_enabled() {
ret i32 0
}

LLVM IR (-O2):
define i32 @developer_mode_enabled() {
ret i32 0
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void RNDResponseSink_RenderingControl_ListPresets(struct UPnPService *Service,
                                                  int ErrorCode, void *User,
                                                  char *CurrentPresetNameList) {
  printf(
      "RND Invoke Response: RenderingControl/ListPresets[ErrorCode:%d](%s)\r\n",
      ErrorCode, CurrentPresetNameList);
}


x86 assembly (clang, -O0):
<RNDResponseSink_RenderingControl_ListPresets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rdx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [70 x i8] c"RND Invoke Response: RenderingControl/ListPresets[ErrorCode:%d](%s)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_ListPresets(%struct.UPnPService* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca %struct.UPnPService*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %8
%11 = call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [70 x i8] c"RND Invoke Response: RenderingControl/ListPresets[ErrorCode:%d](%s)\0D\0A\00"
define void @RNDResponseSink_RenderingControl_ListPresets(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHeader() {
  printf("      SkullOfSummer 2017 - Lorenzo Nodari - SbIEEE@UniBs\n");
  printf("                      -- DISCLAIMER --\n");
  printf("   This program is to be considered just a proof-of-concept\n");
  printf("This executable in only used to show that the library \"works\"\n");
}


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

x86 assembly (clang, -O2):
<printHeader>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xf30(%rip),%rdi
call   1030 <puts@plt>
lea    0xf60(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [58 x i8] c" SkullOfSummer 2017 - Lorenzo Nodari - SbIEEE@UniBs\0A\00"
@.str.1 = [40 x i8] c" -- DISCLAIMER --\0A\00"
@.str.2 = [61 x i8] c" This program is to be considered just a proof-of-concept\0A\00"
@.str.3 = [63 x i8] c"This executable in only used to show that the library \22works\22\0A\00"
define void @printHeader() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [57 x i8] c" SkullOfSummer 2017 - Lorenzo Nodari - SbIEEE@UniBs\00"
@str.4 = [39 x i8] c" -- DISCLAIMER --\00"
@str.5 = [60 x i8] c" This program is to be considered just a proof-of-concept\00"
@str.6 = [62 x i8] c"This executable in only used to show that the library \22works\22\00"
define void @printHeader() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str.6, i64 0, i64 0))
ret void
}
void g() {
  int x;
  x = 3;
}


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

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

LLVM IR (-O0):
define void @g() {
%1 = alloca i32
store i32 3, i32* %1
ret void
}

LLVM IR (-O2):
define void @g() {
ret void
}
/* Variables and functions */
double M_PI;
double acumulativa_inversa_acimut(double x) { return 2.0 * M_PI * x; }


x86 assembly (clang, -O0):
<acumulativa_inversa_acimut>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mov    0x2ed0(%rip),%rax
mulsd  (%rax),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<acumulativa_inversa_acimut>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm1
addsd  %xmm1,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @acumulativa_inversa_acimut(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* @M_PI
%4 = fmul double 2.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @acumulativa_inversa_acimut(double %0) {
%2 = load double, double* @M_PI
%3 = fmul double %2, 2.000000e+00
%4 = fmul double %3, %0
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ cgiBadVar(char *);
void htmlBadVar(char *varName) { cgiBadVar(varName); }


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

x86 assembly (clang, -O2):
<htmlBadVar>:
jmp    1030 <cgiBadVar@plt>

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

LLVM IR (-O2):
define void @htmlBadVar(i8* %0) {
%2 = tail call i32 @cgiBadVar(i8* %0)
ret void
}
/* Type definitions */
struct radix_tree_root {
  int dummy;
};

/* Variables and functions */
unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item) {
  return -1;
}


x86 assembly (clang, -O0):
<radix_tree_locate_item>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<radix_tree_locate_item>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
%struct.radix_tree_root = type { i32 }
define i64 @radix_tree_locate_item(%struct.radix_tree_root* %0, i8* %1) {
%3 = alloca %struct.radix_tree_root*
%4 = alloca i8*
store %struct.radix_tree_root* %0, %struct.radix_tree_root** %3
store i8* %1, i8** %4
ret i64 -1
}

LLVM IR (-O2):
%struct.radix_tree_root = type { i32 }
define i64 @radix_tree_locate_item(%struct.radix_tree_root* nocapture readnone %0, i8* nocapture readnone %1) {
ret i64 -1
}
void fg_init(struct cell_state *cell, short voltage, short temperature) {}


x86 assembly (clang, -O0):
<fg_init>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.cell_state = type opaque
define void @fg_init(%struct.cell_state* %0, i16 signext %1, i16 signext %2) {
%4 = alloca %struct.cell_state*
%5 = alloca i16
%6 = alloca i16
store %struct.cell_state* %0, %struct.cell_state** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
ret void
}

LLVM IR (-O2):
%struct.cell_state = type opaque
define void @fg_init(%struct.cell_state* nocapture %0, i16 signext %1, i16 signext %2) {
ret void
}
void cpu_print_last_instruction(void) {}


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

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

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

LLVM IR (-O2):
define void @cpu_print_last_instruction() {
ret void
}
/* Type definitions */
struct tms {
  double tms_utime;
  scalar_t__ tms_stime;
};

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
double usertimer_() {
  struct tms use;
  double tmp;
  times(&use);
  tmp = use.tms_utime;
  tmp += use.tms_stime;
  return (double)(tmp) / 60;
}


x86 assembly (clang, -O0):
<usertimer_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <times@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usertimer_>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <times@plt>
cvtsi2sdq 0x10(%rsp),%xmm0
addsd  0x8(%rsp),%xmm0
divsd  0xecd(%rip),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tms = type { double, i64 }
define double @usertimer_() {
%1 = alloca %struct.tms
%2 = alloca double
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%5 = load double, double* %4
store double %5, double* %2
%6 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = load double, double* %2
%10 = fadd double %9, %8
store double %10, double* %2
%11 = load double, double* %2
%12 = fdiv double %11, 6.000000e+01
ret double %12
}

LLVM IR (-O2):
%struct.tms = type { double, i64 }
define double @usertimer_() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 1
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fadd double %5, %8
%10 = fdiv double %9, 6.000000e+01
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ cnet_close();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void handle_sigsegv(int x) {
  fprintf(stderr, "~~~Received SIGSEGV, Fix Me~~~\n");
  cnet_close();
  exit(1);
}


x86 assembly (clang, -O0):
<handle_sigsegv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cnet_close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handle_sigsegv>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <cnet_close@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"~~~Received SIGSEGV, Fix Me~~~\0A\00"
define void @handle_sigsegv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @cnet_close()
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"~~~Received SIGSEGV, Fix Me~~~\0A\00"
define void @handle_sigsegv(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @cnet_close()
%5 = tail call i32 @exit(i32 1)
unreachable
}