xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ close(int);
int creat(char *, int);
int /*<<< orphan*/ write(int, unsigned char *, int);
void RS400_dumpraw(char filename[], unsigned char data[], int size) {
  int dump = creat(filename, 0644);
  write(dump, data, size);
  close(dump);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1a4,%esi
call   1050 <creat@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    -0x18(%rbp),%edi
call   1040 <close@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    $0x1a4,%esi
call   1050 <creat@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
mov    %ebp,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <close@plt>

LLVM IR (-O0):
define void @RS400_dumpraw(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = call i32 @creat(i8* %8, i32 420)
store i32 %9, i32* %7
%10 = load i32, i32* %7
%11 = load i8*, i8** %5
%12 = load i32, i32* %6
%13 = call i32 @write(i32 %10, i8* %11, i32 %12)
%14 = load i32, i32* %7
%15 = call i32 @close(i32 %14)
ret void
}

LLVM IR (-O2):
define void @RS400_dumpraw(i8* %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @creat(i8* %0, i32 420)
%5 = tail call i32 @write(i32 %4, i8* %1, i32 %2)
%6 = tail call i32 @close(i32 %4)
ret void
}
/* Type definitions */
struct olist_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __olist_del(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ olist_onext(struct olist_head *);
int /*<<< orphan*/ olist_oprev(struct olist_head *);
void __olist_del_entry(struct olist_head *entry) {
  __olist_del(olist_oprev(entry), olist_onext(entry));
}


x86 assembly (clang, -O0):
<__olist_del_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <olist_oprev@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <olist_onext@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <__olist_del@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__olist_del_entry>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <olist_oprev@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <olist_onext@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__olist_del@plt>

LLVM IR (-O0):
%struct.olist_head = type { i32 }
define void @__olist_del_entry(%struct.olist_head* %0) {
%2 = alloca %struct.olist_head*
store %struct.olist_head* %0, %struct.olist_head** %2
%3 = load %struct.olist_head*, %struct.olist_head** %2
%4 = call i32 @olist_oprev(%struct.olist_head* %3)
%5 = load %struct.olist_head*, %struct.olist_head** %2
%6 = call i32 @olist_onext(%struct.olist_head* %5)
%7 = call i32 @__olist_del(i32 %4, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.olist_head = type { i32 }
define void @__olist_del_entry(%struct.olist_head* %0) {
%2 = tail call i32 @olist_oprev(%struct.olist_head* %0)
%3 = tail call i32 @olist_onext(%struct.olist_head* %0)
%4 = tail call i32 @__olist_del(i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_readable_char(long);
void output_readable_char_str(char *s, long sl) {
  long n;
  n = 0;
  while (n < sl) {
    output_readable_char((long)s[n]);
    n = n + 1;
  }
  return;
}


x86 assembly (clang, -O0):
<output_readable_char_str>:
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
jge    1159 <output_readable_char_str+0x49>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbq (%rax,%rcx,1),%rdi
call   1030 <output_readable_char@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <output_readable_char_str+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_readable_char_str>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
jle    1143 <output_readable_char_str+0x33>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbq (%r14,%rbx,1),%rdi
call   1030 <output_readable_char@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <output_readable_char_str+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @output_readable_char_str(i8* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i64
%9 = tail call i32 @output_readable_char(i64 %8)
%10 = add nuw nsw i64 %5, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ generator_render(double, double, double, double);
int main(int argc, char *argv[]) {
  double min_r, max_r, min_i, max_i;
  min_r = -2;
  max_r = 1;
  min_i = -1;
  max_i = 1;
  generator_render(min_r, max_r, min_i, max_i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xee2(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xec0(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
call   1030 <generator_render@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm2
movsd  0xee7(%rip),%xmm1
movaps %xmm1,%xmm3
call   1030 <generator_render@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double -2.000000e+00, double* %6
store double 1.000000e+00, double* %7
store double -1.000000e+00, double* %8
store double 1.000000e+00, double* %9
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = load double, double* %9
%14 = call i32 @generator_render(double %10, double %11, double %12, double %13)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @generator_render(double -2.000000e+00, double 1.000000e+00, double -1.000000e+00, double 1.000000e+00)
ret i32 0
}
int exe$modify(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<exe$modify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe$modify>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$modify"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$modify"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int compChar(const void *a, const void *b) { return *(char *)a - *(char *)b; }


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

x86 assembly (clang, -O2):
<compChar>:
movsbl (%rdi),%eax
movsbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compChar(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ func_r();
int main(int argc, char *argv[]) {
  func_r();
  return (0);
}


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

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

LLVM IR (-O0):
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 (...) @func_r()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @func_r()
ret i32 0
}
/* Type definitions */
struct sched_param {
  int sched_priority;
};

/* Variables and functions */
int /*<<< orphan*/ SCHED_FIFO;
int /*<<< orphan*/ printf(char *);
scalar_t__ sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                              struct sched_param *);
void set_realtime() {
  struct sched_param param;
  param.sched_priority = 20;
  if (sched_setscheduler(0, SCHED_FIFO, &param) != 0) {
    printf("Failed to get RealTime priority");
  }
}


x86 assembly (clang, -O0):
<set_realtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x14,-0x8(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1040 <sched_setscheduler@plt>
cmp    $0x0,%rax
je     1159 <set_realtime+0x39>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_realtime>:
push   %rax
movl   $0x14,(%rsp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1040 <sched_setscheduler@plt>
test   %rax,%rax
je     114c <set_realtime+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
@.str = [32 x i8] c"Failed to get RealTime priority\00"
define void @set_realtime() {
%1 = alloca %struct.sched_param
%2 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i32 0, i32 0
store i32 20, i32* %2
%3 = load i32, i32* @SCHED_FIFO
%4 = call i64 @sched_setscheduler(i32 0, i32 %3, %struct.sched_param* %1)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
@.str = [32 x i8] c"Failed to get RealTime priority\00"
define void @set_realtime() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i32 20, i32* %3
%4 = load i32, i32* @SCHED_FIFO
%5 = call i64 @sched_setscheduler(i32 0, i32 %4, %struct.sched_param* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ idct_M128ASM_scalar(short *);
void Fast_IDCT(short *block) {
  {
    idct_M128ASM_scalar(block);
    return;
  }
}


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

x86 assembly (clang, -O2):
<Fast_IDCT>:
jmp    1030 <idct_M128ASM_scalar@plt>

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

LLVM IR (-O2):
define void @Fast_IDCT(i16* %0) {
%2 = tail call i32 @idct_M128ASM_scalar(i16* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Volume Calc V 0.01:\n\t1: use the rectangle formular v = lbh\n\t2: "
         "use the cube fomrular v = sss\n\t3: use sphere fomrular v = "
         "(4/3)PIr^3\n\t4: use Cylender, Cone or"
         "Pyramid formular v = PIr^2h\n\t5: display this info and exit\n");
}


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

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

LLVM IR (-O0):
@.str = [217 x i8] c"Volume Calc V 0.01:\0A\091: use the rectangle formular v = lbh\0A\092: use the cube fomrular v = sss\0A\093: use sphere fomrular v = (4/3)PIr^3\0A\094: use Cylender, Cone orPyramid formular v = PIr^2h\0A\095: display this info and exit\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([217 x i8], [217 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [216 x i8] c"Volume Calc V 0.01:\0A\091: use the rectangle formular v = lbh\0A\092: use the cube fomrular v = sss\0A\093: use sphere fomrular v = (4/3)PIr^3\0A\094: use Cylender, Cone orPyramid formular v = PIr^2h\0A\095: display this info and exit\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([216 x i8], [216 x i8]* @str, i64 0, i64 0))
ret void
}
void vnormal(float *v) {
  float return_value_vlength$1;
  return_value_vlength$1 = vlength(v);
  vscale(v, (float)(1.000000 / (double)return_value_vlength$1));
}


x86 assembly (clang, -O0):
<vnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <vlength@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <vscale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnormal>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <vlength@plt>
cvtsi2ss %eax,%xmm0
movss  0xec9(%rip),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
pop    %rbx
jmp    1040 <vscale@plt>

LLVM IR (-O0):
define void @vnormal(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = load float*, float** %2
%5 = call i32 (float*, ...) bitcast (i32 (...)* @vlength to i32 (float*, ...)*)(float* %4)
%6 = sitofp i32 %5 to float
store float %6, float* %3
%7 = load float*, float** %2
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fdiv double 1.000000e+00, %9
%11 = fptrunc double %10 to float
%12 = fpext float %11 to double
%13 = call i32 (float*, double, ...) bitcast (i32 (...)* @vscale to i32 (float*, double, ...)*)(float* %7, double %12)
ret void
}

LLVM IR (-O2):
define void @vnormal(float* %0) {
%2 = tail call i32 (float*, ...) bitcast (i32 (...)* @vlength to i32 (float*, ...)*)(float* %0)
%3 = sitofp i32 %2 to float
%4 = fdiv float 1.000000e+00, %3
%5 = fpext float %4 to double
%6 = tail call i32 (float*, double, ...) bitcast (i32 (...)* @vscale to i32 (float*, double, ...)*)(float* %0, double %5)
ret void
}
int do_701() { return 701; }


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

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

LLVM IR (-O0):
define i32 @do_701() {
ret i32 701
}

LLVM IR (-O2):
define i32 @do_701() {
ret i32 701
}
int ds_selftest_bts(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ds_selftest_bts() {
ret i32 0
}
/* Type definitions */
struct packit_record {
  int dummy;
};
struct packit {
  int dummy;
};
typedef int /*<<< orphan*/ ns;

/* Variables and functions */
struct packit_record *packit_add_header(struct packit *, char const *,
                                        char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, unsigned int);
struct packit_record *packit_add_uint_header(struct packit *p, const char *key,
                                             unsigned int val) {
  char ns[21];
  snprintf((char *)&ns, sizeof(ns), "%u", val);
  return packit_add_header(p, key, (const char *)&ns);
}


x86 assembly (clang, -O0):
<packit_add_uint_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%ecx
mov    $0x15,%esi
lea    0xeba(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1030 <packit_add_header@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packit_add_uint_header>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edx,%ecx
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec8(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x15,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <packit_add_header@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.packit_record = type { i32 }
%struct.packit = type { i32 }
@.str = [3 x i8] c"%u\00"
define %struct.packit_record* @packit_add_uint_header(%struct.packit* %0, i8* %1, i32 %2) {
%4 = alloca %struct.packit*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca [21 x i8]
store %struct.packit* %0, %struct.packit** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = bitcast [21 x i8]* %7 to i8*
%9 = load i32, i32* %6
%10 = call i32 @snprintf(i8* %8, i32 21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load %struct.packit*, %struct.packit** %4
%12 = load i8*, i8** %5
%13 = bitcast [21 x i8]* %7 to i8*
%14 = call %struct.packit_record* @packit_add_header(%struct.packit* %11, i8* %12, i8* %13)
ret %struct.packit_record* %14
}

LLVM IR (-O2):
%struct.packit_record = type { i32 }
%struct.packit = type { i32 }
@.str = [3 x i8] c"%u\00"
define %struct.packit_record* @packit_add_uint_header(%struct.packit* %0, i8* %1, i32 %2) {
%4 = alloca [21 x i8]
%5 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 21, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
%7 = call %struct.packit_record* @packit_add_header(%struct.packit* %0, i8* %1, i8* %5)
ret %struct.packit_record* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ perror(char *);
int putc(int, int /*<<< orphan*/ *);
int tf(FILE *file) {
  int c = 0;
  while ((c = getchar()) != EOF) {
    if (putc(c, file) == EOF) {
      perror("tf: putc");
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<tf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2e94(%rip),%rcx
cmp    (%rcx),%eax
je     1194 <tf+0x64>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
mov    0x2e79(%rip),%rcx
cmp    (%rcx),%eax
jne    118f <tf+0x5f>
lea    0xe82(%rip),%rdi
call   1050 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    119b <tf+0x6b>
jmp    1143 <tf+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    0x2eaa(%rip),%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
je     116a <tf+0x3a>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
cmp    (%rbx),%eax
jne    1140 <tf+0x10>
lea    0xea0(%rip),%rdi
call   1050 <perror@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@EOF = global i32 0
@.str = [9 x i8] c"tf: putc\00"
define i32 @tf(i32* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = tail call i32 @putc(i32 %3, i32* %0)
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %2
10: ; preds = %6
%11 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %2, %10
%13 = phi i32 [ 1, %10 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void testTortureExecute(void) {
  f(1);
  return;
}


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

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

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

LLVM IR (-O2):
define void @testTortureExecute() {
%1 = tail call i32 @f(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __isb(int /*<<< orphan*/);
void check__isb(void) { __isb(0); }


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

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

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

LLVM IR (-O2):
define void @check__isb() {
%1 = tail call i32 @__isb(i32 0)
ret void
}
void eigen(n, a, ev, work, ierr) int n, *ierr;
double *a, *ev, *work;
{
  orthesx(n, 1, n, a, work);
  hqrx(n, 1, n, a, ev, ierr);
}


x86 assembly (clang, -O0):
<eigen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <orthesx@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <hqrx@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eigen>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r8
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%esi
mov    %edi,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <orthesx@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    %r15,%r8
mov    %r14,%r9
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <hqrx@plt>

LLVM IR (-O0):
define void @eigen(i32 %0, double* %1, double* %2, double* %3, i32* %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca double*
%10 = alloca i32*
store i32 %0, i32* %6
store double* %1, double** %7
store double* %2, double** %8
store double* %3, double** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32, i32* %6
%13 = load double*, double** %7
%14 = load double*, double** %9
%15 = call i32 (i32, i32, i32, double*, double*, ...) bitcast (i32 (...)* @orthesx to i32 (i32, i32, i32, double*, double*, ...)*)(i32 %11, i32 1, i32 %12, double* %13, double* %14)
%16 = load i32, i32* %6
%17 = load i32, i32* %6
%18 = load double*, double** %7
%19 = load double*, double** %8
%20 = load i32*, i32** %10
%21 = call i32 (i32, i32, i32, double*, double*, i32*, ...) bitcast (i32 (...)* @hqrx to i32 (i32, i32, i32, double*, double*, i32*, ...)*)(i32 %16, i32 1, i32 %17, double* %18, double* %19, i32* %20)
ret void
}

LLVM IR (-O2):
define void @eigen(i32 %0, double* %1, double* %2, double* %3, i32* %4) {
%6 = tail call i32 (i32, i32, i32, double*, double*, ...) bitcast (i32 (...)* @orthesx to i32 (i32, i32, i32, double*, double*, ...)*)(i32 %0, i32 1, i32 %0, double* %1, double* %3)
%7 = tail call i32 (i32, i32, i32, double*, double*, i32*, ...) bitcast (i32 (...)* @hqrx to i32 (i32, i32, i32, double*, double*, i32*, ...)*)(i32 %0, i32 1, i32 %0, double* %1, double* %2, i32* %4)
ret void
}
/* Variables and functions */
int strcmp(void const *, void const *);
int compareStr(const void *pKeyOld, const void *pKeyNew) {
  return (strcmp(pKeyOld, pKeyNew));
}


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

x86 assembly (clang, -O2):
<compareStr>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @compareStr(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ x54x_out(int, int, void *);
void x54x_outw(uint16_t port, uint16_t val, void *priv) {
  x54x_out(port, val & 0xFF, priv);
}


x86 assembly (clang, -O0):
<x54x_outw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
mov    -0x10(%rbp),%rdx
call   1030 <x54x_out@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x54x_outw>:
movzbl %sil,%esi
jmp    1030 <x54x_out@plt>

LLVM IR (-O0):
define void @x54x_outw(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = and i32 %8, 255
%10 = load i8*, i8** %6
%11 = call i32 @x54x_out(i32 %7, i32 %9, i8* %10)
ret void
}

LLVM IR (-O2):
define void @x54x_outw(i32 %0, i32 %1, i8* %2) {
%4 = and i32 %1, 255
%5 = tail call i32 @x54x_out(i32 %0, i32 %4, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void SetTab() { WRITETEST("\033H"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"\1BH\00"
define void @SetTab() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ putstr(char *);
void run(void) {
  putstr("Hello, I am the MIPSEL\n");
  exit(0);
}


x86 assembly (clang, -O0):
<run>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <putstr@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<run>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <putstr@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Hello, I am the MIPSEL\0A\00"
define void @run() {
%1 = call i32 @putstr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [24 x i8] c"Hello, I am the MIPSEL\0A\00"
define void @run() {
%1 = tail call i32 @putstr(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ vpi_control(int, int);
int /*<<< orphan*/ vpi_printf(char *);
int abortSim(void) {
  vpi_printf("Abort...\n");
  vpi_control(67, 1);
  return -1;
}


x86 assembly (clang, -O0):
<abortSim>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <vpi_printf@plt>
mov    $0x43,%edi
mov    $0x1,%esi
call   1030 <vpi_control@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abortSim>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <vpi_printf@plt>
mov    $0x43,%edi
mov    $0x1,%esi
call   1030 <vpi_control@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Abort...\0A\00"
define i32 @abortSim() {
%1 = call i32 @vpi_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @vpi_control(i32 67, i32 1)
ret i32 -1
}

LLVM IR (-O2):
@.str = [10 x i8] c"Abort...\0A\00"
define i32 @abortSim() {
%1 = tail call i32 @vpi_printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @vpi_control(i32 67, i32 1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
int writebyte(int val) {
  char byte;
  byte = (char)val;
  write(0, &byte, 1);
  return 0;
}


x86 assembly (clang, -O0):
<writebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
xor    %edi,%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writebyte>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @writebyte(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = call i32 @write(i32 0, i8* %3, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @writebyte(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 @write(i32 0, i8* %2, i32 1)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t getArrayLength(uint32_t size) {
  return (uint32_t)(3 + (uint64_t)123 * size / 100);
}


x86 assembly (clang, -O0):
<getArrayLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x7b,-0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
add    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArrayLength>:
imul   $0x7b,%edi,%eax
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
sar    $0x25,%rcx
shr    $0x3f,%rax
add    %ecx,%eax
add    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @getArrayLength(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 123, %3
%5 = sdiv i32 %4, 100
%6 = add nsw i32 3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @getArrayLength(i32 %0) {
%2 = mul nsw i32 %0, 123
%3 = sdiv i32 %2, 100
%4 = add nsw i32 %3, 3
ret i32 %4
}
extern unsigned int cpuid_eax(unsigned int op) {
  unsigned int eax;
  __asm__("cpuid" : "=a"(eax) : "0"(op) : "bx", "cx", "dx");
  return eax;
}


x86 assembly (clang, -O0):
<cpuid_eax>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cpuid
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuid_eax>:
push   %rbx
mov    %edi,%eax
cpuid
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cpuid_eax(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "cpuid", "={ax},0,~{bx},~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @cpuid_eax(i32 %0) {
%2 = tail call i32 asm "cpuid", "={ax},0,~{bx},~{cx},~{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct wl_resource {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ wl_resource_post_event(struct wl_resource *, int,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void wl_pointer_send_axis_discrete(struct wl_resource *resource_, uint32_t axis,
                                   int32_t discrete) {
  wl_resource_post_event(resource_, 8, axis, discrete);
}


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

x86 assembly (clang, -O2):
<wl_pointer_send_axis_discrete>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x8,%esi
jmp    1030 <wl_resource_post_event@plt>

LLVM IR (-O0):
%struct.wl_resource = type { i32 }
define void @wl_pointer_send_axis_discrete(%struct.wl_resource* %0, i32 %1, i32 %2) {
%4 = alloca %struct.wl_resource*
%5 = alloca i32
%6 = alloca i32
store %struct.wl_resource* %0, %struct.wl_resource** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.wl_resource*, %struct.wl_resource** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @wl_resource_post_event(%struct.wl_resource* %7, i32 8, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.wl_resource = type { i32 }
define void @wl_pointer_send_axis_discrete(%struct.wl_resource* %0, i32 %1, i32 %2) {
%4 = tail call i32 @wl_resource_post_event(%struct.wl_resource* %0, i32 8, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pmu_reg_write(int, int);
void pmu_adc_disable() {
  pmu_reg_write(0x3B, ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |
                       (1 << 5) | (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) |
                       (1 << 10) | (0 << 11) | (0 << 12) | (0 << 13) |
                       (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) |
                       (1 << 18) | (1 << 19) | (1 << 20)));
}


x86 assembly (clang, -O0):
<pmu_adc_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3b,%edi
mov    $0x1fc7ff,%esi
call   1030 <pmu_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_disable>:
mov    $0x3b,%edi
mov    $0x1fc7ff,%esi
jmp    1030 <pmu_reg_write@plt>

LLVM IR (-O0):
define void @pmu_adc_disable() {
%1 = call i32 @pmu_reg_write(i32 59, i32 2082815)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_disable() {
%1 = tail call i32 @pmu_reg_write(i32 59, i32 2082815)
ret void
}
int test_imm_AAuint8_reg(unsigned char val) {
  return ((val) & (0xAA << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_AAuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 170
%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_AAuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -86
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
char *RCSid() {
  return RCSid("$Id: termdoc.c,v 1.15 2004/07/01 17:10:03 broeker Exp $");
}


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

x86 assembly (clang, -O2):
<RCSid>:
jmp    1100 <RCSid>

LLVM IR (-O0):
@.str = [56 x i8] c"$Id: termdoc.c,v 1.15 2004/07/01 17:10:03 broeker Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ MIDI_SetSongTick(unsigned long);
void MUSIC_SetSongTick(unsigned long PositionInTicks) {
  MIDI_SetSongTick(PositionInTicks);
}


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

x86 assembly (clang, -O2):
<MUSIC_SetSongTick>:
jmp    1030 <MIDI_SetSongTick@plt>

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

LLVM IR (-O2):
define void @MUSIC_SetSongTick(i64 %0) {
%2 = tail call i32 @MIDI_SetSongTick(i64 %0)
ret void
}
void break1() {}


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

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

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

LLVM IR (-O2):
define void @break1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkfifo(char *, int);
int main() {
  mkfifo("fifo", 0666);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1b6,%esi
call   1030 <mkfifo@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1b6,%esi
call   1030 <mkfifo@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"fifo\00"
define i32 @main() {
%1 = tail call i32 @mkfifo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 438)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void null_close(uint8_t id) {}


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

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

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

LLVM IR (-O2):
define void @null_close(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ msg_user_quit();
void execute_quit() {
  msg_user_quit();
  abort();
}


x86 assembly (clang, -O0):
<execute_quit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <msg_user_quit@plt>
mov    $0x0,%al
call   1040 <abort@plt>

x86 assembly (clang, -O2):
<execute_quit>:
push   %rax
xor    %eax,%eax
call   1030 <msg_user_quit@plt>
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
define void @execute_quit() {
%1 = call i32 (...) @msg_user_quit()
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @execute_quit() {
%1 = tail call i32 (...) @msg_user_quit()
%2 = tail call i32 (...) @abort()
unreachable
}
void reset_base_path_termination(char *base_path, int base_path_length) {
  base_path[base_path_length] = 0;
}


x86 assembly (clang, -O0):
<reset_base_path_termination>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_base_path_termination>:
movslq %esi,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @reset_base_path_termination(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @reset_base_path_termination(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
/* Variables and functions */
float fasterlog(float);
float fasterlgamma(float x) {
  return -0.0810614667f - x - fasterlog(x) + (0.5f + x) * fasterlog(1.0f + x);
}


x86 assembly (clang, -O0):
<fasterlgamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
subss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fasterlog@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xeb2(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe9c(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
call   1030 <fasterlog@plt>
movss  -0xc(%rbp),%xmm1
movaps %xmm0,%xmm2
movss  -0x8(%rbp),%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fasterlgamma>:
sub    $0x18,%rsp
movss  %xmm0,0x10(%rsp)
movss  0xede(%rip),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
call   1030 <fasterlog@plt>
movss  0xc(%rsp),%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
movss  0xebb(%rip),%xmm1
movss  0x10(%rsp),%xmm0
addss  %xmm0,%xmm1
movss  %xmm1,0x14(%rsp)
addss  0xea7(%rip),%xmm0
call   1030 <fasterlog@plt>
mulss  0x14(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define float @fasterlgamma(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float 0xBFB4C071C0000000, %3
%5 = load float, float* %2
%6 = call float @fasterlog(float %5)
%7 = fsub float %4, %6
%8 = load float, float* %2
%9 = fadd float 5.000000e-01, %8
%10 = load float, float* %2
%11 = fadd float 1.000000e+00, %10
%12 = call float @fasterlog(float %11)
%13 = call float @llvm.fmuladd.f32(float %9, float %12, float %7)
ret float %13
}

LLVM IR (-O2):
define float @fasterlgamma(float %0) {
%2 = fsub float 0xBFB4C071C0000000, %0
%3 = tail call float @fasterlog(float %0)
%4 = fsub float %2, %3
%5 = fadd float %0, 5.000000e-01
%6 = fadd float %0, 1.000000e+00
%7 = tail call float @fasterlog(float %6)
%8 = tail call float @llvm.fmuladd.f32(float %5, float %7, float %4)
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void Assert(int assertion, char const *error) {
  if (!assertion) {
    printf("Assertion Failed: %s\n", error);
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<Assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1153 <Assert+0x33>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Assert>:
test   %edi,%edi
je     1125 <Assert+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Assertion Failed: %s\0A\00"
define void @Assert(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 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Assertion Failed: %s\0A\00"
define void @Assert(i32 %0, i8* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __tree_free(const void *ptr) { free((void *)ptr); }


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

LLVM IR (-O0):
define void @__tree_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 @__tree_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int help() {
  puts("this [compose] (-v) [radix] [permutation] [permutation] ...");
  puts("this [enc] [radix] [permutation]");
  puts("this [dec] [radix] [permutational number]");
  return 0;
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2d(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [60 x i8] c"this [compose] (-v) [radix] [permutation] [permutation] ...\00"
@.str.1 = [33 x i8] c"this [enc] [radix] [permutation]\00"
@.str.2 = [42 x i8] c"this [dec] [radix] [permutational number]\00"
define i32 @help() {
%1 = call i32 @puts(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [60 x i8] c"this [compose] (-v) [radix] [permutation] [permutation] ...\00"
@.str.1 = [33 x i8] c"this [enc] [radix] [permutation]\00"
@.str.2 = [42 x i8] c"this [dec] [radix] [permutational number]\00"
define i32 @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}