xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ fchdir(int);
char *myrealpath(char const *, char *, int);
int open(char *, int /*<<< orphan*/);
char *realpath(const char *file, char *dest) {
  int fd = open(".", O_RDONLY);
  char *res = myrealpath(file, dest, 31);
  fchdir(fd);
  close(fd);
  return res;
}


x86 assembly (clang, -O0):
<realpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
lea    0xea0(%rip),%rdi
call   1060 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1f,%edx
call   1040 <myrealpath@plt>
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <fchdir@plt>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realpath>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2e97(%rip),%rax
mov    (%rax),%esi
lea    0xea6(%rip),%rdi
call   1060 <open@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1f,%edx
call   1040 <myrealpath@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1050 <fchdir@plt>
mov    %ebp,%edi
call   1030 <close@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@O_RDONLY = global i32 0
define i8* @realpath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i32, i32* @O_RDONLY
%8 = call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i8* @myrealpath(i8* %9, i8* %10, i32 31)
store i8* %11, i8** %6
%12 = load i32, i32* %5
%13 = call i32 @fchdir(i32 %12)
%14 = load i32, i32* %5
%15 = call i32 @close(i32 %14)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@O_RDONLY = global i32 0
define i8* @realpath(i8* %0, i8* %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i8* @myrealpath(i8* %0, i8* %1, i32 31)
%6 = tail call i32 @fchdir(i32 %4)
%7 = tail call i32 @close(i32 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ np_werror(char *, int);
int err(char *msg, int no) {
  np_werror(msg, no);
  return -1;
}


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

x86 assembly (clang, -O2):
<err>:
push   %rax
call   1030 <np_werror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @err(i8* %0, i32 %1) {
%3 = tail call i32 @np_werror(i8* %0, i32 %1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main(void) {
  putchar('a');
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x61,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @putchar(i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 97)
ret i32 0
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ strbuf_addstr(struct strbuf *, char const *);
void get_peg_path_buf(struct strbuf *bf, const char *path) {
  if (path[0] != '.' && path[1] != '/') {
    strbuf_addstr(bf, "./");
  }
  strbuf_addstr(bf, path);
}


x86 assembly (clang, -O0):
<get_peg_path_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1151 <get_peg_path_buf+0x41>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2f,%eax
je     1151 <get_peg_path_buf+0x41>
mov    -0x8(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <strbuf_addstr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strbuf_addstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_peg_path_buf>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
cmpb   $0x2e,(%rsi)
je     1134 <get_peg_path_buf+0x24>
cmpb   $0x2f,0x1(%rbx)
je     1134 <get_peg_path_buf+0x24>
lea    0xed4(%rip),%rsi
mov    %r14,%rdi
call   1030 <strbuf_addstr@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strbuf_addstr@plt>

LLVM IR (-O0):
%struct.strbuf = type { i32 }
@.str = [3 x i8] c"./\00"
define void @get_peg_path_buf(%struct.strbuf* %0, i8* %1) {
%3 = alloca %struct.strbuf*
%4 = alloca i8*
store %struct.strbuf* %0, %struct.strbuf** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 46
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 47
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load %struct.strbuf*, %struct.strbuf** %3
%18 = call i32 @strbuf_addstr(%struct.strbuf* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %16, %10, %2
%20 = load %struct.strbuf*, %struct.strbuf** %3
%21 = load i8*, i8** %4
%22 = call i32 @strbuf_addstr(%struct.strbuf* %20, i8* %21)
ret void
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
@.str = [3 x i8] c"./\00"
define void @get_peg_path_buf(%struct.strbuf* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 46
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @strbuf_addstr(%struct.strbuf* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %5, %2
%12 = tail call i32 @strbuf_addstr(%struct.strbuf* %0, i8* %1)
ret void
}
unsigned int get_cid_simple(unsigned char *c, unsigned int *cid) {
  *cid = c[0];
  return 1;
}


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

x86 assembly (clang, -O2):
<get_cid_simple>:
movzbl (%rdi),%eax
mov    %eax,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_cid_simple(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = load i32*, i32** %4
store i32 %8, i32* %9
ret i32 1
}

LLVM IR (-O2):
define i32 @get_cid_simple(i8* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = zext i8 %3 to i32
store i32 %4, i32* %1
ret i32 1
}
AX0RX1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((((double *)10000000)[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0RX1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movslq -0x1c(%rbp),%rcx
mov    $0x989680,%eax
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     114d <AX0RX1+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <AX0RX1+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0RX1>:
movslq %edi,%rdx
movslq %esi,%rax
movsd  (%rcx,%rax,8),%xmm0
xor    %eax,%eax
ucomisd 0x989680(,%rdx,8),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @AX0RX1(double %0, double %1, i32 %2, i32 %3, double* nocapture readnone %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* inttoptr (i64 10000000 to double*), i64 %7
%9 = load double, double* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds double, double* %5, i64 %10
%12 = load double, double* %11
%13 = fcmp ole double %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
unsigned int hash_string(str) const char *str;
{
  unsigned int h;
  for (h = 0; *str; str++)
    h = (h << 5) + h + tolower((unsigned char)(*str));
  return h;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <hash_string+0x53>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <hash_string+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     114e <hash_string+0x3e>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ebp
shl    $0x5,%ebp
add    %eax,%ebp
movzbl %cl,%edi
call   1030 <tolower@plt>
add    %ebp,%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <hash_string+0x20>
jmp    1150 <hash_string+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = zext i8 %5 to i32
%10 = tail call i32 @tolower(i32 %9)
%11 = add i32 %10, %8
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %16
}
int test_imm_70int32_reg(int val) { return ((val) & (0x70 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_70int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x70,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_70int32_reg>:
test   $0x70,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_70int32_reg(i32 %0) {
%2 = and i32 %0, 112
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int do_030() { return 30; }


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

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

LLVM IR (-O0):
define i32 @do_030() {
ret i32 30
}

LLVM IR (-O2):
define i32 @do_030() {
ret i32 30
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
__attribute__((always_)) void foo(int i) { printf("printf %d\n", i); }


x86 assembly (clang, -O0):
<foo>:
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):
<foo>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"printf %d\0A\00"
define void @foo(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int test38(int r, int x, int y) {
  int z;
  return ((r < 0) || ((r == 0) && (x < y)));
}


x86 assembly (clang, -O0):
<test38>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x11(%rbp)
jl     113d <test38+0x3d>
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x12(%rbp)
jne    1137 <test38+0x37>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test38>:
test   %edi,%edi
sets   %al
sete   %cl
cmp    %edx,%esi
setl   %dl
and    %cl,%dl
or     %al,%dl
movzbl %dl,%eax
ret

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

LLVM IR (-O2):
define i32 @test38(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 0
%5 = icmp eq i32 %0, 0
%6 = icmp slt i32 %1, %2
%7 = and i1 %5, %6
%8 = or i1 %4, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ myexit(int);
int /*<<< orphan*/ perror(char const *);
void fatalperror(const char *string) {
  perror(string);
  myexit(1);
}


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

x86 assembly (clang, -O2):
<fatalperror>:
push   %rax
call   1040 <perror@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <myexit@plt>

LLVM IR (-O0):
define void @fatalperror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @myexit(i32 1)
ret void
}

LLVM IR (-O2):
define void @fatalperror(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @myexit(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ free_parser();
void quit() {
  free_parser();
  endwin();
  endwin();
}


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

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

LLVM IR (-O0):
define void @quit() {
%1 = call i32 (...) @free_parser()
%2 = call i32 (...) @endwin()
%3 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
define void @quit() {
%1 = tail call i32 (...) @free_parser()
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 (...) @endwin()
ret void
}
unsigned int _uiXMemRead(void *pusBuffer, unsigned long ulOffset,
                         unsigned int uiLen) {
  return (1);
}


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

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

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

LLVM IR (-O2):
define i32 @_uiXMemRead(i8* nocapture readnone %0, i64 %1, i32 %2) {
ret i32 1
}
a(int a, int b) {
  int i;
  i = (5 > 2) + (6 < 3);
  i = 1 < (2 + 3) < 4;
}


x86 assembly (clang, -O0):
<a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @a(i32 %0, i32 %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCHFRANDOMPROC(int const *const);
void scotchfrandomproc__(const int *const procnum) {
  SCOTCHFRANDOMPROC(procnum);
}


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

x86 assembly (clang, -O2):
<scotchfrandomproc__>:
jmp    1030 <SCOTCHFRANDOMPROC@plt>

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

LLVM IR (-O2):
define void @scotchfrandomproc__(i32* %0) {
%2 = tail call i32 @SCOTCHFRANDOMPROC(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mergeSort(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printArray(int *, int);
int main() {
  int arr[5] = {4, 2, 5, 18, 10};
  mergeSort(arr, 0, 4);
  printArray(arr, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <mergeSort@plt>
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
mov    0xee5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xeca(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <mergeSort@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <printArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [5 x i32] [i32 4, i32 2, i32 5, i32 18, i32 10]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @mergeSort(i32* %4, i32 0, i32 4)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%7 = call i32 @printArray(i32* %6, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 4, i32 2, i32 5, i32 18, i32 10]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @mergeSort(i32* %3, i32 0, i32 4)
%5 = call i32 @printArray(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *);
void moddep2(void) { printk("That is the question!\n"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"That is the question!\0A\00"
define void @moddep2() {
%1 = call i32 @printk(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"That is the question!\0A\00"
define void @moddep2() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *print_negation(char *prop) {
  size_t len = strlen(prop) + 2;
  char *buffer = malloc(sizeof(char) * len);
  assert(buffer);
  strcpy(buffer, "~");
  strcpy(buffer + 1, prop);
  return buffer;
}


x86 assembly (clang, -O0):
<print_negation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x2,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x18(%rbp),%rdi
lea    0xe7b(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_negation>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x2(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <assert@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0x1(%rbx),%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"~\00"
define i8* @print_negation(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 2
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i32 @assert(i8* %13)
%15 = load i8*, i8** %4
%16 = call i32 @strcpy(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 1
%19 = load i8*, i8** %2
%20 = call i32 @strcpy(i8* %18, i8* %19)
%21 = load i8*, i8** %4
ret i8* %21
}

LLVM IR (-O2):
@.str = [2 x i8] c"~\00"
define i8* @print_negation(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 2
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @assert(i8* %4)
%6 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
ret i8* %4
}
void curl_slist_append() {}


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

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

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

LLVM IR (-O2):
define void @curl_slist_append() {
ret void
}
int g(int a) { return a + 1; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
void *mbuff_mmap_at(char const *, int, int /*<<< orphan*/ *);
void *mbuff_mmap(const char *name, int size) {
  return mbuff_mmap_at(name, size, NULL);
}


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

x86 assembly (clang, -O2):
<mbuff_mmap>:
xor    %edx,%edx
jmp    1030 <mbuff_mmap_at@plt>

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

LLVM IR (-O2):
define i8* @mbuff_mmap(i8* %0, i32 %1) {
%3 = tail call i8* @mbuff_mmap_at(i8* %0, i32 %1, i32* null)
ret i8* %3
}
void av_default_item_name() {}


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

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

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

LLVM IR (-O2):
define void @av_default_item_name() {
ret void
}
int min_sleep_usec() { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @min_sleep_usec() {
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
char *getLongString();
void testFputs(FILE *f) {
  fputs("\nfputs:\n\n\n", f);
  fputs(getLongString(), f);
}


x86 assembly (clang, -O0):
<testFputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x0,%al
call   1040 <getLongString@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testFputs>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
xor    %eax,%eax
call   1040 <getLongString@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\0Afputs:\0A\0A\0A\00"
define void @testFputs(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fputs(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %3)
%5 = call i8* (...) @getLongString()
%6 = load i32*, i32** %2
%7 = call i32 @fputs(i8* %5, i32* %6)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0Afputs:\0A\0A\0A\00"
define void @testFputs(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 10, i64 1, i32* %0)
%3 = tail call i8* (...) @getLongString()
%4 = tail call i32 @fputs(i8* %3, i32* %0)
ret void
}
const char *BZ2_bzlibVersion(void) { return "1.0.3, 15-Feb-2005"; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"1.0.3, 15-Feb-2005\00"
define i8* @BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"1.0.3, 15-Feb-2005\00"
define i8* @BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
bool sancus_get_u16l(long v, uint16_t *out) {
  if ((v >= 0) && (v <= 0xffff)) {
    if (out != NULL)
      *out = (uint16_t)v;
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<sancus_get_u16l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1147 <sancus_get_u16l+0x47>
cmpq   $0xffff,-0x10(%rbp)
jg     1147 <sancus_get_u16l+0x47>
cmpq   $0x0,-0x18(%rbp)
je     113b <sancus_get_u16l+0x3b>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    114e <sancus_get_u16l+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_get_u16l>:
xor    %eax,%eax
cmp    $0xffff,%rdi
ja     1118 <sancus_get_u16l+0x18>
mov    $0x1,%eax
test   %rsi,%rsi
je     1118 <sancus_get_u16l+0x18>
mov    %rdi,(%rsi)
ret

LLVM IR (-O0):
define i32 @sancus_get_u16l(i64 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64*
store i64 %0, i64* %4
store i64* %1, i64** %5
%6 = load i64, i64* %4
%7 = icmp sge i64 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %2
%9 = load i64, i64* %4
%10 = icmp sle i64 %9, 65535
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i64*, i64** %5
%13 = icmp ne i64* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i64, i64* %4
%16 = load i64*, i64** %5
store i64 %15, i64* %16
br label %17
17: ; preds = %14, %11
store i32 1, i32* %3
br label %19
18: ; preds = %8, %2
store i32 0, i32* %3
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @sancus_get_u16l(i64 %0, i64* writeonly %1) {
%3 = icmp ult i64 %0, 65536
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = icmp eq i64* %1, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i64 %0, i64* %1
br label %7
7: ; preds = %2, %4, %6
%8 = phi i32 [ 1, %6 ], [ 1, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int PTHREAD_PRIO_PROTECT;
void test_PTHREAD_PRIO_PROTECT(void) {
  int dummy = PTHREAD_PRIO_PROTECT;
  (void)dummy;
}


x86 assembly (clang, -O0):
<test_PTHREAD_PRIO_PROTECT>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
@PTHREAD_PRIO_PROTECT = global i32 0
define void @test_PTHREAD_PRIO_PROTECT() {
%1 = alloca i32
%2 = load i32, i32* @PTHREAD_PRIO_PROTECT
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret void
}

LLVM IR (-O2):
@PTHREAD_PRIO_PROTECT = global i32 0
define void @test_PTHREAD_PRIO_PROTECT() {
ret void
}
const char *BZ2_bzlibVersion(void) { return "1.0.5, 10-Dec-2007"; }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"1.0.5, 10-Dec-2007\00"
define i8* @BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"1.0.5, 10-Dec-2007\00"
define i8* @BZ2_bzlibVersion() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
void inst_mc68851_pbcc() {
  slog("%s: Error, not implemented!\n", __func__);
  assert(!"blowup");
}


x86 assembly (clang, -O0):
<inst_mc68851_pbcc>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1040 <slog@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inst_mc68851_pbcc>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
call   1040 <slog@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%s: Error, not implemented!\0A\00"
@__func__.inst_mc68851_pbcc = [18 x i8] c"inst_mc68851_pbcc\00"
@.str.1 = [7 x i8] c"blowup\00"
define void @inst_mc68851_pbcc() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @slog to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.inst_mc68851_pbcc, i64 0, i64 0))
%2 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s: Error, not implemented!\0A\00"
@__func__.inst_mc68851_pbcc = [18 x i8] c"inst_mc68851_pbcc\00"
define void @inst_mc68851_pbcc() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @slog to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.inst_mc68851_pbcc, i64 0, i64 0))
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret void
}
unsigned hash_string(const char *string, unsigned n_buckets) {
  unsigned value = 0;
  while (*string)
    value = ((value * 31 + (int)*(const unsigned char *)string++) % n_buckets);
  return value;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <hash_string+0x44>
imul   $0x1f,-0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movzbl (%rcx),%ecx
add    %ecx,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,-0x10(%rbp)
jmp    1112 <hash_string+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%al
test   %al,%al
je     112e <hash_string+0x2e>
add    $0x1,%rdi
xor    %edx,%edx
nopl   0x0(%rax)
mov    %edx,%ecx
shl    $0x5,%ecx
sub    %edx,%ecx
movzbl %al,%eax
add    %ecx,%eax
xor    %edx,%edx
div    %esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_string+0x10>
mov    %edx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i32 [ %13, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = mul i32 %7, 31
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = zext i8 %6 to i32
%12 = add i32 %9, %11
%13 = urem i32 %12, %1
%14 = load i8, i8* %10
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ 0, %2 ], [ %13, %5 ]
ret i32 %17
}
void RTFileSeek(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileSeek() {
ret void
}
double h(double x, double y) { return __builtin_fmax(-x, -y); }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm3
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
movaps %xmm2,%xmm4
movaps %xmm3,%xmm0
cmpunordsd %xmm0,%xmm0
movaps %xmm0,%xmm1
pand   %xmm4,%xmm1
maxsd  %xmm3,%xmm2
pandn  %xmm2,%xmm0
por    %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
movapd %xmm0,%xmm2
cmpunordsd %xmm0,%xmm2
movapd %xmm2,%xmm3
andpd  %xmm1,%xmm3
minsd  %xmm0,%xmm1
andnpd %xmm1,%xmm2
orpd   %xmm3,%xmm2
xorpd  0xedb(%rip),%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @h(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fneg double %5
%7 = load double, double* %4
%8 = fneg double %7
%9 = call double @llvm.maxnum.f64(double %6, double %8)
ret double %9
}

LLVM IR (-O2):
define double @h(double %0, double %1) {
%3 = tail call double @llvm.minnum.f64(double %0, double %1)
%4 = fneg double %3
ret double %4
}
int fun301() { return 301; }


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

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

LLVM IR (-O0):
define i32 @fun301() {
ret i32 301
}

LLVM IR (-O2):
define i32 @fun301() {
ret i32 301
}
/* Variables and functions */
void *malloc(size_t const);
void *default_heap_alloc_fn(size_t const size, void *context, char const *file,
                            int const line, char const *fn) {
  ((void)(context));
  ((void)(file));
  ((void)(line));
  ((void)(fn));
  return malloc(size);
}


x86 assembly (clang, -O0):
<default_heap_alloc_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_heap_alloc_fn>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @default_heap_alloc_fn(i64 %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3, i8* nocapture readnone %4) {
%6 = tail call i8* @malloc(i64 %0)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ log_write(int, char *, char *, char *, char *);
void dbm_error(char *msg) {
  log_write(0x80000000, "DB", "ERROR", "Database error: %s\n", msg);
}


x86 assembly (clang, -O0):
<dbm_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%r8
mov    $0x80000000,%edi
lea    0xed4(%rip),%rsi
lea    0xed0(%rip),%rdx
lea    0xecf(%rip),%rcx
call   1030 <log_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbm_error>:
mov    %rdi,%r8
lea    0xee6(%rip),%rsi
lea    0xee2(%rip),%rdx
lea    0xee1(%rip),%rcx
mov    $0x80000000,%edi
jmp    1030 <log_write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"DB\00"
@.str.1 = [6 x i8] c"ERROR\00"
@.str.2 = [20 x i8] c"Database error: %s\0A\00"
define void @dbm_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @log_write(i32 -2147483648, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"DB\00"
@.str.1 = [6 x i8] c"ERROR\00"
@.str.2 = [20 x i8] c"Database error: %s\0A\00"
define void @dbm_error(i8* %0) {
%2 = tail call i32 @log_write(i32 -2147483648, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %0)
ret void
}
long long bit59() { return 0x0800000000000000LL; }


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

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

LLVM IR (-O0):
define i64 @bit59() {
ret i64 576460752303423488
}

LLVM IR (-O2):
define i64 @bit59() {
ret i64 576460752303423488
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_cmn(int /*<<< orphan*/);
int /*<<< orphan*/ t16_data_rdn3_op();
void t16_cmn_rdn3() { arm_arith_cmn(t16_data_rdn3_op()); }


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

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

LLVM IR (-O0):
define void @t16_cmn_rdn3() {
%1 = call i32 (...) @t16_data_rdn3_op()
%2 = call i32 @arm_arith_cmn(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_cmn_rdn3() {
%1 = tail call i32 (...) @t16_data_rdn3_op()
%2 = tail call i32 @arm_arith_cmn(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(float *, size_t, size_t, int /*<<< orphan*/ *);
int c_fwrite_real_(float *f, int *nf, FILE **fp) {
  return fwrite(f, (size_t)sizeof(float), (size_t)*nf, *fp);
}


x86 assembly (clang, -O0):
<c_fwrite_real_>:
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),%rax
movslq (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    $0x4,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fwrite_real_>:
movslq (%rsi),%rax
mov    (%rdx),%rcx
mov    $0x4,%esi
mov    %rax,%rdx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i32 @c_fwrite_real_(float* %0, i32* %1, i32** %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32**
store float* %0, float** %4
store i32* %1, i32** %5
store i32** %2, i32*** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = sext i32 %9 to i64
%11 = load i32**, i32*** %6
%12 = load i32*, i32** %11
%13 = call i32 @fwrite(float* %7, i64 4, i64 %10, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @c_fwrite_real_(float* nocapture %0, i32* nocapture %1, i32** nocapture %2) {
%4 = load i32, i32* %1
%5 = sext i32 %4 to i64
%6 = load i32*, i32** %2
%7 = tail call i32 @fwrite(float* %0, i64 4, i64 %5, i32* %6)
ret i32 %7
}
/* Variables and functions */
char *strchr(char *, char);
void strip_nl(char *ptr) {
  char *nl;
  if ((nl = strchr(ptr, '\n')) != NULL || (nl = strchr(ptr, '\r')) != NULL) {
    *nl = 0;
  }
}


x86 assembly (clang, -O0):
<strip_nl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1154 <strip_nl+0x44>
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     115b <strip_nl+0x4b>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_nl>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1135 <strip_nl+0x25>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1138 <strip_nl+0x28>
movb   $0x0,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strip_nl(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 13)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4, %1
%8 = phi i8* [ %2, %1 ], [ %5, %4 ]
store i8 0, i8* %8
br label %9
9: ; preds = %7, %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint_least16_t;
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ endian_16(int /*<<< orphan*/ const,
                             int /*<<< orphan*/ const);
uint_least16_t endian_big16(const uint8_t ptr[2]) {
  return endian_16(ptr[0], ptr[1]);
}


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

x86 assembly (clang, -O2):
<endian_big16>:
mov    (%rdi),%eax
mov    0x4(%rdi),%esi
mov    %eax,%edi
jmp    1030 <endian_16@plt>

LLVM IR (-O0):
define i32 @endian_big16(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = call i32 @endian_16(i32 %5, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @endian_big16(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @endian_16(i32 %2, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void fmt_convert_float_to_float(void *dest_v, void *src_v, int n) {
  memcpy(dest_v, src_v, n * sizeof(float));
}


x86 assembly (clang, -O0):
<fmt_convert_float_to_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmt_convert_float_to_float>:
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @fmt_convert_float_to_float(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32 @memcpy(i8* %7, i8* %8, i32 %12)
ret void
}

LLVM IR (-O2):
define void @fmt_convert_float_to_float(i8* %0, i8* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %4)
ret void
}