#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 one();
int /*<<< orphan*/ print_string(char *);
void main(void) {
  int x, y, z;
  x = 1;
  y = 2;
  z = 3;
  print_string("should get elephant\ngot: ");
  if (x == 1)
    print_string("elephant\n");
  print_string("\n");
  print_string("should get nothing before END\ngot: ");
  if (x == 2)
    print_string("elephant ");
  print_string("END\n");
  print_string("\n");
  print_string("should get elephant\ngot: ");
  if (x == y || (z == 3 && y == 2))
    print_string("elephant\n");
  print_string("\n");
  print_string("should get ONLY elephant\ngot: ");
  if (x == 1 || x == one())
    print_string("elephant\n");
  print_string("\n");
  print_string("should get nothing before END\ngot: ");
  if (x == 2 && x == one())
    print_string("elephant ");
  print_string("END\n");
  print_string("\n");
  print_string("should get nothing before END\ngot: ");
  if (x == 1)
    ;
  print_string("END\n");
  print_string("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
lea    0xebc(%rip),%rdi
call   1030 <print_string@plt>
cmpl   $0x1,-0x4(%rbp)
jne    115f <main+0x3f>
lea    0xec0(%rip),%rdi
call   1030 <print_string@plt>
lea    0xeef(%rip),%rdi
call   1030 <print_string@plt>
lea    0xeb2(%rip),%rdi
call   1030 <print_string@plt>
cmpl   $0x2,-0x4(%rbp)
jne    118d <main+0x6d>
lea    0xec0(%rip),%rdi
call   1030 <print_string@plt>
lea    0xebe(%rip),%rdi
call   1030 <print_string@plt>
lea    0xeb5(%rip),%rdi
call   1030 <print_string@plt>
lea    0xe54(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     11d1 <main+0xb1>
cmpl   $0x3,-0xc(%rbp)
jne    11dd <main+0xbd>
cmpl   $0x2,-0x8(%rbp)
jne    11dd <main+0xbd>
lea    0xe42(%rip),%rdi
call   1030 <print_string@plt>
lea    0xe71(%rip),%rdi
call   1030 <print_string@plt>
lea    0xe67(%rip),%rdi
call   1030 <print_string@plt>
cmpl   $0x1,-0x4(%rbp)
je     1219 <main+0xf9>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <one@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    1225 <main+0x105>
lea    0xdfa(%rip),%rdi
call   1030 <print_string@plt>
lea    0xe29(%rip),%rdi
call   1030 <print_string@plt>
lea    0xdec(%rip),%rdi
call   1030 <print_string@plt>
cmpl   $0x2,-0x4(%rbp)
jne    126d <main+0x14d>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <one@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jne    126d <main+0x14d>
lea    0xde0(%rip),%rdi
call   1030 <print_string@plt>
lea    0xdde(%rip),%rdi
call   1030 <print_string@plt>
lea    0xdd5(%rip),%rdi
call   1030 <print_string@plt>
lea    0xd98(%rip),%rdi
call   1030 <print_string@plt>
cmpl   $0x1,-0x4(%rbp)
jne    12a0 <main+0x180>
jmp    12a0 <main+0x180>
lea    0xdab(%rip),%rdi
call   1030 <print_string@plt>
lea    0xda2(%rip),%rdi
call   1030 <print_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xee0(%rip),%r13
mov    %r13,%rdi
call   1030 <print_string@plt>
lea    0xeeb(%rip),%r12
mov    %r12,%rdi
call   1030 <print_string@plt>
lea    0xf0d(%rip),%rbx
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xed7(%rip),%r14
mov    %r14,%rdi
call   1030 <print_string@plt>
lea    0xeec(%rip),%r15
mov    %r15,%rdi
call   1030 <print_string@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
mov    %r13,%rdi
call   1030 <print_string@plt>
mov    %r12,%rdi
call   1030 <print_string@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
lea    0xec2(%rip),%rdi
call   1030 <print_string@plt>
mov    %r12,%rdi
call   1030 <print_string@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
mov    %r14,%rdi
call   1030 <print_string@plt>
mov    %r15,%rdi
call   1030 <print_string@plt>
mov    %rbx,%rdi
call   1030 <print_string@plt>
mov    %r14,%rdi
call   1030 <print_string@plt>
mov    %r15,%rdi
call   1030 <print_string@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"should get elephant\0Agot: \00"
@.str.1 = [10 x i8] c"elephant\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [36 x i8] c"should get nothing before END\0Agot: \00"
@.str.4 = [10 x i8] c"elephant \00"
@.str.5 = [5 x i8] c"END\0A\00"
@.str.6 = [31 x i8] c"should get ONLY elephant\0Agot: \00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%4 = call i32 @print_string(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @print_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @print_string(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @print_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
%17 = call i32 @print_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%19 = call i32 @print_string(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%20 = load i32, i32* %1
%21 = load i32, i32* %2
%22 = icmp eq i32 %20, %21
br i1 %22, label %29, label %23
23: ; preds = %16
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 3
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = load i32, i32* %2
%28 = icmp eq i32 %27, 2
br i1 %28, label %29, label %31
29: ; preds = %26, %16
%30 = call i32 @print_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29, %26, %23
%32 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @print_string(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%34 = load i32, i32* %1
%35 = icmp eq i32 %34, 1
br i1 %35, label %40, label %36
36: ; preds = %31
%37 = load i32, i32* %1
%38 = call i32 (...) @one()
%39 = icmp eq i32 %37, %38
br i1 %39, label %40, label %42
40: ; preds = %36, %31
%41 = call i32 @print_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %42
42: ; preds = %40, %36
%43 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @print_string(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%45 = load i32, i32* %1
%46 = icmp eq i32 %45, 2
br i1 %46, label %47, label %53
47: ; preds = %42
%48 = load i32, i32* %1
%49 = call i32 (...) @one()
%50 = icmp eq i32 %48, %49
br i1 %50, label %51, label %53
51: ; preds = %47
%52 = call i32 @print_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %53
53: ; preds = %51, %47, %42
%54 = call i32 @print_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%55 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%56 = call i32 @print_string(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%57 = load i32, i32* %1
%58 = icmp eq i32 %57, 1
br i1 %58, label %59, label %60
59: ; preds = %53
br label %60
60: ; preds = %59, %53
%61 = call i32 @print_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%62 = call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"should get elephant\0Agot: \00"
@.str.1 = [10 x i8] c"elephant\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [36 x i8] c"should get nothing before END\0Agot: \00"
@.str.5 = [5 x i8] c"END\0A\00"
@.str.6 = [31 x i8] c"should get ONLY elephant\0Agot: \00"
define void @main() {
%1 = tail call i32 @print_string(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @print_string(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @print_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @print_string(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @print_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @print_string(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 @print_string(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = tail call i32 @print_string(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 @print_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%15 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%16 = tail call i32 @print_string(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
%17 = tail call i32 @print_string(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%18 = tail call i32 @print_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}