xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  TYPE_2__ *(*create_image)();
};
struct TYPE_4__ {
  TYPE_1__ f;
};
typedef TYPE_2__ XImage;

/* Variables and functions */
void set_XImage_f_create_image(void *_p, void *_v) {
  ((XImage *)_p)->f.create_image = (XImage * (*)()) _v;
}


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

x86 assembly (clang, -O2):
<set_XImage_f_create_image>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XImage_f_create_image(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_quad_t;
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ xdr_u_hyper(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
bool_t xdr_u_longlong_t(XDR *xdrs, u_quad_t *ullp) {
  return xdr_u_hyper(xdrs, ullp);
}


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

x86 assembly (clang, -O2):
<xdr_u_longlong_t>:
jmp    1030 <xdr_u_hyper@plt>

LLVM IR (-O0):
define i32 @xdr_u_longlong_t(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 @xdr_u_hyper(i32* %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @xdr_u_longlong_t(i32* %0, i32* %1) {
%3 = tail call i32 @xdr_u_hyper(i32* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int g_utf8_validate(char const *, size_t, char const **);
int utf8_validate(const char *str, size_t max_len, const char **end) {
  return g_utf8_validate(str, max_len, end);
}


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

x86 assembly (clang, -O2):
<utf8_validate>:
jmp    1030 <g_utf8_validate@plt>

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

LLVM IR (-O2):
define i32 @utf8_validate(i8* %0, i64 %1, i8** %2) {
%4 = tail call i32 @g_utf8_validate(i8* %0, i64 %1, i8** %2)
ret i32 %4
}
const f1() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void version() {
  fprintf(stdout, "Entangled slave version: %s\n", "v0.0.1-dev");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xef2(%rip),%rdx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xef6(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [29 x i8] c"Entangled slave version: %s\0A\00"
@.str.1 = [11 x i8] c"v0.0.1-dev\00"
define void @version() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [29 x i8] c"Entangled slave version: %s\0A\00"
@.str.1 = [11 x i8] c"v0.0.1-dev\00"
define void @version() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tm {
  scalar_t__ tm_sec;
};

/* Variables and functions */
float Mysecond(struct tm *ptr) {
  return (float)((3.1415926535898 / 2) -
                 (((float)ptr->tm_sec) / 60) * 2 * 3.1415926535898);
}


x86 assembly (clang, -O0):
<Mysecond>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2ssq (%rax),%xmm0
movss  0xefb(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xeeb(%rip),%xmm1
mulss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb0(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mysecond>:
cvtsi2ssq (%rdi),%xmm0
divss  0xef3(%rip),%xmm0
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeeb(%rip),%xmm0
addsd  0xeeb(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
%struct.tm = type { i64 }
define float @Mysecond(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to float
%7 = fdiv float %6, 6.000000e+01
%8 = fmul float %7, 2.000000e+00
%9 = fpext float %8 to double
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %10, double 0x400921FB54442D28, double 0x3FF921FB54442D28)
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
%struct.tm = type { i64 }
define float @Mysecond(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to float
%5 = fdiv float %4, 6.000000e+01
%6 = fmul float %5, 2.000000e+00
%7 = fpext float %6 to double
%8 = fneg double %7
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x400921FB54442D28, double 0x3FF921FB54442D28)
%10 = fptrunc double %9 to float
ret float %10
}
int __fpclassifyf(float x) { return 0; }


x86 assembly (clang, -O0):
<__fpclassifyf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @__fpclassifyf(float %0) {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int stable_mixed_volume(int *mv, int *smv) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(79, mv, smv, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<stable_mixed_volume>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x4f,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stable_mixed_volume>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x4f,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @stable_mixed_volume(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc(i32 79, i32* %7, i32* %8, double* %9, i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @stable_mixed_volume(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc(i32 79, i32* %0, i32* %1, double* undef, i32 0)
ret i32 %3
}
unsigned kol_time_tick() { asm("int $0x40" ::"a"(26), "b"(9)); }


x86 assembly (clang, -O0):
<kol_time_tick>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    $0x1a,%eax
mov    $0x9,%ebx
int    $0x40
mov    -0xc(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_time_tick>:
push   %rbx
mov    $0x1a,%eax
mov    $0x9,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @kol_time_tick() {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},~{dirflag},~{fpsr},~{flags}"(i32 26, i32 9)
ret i32 undef
}
/* Type definitions */
struct list_simple {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct list_simple *);
int list_free(struct list_simple *list) { free(list); }


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

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

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

LLVM IR (-O2):
%struct.list_simple = type { i32 }
define i32 @list_free(%struct.list_simple* nocapture %0) {
%2 = tail call i32 @free(%struct.list_simple* %0)
ret i32 undef
}
float _matrix_2x2_determinant(float m[2][2]) {
  return (m[0][0] * m[1][1] - m[0][1] * m[1][0]);
}


x86 assembly (clang, -O0):
<_matrix_2x2_determinant>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x8(%rax),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_matrix_2x2_determinant>:
movss  0x8(%rdi),%xmm1
mulss  0x4(%rdi),%xmm1
movss  (%rdi),%xmm0
mulss  0xc(%rdi),%xmm0
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_matrix_2x2_determinant([2 x float]* %0) {
%2 = alloca [2 x float]*
store [2 x float]* %0, [2 x float]** %2
%3 = load [2 x float]*, [2 x float]** %2
%4 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0
%5 = getelementptr inbounds [2 x float], [2 x float]* %4, i64 0, i64 0
%6 = load float, float* %5
%7 = load [2 x float]*, [2 x float]** %2
%8 = getelementptr inbounds [2 x float], [2 x float]* %7, i64 1
%9 = getelementptr inbounds [2 x float], [2 x float]* %8, i64 0, i64 1
%10 = load float, float* %9
%11 = load [2 x float]*, [2 x float]** %2
%12 = getelementptr inbounds [2 x float], [2 x float]* %11, i64 0
%13 = getelementptr inbounds [2 x float], [2 x float]* %12, i64 0, i64 1
%14 = load float, float* %13
%15 = load [2 x float]*, [2 x float]** %2
%16 = getelementptr inbounds [2 x float], [2 x float]* %15, i64 1
%17 = getelementptr inbounds [2 x float], [2 x float]* %16, i64 0, i64 0
%18 = load float, float* %17
%19 = fmul float %14, %18
%20 = fneg float %19
%21 = call float @llvm.fmuladd.f32(float %6, float %10, float %20)
ret float %21
}

LLVM IR (-O2):
define float @_matrix_2x2_determinant([2 x float]* nocapture %0) {
%2 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 0, i64 0
%3 = load float, float* %2
%4 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 0, i64 1
%7 = load float, float* %6
%8 = getelementptr inbounds [2 x float], [2 x float]* %0, i64 1, i64 0
%9 = load float, float* %8
%10 = fneg float %7
%11 = fmul float %9, %10
%12 = tail call float @llvm.fmuladd.f32(float %3, float %5, float %11)
ret float %12
}
void get_dependencies_fmt(char **fmt) { *fmt = "urpmq -d %s"; }


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

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

LLVM IR (-O0):
@.str = [12 x i8] c"urpmq -d %s\00"
define void @get_dependencies_fmt(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %3
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"urpmq -d %s\00"
define void @get_dependencies_fmt(i8** nocapture writeonly %0) {
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memfill(unsigned long, int, int /*<<< orphan*/);
void free_page(unsigned long page) { memfill(page << 12, 0x1000, 0); }


x86 assembly (clang, -O0):
<free_page>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
shl    $0xc,%rdi
mov    $0x1000,%esi
xor    %edx,%edx
call   1030 <memfill@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_page>:
shl    $0xc,%rdi
mov    $0x1000,%esi
xor    %edx,%edx
jmp    1030 <memfill@plt>

LLVM IR (-O0):
define void @free_page(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 12
%5 = call i32 @memfill(i64 %4, i32 4096, i32 0)
ret void
}

LLVM IR (-O2):
define void @free_page(i64 %0) {
%2 = shl i64 %0, 12
%3 = tail call i32 @memfill(i64 %2, i32 4096, i32 0)
ret void
}
int any_LSB_one(unsigned x) { return !!(x & 0xFFu); }


x86 assembly (clang, -O0):
<any_LSB_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<any_LSB_one>:
xor    %eax,%eax
test   %dil,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @any_LSB_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @any_LSB_one(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int numa_available();
int numa_max_node();
int numanuma__get_num_nodes(void) {
  if (numa_available() == -1)
    return -1;
  return numa_max_node() + 1;
}


x86 assembly (clang, -O0):
<numanuma__get_num_nodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <numa_available@plt>
cmp    $0xffffffff,%eax
jne    1144 <numanuma__get_num_nodes+0x24>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <numanuma__get_num_nodes+0x31>
mov    $0x0,%al
call   1040 <numa_max_node@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numanuma__get_num_nodes>:
push   %rax
xor    %eax,%eax
call   1030 <numa_available@plt>
cmp    $0xffffffff,%eax
je     1139 <numanuma__get_num_nodes+0x19>
xor    %eax,%eax
call   1040 <numa_max_node@plt>
add    $0x1,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @numanuma__get_num_nodes() {
%1 = tail call i32 (...) @numa_available()
%2 = icmp eq i32 %1, -1
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @numa_max_node()
%5 = add nsw i32 %4, 1
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ %5, %3 ], [ -1, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_simulate();
int main() {
  if (!test_simulate()) {
    printf("Simulation failed!\n");
  } else {
    printf("Simulation successful.\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_simulate@plt>
cmp    $0x0,%eax
jne    1150 <main+0x30>
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
jmp    115c <main+0x3c>
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_simulate@plt>
test   %eax,%eax
lea    0xecf(%rip),%rax
lea    0xedb(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Simulation failed!\0A\00"
@.str.1 = [24 x i8] c"Simulation successful.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_simulate()
%3 = icmp ne i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@str = [19 x i8] c"Simulation failed!\00"
@str.2 = [23 x i8] c"Simulation successful.\00"
define i32 @main() {
%1 = tail call i32 (...) @test_simulate()
%2 = icmp eq i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
double __expm1(double);
double __sgn1(double);
double tanh(double __x) { return __expm1(__x) * __sgn1(-__x); }


x86 assembly (clang, -O0):
<tanh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <__expm1@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <__sgn1@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tanh>:
sub    $0x28,%rsp
movaps %xmm0,0x10(%rsp)
call   1030 <__expm1@plt>
movsd  %xmm0,0x8(%rsp)
movapd 0x10(%rsp),%xmm0
xorpd  0xebe(%rip),%xmm0
call   1040 <__sgn1@plt>
mulsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @tanh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__expm1(double %3)
%5 = load double, double* %2
%6 = fneg double %5
%7 = call double @__sgn1(double %6)
%8 = fmul double %4, %7
ret double %8
}

LLVM IR (-O2):
define double @tanh(double %0) {
%2 = tail call double @__expm1(double %0)
%3 = fneg double %0
%4 = tail call double @__sgn1(double %3)
%5 = fmul double %2, %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_short_help() {
  printf("Usage: %s [OPTIONS]... <[ADDRESS]... [INTERFACE]... | [-]>\n",
         "sipcalc");
  printf("Try '%s -h' for more information.\n", "sipcalc");
}


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

x86 assembly (clang, -O2):
<print_short_help>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xf1d(%rip),%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
lea    0xf16(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: %s [OPTIONS]... <[ADDRESS]... [INTERFACE]... | [-]>\0A\00"
@.str.1 = [8 x i8] c"sipcalc\00"
@.str.2 = [35 x i8] c"Try '%s -h' for more information.\0A\00"
define void @print_short_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Usage: %s [OPTIONS]... <[ADDRESS]... [INTERFACE]... | [-]>\0A\00"
@.str.1 = [8 x i8] c"sipcalc\00"
@.str.2 = [35 x i8] c"Try '%s -h' for more information.\0A\00"
define void @print_short_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int8_t delta_clip(int8_t i, int8_t min, int8_t max) {
  if (i < min)
    return min;
  else if (i > max)
    return max;
  else
    return i;
}


x86 assembly (clang, -O0):
<delta_clip>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    112b <delta_clip+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <delta_clip+0x4e>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    1146 <delta_clip+0x46>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <delta_clip+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delta_clip>:
mov    %rdx,%rax
cmp    %rdx,%rdi
cmovle %rdi,%rax
cmp    %rsi,%rdi
cmovl  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @delta_clip(i64 %0, i64 %1, i64 %2) {
%4 = icmp slt i64 %0, %1
%5 = icmp sgt i64 %0, %2
%6 = select i1 %5, i64 %2, i64 %0
%7 = select i1 %4, i64 %1, i64 %6
ret i64 %7
}
double longtod(unsigned long long l) { return *((double *)&l); }


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

x86 assembly (clang, -O2):
<longtod>:
movq   %rdi,%xmm0
ret

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

LLVM IR (-O2):
define double @longtod(i64 %0) {
%2 = bitcast i64 %0 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void uhi_free(void *p) { free(p); }


x86 assembly (clang, -O0):
<uhi_free>:
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):
<uhi_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @uhi_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
void si5338_write_error(int error, const char *s) {
  do {
    do {
    } while (0);
  } while (0);
  return;
}


x86 assembly (clang, -O0):
<si5338_write_error>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1110 <si5338_write_error+0x10>
jmp    1115 <si5338_write_error+0x15>
jmp    111a <si5338_write_error+0x1a>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @si5338_write_error(i32 %0, i8* nocapture %1) {
ret void
}
void prefetch0(volatile void *p) {
  asm volatile("prefetcht0 %[p]" : [p] "+m"(*(volatile char *)p));
}


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

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

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

LLVM IR (-O2):
define void @prefetch0(i8* %0) {
tail call void asm sideeffect "prefetcht0 $0", "=*m,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0, i8* elementtype(i8) %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void push(int *a, int **p, int v) {
  if (*p > a + 100) {
    printf("Overflow - 1\n");
  }
  **p = v;
  *p += 1;
}


x86 assembly (clang, -O0):
<push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
add    $0x190,%rcx
cmp    %rcx,%rax
jbe    114a <push+0x3a>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    (%rsi),%rax
add    $0x190,%rdi
cmp    %rdi,%rax
jbe    1136 <push+0x26>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rax
mov    %ebp,(%rax)
add    $0x4,%rax
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Overflow - 1\0A\00"
define void @push(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*** %5
%8 = load i32*, i32** %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 100
%11 = icmp ugt i32* %8, %10
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
%15 = load i32, i32* %6
%16 = load i32**, i32*** %5
%17 = load i32*, i32** %16
store i32 %15, i32* %17
%18 = load i32**, i32*** %5
%19 = load i32*, i32** %18
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32* %20, i32** %18
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Overflow - 1\00"
define void @push(i32* readnone %0, i32** nocapture %1, i32 %2) {
%4 = load i32*, i32** %1
%5 = getelementptr inbounds i32, i32* %0, i64 100
%6 = icmp ugt i32* %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%9 = load i32*, i32** %1
br label %10
10: ; preds = %7, %3
%11 = phi i32* [ %9, %7 ], [ %4, %3 ]
store i32 %2, i32* %11
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32* %12, i32** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VirtualizeTimerC__0__Timer__stop(unsigned int);
void OscilloscopeC__Timer__stop(void) { VirtualizeTimerC__0__Timer__stop(1U); }


x86 assembly (clang, -O0):
<OscilloscopeC__Timer__stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <VirtualizeTimerC__0__Timer__stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OscilloscopeC__Timer__stop>:
mov    $0x1,%edi
jmp    1030 <VirtualizeTimerC__0__Timer__stop@plt>

LLVM IR (-O0):
define void @OscilloscopeC__Timer__stop() {
%1 = call i32 @VirtualizeTimerC__0__Timer__stop(i32 1)
ret void
}

LLVM IR (-O2):
define void @OscilloscopeC__Timer__stop() {
%1 = tail call i32 @VirtualizeTimerC__0__Timer__stop(i32 1)
ret void
}
int HelpRawKey(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpRawKey() {
ret i32 0
}
int stbir__use_upsampling(float ratio) { return ratio > 1; }


x86 assembly (clang, -O0):
<stbir__use_upsampling>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbir__use_upsampling>:
xor    %eax,%eax
ucomiss 0xef7(%rip),%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @stbir__use_upsampling(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp ogt float %3, 1.000000e+00
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @stbir__use_upsampling(float %0) {
%2 = fcmp ogt float %0, 1.000000e+00
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int get_window_end_coordinates_excluding_gaps_with_start_end_index(
    int, int, int *, char *, int, int /*<<< orphan*/, int);
int get_window_end_coordinates_excluding_gaps(int window_start_coordinate,
                                              int window_size,
                                              int *snp_locations,
                                              char *child_sequence,
                                              int number_of_snps) {
  return get_window_end_coordinates_excluding_gaps_with_start_end_index(
      window_start_coordinate, window_size, snp_locations, child_sequence,
      number_of_snps, 0, number_of_snps);
}


x86 assembly (clang, -O0):
<get_window_end_coordinates_excluding_gaps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x1c(%rbp),%eax
xor    %r9d,%r9d
mov    %eax,(%rsp)
call   1030 <get_window_end_coordinates_excluding_gaps_with_start_end_index@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_window_end_coordinates_excluding_gaps>:
push   %rax
mov    %r8d,(%rsp)
xor    %r9d,%r9d
call   1030 <get_window_end_coordinates_excluding_gaps_with_start_end_index@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_window_end_coordinates_excluding_gaps(i32 %0, i32 %1, i32* %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32*, i32** %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = load i32, i32* %10
%17 = call i32 @get_window_end_coordinates_excluding_gaps_with_start_end_index(i32 %11, i32 %12, i32* %13, i8* %14, i32 %15, i32 0, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
define i32 @get_window_end_coordinates_excluding_gaps(i32 %0, i32 %1, i32* %2, i8* %3, i32 %4) {
%6 = tail call i32 @get_window_end_coordinates_excluding_gaps_with_start_end_index(i32 %0, i32 %1, i32* %2, i8* %3, i32 %4, i32 0, i32 %4)
ret i32 %6
}
void initJTAGPorts(void) {}


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

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

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

LLVM IR (-O2):
define void @initJTAGPorts() {
ret void
}
int position_to_array(int x, int y) { return (8 * y + x) / 2; }


x86 assembly (clang, -O0):
<position_to_array>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
add    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<position_to_array>:
lea    (%rdi,%rsi,8),%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @position_to_array(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 3
%4 = add nsw i32 %3, %0
%5 = sdiv i32 %4, 2
ret i32 %5
}
/* Variables and functions */
double log(double);
double rq_rate_simple_to_continuous(double r, double days,
                                    double days_in_year) {
  double af = 1.0 + r * days / days_in_year;
  return log(af) / (days / 365.0);
}


x86 assembly (clang, -O0):
<rq_rate_simple_to_continuous>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
movsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <log@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xea2(%rip),%xmm2
divsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rq_rate_simple_to_continuous>:
push   %rax
movsd  %xmm1,(%rsp)
mulsd  %xmm1,%xmm0
divsd  %xmm2,%xmm0
addsd  0xeda(%rip),%xmm0
call   1030 <log@plt>
movsd  (%rsp),%xmm1
divsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @rq_rate_simple_to_continuous(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* %4
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = load double, double* %6
%12 = fdiv double %10, %11
%13 = fadd double 1.000000e+00, %12
store double %13, double* %7
%14 = load double, double* %7
%15 = call double @log(double %14)
%16 = load double, double* %5
%17 = fdiv double %16, 3.650000e+02
%18 = fdiv double %15, %17
ret double %18
}

LLVM IR (-O2):
define double @rq_rate_simple_to_continuous(double %0, double %1, double %2) {
%4 = fmul double %0, %1
%5 = fdiv double %4, %2
%6 = fadd double %5, 1.000000e+00
%7 = tail call double @log(double %6)
%8 = fdiv double %1, 3.650000e+02
%9 = fdiv double %7, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float number;
  number = 10.4;
  printf("%.2f\n", number);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 0x4024CCCCC0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void hello(void) { printf("Hello, fun library.\n"); }


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello, fun library.\00"
define void @hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_BCint8_reg(signed char val) {
  return ((val) & (0xBC << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BCint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xbc,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BCint8_reg>:
test   $0xbc,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BCint8_reg(i8 signext %0) {
%2 = and i8 %0, -68
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_6Fuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x6F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Fuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 111
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ key(unsigned char, int /*<<< orphan*/, int /*<<< orphan*/);
void menu(int value) { key((unsigned char)value, 0, 0); }


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
movzbl %al,%edi
mov    %edx,%esi
call   1030 <key@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
movzbl %dil,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <key@plt>

LLVM IR (-O0):
define void @menu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = call i32 @key(i8 zeroext %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @menu(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @key(i8 zeroext %2, i32 0, i32 0)
ret void
}
int searchy_is_minus_phrase(char *query, char *ptr) {
  if (ptr == query) {
    return 0;
  }
  return (ptr[-1] == '-') ? 1 : 0;
}


x86 assembly (clang, -O0):
<searchy_is_minus_phrase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1126 <searchy_is_minus_phrase+0x26>
movl   $0x0,-0x4(%rbp)
jmp    113e <searchy_is_minus_phrase+0x3e>
mov    -0x18(%rbp),%rax
movsbl -0x1(%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x2d,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<searchy_is_minus_phrase>:
xor    %eax,%eax
cmp    %rdi,%rsi
je     110e <searchy_is_minus_phrase+0xe>
cmpb   $0x2d,-0x1(%rsi)
sete   %al
ret

LLVM IR (-O0):
define i32 @searchy_is_minus_phrase(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = load i8*, i8** %4
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 0, i32* %3
br label %18
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = getelementptr inbounds i8, i8* %11, i64 -1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 45
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
store i32 %17, i32* %3
br label %18
18: ; preds = %10, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @searchy_is_minus_phrase(i8* readnone %0, i8* %1) {
%3 = icmp eq i8* %1, %0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %1, i64 -1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 45
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void tio_move_cursor(int y, int x) { printf("\033[%i;%iH", y, x); }


x86 assembly (clang, -O0):
<tio_move_cursor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tio_move_cursor>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%i;%iH\00"
define void @tio_move_cursor(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 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%i;%iH\00"
define void @tio_move_cursor(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
void enleve1(char *s) {
  char *w;
  w = s;
  while (*w != '\0')
    *w++ = *(w + 1);
}


x86 assembly (clang, -O0):
<enleve1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113d <enleve1+0x3d>
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    1110 <enleve1+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<enleve1>:
cmpb   $0x0,(%rdi)
je     111e <enleve1+0x1e>
add    $0x1,%rdi
nopl   0x0(%rax)
movzbl (%rdi),%eax
mov    %al,-0x1(%rdi)
add    $0x1,%rdi
test   %al,%al
jne    1110 <enleve1+0x10>
ret

LLVM IR (-O0):
define void @enleve1(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 = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
store i8 %13, i8* %14
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @enleve1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
void kol_buffer_close(char name[]) {
  asm volatile("int $0x40" ::"a"(68), "b"(23), "c"(name));
}


x86 assembly (clang, -O0):
<kol_buffer_close>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x44,%eax
mov    $0x17,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_buffer_close>:
push   %rbx
mov    %rdi,%rcx
mov    $0x44,%eax
mov    $0x17,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_buffer_close(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 68, i32 23, i8* %0)
ret void
}
int main() {
  int a = 5;
  int b, c;
  b = c = a;
  return b;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Jack Daniels\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Jack Daniels\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Jack Daniels\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int f(int);
int main() { return f(5); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
ret i32 %1
}
void d2i_PublicKey(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_PublicKey() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fun_three(int, char, void *);
void fun_two(unsigned int p, const char *y) {
  fun_three((int)p, '1', (void *)y);
}


x86 assembly (clang, -O0):
<fun_two>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x31,%esi
call   1030 <fun_three@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_two>:
mov    %rsi,%rdx
mov    $0x31,%esi
jmp    1030 <fun_three@plt>

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

LLVM IR (-O2):
define void @fun_two(i32 %0, i8* %1) {
%3 = tail call i32 @fun_three(i32 %0, i8 signext 49, i8* %1)
ret void
}