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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     116b <main+0x4b>
cmpl   $0x0,-0xc(%rbp)
je     116b <main+0x4b>
mov    -0x8(%rbp),%esi
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1193 <main+0x73>
cmpl   $0x0,-0x8(%rbp)
jne    117f <main+0x5f>
cmpl   $0x0,-0xc(%rbp)
je     118e <main+0x6e>
mov    -0xc(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
jmp    1193 <main+0x73>
xor    %eax,%eax
add    $0x10,%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),%eax
mov    (%rsp),%esi
test   %eax,%eax
je     114f <main+0x2f>
test   %esi,%esi
je     114f <main+0x2f>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
jmp    115a <main+0x3a>
or     %esi,%eax
je     115f <main+0x3f>
lea    0xebb(%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 = [15 x i8] c"n AND m is %d\0A\00"
@.str.2 = [8 x i8] c"n OR m\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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %0
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %23
13: ; preds = %7, %0
%14 = load i32, i32* %2
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %16, %13
%20 = load i32, i32* %3
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %19, %16
br label %23
23: ; preds = %22, %10
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [15 x i8] c"n AND m is %d\0A\00"
@.str.2 = [8 x i8] c"n OR m\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 = icmp ne i32 %6, 0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
%10 = select i1 %7, i1 %9, i1 false
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %17
13: ; preds = %0
%14 = select i1 %7, i1 true, i1 %9
br i1 %14, label %15, label %17
15: ; preds = %13
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %17
17: ; preds = %15, %13, %11
ret i32 0
}