xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_11() {
  Assert_real((isqrt(11) == 3),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              60, ("Integer square root of 11 should be 3"));
}


x86 assembly (clang, -O0):
<t_sqrt_11>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
call   1030 <isqrt@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x3c,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_11>:
push   %rax
mov    $0xb,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x3c,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 11 should be 3\00"
define void @t_sqrt_11() {
%1 = call i32 @isqrt(i32 11)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 11 should be 3\00"
define void @t_sqrt_11() {
%1 = tail call i32 @isqrt(i32 11)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
char *dupstring(char *str) {
  int sz = strlen(str) + 1;
  char *new = malloc(sz);
  if (new)
    memcpy(new, str, sz);
  return new;
}


x86 assembly (clang, -O0):
<dupstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1172 <dupstring+0x42>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dupstring>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
mov    %eax,%ebp
add    $0x1,%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115d <dupstring+0x2d>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @dupstring(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void vec_dump32(const char *s, const uint32_t *vec, unsigned len) {
  ((void)s);
  ((void)vec);
  ((void)len);
}


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

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

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

LLVM IR (-O2):
define void @vec_dump32(i8* nocapture %0, i32* nocapture %1, i32 %2) {
ret void
}
void alc_wave_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @alc_wave_deinit() {
ret void
}
int compare_intPair(void *tar, void *src) {
  int *target, *source;
  target = (int *)tar;
  source = (int *)src;
  if (target[0] == source[0] && target[1] == source[1])
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compare_intPair>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    114e <compare_intPair+0x4e>
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    0x4(%rcx),%eax
jne    114e <compare_intPair+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <compare_intPair+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_intPair>:
mov    (%rdi),%eax
cmp    (%rsi),%eax
jne    1110 <compare_intPair+0x10>
mov    0x4(%rdi),%ecx
xor    %eax,%eax
cmp    0x4(%rsi),%ecx
je     1115 <compare_intPair+0x15>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_intPair(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp eq i32 %5, %6
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %0, i64 4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = getelementptr inbounds i8, i8* %1, i64 4
%13 = bitcast i8* %12 to i32*
%14 = load i32, i32* %13
%15 = icmp eq i32 %11, %14
br i1 %15, label %17, label %16
16: ; preds = %8, %2
br label %17
17: ; preds = %8, %16
%18 = phi i32 [ 1, %16 ], [ 0, %8 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ print_hex(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int main(void) {
  print_hex(strlen("hello world"));
  print_hex(strlen("a"));
  print_hex(strlen("test"));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <print_hex@plt>
lea    0xed1(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <print_hex@plt>
lea    0xec0(%rip),%rdi
call   1030 <strlen@plt>
mov    %eax,%edi
call   1040 <print_hex@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [5 x i8] c"test\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @print_hex(i32 %2)
%4 = call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @print_hex(i32 %4)
%6 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @print_hex(i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"hello world\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [5 x i8] c"test\00"
define i32 @main() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_hex(i32 %1)
%3 = tail call i32 @strlen(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @print_hex(i32 %3)
%5 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @print_hex(i32 %5)
ret i32 0
}
/* Variables and functions */
int syscall2(int, int);
int lib_page_out(int pageno) { return syscall2(508, pageno); }


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

x86 assembly (clang, -O2):
<lib_page_out>:
mov    %edi,%esi
mov    $0x1fc,%edi
jmp    1030 <syscall2@plt>

LLVM IR (-O0):
define i32 @lib_page_out(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @syscall2(i32 508, i32 %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @lib_page_out(i32 %0) {
%2 = tail call i32 @syscall2(i32 508, i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ hanoi(int, int, int, int);
int main(void) {
  hanoi(20, 1, 3, 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <hanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x2,%ecx
call   1030 <hanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @hanoi(i32 20, i32 1, i32 3, i32 2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @hanoi(i32 20, i32 1, i32 3, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void SDL_Delay(unsigned x) { usleep(x * 1000); }


x86 assembly (clang, -O0):
<SDL_Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SDL_Delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @SDL_Delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @SDL_Delay(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
void *Function2Handle(void *a, void *b) { return a; }


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

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

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

LLVM IR (-O2):
define i8* @Function2Handle(i8* readnone returned %0, i8* nocapture readnone %1) {
ret i8* %0
}
void ReleaseKeyHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @ReleaseKeyHandler() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ quicksort(int *, int /*<<< orphan*/, int);
int main(void) {
  int array[] = {5, 2, 1, 20, 70, -20, 30, 22, 6, 7, 8, 11, 0, 0};
  int size = sizeof(array) / sizeof(*array);
  print_array(array, size);
  quicksort(array, 0, size - 1);
  print_array(array, size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x38,%edx
call   1050 <memcpy@plt>
movl   $0xe,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1030 <print_array@plt>
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%edx
sub    $0x1,%edx
xor    %esi,%esi
call   1040 <quicksort@plt>
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xf04(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xd,%edx
call   1040 <quicksort@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.array = [14 x i32] [i32 5, i32 2, i32 1, i32 20, i32 70, i32 -20, i32 30, i32 22, i32 6, i32 7, i32 8, i32 11, i32 0, i32 0]
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [14 x i32]* %2 to i8*
store i32 14, i32* %3
%5 = getelementptr inbounds [14 x i32], [14 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @print_array(i32* %5, i32 %6)
%8 = getelementptr inbounds [14 x i32], [14 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = call i32 @quicksort(i32* %8, i32 0, i32 %10)
%12 = getelementptr inbounds [14 x i32], [14 x i32]* %2, i64 0, i64 0
%13 = load i32, i32* %3
%14 = call i32 @print_array(i32* %12, i32 %13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [14 x i32] [i32 5, i32 2, i32 1, i32 20, i32 70, i32 -20, i32 30, i32 22, i32 6, i32 7, i32 8, i32 11, i32 0, i32 0]
define i32 @main() {
%1 = alloca [14 x i32]
%2 = bitcast [14 x i32]* %1 to i8*
%3 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 14)
%5 = call i32 @quicksort(i32* %3, i32 0, i32 13)
%6 = call i32 @print_array(i32* %3, i32 14)
ret i32 0
}
float PowerHeuristic(int nf, float fPdf, int ng, float gPdf) {
  float f = nf * fPdf, g = ng * gPdf;
  return (f * f) / (f * f + g * g);
}


x86 assembly (clang, -O0):
<PowerHeuristic>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mulss  -0x14(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0x14(%rbp),%xmm3
movss  -0x18(%rbp),%xmm2
mulss  -0x18(%rbp),%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<PowerHeuristic>:
cvtsi2ss %edi,%xmm2
mulss  %xmm2,%xmm0
xorps  %xmm2,%xmm2
cvtsi2ss %esi,%xmm2
mulss  %xmm1,%xmm2
mulss  %xmm0,%xmm0
mulss  %xmm2,%xmm2
addss  %xmm0,%xmm2
divss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @PowerHeuristic(i32 %0, float %1, i32 %2, float %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32 %0, i32* %5
store float %1, float* %6
store i32 %2, i32* %7
store float %3, float* %8
%11 = load i32, i32* %5
%12 = sitofp i32 %11 to float
%13 = load float, float* %6
%14 = fmul float %12, %13
store float %14, float* %9
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to float
%17 = load float, float* %8
%18 = fmul float %16, %17
store float %18, float* %10
%19 = load float, float* %9
%20 = load float, float* %9
%21 = fmul float %19, %20
%22 = load float, float* %9
%23 = load float, float* %9
%24 = load float, float* %10
%25 = load float, float* %10
%26 = fmul float %24, %25
%27 = call float @llvm.fmuladd.f32(float %22, float %23, float %26)
%28 = fdiv float %21, %27
ret float %28
}

LLVM IR (-O2):
define float @PowerHeuristic(i32 %0, float %1, i32 %2, float %3) {
%5 = sitofp i32 %0 to float
%6 = fmul float %5, %1
%7 = sitofp i32 %2 to float
%8 = fmul float %7, %3
%9 = fmul float %6, %6
%10 = fmul float %8, %8
%11 = tail call float @llvm.fmuladd.f32(float %6, float %6, float %10)
%12 = fdiv float %9, %11
ret float %12
}
void g_type_add_class_cache_func() {}


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

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

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

LLVM IR (-O2):
define void @g_type_add_class_cache_func() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void uninitvar_perror(void) {
  char *string;
  (void)perror(string);
}


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

x86 assembly (clang, -O2):
<uninitvar_perror>:
jmp    1030 <perror@plt>

LLVM IR (-O0):
define void @uninitvar_perror() {
%1 = alloca i8*
%2 = load i8*, i8** %1
%3 = call i32 @perror(i8* %2)
ret void
}

LLVM IR (-O2):
define void @uninitvar_perror() {
%1 = tail call i32 @perror(i8* undef)
ret void
}
unsigned strhash(const char *s) {
  unsigned h = 0;
  while (*s) {
    h = (h << 1) ^ *s++;
  }
  return h;
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <strhash+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
xor    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strhash+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strhash+0x23>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
add    %eax,%eax
movsbl %cl,%ecx
xor    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strhash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strhash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 1
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = xor i32 %8, %10
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M200_f(char *s) {
  debug("M200_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M200_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M200_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M200_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M200_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void ARGBAddRow_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAddRow_AVX2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float gas;
  printf("The price of gas: ");
  scanf("%f", &gas);
  printf("Wow! %.2f for gas?\n", gas);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"The price of gas: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"Wow! %.2f for gas?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"The price of gas: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [20 x i8] c"Wow! %.2f for gas?\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}
/* Variables and functions */
int or1k_mfspr(int);
int /*<<< orphan*/ or1k_mtspr(int, int);
void or1k_timer_disable(void) {
  or1k_mtspr(((0 << (11)) + 17), ~0x00000002 & or1k_mfspr(((0 << (11)) + 17)));
}


x86 assembly (clang, -O0):
<or1k_timer_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x11,%edi
call   1040 <or1k_mfspr@plt>
mov    %eax,%esi
and    $0xfffffffd,%esi
mov    $0x11,%edi
call   1030 <or1k_mtspr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<or1k_timer_disable>:
push   %rax
mov    $0x11,%edi
call   1040 <or1k_mfspr@plt>
and    $0xfffffffd,%eax
mov    $0x11,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <or1k_mtspr@plt>

LLVM IR (-O0):
define void @or1k_timer_disable() {
%1 = call i32 @or1k_mfspr(i32 17)
%2 = and i32 -3, %1
%3 = call i32 @or1k_mtspr(i32 17, i32 %2)
ret void
}

LLVM IR (-O2):
define void @or1k_timer_disable() {
%1 = tail call i32 @or1k_mfspr(i32 17)
%2 = and i32 %1, -3
%3 = tail call i32 @or1k_mtspr(i32 17, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ inc(int *);
void address_of_local() {
  int x = 0;
  {
    int *ptr = &x;
    {
      int **ptrptr = &ptr;
      inc(*ptrptr);
      int z = x;
      assert(z == 1);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<address_of_local>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1040 <inc@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<address_of_local>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <inc@plt>
xor    %edi,%edi
cmpl   $0x1,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @address_of_local() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32**
%4 = alloca i32
store i32 0, i32* %1
store i32* %1, i32** %2
store i32** %2, i32*** %3
%5 = load i32**, i32*** %3
%6 = load i32*, i32** %5
%7 = call i32 @inc(i32* %6)
%8 = load i32, i32* %1
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
ret void
}

LLVM IR (-O2):
define void @address_of_local() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = call i32 @inc(i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
ret void
}
int condition_equals(char c) { return c == '='; }


x86 assembly (clang, -O0):
<condition_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3d,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<condition_equals>:
xor    %eax,%eax
cmp    $0x3d,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @condition_equals(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 61
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @condition_equals(i8 signext %0) {
%2 = icmp eq i8 %0, 61
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gpu_send_data(int);
void gpu_push_vertex(int x, int y) { gpu_send_data((y << 16) | (x & 0xFFFF)); }


x86 assembly (clang, -O0):
<gpu_push_vertex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
shl    $0x10,%edi
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
or     %eax,%edi
call   1030 <gpu_send_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpu_push_vertex>:
shl    $0x10,%esi
movzwl %di,%edi
or     %esi,%edi
jmp    1030 <gpu_send_data@plt>

LLVM IR (-O0):
define void @gpu_push_vertex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32, i32* %3
%8 = and i32 %7, 65535
%9 = or i32 %6, %8
%10 = call i32 @gpu_send_data(i32 %9)
ret void
}

LLVM IR (-O2):
define void @gpu_push_vertex(i32 %0, i32 %1) {
%3 = shl i32 %1, 16
%4 = and i32 %0, 65535
%5 = or i32 %3, %4
%6 = tail call i32 @gpu_send_data(i32 %5)
ret void
}
int main() { struct X *x$1; }


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

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

LLVM IR (-O0):
%struct.X = type opaque
define i32 @main() {
%1 = alloca %struct.X*
ret i32 0
}

LLVM IR (-O2):
%struct.X = type opaque
define i32 @main() {
ret i32 0
}
void initSignals() {}


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

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

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

LLVM IR (-O2):
define void @initSignals() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_anonymous_type_tests();
int /*<<< orphan*/ do_at_tests();
int /*<<< orphan*/ do_bitfield_tests();
int /*<<< orphan*/ do_block_tests();
int /*<<< orphan*/ do_children_tests();
int /*<<< orphan*/ do_frozen_tests();
int /*<<< orphan*/ do_locals_tests();
int /*<<< orphan*/ do_special_tests();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  do_locals_tests();
  do_block_tests();
  do_children_tests();
  do_special_tests();
  do_frozen_tests();
  do_at_tests();
  do_bitfield_tests();
  do_anonymous_type_tests();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1090 <do_locals_tests@plt>
mov    $0x0,%al
call   1060 <do_block_tests@plt>
mov    $0x0,%al
call   1080 <do_children_tests@plt>
mov    $0x0,%al
call   1040 <do_special_tests@plt>
mov    $0x0,%al
call   10a0 <do_frozen_tests@plt>
mov    $0x0,%al
call   1050 <do_at_tests@plt>
mov    $0x0,%al
call   1030 <do_bitfield_tests@plt>
mov    $0x0,%al
call   1070 <do_anonymous_type_tests@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1090 <do_locals_tests@plt>
xor    %eax,%eax
call   1060 <do_block_tests@plt>
xor    %eax,%eax
call   1080 <do_children_tests@plt>
xor    %eax,%eax
call   1040 <do_special_tests@plt>
xor    %eax,%eax
call   10a0 <do_frozen_tests@plt>
xor    %eax,%eax
call   1050 <do_at_tests@plt>
xor    %eax,%eax
call   1030 <do_bitfield_tests@plt>
xor    %eax,%eax
call   1070 <do_anonymous_type_tests@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
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 (...) @do_locals_tests()
%7 = call i32 (...) @do_block_tests()
%8 = call i32 (...) @do_children_tests()
%9 = call i32 (...) @do_special_tests()
%10 = call i32 (...) @do_frozen_tests()
%11 = call i32 (...) @do_at_tests()
%12 = call i32 (...) @do_bitfield_tests()
%13 = call i32 (...) @do_anonymous_type_tests()
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @do_locals_tests()
%4 = tail call i32 (...) @do_block_tests()
%5 = tail call i32 (...) @do_children_tests()
%6 = tail call i32 (...) @do_special_tests()
%7 = tail call i32 (...) @do_frozen_tests()
%8 = tail call i32 (...) @do_at_tests()
%9 = tail call i32 (...) @do_bitfield_tests()
%10 = tail call i32 (...) @do_anonymous_type_tests()
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int *malloc(int);
int *allocate_int() { return malloc(sizeof(int)); }


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

x86 assembly (clang, -O2):
<allocate_int>:
mov    $0x4,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @allocate_int() {
%1 = call i32* @malloc(i32 4)
ret i32* %1
}

LLVM IR (-O2):
define noalias i32* @allocate_int() {
%1 = tail call i32* @malloc(i32 4)
ret i32* %1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ t_add_char();
int /*<<< orphan*/ t_new_charring();
int main(int argc, char *argv[]) {
  t_new_charring();
  t_add_char();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <t_new_charring@plt>
mov    $0x0,%al
call   1030 <t_add_char@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <t_new_charring@plt>
xor    %eax,%eax
call   1030 <t_add_char@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @t_new_charring()
%7 = call i32 (...) @t_add_char()
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @t_new_charring()
%4 = tail call i32 (...) @t_add_char()
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
int serializer_read_bool(char *src, int *pointer) {
  unsigned char value = src[*pointer];
  (*pointer)++;
  return value == 1 ? 1 : 0;
}


x86 assembly (clang, -O0):
<serializer_read_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movzbl -0x11(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serializer_read_bool>:
movslq (%rsi),%rax
mov    (%rdi,%rax,1),%cl
add    $0x1,%eax
mov    %eax,(%rsi)
xor    %eax,%eax
cmp    $0x1,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @serializer_read_bool(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = load i8, i8* %5
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 1, i32 0
ret i32 %19
}

LLVM IR (-O2):
define i32 @serializer_read_bool(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = add nsw i32 %3, 1
store i32 %7, i32* %1
%8 = icmp eq i8 %6, 1
%9 = zext i1 %8 to i32
ret i32 %9
}
int docs_shares_ref_func(const struct cmd_info *ci) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.cmd_info = type opaque
define i32 @docs_shares_ref_func(%struct.cmd_info* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int bcm2835_read(int);
int32_t pl011_uart_getc(void) {
  while (bcm2835_read((0 + 0x201000 + 0x18)) & (1 << 4)) {
  }
  return bcm2835_read((0 + 0x201000 + 0x00));
}


x86 assembly (clang, -O0):
<pl011_uart_getc>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <pl011_uart_getc+0x9>
mov    $0x201018,%edi
call   1030 <bcm2835_read@plt>
and    $0x10,%eax
cmp    $0x0,%eax
je     1134 <pl011_uart_getc+0x24>
jmp    1119 <pl011_uart_getc+0x9>
mov    $0x201000,%edi
call   1030 <bcm2835_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pl011_uart_getc>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x201018,%edi
call   1030 <bcm2835_read@plt>
test   $0x10,%al
jne    1120 <pl011_uart_getc+0x10>
mov    $0x201000,%edi
pop    %rax
jmp    1030 <bcm2835_read@plt>

LLVM IR (-O0):
define i32 @pl011_uart_getc() {
br label %1
1: ; preds = %5, %0
%2 = call i32 @bcm2835_read(i32 2101272)
%3 = and i32 %2, 16
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = call i32 @bcm2835_read(i32 2101248)
ret i32 %7
}

LLVM IR (-O2):
define i32 @pl011_uart_getc() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @bcm2835_read(i32 2101272)
%3 = and i32 %2, 16
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %1
5: ; preds = %1
%6 = tail call i32 @bcm2835_read(i32 2101248)
ret i32 %6
}
long long testClosureVrL(long (*closure)(void)) { return (*closure)(); }


x86 assembly (clang, -O0):
<testClosureVrL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureVrL>:
jmp    *%rdi

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

LLVM IR (-O2):
define i64 @testClosureVrL(i64 ()* nocapture %0) {
%2 = tail call i64 %0()
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ __xfree(void *);
void __strexplodeDestr(void *ptr) {
  __xfree(ptr);
  ptr = NULL;
}


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

x86 assembly (clang, -O2):
<__strexplodeDestr>:
jmp    1030 <__xfree@plt>

LLVM IR (-O0):
define void @__strexplodeDestr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__xfree(i8* %3)
store i8* null, i8** %2
ret void
}

LLVM IR (-O2):
define void @__strexplodeDestr(i8* %0) {
%2 = tail call i32 @__xfree(i8* %0)
ret void
}
/* Type definitions */
struct socket_info {
  int dummy;
};

/* Variables and functions */
struct socket_info *find_socket_info(int);
int listen(int, int);
int swrap_listen(int s, int backlog) {
  int ret;
  struct socket_info *si = find_socket_info(s);
  if (!si) {
    return listen(s, backlog);
  }
  ret = listen(s, backlog);
  return ret;
}


x86 assembly (clang, -O0):
<swrap_listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <find_socket_info@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <swrap_listen+0x38>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <listen@plt>
mov    %eax,-0x4(%rbp)
jmp    116c <swrap_listen+0x4c>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <listen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.socket_info = type { i32 }
define i32 @swrap_listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.socket_info*
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %4
%9 = call %struct.socket_info* @find_socket_info(i32 %8)
store %struct.socket_info* %9, %struct.socket_info** %7
%10 = load %struct.socket_info*, %struct.socket_info** %7
%11 = icmp ne %struct.socket_info* %10, null
br i1 %11, label %16, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @listen(i32 %13, i32 %14)
store i32 %15, i32* %3
br label %21
16: ; preds = %2
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 @listen(i32 %17, i32 %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
store i32 %20, i32* %3
br label %21
21: ; preds = %16, %12
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
%struct.socket_info = type { i32 }
define i32 @swrap_listen(i32 %0, i32 %1) {
%3 = tail call %struct.socket_info* @find_socket_info(i32 %0)
%4 = tail call i32 @listen(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int strlen(const char *str) {
  int len = 0;
  for (const char *s = str; *s; s++) {
    len += 1;
  }
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     113e <strlen+0x3e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <strlen+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %9, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i8* [ %10, %6 ], [ %0, %1 ]
%8 = phi i32 [ %9, %6 ], [ 0, %1 ]
%9 = add nuw nsw i32 %8, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ intc_clearvectaddr();
void intc_init(void) {
  (*((volatile unsigned long *)((0xF2000000) + 0x14))) = 0xffffffff;
  (*((volatile unsigned long *)((0xF2100000) + 0x14))) = 0xffffffff;
  (*((volatile unsigned long *)((0xF2200000) + 0x14))) = 0xffffffff;
  (*((volatile unsigned long *)((0xF2300000) + 0x14))) = 0xffffffff;
  (*((volatile unsigned long *)((0xF2000000) + 0x0c))) = 0x0;
  (*((volatile unsigned long *)((0xF2100000) + 0x0c))) = 0x0;
  (*((volatile unsigned long *)((0xF2200000) + 0x0c))) = 0x0;
  (*((volatile unsigned long *)((0xF2300000) + 0x0c))) = 0x0;
  intc_clearvectaddr();
}


x86 assembly (clang, -O0):
<intc_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf2000014,%eax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
mov    $0xf2100014,%eax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
mov    $0xf2200014,%eax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
mov    $0xf2300014,%eax
mov    $0xffffffff,%ecx
mov    %rcx,(%rax)
mov    $0xf200000c,%eax
movq   $0x0,(%rax)
mov    $0xf210000c,%eax
movq   $0x0,(%rax)
mov    $0xf220000c,%eax
movq   $0x0,(%rax)
mov    $0xf230000c,%eax
movq   $0x0,(%rax)
mov    $0x0,%al
call   1030 <intc_clearvectaddr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<intc_init>:
mov    $0xffffffff,%eax
mov    %rax,-0xdffffeb(%rax)
mov    %rax,-0xdefffeb(%rax)
mov    %rax,-0xddfffeb(%rax)
mov    %rax,-0xdcfffeb(%rax)
movq   $0x0,-0xdfffff3(%rax)
movq   $0x0,-0xdeffff3(%rax)
movq   $0x0,-0xddffff3(%rax)
movq   $0x0,-0xdcffff3(%rax)
xor    %eax,%eax
jmp    1030 <intc_clearvectaddr@plt>

LLVM IR (-O0):
define void @intc_init() {
store volatile i64 4294967295, i64* inttoptr (i64 4060086292 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 4061134868 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 4062183444 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 4063232020 to i64*)
store volatile i64 0, i64* inttoptr (i64 4060086284 to i64*)
store volatile i64 0, i64* inttoptr (i64 4061134860 to i64*)
store volatile i64 0, i64* inttoptr (i64 4062183436 to i64*)
store volatile i64 0, i64* inttoptr (i64 4063232012 to i64*)
%1 = call i32 (...) @intc_clearvectaddr()
ret void
}

LLVM IR (-O2):
define void @intc_init() {
store volatile i64 4294967295, i64* inttoptr (i64 4060086292 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 4061134868 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 4062183444 to i64*)
store volatile i64 4294967295, i64* inttoptr (i64 4063232020 to i64*)
store volatile i64 0, i64* inttoptr (i64 4060086284 to i64*)
store volatile i64 0, i64* inttoptr (i64 4061134860 to i64*)
store volatile i64 0, i64* inttoptr (i64 4062183436 to i64*)
store volatile i64 0, i64* inttoptr (i64 4063232012 to i64*)
%1 = tail call i32 (...) @intc_clearvectaddr()
ret void
}
void swap(double *one, double *two) {
  if (*one > *two) {
    double var = *one;
    *one = *two;
    *two = var;
  }
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    114c <swap+0x4c>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
ucomisd %xmm1,%xmm0
jbe    1116 <swap+0x16>
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @swap(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = fcmp ogt double %7, %9
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load double*, double** %3
%13 = load double, double* %12
store double %13, double* %5
%14 = load double*, double** %4
%15 = load double, double* %14
%16 = load double*, double** %3
store double %15, double* %16
%17 = load double, double* %5
%18 = load double*, double** %4
store double %17, double* %18
br label %19
19: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
define void @swap(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ogt double %3, %4
br i1 %5, label %6, label %7
6: ; preds = %2
store double %4, double* %0
store double %3, double* %1
br label %7
7: ; preds = %6, %2
ret void
}