xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ isspace(char);
int empty_line_or_comment(char *s) {
  while (isspace(*s))
    s++;
  if (!*s)
    return 1;
  if (*s == ';')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<empty_line_or_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <empty_line_or_comment+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <empty_line_or_comment+0xc>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    115c <empty_line_or_comment+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    117f <empty_line_or_comment+0x6f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3b,%eax
jne    1178 <empty_line_or_comment+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <empty_line_or_comment+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<empty_line_or_comment>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <empty_line_or_comment+0x10>
mov    -0x1(%rbx),%al
test   %al,%al
sete   %cl
cmp    $0x3b,%al
sete   %al
or     %cl,%al
movzbl %al,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @empty_line_or_comment(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
%11 = icmp eq i8 %9, 59
%12 = or i1 %10, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ m4iph_sdr_write(unsigned char *, unsigned char *,
                                   unsigned long);
void m4iph_sdr_write_vpu4(unsigned char *address, unsigned char *buffer,
                          unsigned long count) {
  m4iph_sdr_write(address, buffer, count);
}


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

x86 assembly (clang, -O2):
<m4iph_sdr_write_vpu4>:
jmp    1030 <m4iph_sdr_write@plt>

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

LLVM IR (-O2):
define void @m4iph_sdr_write_vpu4(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @m4iph_sdr_write(i8* %0, i8* %1, i64 %2)
ret void
}
void ncsi_unregister_dev(struct ncsi_dev *nd) {}


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

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

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

LLVM IR (-O2):
%struct.ncsi_dev = type opaque
define void @ncsi_unregister_dev(%struct.ncsi_dev* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ asm_sig_print(int, int /*<<< orphan*/ *, void *);
void sigfn_ill(int signum, siginfo_t *siginfo, void *puctx) {
  asm_sig_print(signum, siginfo, puctx);
}


x86 assembly (clang, -O0):
<sigfn_ill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <asm_sig_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigfn_ill>:
jmp    1030 <asm_sig_print@plt>

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

LLVM IR (-O2):
define void @sigfn_ill(i32 %0, i32* %1, i8* %2) {
%4 = tail call i32 @asm_sig_print(i32 %0, i32* %1, i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mt_init();
void normal_setup(void) { mt_init(); }


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

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

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

LLVM IR (-O2):
define void @normal_setup() {
%1 = tail call i32 (...) @mt_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("Running executable_program...");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [30 x i8] c"Running executable_program...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(unsigned int);
int /*<<< orphan*/ stderr;
void *errorchecked_malloc(unsigned int size) {
  void *ptr;
  ptr = malloc(size);
  if (ptr == NULL) {
    fprintf(stderr, "Error: could not allocate memory. \n");
    exit(-1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<errorchecked_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1171 <errorchecked_malloc+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorchecked_malloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <errorchecked_malloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Error: could not allocate memory. \0A\00"
define i8* @errorchecked_malloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Error: could not allocate memory. \0A\00"
define noalias i8* @errorchecked_malloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ end_screen();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void my_exit(int ret) {
  end_screen();
  printf("exiting\n");
  exit(ret);
}


x86 assembly (clang, -O0):
<my_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <end_screen@plt>
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<my_exit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <end_screen@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"exiting\0A\00"
define void @my_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @end_screen()
%4 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@str = [8 x i8] c"exiting\00"
define void @my_exit(i32 %0) {
%2 = tail call i32 (...) @end_screen()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 %0)
unreachable
}
const char *opt2str(int state) {
  if (state == 1)
    return "no";
  else if (state == 2)
    return "yes";
  else
    return "undefined";
}


x86 assembly (clang, -O0):
<opt2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1121 <opt2str+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <opt2str+0x46>
cmpl   $0x2,-0xc(%rbp)
jne    113b <opt2str+0x3b>
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <opt2str+0x46>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt2str>:
cmp    $0x2,%edi
lea    0xef9(%rip),%rax
lea    0xef6(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [10 x i8] c"undefined\00"
define i8* @opt2str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %7
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"no\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [10 x i8] c"undefined\00"
define i8* @opt2str(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
void g_ptr_array_remove_fast() {}


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

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

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

LLVM IR (-O2):
define void @g_ptr_array_remove_fast() {
ret void
}
void Cyc_BansheeIf_persist_cvarmap(struct Cyc___cycFILE *f) { ; }


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

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

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

LLVM IR (-O2):
%struct.Cyc___cycFILE = type opaque
define void @Cyc_BansheeIf_persist_cvarmap(%struct.Cyc___cycFILE* nocapture %0) {
ret void
}
void rop3_13_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D & stk3;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_13_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_13_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
or     %al,%cl
not    %cl
and    %al,%sil
and    %dl,%al
or     %sil,%al
or     %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_13_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = xor i32 %28, -1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %7
%31 = load i8, i8* %7
%32 = zext i8 %31 to i32
%33 = load i8, i8* %5
%34 = zext i8 %33 to i32
%35 = xor i32 %34, -1
%36 = and i32 %32, %35
%37 = load i8, i8* %6
%38 = zext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = and i32 %36, %39
%41 = load i8*, i8** %4
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = load i8, i8* %5
%45 = zext i8 %44 to i32
%46 = and i32 %43, %45
%47 = or i32 %40, %46
%48 = load i8*, i8** %4
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = load i8, i8* %6
%52 = zext i8 %51 to i32
%53 = and i32 %50, %52
%54 = or i32 %47, %53
%55 = trunc i32 %54 to i8
%56 = load i8*, i8** %4
store i8 %55, i8* %56
ret void
}

LLVM IR (-O2):
define void @rop3_13_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = or i8 %5, %4
%7 = xor i8 %6, -1
%8 = and i8 %4, %1
%9 = or i8 %8, %7
%10 = and i8 %4, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int x = 0;
  int y = 0;
  while (x < 5) {
    y = y + x;
    printf("%i%i ", x, y);
    x = x + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1160 <main+0x50>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0xa,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%i%i \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = add nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%i%i \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1, i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 2, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 3, i32 6)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 4, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ CloseScreen();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Finish(int sig) {
  CloseScreen();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define void @Finish(i32 %0) {
%2 = tail call i32 (...) @CloseScreen()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_75int32_mem(int *val) {
  return ((*val) & (0x75 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_75int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 117
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_panic__();
void stg_exit(int n) { __coverity_panic__(); }


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

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

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

LLVM IR (-O2):
define void @stg_exit(i32 %0) {
%2 = tail call i32 (...) @__coverity_panic__()
ret void
}
unsigned long long
unsignedlonglong_ignoring_unsignedlonglong(unsigned long long x,
                                           unsigned long long y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlonglong_ignoring_unsignedlonglong>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlonglong_ignoring_unsignedlonglong(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglong_ignoring_unsignedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
scalar_t__ is_set_option(char);
int is_essential_option(char op_char) {
  if (op_char == 'r')
    return 1;
  if (op_char == 'w')
    return 1;
  if (is_set_option('p') && op_char == 't')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_essential_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x72,%eax
jne    1137 <is_essential_option+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1184 <is_essential_option+0x74>
movsbl -0x5(%rbp),%eax
cmp    $0x77,%eax
jne    1150 <is_essential_option+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1184 <is_essential_option+0x74>
mov    $0x70,%edi
call   1030 <is_set_option@plt>
cmp    $0x0,%rax
je     117d <is_essential_option+0x6d>
movsbl -0x5(%rbp),%eax
cmp    $0x74,%eax
jne    117d <is_essential_option+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1184 <is_essential_option+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_essential_option>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%eax
cmp    $0x72,%bl
je     1122 <is_essential_option+0x12>
cmp    $0x77,%bl
jne    1124 <is_essential_option+0x14>
pop    %rbx
ret
mov    $0x70,%edi
call   1030 <is_set_option@plt>
test   %rax,%rax
setne  %al
cmp    $0x74,%bl
sete   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_essential_option(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 114
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %22
8: ; preds = %1
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 119
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 1, i32* %2
br label %22
13: ; preds = %8
%14 = call i64 @is_set_option(i8 signext 112)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 116
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %2
br label %22
21: ; preds = %16, %13
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %12, %7
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @is_essential_option(i8 signext %0) {
switch i8 %0, label %2 [
i8 114, label %8
i8 119, label %8
]
2: ; preds = %1
%3 = tail call i64 @is_set_option(i8 signext 112)
%4 = icmp ne i64 %3, 0
%5 = icmp eq i8 %0, 116
%6 = and i1 %5, %4
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %1, %1
%9 = phi i32 [ 1, %1 ], [ 1, %1 ], [ %7, %2 ]
ret i32 %9
}
int numA(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<numA>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @numA(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @numA(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void endless() {
  int i = 5;
  printf("Do you know how much research I could fit in space? I'll give you a "
         "hint, more than %d. Level Cleared\n",
         i);
}


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

x86 assembly (clang, -O2):
<endless>:
lea    0xee9(%rip),%rdi
mov    $0x5,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [103 x i8] c"Do you know how much research I could fit in space? I'll give you a hint, more than %d. Level Cleared\0A\00"
define void @endless() {
%1 = alloca i32
store i32 5, i32* %1
%2 = load i32, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [103 x i8] c"Do you know how much research I could fit in space? I'll give you a hint, more than %d. Level Cleared\0A\00"
define void @endless() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0), i32 5)
ret void
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
unsigned int hash_func_int16_t(void *ptr) {
  int16_t v = *((int16_t *)ptr);
  if (sizeof(int16_t) > sizeof(unsigned int))
    return v ^ (v >> 32);
  else
    return v;
}


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

x86 assembly (clang, -O2):
<hash_func_int16_t>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @hash_func_int16_t(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @hash_func_int16_t(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int sqrt(int);
double f(double x) { return (4 * sqrt(1 - x * x)); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sqrt@plt>
shl    $0x2,%eax
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mulsd  %xmm0,%xmm0
movsd  0xee3(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sqrt@plt>
shl    $0x2,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fneg double %3
%6 = call double @llvm.fmuladd.f64(double %5, double %4, double 1.000000e+00)
%7 = fptosi double %6 to i32
%8 = call i32 @sqrt(i32 %7)
%9 = mul nsw i32 4, %8
%10 = sitofp i32 %9 to double
ret double %10
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = fneg double %0
%3 = tail call double @llvm.fmuladd.f64(double %2, double %0, double 1.000000e+00)
%4 = fptosi double %3 to i32
%5 = tail call i32 @sqrt(i32 %4)
%6 = shl nsw i32 %5, 2
%7 = sitofp i32 %6 to double
ret double %7
}
int fun1236() { return 1236; }


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

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

LLVM IR (-O0):
define i32 @fun1236() {
ret i32 1236
}

LLVM IR (-O2):
define i32 @fun1236() {
ret i32 1236
}
/* Variables and functions */
short *BGBMID_LoadWAV_RateStereo16(char const *, int *, int);
short *BGBMID_LoadWAV_16Stereo16(const char *name, int *rlen) {
  return (BGBMID_LoadWAV_RateStereo16(name, rlen, 16000));
}


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

x86 assembly (clang, -O2):
<BGBMID_LoadWAV_16Stereo16>:
mov    $0x3e80,%edx
jmp    1030 <BGBMID_LoadWAV_RateStereo16@plt>

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

LLVM IR (-O2):
define i16* @BGBMID_LoadWAV_16Stereo16(i8* %0, i32* %1) {
%3 = tail call i16* @BGBMID_LoadWAV_RateStereo16(i8* %0, i32* %1, i32 16000)
ret i16* %3
}
/* Variables and functions */
int /*<<< orphan*/ f1();
void wfunc() { f1(); }


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

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

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

LLVM IR (-O2):
define void @wfunc() {
%1 = tail call i32 (...) @f1()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t rt2501buffer_new(const uint8_t *data, uint32_t length,
                         const uint8_t *source_mac, const uint8_t *dest_mac) {}


x86 assembly (clang, -O0):
<rt2501buffer_new>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rt2501buffer_new(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
ret i32 undef
}
/* Variables and functions */
size_t game_data_size();
size_t retro_get_memory_size(unsigned id) {
  if (id != 0)
    return 0;
  return game_data_size();
}


x86 assembly (clang, -O0):
<retro_get_memory_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1132 <retro_get_memory_size+0x22>
movq   $0x0,-0x8(%rbp)
jmp    113d <retro_get_memory_size+0x2d>
mov    $0x0,%al
call   1030 <game_data_size@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retro_get_memory_size>:
test   %edi,%edi
je     1117 <retro_get_memory_size+0x7>
xor    %eax,%eax
ret
xor    %eax,%eax
jmp    1030 <game_data_size@plt>

LLVM IR (-O0):
define i64 @retro_get_memory_size(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 0, i64* %2
br label %9
7: ; preds = %1
%8 = call i64 (...) @game_data_size()
store i64 %8, i64* %2
br label %9
9: ; preds = %7, %6
%10 = load i64, i64* %2
ret i64 %10
}

LLVM IR (-O2):
define i64 @retro_get_memory_size(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i64 (...) @game_data_size()
br label %5
5: ; preds = %1, %3
%6 = phi i64 [ %4, %3 ], [ 0, %1 ]
ret i64 %6
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void printhex(const uint8_t *buf, size_t len) {
  for (size_t i = 0; i < len; i++)
    printf("%02x", buf[i]);
}


x86 assembly (clang, -O0):
<printhex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115e <printhex+0x4e>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <printhex+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhex>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1145 <printhex+0x35>
mov    %rsi,%r12
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed4(%rip),%r15
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <printhex+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%02x\00"
define void @printhex(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int s_islnk(mode_t mode) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @s_islnk(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ stderr;
void usage(char *av0, int depth, int nthreads) {
  fprintf(stderr,
          "Usage: %s [-d <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\n"
          " -d        parallel recursion depth, default %d\n"
          " -n        number of threads in pool, default %d\n"
          " -b        run built-in qsort\n"
          " -s        specify srand() seed\n"
          " -q        don't run serial qsort\n",
          av0, depth, nthreads);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %edx,%r8d
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [245 x i8] c"Usage: %s [-d <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\0A -d parallel recursion depth, default %d\0A -n number of threads in pool, default %d\0A -b run built-in qsort\0A -s specify srand() seed\0A -q don't run serial qsort\0A\00"
define void @usage(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([245 x i8], [245 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i32 %10)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [245 x i8] c"Usage: %s [-d <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\0A -d parallel recursion depth, default %d\0A -n number of threads in pool, default %d\0A -b run built-in qsort\0A -s specify srand() seed\0A -q don't run serial qsort\0A\00"
define void @usage(i8* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([245 x i8], [245 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int Partition(int *, int, int);
void QuickSort(int *array, int low, int high) {
  if (low < high) {
    int pivotloc = Partition(array, low, high);
    QuickSort(array, low, pivotloc - 1);
    QuickSort(array, pivotloc + 1, high);
  }
}


x86 assembly (clang, -O0):
<QuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <QuickSort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <QuickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <QuickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickSort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <QuickSort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <Partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1030 <QuickSort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <QuickSort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @QuickSort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @Partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @QuickSort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int ffs(int);
uint8_t mask_value(uint8_t val, uint8_t mask) {
  return (val & mask) >> (ffs(mask) - 1);
}


x86 assembly (clang, -O0):
<mask_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <ffs@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    $0x1,%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mask_value>:
mov    %edi,%eax
and    %esi,%eax
bsf    %esi,%edx
cmp    $0x1,%esi
sbb    %ecx,%ecx
or     %dl,%cl
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @mask_value(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 = and i32 %5, %6
%8 = load i32, i32* %4
%9 = call i32 @ffs(i32 %8)
%10 = sub nsw i32 %9, 1
%11 = ashr i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @mask_value(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = tail call i32 @llvm.cttz.i32(i32 %1, i1 true)
%5 = icmp eq i32 %1, 0
%6 = select i1 %5, i32 -1, i32 %4
%7 = ashr i32 %3, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, size_t);
void os_remove_in_array(void *ptr, size_t nmemb, size_t size, size_t idx) {
  if (idx < nmemb - 1)
    memmove((((unsigned char *)ptr) + idx * size),
            (((unsigned char *)ptr) + (idx + 1) * size),
            ((nmemb - idx - 1) * size));
}


x86 assembly (clang, -O0):
<os_remove_in_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jae    1177 <os_remove_in_array+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rax
imul   -0x18(%rbp),%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rax
add    $0x1,%rax
imul   -0x18(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
sub    -0x20(%rbp),%rdx
sub    $0x1,%rdx
imul   -0x18(%rbp),%rdx
call   1030 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_remove_in_array>:
lea    -0x1(%rsi),%rax
cmp    %rcx,%rax
jbe    1146 <os_remove_in_array+0x36>
mov    %rcx,%r8
imul   %rdx,%r8
add    %rdi,%r8
lea    0x1(%rcx),%rax
imul   %rdx,%rax
add    %rdi,%rax
not    %rcx
add    %rsi,%rcx
imul   %rdx,%rcx
mov    %r8,%rdi
mov    %rax,%rsi
mov    %rcx,%rdx
jmp    1030 <memmove@plt>
ret

LLVM IR (-O0):
define void @os_remove_in_array(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %8
%10 = load i64, i64* %6
%11 = sub i64 %10, 1
%12 = icmp ult i64 %9, %11
br i1 %12, label %13, label %32
13: ; preds = %4
%14 = load i8*, i8** %5
%15 = load i64, i64* %8
%16 = load i64, i64* %7
%17 = mul i64 %15, %16
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8*, i8** %5
%20 = load i64, i64* %8
%21 = add i64 %20, 1
%22 = load i64, i64* %7
%23 = mul i64 %21, %22
%24 = getelementptr inbounds i8, i8* %19, i64 %23
%25 = load i64, i64* %6
%26 = load i64, i64* %8
%27 = sub i64 %25, %26
%28 = sub i64 %27, 1
%29 = load i64, i64* %7
%30 = mul i64 %28, %29
%31 = call i32 @memmove(i8* %18, i8* %24, i64 %30)
br label %32
32: ; preds = %13, %4
ret void
}

LLVM IR (-O2):
define void @os_remove_in_array(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %1, -1
%6 = icmp ugt i64 %5, %3
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = mul i64 %3, %2
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = add nuw i64 %3, 1
%11 = mul i64 %10, %2
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = xor i64 %3, -1
%14 = add i64 %13, %1
%15 = mul i64 %14, %2
%16 = tail call i32 @memmove(i8* %9, i8* %12, i64 %15)
br label %17
17: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stdout;
void debug(const char *label, const char *msg) {
  fprintf(stdout, "[%s] %s\n", label, msg);
}


x86 assembly (clang, -O0):
<debug>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xec8(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0xeda(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"[%s] %s\0A\00"
define void @debug(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"[%s] %s\0A\00"
define void @debug(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void foo655() {}


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

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

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

LLVM IR (-O2):
define void @foo655() {
ret void
}
/* Variables and functions */
scalar_t__ unlink(char const *);
int clist_unlink(const char *fname) {
  return (unlink(fname) != 0 ? ((-12)) : 0);
}


x86 assembly (clang, -O0):
<clist_unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <unlink@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0xfffffff4,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clist_unlink>:
push   %rax
call   1030 <unlink@plt>
xor    %ecx,%ecx
test   %rax,%rax
mov    $0xfffffff4,%eax
cmove  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clist_unlink(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @unlink(i8* %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -12, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @clist_unlink(i8* nocapture %0) {
%2 = tail call i64 @unlink(i8* %0)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 -12
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ NID_ripemd160;
int jksengine_digests_final(int /*<<< orphan*/ *, unsigned char *,
                            int /*<<< orphan*/);
int jksengine_ripemd160_final(EVP_MD_CTX *ctx, unsigned char *md) {
  ;
  return (jksengine_digests_final(ctx, md, NID_ripemd160));
}


x86 assembly (clang, -O0):
<jksengine_ripemd160_final>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
call   1030 <jksengine_digests_final@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jksengine_ripemd160_final>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
jmp    1030 <jksengine_digests_final@plt>

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

LLVM IR (-O2):
@NID_ripemd160 = global i32 0
define i32 @jksengine_ripemd160_final(i32* %0, i8* %1) {
%3 = load i32, i32* @NID_ripemd160
%4 = tail call i32 @jksengine_digests_final(i32* %0, i8* %1, i32 %3)
ret i32 %4
}