#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ done(int);
int echo(int);
int /*<<< orphan*/ equaltest(int, int);
int /*<<< orphan*/ neqtest(int, int);
int /*<<< orphan*/ nonzerotest(int);
int /*<<< orphan*/ while3(int);
int /*<<< orphan*/ whiletest(int);
int /*<<< orphan*/ zerotest(int);
int main() {
  int a, b, c, d;
  done(1);
  a = echo(123456);
  b = echo(123456);
  c = echo(56789);
  d = echo(0);
  equaltest(a, b);
  done(7);
  equaltest(a, c);
  done(8);
  whiletest(3);
  done(3);
  while3(3);
  done(6);
  neqtest(a, b);
  neqtest(a, b);
  neqtest(a, c);
  zerotest(d);
  zerotest(a);
  done(5);
  nonzerotest(d);
  done(4);
  nonzerotest(a);
  done(111);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1060 <done@plt>
mov    $0x1e240,%edi
call   1030 <echo@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1e240,%edi
call   1030 <echo@plt>
mov    %eax,-0xc(%rbp)
mov    $0xddd5,%edi
call   1030 <echo@plt>
mov    %eax,-0x10(%rbp)
xor    %edi,%edi
call   1030 <echo@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <equaltest@plt>
mov    $0x7,%edi
call   1060 <done@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <equaltest@plt>
mov    $0x8,%edi
call   1060 <done@plt>
mov    $0x3,%edi
call   1070 <whiletest@plt>
mov    $0x3,%edi
call   1060 <done@plt>
mov    $0x3,%edi
call   1040 <while3@plt>
mov    $0x6,%edi
call   1060 <done@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1090 <neqtest@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1090 <neqtest@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1090 <neqtest@plt>
mov    -0x14(%rbp),%edi
call   1080 <zerotest@plt>
mov    -0x8(%rbp),%edi
call   1080 <zerotest@plt>
mov    $0x5,%edi
call   1060 <done@plt>
mov    -0x14(%rbp),%edi
call   10a0 <nonzerotest@plt>
mov    $0x4,%edi
call   1060 <done@plt>
mov    -0x8(%rbp),%edi
call   10a0 <nonzerotest@plt>
mov    $0x6f,%edi
call   1060 <done@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%edi
call   1060 <done@plt>
mov    $0x1e240,%edi
call   1030 <echo@plt>
mov    %eax,%ebx
mov    $0x1e240,%edi
call   1030 <echo@plt>
mov    %eax,%ebp
mov    $0xddd5,%edi
call   1030 <echo@plt>
mov    %eax,%r15d
xor    %edi,%edi
call   1030 <echo@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <equaltest@plt>
mov    $0x7,%edi
call   1060 <done@plt>
mov    %ebx,%edi
mov    %r15d,%esi
call   1050 <equaltest@plt>
mov    $0x8,%edi
call   1060 <done@plt>
mov    $0x3,%edi
call   1070 <whiletest@plt>
mov    $0x3,%edi
call   1060 <done@plt>
mov    $0x3,%edi
call   1040 <while3@plt>
mov    $0x6,%edi
call   1060 <done@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1090 <neqtest@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   1090 <neqtest@plt>
mov    %ebx,%edi
mov    %r15d,%esi
call   1090 <neqtest@plt>
mov    %r14d,%edi
call   1080 <zerotest@plt>
mov    %ebx,%edi
call   1080 <zerotest@plt>
mov    $0x5,%edi
call   1060 <done@plt>
mov    %r14d,%edi
call   10a0 <nonzerotest@plt>
mov    $0x4,%edi
call   1060 <done@plt>
mov    %ebx,%edi
call   10a0 <nonzerotest@plt>
mov    $0x6f,%edi
call   1060 <done@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @done(i32 1)
%7 = call i32 @echo(i32 123456)
store i32 %7, i32* %2
%8 = call i32 @echo(i32 123456)
store i32 %8, i32* %3
%9 = call i32 @echo(i32 56789)
store i32 %9, i32* %4
%10 = call i32 @echo(i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @equaltest(i32 %11, i32 %12)
%14 = call i32 @done(i32 7)
%15 = load i32, i32* %2
%16 = load i32, i32* %4
%17 = call i32 @equaltest(i32 %15, i32 %16)
%18 = call i32 @done(i32 8)
%19 = call i32 @whiletest(i32 3)
%20 = call i32 @done(i32 3)
%21 = call i32 @while3(i32 3)
%22 = call i32 @done(i32 6)
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = call i32 @neqtest(i32 %23, i32 %24)
%26 = load i32, i32* %2
%27 = load i32, i32* %3
%28 = call i32 @neqtest(i32 %26, i32 %27)
%29 = load i32, i32* %2
%30 = load i32, i32* %4
%31 = call i32 @neqtest(i32 %29, i32 %30)
%32 = load i32, i32* %5
%33 = call i32 @zerotest(i32 %32)
%34 = load i32, i32* %2
%35 = call i32 @zerotest(i32 %34)
%36 = call i32 @done(i32 5)
%37 = load i32, i32* %5
%38 = call i32 @nonzerotest(i32 %37)
%39 = call i32 @done(i32 4)
%40 = load i32, i32* %2
%41 = call i32 @nonzerotest(i32 %40)
%42 = call i32 @done(i32 111)
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @done(i32 1)
%2 = tail call i32 @echo(i32 123456)
%3 = tail call i32 @echo(i32 123456)
%4 = tail call i32 @echo(i32 56789)
%5 = tail call i32 @echo(i32 0)
%6 = tail call i32 @equaltest(i32 %2, i32 %3)
%7 = tail call i32 @done(i32 7)
%8 = tail call i32 @equaltest(i32 %2, i32 %4)
%9 = tail call i32 @done(i32 8)
%10 = tail call i32 @whiletest(i32 3)
%11 = tail call i32 @done(i32 3)
%12 = tail call i32 @while3(i32 3)
%13 = tail call i32 @done(i32 6)
%14 = tail call i32 @neqtest(i32 %2, i32 %3)
%15 = tail call i32 @neqtest(i32 %2, i32 %3)
%16 = tail call i32 @neqtest(i32 %2, i32 %4)
%17 = tail call i32 @zerotest(i32 %5)
%18 = tail call i32 @zerotest(i32 %2)
%19 = tail call i32 @done(i32 5)
%20 = tail call i32 @nonzerotest(i32 %5)
%21 = tail call i32 @done(i32 4)
%22 = tail call i32 @nonzerotest(i32 %2)
%23 = tail call i32 @done(i32 111)
ret i32 1
}