// File: demon386[P]git-store/./libs/filesystem/src/operations.cpp
// Function: boost::filesystem::detail::symlink_status(boost::filesystem::path const&, boost::system::error_code*)
BOOST_FILESYSTEM_DECL
  file_status symlink_status(const path& p, error_code* ec)
  {
#   ifdef BOOST_POSIX_API

    struct stat path_stat;
    if (::lstat(p.c_str(), &path_stat)!= 0)
    {
      if (ec != 0)                            // always report errno, even though some
        ec->assign(errno, system_category());   // errno values are not status_errors

      if (errno == ENOENT || errno == ENOTDIR) // these are not errors
      {
        return fs::file_status(fs::file_not_found, fs::no_perms);
      }
      if (ec == 0)
        BOOST_FILESYSTEM_THROW(filesystem_error("boost::filesystem::status",
          p, error_code(errno, system_category())));
      return fs::file_status(fs::status_error);
    }
    if (ec != 0) ec->clear();
    if (S_ISREG(path_stat.st_mode))
      return fs::file_status(fs::regular_file,
        static_cast<perms>(path_stat.st_mode) & fs::perms_mask);
    if (S_ISDIR(path_stat.st_mode))
      return fs::file_status(fs::directory_file,
        static_cast<perms>(path_stat.st_mode) & fs::perms_mask);
    if (S_ISLNK(path_stat.st_mode))
      return fs::file_status(fs::symlink_file,
        static_cast<perms>(path_stat.st_mode) & fs::perms_mask);
    if (S_ISBLK(path_stat.st_mode))
      return fs::file_status(fs::block_file,
        static_cast<perms>(path_stat.st_mode) & fs::perms_mask);
    if (S_ISCHR(path_stat.st_mode))
      return fs::file_status(fs::character_file,
        static_cast<perms>(path_stat.st_mode) & fs::perms_mask);
    if (S_ISFIFO(path_stat.st_mode))
      return fs::file_status(fs::fifo_file,
        static_cast<perms>(path_stat.st_mode) & fs::perms_mask);
    if (S_ISSOCK(path_stat.st_mode))
      return fs::file_status(fs::socket_file,
        static_cast<perms>(path_stat.st_mode) & fs::perms_mask);
    return fs::file_status(fs::type_unknown);

#   else  // Windows

    DWORD attr(::GetFileAttributesW(p.c_str()));
    if (attr == 0xFFFFFFFF)
    {
      return process_status_failure(p, ec);
    }

    if (ec != 0) ec->clear();

    if (attr & FILE_ATTRIBUTE_REPARSE_POINT)
      return is_reparse_point_a_symlink(p)
             ? file_status(symlink_file, make_permissions(p, attr))
             : file_status(reparse_file, make_permissions(p, attr));

    return (attr & FILE_ATTRIBUTE_DIRECTORY)
      ? file_status(directory_file, make_permissions(p, attr))
      : file_status(regular_file, make_permissions(p, attr));

#   endif
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4dc70
movq %rax, %rdi
leaq -0xa8(%rbp), %rsi
callq 0xd910
cmpl $0x0, %eax
je 0x485b6
cmpq $0x0, -0x18(%rbp)
je 0x4844d
movq -0x18(%rbp), %rax
movq %rax, -0x100(%rbp)
callq 0xd070
movl (%rax), %eax
movl %eax, -0xf8(%rbp)
callq 0x53ec0
movq -0x100(%rbp), %rdi
movl -0xf8(%rbp), %esi
movq %rax, %rdx
callq 0x4d800
callq 0xd070
cmpl $0x2, (%rax)
je 0x48461
callq 0xd070
cmpl $0x14, (%rax)
jne 0x48476
leaq -0x8(%rbp), %rdi
movl $0x1, %esi
xorl %edx, %edx
callq 0x4df70
jmp 0x48751
cmpq $0x0, -0x18(%rbp)
jne 0x485a1
movb $0x1, -0xf1(%rbp)
movl $0x50, %edi
callq 0xd2b0
movq %rax, -0x110(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0xdb50
movq -0x108(%rbp), %rdx
leaq 0x1ab2c(%rip), %rsi     # 0x62fe6
leaq -0xc8(%rbp), %rdi
callq 0xd8b0
jmp 0x484c8
movq -0x10(%rbp), %rax
movq %rax, -0x118(%rbp)
callq 0xd070
movl (%rax), %eax
movl %eax, -0x11c(%rbp)
callq 0x53ec0
movl -0x11c(%rbp), %esi
movq %rax, %rdx
leaq -0xf0(%rbp), %rdi
callq 0x4d680
movq -0x118(%rbp), %rdx
movq -0x110(%rbp), %rdi
movl -0xf0(%rbp), %ecx
movq -0xe8(%rbp), %r8
leaq -0xc8(%rbp), %rsi
callq 0x4d6b0
movq -0x110(%rbp), %rdi
movb $0x0, -0xf1(%rbp)
leaq 0x45022(%rip), %rsi     # 0x8d558
leaq 0x5283(%rip), %rdx      # 0x4d7c0
callq 0xdad0
jmp 0x4876a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
jmp 0x48579
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd8(%rbp)
movl %eax, -0xdc(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xdca8
leaq -0xc9(%rbp), %rdi
callq 0xd6b0
testb $0x1, -0xf1(%rbp)
jne 0x48590
jmp 0x4859c
movq -0x110(%rbp), %rdi
callq 0xd460
jmp 0x4875e
leaq -0x8(%rbp), %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x4df70
jmp 0x48751
cmpq $0x0, -0x18(%rbp)
je 0x485c6
movq -0x18(%rbp), %rdi
callq 0x4d9e0
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x485fd
movl -0x90(%rbp), %edi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x4ddc0
movl %eax, %edx
leaq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x4df70
jmp 0x48751
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x48634
movl -0x90(%rbp), %edi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x4ddc0
movl %eax, %edx
leaq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0x4df70
jmp 0x48751
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xa000, %eax           # imm = 0xA000
jne 0x4866b
movl -0x90(%rbp), %edi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x4ddc0
movl %eax, %edx
leaq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x4df70
jmp 0x48751
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x6000, %eax           # imm = 0x6000
jne 0x486a2
movl -0x90(%rbp), %edi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x4ddc0
movl %eax, %edx
leaq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0x4df70
jmp 0x48751
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x2000, %eax           # imm = 0x2000
jne 0x486d6
movl -0x90(%rbp), %edi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x4ddc0
movl %eax, %edx
leaq -0x8(%rbp), %rdi
movl $0x6, %esi
callq 0x4df70
jmp 0x48751
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x1000, %eax           # imm = 0x1000
jne 0x4870a
movl -0x90(%rbp), %edi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x4ddc0
movl %eax, %edx
leaq -0x8(%rbp), %rdi
movl $0x7, %esi
callq 0x4df70
jmp 0x48751
movl -0x90(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0xc000, %eax           # imm = 0xC000
jne 0x4873e
movl -0x90(%rbp), %edi
movl $0xfff, %esi            # imm = 0xFFF
callq 0x4ddc0
movl %eax, %edx
leaq -0x8(%rbp), %rdi
movl $0x8, %esi
callq 0x4df70
jmp 0x48751
leaq -0x8(%rbp), %rdi
movl $0xa, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x4df70
movq -0x8(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0xd8(%rbp), %rdi
callq 0xdb30
nopw (%rax,%rax)