xunge/DecIR huggingface dataset:
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
void print_fib(int n) {
  while (n > 0) {
    printf("%d\n", fib(n));
    n--;
  }
}


x86 assembly (clang, -O0):
<print_fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1159 <print_fib+0x39>
mov    -0x4(%rbp),%edi
call   1040 <fib@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    112b <print_fib+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_fib>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    115b <print_fib+0x3b>
mov    %edi,%ebx
lea    0xecf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <fib@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
ja     1140 <print_fib+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_fib(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = tail call i32 @fib(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nsw i32 %4, -1
%8 = icmp ugt i32 %4, 1
br i1 %8, label %3, label %9
9: ; preds = %3, %1
ret void
}
/* Variables and functions */
int bdos(int, int);
int getnext() {
  bdos(26, 0x80);
  return bdos(18, NULL) & 0xff;
}


x86 assembly (clang, -O0):
<getnext>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1a,%edi
mov    $0x80,%esi
call   1030 <bdos@plt>
mov    $0x12,%edi
xor    %esi,%esi
call   1030 <bdos@plt>
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnext>:
push   %rax
mov    $0x1a,%edi
mov    $0x80,%esi
call   1030 <bdos@plt>
mov    $0x12,%edi
xor    %esi,%esi
call   1030 <bdos@plt>
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getnext() {
%1 = call i32 @bdos(i32 26, i32 128)
%2 = call i32 @bdos(i32 18, i32 0)
%3 = and i32 %2, 255
ret i32 %3
}

LLVM IR (-O2):
define i32 @getnext() {
%1 = tail call i32 @bdos(i32 26, i32 128)
%2 = tail call i32 @bdos(i32 18, i32 0)
%3 = and i32 %2, 255
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
unsigned long UINT32_MAX;
int /*<<< orphan*/ init_xor128(int /*<<< orphan*/);
void init_genrand(unsigned long s) { init_xor128((uint32_t)(s & UINT32_MAX)); }


x86 assembly (clang, -O0):
<init_genrand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ed1(%rip),%rcx
and    (%rcx),%rax
mov    %eax,%edi
call   1030 <init_xor128@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_genrand>:
mov    0x2ee1(%rip),%rax
and    (%rax),%edi
jmp    1030 <init_xor128@plt>

LLVM IR (-O0):
@UINT32_MAX = global i64 0
define void @init_genrand(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @UINT32_MAX
%5 = and i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = call i32 @init_xor128(i32 %6)
ret void
}

LLVM IR (-O2):
@UINT32_MAX = global i64 0
define void @init_genrand(i64 %0) {
%2 = load i64, i64* @UINT32_MAX
%3 = and i64 %2, %0
%4 = trunc i64 %3 to i32
%5 = tail call i32 @init_xor128(i32 %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ hash_keccak(int, int /*<<< orphan*/ const *,
                               int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                               int, int);
int hash_sha3_512(uint8_t *h, const uint8_t *m, uint64_t n) {
  hash_keccak(9 * 8, m, n, 0x06, h, 64, 64);
  return 1;
}


x86 assembly (clang, -O0):
<hash_sha3_512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%r8
mov    $0x48,%edi
mov    $0x6,%ecx
mov    $0x40,%r9d
movl   $0x40,(%rsp)
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_sha3_512>:
push   %rax
mov    %rdi,%r8
movl   $0x40,(%rsp)
mov    $0x48,%edi
mov    $0x6,%ecx
mov    $0x40,%r9d
call   1030 <hash_keccak@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @hash_sha3_512(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @hash_keccak(i32 72, i32* %1, i32 %2, i32 6, i32* %0, i32 64, i32 64)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xc7() {
  Assert_real((isalpha(199) == 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_isalpha.c",
              1000, ("isalpha should be 0 for 0xc7"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0xc7>:
push   %rax
mov    $0xc7,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3e8,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc7\00"
define void @t_isalpha_0xc7() {
%1 = call i64 @isalpha(i32 199)
%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 1000, 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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xc7\00"
define void @t_isalpha_0xc7() {
%1 = tail call i64 @isalpha(i32 199)
%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 1000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
void fflush_or_die(FILE *stream) {
  if (fflush(stream) < 0) {
    perror("fflush failed");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<fflush_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fflush@plt>
cmp    $0x0,%rax
jge    1165 <fflush_or_die+0x35>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fflush_or_die>:
push   %rax
call   1030 <fflush@plt>
test   %rax,%rax
js     113d <fflush_or_die+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"fflush failed\00"
define void @fflush_or_die(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @fflush(i32* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"fflush failed\00"
define void @fflush_or_die(i32* nocapture %0) {
%2 = tail call i64 @fflush(i32* %0)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
int f5(int a) { return a == 0 || a == 5; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <f5+0x20>
cmpl   $0x5,-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):
<f5>:
test   %edi,%edi
sete   %al
cmp    $0x5,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @f5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 5
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @f5(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp eq i32 %0, 5
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fs_tree_aux(int, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int fs_tree() {
  fprintf(stdout, "ROOT\n");
  fs_tree_aux(-1, 0);
}


x86 assembly (clang, -O0):
<fs_tree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
lea    0xec8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1030 <fs_tree_aux@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_tree>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <fs_tree_aux@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c"ROOT\0A\00"
define i32 @fs_tree() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @fs_tree_aux(i32 -1, i32 0)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c"ROOT\0A\00"
define i32 @fs_tree() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @fs_tree_aux(i32 -1, i32 0)
ret i32 undef
}
/* Variables and functions */
char *Strcpy1(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
void main(void) {
  char target[] = "ravin";
  char source[] = "hey";
  char *p = Strcpy1(target, source);
  printf("%s\n", p + 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xecc(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    0xec4(%rip),%eax
mov    %eax,-0xa(%rbp)
lea    -0x6(%rbp),%rdi
lea    -0xa(%rbp),%rsi
call   1030 <Strcpy1@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
add    $0x2,%rsi
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x6e,0x14(%rsp)
movl   $0x69766172,0x10(%rsp)
69
movl   $0x796568,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <Strcpy1@plt>
lea    0x2(%rax),%rsi
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.target = [6 x i8] c"ravin\00"
@__const.main.source = [4 x i8] c"hey\00"
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [6 x i8]
%2 = alloca [4 x i8]
%3 = alloca i8*
%4 = bitcast [6 x i8]* %1 to i8*
%5 = bitcast [4 x i8]* %2 to i8*
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%8 = call i8* @Strcpy1(i8* %6, i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret void
}

LLVM IR (-O2):
@__const.main.target = [6 x i8] c"ravin\00"
@.str = [4 x i8] c"%s\0A\00"
define void @main() {
%1 = alloca [6 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 7955816, i32* %2
%5 = call i8* @Strcpy1(i8* %3, i8* %4)
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutMotionFunc(void (*)(int, int));
void s2winMotionFunc(void (*func)(int x, int y)) { glutMotionFunc(func); }


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

x86 assembly (clang, -O2):
<s2winMotionFunc>:
jmp    1030 <glutMotionFunc@plt>

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

LLVM IR (-O2):
define void @s2winMotionFunc(void (i32, i32)* %0) {
%2 = tail call i32 @glutMotionFunc(void (i32, i32)* %0)
ret void
}
void physics_init() { return; }


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

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

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

LLVM IR (-O2):
define void @physics_init() {
ret void
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int ceil(double);
int numGTs(off_t outsize) {
  int numgrains = ceil((double)outsize / (0x00000080 * 0x00000200));
  return ceil((double)numgrains / 0x00000200);
}


x86 assembly (clang, -O0):
<numGTs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numGTs>:
push   %rax
cvtsi2sd %rdi,%xmm0
mulsd  0xee2(%rip),%xmm0
call   1030 <ceil@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed6(%rip),%xmm0
pop    %rax
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @numGTs(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = sitofp i64 %4 to double
%6 = fdiv double %5, 6.553600e+04
%7 = call i32 @ceil(double %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 5.120000e+02
%11 = call i32 @ceil(double %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @numGTs(i64 %0) {
%2 = sitofp i64 %0 to double
%3 = fmul double %2, 0x3EF0000000000000
%4 = tail call i32 @ceil(double %3)
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 0x3F60000000000000
%7 = tail call i32 @ceil(double %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assertTrue(char *, int);
int /*<<< orphan*/ do_void_malloc(double **);
void test_malloc_addr() {
  double *pd;
  do_void_malloc(&pd);
  assertTrue("pd[0] == 0", pd[0] == 0);
  ;
  assertTrue("pd[9] == 0", pd[9] == 0);
  ;
}


x86 assembly (clang, -O0):
<test_malloc_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <do_void_malloc@plt>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xeac(%rip),%rdi
call   1040 <assertTrue@plt>
mov    -0x8(%rbp),%rax
movsd  0x48(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe8e(%rip),%rdi
call   1040 <assertTrue@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_malloc_addr>:
push   %rax
mov    %rsp,%rdi
call   1030 <do_void_malloc@plt>
mov    (%rsp),%rax
xorpd  %xmm1,%xmm1
movsd  (%rax),%xmm0
cmpeqsd %xmm1,%xmm0
movq   %xmm0,%rsi
and    $0x1,%esi
lea    0xeb7(%rip),%rdi
call   1040 <assertTrue@plt>
mov    (%rsp),%rax
xorpd  %xmm0,%xmm0
cmpeqsd 0x48(%rax),%xmm0
movq   %xmm0,%rsi
and    $0x1,%esi
lea    0xea0(%rip),%rdi
call   1040 <assertTrue@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"pd[0] == 0\00"
@.str.1 = [11 x i8] c"pd[9] == 0\00"
define void @test_malloc_addr() {
%1 = alloca double*
%2 = call i32 @do_void_malloc(double** %1)
%3 = load double*, double** %1
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fcmp oeq double %5, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load double*, double** %1
%10 = getelementptr inbounds double, double* %9, i64 9
%11 = load double, double* %10
%12 = fcmp oeq double %11, 0.000000e+00
%13 = zext i1 %12 to i32
%14 = call i32 @assertTrue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"pd[0] == 0\00"
@.str.1 = [11 x i8] c"pd[9] == 0\00"
define void @test_malloc_addr() {
%1 = alloca double*
%2 = bitcast double** %1 to i8*
%3 = call i32 @do_void_malloc(double** %1)
%4 = load double*, double** %1
%5 = load double, double* %4
%6 = fcmp oeq double %5, 0.000000e+00
%7 = zext i1 %6 to i32
%8 = call i32 @assertTrue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load double*, double** %1
%10 = getelementptr inbounds double, double* %9, i64 9
%11 = load double, double* %10
%12 = fcmp oeq double %11, 0.000000e+00
%13 = zext i1 %12 to i32
%14 = call i32 @assertTrue(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %13)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ __list_splice(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_empty(struct list_head *);
void list_splice_init(struct list_head *list, struct list_head *head) {
  if (!list_empty(list)) {
    __list_splice(list, head);
    INIT_LIST_HEAD(list);
  }
}


x86 assembly (clang, -O0):
<list_splice_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <list_empty@plt>
cmp    $0x0,%eax
jne    1168 <list_splice_init+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <__list_splice@plt>
mov    -0x8(%rbp),%rdi
call   1030 <INIT_LIST_HEAD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_splice_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <list_empty@plt>
test   %eax,%eax
je     114b <list_splice_init+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <__list_splice@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_splice_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @list_empty(%struct.list_head* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load %struct.list_head*, %struct.list_head** %3
%10 = load %struct.list_head*, %struct.list_head** %4
%11 = call i32 @__list_splice(%struct.list_head* %9, %struct.list_head* %10)
%12 = load %struct.list_head*, %struct.list_head** %3
%13 = call i32 @INIT_LIST_HEAD(%struct.list_head* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_splice_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_empty(%struct.list_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @__list_splice(%struct.list_head* %0, %struct.list_head* %1)
%7 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
br label %8
8: ; preds = %5, %2
ret void
}
void wait_for(ch) register int ch;
{
  register int c;
  if (ch == '\n')
    while ((c = readchar()) != '\n')
      continue;
  else
    while (readchar() != ch)
      continue;
}


x86 assembly (clang, -O0):
<wait_for>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    1147 <wait_for+0x37>
jmp    112a <wait_for+0x1a>
mov    $0x0,%al
call   1030 <readchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1142 <wait_for+0x32>
jmp    112a <wait_for+0x1a>
jmp    1166 <wait_for+0x56>
jmp    114c <wait_for+0x3c>
mov    $0x0,%al
call   1030 <readchar@plt>
cmp    -0x4(%rbp),%eax
je     1161 <wait_for+0x51>
jmp    114c <wait_for+0x3c>
jmp    1166 <wait_for+0x56>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_for>:
push   %rbx
cmp    $0xa,%edi
jne    112e <wait_for+0x1e>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <readchar@plt>
cmp    $0xa,%eax
jne    1120 <wait_for+0x10>
jmp    113b <wait_for+0x2b>
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <readchar@plt>
cmp    %ebx,%eax
jne    1130 <wait_for+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @wait_for(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %12
6: ; preds = %1
br label %7
7: ; preds = %10, %6
%8 = call i32 (...) @readchar()
store i32 %8, i32* %3
%9 = icmp ne i32 %8, 10
br i1 %9, label %10, label %11
10: ; preds = %7
br label %7
11: ; preds = %7
br label %19
12: ; preds = %1
br label %13
13: ; preds = %17, %12
%14 = call i32 (...) @readchar()
%15 = load i32, i32* %2
%16 = icmp ne i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
br label %13
18: ; preds = %13
br label %19
19: ; preds = %18, %11
ret void
}

LLVM IR (-O2):
define void @wait_for(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1, %3
%4 = tail call i32 (...) @readchar()
%5 = icmp eq i32 %4, 10
br i1 %5, label %9, label %3
6: ; preds = %1, %6
%7 = tail call i32 (...) @readchar()
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %6
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xlFmtAbort(char *);
void xlCStkOver(void) { xlFmtAbort("control stack overflow"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"control stack overflow\00"
define void @xlCStkOver() {
%1 = call i32 @xlFmtAbort(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"control stack overflow\00"
define void @xlCStkOver() {
%1 = tail call i32 @xlFmtAbort(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ cstrncpy(char *, char *, int);
int main() {
  char *s1;
  char *s2;
  int n = __VERIFIER_nondet_int();
  cstrncpy(s1, s2, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <cstrncpy@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %4
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @cstrncpy(i8* %6, i8* %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @cstrncpy(i8* undef, i8* undef, i32 %1)
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
void sanitize_character(char **str, char character) {
  char *position = strchr(*str, character);
  while (position) {
    *position = '_';
    position = strchr(position, character);
  }
}


x86 assembly (clang, -O0):
<sanitize_character>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115e <sanitize_character+0x4e>
mov    -0x18(%rbp),%rax
movb   $0x5f,(%rax)
mov    -0x18(%rbp),%rdi
movsbl -0x9(%rbp),%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
jmp    1136 <sanitize_character+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sanitize_character>:
push   %rbx
mov    %esi,%ebx
mov    (%rdi),%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     1142 <sanitize_character+0x32>
movsbl %bl,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movb   $0x5f,(%rax)
mov    %rax,%rdi
mov    %ebx,%esi
call   1030 <strchr@plt>
test   %rax,%rax
jne    1130 <sanitize_character+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @sanitize_character(i8** nocapture %0, i8 signext %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @strchr(i8* dereferenceable(1) %3, i8 signext %1)
%5 = icmp eq i8* %4, null
br i1 %5, label %10, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %8, %6 ], [ %4, %2 ]
store i8 95, i8* %7
%8 = tail call i8* @strchr(i8* %7, i8 signext %1)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %6
10: ; preds = %6, %2
ret void
}
int shutdown(void) {
  int yesno = 1;
  return (yesno);
}


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

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

LLVM IR (-O0):
define i32 @shutdown() {
%1 = alloca i32
store i32 1, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @shutdown() {
ret i32 1
}
void inter_storage_sql_final(void) { return; }


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

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

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

LLVM IR (-O2):
define void @inter_storage_sql_final() {
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
scalar_t__ svc_getcaller(int /*<<< orphan*/ *);
struct sockaddr *nfs_getrpccaller(SVCXPRT *xprt) {
  return (struct sockaddr *)svc_getcaller(xprt);
}


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

x86 assembly (clang, -O2):
<nfs_getrpccaller>:
jmp    1030 <svc_getcaller@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define %struct.sockaddr* @nfs_getrpccaller(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @svc_getcaller(i32* %3)
%5 = inttoptr i64 %4 to %struct.sockaddr*
ret %struct.sockaddr* %5
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define %struct.sockaddr* @nfs_getrpccaller(i32* %0) {
%2 = tail call i64 @svc_getcaller(i32* %0)
%3 = inttoptr i64 %2 to %struct.sockaddr*
ret %struct.sockaddr* %3
}
char *_NewAtom(atomName)
char *atomName;
{
  static int sequence = 0;
  (void)sprintf(atomName, "_client%d", sequence);
  sequence = ((sequence < 20) ? sequence + 1 : 0);
  return atomName;
}


x86 assembly (clang, -O0):
<_NewAtom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2f06(%rip),%edx
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <sprintf@plt>
cmpl   $0x14,0x2ef1(%rip)
jge    1152 <_NewAtom+0x42>
mov    0x2ee5(%rip),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <_NewAtom+0x4c>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <_NewAtom+0x4c>
mov    -0xc(%rbp),%eax
mov    %eax,0x2ec7(%rip)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_NewAtom>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2f10(%rip),%edx
lea    0xedd(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <sprintf@plt>
mov    0x2efa(%rip),%eax
lea    0x1(%rax),%ecx
cmp    $0x14,%eax
cmovge %ebp,%ecx
mov    %ecx,0x2eeb(%rip)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@_NewAtom.sequence = internal unnamed_addr global i32 0
@.str = [10 x i8] c"_client%d\00"
define i8* @_NewAtom(i8* returned writeonly %0) {
%2 = load i32, i32* @_NewAtom.sequence
%3 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @_NewAtom.sequence
%5 = icmp slt i32 %4, 20
%6 = add nsw i32 %4, 1
%7 = select i1 %5, i32 %6, i32 0
store i32 %7, i32* @_NewAtom.sequence
ret i8* %0
}
__attribute__((always_)) void prefetch_stack(struct task_struct *t) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @prefetch_stack(%struct.task_struct* nocapture %0) {
ret void
}
/* Variables and functions */
int atoi(char *);
int parseConfigInt(char *str) {
  int n = atoi(str);
  if (n < 0)
    return -1;
  return n;
}


x86 assembly (clang, -O0):
<parseConfigInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    113e <parseConfigInt+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1144 <parseConfigInt+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseConfigInt>:
push   %rax
call   1030 <atoi@plt>
test   %eax,%eax
mov    $0xffffffff,%ecx
cmovs  %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @parseConfigInt(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
%3 = icmp sgt i32 %2, -1
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int num = 1;
  while (num <= 99) {
    printf("%i\n", num);
    num++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x63,-0x8(%rbp)
jg     114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%ebx
lea    0xee0(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
double g1(double x) { return -1.0; }


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @g1(double %0) {
%2 = alloca double
store double %0, double* %2
ret double -1.000000e+00
}

LLVM IR (-O2):
define double @g1(double %0) {
ret double -1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ __cxa_end_catch();
void _ITM_cxa_end_catch(void) { __cxa_end_catch(); }


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

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

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

LLVM IR (-O2):
define void @_ITM_cxa_end_catch() {
%1 = tail call i32 (...) @__cxa_end_catch()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int be32dec(int /*<<< orphan*/ const *);
uint64_t be64dec(const void *pp) {
  uint8_t const *p = (uint8_t const *)pp;
  return (((uint64_t)be32dec(p) << 32) | be32dec(p + 4));
}


x86 assembly (clang, -O0):
<be64dec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <be32dec@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x10,%rdi
call   1030 <be32dec@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<be64dec>:
push   %rbx
mov    %rdi,%rbx
call   1030 <be32dec@plt>
add    $0x10,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <be32dec@plt>

LLVM IR (-O0):
define i32 @be64dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @be32dec(i32* %6)
%8 = shl i32 %7, 32
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 4
%11 = call i32 @be32dec(i32* %10)
%12 = or i32 %8, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @be64dec(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @be32dec(i32* %2)
%4 = getelementptr inbounds i8, i8* %0, i64 16
%5 = bitcast i8* %4 to i32*
%6 = tail call i32 @be32dec(i32* %5)
ret i32 poison
}
/* Variables and functions */
int /*<<< orphan*/ intif_charposreq(int, char const *, int /*<<< orphan*/);
int intif_where(int account_id, const char *name) {
  intif_charposreq(account_id, name, 0);
  return 0;
}


x86 assembly (clang, -O0):
<intif_where>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
call   1030 <intif_charposreq@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @intif_where(i32 %0, i8* %1) {
%3 = tail call i32 @intif_charposreq(i32 %0, i8* %1, i32 0)
ret i32 0
}
void mouse_release_at(int _x, int _y, int _button) {}


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

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

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

LLVM IR (-O2):
define void @mouse_release_at(i32 %0, i32 %1, i32 %2) {
ret void
}
int main(argc, argv)
int argc;
char **argv;
{
  if (argc < 3) {
    printf("usage: %s file name\n", argv[0]);
    return 0;
  }
  MakeFuncTableCode(argv[1], argv[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1161 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    117f <main+0x5f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    $0x0,%al
call   1040 <MakeFuncTableCode@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jg     1139 <main+0x19>
mov    (%rsi),%rsi
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1148 <main+0x28>
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
xor    %eax,%eax
call   1040 <MakeFuncTableCode@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"usage: %s file name\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %11)
store i32 0, i32* %3
br label %21
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @MakeFuncTableCode to i32 (i8*, i8*, ...)*)(i8* %16, i8* %19)
store i32 0, i32* %3
br label %21
21: ; preds = %13, %8
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [21 x i8] c"usage: %s file name\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %13
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @MakeFuncTableCode to i32 (i8*, i8*, ...)*)(i8* %9, i8* %11)
br label %13
13: ; preds = %7, %4
ret i32 0
}
void tskmon_trace_thread() {}


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

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

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

LLVM IR (-O2):
define void @tskmon_trace_thread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void Bar() { printf(" Hello from Bar!\n "); }


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

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

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

LLVM IR (-O2):
@.str = [19 x i8] c" Hello from Bar!\0A \00"
define void @Bar() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}
void dbg_dump_inode(const struct ubifs_info *c, const struct inode *inode) {
  return;
}


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

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

LLVM IR (-O0):
%struct.ubifs_info = type opaque
%struct.inode = type opaque
define void @dbg_dump_inode(%struct.ubifs_info* %0, %struct.inode* %1) {
%3 = alloca %struct.ubifs_info*
%4 = alloca %struct.inode*
store %struct.ubifs_info* %0, %struct.ubifs_info** %3
store %struct.inode* %1, %struct.inode** %4
ret void
}

LLVM IR (-O2):
%struct.ubifs_info = type opaque
%struct.inode = type opaque
define void @dbg_dump_inode(%struct.ubifs_info* nocapture %0, %struct.inode* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int mkdirat_recursive_parents(int, char const *, int /*<<< orphan*/);
int mkdir_recursive_parents(const char *path, mode_t mode) {
  return mkdirat_recursive_parents(-100, path, mode);
}


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

x86 assembly (clang, -O2):
<mkdir_recursive_parents>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0xffffff9c,%edi
jmp    1030 <mkdirat_recursive_parents@plt>

LLVM IR (-O0):
define i32 @mkdir_recursive_parents(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 @mkdirat_recursive_parents(i32 -100, i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @mkdir_recursive_parents(i8* %0, i32 %1) {
%3 = tail call i32 @mkdirat_recursive_parents(i32 -100, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __pipe(int __pipedes[2]) {
  if (__pipedes == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <__pipe+0x31>
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1156 <__pipe+0x46>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__pipe>:
push   %rax
test   %rdi,%rdi
jne    111f <__pipe+0xf>
mov    0x2ebb(%rip),%rax
jmp    1126 <__pipe+0x16>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__pipe(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @EINVAL
%8 = call i32 @__set_errno(i32 %7)
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = load i32, i32* @ENOSYS
%11 = call i32 @__set_errno(i32 %10)
store i32 -1, i32* %2
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@EINVAL = global i32 0
@ENOSYS = global i32 0
define i32 @__pipe(i32* readnone %0) {
%2 = icmp eq i32* %0, null
%3 = load i32, i32* @EINVAL
%4 = load i32, i32* @ENOSYS
%5 = select i1 %2, i32 %3, i32 %4
%6 = tail call i32 @__set_errno(i32 %5)
ret i32 -1
}
short fun_short(void) { return 6; }


x86 assembly (clang, -O0):
<fun_short>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%ax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_short>:
mov    $0x6,%ax
ret

LLVM IR (-O0):
define signext i16 @fun_short() {
ret i16 6
}

LLVM IR (-O2):
define signext i16 @fun_short() {
ret i16 6
}