// File: demon386[P]git-store/./libs/filesystem/src/path.cpp
// Function: boost::filesystem::path::m_path_iterator_increment(boost::filesystem::path::iterator&)
void path::m_path_iterator_increment(path::iterator & it)
  {
    BOOST_ASSERT_MSG(it.m_pos < it.m_path_ptr->m_pathname.size(),
      "path::basic_iterator increment past end()");

    // increment to position past current element; if current element is implicit dot,
    // this will cause it.m_pos to represent the end iterator
    it.m_pos += it.m_element.m_pathname.size();

    // if the end is reached, we are done
    if (it.m_pos == it.m_path_ptr->m_pathname.size())
    {
      it.m_element.clear();  // aids debugging, may release unneeded memory
      return;
    }

    // both POSIX and Windows treat paths that begin with exactly two separators specially
    bool was_net(it.m_element.m_pathname.size() > 2
      && is_separator(it.m_element.m_pathname[0])
      && is_separator(it.m_element.m_pathname[1])
      && !is_separator(it.m_element.m_pathname[2]));

    // process separator (Windows drive spec is only case not a separator)
    if (is_separator(it.m_path_ptr->m_pathname[it.m_pos]))
    {
      // detect root directory
      if (was_net
#       ifdef BOOST_WINDOWS_API
        // case "c:/"
        || it.m_element.m_pathname[it.m_element.m_pathname.size()-1] == colon
#       endif
         )
      {
        it.m_element.m_pathname = separator;  // generic format; see docs
        return;
      }

      // skip separators until it.m_pos points to the start of the next element
      while (it.m_pos != it.m_path_ptr->m_pathname.size()
        && is_separator(it.m_path_ptr->m_pathname[it.m_pos]))
        { ++it.m_pos; }

      // detect trailing separator, and treat it as ".", per POSIX spec
      if (it.m_pos == it.m_path_ptr->m_pathname.size()
        && !is_root_separator(it.m_path_ptr->m_pathname, it.m_pos-1)) 
      {
        --it.m_pos;
        it.m_element = detail::dot_path();
        return;
      }
    }

    // get m_element
    size_type end_pos(it.m_path_ptr->m_pathname.find_first_of(separators, it.m_pos));
    if (end_pos == string_type::npos)
      end_pos = it.m_path_ptr->m_pathname.size();
    it.m_element = it.m_path_ptr->m_pathname.substr(it.m_pos, end_pos - it.m_pos);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xd430
movq -0x50(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x45(%rbp)
jae 0x51980
movb $0x1, %al
movb %al, -0x45(%rbp)
jmp 0x51980
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0x51989
jmp 0x5198b
jmp 0x519aa
leaq 0x11ee0(%rip), %rdi     # 0x63872
leaq 0x11e22(%rip), %rsi     # 0x637bb
movl $0x2ce, %edx            # imm = 0x2CE
leaq 0x11f2a(%rip), %rcx     # 0x638cf
callq 0xd400
movq -0x8(%rbp), %rdi
callq 0xd430
movq %rax, %rcx
movq -0x8(%rbp), %rax
addq 0x28(%rax), %rcx
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xd430
movq %rax, %rcx
movq -0x58(%rbp), %rax
cmpq %rcx, %rax
jne 0x519f5
movq -0x8(%rbp), %rdi
callq 0x4d850
jmp 0x51bf3
movq -0x8(%rbp), %rdi
callq 0xd430
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x2, %rcx
movb %al, -0x59(%rbp)
jbe 0x51a6e
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xdc50
movsbl (%rax), %edi
callq 0x4fab0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x59(%rbp)
jne 0x51a2f
jmp 0x51a6e
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xdc50
movsbl (%rax), %edi
callq 0x4fab0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x59(%rbp)
jne 0x51a53
jmp 0x51a6e
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0xdc50
movsbl (%rax), %edi
callq 0x4fab0
xorb $-0x1, %al
movb %al, -0x59(%rbp)
movb -0x59(%rbp), %al
andb $0x1, %al
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0xd6d0
movsbl (%rax), %edi
callq 0x4fab0
testb $0x1, %al
jne 0x51a9c
jmp 0x51b83
testb $0x1, -0x9(%rbp)
je 0x51ab5
movq -0x8(%rbp), %rdi
movl $0x2f, %esi
callq 0xdaa0
jmp 0x51bf3
jmp 0x51ab7
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xd430
movq -0x68(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x5a(%rbp)
je 0x51b01
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0xd6d0
movsbl (%rax), %edi
callq 0x4fab0
movb %al, -0x5a(%rbp)
movb -0x5a(%rbp), %al
testb $0x1, %al
jne 0x51b0a
jmp 0x51b1c
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x28(%rax)
jmp 0x51ab7
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xd430
movq %rax, %rcx
movq -0x70(%rbp), %rax
cmpq %rcx, %rax
jne 0x51b81
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
subq $0x1, %rsi
callq 0x50c10
testb $0x1, %al
jne 0x51b81
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x28(%rax)
callq 0x50d50
movq %rax, %rsi
movq -0x8(%rbp), %rdi
callq 0x4d9b0
jmp 0x51bf3
jmp 0x51b83
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdx
leaq 0x104b6(%rip), %rsi     # 0x62050
callq 0xd2c0
movq %rax, -0x18(%rbp)
cmpq $-0x1, -0x18(%rbp)
jne 0x51bbb
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xd430
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rsi
movq 0x28(%rax), %rdx
movq -0x18(%rbp), %rcx
subq %rdx, %rcx
leaq -0x38(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0xd650
movq -0x78(%rbp), %rsi
movq -0x8(%rbp), %rdi
callq 0x52280
jmp 0x51bea
leaq -0x38(%rbp), %rdi
callq 0xdca8
addq $0x80, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xdca8
movq -0x40(%rbp), %rdi
callq 0xdb30
nopw (%rax,%rax)