#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 _is_file(char *);
int _is_file_block(char *);
int _is_file_char(char *);
int _is_file_dir(char *);
int _is_file_executable(char *);
int _is_file_readable(char *);
int _is_file_regular(char *);
int _is_file_sgid(char *);
int _is_file_size(char *);
int _is_file_socket(char *);
int _is_file_symlink(char *);
int _is_file_writable(char *);
int _is_string_empty(char *);
int _is_string_not_empty(char *);
int _test_single(char c, char *argv) {
  switch (c) {
  case 'b':
    return _is_file_block(argv);
  case 'c':
    return _is_file_char(argv);
  case 'd':
    return _is_file_dir(argv);
  case 'e':
    return _is_file(argv);
  case 'f':
    return _is_file_regular(argv);
  case 'g':
    return _is_file_sgid(argv);
  case 'h':
  case 'L':
    return _is_file_symlink(argv);
  case 'n':
    return _is_string_not_empty(argv);
  case 'r':
    return _is_file_readable(argv);
  case 'S':
    return _is_file_socket(argv);
  case 's':
    return _is_file_size(argv);
  case 'w':
    return _is_file_writable(argv);
  case 'x':
    return _is_file_executable(argv);
  case 'z':
    return _is_string_empty(argv);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_test_single>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x5(%rbp),%eax
add    $0xffffffb4,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x2e,%eax
ja     130a <_test_single+0x12a>
mov    -0x18(%rbp),%rax
lea    0xded(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rdi
call   1030 <_is_file_block@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   1070 <_is_file_char@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   10e0 <_is_file_dir@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   1060 <_is_file@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   10a0 <_is_file_regular@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   1100 <_is_file_sgid@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   10d0 <_is_file_symlink@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   10b0 <_is_string_not_empty@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   10f0 <_is_file_readable@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   10c0 <_is_file_socket@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   1090 <_is_file_size@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   1040 <_is_file_writable@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   1050 <_is_file_executable@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
mov    -0x10(%rbp),%rdi
call   1080 <_is_string_empty@plt>
mov    %eax,-0x4(%rbp)
jmp    1311 <_test_single+0x131>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_single>:
add    $0xffffffb4,%edi
cmp    $0x2e,%edi
ja     1200 <_test_single+0x20>
lea    0xe11(%rip),%rax
movslq (%rax,%rdi,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    %rsi,%rdi
jmp    10d0 <_is_file_symlink@plt>
xor    %eax,%eax
ret
mov    %rsi,%rdi
jmp    10c0 <_is_file_socket@plt>
mov    %rsi,%rdi
jmp    1030 <_is_file_block@plt>
mov    %rsi,%rdi
jmp    1070 <_is_file_char@plt>
mov    %rsi,%rdi
jmp    10e0 <_is_file_dir@plt>
mov    %rsi,%rdi
jmp    1060 <_is_file@plt>
mov    %rsi,%rdi
jmp    10a0 <_is_file_regular@plt>
mov    %rsi,%rdi
jmp    10b0 <_is_string_not_empty@plt>
mov    %rsi,%rdi
jmp    10f0 <_is_file_readable@plt>
mov    %rsi,%rdi
jmp    1090 <_is_file_size@plt>
mov    %rsi,%rdi
jmp    1040 <_is_file_writable@plt>
mov    %rsi,%rdi
jmp    1050 <_is_file_executable@plt>
mov    %rsi,%rdi
jmp    1080 <_is_string_empty@plt>
mov    %rsi,%rdi
jmp    1100 <_is_file_sgid@plt>

LLVM IR (-O0):
define i32 @_test_single(i8 signext %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
switch i32 %7, label %50 [
i32 98, label %8
i32 99, label %11
i32 100, label %14
i32 101, label %17
i32 102, label %20
i32 103, label %23
i32 104, label %26
i32 76, label %26
i32 110, label %29
i32 114, label %32
i32 83, label %35
i32 115, label %38
i32 119, label %41
i32 120, label %44
i32 122, label %47
]
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = call i32 @_is_file_block(i8* %9)
store i32 %10, i32* %3
br label %51
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i32 @_is_file_char(i8* %12)
store i32 %13, i32* %3
br label %51
14: ; preds = %2
%15 = load i8*, i8** %5
%16 = call i32 @_is_file_dir(i8* %15)
store i32 %16, i32* %3
br label %51
17: ; preds = %2
%18 = load i8*, i8** %5
%19 = call i32 @_is_file(i8* %18)
store i32 %19, i32* %3
br label %51
20: ; preds = %2
%21 = load i8*, i8** %5
%22 = call i32 @_is_file_regular(i8* %21)
store i32 %22, i32* %3
br label %51
23: ; preds = %2
%24 = load i8*, i8** %5
%25 = call i32 @_is_file_sgid(i8* %24)
store i32 %25, i32* %3
br label %51
26: ; preds = %2, %2
%27 = load i8*, i8** %5
%28 = call i32 @_is_file_symlink(i8* %27)
store i32 %28, i32* %3
br label %51
29: ; preds = %2
%30 = load i8*, i8** %5
%31 = call i32 @_is_string_not_empty(i8* %30)
store i32 %31, i32* %3
br label %51
32: ; preds = %2
%33 = load i8*, i8** %5
%34 = call i32 @_is_file_readable(i8* %33)
store i32 %34, i32* %3
br label %51
35: ; preds = %2
%36 = load i8*, i8** %5
%37 = call i32 @_is_file_socket(i8* %36)
store i32 %37, i32* %3
br label %51
38: ; preds = %2
%39 = load i8*, i8** %5
%40 = call i32 @_is_file_size(i8* %39)
store i32 %40, i32* %3
br label %51
41: ; preds = %2
%42 = load i8*, i8** %5
%43 = call i32 @_is_file_writable(i8* %42)
store i32 %43, i32* %3
br label %51
44: ; preds = %2
%45 = load i8*, i8** %5
%46 = call i32 @_is_file_executable(i8* %45)
store i32 %46, i32* %3
br label %51
47: ; preds = %2
%48 = load i8*, i8** %5
%49 = call i32 @_is_string_empty(i8* %48)
store i32 %49, i32* %3
br label %51
50: ; preds = %2
store i32 0, i32* %3
br label %51
51: ; preds = %50, %47, %44, %41, %38, %35, %32, %29, %26, %23, %20, %17, %14, %11, %8
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
define i32 @_test_single(i8 signext %0, i8* %1) {
%3 = sext i8 %0 to i32
switch i32 %3, label %32 [
i32 98, label %4
i32 99, label %6
i32 100, label %8
i32 101, label %10
i32 102, label %12
i32 103, label %14
i32 104, label %16
i32 76, label %16
i32 110, label %18
i32 114, label %20
i32 83, label %22
i32 115, label %24
i32 119, label %26
i32 120, label %28
i32 122, label %30
]
4: ; preds = %2
%5 = tail call i32 @_is_file_block(i8* %1)
br label %32
6: ; preds = %2
%7 = tail call i32 @_is_file_char(i8* %1)
br label %32
8: ; preds = %2
%9 = tail call i32 @_is_file_dir(i8* %1)
br label %32
10: ; preds = %2
%11 = tail call i32 @_is_file(i8* %1)
br label %32
12: ; preds = %2
%13 = tail call i32 @_is_file_regular(i8* %1)
br label %32
14: ; preds = %2
%15 = tail call i32 @_is_file_sgid(i8* %1)
br label %32
16: ; preds = %2, %2
%17 = tail call i32 @_is_file_symlink(i8* %1)
br label %32
18: ; preds = %2
%19 = tail call i32 @_is_string_not_empty(i8* %1)
br label %32
20: ; preds = %2
%21 = tail call i32 @_is_file_readable(i8* %1)
br label %32
22: ; preds = %2
%23 = tail call i32 @_is_file_socket(i8* %1)
br label %32
24: ; preds = %2
%25 = tail call i32 @_is_file_size(i8* %1)
br label %32
26: ; preds = %2
%27 = tail call i32 @_is_file_writable(i8* %1)
br label %32
28: ; preds = %2
%29 = tail call i32 @_is_file_executable(i8* %1)
br label %32
30: ; preds = %2
%31 = tail call i32 @_is_string_empty(i8* %1)
br label %32
32: ; preds = %2, %30, %28, %26, %24, %22, %20, %18, %16, %14, %12, %10, %8, %6, %4
%33 = phi i32 [ %31, %30 ], [ %29, %28 ], [ %27, %26 ], [ %25, %24 ], [ %23, %22 ], [ %21, %20 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ], [ %11, %10 ], [ %9, %8 ], [ %7, %6 ], [ %5, %4 ], [ 0, %2 ]
ret i32 %33
}