xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ accept(int);
int /*<<< orphan*/ fatal_error(char *);
void expect(int type) {
  if (!accept(type)) {
    fatal_error("Parser: Syntax error");
  }
}


x86 assembly (clang, -O0):
<expect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <accept@plt>
cmp    $0x0,%eax
jne    1148 <expect+0x28>
lea    0xebd(%rip),%rdi
call   1030 <fatal_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect>:
push   %rax
call   1040 <accept@plt>
test   %eax,%eax
je     112c <expect+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <fatal_error@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Parser: Syntax error\00"
define void @expect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @accept(i32 %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @fatal_error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Parser: Syntax error\00"
define void @expect(i32 %0) {
%2 = tail call i32 @accept(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int __cmp_char(const void *a_, const void *b_) {
  char a = *((char *)a_);
  char b = *((char *)b_);
  if (a < b)
    return -1;
  else if (a > b)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<__cmp_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jge    113a <__cmp_char+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <__cmp_char+0x5d>
movsbl -0x19(%rbp),%eax
movsbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jle    1156 <__cmp_char+0x56>
movl   $0x1,-0x4(%rbp)
jmp    115d <__cmp_char+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cmp_char>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @__cmp_char(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
int isspace(int c) {
  return ((c == ' ') || (c == '\f') || (c == '\n') || (c == '\r') ||
          (c == '\t') || (c == '\v'));
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%edi
ja     111d <isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 12
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 13
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 9
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 11
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x7f() {
  Assert_real((isspace(127) == 0),
              "/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/ctype/test_isspace.c",
              640, ("isspace should be 0 for 0x7f"));
}


x86 assembly (clang, -O0):
<t_isspace_0x7f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x280,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x7f>:
push   %rax
mov    $0x7f,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x280,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x7f\00"
define void @t_isspace_0x7f() {
%1 = call i64 @isspace(i32 127)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x7f\00"
define void @t_isspace_0x7f() {
%1 = tail call i64 @isspace(i32 127)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 640, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int android_initOpenglesEmulation(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @android_initOpenglesEmulation() {
ret i32 -1
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int PsCreateSystemThread(int ThreadHandle, int DesiredAccess,
                         int ObjectAttributes, int ProcessHandle, int ClientId,
                         int StartRoutine, int StartContext) {
  {
    int tmp_ndt_10;
    tmp_ndt_10 = __VERIFIER_nondet_int();
    if (tmp_ndt_10 == 0) {
      goto switch_11_0;
    } else {
      goto switch_11_default;
      if (0) {
      switch_11_0:
        return (0);
      switch_11_default:;
        return (-1073741823);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<PsCreateSystemThread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1148 <PsCreateSystemThread+0x38>
jmp    114d <PsCreateSystemThread+0x3d>
jmp    1159 <PsCreateSystemThread+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1160 <PsCreateSystemThread+0x50>
movl   $0xc0000001,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PsCreateSystemThread>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0xc0000001,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @PsCreateSystemThread(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
%17 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %17, i32* %16
%18 = load i32, i32* %16
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %7
br label %24
21: ; preds = %7
br label %25
22: ; No predecessors!
br i1 false, label %23, label %26
23: ; preds = %22
br label %24
24: ; preds = %23, %20
store i32 0, i32* %8
br label %28
25: ; preds = %21
store i32 -1073741823, i32* %8
br label %28
26: ; preds = %22
br label %27
27: ; preds = %26
br label %28
28: ; preds = %24, %25, %27
%29 = load i32, i32* %8
ret i32 %29
}

LLVM IR (-O2):
define i32 @PsCreateSystemThread(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 (...) @__VERIFIER_nondet_int()
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 0, i32 -1073741823
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ f(char, int);
void main() { f((char)1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <f@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @f(i8 signext 1, i32 2)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @f(i8 signext 1, i32 2)
ret void
}
char *icalloc(nelem, elsize)
int nelem;
int elsize;
{
  if (nelem == 0 || elsize == 0)
    nelem = elsize = 1;
  return calloc((unsigned int)nelem, (unsigned int)elsize);
}


x86 assembly (clang, -O0):
<icalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <icalloc+0x22>
cmpl   $0x0,-0x8(%rbp)
jne    1140 <icalloc+0x30>
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%edi
mov    -0x8(%rbp),%eax
mov    %eax,%esi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icalloc>:
test   %edi,%edi
sete   %al
test   %esi,%esi
sete   %cl
or     %al,%cl
mov    %edi,%edi
mov    $0x1,%eax
cmovne %rax,%rdi
mov    %esi,%esi
cmovne %rax,%rsi
jmp    1030 <calloc@plt>

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

LLVM IR (-O2):
define noalias i8* @icalloc(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
%4 = icmp eq i32 %1, 0
%5 = or i1 %3, %4
%6 = zext i32 %0 to i64
%7 = select i1 %5, i64 1, i64 %6
%8 = zext i32 %1 to i64
%9 = select i1 %5, i64 1, i64 %8
%10 = tail call i8* @calloc(i64 %7, i64 %9)
ret i8* %10
}
/* Variables and functions */
int f(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ test_brak();
int main() {
  printf("f x is %d\n", f(2));
  test_brak();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <f@plt>
mov    %eax,%esi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test_brak@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <f@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <test_brak@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"f x is %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 2)
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (...) @test_brak()
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"f x is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @test_brak()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int fanotify_mark(int, unsigned int, int /*<<< orphan*/, int, char const *);
int mark_object(int fan_fd, const char *path, int fd, uint64_t mask,
                unsigned int flags) {
  return fanotify_mark(fan_fd, flags, mask, fd, path);
}


x86 assembly (clang, -O0):
<mark_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8
call   1030 <fanotify_mark@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mark_object>:
mov    %edx,%eax
mov    %rsi,%r9
mov    %r8d,%esi
mov    %ecx,%edx
mov    %eax,%ecx
mov    %r9,%r8
jmp    1030 <fanotify_mark@plt>

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

LLVM IR (-O2):
define i32 @mark_object(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @fanotify_mark(i32 %0, i32 %4, i32 %3, i32 %2, i8* %1)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void make_text_file() {
  FILE *f = fopen("write_test_temporary_file"
                  ".txt",
                  "w");
  fclose(f);
}


x86 assembly (clang, -O0):
<make_text_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_text_file>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeef(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"write_test_temporary_file.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @make_text_file() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"write_test_temporary_file.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @make_text_file() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int get_byte(int);
unsigned short get_word(int offset) {
  return (get_byte(offset) << 8) | get_byte(offset + 1);
}


x86 assembly (clang, -O0):
<get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_byte@plt>
shl    $0x8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1030 <get_byte@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
or     %ecx,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_word>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <get_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <get_byte@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @get_word(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @get_byte(i32 %3)
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
%8 = call i32 @get_byte(i32 %7)
%9 = or i32 %5, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @get_word(i32 %0) {
%2 = tail call i32 @get_byte(i32 %0)
%3 = shl i32 %2, 8
%4 = add nsw i32 %0, 1
%5 = tail call i32 @get_byte(i32 %4)
%6 = or i32 %3, %5
%7 = trunc i32 %6 to i16
ret i16 %7
}
int is_uv_hubless(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @is_uv_hubless() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ InlineWords(int, int, int, int, int);
void DoTwoRCopy(void) { InlineWords(4, 41, 42, 18, 40); }


x86 assembly (clang, -O0):
<DoTwoRCopy>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x29,%esi
mov    $0x2a,%edx
mov    $0x12,%ecx
mov    $0x28,%r8d
call   1030 <InlineWords@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoTwoRCopy>:
mov    $0x4,%edi
mov    $0x29,%esi
mov    $0x2a,%edx
mov    $0x12,%ecx
mov    $0x28,%r8d
jmp    1030 <InlineWords@plt>

LLVM IR (-O0):
define void @DoTwoRCopy() {
%1 = call i32 @InlineWords(i32 4, i32 41, i32 42, i32 18, i32 40)
ret void
}

LLVM IR (-O2):
define void @DoTwoRCopy() {
%1 = tail call i32 @InlineWords(i32 4, i32 41, i32 42, i32 18, i32 40)
ret void
}
int base6() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @base6() {
ret i32 0
}
/* Type definitions */
struct sk_buff {
  int dummy;
};
struct nf_conn {
  int dummy;
};
typedef enum ip_conntrack_info {
  ____Placeholder_ip_conntrack_info
} ip_conntrack_info;

/* Variables and functions */
int nfqnl_ct_put(struct sk_buff *skb, struct nf_conn *ct,
                 enum ip_conntrack_info ctinfo) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.sk_buff = type { i32 }
%struct.nf_conn = type { i32 }
define i32 @nfqnl_ct_put(%struct.sk_buff* %0, %struct.nf_conn* %1, i32 %2) {
%4 = alloca %struct.sk_buff*
%5 = alloca %struct.nf_conn*
%6 = alloca i32
store %struct.sk_buff* %0, %struct.sk_buff** %4
store %struct.nf_conn* %1, %struct.nf_conn** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.sk_buff = type { i32 }
%struct.nf_conn = type { i32 }
define i32 @nfqnl_ct_put(%struct.sk_buff* nocapture readnone %0, %struct.nf_conn* nocapture readnone %1, i32 %2) {
ret i32 0
}
void adis16260_unconfigure_ring(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @adis16260_unconfigure_ring(%struct.iio_dev* nocapture %0) {
ret void
}
/* Type definitions */
struct cpu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cpu_set_h(struct cpu *, unsigned char);
int /*<<< orphan*/ cpu_set_l(struct cpu *, unsigned char);
void cpu_set_hl(struct cpu *cpu, unsigned short hl) {
  unsigned char h = ((unsigned char)(((unsigned short)(hl)) >> 8));
  unsigned char l = ((unsigned char)(((unsigned short)(hl)) >> 0));
  cpu_set_h(cpu, h);
  cpu_set_l(cpu, l);
}


x86 assembly (clang, -O0):
<cpu_set_hl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0xb(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x0,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0xb(%rbp),%esi
call   1040 <cpu_set_h@plt>
mov    -0x8(%rbp),%rdi
movzbl -0xc(%rbp),%esi
call   1030 <cpu_set_l@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_set_hl>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
shr    $0x8,%esi
call   1040 <cpu_set_h@plt>
movzbl %bl,%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <cpu_set_l@plt>

LLVM IR (-O0):
%struct.cpu = type { i32 }
define void @cpu_set_hl(%struct.cpu* %0, i16 zeroext %1) {
%3 = alloca %struct.cpu*
%4 = alloca i16
%5 = alloca i8
%6 = alloca i8
store %struct.cpu* %0, %struct.cpu** %3
store i16 %1, i16* %4
%7 = load i16, i16* %4
%8 = zext i16 %7 to i32
%9 = ashr i32 %8, 8
%10 = trunc i32 %9 to i8
store i8 %10, i8* %5
%11 = load i16, i16* %4
%12 = zext i16 %11 to i32
%13 = ashr i32 %12, 0
%14 = trunc i32 %13 to i8
store i8 %14, i8* %6
%15 = load %struct.cpu*, %struct.cpu** %3
%16 = load i8, i8* %5
%17 = call i32 @cpu_set_h(%struct.cpu* %15, i8 zeroext %16)
%18 = load %struct.cpu*, %struct.cpu** %3
%19 = load i8, i8* %6
%20 = call i32 @cpu_set_l(%struct.cpu* %18, i8 zeroext %19)
ret void
}

LLVM IR (-O2):
%struct.cpu = type { i32 }
define void @cpu_set_hl(%struct.cpu* %0, i16 zeroext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = trunc i16 %1 to i8
%6 = tail call i32 @cpu_set_h(%struct.cpu* %0, i8 zeroext %4)
%7 = tail call i32 @cpu_set_l(%struct.cpu* %0, i8 zeroext %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void p() { abort(); }


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

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

LLVM IR (-O0):
define void @p() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @p() {
%1 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func2() { printf("Calling up func2\n"); }


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

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

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

LLVM IR (-O2):
@str = [17 x i8] c"Calling up func2\00"
define void @func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int *arr, int *last) {
  for (; arr <= last; arr++) {
    printf("%d ", *arr);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1153 <printArray+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <printArray+0x10>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %rbx
cmp    %rsi,%rdi
ja     1155 <printArray+0x35>
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xec9(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%rbx
cmp    %r14,%rbx
jbe    1140 <printArray+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* %0, i32* readnone %1) {
%3 = icmp ugt i32* %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32* [ %8, %4 ], [ %0, %2 ]
%6 = load i32, i32* %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds i32, i32* %5, i64 1
%9 = icmp ugt i32* %8, %1
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
unsigned int moo1();
int /*<<< orphan*/ moo2();
int /*<<< orphan*/ moo3(unsigned int);
int /*<<< orphan*/ moo4();
unsigned int cow(void) {
  moo2();
  moo4();
  moo3(moo1());
  return moo1();
}


x86 assembly (clang, -O0):
<cow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <moo2@plt>
mov    $0x0,%al
call   1060 <moo4@plt>
mov    $0x0,%al
call   1030 <moo1@plt>
mov    %eax,%edi
call   1040 <moo3@plt>
mov    $0x0,%al
call   1030 <moo1@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cow>:
push   %rax
xor    %eax,%eax
call   1050 <moo2@plt>
xor    %eax,%eax
call   1060 <moo4@plt>
xor    %eax,%eax
call   1030 <moo1@plt>
mov    %eax,%edi
call   1040 <moo3@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <moo1@plt>

LLVM IR (-O0):
define i32 @cow() {
%1 = call i32 (...) @moo2()
%2 = call i32 (...) @moo4()
%3 = call i32 (...) @moo1()
%4 = call i32 @moo3(i32 %3)
%5 = call i32 (...) @moo1()
ret i32 %5
}

LLVM IR (-O2):
define i32 @cow() {
%1 = tail call i32 (...) @moo2()
%2 = tail call i32 (...) @moo4()
%3 = tail call i32 (...) @moo1()
%4 = tail call i32 @moo3(i32 %3)
%5 = tail call i32 (...) @moo1()
ret i32 %5
}
int test_imm_7Fint16_mem(short *val) {
  return ((*val) & (0x7F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_7Fint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x7f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_7Fint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 127
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_7Fint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 127
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint_fast32_t;

/* Variables and functions */
__attribute__((unused)) void cop_st_ule32(void *buf, uint_fast32_t val) {
  unsigned char *b = buf;
  b[0] = val & 0xFFu;
  b[1] = (val >> 8) & 0xFFu;
  b[2] = (val >> 16) & 0xFFu;
  b[3] = (val >> 24) & 0xFFu;
}


x86 assembly (clang, -O0):
<cop_st_ule32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_st_ule32>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @cop_st_ule32(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
store i8* %6, i8** %5
%7 = load i32, i32* %4
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 8
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %5
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i32, i32* %4
%19 = ashr i32 %18, 16
%20 = and i32 %19, 255
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %21, i8* %23
%24 = load i32, i32* %4
%25 = ashr i32 %24, 24
%26 = and i32 %25, 255
%27 = trunc i32 %26 to i8
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 3
store i8 %27, i8* %29
ret void
}

LLVM IR (-O2):
define void @cop_st_ule32(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %1, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint8_t pseudo_rand_8() {
  static uint16_t seed = 0;
  return (uint8_t)(seed = (12657 * seed + 12345) % 256);
}


x86 assembly (clang, -O0):
<pseudo_rand_8>:
push   %rbp
mov    %rsp,%rbp
imul   $0x3171,0x2f16(%rip),%eax
add    $0x3039,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    %eax,0x2f01(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pseudo_rand_8>:
imul   $0x3171,0x2f1a(%rip),%eax
lea    0x3039(%rax),%ecx
lea    0x3138(%rax),%edx
test   %ecx,%ecx
cmovns %ecx,%edx
and    $0xffffff00,%edx
neg    %edx
add    %edx,%eax
add    $0x3039,%eax
mov    %eax,0x2ef4(%rip)
ret

LLVM IR (-O0):
@pseudo_rand_8.seed = internal global i32 0
define i32 @pseudo_rand_8() {
%1 = load i32, i32* @pseudo_rand_8.seed
%2 = mul nsw i32 12657, %1
%3 = add nsw i32 %2, 12345
%4 = srem i32 %3, 256
store i32 %4, i32* @pseudo_rand_8.seed
ret i32 %4
}

LLVM IR (-O2):
@pseudo_rand_8.seed = internal unnamed_addr global i32 0
define i32 @pseudo_rand_8() {
%1 = load i32, i32* @pseudo_rand_8.seed
%2 = mul nsw i32 %1, 12657
%3 = add nsw i32 %2, 12345
%4 = srem i32 %3, 256
store i32 %4, i32* @pseudo_rand_8.seed
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void iv_dfree(void *mem) {
  if (mem)
    free((char *)mem);
}


x86 assembly (clang, -O0):
<iv_dfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <iv_dfree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iv_dfree>:
test   %rdi,%rdi
je     111a <iv_dfree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @iv_dfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void nseel_asm_sub_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_sub_end() {
ret void
}
int cairo_code_draw_tinyButton_get_height() { return 22; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_tinyButton_get_height() {
ret i32 22
}

LLVM IR (-O2):
define i32 @cairo_code_draw_tinyButton_get_height() {
ret i32 22
}
int divide(const int a, const int b) { return a / b; }


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

x86 assembly (clang, -O2):
<divide>:
mov    %edi,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @divide(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void g_error(char *message) { printf("%s: %s\n", "env", message); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [4 x i8] c"env\00"
define void @g_error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
double gsl_fdiv(double, double);
double gsl_posinf(void) { return gsl_fdiv(+1.0, 0.0); }


x86 assembly (clang, -O0):
<gsl_posinf>:
push   %rbp
mov    %rsp,%rbp
movsd  0xee4(%rip),%xmm0
xorps  %xmm1,%xmm1
call   1030 <gsl_fdiv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsl_posinf>:
movsd  0xee8(%rip),%xmm0
xorps  %xmm1,%xmm1
jmp    1030 <gsl_fdiv@plt>

LLVM IR (-O0):
define double @gsl_posinf() {
%1 = call double @gsl_fdiv(double 1.000000e+00, double 0.000000e+00)
ret double %1
}

LLVM IR (-O2):
define double @gsl_posinf() {
%1 = tail call double @gsl_fdiv(double 1.000000e+00, double 0.000000e+00)
ret double %1
}
void btools_swap_32(void *addr) {
  char *ptr = (char *)addr;
  char tmp = ptr[0];
  ptr[0] = ptr[3];
  ptr[3] = tmp;
  tmp = ptr[1];
  ptr[1] = ptr[2];
  ptr[2] = tmp;
}


x86 assembly (clang, -O0):
<btools_swap_32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<btools_swap_32>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

LLVM IR (-O0):
define void @btools_swap_32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
store i8 %8, i8* %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 3
%11 = load i8, i8* %10
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %11, i8* %13
%14 = load i8, i8* %4
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 3
store i8 %14, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8, i8* %18
store i8 %19, i8* %4
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = load i8, i8* %21
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 1
store i8 %22, i8* %24
%25 = load i8, i8* %4
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 2
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @btools_swap_32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ CRYPTO_EX_DATA;

/* Variables and functions */
int dummy_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, void *from_d,
              int idx, long argl, void *argp) {
  return 0;
}


x86 assembly (clang, -O0):
<dummy_dup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @dummy_dup(i32* nocapture readnone %0, i32* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i64 %4, i8* nocapture readnone %5) {
ret i32 0
}
void write_text(unsigned char *s, char *repl) {
  while (*repl) {
    *s++ = *repl++;
  }
}


x86 assembly (clang, -O0):
<write_text>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1140 <write_text+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    110c <write_text+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_text>:
mov    (%rsi),%al
test   %al,%al
je     1120 <write_text+0x20>
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
mov    %al,(%rdi,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    1110 <write_text+0x10>
ret

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

LLVM IR (-O2):
define void @write_text(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
float __attribute__((const)) lw6sys_fmax(float a, float b) {
  return (a > b) ? a : b;
}


x86 assembly (clang, -O0):
<lw6sys_fmax>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    112c <lw6sys_fmax+0x2c>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1136 <lw6sys_fmax+0x36>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw6sys_fmax>:
maxss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @lw6sys_fmax(float %0, float %1) {
%3 = fcmp ogt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
double RAND_MAX;
int rand();
double rand_uniform_2(void) {
  int val = rand();
  while (val == 0)
    val = rand();
  return (double)val / RAND_MAX;
}


x86 assembly (clang, -O0):
<rand_uniform_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    113b <rand_uniform_2+0x2b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
jmp    1122 <rand_uniform_2+0x12>
cvtsi2sdl -0x4(%rbp),%xmm0
mov    0x2ea1(%rip),%rax
divsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_uniform_2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
test   %eax,%eax
je     1120 <rand_uniform_2+0x10>
cvtsi2sd %eax,%xmm0
mov    0x2eb2(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @rand_uniform_2() {
%1 = alloca i32
%2 = call i32 (...) @rand()
store i32 %2, i32* %1
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 (...) @rand()
store i32 %7, i32* %1
br label %3
8: ; preds = %3
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to double
%11 = load double, double* @RAND_MAX
%12 = fdiv double %10, %11
ret double %12
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @rand_uniform_2() {
%1 = tail call i32 (...) @rand()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0, %3
%4 = tail call i32 (...) @rand()
%5 = icmp eq i32 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3, %0
%7 = phi i32 [ %1, %0 ], [ %4, %3 ]
%8 = sitofp i32 %7 to double
%9 = load double, double* @RAND_MAX
%10 = fdiv double %8, %9
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ set_tcp_cork(int);
int /*<<< orphan*/ set_udp_cork(int);
void set_sock_cork(int fd, int udp) {
  if (!!udp)
    set_udp_cork(fd);
  else
    set_tcp_cork(fd);
}


x86 assembly (clang, -O0):
<set_sock_cork>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1145 <set_sock_cork+0x25>
mov    -0x4(%rbp),%edi
call   1040 <set_udp_cork@plt>
jmp    114d <set_sock_cork+0x2d>
mov    -0x4(%rbp),%edi
call   1030 <set_tcp_cork@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sock_cork>:
test   %esi,%esi
je     1129 <set_sock_cork+0x9>
jmp    1040 <set_udp_cork@plt>
jmp    1030 <set_tcp_cork@plt>

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

LLVM IR (-O2):
define void @set_sock_cork(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @set_udp_cork(i32 %0)
br label %8
6: ; preds = %2
%7 = tail call i32 @set_tcp_cork(i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}