// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rcx, -0x38(%rbp)
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, -0x30(%rbp)
movq %rsi, %rdi
callq 0x24d86
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
testb %al, %al
je 0x21f8b
callq 0xc660
jmp 0x21f93
movq %r15, %rdx
callq 0x21cdc
leaq -0x150(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x25c2c
leaq -0x48(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0xc0(%rbp), %rbx
andl $0x0, (%rbx)
callq 0x2761f
movq %rax, 0x8(%rbx)
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq 0x23f1a
cmpl $0x1, %eax
jne 0x21ff5
movq -0x38(%rbp), %rbx
testq %rbx, %rbx
je 0x2236f
callq 0x275dc
movl $0x2, (%rbx)
movq %rax, 0x8(%rbx)
jmp 0x22015
cmpl $0x0, -0xc0(%rbp)
movq -0x38(%rbp), %rax
je 0x22056
testq %rax, %rax
je 0x223ca
movups -0xc0(%rbp), %xmm0
movups %xmm0, (%rax)
leaq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0xc660
leaq -0x58(%rbp), %rdi
callq 0xc9a0
leaq -0x150(%rbp), %rdi
callq 0xc9a0
leaq -0x78(%rbp), %rdi
callq 0xc9a0
movq -0x30(%rbp), %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x80(%rbp)
leaq -0xf0(%rbp), %r13
leaq -0xb0(%rbp), %r12
andq $0x0, -0x50(%rbp)
movq -0x58(%rbp), %rax
movb $0x0, (%rax)
movq %r13, %rdi
leaq -0x78(%rbp), %rsi
callq 0x258a2
movq %r13, %r15
movq %r12, %rdi
leaq -0x78(%rbp), %rsi
callq 0x259b6
movq %r12, %rdi
movq -0x90(%rbp), %r12
movq -0xd0(%rbp), %r13
movq -0xc8(%rbp), %rbx
movq -0x88(%rbp), %r14
callq 0xc9a0
cmpq %r12, %r13
jne 0x220c9
cmpq %r14, %rbx
je 0x22154
callq 0x2601b
leaq -0xb0(%rbp), %r12
movq %r15, %r13
movq %r15, %rdi
movq %rax, %rsi
callq 0x24b12
testb %al, %al
jne 0x22147
callq 0x2614f
movq %r13, %rdi
movq %rax, %rsi
callq 0x24b12
testb %al, %al
je 0x2211a
leaq -0x58(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x24b22
testb %al, %al
je 0x22147
leaq -0x58(%rbp), %rdi
callq 0x25a08
jmp 0x22147
leaq -0x58(%rbp), %rdi
movq %r13, %rsi
callq 0x2558c
leaq -0x58(%rbp), %rdi
movq -0x38(%rbp), %rbx
movq %rbx, %rsi
callq 0x224cc
testq %rbx, %rbx
je 0x22140
cmpl $0x0, (%rbx)
jne 0x221be
movl %eax, %eax
cmpl $0x4, %eax
je 0x22181
movq %r13, %rdi
callq 0x2652a
jmp 0x22088
xorl %ebx, %ebx
movb $0x1, %r14b
leaq -0xb0(%rbp), %r12
movq %r15, %r13
movq %r13, %rdi
callq 0xc9a0
testb %r14b, %r14b
je 0x22022
testb %bl, %bl
jne 0x22070
jmp 0x2233e
leaq -0x110(%rbp), %rdi
leaq -0x58(%rbp), %rsi
movq -0x38(%rbp), %rbx
movq %rbx, %rdx
callq 0x22654
testq %rbx, %rbx
je 0x221d9
cmpl $0x0, (%rbx)
je 0x221d9
movq -0x30(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, (%rax)
andq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
xorl %r14d, %r14d
jmp 0x2232a
movq -0x30(%rbp), %rax
movq -0x80(%rbp), %rcx
movq %rcx, (%rax)
andq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
xorl %r14d, %r14d
xorl %ebx, %ebx
jmp 0x22163
leaq -0x58(%rbp), %rdi
callq 0x25a08
leaq -0x110(%rbp), %rdi
callq 0x24d86
testb %al, %al
je 0x2225b
movq %r13, %rdi
callq 0x2652a
movq %r12, %rdi
leaq -0x78(%rbp), %rsi
callq 0x259b6
movq %r12, %rdi
movq -0x90(%rbp), %r12
movq -0xd0(%rbp), %r13
movq -0xc8(%rbp), %rbx
movq -0x88(%rbp), %r14
callq 0xc9a0
cmpq %r12, %r13
jne 0x22238
cmpq %r14, %rbx
je 0x222e2
leaq -0x110(%rbp), %rdi
movq %r15, %rbx
movq %r15, %rsi
callq 0x2558c
leaq -0xb0(%rbp), %r12
movq %rbx, %rdi
callq 0x2652a
jmp 0x221fa
leaq -0x130(%rbp), %rbx
movq %rbx, %rdi
leaq -0x58(%rbp), %rsi
callq 0xc660
movq %rbx, %rdi
leaq -0x110(%rbp), %rsi
callq 0x2558c
movq %r13, %rdi
callq 0x2652a
movq %r12, %rdi
leaq -0x78(%rbp), %rsi
callq 0x259b6
movq %r12, %rdi
movq -0x90(%rbp), %r12
movq -0xd0(%rbp), %r13
movq -0xc8(%rbp), %rbx
movq -0x88(%rbp), %r14
callq 0xc9a0
cmpq %r12, %r13
jne 0x222bf
cmpq %r14, %rbx
je 0x22301
leaq -0x130(%rbp), %rdi
movq %r15, %rbx
movq %r15, %rsi
callq 0x2558c
leaq -0xb0(%rbp), %r12
movq %rbx, %rdi
callq 0x2652a
jmp 0x22285
movb $0x1, %r14b
leaq -0x78(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0xc2b0
leaq -0xb0(%rbp), %r12
movq %r15, %r13
jmp 0x2232a
leaq -0x78(%rbp), %rdi
leaq -0x130(%rbp), %rsi
callq 0xc2b0
leaq -0xb0(%rbp), %r12
movq %r15, %r13
leaq -0x130(%rbp), %rdi
callq 0xc9a0
movb $0x1, %r14b
leaq -0x110(%rbp), %rdi
callq 0xc9a0
movl %r14d, %ebx
jmp 0x22163
movq -0x38(%rbp), %rdi
testq %rdi, %rdi
je 0x2234c
callq 0x24b32
leaq -0x58(%rbp), %rdi
callq 0x24d86
testb %al, %al
je 0x22425
leaq -0x58(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0xc660
jmp 0x22022
pushq $0x50
popq %rdi
callq 0xc250
movq %rax, %r14
leaq 0xd79f(%rip), %rsi      # 0x2fb20
leaq -0xf0(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0xc1b0
callq 0x275dc
leaq -0xf0(%rbp), %rsi
leaq -0x78(%rbp), %rdx
pushq $0x2
popq %rcx
movq %r14, %rdi
movq %rax, %r8
callq 0x24a48
leaq 0x261cf(%rip), %rsi     # 0x48588
leaq 0x2728(%rip), %rdx      # 0x24ae8
movq %r14, %rdi
callq 0xc810
jmp 0x22425
pushq $0x50
popq %rdi
callq 0xc250
movq %rax, %r14
leaq 0xd744(%rip), %rsi      # 0x2fb20
leaq -0xf0(%rbp), %rdi
leaq -0xb0(%rbp), %rdx
callq 0xc1b0
movl -0xc0(%rbp), %ecx
movq -0xb8(%rbp), %r8
leaq -0xf0(%rbp), %rsi
leaq -0x78(%rbp), %rdx
movq %r14, %rdi
callq 0x24a48
leaq 0x26172(%rip), %rsi     # 0x48588
leaq 0x26cb(%rip), %rdx      # 0x24ae8
movq %r14, %rdi
callq 0xc810
leaq 0xd711(%rip), %rdi      # 0x2fb3d
leaq 0xd756(%rip), %rsi      # 0x2fb89
leaq 0xd774(%rip), %rcx      # 0x2fbae
movl $0x35e, %edx            # imm = 0x35E
callq 0xc350
jmp 0x22497
jmp 0x2244e
jmp 0x22471
jmp 0x22468
jmp 0x22497
movq %rax, %rbx
movq %r14, %rdi
callq 0xc390
jmp 0x224a6
jmp 0x22476
jmp 0x22497
jmp 0x22471
movq %rax, %rbx
jmp 0x224bb
jmp 0x22468
movq %rax, %rbx
jmp 0x224a6
jmp 0x22471
jmp 0x22476
movq %rax, %rbx
jmp 0x22485
movq %rax, %rbx
leaq -0x130(%rbp), %rdi
callq 0xc9a0
leaq -0x110(%rbp), %rdi
callq 0xc9a0
jmp 0x2249a
jmp 0x22497
jmp 0x22497
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0xc9a0
leaq -0x58(%rbp), %rdi
callq 0xc9a0
leaq -0x150(%rbp), %rdi
callq 0xc9a0
leaq -0x78(%rbp), %rdi
callq 0xc9a0
movq %rbx, %rdi
callq 0xc850