#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 *, int *);
int main() {
  int P, R;
  scanf(" %d %d", &P, &R);
  switch (P) {
  case 0:
    printf("C");
    break;
  case 1:
    switch (R) {
    case 0:
      printf("B");
      break;
    case 1:
      printf("A");
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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,-0x10(%rbp)
test   %eax,%eax
je     1167 <main+0x47>
jmp    1156 <main+0x36>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     1178 <main+0x58>
jmp    11be <main+0x9e>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <main+0x9e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     119c <main+0x7c>
jmp    118b <main+0x6b>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
je     11ad <main+0x8d>
jmp    11b9 <main+0x99>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
jmp    11b9 <main+0x99>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    11be <main+0x9e>
xor    %eax,%eax
add    $0x20,%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
test   %eax,%eax
je     1155 <main+0x35>
cmp    $0x1,%eax
jne    1166 <main+0x46>
mov    (%rsp),%eax
test   %eax,%eax
je     115c <main+0x3c>
cmp    $0x1,%eax
jne    1166 <main+0x46>
mov    $0x41,%edi
jmp    1161 <main+0x41>
mov    $0x43,%edi
jmp    1161 <main+0x41>
mov    $0x42,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c" %d %d\00"
@.str.1 = [2 x i8] c"C\00"
@.str.2 = [2 x i8] c"B\00"
@.str.3 = [2 x i8] c"A\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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%5 = load i32, i32* %2
switch i32 %5, label %15 [
i32 0, label %6
i32 1, label %8
]
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %15
8: ; preds = %0
%9 = load i32, i32* %3
switch i32 %9, label %14 [
i32 0, label %10
i32 1, label %12
]
10: ; preds = %8
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %14
14: ; preds = %8, %12, %10
br label %15
15: ; preds = %14, %0, %6
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c" %d %d\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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
switch i32 %6, label %13 [
i32 0, label %10
i32 1, label %7
]
7: ; preds = %0
%8 = load i32, i32* %2
switch i32 %8, label %13 [
i32 0, label %10
i32 1, label %9
]
9: ; preds = %7
br label %10
10: ; preds = %7, %0, %9
%11 = phi i32 [ 65, %9 ], [ 67, %0 ], [ 66, %7 ]
%12 = call i32 @putchar(i32 %11)
br label %13
13: ; preds = %10, %7, %0
ret i32 0
}