xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strtol(char const *, char **, int);
__attribute__((always_, used)) int __Tales_atoi(const char *__nptr) {
  return (int)strtol(__nptr, (char **)NULL, 10);
}


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

x86 assembly (clang, -O2):
<__Tales_atoi>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtol@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i8*)* @__Tales_atoi to i8*)], section "llvm.metadata"
define i32 @__Tales_atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strtol(i8* %3, i8** null, i32 10)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (i8*)* @__Tales_atoi to i8*)], section "llvm.metadata"
define i32 @__Tales_atoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i8** null, i32 10)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ cdrom_set_null_handler(int /*<<< orphan*/);
int cdrom_null_open(uint8_t id, char d) {
  cdrom_set_null_handler(id);
  return (0);
}


x86 assembly (clang, -O0):
<cdrom_null_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <cdrom_set_null_handler@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdrom_null_open>:
push   %rax
call   1030 <cdrom_set_null_handler@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @cdrom_null_open(i32 %0, i8 signext %1) {
%3 = tail call i32 @cdrom_set_null_handler(i32 %0)
ret i32 0
}
int test_imm_6Dint8_mem(signed char *val) {
  return ((*val) & (0x6D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_6Dint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x6d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_6Dint8_mem>:
testb  $0x6d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_6Dint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 109
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_6Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 109
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__38__IO__makeOutput();
void Msp430GpioC__9__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__38__IO__makeOutput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__9__HplGeneralIO__makeOutput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__38__IO__makeOutput()
ret void
}
void RTAssertMsg1(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAssertMsg1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_ioprio_set;
int /*<<< orphan*/ ioprio_value(int, int);
int syscall(int /*<<< orphan*/, int, int, int /*<<< orphan*/);
int set_ioprio(int which, int who, int ioprio_class, int ioprio_prio) {
  return syscall(SYS_ioprio_set, which, who,
                 ioprio_value(ioprio_class, ioprio_prio));
}


x86 assembly (clang, -O0):
<set_ioprio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <ioprio_value@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_ioprio>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    0x2eb0(%rip),%rax
mov    (%rax),%ebx
mov    %edx,%edi
mov    %ecx,%esi
call   1030 <ioprio_value@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <syscall@plt>

LLVM IR (-O0):
@SYS_ioprio_set = global i32 0
define i32 @set_ioprio(i32 %0, i32 %1, i32 %2, i32 %3) {
%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 %3, i32* %8
%9 = load i32, i32* @SYS_ioprio_set
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32 @ioprio_value(i32 %12, i32 %13)
%15 = call i32 @syscall(i32 %9, i32 %10, i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@SYS_ioprio_set = global i32 0
define i32 @set_ioprio(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @SYS_ioprio_set
%6 = tail call i32 @ioprio_value(i32 %2, i32 %3)
%7 = tail call i32 @syscall(i32 %5, i32 %0, i32 %1, i32 %6)
ret i32 %7
}
/* Variables and functions */
double Random();
long Bernoulli(double p) { return ((Random() < (1.0 - p)) ? 0 : 1); }


x86 assembly (clang, -O0):
<Bernoulli>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Random@plt>
movaps %xmm0,%xmm1
movsd  0xed1(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    $0x1,%eax
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bernoulli>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <Random@plt>
movsd  0xedb(%rip),%xmm1
subsd  (%rsp),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
setbe  %al
pop    %rcx
ret

LLVM IR (-O0):
define i64 @Bernoulli(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @Random()
%4 = load double, double* %2
%5 = fsub double 1.000000e+00, %4
%6 = fcmp olt double %3, %5
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 0, i32 1
%9 = sext i32 %8 to i64
ret i64 %9
}

LLVM IR (-O2):
define i64 @Bernoulli(double %0) {
%2 = tail call double (...) @Random()
%3 = fsub double 1.000000e+00, %0
%4 = fcmp uge double %2, %3
%5 = zext i1 %4 to i64
ret i64 %5
}
/* Variables and functions */
scalar_t__ parse_int(int *, char const **);
int parse_uint16(unsigned short *out, const char **str) {
  int i;
  if (parse_int(&i, str) != 0)
    return -1;
  if (i < 0 || i > 0xffff)
    return -1;
  *out = i;
  return 0;
}


x86 assembly (clang, -O0):
<parse_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdi
call   1030 <parse_int@plt>
cmp    $0x0,%rax
je     1143 <parse_uint16+0x33>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <parse_uint16+0x6a>
cmpl   $0x0,-0x1c(%rbp)
jl     115a <parse_uint16+0x4a>
cmpl   $0xffff,-0x1c(%rbp)
jle    1166 <parse_uint16+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    117a <parse_uint16+0x6a>
mov    -0x1c(%rbp),%eax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_uint16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%rdi
call   1030 <parse_int@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jne    1140 <parse_uint16+0x30>
mov    0xc(%rsp),%ecx
cmp    $0xffff,%ecx
ja     1140 <parse_uint16+0x30>
mov    %cx,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parse_uint16(i16* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i16*
%5 = alloca i8**
%6 = alloca i32
store i16* %0, i16** %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = call i64 @parse_int(i32* %6, i8** %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 -1, i32* %3
br label %22
11: ; preds = %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %6
%16 = icmp sgt i32 %15, 65535
br i1 %16, label %17, label %18
17: ; preds = %14, %11
store i32 -1, i32* %3
br label %22
18: ; preds = %14
%19 = load i32, i32* %6
%20 = trunc i32 %19 to i16
%21 = load i16*, i16** %4
store i16 %20, i16* %21
store i32 0, i32* %3
br label %22
22: ; preds = %18, %17, %10
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @parse_uint16(i16* nocapture writeonly %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @parse_int(i32* %3, i8** %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp ugt i32 %8, 65535
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = trunc i32 %8 to i16
store i16 %11, i16* %0
br label %12
12: ; preds = %7, %2, %10
%13 = phi i32 [ 0, %10 ], [ -1, %2 ], [ -1, %7 ]
ret i32 %13
}
long long llfunc1(int a) { return a * 2; }


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

x86 assembly (clang, -O2):
<llfunc1>:
add    %edi,%edi
movslq %edi,%rax
ret

LLVM IR (-O0):
define i64 @llfunc1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 2
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @llfunc1(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = sext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ test59_InitTestM2_foo__E();
void test59_InitTestM_pollen__run__E() { test59_InitTestM2_foo__E(); }


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

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

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

LLVM IR (-O2):
define void @test59_InitTestM_pollen__run__E() {
%1 = tail call i32 (...) @test59_InitTestM2_foo__E()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fwrite(char const *, int, size_t, int /*<<< orphan*/ *);
void ext_write_log(FILE *sink, const char *buffer, size_t message_size) {
  if (!buffer || !sink) {
    return;
  }
  fwrite(buffer, sizeof(char), message_size, sink);
  fflush(sink);
}


x86 assembly (clang, -O0):
<ext_write_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <ext_write_log+0x2a>
cmpq   $0x0,-0x8(%rbp)
jne    114f <ext_write_log+0x2f>
jmp    116e <ext_write_log+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ext_write_log>:
test   %rdi,%rdi
je     1147 <ext_write_log+0x27>
test   %rsi,%rsi
je     1147 <ext_write_log+0x27>
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fflush@plt>
ret

LLVM IR (-O0):
define void @ext_write_log(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32*, i32** %4
%11 = icmp ne i32* %10, null
br i1 %11, label %13, label %12
12: ; preds = %9, %3
br label %20
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i64, i64* %6
%16 = load i32*, i32** %4
%17 = call i32 @fwrite(i8* %14, i32 1, i64 %15, i32* %16)
%18 = load i32*, i32** %4
%19 = call i32 @fflush(i32* %18)
br label %20
20: ; preds = %13, %12
ret void
}

LLVM IR (-O2):
define void @ext_write_log(i32* %0, i8* %1, i64 %2) {
%4 = icmp ne i8* %1, null
%5 = icmp ne i32* %0, null
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @fwrite(i8* %1, i32 1, i64 %2, i32* %0)
%9 = tail call i32 @fflush(i32* %0)
br label %10
10: ; preds = %3, %7
ret void
}
float add2(float n, float m) { return n + m; }


x86 assembly (clang, -O0):
<add2>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<add2>:
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @add2(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 = fadd float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @add2(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
double const exp(double const);
void df2(const double *y, const double *x, double **res) {
  **res = -*x * exp(*y);
}


x86 assembly (clang, -O0):
<df2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<df2>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movsd  (%rsi),%xmm0
xorps  0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <exp@plt>
mulsd  (%rsp),%xmm0
mov    (%rbx),%rax
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @df2(double* %0, double* %1, double** %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca double**
store double* %0, double** %4
store double* %1, double** %5
store double** %2, double*** %6
%7 = load double*, double** %5
%8 = load double, double* %7
%9 = fneg double %8
%10 = load double*, double** %4
%11 = load double, double* %10
%12 = call double @exp(double %11)
%13 = fmul double %9, %12
%14 = load double**, double*** %6
%15 = load double*, double** %14
store double %13, double* %15
ret void
}

LLVM IR (-O2):
define void @df2(double* nocapture %0, double* nocapture %1, double** nocapture %2) {
%4 = load double, double* %1
%5 = fneg double %4
%6 = load double, double* %0
%7 = tail call double @exp(double %6)
%8 = fmul double %7, %5
%9 = load double*, double** %2
store double %8, double* %9
ret void
}
char *langRomTypePac() { return "PAC (SRAM)"; }


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"PAC (SRAM)\00"
define i8* @langRomTypePac() {
ret i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef char *ssize_t;

/* Variables and functions */
char *set_errno(int);
ssize_t write(int fd, const char *buffer, size_t length) {
  int r;
  __asm__ __volatile__("\tmov $4, %%eax\n"
                       "\tint $0x80\n"
                       : "=a"(r)
                       : "b"(fd), "c"(buffer), "d"(length)
                       : "memory");
  return set_errno(r);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x28,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0xc(%rbp),%ebx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    $0x4,%eax
int    $0x80
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%edi
call   1030 <set_errno@plt>
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
push   %rbx
mov    %rsi,%rcx
mov    %edi,%ebx
mov    $0x4,%eax
int    $0x80
mov    %eax,%edi
pop    %rbx
jmp    1030 <set_errno@plt>

LLVM IR (-O0):
define i8* @write(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 asm sideeffect "\09mov $$4, %eax\0A\09int $$0x80\0A", "={ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %8, i8* %9, i64 %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = call i8* @set_errno(i32 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 asm sideeffect "\09mov $$4, %eax\0A\09int $$0x80\0A", "={ax},{bx},{cx},{dx},~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %0, i8* %1, i64 %2)
%5 = tail call i8* @set_errno(i32 %4)
ret i8* %5
}
void dummyinput_SDL_KeyDown(int keymod, int keysym) {}


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

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

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

LLVM IR (-O2):
define void @dummyinput_SDL_KeyDown(i32 %0, i32 %1) {
ret void
}
long long uuzu() { return 0x7fff7fff00007fffLL; }


x86 assembly (clang, -O0):
<uuzu>:
push   %rbp
mov    %rsp,%rbp
movabs $0x7fff7fff00007fff,%rax
7f ff 7f
pop    %rbp
ret

x86 assembly (clang, -O2):
<uuzu>:
movabs $0x7fff7fff00007fff,%rax
7f ff 7f
ret

LLVM IR (-O0):
define i64 @uuzu() {
ret i64 9223231295071485951
}

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

/* Variables and functions */
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
void free_bitarray_SSE2(uint32_t *x) { free(x); }


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

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

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

LLVM IR (-O2):
define void @free_bitarray_SSE2(i32* nocapture %0) {
%2 = tail call i32 @free(i32* %0)
ret void
}
void os_set_font(int new_font) {}


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

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

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

LLVM IR (-O2):
define void @os_set_font(i32 %0) {
ret void
}
/* Variables and functions */
double CalculateAirDensity(double);
double sqrt(double);
double CalculateDescentRate(double Weight, double CDTimesArea,
                            double Altitude) {
  double Density;
  Density = CalculateAirDensity(Altitude);
  return sqrt((Weight * 9.81) / (0.5 * Density * CDTimesArea));
}


x86 assembly (clang, -O0):
<CalculateDescentRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1030 <CalculateAirDensity@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  0xeba(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  -0x20(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalculateDescentRate>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movapd %xmm2,%xmm0
call   1030 <CalculateAirDensity@plt>
movsd  0x8(%rsp),%xmm1
mulsd  0xeb9(%rip),%xmm1
mulsd  0xeb9(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
divsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
movapd %xmm1,%xmm0
jb     1170 <CalculateDescentRate+0x50>
sqrtsd %xmm0,%xmm0
add    $0x18,%rsp
ret
add    $0x18,%rsp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @CalculateDescentRate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = call double @CalculateAirDensity(double %8)
store double %9, double* %7
%10 = load double, double* %4
%11 = fmul double %10, 9.810000e+00
%12 = load double, double* %7
%13 = fmul double 5.000000e-01, %12
%14 = load double, double* %5
%15 = fmul double %13, %14
%16 = fdiv double %11, %15
%17 = call double @sqrt(double %16)
ret double %17
}

LLVM IR (-O2):
define double @CalculateDescentRate(double %0, double %1, double %2) {
%4 = tail call double @CalculateAirDensity(double %2)
%5 = fmul double %0, 9.810000e+00
%6 = fmul double %4, 5.000000e-01
%7 = fmul double %6, %1
%8 = fdiv double %5, %7
%9 = tail call double @sqrt(double %8)
ret double %9
}
void CheckLambdaValue(int *const v) {
  if (*v < 1)
    *v = 1;
}


x86 assembly (clang, -O0):
<CheckLambdaValue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x1,(%rax)
jge    111f <CheckLambdaValue+0x1f>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckLambdaValue>:
cmpl   $0x0,(%rdi)
jle    1106 <CheckLambdaValue+0x6>
ret
movl   $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @CheckLambdaValue(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp slt i32 %2, 1
br i1 %3, label %4, label %5
4: ; preds = %1
store i32 1, i32* %0
br label %5
5: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef double GLfloat;

/* Variables and functions */
double getRadiano(GLfloat h) {
  GLfloat val = 3.14159265 / 180.0;
  return (double)h * val;
}


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

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

LLVM IR (-O0):
define double @getRadiano(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0x3F91DF46A1FAE712, double* %3
%4 = load double, double* %2
%5 = load double, double* %3
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @getRadiano(double %0) {
%2 = fmul double %0, 0x3F91DF46A1FAE712
ret double %2
}
void GPMCWaitMonitoringTimeSelect(unsigned int baseAddr, unsigned int csNum,
                                  unsigned int flag) {
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) &=
      ~(0x000C0000u);
  (*((volatile unsigned int *)(baseAddr + (0x60 + (csNum * (0x30)))))) |=
      ((flag << (0x00000012u)) & (0x000C0000u));
}


x86 assembly (clang, -O0):
<GPMCWaitMonitoringTimeSelect>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfff3ffff,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
shl    $0x12,%edx
and    $0xc0000,%edx
mov    -0x4(%rbp),%eax
imul   $0x30,-0x8(%rbp),%ecx
add    $0x60,%ecx
add    %ecx,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCWaitMonitoringTimeSelect>:
lea    (%rsi,%rsi,2),%eax
shl    $0x4,%eax
add    %edi,%eax
add    $0x60,%eax
andl   $0xfff3ffff,(%rax)
and    $0x3,%edx
shl    $0x12,%edx
or     %edx,(%rax)
ret

LLVM IR (-O0):
define void @GPMCWaitMonitoringTimeSelect(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = mul i32 %8, 48
%10 = add i32 96, %9
%11 = add i32 %7, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -786433
store volatile i32 %15, i32* %13
%16 = load i32, i32* %6
%17 = shl i32 %16, 18
%18 = and i32 %17, 786432
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = mul i32 %20, 48
%22 = add i32 96, %21
%23 = add i32 %19, %22
%24 = zext i32 %23 to i64
%25 = inttoptr i64 %24 to i32*
%26 = load volatile i32, i32* %25
%27 = or i32 %26, %18
store volatile i32 %27, i32* %25
ret void
}

LLVM IR (-O2):
define void @GPMCWaitMonitoringTimeSelect(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %1, 48
%5 = add i32 %0, 96
%6 = add i32 %5, %4
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -786433
store volatile i32 %10, i32* %8
%11 = shl i32 %2, 18
%12 = and i32 %11, 786432
%13 = load volatile i32, i32* %8
%14 = or i32 %13, %12
store volatile i32 %14, i32* %8
ret void
}
unsigned int _extur(unsigned int src2, int src1) {
  unsigned int csta = (src1 >> 5) & 0x1f;
  unsigned int cstb = src1 & 0x1f;
  return (src2 << csta) >> cstb;
}


x86 assembly (clang, -O0):
<_extur>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x5,%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x10(%rbp),%ecx
shr    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_extur>:
mov    %edi,%eax
mov    %esi,%ecx
shr    $0x5,%ecx
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @_extur(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = ashr i32 %7, 5
%9 = and i32 %8, 31
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = and i32 %10, 31
store i32 %11, i32* %6
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = shl i32 %12, %13
%15 = load i32, i32* %6
%16 = lshr i32 %14, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @_extur(i32 %0, i32 %1) {
%3 = lshr i32 %1, 5
%4 = and i32 %3, 31
%5 = and i32 %1, 31
%6 = shl i32 %0, %4
%7 = lshr i32 %6, %5
ret i32 %7
}
int ft_isalnum(int c) {
  if (c >= '0' && c <= '9')
    return (1);
  if (c >= 'A' && c <= 'Z')
    return (1);
  if (c >= 'a' && c <= 'z')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1127 <ft_isalnum+0x27>
cmpl   $0x39,-0x8(%rbp)
jg     1127 <ft_isalnum+0x27>
movl   $0x1,-0x4(%rbp)
jmp    116e <ft_isalnum+0x6e>
cmpl   $0x41,-0x8(%rbp)
jl     1147 <ft_isalnum+0x47>
cmpl   $0x5a,-0x8(%rbp)
jg     1147 <ft_isalnum+0x47>
movl   $0x1,-0x4(%rbp)
jmp    116e <ft_isalnum+0x6e>
cmpl   $0x61,-0x8(%rbp)
jl     1167 <ft_isalnum+0x67>
cmpl   $0x7a,-0x8(%rbp)
jg     1167 <ft_isalnum+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <ft_isalnum+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ft_isalnum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %25
10: ; preds = %6, %1
%11 = load i32, i32* %3
%12 = icmp sge i32 %11, 65
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = load i32, i32* %3
%15 = icmp sle i32 %14, 90
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1, i32* %2
br label %25
17: ; preds = %13, %10
%18 = load i32, i32* %3
%19 = icmp sge i32 %18, 97
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %3
%22 = icmp sle i32 %21, 122
br i1 %22, label %23, label %24
23: ; preds = %20
store i32 1, i32* %2
br label %25
24: ; preds = %20, %17
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23, %16, %9
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @ft_isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ popen(char *, char *);
void wiki_browsed() {
  popen("xdg-open http://admin.dcomp.ufs.br/wiki/index.php/Página_principal",
        "r");
}


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

x86 assembly (clang, -O2):
<wiki_browsed>:
lea    0xee9(%rip),%rdi
lea    0xf26(%rip),%rsi
jmp    1030 <popen@plt>

LLVM IR (-O0):
@.str = [68 x i8] c"xdg-open http://admin.dcomp.ufs.br/wiki/index.php/P\C3\A1gina_principal\00"
@.str.1 = [2 x i8] c"r\00"
define void @wiki_browsed() {
%1 = call i32 @popen(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [68 x i8] c"xdg-open http://admin.dcomp.ufs.br/wiki/index.php/P\C3\A1gina_principal\00"
@.str.1 = [2 x i8] c"r\00"
define void @wiki_browsed() {
%1 = tail call i32 @popen(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int f(int a, int b) {
  int d = 3;
  int z = a + d;
  return z;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRE1_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRE1_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRE1_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, long double *);
int uptime() {
  long double a;
  int i_uptime;
  FILE *fp;
  fp = fopen("/proc/uptime", "r");
  fscanf(fp, "%Lf", &a);
  fclose(fp);
  i_uptime = (int)a;
  return (i_uptime);
}


x86 assembly (clang, -O0):
<uptime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
lea    0xec7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb5(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
fldt   -0x10(%rbp)
fnstcw -0x26(%rbp)
movzwl -0x26(%rbp),%eax
or     $0xc00,%eax
mov    %ax,-0x28(%rbp)
fldcw  -0x28(%rbp)
fistpl -0x24(%rbp)
fldcw  -0x26(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uptime>:
push   %rbx
sub    $0x20,%rsp
lea    0xec4(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
fldt   0x10(%rsp)
fnstcw 0x8(%rsp)
movzwl 0x8(%rsp),%eax
or     $0xc00,%eax
mov    %ax,0xa(%rsp)
fldcw  0xa(%rsp)
fistpl 0xc(%rsp)
fldcw  0x8(%rsp)
mov    0xc(%rsp),%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/proc/uptime\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%Lf\00"
define i32 @uptime() {
%1 = alloca x86_fp80
%2 = alloca i32
%3 = alloca i32*
%4 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), x86_fp80* %1)
%7 = load i32*, i32** %3
%8 = call i32 @fclose(i32* %7)
%9 = load x86_fp80, x86_fp80* %1
%10 = fptosi x86_fp80 %9 to i32
store i32 %10, i32* %2
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"/proc/uptime\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%Lf\00"
define i32 @uptime() {
%1 = alloca x86_fp80
%2 = bitcast x86_fp80* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), x86_fp80* %1)
%5 = call i32 @fclose(i32* %3)
%6 = load x86_fp80, x86_fp80* %1
%7 = fptosi x86_fp80 %6 to i32
ret i32 %7
}
void error_add_message(char *msg) {}


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

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

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

LLVM IR (-O2):
define void @error_add_message(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
unsigned int if_nametoindex(char const *);
int /*<<< orphan*/ stderr;
unsigned int if_name2index(const char *ifname) {
  unsigned int i = if_nametoindex(ifname);
  if (!i) {
    fprintf(stderr, "ping: unknown iface %s\n", ifname);
    exit(2);
  }
  return i;
}


x86 assembly (clang, -O0):
<if_name2index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <if_nametoindex@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1175 <if_name2index+0x45>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe9a(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_name2index>:
push   %rbx
mov    %rdi,%rbx
call   1040 <if_nametoindex@plt>
test   %eax,%eax
je     113f <if_name2index+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"ping: unknown iface %s\0A\00"
define i32 @if_name2index(i8* %0) {
%2 = tail call i32 @if_nametoindex(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 2)
unreachable
8: ; preds = %1
ret i32 %2
}
void prefetchnta(const void *v) {
  __asm__ volatile("prefetchnta %0" : : "m"(*(const char *)v));
}


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

x86 assembly (clang, -O2):
<prefetchnta>:
prefetchnta (%rdi)
ret

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

LLVM IR (-O2):
define void @prefetchnta(i8* %0) {
tail call void asm sideeffect "prefetchnta $0", "*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0)
ret void
}
void PrintObjectGetVarPN2(void *theEnv, const char *logicalName,
                          void *theValue) {}


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

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

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

LLVM IR (-O2):
define void @PrintObjectGetVarPN2(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2) {
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  long double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double my_gettimeofday() {
  struct timeval tmp_time;
  gettimeofday(&tmp_time, NULL);
  return tmp_time.tv_sec + (tmp_time.tv_usec * 1.0e-6L);
}


x86 assembly (clang, -O0):
<my_gettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
xor    %eax,%eax
mov    %eax,%esi
lea    -0x20(%rbp),%rdi
call   1030 <gettimeofday@plt>
fldl   -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   0xecf(%rip)
fmulp  %st,%st(1)
faddp  %st,%st(1)
fstpl  -0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_gettimeofday>:
sub    $0x38,%rsp
lea    0x10(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
fldt   0x20(%rsp)
fldt   0xed6(%rip)
fmulp  %st,%st(1)
faddl  0x10(%rsp)
fstpl  0x8(%rsp)
movsd  0x8(%rsp),%xmm0
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, x86_fp80 }
define double @my_gettimeofday() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = fpext double %4 to x86_fp80
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load x86_fp80, x86_fp80* %6
%8 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %7, x86_fp80 0xK3FEB8637BD05AF6C69B6, x86_fp80 %5)
%9 = fptrunc x86_fp80 %8 to double
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, x86_fp80 }
define double @my_gettimeofday() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = fpext double %5 to x86_fp80
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load x86_fp80, x86_fp80* %7
%9 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %8, x86_fp80 0xK3FEB8637BD05AF6C69B6, x86_fp80 %6)
%10 = fptrunc x86_fp80 %9 to double
ret double %10
}
/* Variables and functions */
double pow(double, double);
double convert_it_1(double x) { return pow(x, 1.5); }


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

x86 assembly (clang, -O2):
<convert_it_1>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @convert_it_1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 1.500000e+00)
ret double %4
}

LLVM IR (-O2):
define double @convert_it_1(double %0) {
%2 = tail call double @pow(double %0, double 1.500000e+00)
ret double %2
}
/* Variables and functions */
unsigned long long _bzhi_u64(unsigned long long, int);
unsigned long long f30(unsigned long long x) { return _bzhi_u64(x, 69); }


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

x86 assembly (clang, -O2):
<f30>:
mov    $0x45,%esi
jmp    1030 <_bzhi_u64@plt>

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

LLVM IR (-O2):
define i64 @f30(i64 %0) {
%2 = tail call i64 @_bzhi_u64(i64 %0, i32 69)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
int userdb_find_bymask(char *);
int text_userdb_find_bymask3(char *nick, char *user, char *host) {
  char ident[256];
  snprintf(ident, 256, "%s!%s@%s", nick, user, host);
  return userdb_find_bymask(ident);
}


x86 assembly (clang, -O0):
<text_userdb_find_bymask3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x100,%esi
lea    0xeaa(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x120(%rbp),%rdi
call   1040 <userdb_find_bymask@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_userdb_find_bymask3>:
push   %rbx
sub    $0x100,%rsp
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xec8(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x100,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <userdb_find_bymask@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%s!%s@%s\00"
define i32 @text_userdb_find_bymask3(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [256 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @snprintf(i8* %8, i32 256, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%14 = call i32 @userdb_find_bymask(i8* %13)
ret i32 %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s!%s@%s\00"
define i32 @text_userdb_find_bymask3(i8* %0, i8* %1, i8* %2) {
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 256, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%7 = call i32 @userdb_find_bymask(i8* %5)
ret i32 %7
}
void botch(s) const char *s;
{ fatal("%s", s); }


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

x86 assembly (clang, -O2):
<botch>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <fatal@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @botch(i8* %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
float __floatunsisf(unsigned int i __attribute__((unused))) { return 0.0; }


x86 assembly (clang, -O0):
<__floatunsisf>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__floatunsisf>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @__floatunsisf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @__floatunsisf(i32 %0) {
ret float 0.000000e+00
}
int foo() {
  int i;
  *(long *)&i = 0;
  return i;
}


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

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca i32
%2 = bitcast i32* %1 to i64*
store i64 0, i64* %2
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int __attribute__((__stdcall__)) f(void) { printf("Hello from f!\n"); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hello from f!\0A\00"
define i32 @f() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [14 x i8] c"Hello from f!\00"
define i32 @f() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
signed int rt_par_finish(void) {
  signed int a = 0;
  return a;
}


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

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

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

LLVM IR (-O2):
define i32 @rt_par_finish() {
ret i32 0
}