xunge/DecIR huggingface dataset:
void I2STxFIFOLimitSet(unsigned long ulBase, unsigned long ulLevel) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000000C))) = ulLevel;
}


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

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

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

LLVM IR (-O2):
define void @I2STxFIFOLimitSet(i64 %0, i64 %1) {
%3 = add i64 %0, 12
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int get_random(void) {
  srand(time(NULL));
  int rand_n = rand() % 60;
  return rand_n;
}


x86 assembly (clang, -O0):
<get_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x3c,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0xffffffff88888889,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x3c,%ecx,%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_random() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @rand()
%5 = srem i32 %4, 60
store i32 %5, i32* %1
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @get_random() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 60
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int compare_Type(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int generic_compare_Type(void *ctx, const void *x, const void *y) {
  (void)ctx;
  return compare_Type((const int64_t *)x, (const int64_t *)y);
}


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

x86 assembly (clang, -O2):
<generic_compare_Type>:
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <compare_Type@plt>

LLVM IR (-O0):
define i32 @generic_compare_Type(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i32*
%10 = load i8*, i8** %6
%11 = bitcast i8* %10 to i32*
%12 = call i32 @compare_Type(i32* %9, i32* %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @generic_compare_Type(i8* nocapture readnone %0, i8* %1, i8* %2) {
%4 = bitcast i8* %1 to i32*
%5 = bitcast i8* %2 to i32*
%6 = tail call i32 @compare_Type(i32* %4, i32* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/);
void _start(void) { syscall(SYS_exit, 0); }


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_start>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_exit = global i32 0
define void @_start() {
%1 = load i32, i32* @SYS_exit
%2 = call i32 @syscall(i32 %1, i32 0)
ret void
}

LLVM IR (-O2):
@SYS_exit = global i32 0
define void @_start() {
%1 = load i32, i32* @SYS_exit
%2 = tail call i32 @syscall(i32 %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_usage() {
  printf("Usage:\n"
         "Read iim: mxc_iim_test read -d <addr>\n"
         "Write iim: mxc_iim_test fuse -d <addr> -v <value>\n"
         "Note: All value are in hex format!\n");
}


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

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

LLVM IR (-O0):
@.str = [131 x i8] c"Usage:\0ARead iim: mxc_iim_test read -d <addr>\0AWrite iim: mxc_iim_test fuse -d <addr> -v <value>\0ANote: All value are in hex format!\0A\00"
define void @print_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([131 x i8], [131 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [130 x i8] c"Usage:\0ARead iim: mxc_iim_test read -d <addr>\0AWrite iim: mxc_iim_test fuse -d <addr> -v <value>\0ANote: All value are in hex format!\00"
define void @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([130 x i8], [130 x i8]* @str, i64 0, i64 0))
ret void
}
int t1_init_ctxno_mag(int f) {
  int n;
  if (!(f & 0x2000))
    n = (f & ((0x0010 | 0x0001 | 0x0020 | 0x0002 | 0x0040 | 0x0004 | 0x0080 |
               0x0008)))
            ? 1
            : 0;
  else
    n = 2;
  return (((0 + 1) + 9) + n);
}


x86 assembly (clang, -O0):
<t1_init_ctxno_mag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
jne    1136 <t1_init_ctxno_mag+0x36>
mov    -0x4(%rbp),%edx
and    $0xff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    113d <t1_init_ctxno_mag+0x3d>
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xa,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1_init_ctxno_mag>:
cmp    $0x1,%dil
mov    $0xb,%ecx
sbb    $0x0,%ecx
test   $0x2000,%edi
mov    $0xc,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @t1_init_ctxno_mag(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 8192
%6 = icmp ne i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = and i32 %8, 255
%10 = icmp ne i32 %9, 0
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 1, i32 0
store i32 %12, i32* %3
br label %14
13: ; preds = %1
store i32 2, i32* %3
br label %14
14: ; preds = %13, %7
%15 = load i32, i32* %3
%16 = add nsw i32 10, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @t1_init_ctxno_mag(i32 %0) {
%2 = and i32 %0, 8192
%3 = icmp eq i32 %2, 0
%4 = and i32 %0, 255
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 10, i32 11
%7 = select i1 %3, i32 %6, i32 12
ret i32 %7
}
void canvas_undo_purge_abstraction_actions(struct _glist *x) {}


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

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

LLVM IR (-O0):
%struct._glist = type opaque
define void @canvas_undo_purge_abstraction_actions(%struct._glist* %0) {
%2 = alloca %struct._glist*
store %struct._glist* %0, %struct._glist** %2
ret void
}

LLVM IR (-O2):
%struct._glist = type opaque
define void @canvas_undo_purge_abstraction_actions(%struct._glist* nocapture %0) {
ret void
}
void scroll_down() {}


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

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

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

LLVM IR (-O2):
define void @scroll_down() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() {
  printf("usage: \n");
  printf("dumpmem <start position> <mem length>\n");
  printf("start position default is 0xfff00000\n");
  printf("length default is 0x100000 = 1Mi\n");
  printf("\n");
}


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

x86 assembly (clang, -O2):
<help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
lea    0xed4(%rip),%rdi
call   1040 <puts@plt>
lea    0xeee(%rip),%rdi
call   1040 <puts@plt>
lea    0xf07(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"usage: \0A\00"
@.str.1 = [39 x i8] c"dumpmem <start position> <mem length>\0A\00"
@.str.2 = [38 x i8] c"start position default is 0xfff00000\0A\00"
@.str.3 = [34 x i8] c"length default is 0x100000 = 1Mi\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [8 x i8] c"usage: \00"
@str.5 = [38 x i8] c"dumpmem <start position> <mem length>\00"
@str.6 = [37 x i8] c"start position default is 0xfff00000\00"
@str.7 = [33 x i8] c"length default is 0x100000 = 1Mi\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
int putc_serial1(int ch) {
  while (!((*(volatile unsigned long *)(0xE0010000 + 0x14)) & 0x20))
    ;
  return ((*(volatile unsigned long *)(0xE0010000 + 0x00)) = ch);
}


x86 assembly (clang, -O0):
<putc_serial1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xe0010014,%eax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1129 <putc_serial1+0x29>
jmp    112e <putc_serial1+0x2e>
jmp    1107 <putc_serial1+0x7>
movslq -0x4(%rbp),%rax
mov    $0xe0010000,%ecx
mov    %rax,(%rcx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc_serial1>:
mov    $0xe0010000,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
testq  $0x20,0x14(%rcx)
je     1110 <putc_serial1+0x10>
movslq %edi,%rax
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define i32 @putc_serial1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load volatile i64, i64* inttoptr (i64 3758161940 to i64*)
%5 = and i64 %4, 32
%6 = icmp ne i64 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %9
8: ; preds = %3
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
store volatile i64 %11, i64* inttoptr (i64 3758161920 to i64*)
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @putc_serial1(i32 returned %0) {
br label %2
2: ; preds = %2, %1
%3 = load volatile i64, i64* inttoptr (i64 3758161940 to i64*)
%4 = and i64 %3, 32
%5 = icmp eq i64 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = sext i32 %0 to i64
store volatile i64 %7, i64* inttoptr (i64 3758161920 to i64*)
ret i32 %0
}
void RTThreadAdopt(void) {}


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

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

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

LLVM IR (-O2):
define void @RTThreadAdopt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void load_param_3_reg_64(int reg) {
  if (reg & 8) {
    addbyte(0x4c);
    addbyte(0x89);
    addbyte(0xc0 | 2 | ((reg & 7) << 3));
  } else {
    addbyte(0x48);
    addbyte(0x89);
    addbyte(0xc0 | 2 | ((reg & 7) << 3));
  }
}


x86 assembly (clang, -O0):
<load_param_3_reg_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1157 <load_param_3_reg_64+0x47>
mov    $0x4c,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc2,%edi
call   1030 <addbyte@plt>
jmp    117f <load_param_3_reg_64+0x6f>
mov    $0x48,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
shl    $0x3,%edi
or     $0xc2,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_param_3_reg_64>:
push   %rbx
mov    %edi,%ebx
and    $0x8,%edi
shr    %edi
or     $0x48,%edi
call   1030 <addbyte@plt>
mov    $0x89,%edi
call   1030 <addbyte@plt>
shl    $0x3,%ebx
or     $0xc2,%ebx
movzbl %bl,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @load_param_3_reg_64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = call i32 @addbyte(i32 76)
%8 = call i32 @addbyte(i32 137)
%9 = load i32, i32* %2
%10 = and i32 %9, 7
%11 = shl i32 %10, 3
%12 = or i32 194, %11
%13 = call i32 @addbyte(i32 %12)
br label %22
14: ; preds = %1
%15 = call i32 @addbyte(i32 72)
%16 = call i32 @addbyte(i32 137)
%17 = load i32, i32* %2
%18 = and i32 %17, 7
%19 = shl i32 %18, 3
%20 = or i32 194, %19
%21 = call i32 @addbyte(i32 %20)
br label %22
22: ; preds = %14, %6
ret void
}

LLVM IR (-O2):
define void @load_param_3_reg_64(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 72, i32 76
%5 = tail call i32 @addbyte(i32 %4)
%6 = tail call i32 @addbyte(i32 137)
%7 = shl i32 %0, 3
%8 = and i32 %7, 56
%9 = or i32 %8, 194
%10 = tail call i32 @addbyte(i32 %9)
ret void
}
int test_imm_F3uint16_mem(unsigned short *val) {
  return ((*val) & (0xF3 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_F3uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 243
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int tracepoint_probe_register(char *, void *);
__attribute__((always_)) int register_trace_mm_page_pcpu_drain(
    void (*probe)(struct page *page, int order, int migratetype)) {
  return tracepoint_probe_register("mm_page_pcpu_drain", (void *)probe);
}


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

x86 assembly (clang, -O2):
<register_trace_mm_page_pcpu_drain>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <tracepoint_probe_register@plt>

LLVM IR (-O0):
%struct.page = type opaque
@.str = [19 x i8] c"mm_page_pcpu_drain\00"
define i32 @register_trace_mm_page_pcpu_drain(void (%struct.page*, i32, i32)* %0) {
%2 = alloca void (%struct.page*, i32, i32)*
store void (%struct.page*, i32, i32)* %0, void (%struct.page*, i32, i32)** %2
%3 = load void (%struct.page*, i32, i32)*, void (%struct.page*, i32, i32)** %2
%4 = bitcast void (%struct.page*, i32, i32)* %3 to i8*
%5 = call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.page = type opaque
@.str = [19 x i8] c"mm_page_pcpu_drain\00"
define i32 @register_trace_mm_page_pcpu_drain(void (%struct.page*, i32, i32)* %0) {
%2 = bitcast void (%struct.page*, i32, i32)* %0 to i8*
%3 = tail call i32 @tracepoint_probe_register(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 %3
}
/* Type definitions */
typedef int u_int;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int getpid();
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
u_int res_randomid() {
  struct timeval now;
  gettimeofday(&now, NULL);
  return (0xffff & (now.tv_sec ^ now.tv_usec ^ getpid()));
}


x86 assembly (clang, -O0):
<res_randomid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %ecx,%eax
and    $0xffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_randomid>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
movzwl 0x8(%rsp),%eax
movzwl 0xc(%rsp),%ebx
xor    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
movzwl %ax,%eax
xor    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @res_randomid() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = xor i32 %4, %6
%8 = call i32 (...) @getpid()
%9 = xor i32 %7, %8
%10 = and i32 65535, %9
ret i32 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @res_randomid() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = xor i32 %7, %5
%9 = tail call i32 (...) @getpid()
%10 = xor i32 %8, %9
%11 = and i32 %10, 65535
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ base;

/* Variables and functions */
int /*<<< orphan*/ barrier();
void putc(int c) {
  unsigned long base = (0x10000000 + 0x00009000);
  while ((*(volatile unsigned char *)((base) + 0x18)) & (1 << 5))
    barrier();
  (*(volatile unsigned char *)((base) + 0x00)) = c;
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x10009000,-0x10(%rbp)
10
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%al
movzbl %al,%eax
and    $0x20,%eax
cmp    $0x0,%eax
je     1145 <putc+0x35>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1123 <putc+0x13>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbx
mov    %edi,%ebx
testb  $0x20,0x10009018
20
je     1131 <putc+0x21>
nopl   (%rax)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x20,0x10009018
20
jne    1120 <putc+0x10>
mov    %bl,0x10009000
pop    %rbx
ret

LLVM IR (-O0):
define void @putc(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 268472320, i64* %3
br label %4
4: ; preds = %12, %1
%5 = load i64, i64* %3
%6 = add i64 %5, 24
%7 = inttoptr i64 %6 to i8*
%8 = load volatile i8, i8* %7
%9 = zext i8 %8 to i32
%10 = and i32 %9, 32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 (...) @barrier()
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
%16 = trunc i32 %15 to i8
%17 = load i64, i64* %3
%18 = add i64 %17, 0
%19 = inttoptr i64 %18 to i8*
store volatile i8 %16, i8* %19
ret void
}

LLVM IR (-O2):
define void @putc(i32 %0) {
%2 = load volatile i8, i8* inttoptr (i64 268472344 to i8*)
%3 = and i8 %2, 32
%4 = icmp eq i8 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %1, %5
%6 = tail call i32 (...) @barrier()
%7 = load volatile i8, i8* inttoptr (i64 268472344 to i8*)
%8 = and i8 %7, 32
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %1
%11 = trunc i32 %0 to i8
store volatile i8 %11, i8* inttoptr (i64 268472320 to i8*)
ret void
}
void websils_html_abi_0() {}


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

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

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

LLVM IR (-O2):
define void @websils_html_abi_0() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_assert(char *);
void CRYPTO_dbg_realloc(void *addr1, void *addr2, int num, const char *file,
                        int line, int before_p) {
  OPENSSL_assert("CRYPTO_dbg_realloc is no longer permitted");
}


x86 assembly (clang, -O0):
<CRYPTO_dbg_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <OPENSSL_assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [42 x i8] c"CRYPTO_dbg_realloc is no longer permitted\00"
define void @CRYPTO_dbg_realloc(i8* %0, i8* %1, i32 %2, i8* %3, i32 %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = call i32 @OPENSSL_assert(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"CRYPTO_dbg_realloc is no longer permitted\00"
define void @CRYPTO_dbg_realloc(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4, i32 %5) {
%7 = tail call i32 @OPENSSL_assert(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ *fptr;
int /*<<< orphan*/ stderr;
FILE *open_file(char *filename, char *descriptor) {
  FILE *fopen(), *fptr;
  if ((fptr = fopen(filename, descriptor)) == NULL) {
    fprintf(stderr, "Error in opening file:%s\n", filename);
    exit(1);
  }
  return fptr;
}


x86 assembly (clang, -O0):
<open_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    117e <open_file+0x4e>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fopen@plt>
test   %rax,%rax
je     1140 <open_file+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [26 x i8] c"Error in opening file:%s\0A\00"
@fptr = global i32* null
define i32* @open_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32* @fopen(i8* %6, i8* %7)
store i32* %8, i32** %5
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %3
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"Error in opening file:%s\0A\00"
@fptr = global i32* null
define noalias i32* @open_file(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ memcmp(char *, char *, int);
void memcmp4(char *input) {
  char a[] = {1, 2, 3, 4};
  clang_analyzer_eval(memcmp(a, input, 4) == 0);
}


x86 assembly (clang, -O0):
<memcmp4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcmp4>:
push   %rax
mov    %rdi,%rsi
movl   $0x4030201,0x4(%rsp)
04
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <clang_analyzer_eval@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.memcmp4.a = [4 x i8] c"\01\02\03\04"
define void @memcmp4(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i64 @memcmp(i8* %5, i8* %6, i32 4)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @clang_analyzer_eval(i32 %9)
ret void
}

LLVM IR (-O2):
define void @memcmp4(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 67305985, i32* %2
%4 = call i64 @memcmp(i8* %3, i8* %0, i32 4)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @clang_analyzer_eval(i32 %6)
ret void
}
void wifi_rsp_endpoint_set_streaming(
    const struct wifi_msg_endpoint_set_streaming_rsp_t *msg) {}


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

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

LLVM IR (-O0):
%struct.wifi_msg_endpoint_set_streaming_rsp_t = type opaque
define void @wifi_rsp_endpoint_set_streaming(%struct.wifi_msg_endpoint_set_streaming_rsp_t* %0) {
%2 = alloca %struct.wifi_msg_endpoint_set_streaming_rsp_t*
store %struct.wifi_msg_endpoint_set_streaming_rsp_t* %0, %struct.wifi_msg_endpoint_set_streaming_rsp_t** %2
ret void
}

LLVM IR (-O2):
%struct.wifi_msg_endpoint_set_streaming_rsp_t = type opaque
define void @wifi_rsp_endpoint_set_streaming(%struct.wifi_msg_endpoint_set_streaming_rsp_t* nocapture %0) {
ret void
}
int mdp_ppp_cfg_edge_cond(struct mdp_blit_req *req, struct ppp_regs *regs) {
  return 0;
}


x86 assembly (clang, -O0):
<mdp_ppp_cfg_edge_cond>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.mdp_blit_req = type opaque
%struct.ppp_regs = type opaque
define i32 @mdp_ppp_cfg_edge_cond(%struct.mdp_blit_req* %0, %struct.ppp_regs* %1) {
%3 = alloca %struct.mdp_blit_req*
%4 = alloca %struct.ppp_regs*
store %struct.mdp_blit_req* %0, %struct.mdp_blit_req** %3
store %struct.ppp_regs* %1, %struct.ppp_regs** %4
ret i32 0
}

LLVM IR (-O2):
%struct.mdp_blit_req = type opaque
%struct.ppp_regs = type opaque
define i32 @mdp_ppp_cfg_edge_cond(%struct.mdp_blit_req* nocapture readnone %0, %struct.ppp_regs* nocapture readnone %1) {
ret i32 0
}
void ff_hevc_put_hevc_epel_h24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_h24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ search(int *, int, int);
int main(void) {
  int a[4] = {33, 28, 49, 28};
  if (search(a, 4, 28))
    printf("Found\n");
  else
    printf("Not found\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1c,%edx
call   1040 <search@plt>
cmp    $0x0,%rax
je     1173 <main+0x53>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x5f>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
mov    $0x1c,%edx
call   1040 <search@plt>
test   %rax,%rax
lea    0xec5(%rip),%rax
lea    0xec8(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [4 x i32] [i32 33, i32 28, i32 49, i32 28]
@.str = [7 x i8] c"Found\0A\00"
@.str.1 = [11 x i8] c"Not found\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i64 @search(i32* %4, i32 4, i32 28)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %11
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 33, i32 28, i32 49, i32 28]
@str = [10 x i8] c"Not found\00"
@str.2 = [6 x i8] c"Found\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i64 @search(i32* %3, i32 4, i32 28)
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.2, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *dupstr(char *s) {
  char *r;
  r = malloc(strlen(s) + 1);
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<dupstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @dupstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @dupstr(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
int test_imm_B8uint16_mem(unsigned short *val) {
  return ((*val) & (0xB8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_B8uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 184
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int f3(int i) {
  printf("%d\n", i == 0);
  return i;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %edi,%ebx
xor    %esi,%esi
test   %edi,%edi
sete   %sil
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @f3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @f3(i32 returned %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ ab_aux(double, double *, double *, double,
                          int /*<<< orphan*/);
void ab_ecl(double mj, double lsn, double *lam, double *bet) {
  ab_aux(mj, lam, bet, lsn, 0);
}


x86 assembly (clang, -O0):
<ab_ecl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movsd  -0x10(%rbp),%xmm1
xor    %edx,%edx
call   1030 <ab_aux@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ab_ecl>:
xor    %edx,%edx
jmp    1030 <ab_aux@plt>

LLVM IR (-O0):
define void @ab_ecl(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = load double*, double** %7
%11 = load double*, double** %8
%12 = load double, double* %6
%13 = call i32 @ab_aux(double %9, double* %10, double* %11, double %12, i32 0)
ret void
}

LLVM IR (-O2):
define void @ab_ecl(double %0, double %1, double* %2, double* %3) {
%5 = tail call i32 @ab_aux(double %0, double* %2, double* %3, double %1, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int to_hex(unsigned int a) {
  static char hex[] = "0123456789abcdef";
  if (a > 15)
    abort();
  return hex[a];
}


x86 assembly (clang, -O0):
<to_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xf,-0x4(%rbp)
jbe    112c <to_hex+0x1c>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0x2ef8(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex>:
push   %rax
cmp    $0x10,%edi
jae    1125 <to_hex+0x15>
mov    %edi,%eax
lea    0xee1(%rip),%rcx
movsbl (%rax,%rcx,1),%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@to_hex.hex = internal global [17 x i8] c"0123456789abcdef\00"
define i32 @to_hex(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ugt i32 %3, 15
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 (...) @abort()
unreachable
7: ; preds = %1
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@to_hex.hex = internal unnamed_addr constant [17 x i8] c"0123456789abcdef\00"
define i32 @to_hex(i32 %0) {
%2 = icmp ugt i32 %0, 15
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %1
%6 = zext i32 %0 to i64
%7 = getelementptr inbounds [17 x i8], [17 x i8]* @to_hex.hex, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ _strlen(char const *);
int /*<<< orphan*/ sys_write(int, char const *, int /*<<< orphan*/);
void print(const char *string) { sys_write(1, string, _strlen(string)); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <sys_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbx
mov    %rdi,%rbx
call   1030 <_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <sys_write@plt>

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

LLVM IR (-O2):
define void @print(i8* %0) {
%2 = tail call i32 @_strlen(i8* %0)
%3 = tail call i32 @sys_write(i32 1, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putsln(char *);
int /*<<< orphan*/ screen_clear();
int /*<<< orphan*/ serial_write(char *, int);
void kernel_main() {
  screen_clear();
  serial_write("hewwo", 5);
  putsln("sn4 is here to chew ass and kick bubblegum");
  putsln("pls type something:");
  putsln("\nthis is what you wrote:\n");
}


x86 assembly (clang, -O0):
<kernel_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <screen_clear@plt>
lea    0xebe(%rip),%rdi
mov    $0x5,%esi
call   1050 <serial_write@plt>
lea    0xeb3(%rip),%rdi
call   1040 <putsln@plt>
lea    0xed2(%rip),%rdi
call   1040 <putsln@plt>
lea    0xeda(%rip),%rdi
call   1040 <putsln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_main>:
push   %rax
xor    %eax,%eax
call   1030 <screen_clear@plt>
lea    0xec1(%rip),%rdi
mov    $0x5,%esi
call   1050 <serial_write@plt>
lea    0xeb6(%rip),%rdi
call   1040 <putsln@plt>
lea    0xed5(%rip),%rdi
call   1040 <putsln@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1040 <putsln@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hewwo\00"
@.str.1 = [43 x i8] c"sn4 is here to chew ass and kick bubblegum\00"
@.str.2 = [20 x i8] c"pls type something:\00"
@.str.3 = [26 x i8] c"\0Athis is what you wrote:\0A\00"
define void @kernel_main() {
%1 = call i32 (...) @screen_clear()
%2 = call i32 @serial_write(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = call i32 @putsln(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @putsln(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @putsln(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hewwo\00"
@.str.1 = [43 x i8] c"sn4 is here to chew ass and kick bubblegum\00"
@.str.2 = [20 x i8] c"pls type something:\00"
@.str.3 = [26 x i8] c"\0Athis is what you wrote:\0A\00"
define void @kernel_main() {
%1 = tail call i32 (...) @screen_clear()
%2 = tail call i32 @serial_write(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @putsln(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @putsln(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @putsln(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret void
}
int _ext(int src2, unsigned int csta, unsigned int cstb) {
  return (src2 << csta) >> cstb;
}


x86 assembly (clang, -O0):
<_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ext>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    %edx,%ecx
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @_ext(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = shl i32 %7, %8
%10 = load i32, i32* %6
%11 = ashr i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @_ext(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, %1
%5 = ashr i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ xx(char *, char *, int, int, int, int /*<<< orphan*/);
void x3(char *pattern, char *str, int from, int to, int mem) {
  xx(pattern, str, from, to, mem, 0);
}


x86 assembly (clang, -O0):
<x3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
xor    %r9d,%r9d
call   1030 <xx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x3>:
xor    %r9d,%r9d
jmp    1030 <xx@plt>

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

LLVM IR (-O2):
define void @x3(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @xx(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ NJ_FLT_EQ(float, float);
int NJ_FLT_GT(float x, float y) {
  if (NJ_FLT_EQ(x, y)) {
    return (0);
  } else {
    if (x > y) {
      return (1);
    } else {
      return (0);
    }
  }
}


x86 assembly (clang, -O0):
<NJ_FLT_GT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
call   1030 <NJ_FLT_EQ@plt>
cmp    $0x0,%rax
je     1147 <NJ_FLT_GT+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1169 <NJ_FLT_GT+0x59>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1162 <NJ_FLT_GT+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1169 <NJ_FLT_GT+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NJ_FLT_GT>:
push   %rax
movss  %xmm1,(%rsp)
movss  %xmm0,0x4(%rsp)
call   1030 <NJ_FLT_EQ@plt>
test   %rax,%rax
sete   %al
movss  0x4(%rsp),%xmm0
ucomiss (%rsp),%xmm0
seta   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @NJ_FLT_GT(float %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %5
%8 = call i64 @NJ_FLT_EQ(float %6, float %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %17
11: ; preds = %2
%12 = load float, float* %4
%13 = load float, float* %5
%14 = fcmp ogt float %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %3
br label %17
16: ; preds = %11
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @NJ_FLT_GT(float %0, float %1) {
%3 = tail call i64 @NJ_FLT_EQ(float %0, float %1)
%4 = icmp eq i64 %3, 0
%5 = fcmp ogt float %0, %1
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned char localBufferOverflow(void) {
  unsigned char val[16];
  int i;
  for (i = 0; i < 40; i++) {
    val[i] = 'a';
  }
  return val[0];
}


x86 assembly (clang, -O0):
<localBufferOverflow>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x14(%rbp)
cmpl   $0x28,-0x14(%rbp)
jge    112c <localBufferOverflow+0x2c>
movslq -0x14(%rbp),%rax
movb   $0x61,-0x10(%rbp,%rax,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110b <localBufferOverflow+0xb>
movzbl -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<localBufferOverflow>:
mov    $0x61,%al
ret

LLVM IR (-O0):
define zeroext i8 @localBufferOverflow() {
%1 = alloca [16 x i8]
%2 = alloca i32
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 40
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 %8
store i8 97, i8* %9
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%15 = load i8, i8* %14
ret i8 %15
}

LLVM IR (-O2):
define zeroext i8 @localBufferOverflow() {
ret i8 97
}
unsigned long sub1(unsigned long i) { return (i >> 32) << 32; }


x86 assembly (clang, -O0):
<sub1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
shl    $0x20,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub1>:
movabs $0xffffffff00000000,%rax
ff ff ff
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @sub1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = shl i64 %4, 32
ret i64 %5
}

LLVM IR (-O2):
define i64 @sub1(i64 %0) {
%2 = and i64 %0, -4294967296
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fma4() {
  printf("FMA4 is not supported.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"FMA4 is not supported.\00"
define i32 @fma4() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"FMA4 is not supported.\00"
define i32 @fma4() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i32 0
}