xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
void TimerIntEnable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000018))) |= ui32IntFlags;
}


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

x86 assembly (clang, -O2):
<TimerIntEnable>:
mov    %rdi,-0x8(%rsp)
mov    %rsi,-0x10(%rsp)
mov    -0x10(%rsp),%rax
mov    -0x8(%rsp),%rcx
or     %rax,0x18(%rcx)
ret

LLVM IR (-O0):
define void @TimerIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 24
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerIntEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %4
%6 = load volatile i64, i64* %3
%7 = add nsw i64 %6, 24
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
%10 = or i64 %9, %5
store volatile i64 %10, i64* %8
ret void
}
/* Variables and functions */
long __NR_brk;
__attribute__((unused)) void *sys_brk(void *addr) {
  return (void *)({
    long _ret;
    register long _num asm("rax") = (__NR_brk);
    register long _arg1 asm("rdi") = (long)(addr);
    asm volatile("syscall\n"
                 : "=a"(_ret)
                 : "r"(_arg1), "0"(_num)
                 : "rcx", "r8", "r9", "r10", "r11", "memory", "cc");
    _ret;
  });
}


x86 assembly (clang, -O0):
<sys_brk>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
syscall
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_brk>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%rax
syscall
ret

LLVM IR (-O0):
@__NR_brk = global i64 0
define i8* @sys_brk(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %2
%7 = load i64, i64* @__NR_brk
store i64 %7, i64* %4
%8 = load i8*, i8** %2
%9 = ptrtoint i8* %8 to i64
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = load i64, i64* %4
%12 = call i64 asm sideeffect "syscall\0A", "={ax},{rdi},{rax},~{rcx},~{r8},~{r9},~{r10},~{r11},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11)
store i64 %12, i64* %3
%13 = load i64, i64* %3
store i64 %13, i64* %6
%14 = load i64, i64* %6
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
@__NR_brk = global i64 0
define i8* @sys_brk(i8* %0) {
%2 = load i64, i64* @__NR_brk
%3 = ptrtoint i8* %0 to i64
%4 = tail call i64 asm sideeffect "syscall\0A", "={ax},{rdi},{rax},~{rcx},~{r8},~{r9},~{r10},~{r11},~{memory},~{cc},~{dirflag},~{fpsr},~{flags}"(i64 %3, i64 %2)
%5 = inttoptr i64 %4 to i8*
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void print_F_N(float number) { printf("%g\n", number); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%g\0A\00"
define void @print_F_N(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ write2fifo(char *);
int on_play_quit() {
  write2fifo("quit");
  system("rm /tmp/musica_fifofile");
  sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<on_play_quit>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <write2fifo@plt>
lea    0xebe(%rip),%rdi
call   1030 <system@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_play_quit>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <write2fifo@plt>
lea    0xec1(%rip),%rdi
call   1030 <system@plt>
mov    $0x1,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"quit\00"
@.str.1 = [24 x i8] c"rm /tmp/musica_fifofile\00"
define i32 @on_play_quit() {
%1 = call i32 @write2fifo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @sleep(i32 1)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"quit\00"
@.str.1 = [24 x i8] c"rm /tmp/musica_fifofile\00"
define i32 @on_play_quit() {
%1 = tail call i32 @write2fifo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 1)
ret i32 0
}
/* Variables and functions */
int __builtin_mips_cabs_lt_s(float, float);
int test12(float a, float b) { return __builtin_mips_cabs_lt_s(a, b); }


x86 assembly (clang, -O0):
<test12>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <__builtin_mips_cabs_lt_s@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test12>:
jmp    1030 <__builtin_mips_cabs_lt_s@plt>

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

LLVM IR (-O2):
define i32 @test12(float %0, float %1) {
%3 = tail call i32 @__builtin_mips_cabs_lt_s(float %0, float %1)
ret i32 %3
}
void MIDI_send_start(void) {}


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

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

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

LLVM IR (-O2):
define void @MIDI_send_start() {
ret void
}
void d2i_EXTENDED_KEY_USAGE(void) {}


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

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

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

LLVM IR (-O2):
define void @d2i_EXTENDED_KEY_USAGE() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_add_autoload() {
  printf("NOT IMPLEMENTED:"
         "pa_context_add_autoload"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_context_add_autoload\00"
define i32 @pa_context_add_autoload() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int mt_rand_int32();
double mt_rand_res53(void) {
  unsigned long a = mt_rand_int32() >> 5, b = mt_rand_int32() >> 6;
  return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<mt_rand_res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <mt_rand_int32@plt>
mov    %eax,%ecx
mov    -0x11(%rbp),%al
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    %rcx,-0x8(%rbp)
call   1030 <mt_rand_int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x10(%rbp)
movaps 0xeca(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xec9(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_rand_res53>:
push   %rbx
xor    %eax,%eax
call   1030 <mt_rand_int32@plt>
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <mt_rand_int32@plt>
sar    $0x6,%eax
cltq
movq   %rbx,%xmm1
movdqa 0xec9(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xecd(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea8(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @mt_rand_res53() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @mt_rand_int32()
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
store i64 %5, i64* %1
%6 = call i32 (...) @mt_rand_int32()
%7 = ashr i32 %6, 6
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = uitofp i64 %9 to double
%11 = load i64, i64* %2
%12 = uitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %10, double 0x4190000000000000, double %12)
%14 = fmul double %13, 0x3CA0000000000000
ret double %14
}

LLVM IR (-O2):
define double @mt_rand_res53() {
%1 = tail call i32 (...) @mt_rand_int32()
%2 = ashr i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i32 (...) @mt_rand_int32()
%5 = ashr i32 %4, 6
%6 = sext i32 %5 to i64
%7 = uitofp i64 %3 to double
%8 = uitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x4190000000000000, double %8)
%10 = fmul double %9, 0x3CA0000000000000
ret double %10
}
/* Type definitions */
struct gdbserv {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gdbserv_output_byte(struct gdbserv *, char const);
void gdbserv_output_bytes(struct gdbserv *gdbserv, const char *buf,
                          unsigned sizeof_buf) {
  int i;
  for (i = 0; i < sizeof_buf; i++) {
    gdbserv_output_byte(gdbserv, buf[i]);
  }
}


x86 assembly (clang, -O0):
<gdbserv_output_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1159 <gdbserv_output_bytes+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
call   1030 <gdbserv_output_byte@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <gdbserv_output_bytes+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdbserv_output_bytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1146 <gdbserv_output_bytes+0x36>
mov    %rsi,%r14
mov    %rdi,%r15
mov    %edx,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <gdbserv_output_byte@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <gdbserv_output_bytes+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.gdbserv = type { i32 }
define void @gdbserv_output_bytes(%struct.gdbserv* %0, i8* %1, i32 %2) {
%4 = alloca %struct.gdbserv*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.gdbserv* %0, %struct.gdbserv** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp ult i32 %9, %10
br i1 %11, label %12, label %23
12: ; preds = %8
%13 = load %struct.gdbserv*, %struct.gdbserv** %4
%14 = load i8*, i8** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = call i32 @gdbserv_output_byte(%struct.gdbserv* %13, i8 signext %18)
br label %20
20: ; preds = %12
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
store i32 %22, i32* %7
br label %8
23: ; preds = %8
ret void
}

LLVM IR (-O2):
%struct.gdbserv = type { i32 }
define void @gdbserv_output_bytes(%struct.gdbserv* %0, i8* nocapture %1, i32 %2) {
%4 = icmp eq i32 %2, 0
br i1 %4, label %14, label %5
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %12, %7 ]
%9 = getelementptr inbounds i8, i8* %1, i64 %8
%10 = load i8, i8* %9
%11 = tail call i32 @gdbserv_output_byte(%struct.gdbserv* %0, i8 signext %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %6
br i1 %13, label %14, label %7
14: ; preds = %7, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int hwfind(int);
int /*<<< orphan*/ hwreset();
int upload(char const *, int /*<<< orphan*/ const *, int, int);
int pupload(const char *file, const uint8_t *dlbuf, int count, int type) {
  int rc = -1;
  int version = 0;
  hwreset();
  version = hwfind(1);
  if (version) {
    rc = upload(file, dlbuf, count, type);
  }
  return rc;
}


x86 assembly (clang, -O0):
<pupload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1050 <hwreset@plt>
mov    $0x1,%edi
call   1040 <hwfind@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1188 <pupload+0x58>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <upload@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pupload>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %eax,%eax
call   1050 <hwreset@plt>
mov    $0x1,%edi
call   1040 <hwfind@plt>
test   %eax,%eax
je     1173 <pupload+0x43>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <upload@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pupload(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 -1, i32* %9
store i32 0, i32* %10
%11 = call i32 (...) @hwreset()
%12 = call i32 @hwfind(i32 1)
store i32 %12, i32* %10
%13 = load i32, i32* %10
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %4
%16 = load i8*, i8** %5
%17 = load i32*, i32** %6
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = call i32 @upload(i8* %16, i32* %17, i32 %18, i32 %19)
store i32 %20, i32* %9
br label %21
21: ; preds = %15, %4
%22 = load i32, i32* %9
ret i32 %22
}

LLVM IR (-O2):
define i32 @pupload(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 (...) @hwreset()
%6 = tail call i32 @hwfind(i32 1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = tail call i32 @upload(i8* %0, i32* %1, i32 %2, i32 %3)
br label %10
10: ; preds = %8, %4
%11 = phi i32 [ %9, %8 ], [ -1, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ SA1Direct(int);
int /*<<< orphan*/ TRB8(int /*<<< orphan*/);
void Op14M1(void) { TRB8(SA1Direct(3)); }


x86 assembly (clang, -O0):
<Op14M1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
call   1040 <TRB8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op14M1>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Direct@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <TRB8@plt>

LLVM IR (-O0):
define void @Op14M1() {
%1 = call i32 @SA1Direct(i32 3)
%2 = call i32 @TRB8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op14M1() {
%1 = tail call i32 @SA1Direct(i32 3)
%2 = tail call i32 @TRB8(i32 %1)
ret void
}
float fft_dk(const unsigned int n, const float dx) {
  float dk = (2 * 3.14159265358979323846264338327950288) / (n * dx);
  return dk;
}


x86 assembly (clang, -O0):
<fft_dk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cvtsi2ss %rax,%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xedb(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fft_dk>:
mov    %edi,%eax
cvtsi2ss %rax,%xmm1
mulss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fft_dk(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%6 = load i32, i32* %3
%7 = uitofp i32 %6 to float
%8 = load float, float* %4
%9 = fmul float %7, %8
%10 = fpext float %9 to double
%11 = fdiv double 0x401921FB54442D18, %10
%12 = fptrunc double %11 to float
store float %12, float* %5
%13 = load float, float* %5
ret float %13
}

LLVM IR (-O2):
define float @fft_dk(i32 %0, float %1) {
%3 = uitofp i32 %0 to float
%4 = fmul float %3, %1
%5 = fpext float %4 to double
%6 = fdiv double 0x401921FB54442D18, %5
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ check(int *, long *);
int main(void) {
  long k;
  check((int *)&k, &k);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = bitcast i64* %1 to i32*
%4 = call i32 @check(i32* %3, i64* %1)
ret i32 0
}
void XPeekEvent() {}


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

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

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

LLVM IR (-O2):
define void @XPeekEvent() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SU_Make_Lowercase(char *);
char *SU_Lowercase(char *The_String) {
  SU_Make_Lowercase(The_String);
  return The_String;
}


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

x86 assembly (clang, -O2):
<SU_Lowercase>:
push   %rbx
mov    %rdi,%rbx
call   1030 <SU_Make_Lowercase@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @SU_Lowercase(i8* returned %0) {
%2 = tail call i32 @SU_Make_Lowercase(i8* %0)
ret i8* %0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int strlen(char *);
char *create_emphasis(char *s) {
  char *_str, *format = "<em>%s</em>";
  _str = (char *)malloc(strlen(s) + strlen(format) - 2 + 1);
  sprintf(_str, format, s);
  return _str;
}


x86 assembly (clang, -O0):
<create_emphasis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
add    %eax,%edi
sub    $0x2,%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_emphasis>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %eax,%r14d
lea    0xeb6(%rip),%r15
mov    %r15,%rdi
call   1030 <strlen@plt>
lea    (%r14,%rax,1),%edi
add    $0xffffffff,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [12 x i8] c"<em>%s</em>\00"
define i8* @create_emphasis(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = add nsw i32 %6, %8
%10 = sub nsw i32 %9, 2
%11 = add nsw i32 %10, 1
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = load i8*, i8** %4
%16 = load i8*, i8** %2
%17 = call i32 @sprintf(i8* %14, i8* %15, i8* %16)
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [12 x i8] c"<em>%s</em>\00"
define i8* @create_emphasis(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = add i32 %2, -1
%5 = add i32 %4, %3
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @sprintf(i8* dereferenceable(1) %7, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %7
}
int main() {
  char out = 0x55;
  __asm__("movb $0x7F, %%al; cmpb $0x7F, %%al; seto %%al" : "=a"(out));
  return out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movb   $0x55,-0x5(%rbp)
mov    $0x7f,%al
cmp    $0x7f,%al
seto   %al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x7f,%al
cmp    $0x7f,%al
seto   %al
movsbl %al,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 85, i8* %2
%3 = call i8 asm "movb $$0x7F, %al; cmpb $$0x7F, %al; seto %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8 asm "movb $$0x7F, %al; cmpb $$0x7F, %al; seto %al", "={ax},~{dirflag},~{fpsr},~{flags}"()
%2 = sext i8 %1 to i32
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ flexram_wait();
void eeprom_write_byte(uint8_t *addr, uint8_t value) {
  uint32_t offset = (uint32_t)addr;
  if (offset >= 2048)
    return;
  if (((uint8_t *)0x14000000)[offset] != value) {
    ((uint8_t *)0x14000000)[offset] = value;
    flexram_wait();
  }
}


x86 assembly (clang, -O0):
<eeprom_write_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x800,-0x14(%rbp)
jl     1139 <eeprom_write_byte+0x29>
jmp    1168 <eeprom_write_byte+0x58>
movslq -0x14(%rbp),%rcx
mov    $0x14000000,%eax
mov    (%rax,%rcx,8),%rax
cmp    -0x10(%rbp),%rax
je     1168 <eeprom_write_byte+0x58>
mov    -0x10(%rbp),%rdx
movslq -0x14(%rbp),%rcx
mov    $0x14000000,%eax
mov    %rdx,(%rax,%rcx,8)
mov    $0x0,%al
call   1030 <flexram_wait@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeprom_write_byte>:
cmp    $0x7ff,%edi
jg     1125 <eeprom_write_byte+0x15>
movslq %edi,%rax
cmp    %rsi,0x14000000(,%rax,8)
14
jne    1126 <eeprom_write_byte+0x16>
ret
lea    0x14000000(,%rax,8),%rax
14
mov    %rsi,(%rax)
xor    %eax,%eax
jmp    1030 <flexram_wait@plt>

LLVM IR (-O0):
define void @eeprom_write_byte(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
%5 = alloca i32
store i64* %0, i64** %3
store i64 %1, i64* %4
%6 = load i64*, i64** %3
%7 = ptrtoint i64* %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp sge i32 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %2
br label %24
11: ; preds = %2
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i64, i64* inttoptr (i64 335544320 to i64*), i64 %13
%15 = load i64, i64* %14
%16 = load i64, i64* %4
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %11
%19 = load i64, i64* %4
%20 = load i32, i32* %5
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* inttoptr (i64 335544320 to i64*), i64 %21
store i64 %19, i64* %22
%23 = call i32 (...) @flexram_wait()
br label %24
24: ; preds = %10, %18, %11
ret void
}

LLVM IR (-O2):
define void @eeprom_write_byte(i64* %0, i64 %1) {
%3 = ptrtoint i64* %0 to i64
%4 = trunc i64 %3 to i32
%5 = icmp sgt i32 %4, 2047
br i1 %5, label %14, label %6
6: ; preds = %2
%7 = shl i64 %3, 32
%8 = ashr exact i64 %7, 32
%9 = getelementptr inbounds i64, i64* inttoptr (i64 335544320 to i64*), i64 %8
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, %1
br i1 %11, label %14, label %12
12: ; preds = %6
store i64 %1, i64* %9
%13 = tail call i32 (...) @flexram_wait()
br label %14
14: ; preds = %6, %12, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
size_t list_meter_uint64_t(const void *el) { return sizeof(uint64_t); }


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

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

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

LLVM IR (-O2):
define i64 @list_meter_uint64_t(i8* nocapture readnone %0) {
ret i64 4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ n163AudioSet8_48XX(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ namcoSetN163(int /*<<< orphan*/);
void namco_setParams48XX_SetN163(uint16_t addr, uint8_t val) {
  namcoSetN163(addr);
  n163AudioSet8_48XX(addr, val);
}


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

x86 assembly (clang, -O2):
<namco_setParams48XX_SetN163>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <namcoSetN163@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <n163AudioSet8_48XX@plt>

LLVM IR (-O0):
define void @namco_setParams48XX_SetN163(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 = call i32 @namcoSetN163(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @n163AudioSet8_48XX(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @namco_setParams48XX_SetN163(i32 %0, i32 %1) {
%3 = tail call i32 @namcoSetN163(i32 %0)
%4 = tail call i32 @n163AudioSet8_48XX(i32 %0, i32 %1)
ret void
}
double DSConvertZUnitsToYd(int z, int zUnits) { return z * zUnits / 914400.0; }


x86 assembly (clang, -O0):
<DSConvertZUnitsToYd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee3(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSConvertZUnitsToYd>:
imul   %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @DSConvertZUnitsToYd(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 = mul nsw i32 %5, %6
%8 = sitofp i32 %7 to double
%9 = fdiv double %8, 9.144000e+05
ret double %9
}

LLVM IR (-O2):
define double @DSConvertZUnitsToYd(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 9.144000e+05
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("PASS\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"PASS\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct bbiFile {
  int dummy;
};

/* Variables and functions */
struct bbiFile *bbiFileOpen(char *, int, char *);
struct bbiFile *bigBedFileOpen(char *fileName) {
  return bbiFileOpen(fileName, 0x8789F2EB, "big bed");
}


x86 assembly (clang, -O0):
<bigBedFileOpen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x8789f2eb,%esi
lea    0xed4(%rip),%rdx
call   1030 <bbiFileOpen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bigBedFileOpen>:
lea    0xee9(%rip),%rdx
mov    $0x8789f2eb,%esi
jmp    1030 <bbiFileOpen@plt>

LLVM IR (-O0):
%struct.bbiFile = type { i32 }
@.str = [8 x i8] c"big bed\00"
define %struct.bbiFile* @bigBedFileOpen(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.bbiFile* @bbiFileOpen(i8* %3, i32 -2021002517, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.bbiFile* %4
}

LLVM IR (-O2):
%struct.bbiFile = type { i32 }
@.str = [8 x i8] c"big bed\00"
define %struct.bbiFile* @bigBedFileOpen(i8* %0) {
%2 = tail call %struct.bbiFile* @bbiFileOpen(i8* %0, i32 -2021002517, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret %struct.bbiFile* %2
}
/* Variables and functions */
size_t __ht_bucket_index(size_t hash, int M) { return hash & ((1 << M) - 1); }


x86 assembly (clang, -O0):
<__ht_bucket_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ht_bucket_index>:
mov    %esi,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
not    %eax
cltq
and    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @__ht_bucket_index(i64 %0, i32 %1) {
%3 = shl nsw i32 -1, %1
%4 = xor i32 %3, -1
%5 = sext i32 %4 to i64
%6 = and i64 %5, %0
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void key_del(void *data) { printf("key destruct \n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"key destruct \0A\00"
define void @key_del(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"key destruct \00"
define void @key_del(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t two_loops(int);
void call_two_loops_Bad() {
  int a[10];
  int m = 15;
  a[two_loops(m)] = 1;
}


x86 assembly (clang, -O0):
<call_two_loops_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0xf,-0x34(%rbp)
mov    -0x34(%rbp),%edi
call   1030 <two_loops@plt>
movl   $0x1,-0x30(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_two_loops_Bad>:
mov    $0xf,%edi
jmp    1030 <two_loops@plt>

LLVM IR (-O0):
define void @call_two_loops_Bad() {
%1 = alloca [10 x i32]
%2 = alloca i32
store i32 15, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @two_loops(i32 %3)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %4
store i32 1, i32* %5
ret void
}

LLVM IR (-O2):
define void @call_two_loops_Bad() {
%1 = tail call i64 @two_loops(i32 15)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ prune_arrblk_ne_CAT(int *);
void call_prune_arrblk_ne_Bad() {
  int *x = (int *)malloc(sizeof(int) * 5);
  prune_arrblk_ne_CAT(x);
}


x86 assembly (clang, -O0):
<call_prune_arrblk_ne_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <prune_arrblk_ne_CAT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_prune_arrblk_ne_Bad>:
push   %rax
mov    $0x14,%edi
call   1030 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <prune_arrblk_ne_CAT@plt>

LLVM IR (-O0):
define void @call_prune_arrblk_ne_Bad() {
%1 = alloca i32*
%2 = call i64 @malloc(i32 20)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @prune_arrblk_ne_CAT(i32* %4)
ret void
}

LLVM IR (-O2):
define void @call_prune_arrblk_ne_Bad() {
%1 = tail call i64 @malloc(i32 20)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @prune_arrblk_ne_CAT(i32* %2)
ret void
}
/* Variables and functions */
unsigned long htonl(unsigned long);
unsigned long int ntohl(unsigned long int x) { return htonl(x); }


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

x86 assembly (clang, -O2):
<ntohl>:
jmp    1030 <htonl@plt>

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

LLVM IR (-O2):
define i64 @ntohl(i64 %0) {
%2 = tail call i64 @htonl(i64 %0)
ret i64 %2
}
void lockAlarm() {}


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

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

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

LLVM IR (-O2):
define void @lockAlarm() {
ret void
}
int ssds_num_fields(int fd, int class_num) {
  if (class_num == 0)
    return 3;
  if (class_num == 1)
    return 4;
  if (class_num == 2)
    return 2;
  if (class_num == 3)
    return 6;
  return 8;
}


x86 assembly (clang, -O0):
<ssds_num_fields>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1120 <ssds_num_fields+0x20>
movl   $0x3,-0x4(%rbp)
jmp    1169 <ssds_num_fields+0x69>
cmpl   $0x1,-0xc(%rbp)
jne    1136 <ssds_num_fields+0x36>
movl   $0x4,-0x4(%rbp)
jmp    1169 <ssds_num_fields+0x69>
cmpl   $0x2,-0xc(%rbp)
jne    114c <ssds_num_fields+0x4c>
movl   $0x2,-0x4(%rbp)
jmp    1169 <ssds_num_fields+0x69>
cmpl   $0x3,-0xc(%rbp)
jne    1162 <ssds_num_fields+0x62>
movl   $0x6,-0x4(%rbp)
jmp    1169 <ssds_num_fields+0x69>
movl   $0x8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssds_num_fields>:
mov    $0x8,%eax
cmp    $0x3,%esi
ja     1117 <ssds_num_fields+0x17>
movslq %esi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.ssds_num_fields = [4 x i32] [i32 3, i32 4, i32 2, i32 6]
define i32 @ssds_num_fields(i32 %0, i32 %1) {
%3 = icmp ult i32 %1, 4
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.ssds_num_fields, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 8, %2 ]
ret i32 %9
}
void send_word(char **pp, unsigned short value) {
  unsigned char *b = (unsigned char *)*pp;
  b[0] = (value >> 8);
  b[1] = (value & 0xFF);
  *pp += 2;
}


x86 assembly (clang, -O0):
<send_word>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x2,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_word>:
mov    (%rdi),%rax
rol    $0x8,%si
mov    %si,(%rax)
addq   $0x2,(%rdi)
ret

LLVM IR (-O0):
define void @send_word(i8** %0, i16 zeroext %1) {
%3 = alloca i8**
%4 = alloca i16
%5 = alloca i8*
store i8** %0, i8*** %3
store i16 %1, i16* %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %5
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i16, i16* %4
%15 = zext i16 %14 to i32
%16 = and i32 %15, 255
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i64 1
store i8 %17, i8* %19
%20 = load i8**, i8*** %3
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8* %22, i8** %20
ret void
}

LLVM IR (-O2):
define void @send_word(i8** nocapture %0, i16 zeroext %1) {
%3 = load i8*, i8** %0
%4 = lshr i16 %1, 8
%5 = trunc i16 %4 to i8
store i8 %5, i8* %3
%6 = trunc i16 %1 to i8
%7 = getelementptr inbounds i8, i8* %3, i64 1
store i8 %6, i8* %7
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 2
store i8* %9, i8** %0
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;

/* Variables and functions */
int32_t squ2(uint16_t phase) { return (phase > (1 << 14)) ? 22938 : -22938; }


x86 assembly (clang, -O0):
<squ2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0xffffa666,%eax
mov    $0x599a,%ecx
cmp    $0x4000,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<squ2>:
cmp    $0x4001,%edi
mov    $0x599a,%ecx
mov    $0xffffa666,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @squ2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 16384
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 22938, i32 -22938
ret i32 %6
}

LLVM IR (-O2):
define i32 @squ2(i32 %0) {
%2 = icmp sgt i32 %0, 16384
%3 = select i1 %2, i32 22938, i32 -22938
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo();
int main(void) {
  int tmp;
  foo();
  tmp = 1;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
movl   $0x1,-0x8(%rbp)
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @foo()
store i32 1, i32* %2
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int test_009(int a, int b, int c, int d) { return c - d - (a < 0 != b < 0); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
cmpl   $0x0,-0x4(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmpl   $0x0,-0x8(%rbp)
setl   %dl
and    $0x1,%dl
movzbl %dl,%edx
cmp    %edx,%ecx
setne  %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
sub    %ecx,%edx
xor    %esi,%edi
sar    $0x1f,%edi
lea    (%rdi,%rdx,1),%eax
ret

LLVM IR (-O0):
define i32 @test_009(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = load i32, i32* %8
%11 = sub nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 0
%14 = zext i1 %13 to i32
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 0
%17 = zext i1 %16 to i32
%18 = icmp ne i32 %14, %17
%19 = zext i1 %18 to i32
%20 = sub nsw i32 %11, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @test_009(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub i32 %2, %3
%6 = xor i32 %1, %0
%7 = ashr i32 %6, 31
%8 = add i32 %5, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void lxcan_close(int s) { close(s); }


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

x86 assembly (clang, -O2):
<lxcan_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @lxcan_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int print_usage() {
  printf(" Usage: lu_signal [options]\n");
  printf(" Option:\n");
  printf(" \t[ -s <vector size> ] (default: %d)\n", 1024);
  return 1;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x400,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c" Usage: lu_signal [options]\0A\00"
@.str.1 = [10 x i8] c" Option:\0A\00"
@.str.2 = [38 x i8] c" \09[ -s <vector size> ] (default: %d)\0A\00"
define i32 @print_usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 1024)
ret i32 1
}

LLVM IR (-O2):
@.str.2 = [38 x i8] c" \09[ -s <vector size> ] (default: %d)\0A\00"
@str = [28 x i8] c" Usage: lu_signal [options]\00"
@str.3 = [9 x i8] c" Option:\00"
define i32 @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 1024)
ret i32 1
}
int test_imm_0Fint16_reg(short val) {
  return ((val) & (-0x0F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Fint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xfffffff1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Fint16_reg>:
test   $0xfff1,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Fint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, -15
%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_0Fint16_reg(i16 signext %0) {
%2 = and i16 %0, -15
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ TextPrintMsg(char *);
void ShowTitle(void) {
  TextPrintMsg("\n"
               "**** GLBSP Node Builder "
               "2.24"
               " (C) 2007 Andrew Apted ****\n\n");
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"\0A**** GLBSP Node Builder 2.24 (C) 2007 Andrew Apted ****\0A\0A\00"
define void @ShowTitle() {
%1 = call i32 @TextPrintMsg(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [59 x i8] c"\0A**** GLBSP Node Builder 2.24 (C) 2007 Andrew Apted ****\0A\0A\00"
define void @ShowTitle() {
%1 = tail call i32 @TextPrintMsg(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void segmentation_handler(int Sig) {
  printf("Got a segmentation fault while parsing program import table: %d .\n",
         Sig);
}


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

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

LLVM IR (-O0):
@.str = [67 x i8] c"Got a segmentation fault while parsing program import table: %d .\0A\00"
define void @segmentation_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [67 x i8] c"Got a segmentation fault while parsing program import table: %d .\0A\00"
define void @segmentation_handler(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}