#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_extended_type(char c) {
  const char *type_string;
  switch (c) {
  case 'D':
    type_string = "__int8";
    break;
  case 'E':
    type_string = "unsigned __int8";
    break;
  case 'F':
    type_string = "__int16";
    break;
  case 'G':
    type_string = "unsigned __int16";
    break;
  case 'H':
    type_string = "__int32";
    break;
  case 'I':
    type_string = "unsigned __int32";
    break;
  case 'J':
    type_string = "__int64";
    break;
  case 'K':
    type_string = "unsigned __int64";
    break;
  case 'L':
    type_string = "__int128";
    break;
  case 'M':
    type_string = "unsigned __int128";
    break;
  case 'N':
    type_string = "bool";
    break;
  case 'W':
    type_string = "wchar_t";
    break;
  default:
    type_string = NULL;
    break;
  }
  return type_string;
}


x86 assembly (clang, -O0):
<get_extended_type>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x13,%eax
ja     11f4 <get_extended_type+0xf4>
mov    -0x18(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf1e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xf05(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xf0e(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xeff(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xee6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xef0(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xed7(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xee1(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xec8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
lea    0xebf(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    11fc <get_extended_type+0xfc>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"__int8\00"
@.str.1 = [16 x i8] c"unsigned __int8\00"
@.str.2 = [8 x i8] c"__int16\00"
@.str.3 = [17 x i8] c"unsigned __int16\00"
@.str.4 = [8 x i8] c"__int32\00"
@.str.5 = [17 x i8] c"unsigned __int32\00"
@.str.6 = [8 x i8] c"__int64\00"
@.str.7 = [17 x i8] c"unsigned __int64\00"
@.str.8 = [9 x i8] c"__int128\00"
@.str.9 = [18 x i8] c"unsigned __int128\00"
@.str.10 = [5 x i8] c"bool\00"
@.str.11 = [8 x i8] c"wchar_t\00"
define i8* @get_extended_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 %18 [
i32 68, label %6
i32 69, label %7
i32 70, label %8
i32 71, label %9
i32 72, label %10
i32 73, label %11
i32 74, label %12
i32 75, label %13
i32 76, label %14
i32 77, label %15
i32 78, label %16
i32 87, label %17
]
6: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %3
br label %19
7: ; preds = %1
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %19
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %19
9: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %19
10: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %19
11: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %19
12: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %19
13: ; preds = %1
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %19
14: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %19
15: ; preds = %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %19
16: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %19
17: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %19
18: ; preds = %1
store i8* null, i8** %3
br label %19
19: ; preds = %18, %17, %16, %15, %14, %13, %12, %11, %10, %9, %8, %7, %6
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [7 x i8] c"__int8\00"
@.str.1 = [16 x i8] c"unsigned __int8\00"
@.str.2 = [8 x i8] c"__int16\00"
@.str.3 = [17 x i8] c"unsigned __int16\00"
@.str.4 = [8 x i8] c"__int32\00"
@.str.5 = [17 x i8] c"unsigned __int32\00"
@.str.6 = [8 x i8] c"__int64\00"
@.str.7 = [17 x i8] c"unsigned __int64\00"
@.str.8 = [9 x i8] c"__int128\00"
@.str.9 = [18 x i8] c"unsigned __int128\00"
@.str.10 = [5 x i8] c"bool\00"
@.str.11 = [8 x i8] c"wchar_t\00"
@switch.table.get_extended_type = [20 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0), i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* null, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0)]
define i8* @get_extended_type(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -68
%4 = icmp ult i32 %3, 20
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [20 x i8*], [20 x i8*]* @switch.table.get_extended_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
}