xunge/DecIR huggingface dataset:
int *list4(x, y, z, t)
int *y, *z, *t;
{
  int *p = newvec(3);
  p[0] = x;
  p[1] = (int)y;
  p[2] = (int)z;
  p[3] = (int)t;
  return p;
}


x86 assembly (clang, -O0):
<list4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x3,%edi
mov    $0x0,%al
call   1030 <newvec@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x20(%rbp),%rax
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list4>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x3,%edi
xor    %eax,%eax
call   1030 <newvec@plt>
cltq
mov    %ebp,(%rax)
mov    %ebx,0x4(%rax)
mov    %r15d,0x8(%rax)
mov    %r14d,0xc(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @list4(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = call i32 (i32, ...) bitcast (i32 (...)* @newvec to i32 (i32, ...)*)(i32 3)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
store i32* %12, i32** %9
%13 = load i32, i32* %5
%14 = load i32*, i32** %9
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
%16 = load i32*, i32** %6
%17 = ptrtoint i32* %16 to i32
%18 = load i32*, i32** %9
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %17, i32* %19
%20 = load i32*, i32** %7
%21 = ptrtoint i32* %20 to i32
%22 = load i32*, i32** %9
%23 = getelementptr inbounds i32, i32* %22, i64 2
store i32 %21, i32* %23
%24 = load i32*, i32** %8
%25 = ptrtoint i32* %24 to i32
%26 = load i32*, i32** %9
%27 = getelementptr inbounds i32, i32* %26, i64 3
store i32 %25, i32* %27
%28 = load i32*, i32** %9
ret i32* %28
}

LLVM IR (-O2):
define i32* @list4(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @newvec to i32 (i32, ...)*)(i32 3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
store i32 %0, i32* %7
%8 = ptrtoint i32* %1 to i64
%9 = trunc i64 %8 to i32
%10 = getelementptr inbounds i32, i32* %7, i64 1
store i32 %9, i32* %10
%11 = ptrtoint i32* %2 to i64
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds i32, i32* %7, i64 2
store i32 %12, i32* %13
%14 = ptrtoint i32* %3 to i64
%15 = trunc i64 %14 to i32
%16 = getelementptr inbounds i32, i32* %7, i64 3
store i32 %15, i32* %16
ret i32* %7
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int yesno(int /*<<< orphan*/);
bool is_quiet(void) { return yesno(getenv("EINFO_QUIET")); }


x86 assembly (clang, -O0):
<is_quiet>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1040 <yesno@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_quiet>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <yesno@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"EINFO_QUIET\00"
define i32 @is_quiet() {
%1 = call i32 @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @yesno(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [12 x i8] c"EINFO_QUIET\00"
define i32 @is_quiet() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @yesno(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ baz();
int /*<<< orphan*/ foo();
void doit() {
  foo();
  bar();
  baz();
}


x86 assembly (clang, -O0):
<doit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <foo@plt>
mov    $0x0,%al
call   1040 <bar@plt>
mov    $0x0,%al
call   1030 <baz@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<doit>:
push   %rax
xor    %eax,%eax
call   1050 <foo@plt>
xor    %eax,%eax
call   1040 <bar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <baz@plt>

LLVM IR (-O0):
define void @doit() {
%1 = call i32 (...) @foo()
%2 = call i32 (...) @bar()
%3 = call i32 (...) @baz()
ret void
}

LLVM IR (-O2):
define void @doit() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @bar()
%3 = tail call i32 (...) @baz()
ret void
}
/* Type definitions */
typedef int u_int8_t;
typedef int u_int16_t;

/* Variables and functions */
void encode_16(u_int8_t *cp, u_int16_t x) {
  *cp++ = x >> 8;
  *cp = x & 0xff;
}


x86 assembly (clang, -O0):
<encode_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode_16>:
movzbl %sil,%eax
sar    $0x8,%esi
mov    %esi,(%rdi)
mov    %eax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @encode_16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i32 1
store i32* %8, i32** %3
store i32 %6, i32* %7
%9 = load i32, i32* %4
%10 = and i32 %9, 255
%11 = load i32*, i32** %3
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @encode_16(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %0
%5 = and i32 %1, 255
store i32 %5, i32* %4
ret void
}
void energest_type_set(int type, unsigned long val) {}


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

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

LLVM IR (-O0):
define void @energest_type_set(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @energest_type_set(i32 %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void tt_print_options(void) {
  printf("using ");
  printf("LINESCAN  ");
  printf("LOWRES: %d  ", 3);
  printf("FAST_SWEEP  ");
  printf("\n");
}


x86 assembly (clang, -O0):
<tt_print_options>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tt_print_options>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xece(%rip),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"using \00"
@.str.1 = [11 x i8] c"LINESCAN \00"
@.str.2 = [13 x i8] c"LOWRES: %d \00"
@.str.3 = [13 x i8] c"FAST_SWEEP \00"
@.str.4 = [2 x i8] c"\0A\00"
define void @tt_print_options() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 3)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"using \00"
@.str.1 = [11 x i8] c"LINESCAN \00"
@.str.2 = [13 x i8] c"LOWRES: %d \00"
@.str.3 = [13 x i8] c"FAST_SWEEP \00"
define void @tt_print_options() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 3)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put(int);
void put_char(int c) { put(c); }


x86 assembly (clang, -O0):
<put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_char>:
jmp    1030 <put@plt>

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

LLVM IR (-O2):
define void @put_char(i32 %0) {
%2 = tail call i32 @put(i32 %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t be16(uint16_t x) { return ((x & 0xff) << 8) | ((x & 0xFF00) >> 8); }


x86 assembly (clang, -O0):
<be16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x8,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<be16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @be16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 8
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @be16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ f(int, int);
int /*<<< orphan*/ g();
void main(int i) {
  g();
  if (1)
    f(1, 2);
  else
    f(3, 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <g@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <g@plt>
mov    $0x1,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 (...) @g()
%3 = tail call i32 @f(i32 1, i32 2)
ret void
}
void func0(int var1, int var2) {
  var1 = var2;
  var1 = var2 + var2;
  var1 = var2 - var2;
  var1 = var2 < var1;
  var1 = var2 > var1;
  var1 = var2 * var1;
  var1 = var2 / var1;
  var1 = var2 % var1;
  var1 = var2 % var1;
}


x86 assembly (clang, -O0):
<func0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func0(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
store i32 %5, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = sub nsw i32 %9, %10
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = icmp sgt i32 %16, %17
%19 = zext i1 %18 to i32
store i32 %19, i32* %3
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = mul nsw i32 %20, %21
store i32 %22, i32* %3
%23 = load i32, i32* %4
%24 = load i32, i32* %3
%25 = sdiv i32 %23, %24
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = srem i32 %26, %27
store i32 %28, i32* %3
%29 = load i32, i32* %4
%30 = load i32, i32* %3
%31 = srem i32 %29, %30
store i32 %31, i32* %3
ret void
}

LLVM IR (-O2):
define void @func0(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ wBuiltinArrayBound(int);
void wBuiltinUBound() { wBuiltinArrayBound(1); }


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

x86 assembly (clang, -O2):
<wBuiltinUBound>:
mov    $0x1,%edi
jmp    1030 <wBuiltinArrayBound@plt>

LLVM IR (-O0):
define void @wBuiltinUBound() {
%1 = call i32 @wBuiltinArrayBound(i32 1)
ret void
}

LLVM IR (-O2):
define void @wBuiltinUBound() {
%1 = tail call i32 @wBuiltinArrayBound(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ error_exit(int /*<<< orphan*/);
int main(int argc, char **argv) { error_exit(atoi(argv[1])); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <error_exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <error_exit@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(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 = getelementptr inbounds i8*, i8** %5, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @atoi(i8* %7)
%9 = call i32 @error_exit(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @error_exit(i32 %5)
ret i32 0
}
void fghRestoreState(void) {}


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

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

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

LLVM IR (-O2):
define void @fghRestoreState() {
ret void
}
/* Variables and functions */
double shr(double, int);
double dblShr(double a, int b) { return shr(a, b); }


x86 assembly (clang, -O0):
<dblShr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%edi
call   1030 <shr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblShr>:
jmp    1030 <shr@plt>

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

LLVM IR (-O2):
define double @dblShr(double %0, i32 %1) {
%3 = tail call double @shr(double %0, i32 %1)
ret double %3
}
void train_colorizer(char *cfg, char *weight, char *acfg, char *aweight,
                     int clear, int display) {}


x86 assembly (clang, -O0):
<train_colorizer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @train_colorizer(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i32 %4, i32 %5) {
ret void
}
/* Type definitions */
typedef unsigned char value;
typedef int u_int32_t;

/* Variables and functions */
unsigned char *serialize_u_int32_t(unsigned char *buffer, u_int32_t value) {
  buffer[0] = (value >> 24) & 0xFF;
  buffer[1] = (value >> 16) & 0xFF;
  buffer[2] = (value >> 8) & 0xFF;
  buffer[3] = (value)&0xFF;
  return buffer + 4;
}


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

x86 assembly (clang, -O2):
<serialize_u_int32_t>:
bswap  %esi
mov    %esi,(%rdi)
lea    0x4(%rdi),%rax
ret

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

LLVM IR (-O2):
define i8* @serialize_u_int32_t(i8* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
%13 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %13
}
/* Variables and functions */
int /*<<< orphan*/ output_append_orbits(char *);
scalar_t__ output_check(int);
int /*<<< orphan*/ output_timing();
void problem_output() {
  if (output_check(20. * 3.14159265358979323846)) {
    output_timing();
  }
  if (output_check(12.)) {
    output_append_orbits("orbits.txt");
  }
}


x86 assembly (clang, -O0):
<problem_output>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e,%edi
call   1040 <output_check@plt>
cmp    $0x0,%rax
je     114f <problem_output+0x1f>
mov    $0x0,%al
call   1030 <output_timing@plt>
mov    $0xc,%edi
call   1040 <output_check@plt>
cmp    $0x0,%rax
je     116f <problem_output+0x3f>
lea    0xe96(%rip),%rdi
call   1050 <output_append_orbits@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<problem_output>:
push   %rax
mov    $0x3e,%edi
call   1040 <output_check@plt>
test   %rax,%rax
je     1147 <problem_output+0x17>
xor    %eax,%eax
call   1030 <output_timing@plt>
mov    $0xc,%edi
call   1040 <output_check@plt>
test   %rax,%rax
je     1163 <problem_output+0x33>
lea    0xea3(%rip),%rdi
pop    %rax
jmp    1050 <output_append_orbits@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"orbits.txt\00"
define void @problem_output() {
%1 = call i64 @output_check(i32 62)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
%6 = call i64 @output_check(i32 12)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @output_append_orbits(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"orbits.txt\00"
define void @problem_output() {
%1 = tail call i64 @output_check(i32 62)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @output_timing()
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @output_check(i32 12)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @output_append_orbits(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
void d_putsb(unsigned char *ptr, signed char data) { *ptr = data; }


x86 assembly (clang, -O0):
<d_putsb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_putsb>:
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @d_putsb(i8* nocapture writeonly %0, i8 signext %1) {
store i8 %1, i8* %0
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_futex;
int syscall(int /*<<< orphan*/, void *, int, int, struct timespec const *,
            void *, int);
int sys_futex(void *addr1, int op, int val1, const struct timespec *timeout,
              void *addr2, int val3) {
  return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
}


x86 assembly (clang, -O0):
<sys_futex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
mov    -0x24(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_futex>:
push   %rax
mov    %r8,%rax
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
mov    0x2ebb(%rip),%rdi
mov    (%rdi),%edi
mov    %r9d,(%rsp)
mov    %rax,%r9
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @sys_futex(i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store %struct.timespec* %3, %struct.timespec** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i32, i32* @SYS_futex
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = load %struct.timespec*, %struct.timespec** %10
%18 = load i8*, i8** %11
%19 = load i32, i32* %12
%20 = call i32 @syscall(i32 %13, i8* %14, i32 %15, i32 %16, %struct.timespec* %17, i8* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_futex = global i32 0
define i32 @sys_futex(i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5) {
%7 = load i32, i32* @SYS_futex
%8 = tail call i32 @syscall(i32 %7, i8* %0, i32 %1, i32 %2, %struct.timespec* %3, i8* %4, i32 %5)
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ m34setParams7FFD(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ m34setRAM(int /*<<< orphan*/, int /*<<< orphan*/);
void m34setParams7FFD_RAM(uint16_t addr, uint8_t val) {
  m34setRAM(addr, val);
  m34setParams7FFD(addr, val);
}


x86 assembly (clang, -O0):
<m34setParams7FFD_RAM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <m34setRAM@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <m34setParams7FFD@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m34setParams7FFD_RAM>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <m34setRAM@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <m34setParams7FFD@plt>

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

LLVM IR (-O2):
define void @m34setParams7FFD_RAM(i32 %0, i32 %1) {
%3 = tail call i32 @m34setRAM(i32 %0, i32 %1)
%4 = tail call i32 @m34setParams7FFD(i32 %0, i32 %1)
ret void
}
/* Type definitions */
struct thread {
  int dummy;
};

/* Variables and functions */
void arch_init_thread(struct thread *thread, uintptr_t stack_top,
                      void (*entry)(void *), void *arg) {
  (void)thread;
  (void)stack_top;
  (void)entry;
  (void)arg;
  (void)(0);
}


x86 assembly (clang, -O0):
<arch_init_thread>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.thread = type { i32 }
define void @arch_init_thread(%struct.thread* %0, i64 %1, void (i8*)* %2, i8* %3) {
%5 = alloca %struct.thread*
%6 = alloca i64
%7 = alloca void (i8*)*
%8 = alloca i8*
store %struct.thread* %0, %struct.thread** %5
store i64 %1, i64* %6
store void (i8*)* %2, void (i8*)** %7
store i8* %3, i8** %8
%9 = load %struct.thread*, %struct.thread** %5
%10 = load i64, i64* %6
%11 = load void (i8*)*, void (i8*)** %7
%12 = load i8*, i8** %8
ret void
}

LLVM IR (-O2):
%struct.thread = type { i32 }
define void @arch_init_thread(%struct.thread* nocapture %0, i64 %1, void (i8*)* nocapture %2, i8* nocapture %3) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int8_t;

/* Variables and functions */
int inBounds(u_int8_t *start, u_int8_t *end, u_int8_t *p) {
  if (p >= start && p < end) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<inBounds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1138 <inBounds+0x38>
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1138 <inBounds+0x38>
movl   $0x1,-0x4(%rbp)
jmp    113f <inBounds+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inBounds>:
cmp    %rdi,%rdx
setae  %al
cmp    %rsi,%rdx
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @inBounds(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** %7
%9 = load i32*, i32** %5
%10 = icmp uge i32* %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i32*, i32** %7
%13 = load i32*, i32** %6
%14 = icmp ult i32* %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 1, i32* %4
br label %17
16: ; preds = %11, %3
store i32 0, i32* %4
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @inBounds(i32* readnone %0, i32* readnone %1, i32* readnone %2) {
%4 = icmp uge i32* %2, %0
%5 = icmp ult i32* %2, %1
%6 = and i1 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void cleanup() {
  endwin();
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <endwin@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
xor    %eax,%eax
call   1030 <endwin@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define void @cleanup() {
%1 = call i32 (...) @endwin()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define void @cleanup() {
%1 = tail call i32 (...) @endwin()
%2 = load i32, i32* @EXIT_SUCCESS
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
char const *sqliterkGetResultCodeDescription(int);
const char *sqliterk_description(int result) {
  return sqliterkGetResultCodeDescription(result);
}


x86 assembly (clang, -O0):
<sqliterk_description>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sqliterkGetResultCodeDescription@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqliterk_description>:
jmp    1030 <sqliterkGetResultCodeDescription@plt>

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

LLVM IR (-O2):
define i8* @sqliterk_description(i32 %0) {
%2 = tail call i8* @sqliterkGetResultCodeDescription(i32 %0)
ret i8* %2
}
void ushort2bytes(unsigned short number, char *bytes) {
  bytes[0] = (number >> 8) & 0xFF;
  bytes[1] = number & 0xFF;
}


x86 assembly (clang, -O0):
<ushort2bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ushort2bytes>:
rol    $0x8,%di
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @ushort2bytes(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 %9, i8* %11
%12 = load i16, i16* %3
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
ret void
}

LLVM IR (-O2):
define void @ushort2bytes(i16 zeroext %0, i8* nocapture writeonly %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
store i8 %4, i8* %1
%5 = trunc i16 %0 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int strncasecmp(char *, char *, int);
void strncasecmp_diff_length_2() {
  char *x = "aBcDe";
  char *y = "abc";
  if (strncasecmp(x, y, 5) != 1)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strncasecmp_diff_length_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x5,%edx
call   1030 <strncasecmp@plt>
cmp    $0x1,%eax
je     1149 <strncasecmp_diff_length_2+0x39>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @strncasecmp_diff_length_2() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ initialize();
int /*<<< orphan*/ mainMenu();
int main(void) {
  initialize();
  mainMenu();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initialize@plt>
xor    %eax,%eax
call   1040 <mainMenu@plt>
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialize()
%3 = call i32 (...) @mainMenu()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initialize()
%2 = tail call i32 (...) @mainMenu()
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_initializeTdTree();
int /*<<< orphan*/ test_tdprintRange();
int main() {
  printf("////////////////////\n");
  printf("/// 2D TREE TEST\n");
  printf("////////////////////\n");
  test_initializeTdTree();
  printf("\n");
  test_tdprintRange();
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    0xec4(%rip),%rdi
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <test_initializeTdTree@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_tdprintRange@plt>
lea    0xe90(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xea9(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   1060 <test_initializeTdTree@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <test_tdprintRange@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"////////////////////\0A\00"
@.str.1 = [18 x i8] c"/// 2D TREE TEST\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @test_initializeTdTree()
%6 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (...) @test_tdprintRange()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.3 = [17 x i8] c"/// 2D TREE TEST\00"
@str.4 = [21 x i8] c"////////////////////\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 (...) @test_initializeTdTree()
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (...) @test_tdprintRange()
%7 = tail call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
int IsPlayer(int /*<<< orphan*/);
int Cnd_IsPlayer(void) { return (IsPlayer(ArgItem())); }


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

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

LLVM IR (-O0):
define i32 @Cnd_IsPlayer() {
%1 = call i32 (...) @ArgItem()
%2 = call i32 @IsPlayer(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @Cnd_IsPlayer() {
%1 = tail call i32 (...) @ArgItem()
%2 = tail call i32 @IsPlayer(i32 %1)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
scalar_t__ printf(char *, char *);
void write_bool(int64_t n) {
  if (printf("%s\n", (n ? "#t" : "#f")) < 0) {
    perror("write_bool failed");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<write_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xec0(%rip),%rsi
lea    0xeb6(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
cmp    $0x0,%rax
jge    1186 <write_bool+0x56>
lea    0xe97(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_bool>:
push   %rax
test   %rdi,%rdi
lea    0xecc(%rip),%rax
lea    0xec2(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
test   %rax,%rax
js     1159 <write_bool+0x29>
pop    %rax
ret
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"#t\00"
@.str.2 = [3 x i8] c"#f\00"
@.str.3 = [18 x i8] c"write_bool failed\00"
@EXIT_FAILURE = global i32 0
define void @write_bool(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, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%7 = call i64 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [3 x i8] c"#t\00"
@.str.2 = [3 x i8] c"#f\00"
@.str.3 = [18 x i8] c"write_bool failed\00"
@EXIT_FAILURE = global i32 0
define void @write_bool(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%4 = tail call i64 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xec() {
  Assert_real((isupper(236) == 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_isupper.c",
              1185, ("isupper should be 0 for 0xec"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xec>:
push   %rax
mov    $0xec,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4a1,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xec\00"
define void @t_isupper_0xec() {
%1 = call i64 @isupper(i32 236)
%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 1185, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xec\00"
define void @t_isupper_0xec() {
%1 = tail call i64 @isupper(i32 236)
%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 1185, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void Wslowcase(char *p1) {
  while (*p1 = (((*p1) > 64 && (*p1) < 91) ? (*p1) | 32 : (*p1)))
    p1++;
}


x86 assembly (clang, -O0):
<Wslowcase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x40,%eax
jle    113a <Wslowcase+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5b,%eax
jge    113a <Wslowcase+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
or     $0x20,%eax
mov    %eax,-0xc(%rbp)
jmp    1144 <Wslowcase+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <Wslowcase+0x66>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <Wslowcase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wslowcase>:
jmp    1118 <Wslowcase+0x18>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
or     $0x20,%al
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
jbe    1110 <Wslowcase+0x10>
test   %al,%al
je     112d <Wslowcase+0x2d>
add    $0x1,%rdi
jmp    1118 <Wslowcase+0x18>
ret

LLVM IR (-O0):
define void @Wslowcase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %27, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sgt i32 %6, 64
br i1 %7, label %8, label %18
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp slt i32 %11, 91
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = load i8*, i8** %2
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = or i32 %16, 32
br label %22
18: ; preds = %8, %3
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
br label %22
22: ; preds = %18, %13
%23 = phi i32 [ %17, %13 ], [ %21, %18 ]
%24 = trunc i32 %23 to i8
%25 = load i8*, i8** %2
store i8 %24, i8* %25
%26 = icmp ne i8 %24, 0
br i1 %26, label %27, label %30
27: ; preds = %22
%28 = load i8*, i8** %2
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %2
br label %3
30: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @Wslowcase(i8* nocapture %0) {
br label %2
2: ; preds = %11, %1
%3 = phi i8* [ %0, %1 ], [ %12, %11 ]
%4 = load i8, i8* %3
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 26
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = or i8 %4, 32
store i8 %8, i8* %3
br label %11
9: ; preds = %2
%10 = icmp eq i8 %4, 0
br i1 %10, label %13, label %11
11: ; preds = %7, %9
%12 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
13: ; preds = %9
ret void
}
/* Variables and functions */
int are_equal(int *, int *, int);
int /*<<< orphan*/ heapsort(int *, int);
int test_heapsort_sorted() {
  int input[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  int expected[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  heapsort(input, 10);
  return are_equal(input, expected, 10);
}


x86 assembly (clang, -O0):
<test_heapsort_sorted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1030 <heapsort@plt>
lea    -0x30(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    $0xa,%edx
call   1050 <are_equal@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_heapsort_sorted>:
push   %rbx
sub    $0x60,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xebc(%rip),%xmm1
movaps %xmm1,0x30(%rsp)
mov    %rax,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm1,(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <heapsort@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0xa,%edx
call   1040 <are_equal@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_heapsort_sorted.input = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.test_heapsort_sorted.expected = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @test_heapsort_sorted() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @heapsort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%9 = call i32 @are_equal(i32* %7, i32* %8, i32 10)
ret i32 %9
}

LLVM IR (-O2):
@__const.test_heapsort_sorted.expected = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @test_heapsort_sorted() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @heapsort(i32* %5, i32 10)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = call i32 @are_equal(i32* %5, i32* %7, i32 10)
ret i32 %8
}
void grandparent_done(void) {}


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

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

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

LLVM IR (-O2):
define void @grandparent_done() {
ret void
}
unsigned int sq(unsigned int x) { return x * x; }


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

x86 assembly (clang, -O2):
<sq>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @sq(i32 %0) {
%2 = mul i32 %0, %0
ret i32 %2
}