xunge/DecIR huggingface dataset:
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
int xread(int, void *, int);
ssize_t xaread(int fd, void *buf, size_t count) {
  int nread, remain;
  for (remain = count; remain; remain -= nread)
    buf += (nread = xread(fd, buf, remain));
  return count;
}


x86 assembly (clang, -O0):
<xaread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1166 <xaread+0x56>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
call   1030 <xread@plt>
mov    %eax,%ecx
mov    %ecx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
jmp    112a <xaread+0x1a>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xaread>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
test   %r14d,%r14d
je     1146 <xaread+0x36>
mov    %rsi,%rbx
mov    %edi,%r15d
mov    %r14d,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1030 <xread@plt>
cltq
add    %rax,%rbx
sub    %eax,%ebp
jne    1130 <xaread+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @xaread(i32 %0, i8* %1, i64 returned %2) {
%4 = trunc i64 %2 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i32 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %1, %3 ]
%9 = tail call i32 @xread(i32 %0, i8* %8, i32 %7)
%10 = sext i32 %9 to i64
%11 = getelementptr i8, i8* %8, i64 %10
%12 = sub nsw i32 %7, %9
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3
ret i64 %2
}
void SkipToNextLine(char **p) {
  while ((**p) && (**p != 0x0a))
    (*p)++;
  if (**p == 0x0a)
    (*p)++;
}


x86 assembly (clang, -O0):
<SkipToNextLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1133 <SkipToNextLine+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <SkipToNextLine+0x43>
jmp    1156 <SkipToNextLine+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <SkipToNextLine+0x8>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1177 <SkipToNextLine+0x77>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipToNextLine>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
test   %cl,%cl
je     1129 <SkipToNextLine+0x29>
cmp    $0xa,%cl
je     1126 <SkipToNextLine+0x26>
mov    %rax,(%rdi)
jmp    1110 <SkipToNextLine+0x10>
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @SkipToNextLine(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 10, label %8
i8 0, label %10
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %9, i8** %0
br label %10
10: ; preds = %3, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int func(char *, int /*<<< orphan*/);
int main() {
  if (func("1234", 0) == 4)
    exit(0);
  exit(-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
xor    %esi,%esi
call   1030 <func@plt>
cmp    $0x4,%eax
jne    114d <main+0x2d>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1030 <func@plt>
cmp    $0x4,%eax
jne    113b <main+0x1b>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"1234\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @func(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%3 = icmp eq i32 %2, 4
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 0)
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"1234\00"
define i32 @main() {
%1 = tail call i32 @func(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = icmp eq i32 %1, 4
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 -1)
unreachable
}
void sig_alrm(int signo) {}


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

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

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

LLVM IR (-O2):
define void @sig_alrm(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ vswscanf(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/);
void uninivar_vswscanf(void) {
  wchar_t *s;
  wchar_t *format;
  va_list arg;
  (void)vswscanf(s, format, arg);
}


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

x86 assembly (clang, -O2):
<uninivar_vswscanf>:
jmp    1030 <vswscanf@plt>

LLVM IR (-O0):
define void @uninivar_vswscanf() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = load i32*, i32** %1
%5 = load i32*, i32** %2
%6 = load i32, i32* %3
%7 = call i32 @vswscanf(i32* %4, i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @uninivar_vswscanf() {
%1 = tail call i32 @vswscanf(i32* undef, i32* undef, i32 undef)
ret void
}
void redcine_load_raw() {}


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

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

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

LLVM IR (-O2):
define void @redcine_load_raw() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SyncChr();
int /*<<< orphan*/ SyncPrg();
void StateRestore(int version) {
  SyncPrg();
  SyncChr();
}


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

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

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

LLVM IR (-O2):
define void @StateRestore(i32 %0) {
%2 = tail call i32 (...) @SyncPrg()
%3 = tail call i32 (...) @SyncChr()
ret void
}
/* Variables and functions */
char *Realtime_GetServerCookie();
int /*<<< orphan*/ sprintf(char *, char *, char const *, char *);
const char *address_search_prepare_report(const char *user_input) {
  static char s_user_input[1024];
  sprintf(s_user_input, "user_input=%s&server_cookie=%s", user_input,
          Realtime_GetServerCookie());
  return s_user_input;
}


x86 assembly (clang, -O0):
<address_search_prepare_report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Realtime_GetServerCookie@plt>
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0x2ef7(%rip),%rdi
lea    0xeb0(%rip),%rsi
call   1040 <sprintf@plt>
lea    0x2ee4(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<address_search_prepare_report>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <Realtime_GetServerCookie@plt>
lea    0x2f0b(%rip),%r14
lea    0xec4(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@address_search_prepare_report.s_user_input = internal global [1024 x i8] zeroinitializer
@.str = [31 x i8] c"user_input=%s&server_cookie=%s\00"
define i8* @address_search_prepare_report(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* (...) @Realtime_GetServerCookie()
%5 = call i32 @sprintf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @address_search_prepare_report.s_user_input, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @address_search_prepare_report.s_user_input, i64 0, i64 0)
}

LLVM IR (-O2):
@address_search_prepare_report.s_user_input = internal global [1024 x i8] zeroinitializer
@.str = [31 x i8] c"user_input=%s&server_cookie=%s\00"
define i8* @address_search_prepare_report(i8* %0) {
%2 = tail call i8* (...) @Realtime_GetServerCookie()
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([1024 x i8], [1024 x i8]* @address_search_prepare_report.s_user_input, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %2)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @address_search_prepare_report.s_user_input, i64 0, i64 0)
}
/* Variables and functions */
int status(char *);
int main(int argc, char **argv) { return status("/dev/usb/hiddev0"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"/dev/usb/hiddev0\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @status(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 %6
}

LLVM IR (-O2):
@.str = [17 x i8] c"/dev/usb/hiddev0\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @status(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int compare_sort(void const *, void const *);
int compare_sort_inverse(const void *p1, const void *p2) {
  return -compare_sort(p1, p2);
}


x86 assembly (clang, -O0):
<compare_sort_inverse>:
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 <compare_sort@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_sort_inverse>:
push   %rax
call   1030 <compare_sort@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @compare_sort_inverse(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 @compare_sort(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @compare_sort_inverse(i8* %0, i8* %1) {
%3 = tail call i32 @compare_sort(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ handle_bootstrap_requests();
int main() { handle_bootstrap_requests(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @handle_bootstrap_requests()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_string(const char *s) { printf("%s", s); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double __infer_nondet_double();
double trunc(double x) { return __infer_nondet_double(); }


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

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

LLVM IR (-O0):
define double @trunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call double (...) @__infer_nondet_double()
ret double %3
}

LLVM IR (-O2):
define double @trunc(double %0) {
%2 = tail call double (...) @__infer_nondet_double()
ret double %2
}
__attribute__((stdcall)) int __attribute__((stdcall))
some_stdcall_func(int foo, int bar, int baz) {
  return 43;
}


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

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

LLVM IR (-O0):
define i32 @some_stdcall_func(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
ret i32 43
}

LLVM IR (-O2):
define i32 @some_stdcall_func(i32 %0, i32 %1, i32 %2) {
ret i32 43
}
void testIndexTooBig64() {
  char arr[(~0ul) / 8 - 1];
  char *ptr = arr + ((~0ul) / 16);
  ptr += 2;
  *ptr = 42;
}


x86 assembly (clang, -O0):
<testIndexTooBig64>:
push   %rbp
mov    %rsp,%rbp
movabs $0x1fffffffffffff90,%rax
ff ff 1f
sub    %rax,%rsp
mov    %rbp,%rax
movabs $0xfffffffffffffff,%rcx
ff ff 0f
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x2a,(%rax)
push   %rax
movabs $0x1fffffffffffff98,%rax
ff ff 1f
add    %rsp,%rax
xchg   %rax,(%rsp)
mov    (%rsp),%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @testIndexTooBig64() {
%1 = alloca [2305843009213693950 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [2305843009213693950 x i8], [2305843009213693950 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds i8, i8* %3, i64 1152921504606846975
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
store i8* %6, i8** %2
%7 = load i8*, i8** %2
store i8 42, i8* %7
ret void
}

LLVM IR (-O2):
define void @testIndexTooBig64() {
ret void
}
void _assert(void *expr, void *filename, unsigned lineno) {
  printf("Assertion failed: %s, file %s, line %d\n", expr, filename, lineno);
  exit(3);
}


x86 assembly (clang, -O0):
<_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_assert>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Assertion failed: %s, file %s, line %d\0A\00"
define void @_assert(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i32 %9)
unreachable
}

LLVM IR (-O2):
@.str = [40 x i8] c"Assertion failed: %s, file %s, line %d\0A\00"
define void @_assert(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %2)
tail call void @exit(i32 3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
int iintor(int x, int y) {
  x |= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<iintor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     $0x18,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113a <iintor+0x2a>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iintor>:
mov    %edi,%eax
or     $0x18,%eax
ret

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

LLVM IR (-O2):
define i32 @iintor(i32 %0, i32 %1) {
%3 = or i32 %0, 24
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int db_read(wchar_t *buffer, size_t max) {
  int ok = 0;
  return ok;
}


x86 assembly (clang, -O0):
<db_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @db_read(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sleep(int);
int g(int i1, int i2) {
  int sum = i1 + i2;
  printf("g: %i+%i=%i\n", i1, i2, sum);
  printf("sleeping for %i seconds...\n", sum);
  sleep(sum);
  return sum;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%edi
call   1040 <sleep@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %rbx
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%ebx
lea    0xed1(%rip),%rdi
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%edi
call   1040 <sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"g: %i+%i=%i\0A\00"
@.str.1 = [28 x i8] c"sleeping for %i seconds...\0A\00"
define i32 @g(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 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %5
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @sleep(i32 %15)
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@.str = [13 x i8] c"g: %i+%i=%i\0A\00"
@.str.1 = [28 x i8] c"sleeping for %i seconds...\0A\00"
define i32 @g(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
%5 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%6 = tail call i32 @sleep(i32 %3)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ several(scalar_t__);
bool onlyOne(uint64_t bb) { return bb && !several(bb); }


x86 assembly (clang, -O0):
<onlyOne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1140 <onlyOne+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <several@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<onlyOne>:
test   %rdi,%rdi
je     1129 <onlyOne+0x19>
push   %rax
call   1030 <several@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @onlyOne(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i64, i64* %2
%7 = call i32 @several(i64 %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br label %10
10: ; preds = %5, %1
%11 = phi i1 [ false, %1 ], [ %9, %5 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @onlyOne(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @several(i64 %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
struct slPair {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ slAddHead(struct slPair **, struct slPair *);
struct slPair *slPairNew(char *, void *);
void slPairAdd(struct slPair **pList, char *name, void *val) {
  struct slPair *el = slPairNew(name, val);
  slAddHead(pList, el);
}


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

x86 assembly (clang, -O2):
<slPairAdd>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1030 <slPairNew@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <slAddHead@plt>

LLVM IR (-O0):
%struct.slPair = type { i32 }
define void @slPairAdd(%struct.slPair** %0, i8* %1, i8* %2) {
%4 = alloca %struct.slPair**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.slPair*
store %struct.slPair** %0, %struct.slPair*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call %struct.slPair* @slPairNew(i8* %8, i8* %9)
store %struct.slPair* %10, %struct.slPair** %7
%11 = load %struct.slPair**, %struct.slPair*** %4
%12 = load %struct.slPair*, %struct.slPair** %7
%13 = call i32 @slAddHead(%struct.slPair** %11, %struct.slPair* %12)
ret void
}

LLVM IR (-O2):
%struct.slPair = type { i32 }
define void @slPairAdd(%struct.slPair** %0, i8* %1, i8* %2) {
%4 = tail call %struct.slPair* @slPairNew(i8* %1, i8* %2)
%5 = tail call i32 @slAddHead(%struct.slPair** %0, %struct.slPair* %4)
ret void
}
void pci_save_aspm_l1ss_state(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @pci_save_aspm_l1ss_state(%struct.pci_dev* nocapture %0) {
ret void
}
void hw_init() {}


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

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

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

LLVM IR (-O2):
define void @hw_init() {
ret void
}
/* Type definitions */
struct timeb {
  int time;
  scalar_t__ millitm;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
int FUZ_GetMilliStart(void) {
  struct timeb tb;
  int nCount;
  ftime(&tb);
  nCount = (int)(tb.millitm + (tb.time & 0xfffff) * 1000);
  return nCount;
}


x86 assembly (clang, -O0):
<FUZ_GetMilliStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <ftime@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
and    $0xfffff,%ecx
imul   $0x3e8,%ecx,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FUZ_GetMilliStart>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <ftime@plt>
mov    $0xfffff,%eax
and    0x8(%rsp),%eax
imul   $0x3e8,%eax,%eax
add    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeb = type { i32, i64 }
define i32 @FUZ_GetMilliStart() {
%1 = alloca %struct.timeb
%2 = alloca i32
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, 1048575
%9 = mul nsw i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = add nsw i64 %5, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.timeb = type { i32, i64 }
define i32 @FUZ_GetMilliStart() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = and i32 %7, 1048575
%9 = mul nuw nsw i32 %8, 1000
%10 = trunc i64 %5 to i32
%11 = add i32 %9, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void cacherMot() {
  int compteurLignes;
  for (compteurLignes = 0; compteurLignes < 100; compteurLignes++) {
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<cacherMot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1143 <cacherMot+0x33>
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <cacherMot+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cacherMot>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <cacherMot+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @cacherMot() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @putchar(i32 10)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_kill_sink_input() {
  printf("NOT IMPLEMENTED:"
         "pa_context_kill_sink_input"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [43 x i8] c"NOT IMPLEMENTED:pa_context_kill_sink_input\00"
define i32 @pa_context_kill_sink_input() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
short um() { return 0; }


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

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

LLVM IR (-O0):
define signext i16 @um() {
ret i16 0
}

LLVM IR (-O2):
define signext i16 @um() {
ret i16 0
}
/* Type definitions */
struct simple_stats_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ simple_stats_variance(struct simple_stats_s *, int);
double sqrt(int /*<<< orphan*/);
double simple_stats_std_dev(struct simple_stats_s *stats, int bessel_correct) {
  return sqrt(simple_stats_variance(stats, bessel_correct));
}


x86 assembly (clang, -O0):
<simple_stats_std_dev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <simple_stats_variance@plt>
mov    %eax,%edi
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_stats_std_dev>:
push   %rax
call   1030 <simple_stats_variance@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
%struct.simple_stats_s = type { i32 }
define double @simple_stats_std_dev(%struct.simple_stats_s* %0, i32 %1) {
%3 = alloca %struct.simple_stats_s*
%4 = alloca i32
store %struct.simple_stats_s* %0, %struct.simple_stats_s** %3
store i32 %1, i32* %4
%5 = load %struct.simple_stats_s*, %struct.simple_stats_s** %3
%6 = load i32, i32* %4
%7 = call i32 @simple_stats_variance(%struct.simple_stats_s* %5, i32 %6)
%8 = call double @sqrt(i32 %7)
ret double %8
}

LLVM IR (-O2):
%struct.simple_stats_s = type { i32 }
define double @simple_stats_std_dev(%struct.simple_stats_s* %0, i32 %1) {
%3 = tail call i32 @simple_stats_variance(%struct.simple_stats_s* %0, i32 %1)
%4 = tail call double @sqrt(i32 %3)
ret double %4
}
int *preorderTraversal(struct TreeNode *root, int *returnSize) {}


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

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

LLVM IR (-O0):
%struct.TreeNode = type opaque
define i32* @preorderTraversal(%struct.TreeNode* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca %struct.TreeNode*
%5 = alloca i32*
store %struct.TreeNode* %0, %struct.TreeNode** %4
store i32* %1, i32** %5
%6 = load i32*, i32** %3
ret i32* %6
}

LLVM IR (-O2):
%struct.TreeNode = type opaque
define noalias i32* @preorderTraversal(%struct.TreeNode* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32* undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void libc_fun() { printf("Hello from libc\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Hello from libc\0A\00"
define void @libc_fun() {
%1 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Hello from libc\00"
define void @libc_fun() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
int eat_space(char **message) {
  int result = 0;
  while (isspace(**message)) {
    result++;
    ++(*message);
  }
  return result;
}


x86 assembly (clang, -O0):
<eat_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1158 <eat_space+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1123 <eat_space+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eat_space>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     114b <eat_space+0x3b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1130 <eat_space+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @eat_space(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %8, %6 ], [ 0, %1 ]
%8 = add nuw nsw i32 %7, 1
%9 = load i8*, i8** %0
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8* %10, i8** %0
%11 = load i8, i8* %10
%12 = tail call i64 @isspace(i8 signext %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %1
%15 = phi i32 [ 0, %1 ], [ %8, %6 ]
ret i32 %15
}
/* Variables and functions */
size_t dummywc_mbtowc(int *, char const *, size_t);
size_t dummywc_mbrtowc(int *pwc, const char *s, size_t n, int *ps) {
  return dummywc_mbtowc(pwc, s, n);
}


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

x86 assembly (clang, -O2):
<dummywc_mbrtowc>:
jmp    1030 <dummywc_mbtowc@plt>

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

LLVM IR (-O2):
define i64 @dummywc_mbrtowc(i32* %0, i8* %1, i64 %2, i32* nocapture readnone %3) {
%5 = tail call i64 @dummywc_mbtowc(i32* %0, i8* %1, i64 %2)
ret i64 %5
}
int _WLocale_mb_cur_min(struct _Locale_codecvt *lcodecvt
                        __attribute__((__unused__))) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct._Locale_codecvt = type opaque
define i32 @_WLocale_mb_cur_min(%struct._Locale_codecvt* nocapture readnone %0) {
ret i32 1
}
int xxx(int n) {
  if (n % 2 == 0)
    return n / 2;
  else
    return (3 * n + 1) / 2;
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112e <xxx+0x2e>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    1140 <xxx+0x40>
imul   $0x3,-0x8(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxx>:
test   $0x1,%dil
lea    0x1(%rdi,%rdi,2),%ecx
cmove  %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @xxx(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = mul nsw i32 %0, 3
%5 = add nsw i32 %4, 1
%6 = select i1 %3, i32 %0, i32 %5
%7 = sdiv i32 %6, 2
ret i32 %7
}
int Cyc_NewControlFlow_hash_ptr(void *s) {
  void *_T0;
  int _T1;
  _T0 = s;
  _T1 = (int)_T0;
  return _T1;
}


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

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

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

LLVM IR (-O2):
define i32 @Cyc_NewControlFlow_hash_ptr(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
int f(int x, int y) {
  if (!x) {
    return y + 1;
  } else if (x && !y) {
    return f(x - 1, 1);
  } else {
    return f(x - 1, f(x, y - 1));
  }
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <f+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1186 <f+0x76>
cmpl   $0x0,-0x8(%rbp)
je     1162 <f+0x52>
cmpl   $0x0,-0xc(%rbp)
jne    1162 <f+0x52>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
jmp    1186 <f+0x76>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <f@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <f+0x2f>
mov    %edi,%ebx
jmp    112a <f+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <f+0x2f>
test   %eax,%eax
je     1120 <f+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <f@plt>
add    $0xffffffff,%ebx
jne    112a <f+0x1a>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f(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 = icmp ne i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %29
11: ; preds = %2
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
br i1 %16, label %21, label %17
17: ; preds = %14
%18 = load i32, i32* %4
%19 = sub nsw i32 %18, 1
%20 = call i32 @f(i32 %19, i32 1)
store i32 %20, i32* %3
br label %29
21: ; preds = %14, %11
%22 = load i32, i32* %4
%23 = sub nsw i32 %22, 1
%24 = load i32, i32* %4
%25 = load i32, i32* %5
%26 = sub nsw i32 %25, 1
%27 = call i32 @f(i32 %24, i32 %26)
%28 = call i32 @f(i32 %23, i32 %27)
store i32 %28, i32* %3
br label %29
29: ; preds = %21, %17, %8
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add nsw i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add nsw i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add nsw i32 %8, -1
%17 = tail call i32 @f(i32 %9, i32 %16)
br label %11
}
void DebugMemCheckStartPoint(void) {}


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

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

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

LLVM IR (-O2):
define void @DebugMemCheckStartPoint() {
ret void
}
void xy_to_upvp(double xc, double yc, double *up, double *vp) {
  *up = (4 * xc) / ((-2 * xc) + (12 * yc) + 3);
  *vp = (9 * yc) / ((-2 * xc) + (12 * yc) + 3);
}


x86 assembly (clang, -O0):
<xy_to_upvp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  0xefa(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xed8(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
movsd  0xebb(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  0xeb3(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xe99(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
addsd  %xmm2,%xmm2
subsd  %xmm2,%xmm1
movsd  0xe7c(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xy_to_upvp>:
movsd  0xef8(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xef4(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  %xmm0,%xmm0
subsd  %xmm0,%xmm3
addsd  0xee8(%rip),%xmm3
divsd  %xmm3,%xmm2
movsd  %xmm2,(%rdi)
mulsd  0xee0(%rip),%xmm1
divsd  %xmm3,%xmm1
movsd  %xmm1,(%rsi)
ret

LLVM IR (-O0):
define void @xy_to_upvp(double %0, double %1, double* %2, double* %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double*
%8 = alloca double*
store double %0, double* %5
store double %1, double* %6
store double* %2, double** %7
store double* %3, double** %8
%9 = load double, double* %5
%10 = fmul double 4.000000e+00, %9
%11 = load double, double* %5
%12 = load double, double* %6
%13 = fmul double 1.200000e+01, %12
%14 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %11, double %13)
%15 = fadd double %14, 3.000000e+00
%16 = fdiv double %10, %15
%17 = load double*, double** %7
store double %16, double* %17
%18 = load double, double* %6
%19 = fmul double 9.000000e+00, %18
%20 = load double, double* %5
%21 = load double, double* %6
%22 = fmul double 1.200000e+01, %21
%23 = call double @llvm.fmuladd.f64(double -2.000000e+00, double %20, double %22)
%24 = fadd double %23, 3.000000e+00
%25 = fdiv double %19, %24
%26 = load double*, double** %8
store double %25, double* %26
ret void
}

LLVM IR (-O2):
define void @xy_to_upvp(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = fmul double %0, 4.000000e+00
%6 = fmul double %1, 1.200000e+01
%7 = tail call double @llvm.fmuladd.f64(double %0, double -2.000000e+00, double %6)
%8 = fadd double %7, 3.000000e+00
%9 = fdiv double %5, %8
store double %9, double* %2
%10 = fmul double %1, 9.000000e+00
%11 = fdiv double %10, %8
store double %11, double* %3
ret void
}
/* Variables and functions */
double nearbyint(double);
double rint(double x) { return nearbyint(x); }


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

x86 assembly (clang, -O2):
<rint>:
jmp    1030 <nearbyint@plt>

LLVM IR (-O0):
define double @rint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.nearbyint.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @rint(double %0) {
%2 = tail call double @llvm.nearbyint.f64(double %0)
ret double %2
}