xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
help() {
  fprintf(stderr, "SCBIND "
                  "1.1"
                  " -- shell script binder by Al Williams\n");
  fprintf(stderr, "Usage: scbind INFILE OUTFILE NAME SHELL [ARG]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [50 x i8] c"SCBIND 1.1 -- shell script binder by Al Williams\0A\00"
@.str.1 = [47 x i8] c"Usage: scbind INFILE OUTFILE NAME SHELL [ARG]\0A\00"
define i32 @help() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [50 x i8] c"SCBIND 1.1 -- shell script binder by Al Williams\0A\00"
@.str.1 = [47 x i8] c"Usage: scbind INFILE OUTFILE NAME SHELL [ARG]\0A\00"
define i32 @help() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
int reg(int a) { return a; }


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

x86 assembly (clang, -O2):
<reg>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @reg(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ tty_reset();
void tty__atexit(void) { tty_reset(); }


x86 assembly (clang, -O0):
<tty__atexit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <tty_reset@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @tty__atexit() {
%1 = call i32 (...) @tty_reset()
ret void
}

LLVM IR (-O2):
define void @tty__atexit() {
%1 = tail call i32 (...) @tty_reset()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
void setfpg(pid_t pgid) { int ret = 0; }


x86 assembly (clang, -O0):
<setfpg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @setfpg(i32 %0) {
ret void
}
int GetReservedAES256Cipher(void *cipher) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @GetReservedAES256Cipher(i8* nocapture readnone %0) {
ret i32 0
}
void helper(char *inp) {}


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

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

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

LLVM IR (-O2):
define void @helper(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct file {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BUG();
long kgsl_compat_ioctl(struct file *filep, unsigned int cmd,
                       unsigned long arg) {
  BUG();
}


x86 assembly (clang, -O0):
<kgsl_compat_ioctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <BUG@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.file = type { i32 }
define i64 @kgsl_compat_ioctl(%struct.file* %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = alloca %struct.file*
%6 = alloca i32
%7 = alloca i64
store %struct.file* %0, %struct.file** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
%8 = call i32 (...) @BUG()
%9 = load i64, i64* %4
ret i64 %9
}

LLVM IR (-O2):
%struct.file = type { i32 }
define i64 @kgsl_compat_ioctl(%struct.file* nocapture readnone %0, i32 %1, i64 %2) {
%4 = tail call i32 (...) @BUG()
ret i64 undef
}
/* Variables and functions */
char read_buffer(int /*<<< orphan*/);
int match(const char *str, size_t offset) {
  register char tmp;
  while ((tmp = *(str++)))
    if (read_buffer(offset++) != tmp)
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x19(%rbp)
cmp    $0x0,%al
je     1172 <match+0x62>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    %eax,%edi
call   1030 <read_buffer@plt>
movsbl %al,%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
je     116d <match+0x5d>
movl   $0x0,-0x4(%rbp)
jmp    1179 <match+0x69>
jmp    1120 <match+0x10>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%ebp
test   %bpl,%bpl
je     1141 <match+0x31>
add    $0x1,%rbx
mov    %r14d,%edi
call   1030 <read_buffer@plt>
add    $0x1,%r14d
cmp    %bpl,%al
je     1120 <match+0x10>
xor    %eax,%eax
jmp    1146 <match+0x36>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i64 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i64 [ %1, %2 ], [ %10, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = add i64 %5, 1
%11 = trunc i64 %5 to i32
%12 = tail call signext i8 @read_buffer(i32 %11)
%13 = icmp eq i8 %12, %6
br i1 %13, label %3, label %14
14: ; preds = %3, %8
%15 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %15
}
void set_netdump_dest(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<set_netdump_dest>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_netdump_dest>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.set_netdump_dest = [17 x i8] c"set_netdump_dest\00"
define void @set_netdump_dest() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.set_netdump_dest, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.set_netdump_dest = [17 x i8] c"set_netdump_dest\00"
define void @set_netdump_dest() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.set_netdump_dest, i64 0, i64 0))
ret void
}
/* Type definitions */
struct symtab {
  int dummy;
};

/* Variables and functions */
int symtab_get_t(struct symtab *, char const *, int, int *);
int symtab_get_td(struct symtab *tab, const char *name, int type) {
  int res;
  if (symtab_get_t(tab, name, type, &res) == -1)
    return -1;
  return res;
}


x86 assembly (clang, -O0):
<symtab_get_td>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    -0x20(%rbp),%rcx
call   1030 <symtab_get_t@plt>
cmp    $0xffffffff,%eax
jne    114c <symtab_get_td+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <symtab_get_td+0x42>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symtab_get_td>:
push   %rax
lea    0x4(%rsp),%rcx
call   1030 <symtab_get_t@plt>
cmp    $0xffffffff,%eax
je     1124 <symtab_get_td+0x14>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.symtab = type { i32 }
define i32 @symtab_get_td(%struct.symtab* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @symtab_get_t(%struct.symtab* %0, i8* %1, i32 %2, i32* %4)
%7 = icmp eq i32 %6, -1
%8 = load i32, i32* %4
%9 = select i1 %7, i32 -1, i32 %8
ret i32 %9
}
int sort_teacher(char *database, int (*compare)(const void *x, const void *y)) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sort_teacher(i8* %0, i32 (i8*, i8*)* %1) {
%3 = alloca i8*
%4 = alloca i32 (i8*, i8*)*
store i8* %0, i8** %3
store i32 (i8*, i8*)* %1, i32 (i8*, i8*)** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @sort_teacher(i8* nocapture readnone %0, i32 (i8*, i8*)* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
size_t strlen(char *);
char *get_filename_without_base(char *component_base, char *filename) {
  return &filename[strlen(component_base)];
}


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

x86 assembly (clang, -O2):
<get_filename_without_base>:
push   %rbx
mov    %rsi,%rbx
call   1030 <strlen@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @get_filename_without_base(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @get_filename_without_base(i8* nocapture %0, i8* readnone %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = getelementptr inbounds i8, i8* %1, i64 %3
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_get_write_index() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_get_write_index"
         "\n");
}


x86 assembly (clang, -O0):
<pa_memblockq_get_write_index>:
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_memblockq_get_write_index>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_memblockq_get_write_index\00"
define i32 @pa_memblockq_get_write_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void gtk_clipboard_request_targets() {}


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

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

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

LLVM IR (-O2):
define void @gtk_clipboard_request_targets() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ putstring(char *);
int puts(char *s) {
  putstring(s);
  putchar('\r');
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <putstring@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1040 <putstring@plt>
mov    $0xd,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @putstring(i8* %3)
%5 = call i32 @putchar(i8 signext 13)
%6 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @puts(i8* %0) {
%2 = tail call i32 @putstring(i8* %0)
%3 = tail call i32 @putchar(i8 signext 13)
%4 = tail call i32 @putchar(i8 signext 10)
ret i32 0
}
/* Variables and functions */
int VSprintfPatch(int /*<<< orphan*/, char const *, int const *);
int DiagPrintfPatch(const char *fmt, ...) {
  return VSprintfPatch(0, fmt, ((const int *)&fmt) + 1);
}


x86 assembly (clang, -O0):
<DiagPrintfPatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0x4(%rbp),%rdx
xor    %edi,%edi
call   1030 <VSprintfPatch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DiagPrintfPatch>:
push   %rax
mov    %rdi,%rsi
mov    %rdi,(%rsp)
lea    0x4(%rsp),%rdx
xor    %edi,%edi
call   1030 <VSprintfPatch@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @DiagPrintfPatch(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8** %2 to i32*
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = call i32 @VSprintfPatch(i32 0, i8* %3, i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @DiagPrintfPatch(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = bitcast i8** %2 to i32*
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = call i32 @VSprintfPatch(i32 0, i8* %0, i32* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void drwav_free(void *pDataReturnedByOpenAndRead) {
  free((pDataReturnedByOpenAndRead));
}


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

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

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

LLVM IR (-O2):
define void @drwav_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int intlit_comp(const void *a, const void *b) {
  if (*(int *)a > *(int *)b)
    return 1;
  if (*(int *)a == *(int *)b)
    return 0;
  if (*(int *)a < *(int *)b)
    return -1;
}


x86 assembly (clang, -O0):
<intlit_comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jle    112a <intlit_comp+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <intlit_comp+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    1148 <intlit_comp+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1161 <intlit_comp+0x61>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1161 <intlit_comp+0x61>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlit_comp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setne  %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @intlit_comp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %5
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = icmp sgt i32 %8, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %32
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = load i8*, i8** %5
%19 = bitcast i8* %18 to i32*
%20 = load i32, i32* %19
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %3
br label %32
23: ; preds = %14
%24 = load i8*, i8** %4
%25 = bitcast i8* %24 to i32*
%26 = load i32, i32* %25
%27 = load i8*, i8** %5
%28 = bitcast i8* %27 to i32*
%29 = load i32, i32* %28
%30 = icmp slt i32 %26, %29
br i1 %30, label %31, label %32
31: ; preds = %23
store i32 -1, i32* %3
br label %32
32: ; preds = %13, %22, %31, %23
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @intlit_comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
void I_InitCD(void) {}


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

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

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

LLVM IR (-O2):
define void @I_InitCD() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse(int *, int, int);
void right_shift(int *p, int length, int m) {
  m = m % length;
  reverse(p, 0, length - m - 1);
  reverse(p, length - m, length - 1);
  reverse(p, 0, length - 1);
}


x86 assembly (clang, -O0):
<right_shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    -0x10(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<right_shift>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%eax
mov    %esi,%ebx
mov    %rdi,%r14
cltd
idiv   %esi
mov    %esi,%ebp
sub    %edx,%ebp
neg    %edx
add    %ebx,%edx
add    $0xffffffff,%edx
xor    %esi,%esi
call   1030 <reverse@plt>
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <reverse@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <reverse@plt>

LLVM IR (-O0):
define void @right_shift(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* %6
%8 = load i32, i32* %5
%9 = srem i32 %7, %8
store i32 %9, i32* %6
%10 = load i32*, i32** %4
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = sub nsw i32 %11, %12
%14 = sub nsw i32 %13, 1
%15 = call i32 @reverse(i32* %10, i32 0, i32 %14)
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = sub nsw i32 %17, %18
%20 = load i32, i32* %5
%21 = sub nsw i32 %20, 1
%22 = call i32 @reverse(i32* %16, i32 %19, i32 %21)
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 1
%26 = call i32 @reverse(i32* %23, i32 0, i32 %25)
ret void
}

LLVM IR (-O2):
define void @right_shift(i32* %0, i32 %1, i32 %2) {
%4 = srem i32 %2, %1
%5 = sub nsw i32 %1, %4
%6 = add nsw i32 %5, -1
%7 = tail call i32 @reverse(i32* %0, i32 0, i32 %6)
%8 = add nsw i32 %1, -1
%9 = tail call i32 @reverse(i32* %0, i32 %5, i32 %8)
%10 = tail call i32 @reverse(i32* %0, i32 0, i32 %8)
ret void
}
/* Variables and functions */
int MAP_ANONYMOUS;
int MAP_SHARED;
int /*<<< orphan*/ PROT_NONE;
void *mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int, int,
           int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, void *);
void memleak_mmap() {
  void *p_mmap = mmap(NULL, 1, PROT_NONE, MAP_ANONYMOUS | MAP_SHARED, -1, 0);
  printf("%p", p_mmap);
}


x86 assembly (clang, -O0):
<memleak_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%edx
mov    0x2ea0(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea7(%rip),%rax
or     (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%esi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memleak_mmap>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edx
mov    0x2ea7(%rip),%rax
mov    0x2eb0(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
xor    %edi,%edi
mov    $0x1,%esi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
lea    0xea8(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@PROT_NONE = global i32 0
@MAP_ANONYMOUS = global i32 0
@MAP_SHARED = global i32 0
@.str = [3 x i8] c"%p\00"
define void @memleak_mmap() {
%1 = alloca i8*
%2 = load i32, i32* @PROT_NONE
%3 = load i32, i32* @MAP_ANONYMOUS
%4 = load i32, i32* @MAP_SHARED
%5 = or i32 %3, %4
%6 = call i8* @mmap(i32* null, i32 1, i32 %2, i32 %5, i32 -1, i32 0)
store i8* %6, i8** %1
%7 = load i8*, i8** %1
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@PROT_NONE = global i32 0
@MAP_ANONYMOUS = global i32 0
@MAP_SHARED = global i32 0
@.str = [3 x i8] c"%p\00"
define void @memleak_mmap() {
%1 = load i32, i32* @PROT_NONE
%2 = load i32, i32* @MAP_ANONYMOUS
%3 = load i32, i32* @MAP_SHARED
%4 = or i32 %3, %2
%5 = tail call i8* @mmap(i32* null, i32 1, i32 %1, i32 %4, i32 -1, i32 0)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
void __attribute__((noreturn)) abort(void) {
  (*((volatile unsigned char *)(0x29 + 0x20))) = 1;
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x49,%eax
movb   $0x1,(%rax)
jmp    110c <abort+0xc>

x86 assembly (clang, -O2):
<abort>:
movb   $0x1,0x49
01
nopl   0x0(%rax,%rax,1)
jmp    1110 <abort+0x10>

LLVM IR (-O0):
define void @abort() {
store volatile i8 1, i8* inttoptr (i64 73 to i8*)
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @abort() {
store volatile i8 1, i8* inttoptr (i64 73 to i8*)
br label %1
1: ; preds = %1, %0
br label %1
}
void FF_ReleaseSemaphore(void *pSemaphore) {}


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

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

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

LLVM IR (-O2):
define void @FF_ReleaseSemaphore(i8* nocapture %0) {
ret void
}
char *strchr(register const char *buf, int ch) {
  register char c = ch;
  while (*buf != ch && *buf)
    buf++;
  if (*buf)
    return (char *)buf;
  return ((void *)0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %al,-0x15(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    -0x14(%rbp),%ecx
mov    %al,-0x16(%rbp)
je     1136 <strchr+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
test   $0x1,%al
jne    1146 <strchr+0x46>
jmp    1157 <strchr+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1111 <strchr+0x11>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1171 <strchr+0x71>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1179 <strchr+0x79>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <strchr+0x20>
cmp    %esi,%ecx
jne    1110 <strchr+0x10>
xor    %edx,%edx
test   %cl,%cl
cmove  %rdx,%rax
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = trunc i32 %7 to i8
store i8 %8, i8* %6
br label %9
9: ; preds = %22, %2
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = load i32, i32* %5
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br label %20
20: ; preds = %15, %9
%21 = phi i1 [ false, %9 ], [ %19, %15 ]
br i1 %21, label %22, label %25
22: ; preds = %20
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %4
br label %9
25: ; preds = %20
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = load i8*, i8** %4
store i8* %30, i8** %3
br label %32
31: ; preds = %25
store i8* null, i8** %3
br label %32
32: ; preds = %31, %29
%33 = load i8*, i8** %3
ret i8* %33
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, %1
%8 = icmp eq i8 %5, 0
%9 = or i1 %8, %7
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = select i1 %8, i8* null, i8* %4
ret i8* %12
}
/* Type definitions */
typedef int type;
typedef int depth;

/* Variables and functions */
int cvCvToIplDepth(int type) {
  int depth = ((type) & ((1 << 3) - 1));
  return (((((depth) & ((4 - 1) << 3)) >> 3) + 1)
          << ((((sizeof(size_t) / 4 + 1) * 16384 | 0x3a50) >>
               ((depth) & ((1 << 3) - 1)) * 2) &
              3)) *
             8 |
         (depth == 1 || depth == 3 || depth == 4 ? 0x80000000 : 0);
}


x86 assembly (clang, -O0):
<cvCvToIplDepth>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x18,%eax
sar    $0x3,%eax
add    $0x1,%eax
mov    -0x8(%rbp),%ecx
and    $0x7,%ecx
shl    $0x1,%ecx
mov    %ecx,%ecx
mov    $0xfa50,%edx
shr    %cl,%rdx
mov    %rdx,%rcx
and    $0x3,%rcx
shl    %cl,%eax
shl    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1166 <cvCvToIplDepth+0x66>
mov    $0x1,%al
cmpl   $0x3,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1166 <cvCvToIplDepth+0x66>
cmpl   $0x4,-0x8(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x9(%rbp),%sil
xor    %ecx,%ecx
mov    $0x80000000,%edx
test   $0x1,%sil
cmovne %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvCvToIplDepth>:
mov    %edi,%ecx
and    $0x7,%ecx
and    $0x5,%edi
cmp    $0x1,%edi
sete   %dl
cmp    $0x4,%ecx
sete   %al
or     %dl,%al
add    %ecx,%ecx
mov    $0xfa50,%edx
shr    %cl,%edx
movzbl %al,%esi
shl    $0x1f,%esi
and    $0x3,%dl
mov    $0x8,%eax
mov    %edx,%ecx
shl    %cl,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @cvCvToIplDepth(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 7
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, 24
%8 = ashr i32 %7, 3
%9 = add nsw i32 %8, 1
%10 = load i32, i32* %3
%11 = and i32 %10, 7
%12 = mul nsw i32 %11, 2
%13 = zext i32 %12 to i64
%14 = lshr i64 64080, %13
%15 = and i64 %14, 3
%16 = trunc i64 %15 to i32
%17 = shl i32 %9, %16
%18 = mul nsw i32 %17, 8
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 1
br i1 %20, label %27, label %21
21: ; preds = %1
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 3
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 4
br label %27
27: ; preds = %24, %21, %1
%28 = phi i1 [ true, %21 ], [ true, %1 ], [ %26, %24 ]
%29 = zext i1 %28 to i64
%30 = select i1 %28, i32 -2147483648, i32 0
%31 = or i32 %18, %30
ret i32 %31
}

LLVM IR (-O2):
define i32 @cvCvToIplDepth(i32 %0) {
%2 = and i32 %0, 7
%3 = and i32 %0, 5
%4 = icmp eq i32 %3, 1
%5 = icmp eq i32 %2, 4
%6 = or i1 %4, %5
%7 = select i1 %6, i32 -2147483648, i32 0
%8 = shl nuw nsw i32 %2, 1
%9 = lshr i32 64080, %8
%10 = and i32 %9, 3
%11 = shl nuw nsw i32 8, %10
%12 = or i32 %11, %7
ret i32 %12
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void SHAMD5DMADisable(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000110))) &=
      ~(0x00000080 | 0x00000008);
}


x86 assembly (clang, -O0):
<SHAMD5DMADisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%eax
cltq
mov    (%rax),%ecx
and    $0xffffff77,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SHAMD5DMADisable>:
movslq %edi,%rax
andl   $0xffffff77,0x110(%rax)
ff ff ff
ret

LLVM IR (-O0):
define void @SHAMD5DMADisable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 272
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -137
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @SHAMD5DMADisable(i32 %0) {
%2 = add nsw i32 %0, 272
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -137
store volatile i32 %6, i32* %4
ret void
}
int int_array_compare(const int *a, const int *b) {
  if (*a == *b) {
    return 0;
  } else {
    if (*a < *b) {
      return -1;
    } else {
      return 1;
    }
  }
}


x86 assembly (clang, -O0):
<int_array_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jne    112a <int_array_compare+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    114f <int_array_compare+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
jge    1148 <int_array_compare+0x48>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <int_array_compare+0x4f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_array_compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @int_array_compare(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** %4
%7 = load i32, i32* %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %20
12: ; preds = %2
%13 = load i32*, i32** %4
%14 = load i32, i32* %13
%15 = load i32*, i32** %5
%16 = load i32, i32* %15
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 -1, i32* %3
br label %20
19: ; preds = %12
store i32 1, i32* %3
br label %20
20: ; preds = %19, %18, %11
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @int_array_compare(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %3, %4
%6 = icmp slt i32 %3, %4
%7 = select i1 %6, i32 -1, i32 1
%8 = select i1 %5, i32 0, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xaf() {
  Assert_real((isupper(175) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              880, ("isupper should be 0 for 0xaf"));
}


x86 assembly (clang, -O0):
<t_isupper_0xaf>:
push   %rbp
mov    %rsp,%rbp
mov    $0xaf,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x370,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0xaf>:
push   %rax
mov    $0xaf,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x370,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xaf\00"
define void @t_isupper_0xaf() {
%1 = call i64 @isupper(i32 175)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 880, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xaf\00"
define void @t_isupper_0xaf() {
%1 = tail call i64 @isupper(i32 175)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 880, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void ft_print(char a, char b, char c) {
  ft_putchar(a);
  ft_putchar(b);
  ft_putchar(c);
  if (a != '7') {
    ft_putchar(',');
    ft_putchar(' ');
  }
}


x86 assembly (clang, -O0):
<ft_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <ft_putchar@plt>
movsbl -0x2(%rbp),%edi
call   1030 <ft_putchar@plt>
movsbl -0x3(%rbp),%edi
call   1030 <ft_putchar@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
je     1165 <ft_print+0x55>
mov    $0x2c,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <ft_putchar@plt>
mov    %ebp,%edi
call   1030 <ft_putchar@plt>
mov    %r14d,%edi
call   1030 <ft_putchar@plt>
cmp    $0x37,%bl
jne    1139 <ft_print+0x29>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x2c,%edi
call   1030 <ft_putchar@plt>
mov    $0x20,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <ft_putchar@plt>

LLVM IR (-O0):
define void @ft_print(i8 signext %0, i8 signext %1, i8 signext %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 = call i32 @ft_putchar(i8 signext %7)
%9 = load i8, i8* %5
%10 = call i32 @ft_putchar(i8 signext %9)
%11 = load i8, i8* %6
%12 = call i32 @ft_putchar(i8 signext %11)
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 55
br i1 %15, label %16, label %19
16: ; preds = %3
%17 = call i32 @ft_putchar(i8 signext 44)
%18 = call i32 @ft_putchar(i8 signext 32)
br label %19
19: ; preds = %16, %3
ret void
}

LLVM IR (-O2):
define void @ft_print(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = tail call i32 @ft_putchar(i8 signext %0)
%5 = tail call i32 @ft_putchar(i8 signext %1)
%6 = tail call i32 @ft_putchar(i8 signext %2)
%7 = icmp eq i8 %0, 55
br i1 %7, label %11, label %8
8: ; preds = %3
%9 = tail call i32 @ft_putchar(i8 signext 44)
%10 = tail call i32 @ft_putchar(i8 signext 32)
br label %11
11: ; preds = %8, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mem_warn(char *, int, int);
int willus_mem_realloc(double **, int, char *);
int willus_mem_realloc_warn(void **ptr, int newsize, char *name, int exitcode) {
  int status;
  status = willus_mem_realloc((double **)ptr, newsize, name);
  if (!status)
    mem_warn(name, newsize, exitcode);
  return (status);
}


x86 assembly (clang, -O0):
<willus_mem_realloc_warn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <willus_mem_realloc@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1162 <willus_mem_realloc_warn+0x42>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1030 <mem_warn@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<willus_mem_realloc_warn>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %esi,%ebp
call   1040 <willus_mem_realloc@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1147 <willus_mem_realloc_warn+0x27>
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <mem_warn@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @willus_mem_realloc_warn(i8** %0, i32 %1, i8* %2, i32 %3) {
%5 = bitcast i8** %0 to double**
%6 = tail call i32 @willus_mem_realloc(double** %5, i32 %1, i8* %2)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @mem_warn(i8* %2, i32 %1, i32 %3)
br label %10
10: ; preds = %8, %4
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ make_licensed_prog();
int real_epoll_create1(int);
int evil_epoll_create1(int flags) {
  int ret = 0;
  make_licensed_prog();
  ret = real_epoll_create1(flags);
  return ret;
}


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

x86 assembly (clang, -O2):
<evil_epoll_create1>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <make_licensed_prog@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <real_epoll_create1@plt>

LLVM IR (-O0):
define i32 @evil_epoll_create1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = call i32 (...) @make_licensed_prog()
%5 = load i32, i32* %2
%6 = call i32 @real_epoll_create1(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @evil_epoll_create1(i32 %0) {
%2 = tail call i32 (...) @make_licensed_prog()
%3 = tail call i32 @real_epoll_create1(i32 %0)
ret i32 %3
}
/* Variables and functions */
unsigned int gcd(unsigned int, unsigned int);
unsigned int lcm(unsigned int x, unsigned int y) { return x * y / gcd(x, y); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %edx,%edx
div    %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @lcm(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 i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @gcd(i32 %8, i32 %9)
%11 = udiv i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = udiv i32 %3, %4
ret i32 %5
}
/* Type definitions */
typedef int __u32;

/* Variables and functions */
unsigned int tipc_node(__u32 addr) { return addr & 0xfff; }


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

x86 assembly (clang, -O2):
<tipc_node>:
mov    %edi,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i32 @tipc_node(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4095
ret i32 %4
}

LLVM IR (-O2):
define i32 @tipc_node(i32 %0) {
%2 = and i32 %0, 4095
ret i32 %2
}
/* Variables and functions */
char *malloc(size_t);
int strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *allocKey(const char *key) {
  size_t keySize = strlen(key) + 1;
  char *ret = malloc(keySize);
  strncpy(ret, key, keySize);
  return ret;
}


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

x86 assembly (clang, -O2):
<allocKey>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @allocKey(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @strncpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @allocKey(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int bcode_iter_can_has(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @bcode_iter_can_has() {
ret i32 1
}

LLVM IR (-O2):
define i32 @bcode_iter_can_has() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void RogueVMTraceCmd(void *allocation) { printf("TODO: RogueVMTraceCmd()\n"); }


x86 assembly (clang, -O0):
<RogueVMTraceCmd>:
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):
<RogueVMTraceCmd>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [24 x i8] c"TODO: RogueVMTraceCmd()\00"
define void @RogueVMTraceCmd(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
void fsemu_recording_on_load_state_finished(int slot, const char *path) {}


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

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

LLVM IR (-O0):
define void @fsemu_recording_on_load_state_finished(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @fsemu_recording_on_load_state_finished(i32 %0, i8* nocapture %1) {
ret void
}
int isvalid(char ch, char next) {}


x86 assembly (clang, -O0):
<isvalid>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isvalid(i8 signext %0, i8 signext %1) {
ret i32 undef
}
/* Variables and functions */
double time(int /*<<< orphan*/);
double ILLutil_real_zeit(void) { return time(0); }


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

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

LLVM IR (-O0):
define double @ILLutil_real_zeit() {
%1 = call double @time(i32 0)
ret double %1
}

LLVM IR (-O2):
define double @ILLutil_real_zeit() {
%1 = tail call double @time(i32 0)
ret double %1
}