// File: /workspace/github_cpp_makefile_star2_O2/demon386[P]git-store/./libs/filesystem/src/unique_path.cpp
// Function: boost::filesystem::detail::unique_path(boost::filesystem::path const&, boost::system::error_code*)
BOOST_FILESYSTEM_DECL
path unique_path(const path& model, system::error_code* ec)
{
  std::wstring s (model.wstring());  // std::string ng for MBCS encoded POSIX
  const wchar_t hex[] = L"0123456789abcdef";
  char ran[] = "123456789abcdef";  // init to avoid clang static analyzer message
                                   // see ticket #8954
  assert(sizeof(ran) == 16);
  const int max_nibbles = 2 * sizeof(ran);   // 4-bits per nibble

  int nibbles_used = max_nibbles;
  for(std::wstring::size_type i=0; i < s.size(); ++i)
  {
    if (s[i] == L'%')                        // digit request
    {
      if (nibbles_used == max_nibbles)
      {
        system_crypt_random(ran, sizeof(ran), ec);
        if (ec != 0 && *ec)
          return "";
        nibbles_used = 0;
      }
      int c = ran[nibbles_used/2];
      c >>= 4 * (nibbles_used++ & 1);  // if odd, shift right 1 nibble
      s[i] = hex[c & 0xf];             // convert to hex digit and replace
    }
  }

  if (ec != 0) ec->clear();

  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, %r12
movq %rdi, %r14
leaq -0x58(%rbp), %rdi
callq 0x271da
movaps 0x9c01(%rip), %xmm0     # 0x30c00
leaq -0x70(%rbp), %rax
movaps %xmm0, (%rax)
pushq $0x20
popq %rcx
pushq $0x10
popq %rbx
xorl %r15d, %r15d
movq %r14, -0x38(%rbp)
movq %r12, -0x30(%rbp)
cmpq -0x50(%rbp), %r15
jae 0x27107
movq -0x58(%rbp), %rax
cmpl $0x25, (%rax,%r15,4)
jne 0x270ff
cmpl $0x20, %ecx
jne 0x270d4
leaq 0x9b29(%rip), %rdi      # 0x30b69
xorl %esi, %esi
xorl %eax, %eax
callq 0xc3a0
movl %eax, %r13d
cmpl $-0x1, %eax
jne 0x27069
leaq 0x9b1e(%rip), %rdi      # 0x30b76
xorl %esi, %esi
xorl %eax, %eax
callq 0xc3a0
movl %eax, %r13d
cmpl $-0x1, %eax
je 0x270b7
xorl %r14d, %r14d
leaq -0x70(%rbp), %r12
cmpq $0xf, %r14
ja 0x27095
movq %rbx, %rdx
subq %r14, %rdx
movl %r13d, %edi
movq %r12, %rsi
callq 0xc6c0
cmpq $-0x1, %rax
je 0x270a7
addq %rax, %r14
addq %rax, %r12
jmp 0x27070
movl %r13d, %edi
callq 0xc920
movq -0x38(%rbp), %r14
movq -0x30(%rbp), %r12
jmp 0x270c6
movl %r13d, %edi
callq 0xc920
movq -0x38(%rbp), %r14
movq -0x30(%rbp), %r12
callq 0xc060
movl (%rax), %edi
movq %r12, %rsi
callq 0x27168
xorl %ecx, %ecx
testq %r12, %r12
je 0x270d4
cmpl $0x0, (%r12)
jne 0x2713d
movl %ecx, %eax
shrl %eax
movsbl -0x70(%rbp,%rax), %eax
leal 0x1(%rcx), %edx
shll $0x2, %ecx
andb $0x4, %cl
sarl %cl, %eax
andl $0xf, %eax
leaq 0x9abe(%rip), %rcx      # 0x30bb0
movl (%rcx,%rax,4), %eax
movq -0x58(%rbp), %rcx
movl %eax, (%rcx,%r15,4)
movl %edx, %ecx
incq %r15
jmp 0x27017
testq %r12, %r12
je 0x27114
movq %r12, %rdi
callq 0x24b32
leaq -0x58(%rbp), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x2722a
leaq -0x58(%rbp), %rdi
callq 0xc990
movq %r14, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5d3e(%rip), %rsi      # 0x2ce82
movq %r14, %rdi
callq 0x24c82
jmp 0x27122
jmp 0x27154
jmp 0x27154
jmp 0x27154
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0xc990
movq %rbx, %rdi
callq 0xc850