xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ abort();
int ige(int x, int y, int ok) {
  if ((x > y) || (x == y)) {
    if (!ok)
      abort();
  } else if (ok)
    abort();
}


x86 assembly (clang, -O0):
<ige>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1139 <ige+0x29>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    114f <ige+0x3f>
cmpl   $0x0,-0x10(%rbp)
jne    114a <ige+0x3a>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1165 <ige+0x55>
cmpl   $0x0,-0x10(%rbp)
je     1160 <ige+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1165 <ige+0x55>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ige>:
push   %rax
cmp    %esi,%edi
jge    1120 <ige+0x10>
test   %edx,%edx
je     1124 <ige+0x14>
xor    %eax,%eax
call   1030 <abort@plt>
test   %edx,%edx
je     1119 <ige+0x9>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ige(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp eq i32 %2, 0
br i1 %4, label %9, label %6
6: ; preds = %3
br i1 %5, label %7, label %12
7: ; preds = %6
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %3
br i1 %5, label %12, label %10
10: ; preds = %9
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %9, %6
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help(void) {
  printf("USAGE: MasterMind <-r|--rounds> <-g|--guesses> <-h|--help>\n\n");
  printf("This is a game where you guess a code which contains only the "
         "characters:\n '!', '-', '+', '#'\n This is more or less a "
         "implementation of the game MasterMind "
         "(\"http://en.wikipedia.org/wiki/Mastermind_(board_game)\")\n");
  printf("configuration options:\n\n-r, --rounds: configures the round "
         "count\n-g, --guesses: configures the count of guesses per round\n");
}


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

x86 assembly (clang, -O2):
<print_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf18(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [61 x i8] c"USAGE: MasterMind <-r|--rounds> <-g|--guesses> <-h|--help>\0A\0A\00"
@.str.1 = [214 x i8] c"This is a game where you guess a code which contains only the characters:\0A '!', '-', '+', '#'\0A This is more or less a implementation of the game MasterMind (\22http://en.wikipedia.org/wiki/Mastermind_(board_game)\22)\0A\00"
@.str.2 = [123 x i8] c"configuration options:\0A\0A-r, --rounds: configures the round count\0A-g, --guesses: configures the count of guesses per round\0A\00"
define void @print_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([214 x i8], [214 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([123 x i8], [123 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [60 x i8] c"USAGE: MasterMind <-r|--rounds> <-g|--guesses> <-h|--help>\0A\00"
@str.3 = [213 x i8] c"This is a game where you guess a code which contains only the characters:\0A '!', '-', '+', '#'\0A This is more or less a implementation of the game MasterMind (\22http://en.wikipedia.org/wiki/Mastermind_(board_game)\22)\00"
@str.4 = [122 x i8] c"configuration options:\0A\0A-r, --rounds: configures the round count\0A-g, --guesses: configures the count of guesses per round\00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([213 x i8], [213 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([122 x i8], [122 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DPRINT();
int /*<<< orphan*/ printf(char *, char const *, int, int);
void openlog(const char *ident, int option, int facility) {
  DPRINT();
  printf("Opening log: %s (%i, %i)\n", ident, option, facility);
}


x86 assembly (clang, -O0):
<openlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <DPRINT@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openlog>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <DPRINT@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Opening log: %s (%i, %i)\0A\00"
define void @openlog(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 = call i32 (...) @DPRINT()
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Opening log: %s (%i, %i)\0A\00"
define void @openlog(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @DPRINT()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
ret void
}
/* Variables and functions */
double sqrt(double);
double hypot2(double x, double y) { return sqrt(x * x + y * y); }


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

x86 assembly (clang, -O2):
<hypot2>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <hypot2+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @hypot2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @hypot2(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
void strxor80(char *t) {
  while (*t) {
    if ((*t & 0x7f) >= 0x20) {
      *t ^= 0x80;
    }
    t++;
  }
}


x86 assembly (clang, -O0):
<strxor80>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1148 <strxor80+0x48>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0x7f,%eax
cmp    $0x20,%eax
jl     1137 <strxor80+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    $0x80,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <strxor80+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strxor80>:
mov    (%rdi),%al
test   %al,%al
je     1126 <strxor80+0x26>
add    $0x1,%rdi
jmp    111b <strxor80+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1126 <strxor80+0x26>
test   $0x60,%al
je     1110 <strxor80+0x10>
xor    $0x80,%al
mov    %al,-0x1(%rdi)
jmp    1110 <strxor80+0x10>
ret

LLVM IR (-O0):
define void @strxor80(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %19, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %22
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 %10, 127
%12 = icmp sge i32 %11, 32
br i1 %12, label %13, label %19
13: ; preds = %7
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = xor i32 %16, 128
%18 = trunc i32 %17 to i8
store i8 %18, i8* %14
br label %19
19: ; preds = %13, %7
%20 = load i8*, i8** %2
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %2
br label %3
22: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @strxor80(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = and i8 %5, 96
%8 = icmp eq i8 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %4
%10 = xor i8 %5, -128
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
void ftpsend(int in, char *msg) {
  printf("> %s", msg);
  if (send(in, msg, strlen(msg), 0) < 0)
    die("Send", 1, in);
}


x86 assembly (clang, -O0):
<ftpsend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0x0,%rax
jge    11a4 <ftpsend+0x64>
mov    -0x4(%rbp),%edx
lea    0xe6b(%rip),%rdi
mov    $0x1,%esi
call   1060 <die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftpsend>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
test   %rax,%rax
js     1176 <ftpsend+0x36>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe88(%rip),%rdi
mov    $0x1,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <die@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"> %s\00"
@.str.1 = [5 x i8] c"Send\00"
define void @ftpsend(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i64 @send(i32 %0, i8* %1, i32 %4, i32 0)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @die(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 1, i32 %0)
br label %9
9: ; preds = %7, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ walk(unsigned char *, int);
int main() {
  static unsigned char buf[16];
  unsigned char *bp = buf;
  walk(buf, 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0x2f1a(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0x2f0f(%rip),%rdi
mov    $0x9,%esi
call   1030 <walk@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x2f28(%rip),%rdi
mov    $0x9,%esi
call   1030 <walk@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@main.buf = internal global [16 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @main.buf, i64 0, i64 0), i8** %2
%3 = call i32 @walk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @main.buf, i64 0, i64 0), i32 9)
ret i32 0
}

LLVM IR (-O2):
@main.buf = internal global [16 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @walk(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @main.buf, i64 0, i64 0), i32 9)
ret i32 0
}
extern int __compare_and_swap_with_release_semantics(long *p, long oldval,
                                                     long newval) {
  __asm__ __volatile__("" : : : "memory");
  return __compare_and_swap(p, oldval, newval);
}


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

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

LLVM IR (-O0):
define i32 @__compare_and_swap_with_release_semantics(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64*, i64** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 (i64*, i64, i64, ...) bitcast (i32 (...)* @__compare_and_swap to i32 (i64*, i64, i64, ...)*)(i64* %7, i64 %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__compare_and_swap_with_release_semantics(i64* %0, i64 %1, i64 %2) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
%4 = tail call i32 (i64*, i64, i64, ...) bitcast (i32 (...)* @__compare_and_swap to i32 (i64*, i64, i64, ...)*)(i64* %0, i64 %1, i64 %2)
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ mode_t;

/* Variables and functions */
scalar_t__ SYS_mkdir;
int syscall(long, long, long);
int mkdir(const char *pathname, mode_t mode) {
  return syscall((long)SYS_mkdir, (long)pathname, (long)mode);
}


x86 assembly (clang, -O0):
<mkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec1(%rip),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkdir>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ecb(%rip),%rax
mov    (%rax),%rdi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_mkdir = global i64 0
define i32 @mkdir(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* @SYS_mkdir
%6 = load i8*, i8** %3
%7 = ptrtoint i8* %6 to i64
%8 = load i64, i64* %4
%9 = call i32 @syscall(i64 %5, i64 %7, i64 %8)
ret i32 %9
}

LLVM IR (-O2):
@SYS_mkdir = global i64 0
define i32 @mkdir(i8* %0, i64 %1) {
%3 = load i64, i64* @SYS_mkdir
%4 = ptrtoint i8* %0 to i64
%5 = tail call i32 @syscall(i64 %3, i64 %4, i64 %1)
ret i32 %5
}
/* Type definitions */
struct Node {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ preorderDotDump(struct Node *, struct Node *,
                                   int /*<<< orphan*/ *);
void dotDump(struct Node *root, struct Node *sentinel, FILE *outputFile) {
  fprintf(outputFile, "digraph rbtree {\n");
  preorderDotDump(root, sentinel, outputFile);
  fprintf(outputFile, "}\n");
}


x86 assembly (clang, -O0):
<dotDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <preorderDotDump@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dotDump>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0xecb(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <preorderDotDump@plt>
lea    0xeb6(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <fwrite@plt>

LLVM IR (-O0):
%struct.Node = type { i32 }
@.str = [18 x i8] c"digraph rbtree {\0A\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @dotDump(%struct.Node* %0, %struct.Node* %1, i32* %2) {
%4 = alloca %struct.Node*
%5 = alloca %struct.Node*
%6 = alloca i32*
store %struct.Node* %0, %struct.Node** %4
store %struct.Node* %1, %struct.Node** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%9 = load %struct.Node*, %struct.Node** %4
%10 = load %struct.Node*, %struct.Node** %5
%11 = load i32*, i32** %6
%12 = call i32 @preorderDotDump(%struct.Node* %9, %struct.Node* %10, i32* %11)
%13 = load i32*, i32** %6
%14 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.Node = type { i32 }
@.str = [18 x i8] c"digraph rbtree {\0A\00"
@.str.1 = [3 x i8] c"}\0A\00"
define void @dotDump(%struct.Node* %0, %struct.Node* %1, i32* %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 17, i64 1, i32* %2)
%5 = tail call i32 @preorderDotDump(%struct.Node* %0, %struct.Node* %1, i32* %2)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64 2, i64 1, i32* %2)
ret void
}
sevenbit(s) char *s;
{
  while (*s) {
    *s &= 0x7f;
    s++;
  }
}


x86 assembly (clang, -O0):
<sevenbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <sevenbit+0x32>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    $0x7f,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <sevenbit+0x8>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sevenbit>:
mov    (%rdi),%al
test   %al,%al
je     1120 <sevenbit+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
and    $0x7f,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <sevenbit+0x10>
ret

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

LLVM IR (-O2):
define i32 @sevenbit(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = and i8 %5, 127
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ compute_numbytes_with_off(int /*<<< orphan*/ const,
                                             int /*<<< orphan*/ const);
int /*<<< orphan*/ ftello(int /*<<< orphan*/ *);
int64_t compute_numbytes(FILE *fp, const int64_t start) {
  const int64_t off = ftello(fp);
  return compute_numbytes_with_off(off, start);
}


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

x86 assembly (clang, -O2):
<compute_numbytes>:
push   %rbx
mov    %esi,%ebx
call   1030 <ftello@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <compute_numbytes_with_off@plt>

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

LLVM IR (-O2):
define i32 @compute_numbytes(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @ftello(i32* %0)
%4 = tail call i32 @compute_numbytes_with_off(i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int read_data_cmd();
int /*<<< orphan*/ send_ctrl_cmd(int);
unsigned int lcm_compare_id(void) {
  send_ctrl_cmd(0x00);
  return ((0x7601) == read_data_cmd()) ? 1 : 0;
}


x86 assembly (clang, -O0):
<lcm_compare_id>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    %eax,%esi
mov    $0x7601,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_compare_id>:
push   %rax
xor    %edi,%edi
call   1040 <send_ctrl_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
xor    %ecx,%ecx
cmp    $0x7601,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lcm_compare_id() {
%1 = call i32 @send_ctrl_cmd(i32 0)
%2 = call i32 (...) @read_data_cmd()
%3 = icmp eq i32 30209, %2
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @lcm_compare_id() {
%1 = tail call i32 @send_ctrl_cmd(i32 0)
%2 = tail call i32 (...) @read_data_cmd()
%3 = icmp eq i32 %2, 30209
%4 = zext i1 %3 to i32
ret i32 %4
}
(f)(int i) { return i - 1; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, -1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x8d() {
  Assert_real((ispunct(141) == 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_ispunct.c",
              710, ("ispunct should be 0 for 0x8d"));
}


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

x86 assembly (clang, -O2):
<t_ispunct_0x8d>:
push   %rax
mov    $0x8d,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2c6,%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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x8d\00"
define void @t_ispunct_0x8d() {
%1 = call i64 @ispunct(i32 141)
%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 710, 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_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0x8d\00"
define void @t_ispunct_0x8d() {
%1 = tail call i64 @ispunct(i32 141)
%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 710, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int f259(int *);
int f260(int *p) { return f259(p); }


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

x86 assembly (clang, -O2):
<f260>:
jmp    1030 <f259@plt>

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

LLVM IR (-O2):
define i32 @f260(i32* %0) {
%2 = tail call i32 @f259(i32* %0)
ret i32 %2
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void *memdup(const void *base, size_t size) {
  void *mem;
  if (size == 0)
    return NULL;
  mem = malloc(size);
  memcpy(mem, base, size);
  return mem;
}


x86 assembly (clang, -O0):
<memdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1148 <memdup+0x28>
movq   $0x0,-0x8(%rbp)
jmp    116e <memdup+0x4e>
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memdup>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     114b <memdup+0x2b>
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
jmp    114e <memdup+0x2e>
xor    %r14d,%r14d
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @memdup(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8* [ %5, %4 ], [ null, %2 ]
ret i8* %8
}
int ld_ge_cr2(long double a1) { return !(((100) >= (a1))); }


x86 assembly (clang, -O0):
<ld_ge_cr2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
flds   0xeed(%rip)
fucomip %st(1),%st
fstp   %st(0)
setae  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_ge_cr2>:
fldt   0x8(%rsp)
flds   0xef6(%rip)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
setb   %al
ret

LLVM IR (-O0):
define i32 @ld_ge_cr2(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = fcmp oge x86_fp80 0xK4005C800000000000000, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @ld_ge_cr2(x86_fp80 %0) {
%2 = fcmp ugt x86_fp80 %0, 0xK4005C800000000000000
%3 = zext i1 %2 to i32
ret i32 %3
}
int main(int argc, char **argv) {
  int x = 1;
  int i;
  for (i = 0; i < 3; i++) {
    x += x;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1141 <main+0x41>
mov    -0x14(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1120 <main+0x20>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 8
}
/* Variables and functions */
int fn1();
int __attribute__((cold)) main() { return fn1(); }


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <fn1@plt>
nopw   0x0(%rax,%rax,1)

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fn1()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(unsigned char);
void cmp_preg32pimm32_imm8(int reg32, unsigned int imm32, unsigned char imm8) {
  put8(0x80);
  put8(0xB8 + reg32);
  put32(imm32);
  put8(imm8);
}


x86 assembly (clang, -O0):
<cmp_preg32pimm32_imm8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x80,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%eax
add    $0xb8,%eax
movzbl %al,%edi
call   1030 <put8@plt>
mov    -0x8(%rbp),%edi
call   1040 <put32@plt>
movzbl -0x9(%rbp),%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_preg32pimm32_imm8>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0x80,%edi
call   1030 <put8@plt>
add    $0xb8,%bl
movzbl %bl,%edi
call   1030 <put8@plt>
mov    %ebp,%edi
call   1040 <put32@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @cmp_preg32pimm32_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = call i32 @put8(i8 zeroext -128)
%8 = load i32, i32* %4
%9 = add nsw i32 184, %8
%10 = trunc i32 %9 to i8
%11 = call i32 @put8(i8 zeroext %10)
%12 = load i32, i32* %5
%13 = call i32 @put32(i32 %12)
%14 = load i8, i8* %6
%15 = call i32 @put8(i8 zeroext %14)
ret void
}

LLVM IR (-O2):
define void @cmp_preg32pimm32_imm8(i32 %0, i32 %1, i8 zeroext %2) {
%4 = tail call i32 @put8(i8 zeroext -128)
%5 = trunc i32 %0 to i8
%6 = add i8 %5, -72
%7 = tail call i32 @put8(i8 zeroext %6)
%8 = tail call i32 @put32(i32 %1)
%9 = tail call i32 @put8(i8 zeroext %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ vfork();
void main() {
  pid_t pid_01;
  int count = 0;
  pid_01 = vfork();
  count++;
  printf("%d\n", count);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x8(%rbp)
call   1040 <vfork@plt>
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1040 <vfork@plt>
lea    0xec3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
%3 = call i32 @vfork()
store i32 %3, i32* %1
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = call i32 @vfork()
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ foo1();
int /*<<< orphan*/ foo2();
int main() {
  foo1();
  foo2();
  void *f = &foo1;
  void *g = &foo2;
  assert(((uintptr_t)f % 16) == 0);
  assert(((uintptr_t)g % 32) == 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1048 <foo1@plt>
mov    $0x0,%al
call   1040 <foo2@plt>
mov    0x2eab(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2e90(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
and    $0x1f,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1048 <foo1@plt>
xor    %eax,%eax
call   1040 <foo2@plt>
xor    %edi,%edi
testb  $0xf,0x2eb0(%rip)
sete   %dil
call   1030 <assert@plt>
xor    %edi,%edi
testb  $0x1f,0x2e8e(%rip)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i32 (...) @foo1()
%4 = call i32 (...) @foo2()
store i8* bitcast (i32 (...)* @foo1 to i8*), i8** %1
store i8* bitcast (i32 (...)* @foo2 to i8*), i8** %2
%5 = load i8*, i8** %1
%6 = ptrtoint i8* %5 to i64
%7 = urem i64 %6, 16
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i8*, i8** %2
%12 = ptrtoint i8* %11 to i64
%13 = urem i64 %12, 32
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @foo1()
%2 = tail call i32 (...) @foo2()
%3 = tail call i32 @assert(i32 zext (i1 icmp eq (i64 urem (i64 ptrtoint (i32 (...)* @foo1 to i64), i64 16), i64 0) to i32))
%4 = tail call i32 @assert(i32 zext (i1 icmp eq (i64 urem (i64 ptrtoint (i32 (...)* @foo2 to i64), i64 32), i64 0) to i32))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test(int, int, int);
int main() {
  printf("====RUNNING KEYGEN TESTS====\n\n");
  test(642, 164, 67);
  test(594, 177, 35);
  test(61, 75, 184);
  test(991, 255, 239);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x282,%edi
mov    $0xa4,%esi
mov    $0x43,%edx
call   1040 <test@plt>
mov    $0x252,%edi
mov    $0xb1,%esi
mov    $0x23,%edx
call   1040 <test@plt>
mov    $0x3d,%edi
mov    $0x4b,%esi
mov    $0xb8,%edx
call   1040 <test@plt>
mov    $0x3df,%edi
mov    $0xff,%esi
mov    $0xef,%edx
call   1040 <test@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x282,%edi
mov    $0xa4,%esi
mov    $0x43,%edx
call   1040 <test@plt>
mov    $0x252,%edi
mov    $0xb1,%esi
mov    $0x23,%edx
call   1040 <test@plt>
mov    $0x3d,%edi
mov    $0x4b,%esi
mov    $0xb8,%edx
call   1040 <test@plt>
mov    $0x3df,%edi
mov    $0xff,%esi
mov    $0xef,%edx
call   1040 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"====RUNNING KEYGEN TESTS====\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @test(i32 642, i32 164, i32 67)
%4 = call i32 @test(i32 594, i32 177, i32 35)
%5 = call i32 @test(i32 61, i32 75, i32 184)
%6 = call i32 @test(i32 991, i32 255, i32 239)
ret i32 0
}

LLVM IR (-O2):
@str = [30 x i8] c"====RUNNING KEYGEN TESTS====\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @test(i32 642, i32 164, i32 67)
%3 = tail call i32 @test(i32 594, i32 177, i32 35)
%4 = tail call i32 @test(i32 61, i32 75, i32 184)
%5 = tail call i32 @test(i32 991, i32 255, i32 239)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ vinlet_setup();
int /*<<< orphan*/ voutlet_setup();
void g_io_setup(void) {
  vinlet_setup();
  voutlet_setup();
}


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

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

LLVM IR (-O0):
define void @g_io_setup() {
%1 = call i32 (...) @vinlet_setup()
%2 = call i32 (...) @voutlet_setup()
ret void
}

LLVM IR (-O2):
define void @g_io_setup() {
%1 = tail call i32 (...) @vinlet_setup()
%2 = tail call i32 (...) @voutlet_setup()
ret void
}
long long fooinvdi(long long a) { return a ? 30 : ~30; }


x86 assembly (clang, -O0):
<fooinvdi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0xffffffe1,%eax
mov    $0x1e,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<fooinvdi>:
test   %rdi,%rdi
mov    $0xffffffffffffffe1,%rcx
mov    $0x1e,%eax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @fooinvdi(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 30, i32 -31
%7 = sext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @fooinvdi(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 -31, i64 30
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ printf(char *, char *);
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
main() {
  system("./test.sh");
  printf("Oh dear, something went wrong with read()! %s\n", strerror(errno));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <system@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %rax,%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <system@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb8(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"./test.sh\00"
@.str.1 = [47 x i8] c"Oh dear, something went wrong with read()! %s\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = call i8* @strerror(i32 %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"./test.sh\00"
@.str.1 = [47 x i8] c"Oh dear, something went wrong with read()! %s\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = tail call i8* @strerror(i32 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
char *strstr(char *, char *);
void trim_crlf(char *str) {
  char *p;
  p = strstr(str, "\r\n");
  if (p != NULL)
    *p = '\0';
}


x86 assembly (clang, -O0):
<trim_crlf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1142 <trim_crlf+0x32>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim_crlf>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1125 <trim_crlf+0x15>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"\0D\0A\00"
define void @trim_crlf(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @trim_crlf(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int rand();
void fill_random(char *x, size_t len) {
  size_t i;
  assert(x != NULL);
  for (i = 0; i < len; i++) {
    x[i] = '0' + (rand() % 40);
  }
}


x86 assembly (clang, -O0):
<fill_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1186 <fill_random+0x66>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x28,%ecx
cltd
idiv   %ecx
add    $0x30,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114a <fill_random+0x2a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_random>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
test   %r15,%r15
setne  %dil
call   1030 <assert@plt>
test   %r14,%r14
je     1174 <fill_random+0x54>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
shl    $0x3,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
add    $0x30,%al
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <fill_random+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @fill_random(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
store i64 0, i64* %5
br label %10
10: ; preds = %22, %2
%11 = load i64, i64* %5
%12 = load i64, i64* %4
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %10
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 40
%17 = add nsw i32 48, %16
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %3
%20 = load i64, i64* %5
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 %18, i8* %21
br label %22
22: ; preds = %14
%23 = load i64, i64* %5
%24 = add i64 %23, 1
store i64 %24, i64* %5
br label %10
25: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @fill_random(i8* writeonly %0, i64 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp eq i64 %1, 0
br i1 %6, label %16, label %7
7: ; preds = %2, %7
%8 = phi i64 [ %14, %7 ], [ 0, %2 ]
%9 = tail call i32 (...) @rand()
%10 = srem i32 %9, 40
%11 = trunc i32 %10 to i8
%12 = add nsw i8 %11, 48
%13 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 %12, i8* %13
%14 = add nuw i64 %8, 1
%15 = icmp eq i64 %14, %1
br i1 %15, label %16, label %7
16: ; preds = %7, %2
ret void
}
/* Variables and functions */
int get_left_sum(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
int main() { printf("\nget_left_sum(NULL) = %d", get_left_sum(NULL)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <get_left_sum@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [25 x i8] c"\0Aget_left_sum(NULL) = %d\00"
define i32 @main() {
%1 = call i32 @get_left_sum(i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0Aget_left_sum(NULL) = %d\00"
define i32 @main() {
%1 = tail call i32 @get_left_sum(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}