#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  char card[3];
  printf("Please enter score card: ");
  fgets(card, 3, stdin);
  int length = strlen(card);
  if (card[0] > 1 && length == 1) {
    switch (card[0]) {
    case '2':
    case '3':
    case '4':
    case '5':
    case '6':
    case '7':
    case '8':
    case '9':
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      printf("Yes\n");
      break;
    default:
      printf("No\n");
      break;
    }
  } else if (card[0] == '1' && card[1] == '0') {
    printf("Yes\n");
  } else {
    printf("No\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
lea    -0x7(%rbp),%rdi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
mov    $0x3,%esi
call   1050 <fgets@plt>
lea    -0x7(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
movsbl -0x7(%rbp),%eax
cmp    $0x1,%eax
jle    11f5 <main+0xc5>
cmpl   $0x1,-0xc(%rbp)
jne    11f5 <main+0xc5>
movsbl -0x7(%rbp),%eax
mov    %eax,-0x10(%rbp)
add    $0xffffffce,%eax
sub    $0x8,%eax
jb     11d3 <main+0xa3>
jmp    119d <main+0x6d>
mov    -0x10(%rbp),%eax
sub    $0x41,%eax
je     11d3 <main+0xa3>
jmp    11ae <main+0x7e>
mov    -0x10(%rbp),%eax
add    $0xffffffb6,%eax
sub    $0x2,%eax
jb     11d3 <main+0xa3>
jmp    11c2 <main+0x92>
mov    -0x10(%rbp),%eax
sub    $0x51,%eax
jne    11e4 <main+0xb4>
jmp    11d3 <main+0xa3>
lea    0xe40(%rip),%rdi
call   1040 <printf@plt>
jmp    11f0 <main+0xc0>
lea    0xe34(%rip),%rdi
call   1040 <printf@plt>
jmp    1231 <main+0x101>
movsbl -0x7(%rbp),%eax
cmp    $0x31,%eax
jne    1220 <main+0xf0>
movsbl -0x6(%rbp),%eax
cmp    $0x30,%eax
jne    1220 <main+0xf0>
lea    0xe04(%rip),%rdi
call   1040 <printf@plt>
jmp    122c <main+0xfc>
lea    0xdf8(%rip),%rdi
call   1040 <printf@plt>
jmp    1231 <main+0x101>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edx
lea    0xd(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <fgets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    0xd(%rsp),%cl
cmp    $0x2,%cl
jl     11a1 <main+0x61>
cmp    $0x1,%eax
jne    11a1 <main+0x61>
add    $0xce,%cl
cmp    $0x1f,%cl
ja     11cb <main+0x8b>
movzbl %cl,%eax
mov    $0x830080ff,%ecx
bt     %rax,%rcx
jae    11cb <main+0x8b>
lea    0xe7b(%rip),%rdi
jmp    11be <main+0x7e>
xor    $0x31,%cl
mov    0xe(%rsp),%al
xor    $0x30,%al
lea    0xe69(%rip),%rdx
lea    0xe66(%rip),%rdi
or     %cl,%al
cmove  %rdx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xe4c(%rip),%rdi
jmp    11be <main+0x7e>

LLVM IR (-O0):
@.str = [26 x i8] c"Please enter score card: \00"
@stdin = global i32 0
@.str.1 = [5 x i8] c"Yes\0A\00"
@.str.2 = [4 x i8] c"No\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %5, i32 3, i32 %6)
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %3
%10 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sgt i32 %12, 1
br i1 %13, label %14, label %26
14: ; preds = %0
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %26
17: ; preds = %14
%18 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
switch i32 %20, label %23 [
i32 50, label %21
i32 51, label %21
i32 52, label %21
i32 53, label %21
i32 54, label %21
i32 55, label %21
i32 56, label %21
i32 57, label %21
i32 74, label %21
i32 81, label %21
i32 75, label %21
i32 65, label %21
]
21: ; preds = %17, %17, %17, %17, %17, %17, %17, %17, %17, %17, %17, %17
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %25
23: ; preds = %17
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
br label %41
26: ; preds = %14, %0
%27 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 49
br i1 %30, label %31, label %38
31: ; preds = %26
%32 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %34, 48
br i1 %35, label %36, label %38
36: ; preds = %31
%37 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %40
38: ; preds = %31, %26
%39 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38, %36
br label %41
41: ; preds = %40, %25
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Please enter score card: \00"
@stdin = global i32 0
@str.4 = [4 x i8] c"Yes\00"
@str.5 = [3 x i8] c"No\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 3, i32 %4)
%6 = call i32 @strlen(i8* %2)
%7 = load i8, i8* %2
%8 = icmp sgt i8 %7, 1
%9 = icmp eq i32 %6, 1
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %11, label %13
11: ; preds = %0
switch i8 %7, label %12 [
i8 50, label %20
i8 51, label %20
i8 52, label %20
i8 53, label %20
i8 54, label %20
i8 55, label %20
i8 56, label %20
i8 57, label %20
i8 74, label %20
i8 81, label %20
i8 75, label %20
i8 65, label %20
]
12: ; preds = %11
br label %20
13: ; preds = %0
%14 = icmp eq i8 %7, 49
%15 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 48
%18 = select i1 %14, i1 %17, i1 false
%19 = select i1 %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0)
br label %20
20: ; preds = %13, %11, %11, %11, %11, %11, %11, %11, %11, %11, %11, %11, %11, %12
%21 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0), %12 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %11 ], [ %19, %13 ]
%22 = call i32 @puts(i8* dereferenceable(1) %21)
ret i32 0
}