#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 */
const char *get_simple_type(char c) {
  const char *type_string;
  switch (c) {
  case 'C':
    type_string = "signed char";
    break;
  case 'D':
    type_string = "char";
    break;
  case 'E':
    type_string = "unsigned char";
    break;
  case 'F':
    type_string = "short";
    break;
  case 'G':
    type_string = "unsigned short";
    break;
  case 'H':
    type_string = "int";
    break;
  case 'I':
    type_string = "unsigned int";
    break;
  case 'J':
    type_string = "long";
    break;
  case 'K':
    type_string = "unsigned long";
    break;
  case 'M':
    type_string = "float";
    break;
  case 'N':
    type_string = "double";
    break;
  case 'O':
    type_string = "long double";
    break;
  case 'X':
    type_string = "void";
    break;
  case 'Z':
    type_string = "...";
    break;
  default:
    type_string = NULL;
    break;
  }
  return type_string;
}


x86 assembly (clang, -O0):
<get_simple_type>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbd,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x17,%eax
ja     1214 <get_simple_type+0x114>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf27(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xf1e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xf05(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xf0c(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xef3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xefb(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xee2(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xee8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xecf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xec8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xeb3(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xeaf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
lea    0xea4(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    121c <get_simple_type+0x11c>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_simple_type>:
add    $0xffffffbd,%edi
cmp    $0x17,%edi
ja     1117 <get_simple_type+0x17>
movslq %edi,%rax
lea    0x2c7e(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [12 x i8] c"signed char\00"
@.str.1 = [5 x i8] c"char\00"
@.str.2 = [14 x i8] c"unsigned char\00"
@.str.3 = [6 x i8] c"short\00"
@.str.4 = [15 x i8] c"unsigned short\00"
@.str.5 = [4 x i8] c"int\00"
@.str.6 = [13 x i8] c"unsigned int\00"
@.str.7 = [5 x i8] c"long\00"
@.str.8 = [14 x i8] c"unsigned long\00"
@.str.9 = [6 x i8] c"float\00"
@.str.10 = [7 x i8] c"double\00"
@.str.11 = [12 x i8] c"long double\00"
@.str.12 = [5 x i8] c"void\00"
@.str.13 = [4 x i8] c"...\00"
define i8* @get_simple_type(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8*
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %20 [
i32 67, label %6
i32 68, label %7
i32 69, label %8
i32 70, label %9
i32 71, label %10
i32 72, label %11
i32 73, label %12
i32 74, label %13
i32 75, label %14
i32 77, label %15
i32 78, label %16
i32 79, label %17
i32 88, label %18
i32 90, label %19
]
6: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %3
br label %21
7: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %21
8: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %21
9: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %21
10: ; preds = %1
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %21
11: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %21
12: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %21
13: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %21
14: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %21
15: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %21
16: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %21
17: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %21
18: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %21
19: ; preds = %1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %21
20: ; preds = %1
store i8* null, i8** %3
br label %21
21: ; preds = %20, %19, %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
@.str = [12 x i8] c"signed char\00"
@.str.1 = [5 x i8] c"char\00"
@.str.2 = [14 x i8] c"unsigned char\00"
@.str.3 = [6 x i8] c"short\00"
@.str.4 = [15 x i8] c"unsigned short\00"
@.str.5 = [4 x i8] c"int\00"
@.str.6 = [13 x i8] c"unsigned int\00"
@.str.7 = [5 x i8] c"long\00"
@.str.8 = [14 x i8] c"unsigned long\00"
@.str.9 = [6 x i8] c"float\00"
@.str.10 = [7 x i8] c"double\00"
@.str.11 = [12 x i8] c"long double\00"
@.str.12 = [5 x i8] c"void\00"
@.str.13 = [4 x i8] c"...\00"
@switch.table.get_simple_type = [24 x i8*] [i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0)]
define i8* @get_simple_type(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -67
%4 = icmp ult i32 %3, 24
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [24 x i8*], [24 x i8*]* @switch.table.get_simple_type, i64 0, i64 %6
%8 = load i8*, i8** %7
br label %9
9: ; preds = %1, %5
%10 = phi i8* [ %8, %5 ], [ null, %1 ]
ret i8* %10
}