#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 /*<<< orphan*/ mode_t;

/* Variables and functions */
scalar_t__ S_ISBLK(int /*<<< orphan*/);
scalar_t__ S_ISCHR(int /*<<< orphan*/);
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ S_ISFIFO(int /*<<< orphan*/);
scalar_t__ S_ISLNK(int /*<<< orphan*/);
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ S_ISSOCK(int /*<<< orphan*/);
char *Ftypetxt(mode_t st_mode, int flag) {
  if (flag & 1)
    goto single_letters;
  if (S_ISDIR(st_mode))
    return ("directory");
  else if (S_ISREG(st_mode))
    return ("regular_file");
  else if (S_ISLNK(st_mode))
    return ("symbolic_link");
  else if (S_ISBLK(st_mode))
    return ("block_device");
  else if (S_ISCHR(st_mode))
    return ("char_device");
  else if (S_ISFIFO(st_mode))
    return ("name_pipe");
  else if (S_ISSOCK(st_mode))
    return ("unix_socket");
  return ("unknown");
single_letters:;
  if (S_ISDIR(st_mode))
    return ("d");
  else if (S_ISREG(st_mode))
    return ("-");
  else if (S_ISLNK(st_mode))
    return ("l");
  else if (S_ISBLK(st_mode))
    return ("b");
  else if (S_ISCHR(st_mode))
    return ("c");
  else if (S_ISFIFO(st_mode))
    return ("p");
  else if (S_ISSOCK(st_mode))
    return ("s");
  return ("?");
}


x86 assembly (clang, -O0):
<Ftypetxt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1192 <Ftypetxt+0x22>
jmp    12ae <Ftypetxt+0x13e>
mov    -0xc(%rbp),%edi
call   1060 <S_ISDIR@plt>
cmp    $0x0,%rax
je     11b4 <Ftypetxt+0x44>
lea    0xe55(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1070 <S_ISREG@plt>
cmp    $0x0,%rax
je     11d6 <Ftypetxt+0x66>
lea    0xe3d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     11f8 <Ftypetxt+0x88>
lea    0xe28(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1090 <S_ISBLK@plt>
cmp    $0x0,%rax
je     121a <Ftypetxt+0xaa>
lea    0xe14(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1080 <S_ISCHR@plt>
cmp    $0x0,%rax
je     123c <Ftypetxt+0xcc>
lea    0xdff(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1040 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     125e <Ftypetxt+0xee>
lea    0xde9(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1050 <S_ISSOCK@plt>
cmp    $0x0,%rax
je     1280 <Ftypetxt+0x110>
lea    0xdd1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
jmp    1285 <Ftypetxt+0x115>
jmp    128a <Ftypetxt+0x11a>
jmp    128f <Ftypetxt+0x11f>
jmp    1294 <Ftypetxt+0x124>
jmp    1299 <Ftypetxt+0x129>
jmp    129e <Ftypetxt+0x12e>
lea    0xdaf(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1060 <S_ISDIR@plt>
cmp    $0x0,%rax
je     12d0 <Ftypetxt+0x160>
lea    0xd95(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1070 <S_ISREG@plt>
cmp    $0x0,%rax
je     12f2 <Ftypetxt+0x182>
lea    0xd75(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1030 <S_ISLNK@plt>
cmp    $0x0,%rax
je     1314 <Ftypetxt+0x1a4>
lea    0xd55(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1090 <S_ISBLK@plt>
cmp    $0x0,%rax
je     1336 <Ftypetxt+0x1c6>
lea    0xd35(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1080 <S_ISCHR@plt>
cmp    $0x0,%rax
je     1358 <Ftypetxt+0x1e8>
lea    0xd15(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1040 <S_ISFIFO@plt>
cmp    $0x0,%rax
je     137a <Ftypetxt+0x20a>
lea    0xcf5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
mov    -0xc(%rbp),%edi
call   1050 <S_ISSOCK@plt>
cmp    $0x0,%rax
je     139c <Ftypetxt+0x22c>
lea    0xcd5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    13c5 <Ftypetxt+0x255>
jmp    13a1 <Ftypetxt+0x231>
jmp    13a6 <Ftypetxt+0x236>
jmp    13ab <Ftypetxt+0x23b>
jmp    13b0 <Ftypetxt+0x240>
jmp    13b5 <Ftypetxt+0x245>
jmp    13ba <Ftypetxt+0x24a>
lea    0xca9(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Ftypetxt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1060 <S_ISDIR@plt>
test   $0x1,%bpl
jne    1193 <Ftypetxt+0x23>
test   %rax,%rax
je     11a4 <Ftypetxt+0x34>
lea    0xe72(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
test   %rax,%rax
je     11bc <Ftypetxt+0x4c>
lea    0xebd(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1070 <S_ISREG@plt>
test   %rax,%rax
je     11d4 <Ftypetxt+0x64>
lea    0xe53(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1070 <S_ISREG@plt>
test   %rax,%rax
je     11ec <Ftypetxt+0x7c>
lea    0xe8f(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1030 <S_ISLNK@plt>
test   %rax,%rax
je     1204 <Ftypetxt+0x94>
lea    0xe30(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1030 <S_ISLNK@plt>
test   %rax,%rax
je     121c <Ftypetxt+0xac>
lea    0xe61(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1090 <S_ISBLK@plt>
test   %rax,%rax
je     1234 <Ftypetxt+0xc4>
lea    0xe0e(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1090 <S_ISBLK@plt>
test   %rax,%rax
je     1249 <Ftypetxt+0xd9>
lea    0xe33(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1080 <S_ISCHR@plt>
test   %rax,%rax
je     125e <Ftypetxt+0xee>
lea    0xdeb(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1080 <S_ISCHR@plt>
test   %rax,%rax
je     1273 <Ftypetxt+0x103>
lea    0xe08(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1040 <S_ISFIFO@plt>
test   %rax,%rax
je     1288 <Ftypetxt+0x118>
lea    0xdcd(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1040 <S_ISFIFO@plt>
test   %rax,%rax
je     12a2 <Ftypetxt+0x132>
lea    0xde0(%rip),%rax
jmp    12be <Ftypetxt+0x14e>
mov    %ebx,%edi
call   1050 <S_ISSOCK@plt>
test   %rax,%rax
lea    0xdbb(%rip),%rcx
lea    0xda8(%rip),%rax
jmp    12ba <Ftypetxt+0x14a>
mov    %ebx,%edi
call   1050 <S_ISSOCK@plt>
test   %rax,%rax
lea    0xdb7(%rip),%rcx
lea    0xdae(%rip),%rax
cmove  %rcx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"directory\00"
@.str.1 = [13 x i8] c"regular_file\00"
@.str.2 = [14 x i8] c"symbolic_link\00"
@.str.3 = [13 x i8] c"block_device\00"
@.str.4 = [12 x i8] c"char_device\00"
@.str.5 = [10 x i8] c"name_pipe\00"
@.str.6 = [12 x i8] c"unix_socket\00"
@.str.7 = [8 x i8] c"unknown\00"
@.str.8 = [2 x i8] c"d\00"
@.str.9 = [2 x i8] c"-\00"
@.str.10 = [2 x i8] c"l\00"
@.str.11 = [2 x i8] c"b\00"
@.str.12 = [2 x i8] c"c\00"
@.str.13 = [2 x i8] c"p\00"
@.str.14 = [2 x i8] c"s\00"
@.str.15 = [2 x i8] c"?\00"
define i8* @Ftypetxt(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
br label %52
10: ; preds = %2
%11 = load i32, i32* %4
%12 = call i64 @S_ISDIR(i32 %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
br label %94
15: ; preds = %10
%16 = load i32, i32* %4
%17 = call i64 @S_ISREG(i32 %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %94
20: ; preds = %15
%21 = load i32, i32* %4
%22 = call i64 @S_ISLNK(i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %94
25: ; preds = %20
%26 = load i32, i32* %4
%27 = call i64 @S_ISBLK(i32 %26)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %25
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %94
30: ; preds = %25
%31 = load i32, i32* %4
%32 = call i64 @S_ISCHR(i32 %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %35
34: ; preds = %30
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i8** %3
br label %94
35: ; preds = %30
%36 = load i32, i32* %4
%37 = call i64 @S_ISFIFO(i32 %36)
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %35
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8** %3
br label %94
40: ; preds = %35
%41 = load i32, i32* %4
%42 = call i64 @S_ISSOCK(i32 %41)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %40
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8** %3
br label %94
45: ; preds = %40
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
br label %50
50: ; preds = %49
br label %51
51: ; preds = %50
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8** %3
br label %94
52: ; preds = %9
%53 = load i32, i32* %4
%54 = call i64 @S_ISDIR(i32 %53)
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %57
56: ; preds = %52
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8** %3
br label %94
57: ; preds = %52
%58 = load i32, i32* %4
%59 = call i64 @S_ISREG(i32 %58)
%60 = icmp ne i64 %59, 0
br i1 %60, label %61, label %62
61: ; preds = %57
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8** %3
br label %94
62: ; preds = %57
%63 = load i32, i32* %4
%64 = call i64 @S_ISLNK(i32 %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %62
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), i8** %3
br label %94
67: ; preds = %62
%68 = load i32, i32* %4
%69 = call i64 @S_ISBLK(i32 %68)
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %72
71: ; preds = %67
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i8** %3
br label %94
72: ; preds = %67
%73 = load i32, i32* %4
%74 = call i64 @S_ISCHR(i32 %73)
%75 = icmp ne i64 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %72
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8** %3
br label %94
77: ; preds = %72
%78 = load i32, i32* %4
%79 = call i64 @S_ISFIFO(i32 %78)
%80 = icmp ne i64 %79, 0
br i1 %80, label %81, label %82
81: ; preds = %77
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), i8** %3
br label %94
82: ; preds = %77
%83 = load i32, i32* %4
%84 = call i64 @S_ISSOCK(i32 %83)
%85 = icmp ne i64 %84, 0
br i1 %85, label %86, label %87
86: ; preds = %82
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0), i8** %3
br label %94
87: ; preds = %82
br label %88
88: ; preds = %87
br label %89
89: ; preds = %88
br label %90
90: ; preds = %89
br label %91
91: ; preds = %90
br label %92
92: ; preds = %91
br label %93
93: ; preds = %92
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8** %3
br label %94
94: ; preds = %93, %86, %81, %76, %71, %66, %61, %56, %51, %44, %39, %34, %29, %24, %19, %14
%95 = load i8*, i8** %3
ret i8* %95
}

LLVM IR (-O2):
@.str = [10 x i8] c"directory\00"
@.str.1 = [13 x i8] c"regular_file\00"
@.str.2 = [14 x i8] c"symbolic_link\00"
@.str.3 = [13 x i8] c"block_device\00"
@.str.4 = [12 x i8] c"char_device\00"
@.str.5 = [10 x i8] c"name_pipe\00"
@.str.6 = [12 x i8] c"unix_socket\00"
@.str.7 = [8 x i8] c"unknown\00"
@.str.8 = [2 x i8] c"d\00"
@.str.9 = [2 x i8] c"-\00"
@.str.10 = [2 x i8] c"l\00"
@.str.11 = [2 x i8] c"b\00"
@.str.12 = [2 x i8] c"c\00"
@.str.13 = [2 x i8] c"p\00"
@.str.14 = [2 x i8] c"s\00"
@.str.15 = [2 x i8] c"?\00"
define i8* @Ftypetxt(i32 %0, i32 %1) {
%3 = and i32 %1, 1
%4 = icmp eq i32 %3, 0
%5 = tail call i64 @S_ISDIR(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %4, label %7, label %27
7: ; preds = %2
br i1 %6, label %8, label %47
8: ; preds = %7
%9 = tail call i64 @S_ISREG(i32 %0)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %47
11: ; preds = %8
%12 = tail call i64 @S_ISLNK(i32 %0)
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %47
14: ; preds = %11
%15 = tail call i64 @S_ISBLK(i32 %0)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %47
17: ; preds = %14
%18 = tail call i64 @S_ISCHR(i32 %0)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %47
20: ; preds = %17
%21 = tail call i64 @S_ISFIFO(i32 %0)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %47
23: ; preds = %20
%24 = tail call i64 @S_ISSOCK(i32 %0)
%25 = icmp eq i64 %24, 0
%26 = select i1 %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0)
br label %47
27: ; preds = %2
br i1 %6, label %28, label %47
28: ; preds = %27
%29 = tail call i64 @S_ISREG(i32 %0)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %47
31: ; preds = %28
%32 = tail call i64 @S_ISLNK(i32 %0)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %47
34: ; preds = %31
%35 = tail call i64 @S_ISBLK(i32 %0)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %47
37: ; preds = %34
%38 = tail call i64 @S_ISCHR(i32 %0)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %47
40: ; preds = %37
%41 = tail call i64 @S_ISFIFO(i32 %0)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %40
%44 = tail call i64 @S_ISSOCK(i32 %0)
%45 = icmp eq i64 %44, 0
%46 = select i1 %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.14, i64 0, i64 0)
br label %47
47: ; preds = %43, %40, %37, %34, %31, %28, %27, %23, %20, %17, %14, %11, %8, %7
%48 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), %7 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), %11 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), %14 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), %17 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), %20 ], [ %26, %23 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), %27 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), %28 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0), %31 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), %34 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), %37 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0), %40 ], [ %46, %43 ]
ret i8* %48
}