xunge/DecIR huggingface dataset:
double catmull_rom(double x, double y0, double y1, double y2, double y3) {
  double a3 = y3 - y2 - y0 + y1;
  y3 = y0 - y1 - a3;
  return y1 + x * (y2 - y0 + x * (y3 + x * a3));
}


x86 assembly (clang, -O0):
<catmull_rom>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
subsd  -0x10(%rbp),%xmm3
movsd  -0x8(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm5
movsd  -0x8(%rbp),%xmm4
movsd  -0x30(%rbp),%xmm6
mulsd  %xmm6,%xmm4
addsd  %xmm5,%xmm4
mulsd  %xmm4,%xmm2
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<catmull_rom>:
subsd  %xmm3,%xmm4
subsd  %xmm1,%xmm4
addsd  %xmm2,%xmm4
subsd  %xmm1,%xmm3
subsd  %xmm2,%xmm1
subsd  %xmm4,%xmm1
mulsd  %xmm0,%xmm4
addsd  %xmm1,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @catmull_rom(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%12 = load double, double* %10
%13 = load double, double* %9
%14 = fsub double %12, %13
%15 = load double, double* %7
%16 = fsub double %14, %15
%17 = load double, double* %8
%18 = fadd double %16, %17
store double %18, double* %11
%19 = load double, double* %7
%20 = load double, double* %8
%21 = fsub double %19, %20
%22 = load double, double* %11
%23 = fsub double %21, %22
store double %23, double* %10
%24 = load double, double* %8
%25 = load double, double* %6
%26 = load double, double* %9
%27 = load double, double* %7
%28 = fsub double %26, %27
%29 = load double, double* %6
%30 = load double, double* %10
%31 = load double, double* %6
%32 = load double, double* %11
%33 = call double @llvm.fmuladd.f64(double %31, double %32, double %30)
%34 = call double @llvm.fmuladd.f64(double %29, double %33, double %28)
%35 = call double @llvm.fmuladd.f64(double %25, double %34, double %24)
ret double %35
}

LLVM IR (-O2):
define double @catmull_rom(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %4, %3
%7 = fsub double %6, %1
%8 = fadd double %7, %2
%9 = fsub double %1, %2
%10 = fsub double %9, %8
%11 = fsub double %3, %1
%12 = tail call double @llvm.fmuladd.f64(double %0, double %8, double %10)
%13 = tail call double @llvm.fmuladd.f64(double %0, double %12, double %11)
%14 = tail call double @llvm.fmuladd.f64(double %0, double %13, double %2)
ret double %14
}
void DH_get_default_method(void) {}


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

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

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

LLVM IR (-O2):
define void @DH_get_default_method() {
ret void
}
const unsigned int *mi_getblk(int ldev, int ch) {
  extern unsigned int **mi_root[32];
  extern char mi_tr_l2p[32];
  return mi_root[(int)mi_tr_l2p[ldev]][ch];
}


x86 assembly (clang, -O0):
<mi_getblk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2ed3(%rip),%rax
movsbl (%rax,%rcx,1),%eax
movslq %eax,%rcx
mov    0x2ead(%rip),%rax
mov    (%rax,%rcx,8),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_getblk>:
movslq %edi,%rax
mov    0x2ede(%rip),%rcx
movsbq (%rcx,%rax,1),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx,%rax,8),%rax
movslq %esi,%rcx
mov    (%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
@mi_root = external global [32 x i32**]
@mi_tr_l2p = external global [32 x i8]
define i32* @mi_getblk(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 = sext i32 %5 to i64
%7 = getelementptr inbounds [32 x i8], [32 x i8]* @mi_tr_l2p, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [32 x i32**], [32 x i32**]* @mi_root, i64 0, i64 %10
%12 = load i32**, i32*** %11
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32*, i32** %12, i64 %14
%16 = load i32*, i32** %15
ret i32* %16
}

LLVM IR (-O2):
@mi_root = external global [32 x i32**]
@mi_tr_l2p = external global [32 x i8]
define i32* @mi_getblk(i32 %0, i32 %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds [32 x i8], [32 x i8]* @mi_tr_l2p, i64 0, i64 %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i64
%7 = getelementptr inbounds [32 x i32**], [32 x i32**]* @mi_root, i64 0, i64 %6
%8 = load i32**, i32*** %7
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32*, i32** %8, i64 %9
%11 = load i32*, i32** %10
ret i32* %11
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Hello World!!");
  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 <puts@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"Hello World!!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World!!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t read_uint32(const void *src) {
  uint8_t *p = (uint8_t *)src;
  return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
}


x86 assembly (clang, -O0):
<read_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read_uint32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 24
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = shl i32 %17, 8
%19 = or i32 %14, %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 3
%22 = load i32, i32* %21
%23 = or i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @read_uint32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 12
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = or i32 %14, %17
ret i32 %18
}
double metresToFeet(double metres) { return metres * 3.2808; }


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

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

LLVM IR (-O0):
define double @metresToFeet(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.280800e+00
ret double %4
}

LLVM IR (-O2):
define double @metresToFeet(double %0) {
%2 = fmul double %0, 3.280800e+00
ret double %2
}
/* Type definitions */
struct map_ent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ map_delete(struct map_ent **, int);
int /*<<< orphan*/ map_free(struct map_ent *);
int /*<<< orphan*/ map_write(struct map_ent *);
void map_remove(struct map_ent **mapp, int devnum) {
  if (devnum == (1 << 23))
    return;
  map_delete(mapp, devnum);
  map_write(*mapp);
  map_free(*mapp);
}


x86 assembly (clang, -O0):
<map_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x800000,-0xc(%rbp)
jne    1151 <map_remove+0x21>
jmp    1175 <map_remove+0x45>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <map_delete@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1040 <map_write@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <map_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_remove>:
cmp    $0x800000,%esi
jne    1139 <map_remove+0x9>
ret
push   %rbx
mov    %rdi,%rbx
call   1050 <map_delete@plt>
mov    (%rbx),%rdi
call   1040 <map_write@plt>
mov    (%rbx),%rdi
pop    %rbx
jmp    1030 <map_free@plt>

LLVM IR (-O0):
%struct.map_ent = type { i32 }
define void @map_remove(%struct.map_ent** %0, i32 %1) {
%3 = alloca %struct.map_ent**
%4 = alloca i32
store %struct.map_ent** %0, %struct.map_ent*** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 8388608
br i1 %6, label %7, label %8
7: ; preds = %2
br label %18
8: ; preds = %2
%9 = load %struct.map_ent**, %struct.map_ent*** %3
%10 = load i32, i32* %4
%11 = call i32 @map_delete(%struct.map_ent** %9, i32 %10)
%12 = load %struct.map_ent**, %struct.map_ent*** %3
%13 = load %struct.map_ent*, %struct.map_ent** %12
%14 = call i32 @map_write(%struct.map_ent* %13)
%15 = load %struct.map_ent**, %struct.map_ent*** %3
%16 = load %struct.map_ent*, %struct.map_ent** %15
%17 = call i32 @map_free(%struct.map_ent* %16)
br label %18
18: ; preds = %8, %7
ret void
}

LLVM IR (-O2):
%struct.map_ent = type { i32 }
define void @map_remove(%struct.map_ent** %0, i32 %1) {
%3 = icmp eq i32 %1, 8388608
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = tail call i32 @map_delete(%struct.map_ent** %0, i32 %1)
%6 = load %struct.map_ent*, %struct.map_ent** %0
%7 = tail call i32 @map_write(%struct.map_ent* %6)
%8 = load %struct.map_ent*, %struct.map_ent** %0
%9 = tail call i32 @map_free(%struct.map_ent* %8)
br label %10
10: ; preds = %2, %4
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int fastrand();
void *hb_calloc_impl(size_t nmemb, size_t size) {
  return (fastrand() % 16) ? calloc(nmemb, size) : NULL;
}


x86 assembly (clang, -O0):
<hb_calloc_impl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fastrand@plt>
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     115e <hb_calloc_impl+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
jmp    1169 <hb_calloc_impl+0x49>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1169 <hb_calloc_impl+0x49>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hb_calloc_impl>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fastrand@plt>
test   $0xf,%al
je     1147 <hb_calloc_impl+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <calloc@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @hb_calloc_impl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = call i32 (...) @fastrand()
%6 = srem i32 %5, 16
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = call i8* @calloc(i64 %9, i64 %10)
br label %13
12: ; preds = %2
br label %13
13: ; preds = %12, %8
%14 = phi i8* [ %11, %8 ], [ null, %12 ]
ret i8* %14
}

LLVM IR (-O2):
define noalias i8* @hb_calloc_impl(i64 %0, i64 %1) {
%3 = tail call i32 (...) @fastrand()
%4 = and i32 %3, 15
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @calloc(i64 %0, i64 %1)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
int hpgl_open(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hpgl_open() {
ret i32 0
}
int is_in_bound(int *arr, int size, int *ptr) {
  if ((ptr > arr + size - 1) || (ptr < arr)) {
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
add    $0xfffffffffffffffc,%rcx
cmp    %rcx,%rax
ja     113d <is_in_bound+0x3d>
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1149 <is_in_bound+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1150 <is_in_bound+0x50>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
movslq %esi,%rax
lea    (%rdi,%rax,4),%rax
add    $0xfffffffffffffffc,%rax
cmp    %rdx,%rax
setae  %al
cmp    %rdi,%rdx
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 -1
%7 = icmp uge i32* %6, %2
%8 = icmp uge i32* %2, %0
%9 = and i1 %8, %7
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ mpfr_t;

/* Variables and functions */
int /*<<< orphan*/ cfree(int /*<<< orphan*/ *);
int /*<<< orphan*/ m_clear(int /*<<< orphan*/);
void freeArray(mpfr_t *array, const size_t size) {
  for (size_t i = 0; i < size; ++i) {
    m_clear(array[i]);
  }
  cfree(array);
}


x86 assembly (clang, -O0):
<freeArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1167 <freeArray+0x47>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <m_clear@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1138 <freeArray+0x18>
mov    -0x8(%rbp),%rdi
call   1040 <cfree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeArray>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
je     1152 <freeArray+0x32>
mov    %rsi,%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edi
call   1030 <m_clear@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <freeArray+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <cfree@plt>

LLVM IR (-O0):
define void @freeArray(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i64, i64* %5
%13 = getelementptr inbounds i32, i32* %11, i64 %12
%14 = load i32, i32* %13
%15 = call i32 @m_clear(i32 %14)
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
%20 = load i32*, i32** %3
%21 = call i32 @cfree(i32* %20)
ret void
}

LLVM IR (-O2):
define void @freeArray(i32* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @cfree(i32* %0)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %11, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 @m_clear(i32 %9)
%11 = add nuw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %4, label %6
}
void inter_elemental_sql_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @inter_elemental_sql_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ndb_unix_split(char const *, char *, char *);
void ndb_osdep_split(const char *s_files, char *pDir, char *pFile) {
  ndb_unix_split(s_files, pDir, pFile);
}


x86 assembly (clang, -O0):
<ndb_osdep_split>:
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 <ndb_unix_split@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndb_osdep_split>:
jmp    1030 <ndb_unix_split@plt>

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

LLVM IR (-O2):
define void @ndb_osdep_split(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @ndb_unix_split(i8* %0, i8* %1, i8* %2)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
float fastsqrt1(float x) {
  union {
    int32_t i;
    float x;
  } u;
  u.x = x;
  u.i = ((int32_t)1 << 29) + (u.i >> 1) - ((int32_t)1 << 22);
  return u.x;
}


x86 assembly (clang, -O0):
<fastsqrt1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
add    $0x20000000,%eax
sub    $0x400000,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastsqrt1>:
movd   %xmm0,%eax
sar    %eax
add    $0x1fc00000,%eax
movd   %eax,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @fastsqrt1(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = ashr i32 %7, 1
%9 = add nsw i32 536870912, %8
%10 = sub nsw i32 %9, 4194304
%11 = bitcast %union.anon* %3 to i32*
store i32 %10, i32* %11
%12 = bitcast %union.anon* %3 to float*
%13 = load float, float* %12
ret float %13
}

LLVM IR (-O2):
define float @fastsqrt1(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = add nsw i32 %3, 532676608
%5 = bitcast i32 %4 to float
ret float %5
}
void g_path_is_absolute() {}


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

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

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

LLVM IR (-O2):
define void @g_path_is_absolute() {
ret void
}
int opposite_neib_index(int i) {
  int d[] = {3, 4, 2, 5, 1, 0};
  return (i + d[i]);
}


x86 assembly (clang, -O0):
<opposite_neib_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeef(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeec(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
movslq -0x4(%rbp),%rcx
add    -0x20(%rbp,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opposite_neib_index>:
movslq %edi,%rcx
lea    0xef6(%rip),%rax
mov    (%rax,%rcx,4),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
@__const.opposite_neib_index.d = [6 x i32] [i32 3, i32 4, i32 2, i32 5, i32 1, i32 0]
define i32 @opposite_neib_index(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x i32]
store i32 %0, i32* %2
%4 = bitcast [6 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %7
%9 = load i32, i32* %8
%10 = add nsw i32 %5, %9
ret i32 %10
}

LLVM IR (-O2):
@__const.opposite_neib_index.d = [6 x i32] [i32 3, i32 4, i32 2, i32 5, i32 1, i32 0]
define i32 @opposite_neib_index(i32 %0) {
%2 = sext i32 %0 to i64
%3 = getelementptr inbounds [6 x i32], [6 x i32]* @__const.opposite_neib_index.d, i64 0, i64 %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %0
ret i32 %5
}
void gtk_file_chooser_remove_shortcut_folder_uri() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ bubbleSort(int *, int);
int /*<<< orphan*/ printArray(int *, int);
int /*<<< orphan*/ printf(char *);
int main() {
  int arr[] = {32, 1, 89, 54, 9, 7, 67};
  int n = sizeof(arr) / sizeof(arr[0]);
  bubbleSort(arr, n);
  printf("Sorted array:\n");
  printArray(arr, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <bubbleSort@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xed0(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <bubbleSort@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1050 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [7 x i32] [i32 32, i32 1, i32 89, i32 54, i32 9, i32 7, i32 67]
@.str = [15 x i8] c"Sorted array:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [7 x i32]* %2 to i8*
store i32 7, i32* %3
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @bubbleSort(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %3
%11 = call i32 @printArray(i32* %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [7 x i32] [i32 32, i32 1, i32 89, i32 54, i32 9, i32 7, i32 67]
@str = [14 x i8] c"Sorted array:\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @bubbleSort(i32* %3, i32 7)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%6 = call i32 @printArray(i32* %3, i32 7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FourFunction();
int /*<<< orphan*/ OneFunction();
void ThreeFunction() {
  static int count = 0;
  if (count == 0) {
    ++count;
    FourFunction();
  }
  OneFunction();
}


x86 assembly (clang, -O0):
<ThreeFunction>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f09(%rip)
jne    1147 <ThreeFunction+0x27>
mov    0x2efd(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ef4(%rip)
mov    $0x0,%al
call   1030 <FourFunction@plt>
mov    $0x0,%al
call   1040 <OneFunction@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ThreeFunction>:
push   %rax
cmpb   $0x0,0x2f0c(%rip)
jne    1138 <ThreeFunction+0x18>
movb   $0x1,0x2f03(%rip)
xor    %eax,%eax
call   1030 <FourFunction@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <OneFunction@plt>

LLVM IR (-O0):
@ThreeFunction.count = internal global i32 0
define void @ThreeFunction() {
%1 = load i32, i32* @ThreeFunction.count
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = load i32, i32* @ThreeFunction.count
%5 = add nsw i32 %4, 1
store i32 %5, i32* @ThreeFunction.count
%6 = call i32 (...) @FourFunction()
br label %7
7: ; preds = %3, %0
%8 = call i32 (...) @OneFunction()
ret void
}

LLVM IR (-O2):
@ThreeFunction.count = internal unnamed_addr global i1 false
define void @ThreeFunction() {
%1 = load i1, i1* @ThreeFunction.count
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @ThreeFunction.count
%3 = tail call i32 (...) @FourFunction()
br label %4
4: ; preds = %2, %0
%5 = tail call i32 (...) @OneFunction()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int *);
scalar_t__ malloc(int);
int *makeRecRanks(int numSubjects) {
  int *r;
  r = (int *)malloc(sizeof(int) * (numSubjects));
  assert(r);
  return r;
}


x86 assembly (clang, -O0):
<makeRecRanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeRecRanks>:
push   %rbx
shl    $0x2,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @makeRecRanks(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 4, %5
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %3
%10 = load i32*, i32** %3
%11 = call i32 @assert(i32* %10)
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
define i32* @makeRecRanks(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i64 @malloc(i32 %2)
%4 = inttoptr i64 %3 to i32*
%5 = tail call i32 @assert(i32* %4)
ret i32* %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: rand_emmc_perf [ -r | -w ] [-o] [-s count] [-f "
                  "full_stats_filename] <size_in_mb> <block_dev>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [101 x i8] c"Usage: rand_emmc_perf [ -r | -w ] [-o] [-s count] [-f full_stats_filename] <size_in_mb> <block_dev>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [101 x i8] c"Usage: rand_emmc_perf [ -r | -w ] [-o] [-s count] [-f full_stats_filename] <size_in_mb> <block_dev>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct scheduler {
  int dummy;
};

/* Variables and functions */
int sched_restore(struct scheduler *);
int sched_deadline_leave(struct scheduler *sched) {
  return sched_restore(sched);
}


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

x86 assembly (clang, -O2):
<sched_deadline_leave>:
jmp    1030 <sched_restore@plt>

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

LLVM IR (-O2):
%struct.scheduler = type { i32 }
define i32 @sched_deadline_leave(%struct.scheduler* %0) {
%2 = tail call i32 @sched_restore(%struct.scheduler* %0)
ret i32 %2
}
void foo_2_2_2_2_2_1_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_2_1_2_1_2() {
ret void
}
int f2(unsigned x) {
  unsigned a = 1, b = 0x7fffffff - 1;
  return x - a <= b;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x7ffffffe,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
store i32 2147483646, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sub i32 %5, %6
%8 = load i32, i32* %4
%9 = icmp ule i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f2(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int __finite(double __x) {
  return (__extension__(((((union {
                            double __d;
                            int __i[2];
                          }){__d : __x})
                              .__i[1] |
                          0x800fffffu) +
                         1) >>
                        31));
}


x86 assembly (clang, -O0):
<__finite>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     $0x800fffff,%eax
add    $0x1,%eax
shr    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__finite>:
movq   %xmm0,%rax
shr    $0x20,%rax
or     $0x800fffff,%eax
add    $0x1,%eax
shr    $0x1f,%eax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @__finite(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = bitcast %union.anon* %3 to double*
%5 = load double, double* %2
store double %5, double* %4
%6 = bitcast %union.anon* %3 to [2 x i32]*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 1
%8 = load i32, i32* %7
%9 = or i32 %8, -2146435073
%10 = add i32 %9, 1
%11 = lshr i32 %10, 31
ret i32 %11
}

LLVM IR (-O2):
define i32 @__finite(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 32
%4 = trunc i64 %3 to i32
%5 = or i32 %4, -2146435073
%6 = add nsw i32 %5, 1
%7 = lshr i32 %6, 31
ret i32 %7
}
long bar(long i) { return (long)((unsigned long)i + 2) - (long)i; }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
sub    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @bar(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 2
%5 = load i64, i64* %2
%6 = sub nsw i64 %4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @bar(i64 %0) {
ret i64 2
}
/* Variables and functions */
int /*<<< orphan*/ conio_init();
void caca_conio_sound(unsigned int frequency) { conio_init(); }


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

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

LLVM IR (-O0):
define void @caca_conio_sound(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @conio_init()
ret void
}

LLVM IR (-O2):
define void @caca_conio_sound(i32 %0) {
%2 = tail call i32 (...) @conio_init()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ prg8setBank2(int);
void m65setParamsC000(uint16_t addr, uint8_t val) {
  (void)addr;
  prg8setBank2(val << 13);
}


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

x86 assembly (clang, -O2):
mov    %esi,%edi
shl    $0xd,%edi
jmp    1030 <prg8setBank2@plt>

LLVM IR (-O0):
define void @m65setParamsC000(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 = shl i32 %6, 13
%8 = call i32 @prg8setBank2(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m65setParamsC000(i32 %0, i32 %1) {
%3 = shl i32 %1, 13
%4 = tail call i32 @prg8setBank2(i32 %3)
ret void
}
/* Variables and functions */
int ReadControlRegisterConfigData();
int /*<<< orphan*/ WriteControlRegisterConfigData(int);
void mmu_enable() {
  WriteControlRegisterConfigData(ReadControlRegisterConfigData() | 0x1);
}


x86 assembly (clang, -O0):
<mmu_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ReadControlRegisterConfigData@plt>
mov    %eax,%edi
or     $0x1,%edi
call   1040 <WriteControlRegisterConfigData@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmu_enable>:
push   %rax
xor    %eax,%eax
call   1030 <ReadControlRegisterConfigData@plt>
or     $0x1,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <WriteControlRegisterConfigData@plt>

LLVM IR (-O0):
define void @mmu_enable() {
%1 = call i32 (...) @ReadControlRegisterConfigData()
%2 = or i32 %1, 1
%3 = call i32 @WriteControlRegisterConfigData(i32 %2)
ret void
}

LLVM IR (-O2):
define void @mmu_enable() {
%1 = tail call i32 (...) @ReadControlRegisterConfigData()
%2 = or i32 %1, 1
%3 = tail call i32 @WriteControlRegisterConfigData(i32 %2)
ret void
}
/* Type definitions */
struct onak_dbctx {
  int dummy;
};

/* Variables and functions */
bool file_starttrans(struct onak_dbctx *dbctx) { return true; }


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

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

LLVM IR (-O0):
%struct.onak_dbctx = type { i32 }
define i32 @file_starttrans(%struct.onak_dbctx* %0) {
%2 = alloca %struct.onak_dbctx*
store %struct.onak_dbctx* %0, %struct.onak_dbctx** %2
ret i32 1
}

LLVM IR (-O2):
%struct.onak_dbctx = type { i32 }
define i32 @file_starttrans(%struct.onak_dbctx* nocapture readnone %0) {
ret i32 1
}
unsigned int get_size(char *test_string) {
  char *beg = test_string;
  char *end = test_string;
  while (*(++end) != '\0') {
  }
  end--;
  return end - beg;
}


x86 assembly (clang, -O0):
<get_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
je     1139 <get_size+0x39>
jmp    1118 <get_size+0x18>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_size>:
add    $0x1,%rdi
mov    $0xffffffff,%eax
nopl   0x0(%rax)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <get_size+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_size(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void __lyos_libutil_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @__lyos_libutil_dummy() {
ret void
}
void scale_matrix(double *matrix, double x, double y, double z) {
  matrix[0] *= x;
  matrix[5] *= y;
  matrix[10] *= z;
}


x86 assembly (clang, -O0):
<scale_matrix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x28(%rax),%xmm0
movsd  %xmm0,0x28(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x50(%rax),%xmm0
movsd  %xmm0,0x50(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_matrix>:
mulsd  (%rdi),%xmm0
movsd  %xmm0,(%rdi)
mulsd  0x28(%rdi),%xmm1
movsd  %xmm1,0x28(%rdi)
mulsd  0x50(%rdi),%xmm2
movsd  %xmm2,0x50(%rdi)
ret

LLVM IR (-O0):
define void @scale_matrix(double* %0, double %1, double %2, double %3) {
%5 = alloca double*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double* %0, double** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %6
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fmul double %12, %9
store double %13, double* %11
%14 = load double, double* %7
%15 = load double*, double** %5
%16 = getelementptr inbounds double, double* %15, i64 5
%17 = load double, double* %16
%18 = fmul double %17, %14
store double %18, double* %16
%19 = load double, double* %8
%20 = load double*, double** %5
%21 = getelementptr inbounds double, double* %20, i64 10
%22 = load double, double* %21
%23 = fmul double %22, %19
store double %23, double* %21
ret void
}

LLVM IR (-O2):
define void @scale_matrix(double* nocapture %0, double %1, double %2, double %3) {
%5 = load double, double* %0
%6 = fmul double %5, %1
store double %6, double* %0
%7 = getelementptr inbounds double, double* %0, i64 5
%8 = load double, double* %7
%9 = fmul double %8, %2
store double %9, double* %7
%10 = getelementptr inbounds double, double* %0, i64 10
%11 = load double, double* %10
%12 = fmul double %11, %3
store double %12, double* %10
ret void
}
long long uuuu() { return 0x7fff7fff7fff7fffLL; }


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

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

LLVM IR (-O0):
define i64 @uuuu() {
ret i64 9223231297218904063
}

LLVM IR (-O2):
define i64 @uuuu() {
ret i64 9223231297218904063
}
/* Type definitions */
typedef int /*<<< orphan*/ complex;

/* Variables and functions */
int /*<<< orphan*/ cimag(int /*<<< orphan*/);
int /*<<< orphan*/ creal(int /*<<< orphan*/);
double sqr(int /*<<< orphan*/);
double cnorm2(complex z) { return sqr(creal(z)) + sqr(cimag(z)); }


x86 assembly (clang, -O0):
<cnorm2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <creal@plt>
mov    %eax,%edi
call   1040 <sqr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <cimag@plt>
mov    %eax,%edi
call   1040 <sqr@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cnorm2>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1030 <creal@plt>
mov    %eax,%edi
call   1040 <sqr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %ebx,%edi
call   1050 <cimag@plt>
mov    %eax,%edi
call   1040 <sqr@plt>
addsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @cnorm2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @creal(i32 %3)
%5 = call double @sqr(i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @cimag(i32 %6)
%8 = call double @sqr(i32 %7)
%9 = fadd double %5, %8
ret double %9
}

LLVM IR (-O2):
define double @cnorm2(i32 %0) {
%2 = tail call i32 @creal(i32 %0)
%3 = tail call double @sqr(i32 %2)
%4 = tail call i32 @cimag(i32 %0)
%5 = tail call double @sqr(i32 %4)
%6 = fadd double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ compute();
int /*<<< orphan*/ use(int *, int /*<<< orphan*/);
void testSimple() {
  int *p = 0;
  use(p, compute());
}


x86 assembly (clang, -O0):
<testSimple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <compute@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1030 <use@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testSimple>:
push   %rax
xor    %eax,%eax
call   1040 <compute@plt>
xor    %edi,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <use@plt>

LLVM IR (-O0):
define void @testSimple() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
%3 = call i32 (...) @compute()
%4 = call i32 @use(i32* %2, i32 %3)
ret void
}

LLVM IR (-O2):
define void @testSimple() {
%1 = tail call i32 (...) @compute()
%2 = tail call i32 @use(i32* null, i32 %1)
ret void
}
int ft_endianness(void) {
  unsigned int i;
  char *c;
  i = 1;
  c = (char *)&i;
  if (*c)
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<ft_endianness>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112c <ft_endianness+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1133 <ft_endianness+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_endianness() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello World!\n");
  printf("Good Bye!\n");
  return 0;
}


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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [11 x i8] c"Good Bye!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.2 = [10 x i8] c"Good Bye!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
const int return_const() { return 4; }


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

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

LLVM IR (-O0):
define i32 @return_const() {
ret i32 4
}

LLVM IR (-O2):
define i32 @return_const() {
ret i32 4
}