#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 atoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int val = 0;
  char card_name[] = "8";
  if (card_name[0] == 'K') {
    val = 10;
  } else if (card_name[0] == 'K') {
    val = 10;
  } else if (card_name[0] == 'Q') {
    val = 10;
  } else if (card_name[0] == 'J') {
    val = 10;
  } else if (card_name[0] == 'A') {
    val = 11;
  } else {
    val = atoi(card_name);
  }
  printf("%d\n", val);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0xa(%rbp)
movsbl -0xa(%rbp),%eax
cmp    $0x4b,%eax
jne    115a <main+0x3a>
movl   $0xa,-0x8(%rbp)
jmp    11de <main+0xbe>
movsbl -0xa(%rbp),%eax
cmp    $0x4b,%eax
jne    1173 <main+0x53>
movl   $0xa,-0x8(%rbp)
jmp    11d9 <main+0xb9>
movsbl -0xa(%rbp),%eax
cmp    $0x51,%eax
jne    118c <main+0x6c>
movl   $0xa,-0x8(%rbp)
jmp    11d4 <main+0xb4>
movsbl -0xa(%rbp),%eax
cmp    $0x4a,%eax
jne    11a5 <main+0x85>
movl   $0xa,-0x8(%rbp)
jmp    11cf <main+0xaf>
movsbl -0xa(%rbp),%eax
cmp    $0x41,%eax
jne    11be <main+0x9e>
movl   $0xb,-0x8(%rbp)
jmp    11ca <main+0xaa>
lea    -0xa(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x8(%rbp)
jmp    11cf <main+0xaf>
jmp    11d4 <main+0xb4>
jmp    11d9 <main+0xb9>
jmp    11de <main+0xbe>
mov    -0x8(%rbp),%esi
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.card_name = [2 x i8] c"8\00"
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%4 = bitcast [2 x i8]* %3 to i8*
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 75
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 10, i32* %2
br label %41
10: ; preds = %0
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 75
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 10, i32* %2
br label %40
16: ; preds = %10
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 81
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 10, i32* %2
br label %39
22: ; preds = %16
%23 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 74
br i1 %26, label %27, label %28
27: ; preds = %22
store i32 10, i32* %2
br label %38
28: ; preds = %22
%29 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 65
br i1 %32, label %33, label %34
33: ; preds = %28
store i32 11, i32* %2
br label %37
34: ; preds = %28
%35 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%36 = call i32 @atoi(i8* %35)
store i32 %36, i32* %2
br label %37
37: ; preds = %34, %33
br label %38
38: ; preds = %37, %27
br label %39
39: ; preds = %38, %21
br label %40
40: ; preds = %39, %15
br label %41
41: ; preds = %40, %9
%42 = load i32, i32* %2
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %42)
%44 = load i32, i32* %1
ret i32 %44
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}