#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*/ __print_int(int);
int main() {
  int a;
  a = 7;
  __print_int(!a);
  a = 0;
  __print_int(!a);
  __print_int(a && 10);
  __print_int(10 && a);
  a = 5;
  __print_int(a && 10);
  __print_int(10 && a);
  __print_int(a && 0);
  __print_int(0 && a);
  __print_int(a || 0);
  __print_int(0 || a);
  a = 0;
  __print_int(a || 0);
  __print_int(0 || a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     116c <main+0x5c>
mov    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    116c <main+0x5c>
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
movl   $0x5,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xa(%rbp)
je     11aa <main+0x9a>
mov    $0x1,%al
mov    %al,-0xa(%rbp)
jmp    11aa <main+0x9a>
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xb(%rbp)
je     11e1 <main+0xd1>
xor    %eax,%eax
mov    %al,-0xb(%rbp)
jmp    11e1 <main+0xd1>
mov    -0xb(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
xor    %edi,%edi
call   1030 <__print_int@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xc(%rbp)
jne    120e <main+0xfe>
xor    %eax,%eax
mov    %al,-0xc(%rbp)
jmp    120e <main+0xfe>
mov    -0xc(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    124c <main+0x13c>
xor    %eax,%eax
mov    %al,-0xd(%rbp)
jmp    124c <main+0x13c>
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
xor    %edi,%edi
call   1030 <__print_int@plt>
xor    %edi,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
xor    %edi,%edi
call   1030 <__print_int@plt>
xor    %edi,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
mov    $0x1,%edi
call   1030 <__print_int@plt>
xor    %edi,%edi
call   1030 <__print_int@plt>
xor    %edi,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 7, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @__print_int(i32 %6)
store i32 0, i32* %2
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @__print_int(i32 %11)
%13 = load i32, i32* %2
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %0
br label %16
16: ; preds = %15, %0
%17 = phi i1 [ false, %0 ], [ true, %15 ]
%18 = zext i1 %17 to i32
%19 = call i32 @__print_int(i32 %18)
%20 = load i32, i32* %2
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i32
%23 = call i32 @__print_int(i32 %22)
store i32 5, i32* %2
%24 = load i32, i32* %2
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %16
br label %27
27: ; preds = %26, %16
%28 = phi i1 [ false, %16 ], [ true, %26 ]
%29 = zext i1 %28 to i32
%30 = call i32 @__print_int(i32 %29)
%31 = load i32, i32* %2
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i32
%34 = call i32 @__print_int(i32 %33)
%35 = load i32, i32* %2
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %38
37: ; preds = %27
br label %38
38: ; preds = %37, %27
%39 = phi i1 [ false, %27 ], [ false, %37 ]
%40 = zext i1 %39 to i32
%41 = call i32 @__print_int(i32 %40)
%42 = call i32 @__print_int(i32 0)
%43 = load i32, i32* %2
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %38
br label %46
46: ; preds = %45, %38
%47 = phi i1 [ true, %38 ], [ false, %45 ]
%48 = zext i1 %47 to i32
%49 = call i32 @__print_int(i32 %48)
%50 = load i32, i32* %2
%51 = icmp ne i32 %50, 0
%52 = zext i1 %51 to i32
%53 = call i32 @__print_int(i32 %52)
store i32 0, i32* %2
%54 = load i32, i32* %2
%55 = icmp ne i32 %54, 0
br i1 %55, label %57, label %56
56: ; preds = %46
br label %57
57: ; preds = %56, %46
%58 = phi i1 [ true, %46 ], [ false, %56 ]
%59 = zext i1 %58 to i32
%60 = call i32 @__print_int(i32 %59)
%61 = load i32, i32* %2
%62 = icmp ne i32 %61, 0
%63 = zext i1 %62 to i32
%64 = call i32 @__print_int(i32 %63)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 0)
%2 = tail call i32 @__print_int(i32 1)
%3 = tail call i32 @__print_int(i32 0)
%4 = tail call i32 @__print_int(i32 0)
%5 = tail call i32 @__print_int(i32 1)
%6 = tail call i32 @__print_int(i32 1)
%7 = tail call i32 @__print_int(i32 0)
%8 = tail call i32 @__print_int(i32 0)
%9 = tail call i32 @__print_int(i32 1)
%10 = tail call i32 @__print_int(i32 1)
%11 = tail call i32 @__print_int(i32 0)
%12 = tail call i32 @__print_int(i32 0)
ret i32 0
}