xunge/DecIR huggingface dataset:
/* Variables and functions */
int test_eval2(int);
int lisp_test4() { return test_eval2(1); }


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

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

LLVM IR (-O0):
define i32 @lisp_test4() {
%1 = call i32 @test_eval2(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @lisp_test4() {
%1 = tail call i32 @test_eval2(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_strbuf_free() {
  printf("NOT IMPLEMENTED:"
         "pa_strbuf_free"
         "\n");
}


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

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

LLVM IR (-O2):
@str = [31 x i8] c"NOT IMPLEMENTED:pa_strbuf_free\00"
define i32 @pa_strbuf_free() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int sb_any_quota_loaded(struct super_block *sb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.super_block = type opaque
define i32 @sb_any_quota_loaded(%struct.super_block* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
void *halloc(void *, size_t);
void *h_realloc(void *ptr, size_t len) { return halloc(ptr, len); }


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

x86 assembly (clang, -O2):
<h_realloc>:
jmp    1030 <halloc@plt>

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

LLVM IR (-O2):
define i8* @h_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @halloc(i8* %0, i64 %1)
ret i8* %3
}
void stack_array_pop(struct Stack *s) {}


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

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

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

LLVM IR (-O2):
%struct.Stack = type opaque
define void @stack_array_pop(%struct.Stack* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int quit(int op) {
  char *msg = op == 1 ? "YOU WIN!" : op == 0 ? "GAME OVER." : "QUIT";
  printf("\n\n%s\n", msg);
  cleanup();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1155 <quit+0x25>
lea    0xeb4(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1171 <quit+0x41>
mov    -0x4(%rbp),%edx
lea    0xeb5(%rip),%rax
lea    0xea3(%rip),%rcx
cmp    $0x0,%edx
cmove  %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cleanup@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
test   %edi,%edi
lea    0xecf(%rip),%rax
lea    0xed3(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%edi
lea    0xeb1(%rip),%rsi
cmovne %rcx,%rsi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <cleanup@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"YOU WIN!\00"
@.str.1 = [11 x i8] c"GAME OVER.\00"
@.str.2 = [5 x i8] c"QUIT\00"
@.str.3 = [6 x i8] c"\0A\0A%s\0A\00"
define i32 @quit(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
br label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
br label %12
12: ; preds = %7, %6
%13 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %6 ], [ %11, %7 ]
store i8* %13, i8** %3
%14 = load i8*, i8** %3
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %14)
%16 = call i32 (...) @cleanup()
%17 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"YOU WIN!\00"
@.str.1 = [11 x i8] c"GAME OVER.\00"
@.str.2 = [5 x i8] c"QUIT\00"
@.str.3 = [6 x i8] c"\0A\0A%s\0A\00"
define i32 @quit(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%7 = tail call i32 (...) @cleanup()
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
start_suite(char *tsuite) {
  printf("\033[1m\033[37m"
         "\nExecuting %s Test Suite\n"
         "\033[0m",
         tsuite);
  puts("\033[1m\033[37m"
       "========================================"
       "\033[0m");
}


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

x86 assembly (clang, -O2):
<start_suite>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"\1B[1m\1B[37m\0AExecuting %s Test Suite\0A\1B[0m\00"
@.str.1 = [54 x i8] c"\1B[1m\1B[37m========================================\1B[0m\00"
define i32 @start_suite(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [39 x i8] c"\1B[1m\1B[37m\0AExecuting %s Test Suite\0A\1B[0m\00"
@.str.1 = [54 x i8] c"\1B[1m\1B[37m========================================\1B[0m\00"
define i32 @start_suite(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.1, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *value = malloc(size);
  if (!value) {
    fprintf(stderr, "Out of memory!\n");
    exit(1);
  }
  return value;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <xmalloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([16 x i8], [16 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 = [16 x i8] c"Out of memory!\0A\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %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 ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
int g_DUMMY_popup_container_open(int win_id, char *title, int flag) {
  win_id = win_id;
  title = title;
  flag = flag;
  return 0;
}


x86 assembly (clang, -O0):
<g_DUMMY_popup_container_open>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @g_DUMMY_popup_container_open(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ type_graphics();
int /*<<< orphan*/ type_text();
void JeckyllRepaint() {
  type_text();
  type_graphics();
}


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

x86 assembly (clang, -O2):
<JeckyllRepaint>:
push   %rax
xor    %eax,%eax
call   1040 <type_text@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <type_graphics@plt>

LLVM IR (-O0):
define void @JeckyllRepaint() {
%1 = call i32 (...) @type_text()
%2 = call i32 (...) @type_graphics()
ret void
}

LLVM IR (-O2):
define void @JeckyllRepaint() {
%1 = tail call i32 (...) @type_text()
%2 = tail call i32 (...) @type_graphics()
ret void
}
new2(int a, int *b, void(c)(int k)) {
  int k;
  k = a = *b;
}


x86 assembly (clang, -O0):
<new2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @new2(i32 %0, i32* nocapture readnone %1, void (i32)* nocapture readnone %2) {
ret i32 undef
}
int test_imm_15uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x15 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_15uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x15,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_15uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 90194313216
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void rmb() { __asm__ volatile("lfence" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @rmb() {
tail call void asm sideeffect "lfence", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void proc36() {}


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

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

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

LLVM IR (-O2):
define void @proc36() {
ret void
}
/* Variables and functions */
int add(int, int);
char *test_add_sucess() {
  do {
    if (!(add(1, 2) == 3))
      return "add(1,2) must produce 3";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_add_sucess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
cmp    $0x3,%eax
je     1140 <test_add_sucess+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <test_add_sucess+0x3d>
jmp    1145 <test_add_sucess+0x35>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_add_sucess>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0x3,%eax
lea    0xed4(%rip),%rax
cmovne %rax,%rcx
mov    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"add(1,2) must produce 3\00"
define i8* @test_add_sucess() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 @add(i32 1, i32 2)
%4 = icmp eq i32 %3, 3
br i1 %4, label %6, label %5
5: ; preds = %2
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %1
br label %8
6: ; preds = %2
br label %7
7: ; preds = %6
store i8* null, i8** %1
br label %8
8: ; preds = %7, %5
%9 = load i8*, i8** %1
ret i8* %9
}

LLVM IR (-O2):
@.str = [24 x i8] c"add(1,2) must produce 3\00"
define i8* @test_add_sucess() {
%1 = tail call i32 @add(i32 1, i32 2)
%2 = icmp eq i32 %1, 3
%3 = select i1 %2, i8* null, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Variables and functions */
int foo(char **);
int f2(int *x, int y) {
  char a[y + 1][16];
  return foo(a);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,%rcx
shl    $0x4,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x20(%rbp)
call   1030 <foo@plt>
mov    -0x18(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbp
mov    %rsp,%rbp
add    $0x1,%esi
mov    %rsp,%rdi
shl    $0x4,%rsi
sub    %rsi,%rdi
mov    %rdi,%rsp
call   1030 <foo@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f2(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %5
%11 = alloca [16 x i8], i64 %9
store i64 %9, i64* %6
%12 = bitcast [16 x i8]* %11 to i8**
%13 = call i32 @foo(i8** %12)
%14 = load i8*, i8** %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @f2(i32* nocapture readnone %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 1
%6 = alloca i8*, i64 %5
%7 = call i32 @foo(i8** %6)
ret i32 %7
}
unsigned char bigint_add(unsigned char *r, const unsigned char *x,
                         unsigned long xlen, const unsigned char *y,
                         unsigned long ylen) {}


x86 assembly (clang, -O0):
<bigint_add>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @bigint_add(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i64
store i8* %0, i8** %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i8* %3, i8** %10
store i64 %4, i64* %11
%12 = load i8, i8* %6
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @bigint_add(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i8* nocapture readnone %3, i64 %4) {
ret i8 undef
}
int test_000(int a, int c, int b, int d) { return a + (b & 1); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
and    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
and    $0x1,%edx
lea    (%rdx,%rdi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @test_000(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %2, 1
%6 = add nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int standard_crude_tracker(int verbose) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(622, &verbose, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<standard_crude_tracker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x26e,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standard_crude_tracker>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x26e,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @standard_crude_tracker(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 622, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @standard_crude_tracker(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 622, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ XEvent;
struct TYPE_2__ {
  int /*<<< orphan*/ time;
};
typedef TYPE_1__ XButtonReleasedEvent;
typedef int /*<<< orphan*/ Widget;
typedef int /*<<< orphan*/ String;
typedef int /*<<< orphan*/ Cardinal;

/* Variables and functions */
int /*<<< orphan*/ do_select(int /*<<< orphan*/);
void selection(Widget w, XEvent *ev, String *vector, Cardinal *count) {
  do_select(((XButtonReleasedEvent *)ev)->time);
}


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

x86 assembly (clang, -O2):
<selection>:
mov    (%rsi),%edi
jmp    1030 <do_select@plt>

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @selection(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %6
%10 = bitcast i32* %9 to %struct.TYPE_2__*
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @do_select(i32 %12)
ret void
}

LLVM IR (-O2):
define void @selection(i32 %0, i32* nocapture %1, i32* nocapture readnone %2, i32* nocapture readnone %3) {
%5 = load i32, i32* %1
%6 = tail call i32 @do_select(i32 %5)
ret void
}
/* Variables and functions */
char *calloc(int, scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *wr_strdup(char *str) {
  char *nstr = calloc(1, strlen(str) + 1);
  if (!nstr)
    return NULL;
  strcpy(nstr, str);
  return nstr;
}


x86 assembly (clang, -O0):
<wr_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rsi
add    $0x1,%rsi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <wr_strdup+0x42>
movq   $0x0,-0x8(%rbp)
jmp    1187 <wr_strdup+0x57>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wr_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rsi
mov    $0x1,%edi
call   1050 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <wr_strdup+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @wr_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @calloc(i32 1, i64 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %12, label %11
11: ; preds = %1
store i8* null, i8** %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %11
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @wr_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @calloc(i32 1, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
void X509_pubkey_digest(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_pubkey_digest() {
ret void
}
int test_imm_66int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x66 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_66int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x66,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_66int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6684672
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
double const exp(double const);
void exp_decay_value(const double r, const double *p, double *f) {
  *f = p[0] * exp(-p[1] * r);
}


x86 assembly (clang, -O0):
<exp_decay_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_decay_value>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsd  (%rdi),%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%rdi),%xmm1
xorpd  0xed1(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @exp_decay_value(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double*, double** %5
%8 = getelementptr inbounds double, double* %7, i64 0
%9 = load double, double* %8
%10 = load double*, double** %5
%11 = getelementptr inbounds double, double* %10, i64 1
%12 = load double, double* %11
%13 = fneg double %12
%14 = load double, double* %4
%15 = fmul double %13, %14
%16 = call double @exp(double %15)
%17 = fmul double %9, %16
%18 = load double*, double** %6
store double %17, double* %18
ret void
}

LLVM IR (-O2):
define void @exp_decay_value(double %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %1
%5 = getelementptr inbounds double, double* %1, i64 1
%6 = load double, double* %5
%7 = fneg double %6
%8 = fmul double %7, %0
%9 = tail call double @exp(double %8)
%10 = fmul double %4, %9
store double %10, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ readFile();
int main() { readFile(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @readFile()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @readFile()
ret i32 0
}
unsigned tree_sitter_javascript_external_scanner_serialize(void *p,
                                                           char *buffer) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @tree_sitter_javascript_external_scanner_serialize(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ init_i2c_hw(int);
int /*<<< orphan*/ serial_puts(char *);
void test_dac(void) {
  serial_puts("Begin DAC test on i2c\n");
  init_i2c_hw(1);
}


x86 assembly (clang, -O0):
<test_dac>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <serial_puts@plt>
mov    $0x1,%edi
call   1030 <init_i2c_hw@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dac>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <serial_puts@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <init_i2c_hw@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Begin DAC test on i2c\0A\00"
define void @test_dac() {
%1 = call i32 @serial_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @init_i2c_hw(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Begin DAC test on i2c\0A\00"
define void @test_dac() {
%1 = tail call i32 @serial_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @init_i2c_hw(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

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


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

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

LLVM IR (-O0):
define void @namco_setParamsD8XX_SetN163(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = call i32 @namcoSetN163(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @namco_setParamsD8XX_N163(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @namco_setParamsD8XX_SetN163(i32 %0, i32 %1) {
%3 = tail call i32 @namcoSetN163(i32 %0)
%4 = tail call i32 @namco_setParamsD8XX_N163(i32 %0, i32 %1)
ret void
}
long long proc4() { return -1LL; }


x86 assembly (clang, -O0):
<proc4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc4>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @proc4() {
ret i64 -1
}

LLVM IR (-O2):
define i64 @proc4() {
ret i64 -1
}
void pm_loss_init(void) {}


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

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

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

LLVM IR (-O2):
define void @pm_loss_init() {
ret void
}
/* Variables and functions */
int util_check_null_string(const char *string) {
  if (string != NULL && *string != '\0')
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<util_check_null_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     112f <util_check_null_string+0x2f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     112f <util_check_null_string+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1136 <util_check_null_string+0x36>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_check_null_string>:
test   %rdi,%rdi
je     110d <util_check_null_string+0xd>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
je     110d <util_check_null_string+0xd>
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @util_check_null_string(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %6
store i32 0, i32* %2
br label %13
12: ; preds = %6, %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @util_check_null_string(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %1
br label %7
7: ; preds = %3, %6
%8 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %8
}
void av_get_padded_bits_per_pixel() {}


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

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

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

LLVM IR (-O2):
define void @av_get_padded_bits_per_pixel() {
ret void
}
/* Variables and functions */
char const *strstr(char const *, char const *);
int __imlib_find_string(const char *haystack, const char *needle) {
  if (strstr(haystack, needle) != NULL)
    return (strstr(haystack, needle) - haystack);
  return 0;
}


x86 assembly (clang, -O0):
<__imlib_find_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1153 <__imlib_find_string+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    115a <__imlib_find_string+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__imlib_find_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%edx
sub    %ebx,%edx
xor    %ecx,%ecx
test   %rax,%rax
cmovne %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__imlib_find_string(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 = load i8*, i8** %5
%8 = call i8* @strstr(i8* %6, i8* %7)
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i8* @strstr(i8* %11, i8* %12)
%14 = load i8*, i8** %4
%15 = ptrtoint i8* %13 to i64
%16 = ptrtoint i8* %14 to i64
%17 = sub i64 %15, %16
%18 = trunc i64 %17 to i32
store i32 %18, i32* %3
br label %20
19: ; preds = %2
store i32 0, i32* %3
br label %20
20: ; preds = %19, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @__imlib_find_string(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 0, i32 %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
scalar_t__ strlen(char *);
void cmdline_parser_print_version(void) {
  printf("%s %s\n", (strlen("ocr") ? "ocr" : "ocr"), "0.1");
}


x86 assembly (clang, -O0):
<cmdline_parser_print_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xedc(%rip),%rdi
call   1030 <strlen@plt>
lea    0xed0(%rip),%rsi
cmp    $0x0,%rax
cmovne %rsi,%rsi
lea    0xeba(%rip),%rdi
lea    0xebe(%rip),%rdx
call   1040 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [4 x i8] c"ocr\00"
@.str.2 = [4 x i8] c"0.1\00"
define void @cmdline_parser_print_version() {
%1 = call i64 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [4 x i8] c"ocr\00"
@.str.2 = [4 x i8] c"0.1\00"
define void @cmdline_parser_print_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}
void i2d_EC_PUBKEY(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_EC_PUBKEY() {
ret void
}
__attribute__((always_)) void cpu_hlt(void) { asm("hlt"); }


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

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

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

LLVM IR (-O2):
define void @cpu_hlt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int not_l(int *);
int intr_wrap_579(int p1) { return not_l(&p1); }


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

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

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

LLVM IR (-O2):
define i32 @intr_wrap_579(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @not_l(i32* %2)
ret i32 %3
}
char itoc(char x) {
  if (x <= 9)
    return x + '0';
  else if (x > 9 && x < 36)
    return x - 10 + 'A';
  else if (x >= 36 && x <= 62)
    return x - 36 + 'a';
  else
    return 0;
}


x86 assembly (clang, -O0):
<itoc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jg     1126 <itoc+0x26>
movsbl -0x2(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1182 <itoc+0x82>
movsbl -0x2(%rbp),%eax
cmp    $0x9,%eax
jle    1152 <itoc+0x52>
movsbl -0x2(%rbp),%eax
cmp    $0x24,%eax
jge    1152 <itoc+0x52>
movsbl -0x2(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1182 <itoc+0x82>
movsbl -0x2(%rbp),%eax
cmp    $0x24,%eax
jl     117e <itoc+0x7e>
movsbl -0x2(%rbp),%eax
cmp    $0x3e,%eax
jg     117e <itoc+0x7e>
movsbl -0x2(%rbp),%eax
sub    $0x24,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1182 <itoc+0x82>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoc>:
mov    %edi,%eax
cmp    $0x9,%al
jg     1109 <itoc+0x9>
add    $0x30,%al
ret
cmp    $0x23,%al
ja     1110 <itoc+0x10>
add    $0x37,%al
ret
lea    0x3d(%rax),%ecx
xor    %edx,%edx
cmp    $0x3f,%al
movzbl %cl,%eax
cmovae %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @itoc(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sle i32 %5, 9
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, 48
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %41
12: ; preds = %1
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sgt i32 %14, 9
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp slt i32 %18, 36
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i8, i8* %3
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 10
%24 = add nsw i32 %23, 65
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %41
26: ; preds = %16, %12
%27 = load i8, i8* %3
%28 = sext i8 %27 to i32
%29 = icmp sge i32 %28, 36
br i1 %29, label %30, label %40
30: ; preds = %26
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = icmp sle i32 %32, 62
br i1 %33, label %34, label %40
34: ; preds = %30
%35 = load i8, i8* %3
%36 = sext i8 %35 to i32
%37 = sub nsw i32 %36, 36
%38 = add nsw i32 %37, 97
%39 = trunc i32 %38 to i8
store i8 %39, i8* %2
br label %41
40: ; preds = %30, %26
store i8 0, i8* %2
br label %41
41: ; preds = %40, %34, %20, %7
%42 = load i8, i8* %2
ret i8 %42
}

LLVM IR (-O2):
define signext i8 @itoc(i8 signext %0) {
%2 = icmp slt i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = add nsw i8 %0, 48
br label %13
5: ; preds = %1
%6 = icmp ult i8 %0, 36
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = add nuw nsw i8 %0, 55
br label %13
9: ; preds = %5
%10 = icmp ult i8 %0, 63
%11 = add nuw i8 %0, 61
%12 = select i1 %10, i8 %11, i8 0
br label %13
13: ; preds = %9, %7, %3
%14 = phi i8 [ %4, %3 ], [ %8, %7 ], [ %12, %9 ]
ret i8 %14
}
void typedefStructFunc() {
  typedef struct {
    char c1;
    int t;
    char c2;
  } S;
  S obj;
}


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

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

LLVM IR (-O0):
%struct.S = type { i8, i32, i8 }
define void @typedefStructFunc() {
%1 = alloca %struct.S
ret void
}

LLVM IR (-O2):
%struct.S = type { i8, i32, i8 }
define void @typedefStructFunc() {
ret void
}
/* Variables and functions */
int get_SCR();
unsigned int get_security_state() { return ((get_SCR() & 1) == 0); }


x86 assembly (clang, -O0):
<get_security_state>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <get_SCR@plt>
and    $0x1,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_security_state>:
push   %rax
xor    %eax,%eax
call   1030 <get_SCR@plt>
not    %eax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @get_security_state() {
%1 = call i32 (...) @get_SCR()
%2 = and i32 %1, 1
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @get_security_state() {
%1 = tail call i32 (...) @get_SCR()
%2 = and i32 %1, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ merge_sort(int *, int /*<<< orphan*/, int, int, int);
void k_sort(int *numbers, int size, int k) {
  for (int i = 0; i < k; i++) {
    merge_sort(numbers, 0, size, k, i);
  }
}


x86 assembly (clang, -O0):
<k_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1158 <k_sort+0x48>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
xor    %esi,%esi
call   1030 <merge_sort@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <k_sort+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<k_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1149 <k_sort+0x39>
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
xor    %esi,%esi
mov    %r14d,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
call   1030 <merge_sort@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <k_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @k_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %6, label %5
5: ; preds = %6, %3
ret void
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = tail call i32 @merge_sort(i32* %0, i32 0, i32 %1, i32 %2, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, %2
br i1 %10, label %5, label %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  fprintf(stderr, "WARNING: runtest not implemented for platform yet\n");
  return 77;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4d,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x4d,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"WARNING: runtest not implemented for platform yet\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 77
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"WARNING: runtest not implemented for platform yet\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i32 77
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void __attribute__((no)) foo_s32(int a, int b) {
  if (a == -b)
    abort();
}


x86 assembly (clang, -O0):
<foo_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    1135 <foo_s32+0x25>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_s32>:
add    %esi,%edi
je     1115 <foo_s32+0x5>
ret
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @foo_s32(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 = sub nsw i32 0, %6
%8 = icmp eq i32 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @foo_s32(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = icmp eq i32 %3, %0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret void
}