#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int a, b, c;
  printf("a: ");
  scanf("%d", &a);
  printf("b: ");
  scanf("%d", &b);
  printf("c: ");
  scanf("%d", &c);
  printf("((a >= 2 || b == 1) && c > 0)\n");
  printf("%d\n", (a >= 2 || b == 1) && c > 0);
  printf("(a >= 2 || b == 1 && c > 0)\n");
  printf("%d\n", a >= 2 || b == 1 && c > 0);
  printf("((a >= 2 || b == 1 && c > 0) != 0)\n");
  printf("%d\n", (a >= 2 || b == 1 && c > 0) != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jge    11b0 <main+0x90>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jne    11ba <main+0x9a>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x12(%rbp)
jge    120c <main+0xec>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x13(%rbp)
jne    1206 <main+0xe6>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%al
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x14(%rbp)
jge    125e <main+0x13e>
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x15(%rbp)
jne    1258 <main+0x138>
cmpl   $0x0,-0x10(%rbp)
setg   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%esi
lea    0xdb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeba(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xea9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x2,0xc(%rsp)
setge  %al
cmpl   $0x1,0x8(%rsp)
sete   %cl
or     %al,%cl
cmpl   $0x0,0x4(%rsp)
setg   %al
and    %cl,%al
movzbl %al,%esi
lea    0xe50(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe64(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
cmpl   $0x1,0xc(%rsp)
mov    $0x1,%esi
jg     11f8 <main+0xc8>
cmpl   $0x1,0x8(%rsp)
sete   %al
cmpl   $0x0,0x4(%rsp)
setg   %cl
and    %al,%cl
movzbl %cl,%esi
lea    0xe10(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe40(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x1,0xc(%rsp)
jg     122e <main+0xfe>
cmpl   $0x1,0x8(%rsp)
sete   %al
cmpl   $0x0,0x4(%rsp)
setg   %cl
and    %al,%cl
movzbl %cl,%ebx
lea    0xdda(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"a: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"b: \00"
@.str.3 = [4 x i8] c"c: \00"
@.str.4 = [31 x i8] c"((a >= 2 || b == 1) && c > 0)\0A\00"
@.str.5 = [4 x i8] c"%d\0A\00"
@.str.6 = [29 x i8] c"(a >= 2 || b == 1 && c > 0)\0A\00"
@.str.7 = [36 x i8] c"((a >= 2 || b == 1 && c > 0) != 0)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = icmp sge i32 %12, 2
br i1 %13, label %17, label %14
14: ; preds = %0
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %20
17: ; preds = %14, %0
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 0
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0))
%25 = load i32, i32* %2
%26 = icmp sge i32 %25, 2
br i1 %26, label %35, label %27
27: ; preds = %20
%28 = load i32, i32* %3
%29 = icmp eq i32 %28, 1
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load i32, i32* %4
%32 = icmp sgt i32 %31, 0
br label %33
33: ; preds = %30, %27
%34 = phi i1 [ false, %27 ], [ %32, %30 ]
br label %35
35: ; preds = %33, %20
%36 = phi i1 [ true, %20 ], [ %34, %33 ]
%37 = zext i1 %36 to i32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %37)
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0))
%40 = load i32, i32* %2
%41 = icmp sge i32 %40, 2
br i1 %41, label %50, label %42
42: ; preds = %35
%43 = load i32, i32* %3
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %48
45: ; preds = %42
%46 = load i32, i32* %4
%47 = icmp sgt i32 %46, 0
br label %48
48: ; preds = %45, %42
%49 = phi i1 [ false, %42 ], [ %47, %45 ]
br label %50
50: ; preds = %48, %35
%51 = phi i1 [ true, %35 ], [ %49, %48 ]
%52 = zext i1 %51 to i32
%53 = icmp ne i32 %52, 0
%54 = zext i1 %53 to i32
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %54)
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
@.str = [4 x i8] c"a: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"b: \00"
@.str.3 = [4 x i8] c"c: \00"
@.str.5 = [4 x i8] c"%d\0A\00"
@str = [30 x i8] c"((a >= 2 || b == 1) && c > 0)\00"
@str.8 = [28 x i8] c"(a >= 2 || b == 1 && c > 0)\00"
@str.9 = [35 x i8] c"((a >= 2 || b == 1 && c > 0) != 0)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = icmp sgt i32 %14, 1
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 1
%18 = select i1 %15, i1 true, i1 %17
%19 = load i32, i32* %3
%20 = icmp sgt i32 %19, 0
%21 = select i1 %18, i1 %20, i1 false
%22 = zext i1 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.8, i64 0, i64 0))
%25 = load i32, i32* %1
%26 = icmp sgt i32 %25, 1
br i1 %26, label %34, label %27
27: ; preds = %0
%28 = load i32, i32* %2
%29 = icmp eq i32 %28, 1
%30 = load i32, i32* %3
%31 = icmp sgt i32 %30, 0
%32 = select i1 %29, i1 %31, i1 false
%33 = zext i1 %32 to i32
br label %34
34: ; preds = %27, %0
%35 = phi i32 [ 1, %0 ], [ %33, %27 ]
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.9, i64 0, i64 0))
%38 = load i32, i32* %1
%39 = icmp sgt i32 %38, 1
br i1 %39, label %47, label %40
40: ; preds = %34
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 1
%43 = load i32, i32* %3
%44 = icmp sgt i32 %43, 0
%45 = select i1 %42, i1 %44, i1 false
%46 = zext i1 %45 to i32
br label %47
47: ; preds = %40, %34
%48 = phi i32 [ 1, %34 ], [ %46, %40 ]
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %48)
ret i32 0
}