xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int my_main() {
  printf("no main function defined\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"no main function defined\0A\00"
define i32 @my_main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"no main function defined\00"
define i32 @my_main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int serial_iec_lib_write_sector(unsigned int, unsigned int, unsigned int,
                                unsigned char *);
int machine_bus_lib_write_sector(unsigned int unit, unsigned int track,
                                 unsigned int sector, unsigned char *buf) {
  return serial_iec_lib_write_sector(unit, track, sector, buf);
}


x86 assembly (clang, -O0):
<machine_bus_lib_write_sector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <serial_iec_lib_write_sector@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<machine_bus_lib_write_sector>:
jmp    1030 <serial_iec_lib_write_sector@plt>

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

LLVM IR (-O2):
define i32 @machine_bus_lib_write_sector(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @serial_iec_lib_write_sector(i32 %0, i32 %1, i32 %2, i8* %3)
ret i32 %5
}
/* Type definitions */
struct widget {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gui_init();
int /*<<< orphan*/ gui_main();
int /*<<< orphan*/ gui_widget_show(struct widget *);
struct widget *gui_window_new();
int main(int argc, char **argv) {
  struct widget *window = 0;
  gui_init();
  window = gui_window_new();
  gui_widget_show(window);
  gui_main();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1060 <gui_init@plt>
mov    $0x0,%al
call   1040 <gui_window_new@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <gui_widget_show@plt>
mov    $0x0,%al
call   1050 <gui_main@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <gui_init@plt>
xor    %eax,%eax
call   1040 <gui_window_new@plt>
mov    %rax,%rdi
call   1030 <gui_widget_show@plt>
xor    %eax,%eax
call   1050 <gui_main@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.widget = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.widget*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.widget* null, %struct.widget** %6
%7 = call i32 (...) @gui_init()
%8 = call %struct.widget* (...) @gui_window_new()
store %struct.widget* %8, %struct.widget** %6
%9 = load %struct.widget*, %struct.widget** %6
%10 = call i32 @gui_widget_show(%struct.widget* %9)
%11 = call i32 (...) @gui_main()
ret i32 0
}

LLVM IR (-O2):
%struct.widget = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @gui_init()
%4 = tail call %struct.widget* (...) @gui_window_new()
%5 = tail call i32 @gui_widget_show(%struct.widget* %4)
%6 = tail call i32 (...) @gui_main()
ret i32 0
}
long ptr_diff(const void *a, const void *b) {
  return (const char *)a - (const char *)b;
}


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

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

LLVM IR (-O0):
define i64 @ptr_diff(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @ptr_diff(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ say_goodbye();
void handle_abort(int param) { say_goodbye(); }


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

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

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

LLVM IR (-O2):
define void @handle_abort(i32 %0) {
%2 = tail call i32 (...) @say_goodbye()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: garpTool br0 192.168.4.100 xx:xx:xx:xx:xx:xx  \n");
  exit(-1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Usage: garpTool br0 192.168.4.100 xx:xx:xx:xx:xx:xx \0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [54 x i8] c"Usage: garpTool br0 192.168.4.100 xx:xx:xx:xx:xx:xx \00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
int compare_func_for_int(int a, int b) {
  if (a < b) {
    return -1;
  } else if (a > b) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<compare_func_for_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1122 <compare_func_for_int+0x22>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <compare_func_for_int+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113a <compare_func_for_int+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <compare_func_for_int+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_func_for_int>:
xor    %ecx,%ecx
cmp    %esi,%edi
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_func_for_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = icmp sgt i32 %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void UI_AddBots_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/common/arrow_up_16.tga");
  trap_R_RegisterShaderNoMip("menu/common/arrow_dn_16.tga");
}


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

x86 assembly (clang, -O2):
<UI_AddBots_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef8(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"menu/common/arrow_up_16.tga\00"
@.str.1 = [28 x i8] c"menu/common/arrow_dn_16.tga\00"
define void @UI_AddBots_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"menu/common/arrow_up_16.tga\00"
@.str.1 = [28 x i8] c"menu/common/arrow_dn_16.tga\00"
define void @UI_AddBots_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *strCopy(char *dest, char *src) {
  int i = 0;
  while (src[i] != '\0') {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strCopy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <strCopy+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strCopy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strCopy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <strCopy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strCopy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strCopy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
void pp_test_setup() {}


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

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

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

LLVM IR (-O2):
define void @pp_test_setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ work(int);
int main(int argc, char *argv[]) {
  int i;
  for (i = 0; i < 8; ++i)
    work(i + 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1150 <main+0x40>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1030 <work@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <work@plt>
mov    $0x2,%edi
call   1030 <work@plt>
mov    $0x3,%edi
call   1030 <work@plt>
mov    $0x4,%edi
call   1030 <work@plt>
mov    $0x5,%edi
call   1030 <work@plt>
mov    $0x6,%edi
call   1030 <work@plt>
mov    $0x7,%edi
call   1030 <work@plt>
mov    $0x8,%edi
call   1030 <work@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @work(i32 1)
%4 = tail call i32 @work(i32 2)
%5 = tail call i32 @work(i32 3)
%6 = tail call i32 @work(i32 4)
%7 = tail call i32 @work(i32 5)
%8 = tail call i32 @work(i32 6)
%9 = tail call i32 @work(i32 7)
%10 = tail call i32 @work(i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void apple() { printf("FRUIT:: This is apple !\n"); }


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

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

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

LLVM IR (-O2):
@str = [24 x i8] c"FRUIT:: This is apple !\00"
define void @apple() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
int(_rl_digit_p)(c) int c;
{ return ((c) >= '0' && (c) <= '9'); }


x86 assembly (clang, -O0):
<_rl_digit_p>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <_rl_digit_p+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_rl_digit_p>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @_rl_digit_p(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @_rl_digit_p(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int compare_int_ptr(void const *, void const *);
int compare_int_as_obj(const void **v_int1, const void **v_int2) {
  return (compare_int_ptr(*v_int1, *v_int2));
}


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

x86 assembly (clang, -O2):
<compare_int_as_obj>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <compare_int_ptr@plt>

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

LLVM IR (-O2):
define i32 @compare_int_as_obj(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @compare_int_ptr(i8* %3, i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) { fprintf(stderr, "Usage: mkfs.jffs -d root_directory\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [36 x i8] c"Usage: mkfs.jffs -d root_directory\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"Usage: mkfs.jffs -d root_directory\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double exp(double);
int tanh(double);
double param2(double z) {
  double u = 2 * z - 1;
  return exp(-u) + 2 * (2 - tanh(u));
}


x86 assembly (clang, -O0):
<param2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  %xmm0,%xmm0
movsd  0xec2(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <tanh@plt>
movsd  -0x18(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x2,%eax
sub    %ecx,%eax
shl    $0x1,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<param2>:
sub    $0x28,%rsp
movapd %xmm0,%xmm1
addsd  %xmm0,%xmm1
addsd  0xecc(%rip),%xmm1
movapd %xmm1,0x10(%rsp)
movapd 0xece(%rip),%xmm0
xorpd  %xmm1,%xmm0
call   1040 <exp@plt>
movsd  %xmm0,0x8(%rsp)
movaps 0x10(%rsp),%xmm0
call   1030 <tanh@plt>
add    %eax,%eax
mov    $0x4,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @param2(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %4, double -1.000000e+00)
store double %5, double* %3
%6 = load double, double* %3
%7 = fneg double %6
%8 = call double @exp(double %7)
%9 = load double, double* %3
%10 = call i32 @tanh(double %9)
%11 = sub nsw i32 2, %10
%12 = mul nsw i32 2, %11
%13 = sitofp i32 %12 to double
%14 = fadd double %8, %13
ret double %14
}

LLVM IR (-O2):
define double @param2(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double -1.000000e+00)
%3 = fneg double %2
%4 = tail call double @exp(double %3)
%5 = tail call i32 @tanh(double %2)
%6 = mul i32 %5, -2
%7 = add i32 %6, 4
%8 = sitofp i32 %7 to double
%9 = fadd double %4, %8
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void polo(void) { printf("Core 2 says polo\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"Core 2 says polo\00"
define void @polo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
int execute_getsid() { return 0; }


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

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

LLVM IR (-O0):
define i32 @execute_getsid() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_getsid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *progname) {
  fprintf(stderr,
          ("usage: %s [ [-q msqid] [-m shmid] [-s semid]\n"
           "          [-Q msgkey] [-M shmkey] [-S semkey] ... ]\n"),
          progname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [98 x i8] c"usage: %s [ [-q msqid] [-m shmid] [-s semid]\0A [-Q msgkey] [-M shmkey] [-S semkey] ... ]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [98 x i8] c"usage: %s [ [-q msqid] [-m shmid] [-s semid]\0A [-Q msgkey] [-M shmkey] [-S semkey] ... ]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void test2(int *P, int A) {
  struct str;
  int Array[*(int *)P + A];
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test2(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** %3
%8 = load i32, i32* %7
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = alloca i32, i64 %11
store i64 %11, i64* %6
%14 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @test2(i32* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_timestamp_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ xembed_message_send(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                       int /*<<< orphan*/, int,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       int /*<<< orphan*/);
void xembed_window_activate(xcb_connection_t *c, xcb_window_t client,
                            xcb_timestamp_t timestamp) {
  xembed_message_send(c, client, timestamp, 1, 0, 0, 0);
}


x86 assembly (clang, -O0):
<xembed_window_activate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x1,%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
call   1030 <xembed_message_send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xembed_window_activate>:
push   %rax
movl   $0x0,(%rsp)
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <xembed_message_send@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @xembed_window_activate(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @xembed_message_send(i32* %0, i32 %1, i32 %2, i32 1, i32 0, i32 0, i32 0)
ret void
}
int f1() {
  int a = -42;
  int b = -35;
  if (a = b)
    return a;
  return 1;
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffd6,-0x8(%rbp)
movl   $0xffffffdd,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     112c <f1+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <f1+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f1() {
ret i32 -35
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int icompare(void *e1, void *e2) {
  uint64_t *i1 = e1;
  uint64_t *i2 = e2;
  return ((*i1 >= *i2) - (*i2 >= *i1));
}


x86 assembly (clang, -O0):
<icompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
mov    -0x18(%rbp),%rdx
cmp    (%rdx),%rcx
setge  %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<icompare>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setge  %al
setle  %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @icompare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = icmp sge i64 %12, %14
%16 = zext i1 %15 to i32
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
%19 = load i64*, i64** %5
%20 = load i64, i64* %19
%21 = icmp sge i64 %18, %20
%22 = zext i1 %21 to i32
%23 = sub nsw i32 %16, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @icompare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sge i64 %5, %6
%8 = zext i1 %7 to i32
%9 = icmp sge i64 %6, %5
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int test_imm_89uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x89 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_89uint64_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, 137
%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_89uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 588410519552
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void eapol_sm_step(struct eapol_sm *sm) {}


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

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

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

LLVM IR (-O2):
%struct.eapol_sm = type opaque
define void @eapol_sm_step(%struct.eapol_sm* nocapture %0) {
ret void
}
int has_SSE(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @has_SSE() {
ret i32 0
}

LLVM IR (-O2):
define i32 @has_SSE() {
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int compare_names(const void *a, const void *b) {
  char **str_a = (char **)a;
  char **str_b = (char **)b;
  return strcmp(*str_a, *str_b);
}


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

x86 assembly (clang, -O2):
<compare_names>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare_names(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_names(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
struct dirent {
  char *d_name;
};

/* Variables and functions */
int select_files(struct dirent *dirbuf) {
  if (dirbuf->d_name[0] == '.')
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<select_files>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1127 <select_files+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <select_files+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_files>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmpb   $0x2e,(%rcx)
setne  %al
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i32 @select_files(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 46
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 0, i32* %2
br label %13
12: ; preds = %1
store i32 1, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i32 @select_files(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 46
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned int __VERIFIER_nondet_uint() {
  unsigned int val;
  return val;
}


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

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

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

LLVM IR (-O2):
define i32 @__VERIFIER_nondet_uint() {
ret i32 undef
}
/* Variables and functions */
unsigned char ButtonWaitForAnyPress(int /*<<< orphan*/);
void ButtonWaitForPress(unsigned char Button) {
  while ((ButtonWaitForAnyPress(0) & Button) == 0) {
  }
}


x86 assembly (clang, -O0):
<ButtonWaitForPress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
call   1030 <ButtonWaitForAnyPress@plt>
movzbl %al,%eax
movzbl -0x1(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    113c <ButtonWaitForPress+0x2c>
jmp    111e <ButtonWaitForPress+0xe>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ButtonWaitForPress>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
call   1030 <ButtonWaitForAnyPress@plt>
test   %bl,%al
je     1120 <ButtonWaitForPress+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @ButtonWaitForPress(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %10, %1
%4 = call zeroext i8 @ButtonWaitForAnyPress(i32 0)
%5 = zext i8 %4 to i32
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 %5, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ButtonWaitForPress(i8 zeroext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call zeroext i8 @ButtonWaitForAnyPress(i32 0)
%4 = and i8 %3, %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
ret void
}
/* Variables and functions */
void read_handler(void *rm_addr, size_t size) {}


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

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

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

LLVM IR (-O2):
define void @read_handler(i8* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ report_axes();
int /*<<< orphan*/ report_improper_axes();
int /*<<< orphan*/ report_inversion_centers();
int /*<<< orphan*/ report_planes();
void report_symmetry_elements_verbose(void) {
  report_inversion_centers();
  report_axes();
  report_improper_axes();
  report_planes();
}


x86 assembly (clang, -O0):
<report_symmetry_elements_verbose>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <report_inversion_centers@plt>
mov    $0x0,%al
call   1060 <report_axes@plt>
mov    $0x0,%al
call   1050 <report_improper_axes@plt>
mov    $0x0,%al
call   1040 <report_planes@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_symmetry_elements_verbose>:
push   %rax
xor    %eax,%eax
call   1030 <report_inversion_centers@plt>
xor    %eax,%eax
call   1060 <report_axes@plt>
xor    %eax,%eax
call   1050 <report_improper_axes@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <report_planes@plt>

LLVM IR (-O0):
define void @report_symmetry_elements_verbose() {
%1 = call i32 (...) @report_inversion_centers()
%2 = call i32 (...) @report_axes()
%3 = call i32 (...) @report_improper_axes()
%4 = call i32 (...) @report_planes()
ret void
}

LLVM IR (-O2):
define void @report_symmetry_elements_verbose() {
%1 = tail call i32 (...) @report_inversion_centers()
%2 = tail call i32 (...) @report_axes()
%3 = tail call i32 (...) @report_improper_axes()
%4 = tail call i32 (...) @report_planes()
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *gosh_realloc_size(void *ptr, size_t size) { return realloc(ptr, size); }


x86 assembly (clang, -O0):
<gosh_realloc_size>:
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 <realloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gosh_realloc_size>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @gosh_realloc_size(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* @realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @gosh_realloc_size(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Variables and functions */
scalar_t__ isPrime(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  printf("Enter a number: ");
  scanf("%d", &num);
  if (isPrime(num))
    printf("Prime number\n");
  else
    printf("Composite number\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <main+0x5a>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <isPrime@plt>
test   %rax,%rax
lea    0xea3(%rip),%rax
lea    0xead(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"Prime number\0A\00"
@.str.3 = [18 x i8] c"Composite number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i64 @isPrime(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [17 x i8] c"Composite number\00"
@str.4 = [13 x i8] c"Prime number\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @isPrime(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int max(int, int /*<<< orphan*/);
int /*<<< orphan*/ min(int, int);
int test_00(int a) { return max(-128, min(127, a)); }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x7f,%edi
call   1030 <min@plt>
mov    %eax,%esi
mov    $0xffffff80,%edi
call   1040 <max@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    %edi,%esi
mov    $0x7f,%edi
call   1030 <min@plt>
mov    $0xffffff80,%edi
mov    %eax,%esi
pop    %rax
jmp    1040 <max@plt>

LLVM IR (-O0):
define i32 @test_00(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @min(i32 127, i32 %3)
%5 = call i32 @max(i32 -128, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_00(i32 %0) {
%2 = tail call i32 @min(i32 127, i32 %0)
%3 = tail call i32 @max(i32 -128, i32 %2)
ret i32 %3
}
int simulated_nested_loop_more_expensive(int p) {
  int k = 0;
  int t = 5;
  int j = 0;
  for (int i = 0; i < 5; i++) {
  B:
    t = 3;
    j++;
    if (j < 100)
      goto B;
    else {
      j = 0;
    }
  }
  return k;
}


x86 assembly (clang, -O0):
<simulated_nested_loop_more_expensive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    116b <simulated_nested_loop_more_expensive+0x6b>
jmp    1132 <simulated_nested_loop_more_expensive+0x32>
movl   $0x3,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
jge    1151 <simulated_nested_loop_more_expensive+0x51>
jmp    1132 <simulated_nested_loop_more_expensive+0x32>
movl   $0x0,-0x10(%rbp)
jmp    115d <simulated_nested_loop_more_expensive+0x5d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <simulated_nested_loop_more_expensive+0x23>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @simulated_nested_loop_more_expensive(i32 %0) {
ret i32 0
}
void vm_class_is_assignable_from(void) {}


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

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

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

LLVM IR (-O2):
define void @vm_class_is_assignable_from() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void g(void *a, char *b) { abort(); }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<g>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @g(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @g(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void p1(char c) { printf("%c\n", c); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define void @p1(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int UINT_MAX;
unsigned int log(int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(void) {
  unsigned x = log(UINT_MAX) / log(2);
  printf("unsigned int has [%u] bits\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <log@plt>
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
xor    %edx,%edx
div    %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
lea    0xeb6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
@.str = [28 x i8] c"unsigned int has [%u] bits\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @UINT_MAX
%4 = call i32 @log(i32 %3)
%5 = call i32 @log(i32 2)
%6 = udiv i32 %4, %5
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
@.str = [28 x i8] c"unsigned int has [%u] bits\0A\00"
define i32 @main() {
%1 = load i32, i32* @UINT_MAX
%2 = tail call i32 @log(i32 %1)
%3 = tail call i32 @log(i32 2)
%4 = udiv i32 %2, %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void gdk_draw_glyphs() {}


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

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

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

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