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

    struct stat path_stat;
    if (::stat(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 (not_found_error(errno))
      {
        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_ISDIR(path_stat.st_mode))
      return fs::file_status(fs::directory_file,
        static_cast<perms>(path_stat.st_mode) & fs::perms_mask);
    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_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);
    }

    //  reparse point handling;
    //    since GetFileAttributesW does not resolve symlinks, try to open a file
    //    handle to discover if the file exists
    if (attr & FILE_ATTRIBUTE_REPARSE_POINT)
    {
      handle_wrapper h(
        create_file_handle(
            p.c_str(),
            0,  // dwDesiredAccess; attributes only
            FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE,
            0,  // lpSecurityAttributes
            OPEN_EXISTING,
            FILE_FLAG_BACKUP_SEMANTICS,
            0)); // hTemplateFile
      if (h.handle == INVALID_HANDLE_VALUE)
      {
        return process_status_failure(p, ec);
      }

      if (!is_reparse_point_a_symlink(p))
        return file_status(reparse_file, make_permissions(p, attr));
    }

    if (ec != 0) ec->clear();
    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
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xb0, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rdi
leaq -0xd0(%rbp), %rsi
callq 0xb7c0
testl %eax, %eax
je 0x289f1
testq %rbx, %rbx
je 0x289b9
callq 0xb060
movl (%rax), %r15d
callq 0x2c80a
movl %r15d, (%rbx)
movq %rax, 0x8(%rbx)
callq 0xb060
movq %rax, %r15
movl (%rax), %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x2, %edx
je 0x28a89
cmpl $0x14, %edx
je 0x28a89
testq %rbx, %rbx
je 0x28aa0
movl $0xffff, %eax           # imm = 0xFFFF
xorl %ecx, %ecx
jmp 0x28a89
testq %rbx, %rbx
je 0x28a05
movl $0x0, (%rbx)
callq 0x2c80a
movq %rax, 0x8(%rbx)
movl -0xb8(%rbp), %edx
movl %edx, %esi
andl $0xf000, %esi           # imm = 0xF000
addl $0xfffff000, %esi       # imm = 0xFFFFF000
shrl $0xc, %esi
movl $0xffff, %eax           # imm = 0xFFFF
movl $0xa, %ecx
cmpl $0xb, %esi
ja 0x28a89
leaq 0xcfd6(%rip), %rdi      # 0x35a08
movslq (%rdi,%rsi,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
andl $0xfff, %edx            # imm = 0xFFF
movl $0x7, %ecx
jmp 0x28a87
andl $0xfff, %edx            # imm = 0xFFF
movl $0x3, %ecx
jmp 0x28a87
andl $0xfff, %edx            # imm = 0xFFF
movl $0x8, %ecx
jmp 0x28a87
andl $0xfff, %edx            # imm = 0xFFF
movl $0x6, %ecx
jmp 0x28a87
andl $0xfff, %edx            # imm = 0xFFF
movl $0x5, %ecx
jmp 0x28a87
andl $0xfff, %edx            # imm = 0xFFF
movl $0x2, %ecx
movl %edx, %eax
shlq $0x20, %rax
orq %rcx, %rax
addq $0xb0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x50, %edi
callq 0xb250
movq %rax, %rbx
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0xd46c(%rip), %rsi      # 0x35f29
leaq 0xd47e(%rip), %rdx      # 0x35f42
leaq -0x40(%rbp), %rdi
callq 0xf97e
movl (%r15), %r15d
callq 0x2c80a
leaq -0x40(%rbp), %rsi
movq %rbx, %rdi
movq %r14, %rdx
movl %r15d, %ecx
movq %rax, %r8
callq 0x29772
leaq 0x22a77(%rip), %rsi     # 0x4b568
leaq 0xd64(%rip), %rdx       # 0x2985c
movq %rbx, %rdi
callq 0xb7b0
movq %rax, %r14
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x28b11
callq 0xb430
xorl %eax, %eax
jmp 0x28b1a
movq %rax, %r14
movb $0x1, %al
testb %al, %al
je 0x28b26
movq %rbx, %rdi
callq 0xb360
movq %r14, %rdi
callq 0xb7f0