#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 */
char *vfs_filetype_to_verbose(int filetype) {
  switch (filetype) {
  case 0xC000:
    return "FT_IFSOCK";
  case 0xA000:
    return "FT_IFLNK";
  case 0x8000:
    return "FT_IFREG";
  case 0x6000:
    return "FT_IFBLK";
  case 0x4000:
    return "FT_IFDIR";
  case 0x2000:
    return "FT_IFCHR";
  case 0x1000:
    return "FT_IFIFO";
  default:
    return NULL;
  }
}


x86 assembly (clang, -O0):
<vfs_filetype_to_verbose>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1000,%eax
je     11ef <vfs_filetype_to_verbose+0xef>
jmp    111d <vfs_filetype_to_verbose+0x1d>
mov    -0x10(%rbp),%eax
sub    $0x2000,%eax
je     11df <vfs_filetype_to_verbose+0xdf>
jmp    1130 <vfs_filetype_to_verbose+0x30>
mov    -0x10(%rbp),%eax
sub    $0x4000,%eax
je     11cf <vfs_filetype_to_verbose+0xcf>
jmp    1143 <vfs_filetype_to_verbose+0x43>
mov    -0x10(%rbp),%eax
sub    $0x6000,%eax
je     11bf <vfs_filetype_to_verbose+0xbf>
jmp    1156 <vfs_filetype_to_verbose+0x56>
mov    -0x10(%rbp),%eax
sub    $0x8000,%eax
je     11af <vfs_filetype_to_verbose+0xaf>
jmp    1169 <vfs_filetype_to_verbose+0x69>
mov    -0x10(%rbp),%eax
sub    $0xa000,%eax
je     119f <vfs_filetype_to_verbose+0x9f>
jmp    117c <vfs_filetype_to_verbose+0x7c>
mov    -0x10(%rbp),%eax
sub    $0xc000,%eax
jne    11ff <vfs_filetype_to_verbose+0xff>
jmp    118f <vfs_filetype_to_verbose+0x8f>
lea    0xe6a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <vfs_filetype_to_verbose+0x107>
lea    0xe64(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <vfs_filetype_to_verbose+0x107>
lea    0xe5d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <vfs_filetype_to_verbose+0x107>
lea    0xe56(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <vfs_filetype_to_verbose+0x107>
lea    0xe4f(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <vfs_filetype_to_verbose+0x107>
lea    0xe48(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <vfs_filetype_to_verbose+0x107>
lea    0xe41(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1207 <vfs_filetype_to_verbose+0x107>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfs_filetype_to_verbose>:
add    $0xfffff000,%edi
rol    $0x14,%edi
cmp    $0xb,%edi
ja     111d <vfs_filetype_to_verbose+0x1d>
movslq %edi,%rax
lea    0x2cd8(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"FT_IFSOCK\00"
@.str.1 = [9 x i8] c"FT_IFLNK\00"
@.str.2 = [9 x i8] c"FT_IFREG\00"
@.str.3 = [9 x i8] c"FT_IFBLK\00"
@.str.4 = [9 x i8] c"FT_IFDIR\00"
@.str.5 = [9 x i8] c"FT_IFCHR\00"
@.str.6 = [9 x i8] c"FT_IFIFO\00"
define i8* @vfs_filetype_to_verbose(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 49152, label %5
i32 40960, label %6
i32 32768, label %7
i32 24576, label %8
i32 16384, label %9
i32 8192, label %10
i32 4096, label %11
]
5: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
br label %13
6: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %13
7: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %13
8: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %13
9: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8** %2
br label %13
10: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8** %2
br label %13
11: ; preds = %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8** %2
br label %13
12: ; preds = %1
store i8* null, i8** %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i8*, i8** %2
ret i8* %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"FT_IFSOCK\00"
@.str.1 = [9 x i8] c"FT_IFLNK\00"
@.str.2 = [9 x i8] c"FT_IFREG\00"
@.str.3 = [9 x i8] c"FT_IFBLK\00"
@.str.4 = [9 x i8] c"FT_IFDIR\00"
@.str.5 = [9 x i8] c"FT_IFCHR\00"
@.str.6 = [9 x i8] c"FT_IFIFO\00"
@switch.table.vfs_filetype_to_verbose = [12 x i8*] [i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* null, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)]
define i8* @vfs_filetype_to_verbose(i32 %0) {
%2 = add i32 %0, -4096
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 20)
%4 = icmp ult i32 %3, 12
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [12 x i8*], [12 x i8*]* @switch.table.vfs_filetype_to_verbose, 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
}