xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int);
int /*<<< orphan*/ output_w32(int);
int rd_rn_rm(int, int, int /*<<< orphan*/);
void emit_jno_unlikely(int a) {
  assem_debug("addvc pc,pc,#? (%x)\n", a);
  output_w32(0x72800000 | rd_rn_rm(15, 15, 0));
}


x86 assembly (clang, -O0):
<emit_jno_unlikely>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xf,%esi
xor    %edx,%edx
mov    %esi,%edi
call   1050 <rd_rn_rm@plt>
mov    %eax,%edi
or     $0x72800000,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_jno_unlikely>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1030 <assem_debug@plt>
mov    $0xf,%edi
mov    $0xf,%esi
xor    %edx,%edx
call   1050 <rd_rn_rm@plt>
or     $0x72800000,%eax
mov    %eax,%edi
pop    %rax
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"addvc pc,pc,#? (%x)\0A\00"
define void @emit_jno_unlikely(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @assem_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @rd_rn_rm(i32 15, i32 15, i32 0)
%6 = or i32 1920991232, %5
%7 = call i32 @output_w32(i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"addvc pc,pc,#? (%x)\0A\00"
define void @emit_jno_unlikely(i32 %0) {
%2 = tail call i32 @assem_debug(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @rd_rn_rm(i32 15, i32 15, i32 0)
%4 = or i32 %3, 1920991232
%5 = tail call i32 @output_w32(i32 %4)
ret void
}
int getParent(int *context) { return *(context + 9); }


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

x86 assembly (clang, -O2):
<getParent>:
mov    0x24(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @getParent(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 9
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @getParent(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 9
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int x;
  int y;
  if (!(x < 0))
    return 0;
  while (x < 0) {
    x = x + y;
    y++;
  }
  assert(y >= 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1135 <main+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1173 <main+0x63>
jmp    113a <main+0x2a>
cmpl   $0x0,-0x8(%rbp)
jge    115b <main+0x4b>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <main+0x2a>
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int ilog2(int x) {
  int l = -1;
  for (; x > 0; x /= 2)
    ++l;
  return l;
}


x86 assembly (clang, -O0):
<ilog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <ilog2+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <ilog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilog2>:
mov    $0xffffffff,%eax
test   %edi,%edi
jle    111c <ilog2+0x1c>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
add    $0x1,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1110 <ilog2+0x10>
ret

LLVM IR (-O0):
define i32 @ilog2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
br label %10
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 2
store i32 %12, i32* %2
br label %4
13: ; preds = %4
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ -1, %1 ]
%5 = phi i32 [ %7, %3 ], [ %0, %1 ]
%6 = add nsw i32 %4, 1
%7 = lshr i32 %5, 1
%8 = icmp ult i32 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ -1, %1 ], [ %6, %3 ]
ret i32 %10
}
void outb(unsigned char data, unsigned short addr) {
  __asm__("outb %%al,  %%dx" ::"a"(data), "d"(addr));
}


x86 assembly (clang, -O0):
<outb>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    -0x4(%rbp),%dx
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outb>:
mov    %esi,%edx
mov    %edi,%eax
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
store i8 %0, i8* %3
store i16 %1, i16* %4
%5 = load i8, i8* %3
%6 = load i16, i16* %4
ret void
}

LLVM IR (-O2):
define void @outb(i8 zeroext %0, i16 zeroext %1) {
tail call void asm sideeffect "outb %al, %dx", "{ax},{dx},~{dirflag},~{fpsr},~{flags}"(i8 %0, i16 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __sgetc(int /*<<< orphan*/ *);
int getc_unlocked(FILE *fp) { return (__sgetc(fp)); }


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

x86 assembly (clang, -O2):
<getc_unlocked>:
jmp    1030 <__sgetc@plt>

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

LLVM IR (-O2):
define i32 @getc_unlocked(i32* %0) {
%2 = tail call i32 @__sgetc(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fail_and_exit();
void *realloc(void *, size_t);
void *cc_realloc(void *memory, size_t size) {
  void *new_memory = realloc(memory, size);
  if (!new_memory)
    fail_and_exit();
  if (!memory)
    ;
  return new_memory;
}


x86 assembly (clang, -O0):
<cc_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <cc_realloc+0x33>
mov    $0x0,%al
call   1030 <fail_and_exit@plt>
cmpq   $0x0,-0x8(%rbp)
jne    1163 <cc_realloc+0x43>
jmp    1163 <cc_realloc+0x43>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_realloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <cc_realloc+0x15>
xor    %eax,%eax
call   1030 <fail_and_exit@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @cc_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @fail_and_exit()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int omap_rev();
int is_omap3530(void) {
  return (((omap_rev() >> 16) & 0xffff) == (0x3530)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_omap3530>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <omap_rev@plt>
mov    %eax,%edx
sar    $0x10,%edx
and    $0xffff,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x3530,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_omap3530>:
push   %rax
xor    %eax,%eax
call   1030 <omap_rev@plt>
and    $0xffff0000,%eax
xor    %ecx,%ecx
cmp    $0x35300000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_omap3530() {
%1 = call i32 (...) @omap_rev()
%2 = ashr i32 %1, 16
%3 = and i32 %2, 65535
%4 = icmp eq i32 %3, 13616
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 0
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_omap3530() {
%1 = tail call i32 (...) @omap_rev()
%2 = and i32 %1, -65536
%3 = icmp eq i32 %2, 892338176
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct obj {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cintern(char *);
int /*<<< orphan*/ setvar(int /*<<< orphan*/, int /*<<< orphan*/, struct obj *);
void init_siod_version(void) {
  setvar(cintern("*siod-version*"),
         cintern("$Id: sample.c,v 1.3 1997/05/16 02:19:41 gjc Exp $"),
         ((struct obj *)0));
}


x86 assembly (clang, -O0):
<init_siod_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,-0x4(%rbp)
lea    0xed1(%rip),%rdi
call   1040 <cintern@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <setvar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_siod_version>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1040 <cintern@plt>
mov    %eax,%ebx
lea    0xed9(%rip),%rdi
call   1040 <cintern@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1030 <setvar@plt>

LLVM IR (-O0):
%struct.obj = type { i32 }
@.str = [15 x i8] c"*siod-version*\00"
@.str.1 = [50 x i8] c"$Id: sample.c,v 1.3 1997/05/16 02:19:41 gjc Exp $\00"
define void @init_siod_version() {
%1 = call i32 @cintern(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @cintern(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}

LLVM IR (-O2):
%struct.obj = type { i32 }
@.str = [15 x i8] c"*siod-version*\00"
@.str.1 = [50 x i8] c"$Id: sample.c,v 1.3 1997/05/16 02:19:41 gjc Exp $\00"
define void @init_siod_version() {
%1 = tail call i32 @cintern(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @cintern(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @setvar(i32 %1, i32 %2, %struct.obj* null)
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int *alloca(int);
int main() {
  int length = __VERIFIER_nondet_int();
  if (length < 1 || length > 1000)
    length = 5;
  int *arr = alloca(length);
  if (arr != 0)
    return 0;
  int *a = arr;
  *a = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     1150 <main+0x30>
cmpl   $0x3e8,-0x8(%rbp)
jle    1157 <main+0x37>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <alloca@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117a <main+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1193 <main+0x73>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
lea    -0x3e9(%rax),%ecx
cmp    $0xfffffc18,%ecx
mov    $0x5,%edi
cmovae %eax,%edi
call   1030 <alloca@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = add i32 %1, -1001
%3 = icmp ult i32 %2, -1000
%4 = select i1 %3, i32 5, i32 %1
%5 = tail call i32* @alloca(i32 %4)
%6 = icmp ne i32* %5, null
tail call void @llvm.assume(i1 %6)
ret i32 0
}
char *estrdup(char *s) {
  s = strdup(s);
  if (s == ((void *)0))
    panic("out of memory");
  return s;
}


x86 assembly (clang, -O0):
<estrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1152 <estrdup+0x32>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <panic@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estrdup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <estrdup+0x1c>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <panic@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @estrdup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strdup(i8* %3)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @estrdup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @panic to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0xf6() {
  Assert_real((isprint(246) == 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_isprint.c",
              1235, ("isprint should be 0 for 0xf6"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0xf6>:
push   %rax
mov    $0xf6,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d3,%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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xf6\00"
define void @t_isprint_0xf6() {
%1 = call i64 @isprint(i32 246)
%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 1235, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0xf6\00"
define void @t_isprint_0xf6() {
%1 = tail call i64 @isprint(i32 246)
%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 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int sums(int);
int main() {
  int i = 10;
  printf("Value: %d   Sum: %d\n", i, sums(i));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <sums@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1040 <sums@plt>
lea    0xece(%rip),%rdi
mov    $0xa,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Value: %d Sum: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @sums(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Value: %d Sum: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @sums(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 10, i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Log(char *);
int /*<<< orphan*/ abort();
int SegV() {
  Log("Segmentation Fault caused abort");
  abort();
}


x86 assembly (clang, -O0):
<SegV>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <Log@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<SegV>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <Log@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Segmentation Fault caused abort\00"
define i32 @SegV() {
%1 = call i32 @Log(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Segmentation Fault caused abort\00"
define i32 @SegV() {
%1 = tail call i32 @Log(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char ch;
  printf("Please enter a few characters and <enter> and see how target\n");
  printf("echoes them back one by one...\n");
  while (1) {
    ch = getchar();
    printf("Target Got: %c\r", ch);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rbx
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [62 x i8] c"Please enter a few characters and <enter> and see how target\0A\00"
@.str.1 = [32 x i8] c"echoes them back one by one...\0A\00"
@.str.2 = [16 x i8] c"Target Got: %c\0D\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %5
}

LLVM IR (-O2):
@.str.2 = [16 x i8] c"Target Got: %c\0D\00"
@str = [61 x i8] c"Please enter a few characters and <enter> and see how target\00"
@str.3 = [31 x i8] c"echoes them back one by one...\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.3, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
%4 = tail call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %5)
br label %3
}
/* Variables and functions */
double floor(double);
double fmod20(double x) { return (x - 20.0 * (floor(x / 20.0))); }


x86 assembly (clang, -O0):
<fmod20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xeb6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmod20>:
push   %rax
movsd  %xmm0,(%rsp)
divsd  0xee2(%rip),%xmm0
call   1030 <floor@plt>
mulsd  0xedd(%rip),%xmm0
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @fmod20(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fdiv double %4, 2.000000e+01
%6 = call double @llvm.floor.f64(double %5)
%7 = call double @llvm.fmuladd.f64(double -2.000000e+01, double %6, double %3)
ret double %7
}

LLVM IR (-O2):
define double @fmod20(double %0) {
%2 = fdiv double %0, 2.000000e+01
%3 = tail call double @llvm.floor.f64(double %2)
%4 = tail call double @llvm.fmuladd.f64(double %3, double -2.000000e+01, double %0)
ret double %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ tlbtrace_ntlb_find2(int, int);
void emulate_ntlb2(int level, uint32_t l1_gpa, uint32_t l2_gpa, uint32_t gpa) {
  tlbtrace_ntlb_find2(l1_gpa & 0xFFFFF000, 0);
  if (level > 1) {
    tlbtrace_ntlb_find2(l2_gpa & 0xFFFFF000, 0);
  }
  if (level > 2) {
    tlbtrace_ntlb_find2(gpa, 1);
  }
}


x86 assembly (clang, -O0):
<emulate_ntlb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
and    $0xfffff000,%edi
xor    %esi,%esi
call   1030 <tlbtrace_ntlb_find2@plt>
cmpl   $0x1,-0x4(%rbp)
jle    114e <emulate_ntlb2+0x3e>
mov    -0xc(%rbp),%edi
and    $0xfffff000,%edi
xor    %esi,%esi
call   1030 <tlbtrace_ntlb_find2@plt>
cmpl   $0x2,-0x4(%rbp)
jle    1165 <emulate_ntlb2+0x55>
mov    -0x10(%rbp),%edi
mov    $0x1,%esi
call   1030 <tlbtrace_ntlb_find2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emulate_ntlb2>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebx
mov    %edi,%ebp
and    $0xfffff000,%esi
mov    %esi,%edi
xor    %esi,%esi
call   1030 <tlbtrace_ntlb_find2@plt>
cmp    $0x2,%ebp
jl     1143 <emulate_ntlb2+0x33>
and    $0xfffff000,%ebx
mov    %ebx,%edi
xor    %esi,%esi
call   1030 <tlbtrace_ntlb_find2@plt>
cmp    $0x2,%ebp
jne    1148 <emulate_ntlb2+0x38>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14d,%edi
mov    $0x1,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <tlbtrace_ntlb_find2@plt>

LLVM IR (-O0):
define void @emulate_ntlb2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = and i32 %9, -4096
%11 = call i32 @tlbtrace_ntlb_find2(i32 %10, i32 0)
%12 = load i32, i32* %5
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %18
14: ; preds = %4
%15 = load i32, i32* %7
%16 = and i32 %15, -4096
%17 = call i32 @tlbtrace_ntlb_find2(i32 %16, i32 0)
br label %18
18: ; preds = %14, %4
%19 = load i32, i32* %5
%20 = icmp sgt i32 %19, 2
br i1 %20, label %21, label %24
21: ; preds = %18
%22 = load i32, i32* %8
%23 = call i32 @tlbtrace_ntlb_find2(i32 %22, i32 1)
br label %24
24: ; preds = %21, %18
ret void
}

LLVM IR (-O2):
define void @emulate_ntlb2(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %1, -4096
%6 = tail call i32 @tlbtrace_ntlb_find2(i32 %5, i32 0)
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = and i32 %2, -4096
%10 = tail call i32 @tlbtrace_ntlb_find2(i32 %9, i32 0)
%11 = icmp eq i32 %0, 2
br i1 %11, label %14, label %12
12: ; preds = %8
%13 = tail call i32 @tlbtrace_ntlb_find2(i32 %3, i32 1)
br label %14
14: ; preds = %4, %12, %8
ret void
}
int test04_inv(int a) { return ((a & 0x55) != 0) ? 0x80000000 : 0x7FFFFFFF; }


x86 assembly (clang, -O0):
<test04_inv>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x55,%edx
mov    $0x7fffffff,%eax
mov    $0x80000000,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test04_inv>:
and    $0x55,%edi
cmp    $0x1,%edi
mov    $0x80000000,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @test04_inv(i32 %0) {
%2 = and i32 %0, 85
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 2147483647, i32 -2147483648
ret i32 %4
}
/* Variables and functions */
char const *getenv(char *);
const char *conf_get_autoconfig_name(void) {
  return getenv("KCONFIG_AUTOCONFIG");
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"KCONFIG_AUTOCONFIG\00"
define i8* @conf_get_autoconfig_name() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [19 x i8] c"KCONFIG_AUTOCONFIG\00"
define i8* @conf_get_autoconfig_name() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void RTLdrGetSymbol(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLdrGetSymbol() {
ret void
}
/* Variables and functions */
int do_send(int, char *);
int irc_v3_cap_end(int fd) { return do_send(fd, "CAP END"); }


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

x86 assembly (clang, -O2):
<irc_v3_cap_end>:
lea    0xee9(%rip),%rsi
jmp    1030 <do_send@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"CAP END\00"
define i32 @irc_v3_cap_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @do_send(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@.str = [8 x i8] c"CAP END\00"
define i32 @irc_v3_cap_end(i32 %0) {
%2 = tail call i32 @do_send(i32 %0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ print_prgname();
void fatal_ioerror(const char *str) {
  print_prgname();
  perror(str);
  exit(2);
}


x86 assembly (clang, -O0):
<fatal_ioerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <print_prgname@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatal_ioerror>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <print_prgname@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @fatal_ioerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @print_prgname()
%4 = load i8*, i8** %2
%5 = call i32 @perror(i8* %4)
%6 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
define void @fatal_ioerror(i8* nocapture %0) {
%2 = tail call i32 (...) @print_prgname()
%3 = tail call i32 @perror(i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
void foo238(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo238(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *, char *, char *);
char *google_earth_station_get_pdf_filename(char *application_name,
                                            char *station,
                                            char *document_root_directory) {
  static char filename[256];
  sprintf(filename, "%s/%s/%s/%s.pdf", document_root_directory,
          application_name, "dailyplots", station);
  return filename;
}


x86 assembly (clang, -O0):
<google_earth_station_get_pdf_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r9
lea    0x2f09(%rip),%rdi
lea    0xec2(%rip),%rsi
lea    0xecb(%rip),%r8
call   1030 <sprintf@plt>
lea    0x2eef(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<google_earth_station_get_pdf_filename>:
push   %rbx
mov    %rsi,%r9
mov    %rdi,%rcx
lea    0x2f22(%rip),%rbx
lea    0xedb(%rip),%rsi
lea    0xee4(%rip),%r8
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@google_earth_station_get_pdf_filename.filename = internal global [256 x i8] zeroinitializer
@.str = [16 x i8] c"%s/%s/%s/%s.pdf\00"
@.str.1 = [11 x i8] c"dailyplots\00"
define i8* @google_earth_station_get_pdf_filename(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @sprintf(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @google_earth_station_get_pdf_filename.filename, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %9)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @google_earth_station_get_pdf_filename.filename, i64 0, i64 0)
}

LLVM IR (-O2):
@google_earth_station_get_pdf_filename.filename = internal global [256 x i8] zeroinitializer
@.str = [16 x i8] c"%s/%s/%s/%s.pdf\00"
@.str.1 = [11 x i8] c"dailyplots\00"
define i8* @google_earth_station_get_pdf_filename(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([256 x i8], [256 x i8]* @google_earth_station_get_pdf_filename.filename, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @google_earth_station_get_pdf_filename.filename, i64 0, i64 0)
}
int main() {
  int i;
  int c;
  i = 0;
  c = 0;
  while (i < 20) {
    i = i + 1;
    if (i <= 10) {
    } else {
      c = c + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    1149 <main+0x49>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     113b <main+0x3b>
jmp    1144 <main+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1119 <main+0x19>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void chaz_ConfWriterPython_add_sys_include(const char *header) { (void)header; }


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

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

LLVM IR (-O0):
define void @chaz_ConfWriterPython_add_sys_include(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @chaz_ConfWriterPython_add_sys_include(i8* nocapture %0) {
ret void
}
int data_abort_unmask(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @data_abort_unmask() {
ret i32 0
}
int x0_process_synack(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x0_process_synack(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
void print_expression(name, expr) const char *name;
struct expression *expr;
{
  char buf[1024];
  print_subexpression(expr, buf, sizeof buf);
  log_info("%s: %s", name, buf);
}


x86 assembly (clang, -O0):
<print_expression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x410(%rbp),%rsi
mov    $0x400,%edx
mov    $0x0,%al
call   1040 <print_subexpression@plt>
mov    -0x8(%rbp),%rsi
lea    -0x410(%rbp),%rdx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <log_info@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_expression>:
push   %r14
push   %rbx
sub    $0x408,%rsp
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x400,%edx
mov    %rsi,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <print_subexpression@plt>
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <log_info@plt>
add    $0x408,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.expression = type opaque
@.str = [7 x i8] c"%s: %s\00"
define void @print_expression(i8* %0, %struct.expression* %1) {
%3 = alloca i8*
%4 = alloca %struct.expression*
%5 = alloca [1024 x i8]
store i8* %0, i8** %3
store %struct.expression* %1, %struct.expression** %4
%6 = load %struct.expression*, %struct.expression** %4
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%8 = call i32 (%struct.expression*, i8*, i64, ...) bitcast (i32 (...)* @print_subexpression to i32 (%struct.expression*, i8*, i64, ...)*)(%struct.expression* %6, i8* %7, i64 1024)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @log_info to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
%struct.expression = type opaque
@.str = [7 x i8] c"%s: %s\00"
define void @print_expression(i8* %0, %struct.expression* %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = call i32 (%struct.expression*, i8*, i64, ...) bitcast (i32 (...)* @print_subexpression to i32 (%struct.expression*, i8*, i64, ...)*)(%struct.expression* %1, i8* %4, i64 1024)
%6 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @log_info to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
ret void
}
/* Variables and functions */
float fabs(float inp) {
  if (inp < 0)
    return -inp;
  else
    return inp;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <fabs+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <fabs+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fneg float %7
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
void *tnode_list_hookcopyoralias(void *, int /*<<< orphan*/ *);
void *tnode_list_hookcopy(void *hook) {
  return tnode_list_hookcopyoralias(hook, NULL);
}


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

x86 assembly (clang, -O2):
<tnode_list_hookcopy>:
xor    %esi,%esi
jmp    1030 <tnode_list_hookcopyoralias@plt>

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

LLVM IR (-O2):
define i8* @tnode_list_hookcopy(i8* %0) {
%2 = tail call i8* @tnode_list_hookcopyoralias(i8* %0, i32* null)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ value;
typedef int /*<<< orphan*/ int16_t;
typedef scalar_t__ caddr_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(scalar_t__, int /*<<< orphan*/ *, int);
void ptr_set_int16_t(void *arg1, int offset, int16_t value) {
  memcpy((caddr_t)arg1 + offset, &value, sizeof(value));
}


x86 assembly (clang, -O0):
<ptr_set_int16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_set_int16_t>:
push   %rax
mov    %edx,0x4(%rsp)
movslq %esi,%rax
add    %rax,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @ptr_set_int16_t(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = ptrtoint i8* %0 to i64
%6 = sext i32 %1 to i64
%7 = add nsw i64 %6, %5
%8 = call i32 @memcpy(i64 %7, i32* %4, i32 4)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned char, int);
void fprint_mov_direct_to_Rn(FILE *stream, unsigned char n, uint8_t direct) {
  fprintf(stream,
          "MOV   R%X, "
          "0x%02X"
          "                  ",
          n, direct);
}


x86 assembly (clang, -O0):
<fprint_mov_direct_to_Rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x9(%rbp),%al
mov    -0x10(%rbp),%ecx
lea    0xeca(%rip),%rsi
movzbl %al,%edx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fprint_mov_direct_to_Rn>:
mov    %edx,%ecx
mov    %esi,%edx
lea    0xee5(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"MOV R%X, 0x%02X \00"
define void @fprint_mov_direct_to_Rn(i32* %0, i8 zeroext %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i32
store i32* %0, i32** %4
store i8 %1, i8* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i8, i8* %5
%9 = load i32, i32* %6
%10 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"MOV R%X, 0x%02X \00"
define void @fprint_mov_direct_to_Rn(i32* nocapture %0, i8 zeroext %1, i32 %2) {
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8 zeroext %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MAIN__();
int test2_() {
  MAIN__();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @test2_() {
%1 = call i32 (...) @MAIN__()
ret i32 0
}

LLVM IR (-O2):
define i32 @test2_() {
%1 = tail call i32 (...) @MAIN__()
ret i32 0
}
long long square(long long x) { return x * x; }


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

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

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

LLVM IR (-O2):
define i64 @square(i64 %0) {
%2 = mul nsw i64 %0, %0
ret i64 %2
}
void kasan_init_slab_obj(struct kmem_cache *cache, const void *object) {}


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

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

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

LLVM IR (-O2):
%struct.kmem_cache = type opaque
define void @kasan_init_slab_obj(%struct.kmem_cache* nocapture %0, i8* nocapture %1) {
ret void
}
double piapprox(int index, unsigned int n) {
  double approx;
  approx = 1.0 / (1.0 + (((double)index) - 0.5) / ((double)n) *
                            (((double)index) - 0.5) / ((double)n));
  return approx;
}


x86 assembly (clang, -O0):
<piapprox>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm2
movsd  0xef1(%rip),%xmm0
addsd  %xmm0,%xmm2
mov    -0x8(%rbp),%eax
cvtsi2sd %rax,%xmm1
movaps %xmm2,%xmm0
divsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeba(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<piapprox>:
cvtsi2sd %edi,%xmm0
addsd  0xef4(%rip),%xmm0
mov    %esi,%eax
cvtsi2sd %rax,%xmm1
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm1,%xmm2
movsd  0xedd(%rip),%xmm0
addsd  %xmm0,%xmm2
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @piapprox(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = fsub double %7, 5.000000e-01
%9 = load i32, i32* %4
%10 = uitofp i32 %9 to double
%11 = fdiv double %8, %10
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = fsub double %13, 5.000000e-01
%15 = fmul double %11, %14
%16 = load i32, i32* %4
%17 = uitofp i32 %16 to double
%18 = fdiv double %15, %17
%19 = fadd double 1.000000e+00, %18
%20 = fdiv double 1.000000e+00, %19
store double %20, double* %5
%21 = load double, double* %5
ret double %21
}

LLVM IR (-O2):
define double @piapprox(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = fadd double %3, -5.000000e-01
%5 = uitofp i32 %1 to double
%6 = fdiv double %4, %5
%7 = fmul double %4, %6
%8 = fdiv double %7, %5
%9 = fadd double %8, 1.000000e+00
%10 = fdiv double 1.000000e+00, %9
ret double %10
}