// File: ncbi[P]amr/common.cpp
// Function: Common_sp::getFiletype(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
Filetype getFiletype (const string &path,
                      bool expandLink)
{
  struct stat buf;
  if (expandLink)
  {
    if (stat (path. c_str (), & buf))
      return Filetype::none;
  }
  else
  {
    if (lstat (path. c_str (), & buf))
      return Filetype::none;
  }
    
  if (S_ISDIR  (buf. st_mode))  return Filetype::dir;
  if (S_ISCHR  (buf. st_mode))  return Filetype::terminal;
  if (S_ISBLK  (buf. st_mode))  return Filetype::disk;
  if (S_ISREG  (buf. st_mode))  return Filetype::file;
  if (S_ISFIFO (buf. st_mode))  return Filetype::pipe;
  if (! expandLink)
  {
    if (S_ISLNK  (buf. st_mode))  return Filetype::link;
  }
  if (S_ISSOCK (buf. st_mode))  return Filetype::socket;
    
  NEVER_CALL;
}

// Assembly:
subq $0x1d8, %rsp            # imm = 0x1D8
movb %sil, %al
movq %rdi, 0x1c8(%rsp)
andb $0x1, %al
movb %al, 0x1c7(%rsp)
testb $0x1, 0x1c7(%rsp)
je 0x43f99
movq 0x1c8(%rsp), %rdi
callq 0xc300
movq %rax, %rdi
leaq 0x130(%rsp), %rsi
callq 0xc680
cmpl $0x0, %eax
je 0x43f97
movl $0x0, 0x1d4(%rsp)
jmp 0x44311
jmp 0x43fcd
movq 0x1c8(%rsp), %rdi
callq 0xc300
movq %rax, %rdi
leaq 0x130(%rsp), %rsi
callq 0xce00
cmpl $0x0, %eax
je 0x43fcb
movl $0x0, 0x1d4(%rsp)
jmp 0x44311
jmp 0x43fcd
movl 0x148(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x43ff0
movl $0x1, 0x1d4(%rsp)
jmp 0x44311
movl 0x148(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x2000, %eax           # imm = 0x2000
jne 0x44013
movl $0x2, 0x1d4(%rsp)
jmp 0x44311
movl 0x148(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x6000, %eax           # imm = 0x6000
jne 0x44036
movl $0x3, 0x1d4(%rsp)
jmp 0x44311
movl 0x148(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x44059
movl $0x4, 0x1d4(%rsp)
jmp 0x44311
movl 0x148(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x4407c
movl $0x5, 0x1d4(%rsp)
jmp 0x44311
testb $0x1, 0x1c7(%rsp)
jne 0x440ab
movl 0x148(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x440a9
movl $0x6, 0x1d4(%rsp)
jmp 0x44311
jmp 0x440ab
movl 0x148(%rsp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xc000, %eax           # imm = 0xC000
jne 0x440ce
movl $0x7, 0x1d4(%rsp)
jmp 0x44311
callq 0xc8c0
cmpl $0x0, %eax
jne 0x44307
leaq 0x8f(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xcd00
movq 0x8(%rsp), %rdx
leaq 0x8991f(%rip), %rsi     # 0xcda19
leaq 0x90(%rsp), %rdi
callq 0x29fd0
jmp 0x44109
leaq 0x58(%rsp), %rdi
movl $0x51a, %esi            # imm = 0x51A
callq 0x2ded0
jmp 0x4411a
leaq 0xb0(%rsp), %rdi
leaq 0x90(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x2dde0
jmp 0x44136
leaq 0x87a64(%rip), %rdx     # 0xcbba1
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x2a2f0
jmp 0x44154
leaq 0x17(%rsp), %rdi
movq %rdi, (%rsp)
callq 0xcd00
movq (%rsp), %rdx
leaq 0x89d1d(%rip), %rsi     # 0xcde8a
leaq 0x18(%rsp), %rdi
callq 0x29fd0
jmp 0x44179
leaq 0x89896(%rip), %rdx     # 0xcda16
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2a2f0
jmp 0x44191
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x38(%rsp), %rdx
callq 0x2dde0
jmp 0x441ad
leaq 0x899e3(%rip), %rdx     # 0xcdb97
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x2a2f0
jmp 0x441cb
leaq 0x110(%rsp), %rdi
callq 0x3e9b0
jmp 0x441da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x442f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x442eb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x442e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x442d4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x442bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x442b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x442a9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
jmp 0x4429c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x80(%rsp)
movl %eax, 0x7c(%rsp)
leaq 0x110(%rsp), %rdi
callq 0xce98
leaq 0xf0(%rsp), %rdi
callq 0xce98
leaq 0x38(%rsp), %rdi
callq 0xce98
leaq 0x18(%rsp), %rdi
callq 0xce98
leaq 0x17(%rsp), %rdi
callq 0xc7a0
leaq 0xd0(%rsp), %rdi
callq 0xce98
leaq 0xb0(%rsp), %rdi
callq 0xce98
leaq 0x58(%rsp), %rdi
callq 0xce98
leaq 0x90(%rsp), %rdi
callq 0xce98
leaq 0x8f(%rsp), %rdi
callq 0xc7a0
jmp 0x44320
movl $0x1, %edi
callq 0xc8d0
movl 0x1d4(%rsp), %eax
addq $0x1d8, %rsp            # imm = 0x1D8
retq
movq 0x80(%rsp), %rdi
callq 0xccf0
nopl (%rax)