#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 */
scalar_t__ one();
int two();
int /*<<< orphan*/ write(char *);
int zero();
int MAIN() {
  if (one() || zero()) {
    write("correct: 1\n");
  } else {
    write("wrongn\n");
  }
  if (zero() || one()) {
    write("correct: 0 1\n");
  } else {
    write("wrongn\n");
  }
  if (one() && zero()) {
    write("wrongn\n");
  } else {
    write("correct: 1 0\n");
  }
  if (zero() && one()) {
    write("wrongn\n");
  } else {
    write("correct: 0\n");
  }
  if (one() && two()) {
    write("correct: 1 2\n");
  } else {
    write("wrongn\n");
  }
  if (one() || (two() / zero())) {
    write("correct: 1\n");
  }
}


x86 assembly (clang, -O0):
<MAIN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <one@plt>
cmp    $0x0,%rax
jne    1169 <MAIN+0x29>
mov    $0x0,%al
call   1050 <zero@plt>
cmp    $0x0,%eax
je     117a <MAIN+0x3a>
lea    0xe90(%rip),%rdi
call   1040 <write@plt>
jmp    1186 <MAIN+0x46>
lea    0xe8b(%rip),%rdi
call   1040 <write@plt>
mov    $0x0,%al
call   1050 <zero@plt>
cmp    $0x0,%eax
jne    11a7 <MAIN+0x67>
mov    $0x0,%al
call   1060 <one@plt>
cmp    $0x0,%rax
je     11b8 <MAIN+0x78>
lea    0xe66(%rip),%rdi
call   1040 <write@plt>
jmp    11c4 <MAIN+0x84>
lea    0xe4d(%rip),%rdi
call   1040 <write@plt>
mov    $0x0,%al
call   1060 <one@plt>
cmp    $0x0,%rax
je     11f6 <MAIN+0xb6>
mov    $0x0,%al
call   1050 <zero@plt>
cmp    $0x0,%eax
je     11f6 <MAIN+0xb6>
lea    0xe20(%rip),%rdi
call   1040 <write@plt>
jmp    1202 <MAIN+0xc2>
lea    0xe25(%rip),%rdi
call   1040 <write@plt>
mov    $0x0,%al
call   1050 <zero@plt>
cmp    $0x0,%eax
je     1234 <MAIN+0xf4>
mov    $0x0,%al
call   1060 <one@plt>
cmp    $0x0,%rax
je     1234 <MAIN+0xf4>
lea    0xde2(%rip),%rdi
call   1040 <write@plt>
jmp    1240 <MAIN+0x100>
lea    0xdf5(%rip),%rdi
call   1040 <write@plt>
mov    $0x0,%al
call   1060 <one@plt>
cmp    $0x0,%rax
je     1272 <MAIN+0x132>
mov    $0x0,%al
call   1030 <two@plt>
cmp    $0x0,%eax
je     1272 <MAIN+0x132>
lea    0xdd4(%rip),%rdi
call   1040 <write@plt>
jmp    127e <MAIN+0x13e>
lea    0xd93(%rip),%rdi
call   1040 <write@plt>
mov    $0x0,%al
call   1060 <one@plt>
cmp    $0x0,%rax
jne    12b1 <MAIN+0x171>
mov    $0x0,%al
call   1030 <two@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <zero@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
cmp    $0x0,%eax
je     12bd <MAIN+0x17d>
lea    0xd48(%rip),%rdi
call   1040 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MAIN>:
push   %rbx
xor    %eax,%eax
call   1060 <one@plt>
test   %rax,%rax
je     1156 <MAIN+0x16>
lea    0xeac(%rip),%rdi
jmp    1171 <MAIN+0x31>
xor    %eax,%eax
call   1050 <zero@plt>
test   %eax,%eax
lea    0xea6(%rip),%rax
lea    0xe93(%rip),%rdi
cmove  %rax,%rdi
call   1040 <write@plt>
xor    %eax,%eax
call   1050 <zero@plt>
test   %eax,%eax
je     118a <MAIN+0x4a>
lea    0xe8c(%rip),%rdi
jmp    11a6 <MAIN+0x66>
xor    %eax,%eax
call   1060 <one@plt>
test   %rax,%rax
lea    0xe71(%rip),%rax
lea    0xe72(%rip),%rdi
cmove  %rax,%rdi
call   1040 <write@plt>
xor    %eax,%eax
call   1060 <one@plt>
test   %rax,%rax
je     11cb <MAIN+0x8b>
xor    %eax,%eax
call   1050 <zero@plt>
test   %eax,%eax
je     11cb <MAIN+0x8b>
lea    0xe43(%rip),%rdi
jmp    11d2 <MAIN+0x92>
lea    0xe50(%rip),%rdi
call   1040 <write@plt>
xor    %eax,%eax
call   1050 <zero@plt>
test   %eax,%eax
je     11f7 <MAIN+0xb7>
xor    %eax,%eax
call   1060 <one@plt>
test   %rax,%rax
je     11f7 <MAIN+0xb7>
lea    0xe17(%rip),%rdi
jmp    11fe <MAIN+0xbe>
lea    0xe32(%rip),%rdi
call   1040 <write@plt>
xor    %eax,%eax
call   1060 <one@plt>
test   %rax,%rax
je     1223 <MAIN+0xe3>
xor    %eax,%eax
call   1030 <two@plt>
test   %eax,%eax
je     1223 <MAIN+0xe3>
lea    0xe1b(%rip),%rdi
jmp    122a <MAIN+0xea>
lea    0xde2(%rip),%rdi
call   1040 <write@plt>
xor    %eax,%eax
call   1060 <one@plt>
test   %rax,%rax
jne    1256 <MAIN+0x116>
xor    %eax,%eax
call   1030 <two@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <zero@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
test   %eax,%eax
je     1262 <MAIN+0x122>
lea    0xda3(%rip),%rdi
call   1040 <write@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"correct: 1\0A\00"
@.str.1 = [8 x i8] c"wrongn\0A\00"
@.str.2 = [14 x i8] c"correct: 0 1\0A\00"
@.str.3 = [14 x i8] c"correct: 1 0\0A\00"
@.str.4 = [12 x i8] c"correct: 0\0A\00"
@.str.5 = [14 x i8] c"correct: 1 2\0A\00"
define i32 @MAIN() {
%1 = tail call i64 (...) @one()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 (...) @zero()
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
br label %7
7: ; preds = %3, %0
%8 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %0 ], [ %6, %3 ]
%9 = tail call i32 @write(i8* %8)
%10 = tail call i32 (...) @zero()
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = tail call i64 (...) @one()
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0)
br label %16
16: ; preds = %12, %7
%17 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %7 ], [ %15, %12 ]
%18 = tail call i32 @write(i8* %17)
%19 = tail call i64 (...) @one()
%20 = icmp eq i64 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %16
%22 = tail call i32 (...) @zero()
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %21, %16
br label %25
25: ; preds = %21, %24
%26 = phi i8* [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), %24 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %21 ]
%27 = tail call i32 @write(i8* %26)
%28 = tail call i32 (...) @zero()
%29 = icmp eq i32 %28, 0
br i1 %29, label %33, label %30
30: ; preds = %25
%31 = tail call i64 (...) @one()
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %30, %25
br label %34
34: ; preds = %30, %33
%35 = phi i8* [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), %33 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %30 ]
%36 = tail call i32 @write(i8* %35)
%37 = tail call i64 (...) @one()
%38 = icmp eq i64 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %34
%40 = tail call i32 (...) @two()
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %43
42: ; preds = %39, %34
br label %43
43: ; preds = %39, %42
%44 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %42 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), %39 ]
%45 = tail call i32 @write(i8* %44)
%46 = tail call i64 (...) @one()
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %43
%49 = tail call i32 (...) @two()
%50 = tail call i32 (...) @zero()
%51 = sdiv i32 %49, %50
%52 = icmp eq i32 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %48, %43
%54 = tail call i32 @write(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %55
55: ; preds = %53, %48
ret i32 undef
}