#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, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d AND %d is %d\n", a, b, a && b);
  printf("%d OR %d is %d\n", a, b, a || b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1168 <main+0x48>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x19(%rbp)
jne    11a7 <main+0x87>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%esi
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%ecx
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
test   %esi,%esi
setne  %al
test   %edx,%edx
setne  %cl
and    %al,%cl
movzbl %cl,%ecx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
xor    %ecx,%ecx
mov    %edx,%eax
or     %esi,%eax
setne  %cl
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [17 x i8] c"%d AND %d is %d\0A\00"
@.str.2 = [16 x i8] c"%d OR %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %3
%11 = icmp ne i32 %10, 0
br label %12
12: ; preds = %9, %0
%13 = phi i1 [ false, %0 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6, i32 %14)
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = icmp ne i32 %18, 0
br i1 %19, label %23, label %20
20: ; preds = %12
%21 = load i32, i32* %3
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %20, %12
%24 = phi i1 [ true, %12 ], [ %22, %20 ]
%25 = zext i1 %24 to i32
%26 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %16, i32 %17, i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [17 x i8] c"%d AND %d is %d\0A\00"
@.str.2 = [16 x i8] c"%d OR %d is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %6, 0
%9 = icmp ne i32 %7, 0
%10 = and i1 %8, %9
%11 = zext i1 %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %7, i32 %11)
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = or i32 %14, %13
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %14, i32 %17)
ret i32 0
}