#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 EXIT_SUCCESS;
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  char card[16];
  int inputBuff;
  printf("Enter card: ");
  fgets(card, 16, stdin);
  if (card[0] == '1' && card[1] == '0') {
    printf("yes");
  } else if (card[1] != '\n') {
    printf("no");
  } else if ((card[0] >= '2') && (card[0] <= '9')) {
    printf("yes");
  } else {
    switch (card[0]) {
    case 'J':
    case 'Q':
    case 'K':
    case 'A':
      printf("Yes");
      break;
    default:
      printf("No");
    }
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
mov    $0x10,%esi
call   1040 <fgets@plt>
movsbl -0x20(%rbp),%eax
cmp    $0x31,%eax
jne    117d <main+0x5d>
movsbl -0x1f(%rbp),%eax
cmp    $0x30,%eax
jne    117d <main+0x5d>
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
jmp    122c <main+0x10c>
movsbl -0x1f(%rbp),%eax
cmp    $0xa,%eax
je     119b <main+0x7b>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    1227 <main+0x107>
movsbl -0x20(%rbp),%eax
cmp    $0x32,%eax
jl     11c6 <main+0xa6>
movsbl -0x20(%rbp),%eax
cmp    $0x39,%eax
jg     11c6 <main+0xa6>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
jmp    1222 <main+0x102>
movsbl -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
sub    $0x41,%eax
je     1200 <main+0xe0>
jmp    11db <main+0xbb>
mov    -0x28(%rbp),%eax
add    $0xffffffb6,%eax
sub    $0x2,%eax
jb     1200 <main+0xe0>
jmp    11ef <main+0xcf>
mov    -0x28(%rbp),%eax
sub    $0x51,%eax
jne    1211 <main+0xf1>
jmp    1200 <main+0xe0>
lea    0xe0d(%rip),%rdi
call   1030 <printf@plt>
jmp    121d <main+0xfd>
lea    0xe00(%rip),%rdi
call   1030 <printf@plt>
jmp    1222 <main+0x102>
jmp    1227 <main+0x107>
jmp    122c <main+0x10c>
mov    0x2da5(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x10,%esi
call   1040 <fgets@plt>
movsbl (%rsp),%eax
mov    0x1(%rsp),%cl
lea    0xeb8(%rip),%rdi
cmp    $0x31,%eax
jne    115f <main+0x3f>
cmp    $0x30,%cl
je     118e <main+0x6e>
cmp    $0xa,%cl
jne    1187 <main+0x67>
lea    -0x32(%rax),%ecx
cmp    $0x8,%cl
jb     118e <main+0x6e>
add    $0xffffffbf,%eax
cmp    $0x10,%eax
ja     11a1 <main+0x81>
mov    $0x10601,%ecx
bt     %eax,%ecx
jae    11a1 <main+0x81>
lea    0xe8f(%rip),%rdi
jmp    118e <main+0x6e>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret
lea    0xe70(%rip),%rdi
jmp    118e <main+0x6e>

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

LLVM IR (-O2):
@.str = [13 x i8] c"Enter card: \00"
@stdin = global i32 0
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
@.str.3 = [4 x i8] c"Yes\00"
@.str.4 = [3 x i8] c"No\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdin
%5 = call i32 @fgets(i8* %2, i32 16, i32 %4)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp eq i8 %6, 49
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 48
%12 = select i1 %8, i1 %11, i1 false
br i1 %12, label %20, label %13
13: ; preds = %0
%14 = icmp eq i8 %10, 10
br i1 %14, label %15, label %20
15: ; preds = %13
%16 = add i8 %6, -50
%17 = icmp ult i8 %16, 8
br i1 %17, label %20, label %18
18: ; preds = %15
switch i32 %7, label %19 [
i32 74, label %20
i32 81, label %20
i32 75, label %20
i32 65, label %20
]
19: ; preds = %18
br label %20
20: ; preds = %18, %18, %18, %18, %15, %13, %0, %19
%21 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), %19 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %0 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %13 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %15 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %18 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), %18 ]
%22 = call i32 @printf(i8* dereferenceable(1) %21)
%23 = load i32, i32* @EXIT_SUCCESS
ret i32 %23
}