// File: /workspace/github_cpp_makefile_star2_O2/demon386[P]git-store/./libs/filesystem/src/operations.cpp
// Function: boost::filesystem::absolute(boost::filesystem::path const&, boost::filesystem::path const&)
BOOST_FILESYSTEM_DECL
  path absolute(const path& p, const path& base)
  {
//    if ( p.empty() || p.is_absolute() )
//      return p;
//    //  recursively calling absolute is sub-optimal, but is simple
//    path abs_base(base.is_absolute() ? base : absolute(base));
//# ifdef BOOST_WINDOWS_API
//    if (p.has_root_directory())
//      return abs_base.root_name() / p;
//    //  !p.has_root_directory
//    if (p.has_root_name())
//      return p.root_name()
//        / abs_base.root_directory() / abs_base.relative_path() / p.relative_path();
//    //  !p.has_root_name()
//# endif
//    return abs_base / p;

    //  recursively calling absolute is sub-optimal, but is sure and simple
    path abs_base(base.is_absolute() ? base : absolute(base));

    //  store expensive to compute values that are needed multiple times
    path p_root_name (p.root_name());
    path base_root_name (abs_base.root_name());
    path p_root_directory (p.root_directory());

    if (p.empty())
      return abs_base;

    if (!p_root_name.empty())  // p.has_root_name()
    {
      if (p_root_directory.empty())  // !p.has_root_directory()
        return p_root_name / abs_base.root_directory()
        / abs_base.relative_path() / p.relative_path();
      // p is absolute, so fall through to return p at end of block
    }

    else if (!p_root_directory.empty())  // p.has_root_directory()
    {
#     ifdef BOOST_POSIX_API
      // POSIX can have root name it it is a network path
      if (base_root_name.empty())   // !abs_base.has_root_name()
        return p;
#     endif
      return base_root_name / p;
    }

    else
    {
      return abs_base / p;
    }

    return p;  // p.is_absolute() is true
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x120, %rsp            # imm = 0x120
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rdx, %rdi
callq 0x24d86
testb %al, %al
je 0x21d11
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
callq 0xc660
jmp 0x21d35
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x249c4
leaq -0x60(%rbp), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21cdc
leaq -0x40(%rbp), %rdi
callq 0xc9a0
leaq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x25cb4
leaq -0x140(%rbp), %r15
leaq -0x60(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x25cb4
leaq -0x120(%rbp), %rdi
movq %r14, %rsi
callq 0x25d3c
cmpq $0x0, 0x8(%r14)
je 0x21d83
cmpq $0x0, -0x38(%rbp)
movq -0x118(%rbp), %rax
je 0x21d93
testq %rax, %rax
je 0x21dac
movq %r14, %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xc660
jmp 0x21e69
testq %rax, %rax
je 0x21e57
cmpq $0x0, -0x138(%rbp)
jne 0x21e5b
jmp 0x21d80
leaq -0xc0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x25d3c
leaq -0xe0(%rbp), %rdi
leaq -0x40(%rbp), %rsi
leaq -0xc0(%rbp), %rdx
callq 0x249e8
leaq -0xa0(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x25dfe
leaq -0x100(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
leaq -0xa0(%rbp), %rdx
callq 0x249e8
leaq -0x80(%rbp), %rdi
movq %r14, %rsi
callq 0x25dfe
leaq -0x100(%rbp), %rsi
leaq -0x80(%rbp), %rdx
movq %rbx, %rdi
callq 0x249e8
leaq -0x80(%rbp), %rdi
callq 0xc9a0
leaq -0x100(%rbp), %rdi
callq 0xc9a0
leaq -0xa0(%rbp), %rdi
callq 0xc9a0
leaq -0xe0(%rbp), %rdi
callq 0xc9a0
leaq -0xc0(%rbp), %rdi
callq 0xc9a0
jmp 0x21e69
leaq -0x60(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x249e8
leaq -0x120(%rbp), %rdi
callq 0xc9a0
leaq -0x140(%rbp), %rdi
callq 0xc9a0
leaq -0x40(%rbp), %rdi
callq 0xc9a0
leaq -0x60(%rbp), %rdi
callq 0xc9a0
movq %rbx, %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0xc9a0
jmp 0x21eb7
movq %rax, %rbx
leaq -0x100(%rbp), %rdi
callq 0xc9a0
jmp 0x21ec8
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0xc9a0
jmp 0x21ed9
movq %rax, %rbx
leaq -0xe0(%rbp), %rdi
callq 0xc9a0
jmp 0x21eea
movq %rax, %rbx
leaq -0xc0(%rbp), %rdi
callq 0xc9a0
jmp 0x21f06
jmp 0x21f03
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
jmp 0x21f3a
movq %rax, %rbx
leaq -0x120(%rbp), %rdi
callq 0xc9a0
jmp 0x21f17
movq %rax, %rbx
leaq -0x140(%rbp), %rdi
callq 0xc9a0
jmp 0x21f28
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0xc9a0
jmp 0x21f36
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0xc9a0
movq %rbx, %rdi
callq 0xc850