#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*/ fault(int);
char *name_of_type(int n) {
  switch (n) {
  default:
    fault(1);
  case 's':
    return "string";
  case 'i':
    return "integer";
  case 'r':
    return "routine";
  case 'R':
    return "routine or grouping";
  case 'g':
    return "grouping";
  }
}


x86 assembly (clang, -O0):
<name_of_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffae,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x21,%eax
ja     1144 <name_of_type+0x34>
mov    -0x18(%rbp),%rax
lea    0xec5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x1,%edi
call   1030 <fault@plt>
lea    0xf33(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1199 <name_of_type+0x89>
lea    0xf2a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1199 <name_of_type+0x89>
lea    0xf22(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1199 <name_of_type+0x89>
lea    0xf1a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1199 <name_of_type+0x89>
lea    0xf15(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_of_type>:
push   %rbx
lea    0xf70(%rip),%rbx
add    $0xffffffae,%edi
cmp    $0x21,%edi
ja     1139 <name_of_type+0x29>
lea    0xed9(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
lea    0xf68(%rip),%rbx
jmp    115e <name_of_type+0x4e>
mov    $0x1,%edi
call   1030 <fault@plt>
jmp    115e <name_of_type+0x4e>
lea    0xf5e(%rip),%rbx
jmp    115e <name_of_type+0x4e>
lea    0xf3a(%rip),%rbx
jmp    115e <name_of_type+0x4e>
lea    0xf39(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"string\00"
@.str.1 = [8 x i8] c"integer\00"
@.str.2 = [8 x i8] c"routine\00"
@.str.3 = [20 x i8] c"routine or grouping\00"
@.str.4 = [9 x i8] c"grouping\00"
define i8* @name_of_type(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %5 [
i32 115, label %7
i32 105, label %8
i32 114, label %9
i32 82, label %10
i32 103, label %11
]
5: ; preds = %1
%6 = call i32 @fault(i32 1)
br label %7
7: ; preds = %1, %5
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %12
9: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %12
10: ; preds = %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %12
12: ; preds = %11, %10, %9, %8, %7
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"string\00"
@.str.1 = [8 x i8] c"integer\00"
@.str.2 = [8 x i8] c"routine\00"
@.str.3 = [20 x i8] c"routine or grouping\00"
@.str.4 = [9 x i8] c"grouping\00"
define i8* @name_of_type(i32 %0) {
switch i32 %0, label %2 [
i32 115, label %8
i32 105, label %4
i32 114, label %5
i32 82, label %6
i32 103, label %7
]
2: ; preds = %1
%3 = tail call i32 @fault(i32 1)
br label %8
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %2, %1, %7, %6, %5, %4
%9 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), %7 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), %6 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), %5 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), %4 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %1 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), %2 ]
ret i8* %9
}