// File: demon386[P]git-store/./libs/filesystem/src/operations.cpp
// Function: boost::filesystem::detail::canonical(boost::filesystem::path const&, boost::filesystem::path const&, boost::system::error_code*)
BOOST_FILESYSTEM_DECL
  path canonical(const path& p, const path& base, system::error_code* ec)
  {
    path source (p.is_absolute() ? p : absolute(p, base));
    path root(source.root_path());
    path result;

    system::error_code local_ec;
    file_status stat (status(source, local_ec));

    if (stat.type() == fs::file_not_found)
    {
      if (ec == 0)
        BOOST_FILESYSTEM_THROW(filesystem_error(
          "boost::filesystem::canonical", source,
          error_code(system::errc::no_such_file_or_directory, system::generic_category())));
      ec->assign(system::errc::no_such_file_or_directory, system::generic_category());
      return result;
    }
    else if (local_ec)
    {
      if (ec == 0)
        BOOST_FILESYSTEM_THROW(filesystem_error(
          "boost::filesystem::canonical", source, local_ec));
      *ec = local_ec;
      return result;
    }

    bool scan (true);
    while (scan)
    {
      scan = false;
      result.clear();
      for (path::iterator itr = source.begin(); itr != source.end(); ++itr)
      {
        if (*itr == dot_path())
          continue;
        if (*itr == dot_dot_path())
        {
          if (result != root)
            result.remove_filename();
          continue;
        }

        result /= *itr;

        bool is_sym (is_symlink(detail::symlink_status(result, ec)));
        if (ec && *ec)
          return path();

        if (is_sym)
        {
          path link(detail::read_symlink(result, ec));
          if (ec && *ec)
            return path();
          result.remove_filename();

          if (link.is_absolute())
          {
            for (++itr; itr != source.end(); ++itr)
              link /= *itr;
            source = link;
          }
          else // link is relative
          {
            path new_source(result);
            new_source /= link;
            for (++itr; itr != source.end(); ++itr)
              new_source /= *itr;
            source = new_source;
          }
          scan = true;  // symlink causes scan to be restarted
          break;
        }
      }
    }
    if (ec != 0)
      ec->clear();
    BOOST_ASSERT_MSG(result.is_absolute(), "canonical() implementation error; please report");
    return result;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x248(%rbp)
movq %rdi, %rax
movq %rax, -0x240(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4d4d0
testb $0x1, %al
jne 0x47a7b
jmp 0x47a8a
movq -0x10(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x4d4f0
jmp 0x47a9b
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x475d0
leaq -0x60(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x504e0
jmp 0x47aaa
leaq -0x90(%rbp), %rdi
callq 0x4d620
jmp 0x47ab8
leaq -0xa0(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0x4d4a0
movq -0x258(%rbp), %rsi
leaq -0x40(%rbp), %rdi
callq 0x4d640
movq %rax, -0x250(%rbp)
jmp 0x47ae4
movq -0x250(%rbp), %rax
movq %rax, -0xa8(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0x4d670
movl %eax, -0x25c(%rbp)
jmp 0x47b06
movl -0x25c(%rbp), %eax
cmpl $0x1, %eax
jne 0x47c93
cmpq $0x0, -0x20(%rbp)
jne 0x47c4b
movb $0x1, -0xe1(%rbp)
movl $0x50, %edi
callq 0xd2b0
movq %rax, -0x270(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0xdb50
movq -0x268(%rbp), %rdx
leaq 0x1af35(%rip), %rsi     # 0x62a8e
leaq -0xc8(%rbp), %rdi
callq 0xd8b0
jmp 0x47b67
callq 0x53e50
movq %rax, %rdx
leaq -0xe0(%rbp), %rdi
movl $0x2, %esi
callq 0x4d680
movq -0x270(%rbp), %rdi
movl -0xe0(%rbp), %ecx
movq -0xd8(%rbp), %r8
leaq -0xc8(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x4d6b0
movq -0x270(%rbp), %rdi
movb $0x0, -0xe1(%rbp)
leaq 0x4599f(%rip), %rsi     # 0x8d558
leaq 0x5c00(%rip), %rdx      # 0x4d7c0
callq 0xdad0
jmp 0x483d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x483c7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x483be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x483b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x47c23
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xdca8
leaq -0xc9(%rbp), %rdi
callq 0xd6b0
testb $0x1, -0xe1(%rbp)
jne 0x47c3a
jmp 0x47c46
movq -0x270(%rbp), %rdi
callq 0xd460
jmp 0x483b2
movq -0x20(%rbp), %rax
movq %rax, -0x278(%rbp)
callq 0x53e50
movq -0x278(%rbp), %rdi
movq %rax, %rdx
movl $0x2, %esi
callq 0x4d800
movq -0x248(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4d4f0
jmp 0x47c84
movl $0x1, -0xe8(%rbp)
jmp 0x48384
leaq -0xa0(%rbp), %rdi
callq 0x4d830
cmpq $0x0, %rax
je 0x47dd3
cmpq $0x0, -0x20(%rbp)
jne 0x47da1
movb $0x1, -0x121(%rbp)
movl $0x50, %edi
callq 0xd2b0
movq %rax, -0x288(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0xdb50
movq -0x280(%rbp), %rdx
leaq 0x1ada1(%rip), %rsi     # 0x62a8e
leaq -0x108(%rbp), %rdi
callq 0xd8b0
jmp 0x47cfb
movq -0x288(%rbp), %rdi
movups -0xa0(%rbp), %xmm0
movaps %xmm0, -0x120(%rbp)
movl -0x120(%rbp), %ecx
movq -0x118(%rbp), %r8
leaq -0x108(%rbp), %rsi
leaq -0x40(%rbp), %rdx
callq 0x4d6b0
movq -0x288(%rbp), %rdi
movb $0x0, -0x121(%rbp)
leaq 0x45816(%rip), %rsi     # 0x8d558
leaq 0x5a77(%rip), %rdx      # 0x4d7c0
callq 0xdad0
jmp 0x483d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x47d79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x108(%rbp), %rdi
callq 0xdca8
leaq -0x109(%rbp), %rdi
callq 0xd6b0
testb $0x1, -0x121(%rbp)
jne 0x47d90
jmp 0x47d9c
movq -0x288(%rbp), %rdi
callq 0xd460
jmp 0x483b2
movq -0x248(%rbp), %rdi
movq -0x20(%rbp), %rax
movups -0xa0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x90(%rbp), %rsi
callq 0x4d4f0
jmp 0x47dc4
movl $0x1, -0xe8(%rbp)
jmp 0x48384
jmp 0x47dd5
movb $0x1, -0x122(%rbp)
testb $0x1, -0x122(%rbp)
je 0x482f5
movb $0x0, -0x122(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x4d850
jmp 0x47dfe
leaq -0x158(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x4ff50
jmp 0x47e10
jmp 0x47e12
leaq -0x188(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x50060
jmp 0x47e24
leaq -0x158(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x4d870
movb %al, -0x289(%rbp)
jmp 0x47e3f
leaq -0x188(%rbp), %rdi
callq 0x4d8a0
movb -0x289(%rbp), %al
testb $0x1, %al
jne 0x47e92
movl $0x4, -0xe8(%rbp)
jmp 0x482c3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x482df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x4d8a0
jmp 0x482df
leaq -0x158(%rbp), %rdi
callq 0x4d8f0
movq %rax, -0x298(%rbp)
jmp 0x47ea7
callq 0x50d50
movq %rax, -0x2a0(%rbp)
jmp 0x47eb5
movq -0x2a0(%rbp), %rsi
movq -0x298(%rbp), %rdi
callq 0x4d8c0
movb %al, -0x2a1(%rbp)
jmp 0x47ed0
movb -0x2a1(%rbp), %al
testb $0x1, %al
jne 0x47edc
jmp 0x47ee1
jmp 0x482b0
leaq -0x158(%rbp), %rdi
callq 0x4d8f0
movq %rax, -0x2b0(%rbp)
jmp 0x47ef6
callq 0x50f20
movq %rax, -0x2b8(%rbp)
jmp 0x47f04
movq -0x2b8(%rbp), %rsi
movq -0x2b0(%rbp), %rdi
callq 0x4d8c0
movb %al, -0x2b9(%rbp)
jmp 0x47f1f
movb -0x2b9(%rbp), %al
testb $0x1, %al
jne 0x47f2b
jmp 0x47f64
leaq -0x90(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4d920
movb %al, -0x2ba(%rbp)
jmp 0x47f43
movb -0x2ba(%rbp), %al
testb $0x1, %al
jne 0x47f4f
jmp 0x47f5f
leaq -0x90(%rbp), %rdi
callq 0x50140
jmp 0x47f5d
jmp 0x47f5f
jmp 0x482b0
leaq -0x158(%rbp), %rdi
callq 0x4d8f0
movq %rax, -0x2c8(%rbp)
jmp 0x47f79
movq -0x2c8(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x4f990
jmp 0x47f8e
movq -0x20(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x483e0
movq %rax, -0x2d0(%rbp)
jmp 0x47fa7
movq -0x2d0(%rbp), %rax
movq %rax, -0x194(%rbp)
movq -0x194(%rbp), %rdi
callq 0x4d950
movb %al, -0x2d1(%rbp)
jmp 0x47fc9
movb -0x2d1(%rbp), %al
andb $0x1, %al
movb %al, -0x189(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x4800a
movq -0x20(%rbp), %rdi
callq 0x4d830
cmpq $0x0, %rax
je 0x4800a
movq -0x248(%rbp), %rdi
callq 0x4d620
jmp 0x47ffb
movl $0x1, -0xe8(%rbp)
jmp 0x482c3
testb $0x1, -0x189(%rbp)
je 0x482ae
movq -0x20(%rbp), %rdx
leaq -0x1b8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x48770
jmp 0x48030
cmpq $0x0, -0x20(%rbp)
je 0x48074
movq -0x20(%rbp), %rdi
callq 0x4d830
cmpq $0x0, %rax
je 0x48074
movq -0x248(%rbp), %rdi
callq 0x4d620
jmp 0x48054
movl $0x1, -0xe8(%rbp)
jmp 0x48292
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x482a0
leaq -0x90(%rbp), %rdi
callq 0x50140
jmp 0x48082
leaq -0x1b8(%rbp), %rdi
callq 0x4d4d0
movb %al, -0x2d2(%rbp)
jmp 0x48096
movb -0x2d2(%rbp), %al
testb $0x1, %al
jne 0x480a5
jmp 0x4816d
leaq -0x158(%rbp), %rdi
callq 0x4d980
jmp 0x480b3
jmp 0x480b5
leaq -0x1e8(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x50060
jmp 0x480c7
leaq -0x158(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x4d870
movb %al, -0x2d3(%rbp)
jmp 0x480e2
leaq -0x1e8(%rbp), %rdi
callq 0x4d8a0
movb -0x2d3(%rbp), %al
testb $0x1, %al
jne 0x480fa
jmp 0x48156
leaq -0x158(%rbp), %rdi
callq 0x4d8f0
movq %rax, -0x2e0(%rbp)
jmp 0x4810f
movq -0x2e0(%rbp), %rsi
leaq -0x1b8(%rbp), %rdi
callq 0x4f990
jmp 0x48124
jmp 0x48126
leaq -0x158(%rbp), %rdi
callq 0x4d980
jmp 0x48134
jmp 0x480b5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x1e8(%rbp), %rdi
callq 0x4d8a0
jmp 0x482a0
leaq -0x40(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x4d9b0
jmp 0x48168
jmp 0x48281
leaq -0x208(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4d4f0
jmp 0x48182
leaq -0x208(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x4f990
jmp 0x48197
leaq -0x158(%rbp), %rdi
callq 0x4d980
jmp 0x481a5
jmp 0x481a7
leaq -0x238(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x50060
jmp 0x481b9
leaq -0x158(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x4d870
movb %al, -0x2e1(%rbp)
jmp 0x481d4
leaq -0x238(%rbp), %rdi
callq 0x4d8a0
movb -0x2e1(%rbp), %al
testb $0x1, %al
jne 0x481ec
jmp 0x48253
leaq -0x158(%rbp), %rdi
callq 0x4d8f0
movq %rax, -0x2f0(%rbp)
jmp 0x48201
movq -0x2f0(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x4f990
jmp 0x48216
jmp 0x48218
leaq -0x158(%rbp), %rdi
callq 0x4d980
jmp 0x48226
jmp 0x481a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
jmp 0x48273
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x68(%rbp)
movl %eax, -0x6c(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x4d8a0
jmp 0x48273
leaq -0x40(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x4d9b0
jmp 0x48265
leaq -0x208(%rbp), %rdi
callq 0x4d550
jmp 0x48281
leaq -0x208(%rbp), %rdi
callq 0x4d550
jmp 0x482a0
movb $0x1, -0x122(%rbp)
movl $0x4, -0xe8(%rbp)
leaq -0x1b8(%rbp), %rdi
callq 0x4d550
jmp 0x482c3
leaq -0x1b8(%rbp), %rdi
callq 0x4d550
jmp 0x482df
jmp 0x482b0
leaq -0x158(%rbp), %rdi
callq 0x4d980
jmp 0x482be
jmp 0x47e12
leaq -0x158(%rbp), %rdi
callq 0x4d8a0
movl -0xe8(%rbp), %eax
subl $0x4, %eax
je 0x482f0
jmp 0x48384
leaq -0x158(%rbp), %rdi
callq 0x4d8a0
jmp 0x483b2
jmp 0x47ddc
cmpq $0x0, -0x20(%rbp)
je 0x48305
movq -0x20(%rbp), %rdi
callq 0x4d9e0
leaq -0x90(%rbp), %rdi
callq 0x4d4d0
movb %al, -0x2f1(%rbp)
jmp 0x48319
movb -0x2f1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x2f2(%rbp)
jne 0x4832e
jmp 0x48338
movb $0x1, %al
movb %al, -0x2f2(%rbp)
jmp 0x48338
movb -0x2f2(%rbp), %al
testb $0x1, %al
jne 0x48344
jmp 0x48346
jmp 0x48365
leaq 0x1a78e(%rip), %rdi     # 0x62adb
leaq 0x1a7d3(%rip), %rsi     # 0x62b27
movl $0x35e, %edx            # imm = 0x35E
leaq 0x1a7ec(%rip), %rcx     # 0x62b4c
callq 0xd400
movq -0x248(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4d4f0
jmp 0x4837a
movl $0x1, -0xe8(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x4d550
leaq -0x60(%rbp), %rdi
callq 0x4d550
leaq -0x40(%rbp), %rdi
callq 0x4d550
movq -0x240(%rbp), %rax
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x90(%rbp), %rdi
callq 0x4d550
leaq -0x60(%rbp), %rdi
callq 0x4d550
leaq -0x40(%rbp), %rdi
callq 0x4d550
movq -0x68(%rbp), %rdi
callq 0xdb30
nopl (%rax)