xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ close(int);
void receivedata_close(int fd) {
  if (fd >= 0)
    close(fd);
}


x86 assembly (clang, -O0):
<receivedata_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <receivedata_close+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<receivedata_close>:
test   %edi,%edi
js     1119 <receivedata_close+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @receivedata_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @receivedata_close(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
unsigned char get_fs_byte(const char *addr) {
  unsigned register char _v;
  __asm__("movb %%fs:%1,%0" : "=r"(_v) : "m"(*addr));
  return _v;
}


x86 assembly (clang, -O0):
<get_fs_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %fs:(%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fs_byte>:
mov    %fs:(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @get_fs_byte(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8 asm "movb %fs:$1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @get_fs_byte(i8* %0) {
%2 = tail call i8 asm "movb %fs:$1,$0", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ __svgalib_driver8p_putbox(int, int, int, int, void *, int);
void __svgalib_driver16p_putbox(int x, int y, int w, int h, void *b, int bw) {
  __svgalib_driver8p_putbox(x * 2, y, w * 2, h, b, bw * 2);
}


x86 assembly (clang, -O0):
<__svgalib_driver16p_putbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
shl    $0x1,%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
shl    $0x1,%r9d
call   1030 <__svgalib_driver8p_putbox@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__svgalib_driver16p_putbox>:
add    %edi,%edi
add    %edx,%edx
add    %r9d,%r9d
jmp    1030 <__svgalib_driver8p_putbox@plt>

LLVM IR (-O0):
define void @__svgalib_driver16p_putbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* %7
%14 = mul nsw i32 %13, 2
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = mul nsw i32 %16, 2
%18 = load i32, i32* %10
%19 = load i8*, i8** %11
%20 = load i32, i32* %12
%21 = mul nsw i32 %20, 2
%22 = call i32 @__svgalib_driver8p_putbox(i32 %14, i32 %15, i32 %17, i32 %18, i8* %19, i32 %21)
ret void
}

LLVM IR (-O2):
define void @__svgalib_driver16p_putbox(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = shl nsw i32 %0, 1
%8 = shl nsw i32 %2, 1
%9 = shl nsw i32 %5, 1
%10 = tail call i32 @__svgalib_driver8p_putbox(i32 %7, i32 %1, i32 %8, i32 %3, i8* %4, i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printstr(char *);
int rarrow_menuitem(int k, int *p) {
  printstr("\b->");
  return k == 2 ? 2 : 0;
}


x86 assembly (clang, -O0):
<rarrow_menuitem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printstr@plt>
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x2,%ecx
cmp    $0x2,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rarrow_menuitem>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <printstr@plt>
xor    %eax,%eax
cmp    $0x2,%ebx
sete   %al
add    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\08->\00"
define i32 @rarrow_menuitem(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = call i32 @printstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 2, i32 0
ret i32 %9
}

LLVM IR (-O2):
@.str = [4 x i8] c"\08->\00"
define i32 @rarrow_menuitem(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 @printstr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i32 2, i32 0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_signal_set_destroy() {
  printf("NOT IMPLEMENTED:"
         "pa_signal_set_destroy"
         "\n");
}


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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_signal_set_destroy\00"
define i32 @pa_signal_set_destroy() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free_string(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *valid_ipv6(char *);
void valid_ipv6_c(char *userInput, char *buf) {
  char *result = valid_ipv6(userInput);
  strcpy(buf, result);
  free_string(result);
}


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

x86 assembly (clang, -O2):
<valid_ipv6_c>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <valid_ipv6@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <free_string@plt>

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

LLVM IR (-O2):
define void @valid_ipv6_c(i8* %0, i8* %1) {
%3 = tail call i8* @valid_ipv6(i8* %0)
%4 = tail call i32 @strcpy(i8* %1, i8* %3)
%5 = tail call i32 @free_string(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mmap_chunks_higher(int, int /*<<< orphan*/);
int /*<<< orphan*/ mmap_chunks_lower(int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void alloc_page_full() {
  printf("Allocating default pagesize pages < 128TB \n");
  mmap_chunks_lower(8190, 0);
  printf("Allocating default pagesize pages > 128TB \n");
  mmap_chunks_higher(24575, 0);
}


x86 assembly (clang, -O0):
<alloc_page_full>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1ffe,%edi
xor    %esi,%esi
call   1050 <mmap_chunks_lower@plt>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5fff,%edi
xor    %esi,%esi
call   1040 <mmap_chunks_higher@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_page_full>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1ffe,%edi
xor    %esi,%esi
call   1050 <mmap_chunks_lower@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5fff,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <mmap_chunks_higher@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"Allocating default pagesize pages < 128TB \0A\00"
@.str.1 = [44 x i8] c"Allocating default pagesize pages > 128TB \0A\00"
define void @alloc_page_full() {
%1 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @mmap_chunks_lower(i32 8190, i32 0)
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @mmap_chunks_higher(i32 24575, i32 0)
ret void
}

LLVM IR (-O2):
@str = [43 x i8] c"Allocating default pagesize pages < 128TB \00"
@str.2 = [43 x i8] c"Allocating default pagesize pages > 128TB \00"
define void @alloc_page_full() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @mmap_chunks_lower(i32 8190, i32 0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @mmap_chunks_higher(i32 24575, i32 0)
ret void
}
/* Variables and functions */
double ldexp(double, int);
double test5(double x, int exp) { return ldexp(x, exp); }


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

x86 assembly (clang, -O2):
<test5>:
jmp    1030 <ldexp@plt>

LLVM IR (-O0):
define double @test5(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = call double @ldexp(double %5, i32 %6)
ret double %7
}

LLVM IR (-O2):
define double @test5(double %0, i32 %1) {
%3 = tail call double @ldexp(double %0, i32 %1)
ret double %3
}
unsigned long d2ul(double x) { return x; }


x86 assembly (clang, -O0):
<d2ul>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2ul>:
cvttsd2si %xmm0,%rcx
mov    %rcx,%rdx
sar    $0x3f,%rdx
subsd  0xeec(%rip),%xmm0
cvttsd2si %xmm0,%rax
and    %rdx,%rax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @d2ul(double %0) {
%2 = fptoui double %0 to i64
ret i64 %2
}
/* Variables and functions */
char *strchr(char *, int);
char *chop(char *s, int c) {
  char *p = strchr(s, c);
  if (p != NULL)
    *p = 0;
  return s;
}


x86 assembly (clang, -O0):
<chop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1141 <chop+0x31>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strchr@plt>
test   %rax,%rax
je     1121 <chop+0x11>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @chop(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 = call i8* @strchr(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %5
store i8 0, i8* %12
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @chop(i8* returned %0, i32 %1) {
%3 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %5, %2
ret i8* %0
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ scanf(char *, char *);
char laby_gameplay_player_input() {
  char c = '\0';
  {
    char c;
    do {
      c = getchar();
    } while (c != '\n' && c != EOF);
  };
  scanf("%c", &c);
  return c;
}


x86 assembly (clang, -O0):
<laby_gameplay_player_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x3(%rbp)
je     115e <laby_gameplay_player_input+0x3e>
movsbl -0x2(%rbp),%eax
mov    0x2e95(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
test   $0x1,%al
jne    112c <laby_gameplay_player_input+0xc>
lea    0xe90(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<laby_gameplay_player_input>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
mov    0x2eb7(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
je     114f <laby_gameplay_player_input+0x2f>
cmp    (%rbx),%al
jne    1140 <laby_gameplay_player_input+0x20>
lea    0xeaa(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xf(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define signext i8 @laby_gameplay_player_input() {
%1 = alloca i8
%2 = alloca i8
store i8 0, i8* %1
br label %3
3: ; preds = %15, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
br label %5
5: ; preds = %3
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = load i8, i8* @EOF
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %11, %13
br label %15
15: ; preds = %9, %5
%16 = phi i1 [ false, %5 ], [ %14, %9 ]
br i1 %16, label %3, label %17
17: ; preds = %15
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%19 = load i8, i8* %1
ret i8 %19
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [3 x i8] c"%c\00"
define signext i8 @laby_gameplay_player_input() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = icmp ne i8 %3, 10
%5 = load i8, i8* @EOF
%6 = icmp ne i8 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %2, label %8
8: ; preds = %2
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%10 = load i8, i8* %1
ret i8 %10
}
/* Variables and functions */
unsigned int stb_hash(char *str) {
  unsigned int hash = 0;
  while (*str)
    hash = (hash << 7) + (hash >> 25) + *str++;
  return hash + (hash >> 16);
}


x86 assembly (clang, -O0):
<stb_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <stb_hash+0x46>
mov    -0xc(%rbp),%eax
shl    $0x7,%eax
mov    -0xc(%rbp),%ecx
shr    $0x19,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <stb_hash+0xf>
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_hash>:
mov    (%rdi),%al
test   %al,%al
je     1125 <stb_hash+0x25>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
rol    $0x7,%ecx
movsbl %al,%eax
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <stb_hash+0x10>
jmp    1127 <stb_hash+0x27>
xor    %ecx,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @stb_hash(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 %19
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 7
%11 = load i32, i32* %3
%12 = lshr i32 %11, 25
%13 = add i32 %10, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %2
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = add i32 %13, %17
store i32 %18, i32* %3
br label %4
19: ; preds = %4
%20 = load i32, i32* %3
%21 = load i32, i32* %3
%22 = lshr i32 %21, 16
%23 = add i32 %20, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @stb_hash(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 = tail call i32 @llvm.fshl.i32(i32 %6, i32 %6, i32 7)
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = add 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 ]
%16 = lshr i32 %15, 16
%17 = add i32 %16, %15
ret i32 %17
}
int unregister_hdmi_cable_notification(struct hdmi_cable_notify *handler) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.hdmi_cable_notify = type opaque
define i32 @unregister_hdmi_cable_notification(%struct.hdmi_cable_notify* nocapture readnone %0) {
ret i32 0
}
void sgen_drop(struct codec *c) {}


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

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

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

LLVM IR (-O2):
%struct.codec = type opaque
define void @sgen_drop(%struct.codec* nocapture %0) {
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ inet_ntop(int /*<<< orphan*/, struct in_addr *, char *,
                             int /*<<< orphan*/);
char *inet_ntoa_r(struct in_addr in, char *buf, socklen_t size) {
  (void)inet_ntop(AF_INET, &in, buf, size);
  return (buf);
}


x86 assembly (clang, -O0):
<inet_ntoa_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x8(%rbp),%rsi
call   1030 <inet_ntop@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_ntoa_r>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ecx
mov    %rsi,%rbx
mov    %edi,0x8(%rsp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
mov    %rbx,%rdx
call   1030 <inet_ntop@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i8* @inet_ntoa_r(i32 %0, i8* %1, i32 %2) {
%4 = alloca %struct.in_addr
%5 = alloca i8*
%6 = alloca i32
%7 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i32 0, i32 0
store i32 %0, i32* %7
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* @AF_INET
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @inet_ntop(i32 %8, %struct.in_addr* %4, i8* %9, i32 %10)
%12 = load i8*, i8** %5
ret i8* %12
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
@AF_INET = global i32 0
define i8* @inet_ntoa_r(i32 %0, i8* returned %1, i32 %2) {
%4 = alloca %struct.in_addr
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %4, i64 0, i32 0
store i32 %0, i32* %5
%6 = load i32, i32* @AF_INET
%7 = call i32 @inet_ntop(i32 %6, %struct.in_addr* %4, i8* %1, i32 %2)
ret i8* %1
}
void _Jv_JNI_PopSystemFrame(void) {}


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

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

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

LLVM IR (-O2):
define void @_Jv_JNI_PopSystemFrame() {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int length;
  void *data;
};
typedef TYPE_1__ ASN1_STRING;

/* Variables and functions */
int /*<<< orphan*/ freezero(void *, int);
void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len) {
  freezero(str->data, str->length);
  str->data = data;
  str->length = len;
}


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

x86 assembly (clang, -O2):
<ASN1_STRING_set0>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    0x8(%rdi),%rdi
mov    0x0(%rbp),%esi
call   1030 <freezero@plt>
mov    %rbx,0x8(%rbp)
mov    %r14d,0x0(%rbp)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i8* }
define void @ASN1_STRING_set0(%struct.TYPE_3__* %0, i8* %1, i32 %2) {
%4 = alloca %struct.TYPE_3__*
%5 = alloca i8*
%6 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
%9 = load i8*, i8** %8
%10 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @freezero(i8* %9, i32 %12)
%14 = load i8*, i8** %5
%15 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%16 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %15, i32 0, i32 1
store i8* %14, i8** %16
%17 = load i32, i32* %6
%18 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %18, i32 0, i32 0
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i8* }
define void @ASN1_STRING_set0(%struct.TYPE_3__* nocapture %0, i8* %1, i32 %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%5 = load i8*, i8** %4
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @freezero(i8* %5, i32 %7)
store i8* %1, i8** %4
store i32 %2, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Tos_TaskDelay(int);
void Beep_Test() { Tos_TaskDelay(10000); }


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

x86 assembly (clang, -O2):
<Beep_Test>:
mov    $0x2710,%edi
jmp    1030 <Tos_TaskDelay@plt>

LLVM IR (-O0):
define void @Beep_Test() {
%1 = call i32 @Tos_TaskDelay(i32 10000)
ret void
}

LLVM IR (-O2):
define void @Beep_Test() {
%1 = tail call i32 @Tos_TaskDelay(i32 10000)
ret void
}
/* Variables and functions */
double exp(long);
long log(double);
double cdfGeometric(double p, long x) { return (1.0 - exp((x + 1) * log(p))); }


x86 assembly (clang, -O0):
<cdfGeometric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <log@plt>
mov    -0x18(%rbp),%rdi
imul   %rax,%rdi
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdfGeometric>:
push   %rbx
mov    %rdi,%rbx
add    $0x1,%rbx
call   1040 <log@plt>
imul   %rax,%rbx
mov    %rbx,%rdi
call   1030 <exp@plt>
movsd  0xebf(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @cdfGeometric(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
store double %0, double* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = add nsw i64 %5, 1
%7 = load double, double* %3
%8 = call i64 @log(double %7)
%9 = mul nsw i64 %6, %8
%10 = call double @exp(i64 %9)
%11 = fsub double 1.000000e+00, %10
ret double %11
}

LLVM IR (-O2):
define double @cdfGeometric(double %0, i64 %1) {
%3 = add nsw i64 %1, 1
%4 = tail call i64 @log(double %0)
%5 = mul nsw i64 %4, %3
%6 = tail call double @exp(i64 %5)
%7 = fsub double 1.000000e+00, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_channel_map_init_extend() {
  printf("NOT IMPLEMENTED:"
         "pa_channel_map_init_extend"
         "\n");
}


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

LLVM IR (-O0):
@.str = [44 x i8] c"NOT IMPLEMENTED:pa_channel_map_init_extend\0A\00"
define i32 @pa_channel_map_init_extend() {
%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_channel_map_init_extend\00"
define i32 @pa_channel_map_init_extend() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_pstream_unref() {
  printf("NOT IMPLEMENTED:"
         "pa_pstream_unref"
         "\n");
}


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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_pstream_unref\00"
define i32 @pa_pstream_unref() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void bc_print_message_prefix(int level) {
  int indent;
  printf("bccunit: ");
  for (indent = 0; indent < level; indent++) {
    printf("  ");
  }
}


x86 assembly (clang, -O0):
<bc_print_message_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1154 <bc_print_message_prefix+0x44>
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <bc_print_message_prefix+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc_print_message_prefix>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
test   %ebx,%ebx
jle    113d <bc_print_message_prefix+0x2d>
lea    0xedd(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <bc_print_message_prefix+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"bccunit: \00"
@.str.1 = [3 x i8] c" \00"
define void @bc_print_message_prefix(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int v_atomic_test_and_set_int(int volatile *, int, int);
int v_atomic_test_and_set_release_int(volatile int *ptr, int expected,
                                      int newval) {
  return v_atomic_test_and_set_int(ptr, expected, newval);
}


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

x86 assembly (clang, -O2):
<v_atomic_test_and_set_release_int>:
jmp    1030 <v_atomic_test_and_set_int@plt>

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

LLVM IR (-O2):
define i32 @v_atomic_test_and_set_release_int(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @v_atomic_test_and_set_int(i32* %0, i32 %1, i32 %2)
ret i32 %4
}
void gtk_icon_theme_get_search_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_theme_get_search_path() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ vp8_sub_pixel_variance16x16_c(unsigned char *, int, int, int,
                                                 unsigned char *, int,
                                                 unsigned int *);
unsigned int vp8_sub_pixel_mse16x16_c(unsigned char *src_ptr,
                                      int src_pixels_per_line, int xoffset,
                                      int yoffset, unsigned char *dst_ptr,
                                      int dst_pixels_per_line,
                                      unsigned int *sse) {
  vp8_sub_pixel_variance16x16_c(src_ptr, src_pixels_per_line, xoffset, yoffset,
                                dst_ptr, dst_pixels_per_line, sse);
  return *sse;
}


x86 assembly (clang, -O0):
<vp8_sub_pixel_mse16x16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <vp8_sub_pixel_variance16x16_c@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sub_pixel_mse16x16_c>:
push   %rbx
sub    $0x10,%rsp
mov    0x20(%rsp),%rbx
mov    %rbx,(%rsp)
call   1030 <vp8_sub_pixel_variance16x16_c@plt>
mov    (%rbx),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @vp8_sub_pixel_mse16x16_c(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i8*, i8** %12
%20 = load i32, i32* %13
%21 = load i32*, i32** %14
%22 = call i32 @vp8_sub_pixel_variance16x16_c(i8* %15, i32 %16, i32 %17, i32 %18, i8* %19, i32 %20, i32* %21)
%23 = load i32*, i32** %14
%24 = load i32, i32* %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @vp8_sub_pixel_mse16x16_c(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5, i32* %6) {
%8 = tail call i32 @vp8_sub_pixel_variance16x16_c(i8* %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5, i32* %6)
%9 = load i32, i32* %6
ret i32 %9
}
unsigned int ftoint(float f) { return *((unsigned int *)&f); }


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

x86 assembly (clang, -O2):
<ftoint>:
movd   %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @ftoint(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = bitcast float* %2 to i32*
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @ftoint(float %0) {
%2 = bitcast float %0 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ BN_sqr(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
void SANDSHREW_BN_sqr(BIGNUM *result, BIGNUM *input, BN_CTX *ctx) {
  BN_sqr(result, input, ctx);
}


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

x86 assembly (clang, -O2):
<SANDSHREW_BN_sqr>:
jmp    1030 <BN_sqr@plt>

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

LLVM IR (-O2):
define void @SANDSHREW_BN_sqr(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @BN_sqr(i32* %0, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
void idt_int14(void) { print("!! Page fault "); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"!! Page fault \00"
define void @idt_int14() {
%1 = call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"!! Page fault \00"
define void @idt_int14() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_move_tree();
void dump_moves(void) { dump_move_tree(); }


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

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

LLVM IR (-O0):
define void @dump_moves() {
%1 = call i32 (...) @dump_move_tree()
ret void
}

LLVM IR (-O2):
define void @dump_moves() {
%1 = tail call i32 (...) @dump_move_tree()
ret void
}
void coresight_nidnt_writel(unsigned int val, unsigned int off) {}


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

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

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

LLVM IR (-O2):
define void @coresight_nidnt_writel(i32 %0, i32 %1) {
ret void
}
int drm_iommu_attach_device(struct drm_device *drm_dev,
                            struct device *subdrv_dev) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.drm_device = type opaque
%struct.device = type opaque
define i32 @drm_iommu_attach_device(%struct.drm_device* %0, %struct.device* %1) {
%3 = alloca %struct.drm_device*
%4 = alloca %struct.device*
store %struct.drm_device* %0, %struct.drm_device** %3
store %struct.device* %1, %struct.device** %4
ret i32 0
}

LLVM IR (-O2):
%struct.drm_device = type opaque
%struct.device = type opaque
define i32 @drm_iommu_attach_device(%struct.drm_device* nocapture readnone %0, %struct.device* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void f1(int a) { printf("a = %d\n", a); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"a = %d\0A\00"
define void @f1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
void inflate_table(void) {}


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

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

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

LLVM IR (-O2):
define void @inflate_table() {
ret void
}
float scalarprod4(float *v1, float *v2) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2] + v1[3] * v2[3];
}


x86 assembly (clang, -O0):
<scalarprod4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalarprod4>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm2
mulss  0x8(%rsi),%xmm2
addss  %xmm1,%xmm2
movss  0xc(%rdi),%xmm0
mulss  0xc(%rsi),%xmm0
addss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @scalarprod4(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
%26 = load float*, float** %3
%27 = getelementptr inbounds float, float* %26, i64 3
%28 = load float, float* %27
%29 = load float*, float** %4
%30 = getelementptr inbounds float, float* %29, i64 3
%31 = load float, float* %30
%32 = call float @llvm.fmuladd.f32(float %28, float %31, float %25)
ret float %32
}

LLVM IR (-O2):
define float @scalarprod4(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
%16 = getelementptr inbounds float, float* %0, i64 3
%17 = load float, float* %16
%18 = getelementptr inbounds float, float* %1, i64 3
%19 = load float, float* %18
%20 = tail call float @llvm.fmuladd.f32(float %17, float %19, float %15)
ret float %20
}
void sound_mix(int cycles) {}


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

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

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

LLVM IR (-O2):
define void @sound_mix(i32 %0) {
ret void
}
/* Variables and functions */
char *hex_to_signed(char const *, long *);
char *hex_to_int(const char *str, int *out) {
  long v;
  char *cur = hex_to_signed(str, &v);
  if (cur != str) {
    *out = (int)v;
  }
  return cur;
}


x86 assembly (clang, -O0):
<hex_to_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <hex_to_signed@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x8(%rbp),%rax
je     114b <hex_to_int+0x3b>
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_to_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
call   1030 <hex_to_signed@plt>
cmp    %rbx,%rax
je     112d <hex_to_int+0x1d>
mov    (%rsp),%ecx
mov    %ecx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @hex_to_int(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i8* @hex_to_signed(i8* %0, i64* %3)
%6 = icmp eq i8* %5, %0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = trunc i64 %8 to i32
store i32 %9, i32* %1
br label %10
10: ; preds = %7, %2
ret i8* %5
}
int find_first_lt(double *x, double a, int n) {
  int i;
  for (i = 0; i < n; ++i)
    if (x[i] < a)
      break;
  return i;
}


x86 assembly (clang, -O0):
<find_first_lt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1157 <find_first_lt+0x57>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1144 <find_first_lt+0x44>
jmp    1157 <find_first_lt+0x57>
jmp    1149 <find_first_lt+0x49>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1117 <find_first_lt+0x17>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_first_lt>:
test   %esi,%esi
jle    1123 <find_first_lt+0x23>
mov    %esi,%ecx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
ucomisd (%rdi,%rax,8),%xmm0
ja     1122 <find_first_lt+0x22>
add    $0x1,%rax
cmp    %rax,%rcx
jne    1110 <find_first_lt+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @find_first_lt(double* nocapture %0, double %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds double, double* %0, i64 %8
%10 = load double, double* %9
%11 = fcmp olt double %10, %1
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ 0, %3 ], [ %16, %15 ], [ %2, %12 ]
ret i32 %18
}