// File: demon386[P]git-store/./libs/filesystem/src/operations.cpp
// Function: (anonymous namespace)::dir_itr_increment(void*&, void*&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, boost::filesystem::file_status&, boost::filesystem::file_status&)
error_code dir_itr_increment(void *& handle, void *& buffer,
    string& target, fs::file_status & sf, fs::file_status & symlink_sf)
  {
    BOOST_ASSERT(buffer != 0);
    dirent * entry(static_cast<dirent *>(buffer));
    dirent * result;
    int return_code;
    if ((return_code = readdir_r_simulator(static_cast<DIR*>(handle), entry, &result))!= 0)
      return error_code(errno, system_category());
    if (result == 0)
      return fs::detail::dir_itr_close(handle, buffer);
    target = entry->d_name;
#   ifdef BOOST_FILESYSTEM_STATUS_CACHE
    if (entry->d_type == DT_UNKNOWN) // filesystem does not supply d_type value
    {
      sf = symlink_sf = fs::file_status(fs::status_error);
    }
    else  // filesystem supplies d_type value
    {
      if (entry->d_type == DT_DIR)
        sf = symlink_sf = fs::file_status(fs::directory_file);
      else if (entry->d_type == DT_REG)
        sf = symlink_sf = fs::file_status(fs::regular_file);
      else if (entry->d_type == DT_LNK)
      {
        sf = fs::file_status(fs::status_error);
        symlink_sf = fs::file_status(fs::symlink_file);
      }
      else sf = symlink_sf = fs::file_status(fs::status_error);
    }
#   else
    sf = symlink_sf = fs::file_status(fs::status_error);
#    endif
    return ok;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movq %rdx, -0x28(%rbp)
movq %rcx, -0x30(%rbp)
movq %r8, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpq $0x0, (%rax)
je 0x4cf5b
jmp 0x4cf7a
leaq 0x16577(%rip), %rdi     # 0x634d9
leaq 0x15bbe(%rip), %rsi     # 0x62b27
movl $0x7db, %edx            # imm = 0x7DB
leaq 0x16570(%rip), %rcx     # 0x634e5
callq 0xd400
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x40(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0x4d260
movl %eax, -0x4c(%rbp)
cmpl $0x0, %eax
je 0x4cfc4
callq 0xd070
movl (%rax), %eax
movl %eax, -0x80(%rbp)
callq 0x53ec0
movl -0x80(%rbp), %esi
movq %rax, %rdx
leaq -0x10(%rbp), %rdi
callq 0x4d680
jmp 0x4d126
cmpq $0x0, -0x48(%rbp)
jne 0x4cfe4
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x4c3b0
movl %eax, -0x10(%rbp)
movq %rdx, -0x8(%rbp)
jmp 0x4d126
movq -0x40(%rbp), %rsi
addq $0x13, %rsi
movq -0x28(%rbp), %rdi
callq 0xd8a0
movq -0x40(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x0, %eax
jne 0x4d02c
leaq -0x54(%rbp), %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x4df70
movq -0x38(%rbp), %rcx
movq -0x54(%rbp), %rax
movq %rax, (%rcx)
movq -0x30(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0x4d110
movq -0x40(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x4, %eax
jne 0x4d066
leaq -0x5c(%rbp), %rdi
movl $0x3, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x4df70
movq -0x38(%rbp), %rcx
movq -0x5c(%rbp), %rax
movq %rax, (%rcx)
movq -0x30(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0x4d10e
movq -0x40(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0x8, %eax
jne 0x4d09d
leaq -0x64(%rbp), %rdi
movl $0x2, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x4df70
movq -0x38(%rbp), %rcx
movq -0x64(%rbp), %rax
movq %rax, (%rcx)
movq -0x30(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0x4d10c
movq -0x40(%rbp), %rax
movzbl 0x12(%rax), %eax
cmpl $0xa, %eax
jne 0x4d0e5
leaq -0x6c(%rbp), %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x4df70
movq -0x30(%rbp), %rax
movq -0x6c(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x74(%rbp), %rdi
movl $0x4, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x4df70
movq -0x38(%rbp), %rax
movq -0x74(%rbp), %rcx
movq %rcx, (%rax)
jmp 0x4d10a
leaq -0x7c(%rbp), %rdi
xorl %esi, %esi
movl $0xffff, %edx           # imm = 0xFFFF
callq 0x4df70
movq -0x38(%rbp), %rcx
movq -0x7c(%rbp), %rax
movq %rax, (%rcx)
movq -0x30(%rbp), %rax
movq (%rcx), %rcx
movq %rcx, (%rax)
jmp 0x4d10c
jmp 0x4d10e
jmp 0x4d110
movq 0x41691(%rip), %rax     # 0x8e7a8
movq %rax, -0x10(%rbp)
movq 0x4168e(%rip), %rax     # 0x8e7b0
movq %rax, -0x8(%rbp)
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rdx
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)