#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_type_name(uint32_t type) {
  switch (type) {
  case 0x0:
    printf("NULL");
    break;
  case 0x1:
    printf("PROGBITS");
    break;
  case 0x2:
    printf("SYMTAB");
    break;
  case 0x3:
    printf("STRTAB");
    break;
  case 0x4:
    printf("RELA");
    break;
  case 0x5:
    printf("HASH");
    break;
  case 0x6:
    printf("DYNAMIC");
    break;
  case 0x7:
    printf("NOTE");
    break;
  case 0x8:
    printf("NOBITS");
    break;
  case 0x9:
    printf("REL");
    break;
  case 0xa:
    printf("SHLIB");
    break;
  case 0xb:
    printf("DYNSYM");
    break;
  case 0xe:
    printf("INIT_ARRAY");
    break;
  case 0xf:
    printf("FINI_ARRAY");
    break;
  case 0x10:
    printf("PREINIT_ARRAY");
    break;
  case 0x11:
    printf("GROUP");
    break;
  case 0x12:
    printf("SYMTAB_SHNDX");
    break;
  case 0x13:
    printf("NUM");
    break;
  case 0x70000003:
    printf("ARM_ATTRIBUTES");
    break;
  default:
    printf("Unknown type %x\n", type);
  }
}


x86 assembly (clang, -O0):
<print_type_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1262 <print_type_name+0x152>
jmp    112e <print_type_name+0x1e>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1275 <print_type_name+0x165>
jmp    113f <print_type_name+0x2f>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1288 <print_type_name+0x178>
jmp    1150 <print_type_name+0x40>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     129b <print_type_name+0x18b>
jmp    1161 <print_type_name+0x51>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
je     12ae <print_type_name+0x19e>
jmp    1172 <print_type_name+0x62>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
je     12c1 <print_type_name+0x1b1>
jmp    1183 <print_type_name+0x73>
mov    -0x8(%rbp),%eax
sub    $0x6,%eax
je     12d4 <print_type_name+0x1c4>
jmp    1194 <print_type_name+0x84>
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
je     12e7 <print_type_name+0x1d7>
jmp    11a5 <print_type_name+0x95>
mov    -0x8(%rbp),%eax
sub    $0x8,%eax
je     12fa <print_type_name+0x1ea>
jmp    11b6 <print_type_name+0xa6>
mov    -0x8(%rbp),%eax
sub    $0x9,%eax
je     130d <print_type_name+0x1fd>
jmp    11c7 <print_type_name+0xb7>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
je     1320 <print_type_name+0x210>
jmp    11d8 <print_type_name+0xc8>
mov    -0x8(%rbp),%eax
sub    $0xb,%eax
je     1333 <print_type_name+0x223>
jmp    11e9 <print_type_name+0xd9>
mov    -0x8(%rbp),%eax
sub    $0xe,%eax
je     1346 <print_type_name+0x236>
jmp    11fa <print_type_name+0xea>
mov    -0x8(%rbp),%eax
sub    $0xf,%eax
je     1359 <print_type_name+0x249>
jmp    120b <print_type_name+0xfb>
mov    -0x8(%rbp),%eax
sub    $0x10,%eax
je     136c <print_type_name+0x25c>
jmp    121c <print_type_name+0x10c>
mov    -0x8(%rbp),%eax
sub    $0x11,%eax
je     137f <print_type_name+0x26f>
jmp    122d <print_type_name+0x11d>
mov    -0x8(%rbp),%eax
sub    $0x12,%eax
je     1392 <print_type_name+0x282>
jmp    123e <print_type_name+0x12e>
mov    -0x8(%rbp),%eax
sub    $0x13,%eax
je     13a5 <print_type_name+0x295>
jmp    124f <print_type_name+0x13f>
mov    -0x8(%rbp),%eax
sub    $0x70000003,%eax
je     13b8 <print_type_name+0x2a8>
jmp    13cb <print_type_name+0x2bb>
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd73(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xd0c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xce3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xccb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13dc <print_type_name+0x2cc>
mov    -0x4(%rbp),%esi
lea    0xcb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_type_name>:
mov    %edi,%esi
cmp    $0x13,%edi
ja     1137 <print_type_name+0x27>
mov    %esi,%eax
lea    0xee0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf20(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
cmp    $0x70000003,%esi
jne    114d <print_type_name+0x3d>
lea    0xf85(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xf86(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xef3(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeee(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xee7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xee0(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xed7(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xece(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xeae(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xea6(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xead(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe91(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe86(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>
lea    0xe85(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"NULL\00"
@.str.1 = [9 x i8] c"PROGBITS\00"
@.str.2 = [7 x i8] c"SYMTAB\00"
@.str.3 = [7 x i8] c"STRTAB\00"
@.str.4 = [5 x i8] c"RELA\00"
@.str.5 = [5 x i8] c"HASH\00"
@.str.6 = [8 x i8] c"DYNAMIC\00"
@.str.7 = [5 x i8] c"NOTE\00"
@.str.8 = [7 x i8] c"NOBITS\00"
@.str.9 = [4 x i8] c"REL\00"
@.str.10 = [6 x i8] c"SHLIB\00"
@.str.11 = [7 x i8] c"DYNSYM\00"
@.str.12 = [11 x i8] c"INIT_ARRAY\00"
@.str.13 = [11 x i8] c"FINI_ARRAY\00"
@.str.14 = [14 x i8] c"PREINIT_ARRAY\00"
@.str.15 = [6 x i8] c"GROUP\00"
@.str.16 = [13 x i8] c"SYMTAB_SHNDX\00"
@.str.17 = [4 x i8] c"NUM\00"
@.str.18 = [15 x i8] c"ARM_ATTRIBUTES\00"
@.str.19 = [17 x i8] c"Unknown type %x\0A\00"
define void @print_type_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %42 [
i32 0, label %4
i32 1, label %6
i32 2, label %8
i32 3, label %10
i32 4, label %12
i32 5, label %14
i32 6, label %16
i32 7, label %18
i32 8, label %20
i32 9, label %22
i32 10, label %24
i32 11, label %26
i32 14, label %28
i32 15, label %30
i32 16, label %32
i32 17, label %34
i32 18, label %36
i32 19, label %38
i32 1879048195, label %40
]
4: ; preds = %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %45
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %45
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %45
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %45
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %45
14: ; preds = %1
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %45
16: ; preds = %1
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %45
18: ; preds = %1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %45
20: ; preds = %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
br label %45
22: ; preds = %1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %45
24: ; preds = %1
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %45
26: ; preds = %1
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %45
28: ; preds = %1
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
br label %45
30: ; preds = %1
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %45
32: ; preds = %1
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
br label %45
34: ; preds = %1
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
br label %45
36: ; preds = %1
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0))
br label %45
38: ; preds = %1
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
br label %45
40: ; preds = %1
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0))
br label %45
42: ; preds = %1
%43 = load i32, i32* %2
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"NULL\00"
@.str.1 = [9 x i8] c"PROGBITS\00"
@.str.2 = [7 x i8] c"SYMTAB\00"
@.str.3 = [7 x i8] c"STRTAB\00"
@.str.4 = [5 x i8] c"RELA\00"
@.str.5 = [5 x i8] c"HASH\00"
@.str.6 = [8 x i8] c"DYNAMIC\00"
@.str.7 = [5 x i8] c"NOTE\00"
@.str.8 = [7 x i8] c"NOBITS\00"
@.str.9 = [4 x i8] c"REL\00"
@.str.10 = [6 x i8] c"SHLIB\00"
@.str.11 = [7 x i8] c"DYNSYM\00"
@.str.12 = [11 x i8] c"INIT_ARRAY\00"
@.str.13 = [11 x i8] c"FINI_ARRAY\00"
@.str.14 = [14 x i8] c"PREINIT_ARRAY\00"
@.str.15 = [6 x i8] c"GROUP\00"
@.str.16 = [13 x i8] c"SYMTAB_SHNDX\00"
@.str.17 = [4 x i8] c"NUM\00"
@.str.18 = [15 x i8] c"ARM_ATTRIBUTES\00"
@.str.19 = [17 x i8] c"Unknown type %x\0A\00"
define void @print_type_name(i32 %0) {
switch i32 %0, label %40 [
i32 0, label %2
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 4, label %10
i32 5, label %12
i32 6, label %14
i32 7, label %16
i32 8, label %18
i32 9, label %20
i32 10, label %22
i32 11, label %24
i32 14, label %26
i32 15, label %28
i32 16, label %30
i32 17, label %32
i32 18, label %34
i32 19, label %36
i32 1879048195, label %38
]
2: ; preds = %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %42
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %42
6: ; preds = %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %42
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %42
10: ; preds = %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %42
12: ; preds = %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %42
14: ; preds = %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
br label %42
16: ; preds = %1
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %42
18: ; preds = %1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
br label %42
20: ; preds = %1
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
br label %42
22: ; preds = %1
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %42
24: ; preds = %1
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %42
26: ; preds = %1
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
br label %42
28: ; preds = %1
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %42
30: ; preds = %1
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0))
br label %42
32: ; preds = %1
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
br label %42
34: ; preds = %1
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0))
br label %42
36: ; preds = %1
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
br label %42
38: ; preds = %1
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.18, i64 0, i64 0))
br label %42
40: ; preds = %1
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0), i32 %0)
br label %42
42: ; preds = %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4, %2
ret void
}