xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(int argc, char *const argv[]) { foo(); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @foo()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int e_raise(int);
int __attribute__((section("libgloss_epiphany"))) _kill(pid_t pid, int sig) {
  return e_raise(sig);
}


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

x86 assembly (clang, -O2):
<_kill>:
mov    %esi,%edi
jmp    1030 <e_raise@plt>

LLVM IR (-O0):
define i32 @_kill(i32 %0, i32 %1) section "libgloss_epiphany" {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @e_raise(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @_kill(i32 %0, i32 %1) section "libgloss_epiphany" {
%3 = tail call i32 @e_raise(i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void memory_prepare_filename(
    char filename[(sizeof("/tmp/") + sizeof("XXXXXX"))]) {
  strcpy(filename, "/tmp/");
  strcat(filename, "XXXXXX");
}


x86 assembly (clang, -O0):
<memory_prepare_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memory_prepare_filename>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"/tmp/\00"
@.str.1 = [7 x i8] c"XXXXXX\00"
define void @memory_prepare_filename(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strcpy(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"/tmp/\00"
@.str.1 = [7 x i8] c"XXXXXX\00"
define void @memory_prepare_filename(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int xconfigIsUpper(char c) { return ((c >= 'A') && (c <= 'Z')); }


x86 assembly (clang, -O0):
<xconfigIsUpper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <xconfigIsUpper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xconfigIsUpper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xconfigIsUpper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
unsigned long __ffs(unsigned long);
unsigned long ffz(unsigned long x) { return __ffs(~(x)); }


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

x86 assembly (clang, -O2):
<ffz>:
not    %rdi
jmp    1030 <__ffs@plt>

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

LLVM IR (-O2):
define i64 @ffz(i64 %0) {
%2 = xor i64 %0, -1
%3 = tail call i64 @__ffs(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ error_handler(char *);
void get_string_data(const char *file, const char *name, char *data) {
  int ncid, varid, status;
  char msg[512];
  error_handler("read_mosaic: Add flag -Duse_netCDF when compiling");
}


x86 assembly (clang, -O0):
<get_string_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <error_handler@plt>
add    $0x230,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [50 x i8] c"read_mosaic: Add flag -Duse_netCDF when compiling\00"
define void @get_string_data(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [512 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%11 = call i32 @error_handler(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"read_mosaic: Add flag -Duse_netCDF when compiling\00"
define void @get_string_data(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @error_handler(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
ret void
}
char *s_test() { return "test"; }


x86 assembly (clang, -O0):
<s_test>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_test>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
define i8* @s_test() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
define i8* @s_test() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int programshutdown() { exit(1); }


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

x86 assembly (clang, -O2):
<programshutdown>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @programshutdown() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define i32 @programshutdown() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
int execute_munlockall() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_munlockall() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void tp_print_param_char_ptr(char *name, char *value) {
  printf("\tchar *%s = \"%s\";\n", name, value);
}


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

x86 assembly (clang, -O2):
<tp_print_param_char_ptr>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\09char *%s = \22%s\22;\0A\00"
define void @tp_print_param_char_ptr(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 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"\09char *%s = \22%s\22;\0A\00"
define void @tp_print_param_char_ptr(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ *f();
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
int main() {
  pthread_mutex_t *l1 = f();
  pthread_mutex_t *l2 = f();
  pthread_mutex_lock(l1);
  pthread_mutex_lock(l2);
  pthread_mutex_unlock(l2);
  pthread_mutex_unlock(l1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    -0x18(%rbp),%rdi
call   1050 <pthread_mutex_lock@plt>
mov    -0x18(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pthread_mutex_unlock@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <f@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %rbx,%rdi
call   1050 <pthread_mutex_lock@plt>
mov    %rbx,%rdi
call   1040 <pthread_mutex_unlock@plt>
mov    %r14,%rdi
call   1040 <pthread_mutex_unlock@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* (...) @f()
store i32* %4, i32** %2
%5 = call i32* (...) @f()
store i32* %5, i32** %3
%6 = load i32*, i32** %2
%7 = call i32 @pthread_mutex_lock(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @pthread_mutex_lock(i32* %8)
%10 = load i32*, i32** %3
%11 = call i32 @pthread_mutex_unlock(i32* %10)
%12 = load i32*, i32** %2
%13 = call i32 @pthread_mutex_unlock(i32* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @f()
%2 = tail call i32* (...) @f()
%3 = tail call i32 @pthread_mutex_lock(i32* %1)
%4 = tail call i32 @pthread_mutex_lock(i32* %2)
%5 = tail call i32 @pthread_mutex_unlock(i32* %2)
%6 = tail call i32 @pthread_mutex_unlock(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close_files();
int /*<<< orphan*/ join_files();
int /*<<< orphan*/ open_files();
int /*<<< orphan*/ prv_generate();
void mintaka_merge() {
  open_files();
  join_files();
  prv_generate();
  close_files();
}


x86 assembly (clang, -O0):
<mintaka_merge>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <open_files@plt>
mov    $0x0,%al
call   1030 <join_files@plt>
mov    $0x0,%al
call   1050 <prv_generate@plt>
mov    $0x0,%al
call   1060 <close_files@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mintaka_merge>:
push   %rax
xor    %eax,%eax
call   1040 <open_files@plt>
xor    %eax,%eax
call   1030 <join_files@plt>
xor    %eax,%eax
call   1050 <prv_generate@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <close_files@plt>

LLVM IR (-O0):
define void @mintaka_merge() {
%1 = call i32 (...) @open_files()
%2 = call i32 (...) @join_files()
%3 = call i32 (...) @prv_generate()
%4 = call i32 (...) @close_files()
ret void
}

LLVM IR (-O2):
define void @mintaka_merge() {
%1 = tail call i32 (...) @open_files()
%2 = tail call i32 (...) @join_files()
%3 = tail call i32 (...) @prv_generate()
%4 = tail call i32 (...) @close_files()
ret void
}
void gtk_vpaned_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vpaned_new() {
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
int rheight(int max) {
  int h = 1;
  while (h < max && rand() < RAND_MAX / 2)
    ++h;
  return h;
}


x86 assembly (clang, -O0):
<rheight>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
xor    %eax,%eax
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
jge    115b <rheight+0x4b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x10(%rbp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    116b <rheight+0x5b>
jmp    1179 <rheight+0x69>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <rheight+0x12>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rheight>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     1150 <rheight+0x40>
mov    %edi,%ebp
mov    $0x1,%ebx
mov    0x2ebc(%rip),%r14
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    (%r14),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
cmp    %edx,%eax
jge    1150 <rheight+0x40>
add    $0x1,%ebx
cmp    %ebx,%ebp
jne    1130 <rheight+0x20>
mov    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define i32 @rheight(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %15, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 (...) @rand()
%10 = load i32, i32* @RAND_MAX
%11 = sdiv i32 %10, 2
%12 = icmp slt i32 %9, %11
br label %13
13: ; preds = %8, %4
%14 = phi i1 [ false, %4 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %4
18: ; preds = %13
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rheight(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %12
3: ; preds = %1, %9
%4 = phi i32 [ %10, %9 ], [ 1, %1 ]
%5 = tail call i32 (...) @rand()
%6 = load i32, i32* @RAND_MAX
%7 = sdiv i32 %6, 2
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, %0
br i1 %11, label %12, label %3
12: ; preds = %3, %9, %1
%13 = phi i32 [ 1, %1 ], [ %0, %9 ], [ %4, %3 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void exit(int status) {
  fflush(stdout);
  fflush(stderr);
  _exit(status);
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exit>:
push   %rbx
mov    %edi,%ebx
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* %2
%8 = call i32 @_exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
define void @exit(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 @_exit(i32 %0)
unreachable
}
int s39ain_init(void) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @s39ain_init() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ g(int, int, int *);
void f(int x, int *y) {
  int y1;
  if (x > 0) {
    f(x - 1, &y1);
    g(x - 1, y1, y);
  } else
    *y = 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    115f <f+0x3f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
lea    -0x14(%rbp),%rsi
call   1030 <f@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1040 <g@plt>
jmp    1169 <f+0x49>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
test   %edi,%edi
jle    114b <f+0x2b>
mov    %edi,%ebp
add    $0xffffffff,%ebp
lea    0x4(%rsp),%rsi
mov    %ebp,%edi
call   1030 <f@plt>
mov    0x4(%rsp),%esi
mov    %ebp,%edi
mov    %rbx,%rdx
call   1040 <g@plt>
jmp    1151 <f+0x31>
movl   $0x1,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @f(i32 %0, i32* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = add nsw i32 %0, -1
%8 = load i32, i32* %3
%9 = call i32 @g(i32 %7, i32 %8, i32* %1)
br label %11
10: ; preds = %2
store i32 1, i32* %1
br label %11
11: ; preds = %10, %6
ret void
}
/* Type definitions */
typedef int wint_t;
typedef int /*<<< orphan*/ locale_t;

/* Variables and functions */
wint_t btowc_l(int x, locale_t loc) { return x; }


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

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

LLVM IR (-O0):
define i32 @btowc_l(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @btowc_l(i32 returned %0, i32 %1) {
ret i32 %0
}
void do_page_fault(void *x) {}


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

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

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

LLVM IR (-O2):
define void @do_page_fault(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ fread(char *, int, int, int /*<<< orphan*/ *);
unsigned int *malloc(int);
unsigned int *get_chars_frequency(FILE *fp) {
  unsigned int *ascii = malloc(128 * sizeof(int));
  char c;
  while (fread(&c, 1, 1, fp))
    ascii[(int)c]++;
  return ascii;
}


x86 assembly (clang, -O0):
<get_chars_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x200,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x11(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fread@plt>
cmp    $0x0,%rax
je     1171 <get_chars_frequency+0x51>
mov    -0x10(%rbp),%rax
movsbl -0x11(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
jmp    113a <get_chars_frequency+0x1a>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_chars_frequency>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
mov    $0x200,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xf(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
test   %rax,%rax
je     1184 <get_chars_frequency+0x64>
lea    0xf(%rsp),%r15
nopw   0x0(%rax,%rax,1)
movsbq 0xf(%rsp),%rax
addl   $0x1,(%rbx,%rax,4)
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
test   %rax,%rax
jne    1160 <get_chars_frequency+0x40>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @get_chars_frequency(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %2
%5 = call i32* @malloc(i32 512)
store i32* %5, i32** %3
br label %6
6: ; preds = %10, %1
%7 = load i32*, i32** %2
%8 = call i64 @fread(i8* %4, i32 1, i32 1, i32* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
%16 = load i32, i32* %15
%17 = add i32 %16, 1
store i32 %17, i32* %15
br label %6
18: ; preds = %6
%19 = load i32*, i32** %3
ret i32* %19
}

LLVM IR (-O2):
define noalias i32* @get_chars_frequency(i32* nocapture %0) {
%2 = alloca i8
%3 = tail call i32* @malloc(i32 512)
%4 = call i64 @fread(i8* %2, i32 1, i32 1, i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %6
%7 = load i8, i8* %2
%8 = sext i8 %7 to i64
%9 = getelementptr inbounds i32, i32* %3, i64 %8
%10 = load i32, i32* %9
%11 = add i32 %10, 1
store i32 %11, i32* %9
%12 = call i64 @fread(i8* %2, i32 1, i32 1, i32* %0)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %1
ret i32* %3
}
/* Variables and functions */
scalar_t__ is_slm(unsigned int, unsigned int);
scalar_t__ is_snb(unsigned int, unsigned int);
double slm_bclk();
double discover_bclk(unsigned int family, unsigned int model) {
  if (is_snb(family, model))
    return 100.00;
  else if (is_slm(family, model))
    return slm_bclk();
  else
    return 133.33;
}


x86 assembly (clang, -O0):
<discover_bclk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <is_snb@plt>
cmp    $0x0,%rax
je     1165 <discover_bclk+0x35>
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1198 <discover_bclk+0x68>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <is_slm@plt>
cmp    $0x0,%rax
je     118b <discover_bclk+0x5b>
mov    $0x0,%al
call   1040 <slm_bclk@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    1198 <discover_bclk+0x68>
movsd  0xe6d(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<discover_bclk>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1050 <is_snb@plt>
test   %rax,%rax
je     1150 <discover_bclk+0x20>
movsd  0xeb7(%rip),%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <is_slm@plt>
test   %rax,%rax
je     116b <discover_bclk+0x3b>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <slm_bclk@plt>
movsd  0xe95(%rip),%xmm0
jmp    1149 <discover_bclk+0x19>

LLVM IR (-O0):
define double @discover_bclk(i32 %0, i32 %1) {
%3 = alloca double
%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 = call i64 @is_snb(i32 %6, i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store double 1.000000e+02, double* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i64 @is_slm(i32 %12, i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call double (...) @slm_bclk()
store double %17, double* %3
br label %19
18: ; preds = %11
store double 1.333300e+02, double* %3
br label %19
19: ; preds = %18, %16, %10
%20 = load double, double* %3
ret double %20
}

LLVM IR (-O2):
define double @discover_bclk(i32 %0, i32 %1) {
%3 = tail call i64 @is_snb(i32 %0, i32 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i64 @is_slm(i32 %0, i32 %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call double (...) @slm_bclk()
br label %10
10: ; preds = %5, %2, %8
%11 = phi double [ %9, %8 ], [ 1.000000e+02, %2 ], [ 1.333300e+02, %5 ]
ret double %11
}
long long bit56() { return 0x0100000000000000LL; }


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

x86 assembly (clang, -O2):
<bit56>:
movabs $0x100000000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit56() {
ret i64 72057594037927936
}

LLVM IR (-O2):
define i64 @bit56() {
ret i64 72057594037927936
}
__typeof__(sprintf(1, 1, (void *)1)) test_sprintf_251(void) {
  return sprintf(1, 1, (void *)1);
}


x86 assembly (clang, -O0):
<test_sprintf_251>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sprintf_251>:
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
define i32 @test_sprintf_251() {
%1 = call i32 (i8*, i8*, ...) @sprintf(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_sprintf_251() {
%1 = tail call i32 (i8*, i8*, ...) @sprintf(i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
void swap(int *a, int *b) {
  int t = *b;
  *b = *a;
  *a = t;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
store i32 %3, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isspace(int);
int bow_not_isspace(int character) { return (!isspace(character)); }


x86 assembly (clang, -O0):
<bow_not_isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bow_not_isspace>:
push   %rax
call   1030 <isspace@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bow_not_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @isspace(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @bow_not_isspace(i32 %0) {
%2 = tail call i32 @isspace(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void pci_init_board(void) {}


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

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

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

LLVM IR (-O2):
define void @pci_init_board() {
ret void
}
void I2CGlobalWakeUpDisable(unsigned int baseAdd) {
  (*((volatile unsigned int *)(baseAdd + (0x10)))) &= ~(0x00000004u);
}


x86 assembly (clang, -O0):
<I2CGlobalWakeUpDisable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffffb,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CGlobalWakeUpDisable>:
add    $0x10,%edi
andl   $0xfffffffb,(%rdi)
ret

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

LLVM IR (-O2):
define void @I2CGlobalWakeUpDisable(i32 %0) {
%2 = add i32 %0, 16
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, -5
store volatile i32 %6, i32* %4
ret void
}
void gc_addref(void *obj) { (void)obj; }


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

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

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

LLVM IR (-O2):
define void @gc_addref(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show() { printf("Standard Object by gashero\n"); }


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Standard Object by gashero\0A\00"
define void @show() {
%1 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [27 x i8] c"Standard Object by gashero\00"
define void @show() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret void
}
float fminf(float x, float y) { return (x < y) ? x : y; }


x86 assembly (clang, -O0):
<fminf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <fminf+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <fminf+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminf>:
minss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fminf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
ret float %13
}

LLVM IR (-O2):
define float @fminf(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version() {
  printf("check_mutti version X, Copyright 2009, Mark A. Meyer\n");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"check_mutti version X, Copyright 2009, Mark A. Meyer\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [53 x i8] c"check_mutti version X, Copyright 2009, Mark A. Meyer\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret void
}
void dbg_dump_index(struct ubifs_info *c) { return; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define void @dbg_dump_index(%struct.ubifs_info* nocapture %0) {
ret void
}
int main() {
  int d = 0;
  for (d = 0;;) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    1119 <main+0x19>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %2
br label %3
3: ; preds = %3, %0
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int getpid();
int /*<<< orphan*/ printf(char *, scalar_t__);
int /*<<< orphan*/ sleep(int);
scalar_t__ wait(int /*<<< orphan*/ *);
int main(void) {
  pid_t pc, pr;
  int ps = fork();
  if (0 == pc) {
    printf("This is child process with pid of %d\n", getpid());
    sleep(10);
  } else if (pc > 0) {
    pr = wait(NULL);
    printf("I catched a child process with pid of %d\n", pr);
  }
  exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <fork@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    11aa <main+0x4a>
mov    $0x0,%al
call   1030 <getpid@plt>
movslq %eax,%rsi
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
jmp    11d7 <main+0x77>
cmpq   $0x0,-0x10(%rbp)
jle    11d2 <main+0x72>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <wait@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
jmp    11d7 <main+0x77>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O0):
@.str = [38 x i8] c"This is child process with pid of %d\0A\00"
@.str.1 = [42 x i8] c"I catched a child process with pid of %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @fork()
store i32 %5, i32* %4
%6 = load i64, i64* %2
%7 = icmp eq i64 0, %6
br i1 %7, label %8, label %13
8: ; preds = %0
%9 = call i32 (...) @getpid()
%10 = sext i32 %9 to i64
%11 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = call i32 @sleep(i32 10)
br label %21
13: ; preds = %0
%14 = load i64, i64* %2
%15 = icmp sgt i64 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = call i64 @wait(i32* null)
store i64 %17, i64* %3
%18 = load i64, i64* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i64 %18)
br label %20
20: ; preds = %16, %13
br label %21
21: ; preds = %20, %8
%22 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ktswitch();
int do_switch() { ktswitch(); }


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

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

LLVM IR (-O0):
define i32 @do_switch() {
%1 = alloca i32
%2 = call i32 (...) @ktswitch()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @do_switch() {
%1 = tail call i32 (...) @ktswitch()
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vpicx_set_progressive(uint8_t *p_mp2vpicx) { p_mp2vpicx[8] |= 0x80; }


x86 assembly (clang, -O0):
<mp2vpicx_set_progressive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%ecx
or     $0x80,%ecx
mov    %ecx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_set_progressive>:
orb    $0x80,0x20(%rdi)
ret

LLVM IR (-O0):
define void @mp2vpicx_set_progressive(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 8
%5 = load i32, i32* %4
%6 = or i32 %5, 128
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mp2vpicx_set_progressive(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 8
%3 = load i32, i32* %2
%4 = or i32 %3, 128
store i32 %4, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ eeprom_update_dword(int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
void eeconfig_update_kb(uint32_t val) {
  eeprom_update_dword((uint32_t *)15, val);
}


x86 assembly (clang, -O0):
<eeconfig_update_kb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0xf,%edi
call   1030 <eeprom_update_dword@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eeconfig_update_kb>:
mov    %edi,%esi
mov    $0xf,%edi
jmp    1030 <eeprom_update_dword@plt>

LLVM IR (-O0):
define void @eeconfig_update_kb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @eeprom_update_dword(i32* inttoptr (i64 15 to i32*), i32 %3)
ret void
}

LLVM IR (-O2):
define void @eeconfig_update_kb(i32 %0) {
%2 = tail call i32 @eeprom_update_dword(i32* inttoptr (i64 15 to i32*), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: man -[antfkq] [-M path] [-s section] title ...\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"Usage: man -[antfkq] [-M path] [-s section] title ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"Usage: man -[antfkq] [-M path] [-s section] title ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
double __ieee754_asin(double);
double asin(double x) { return __ieee754_asin(x); }


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

x86 assembly (clang, -O2):
<asin>:
jmp    1030 <__ieee754_asin@plt>

LLVM IR (-O0):
define double @asin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__ieee754_asin(double %3)
ret double %4
}

LLVM IR (-O2):
define double @asin(double %0) {
%2 = tail call double @__ieee754_asin(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ bmouse();
int /*<<< orphan*/ pushNumber(int /*<<< orphan*/);
void basBMouse() { pushNumber(bmouse()); }


x86 assembly (clang, -O0):
<basBMouse>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bmouse@plt>
mov    %eax,%edi
call   1040 <pushNumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<basBMouse>:
push   %rax
xor    %eax,%eax
call   1030 <bmouse@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <pushNumber@plt>

LLVM IR (-O0):
define void @basBMouse() {
%1 = call i32 (...) @bmouse()
%2 = call i32 @pushNumber(i32 %1)
ret void
}

LLVM IR (-O2):
define void @basBMouse() {
%1 = tail call i32 (...) @bmouse()
%2 = tail call i32 @pushNumber(i32 %1)
ret void
}
int f() { return 3; }


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

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

LLVM IR (-O0):
define i32 @f() {
ret i32 3
}

LLVM IR (-O2):
define i32 @f() {
ret i32 3
}
void XXX() {}


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

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

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

LLVM IR (-O2):
define void @XXX() {
ret void
}
char *hash_plugin_detailed(void) {
  return ("mysql5 - MySQL 4.1 and above plugin\n"
          "------------------------\n"
          "Use this module to crack newer mysql  password hashes\n"
          "Input should be in form: \'user:hash\' or just \'hash\'.\n"
          "Known software that uses this password hashing method:\n"
          "MySQL > 4.1\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [281 x i8] c"mysql5 - MySQL 4.1 and above plugin\0A------------------------\0AUse this module to crack newer mysql password hashes\0AInput should be in form: 'user:hash' or just 'hash'.\0AKnown software that uses this password hashing method:\0AMySQL > 4.1\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([281 x i8], [281 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [281 x i8] c"mysql5 - MySQL 4.1 and above plugin\0A------------------------\0AUse this module to crack newer mysql password hashes\0AInput should be in form: 'user:hash' or just 'hash'.\0AKnown software that uses this password hashing method:\0AMySQL > 4.1\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([281 x i8], [281 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void *writer(void *arg) {
  int i = 0;
  while (1) {
    printf("inserting node at %d", i);
    i++;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<writer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1123 <writer+0x13>

x86 assembly (clang, -O2):
<writer>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
jmp    1120 <writer+0x10>

LLVM IR (-O0):
@.str = [21 x i8] c"inserting node at %d\00"
define i8* @writer(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %1, %4
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 1
store i32 %8, i32* %3
br label %4
}

LLVM IR (-O2):
@.str = [21 x i8] c"inserting node at %d\00"
define noalias i8* @writer(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nuw nsw i32 %3, 1
br label %2
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_NAME_it;
int i2d_X509_NAME(X509_NAME *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_NAME_it);
}


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

x86 assembly (clang, -O2):
<i2d_X509_NAME>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@X509_NAME_it = global i32 0
define i32 @i2d_X509_NAME(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @X509_NAME_it)
ret i32 %3
}