#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 *);
void print_help(char *line) {
  switch (line[0]) {
  case 'p':
    printf("pass\n");
    break;
  case 'd':
    printf("done\n");
    break;
  case 'D':
    printf("draw[number]\nex: D7\nex: D\n");
    break;
  case 'V':
    printf("toggle visibility[card id],[card id],...\nex: V31\n");
    break;
  case 'M':
    printf("move card[dest zone][card id],[card "
           "id],...\n[G]rave,[D]eck,[H]and,[P]lay,[V]oid\nex:MP52\n");
    break;
  case 'T':
    printf("tap card[card id],[card id],...\nex: T18\n");
    break;
  case 'c':
    printf(
        "transfer control[dest player] [card id],[card id],...\nex: c2 20\n");
    break;
  }
}


x86 assembly (clang, -O0):
<print_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x2c,%eax
ja     11bb <print_help+0xab>
mov    -0x10(%rbp),%rax
lea    0xec0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf64(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <print_help+0xab>
lea    0xf59(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <print_help+0xab>
lea    0xf4e(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <print_help+0xab>
lea    0xf58(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <print_help+0xab>
lea    0xf79(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <print_help+0xab>
lea    0xfc1(%rip),%rdi
call   1030 <printf@plt>
jmp    11bb <print_help+0xab>
lea    0xfd9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_help>:
movsbl (%rdi),%eax
add    $0xffffffbc,%eax
cmp    $0x2c,%eax
ja     113e <print_help+0x2e>
lea    0x10a2(%rip),%rdi
lea    0xed7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x106c(%rip),%rdi
jmp    1030 <puts@plt>
ret
lea    0xfd6(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xfa2(%rip),%rdi
jmp    1030 <puts@plt>
lea    0x1016(%rip),%rdi
jmp    1030 <puts@plt>
lea    0xf4a(%rip),%rdi
jmp    1030 <puts@plt>
lea    0x1049(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"pass\0A\00"
@.str.1 = [6 x i8] c"done\0A\00"
@.str.2 = [27 x i8] c"draw[number]\0Aex: D7\0Aex: D\0A\00"
@.str.3 = [50 x i8] c"toggle visibility[card id],[card id],...\0Aex: V31\0A\00"
@.str.4 = [89 x i8] c"move card[dest zone][card id],[card id],...\0A[G]rave,[D]eck,[H]and,[P]lay,[V]oid\0Aex:MP52\0A\00"
@.str.5 = [41 x i8] c"tap card[card id],[card id],...\0Aex: T18\0A\00"
@.str.6 = [65 x i8] c"transfer control[dest player] [card id],[card id],...\0Aex: c2 20\0A\00"
define void @print_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %21 [
i32 112, label %7
i32 100, label %9
i32 68, label %11
i32 86, label %13
i32 77, label %15
i32 84, label %17
i32 99, label %19
]
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %21
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %21
11: ; preds = %1
%12 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %21
13: ; preds = %1
%14 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
br label %21
15: ; preds = %1
%16 = call i32 @printf(i8* getelementptr inbounds ([89 x i8], [89 x i8]* @.str.4, i64 0, i64 0))
br label %21
17: ; preds = %1
%18 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
br label %21
19: ; preds = %1
%20 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0))
br label %21
21: ; preds = %1, %19, %17, %15, %13, %11, %9, %7
ret void
}

LLVM IR (-O2):
@str = [64 x i8] c"transfer control[dest player] [card id],[card id],...\0Aex: c2 20\00"
@str.7 = [40 x i8] c"tap card[card id],[card id],...\0Aex: T18\00"
@str.8 = [88 x i8] c"move card[dest zone][card id],[card id],...\0A[G]rave,[D]eck,[H]and,[P]lay,[V]oid\0Aex:MP52\00"
@str.9 = [49 x i8] c"toggle visibility[card id],[card id],...\0Aex: V31\00"
@str.10 = [26 x i8] c"draw[number]\0Aex: D7\0Aex: D\00"
@str.11 = [5 x i8] c"done\00"
@str.12 = [5 x i8] c"pass\00"
define void @print_help(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %13 [
i32 112, label %10
i32 100, label %4
i32 68, label %5
i32 86, label %6
i32 77, label %7
i32 84, label %8
i32 99, label %9
]
4: ; preds = %1
br label %10
5: ; preds = %1
br label %10
6: ; preds = %1
br label %10
7: ; preds = %1
br label %10
8: ; preds = %1
br label %10
9: ; preds = %1
br label %10
10: ; preds = %1, %4, %5, %6, %7, %8, %9
%11 = phi i8* [ getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0), %9 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @str.7, i64 0, i64 0), %8 ], [ getelementptr inbounds ([88 x i8], [88 x i8]* @str.8, i64 0, i64 0), %7 ], [ getelementptr inbounds ([49 x i8], [49 x i8]* @str.9, i64 0, i64 0), %6 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @str.10, i64 0, i64 0), %5 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.11, i64 0, i64 0), %4 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0), %1 ]
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
br label %13
13: ; preds = %10, %1
ret void
}