// File: /workspace/github_cpp_makefile_star2_O1/ncbi[P]amr/common.cpp
// Function: Common_sp::unpercent(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string unpercent (const string &s)
{
  for (const char c : s)
  	if (between (c, '\0', ' ') /*! printable (c)*/)
  		throw runtime_error (FUNC "Non-printable character: " + to_string (uint (c)));

  string r;
  constexpr size_t hex_pos_max = 2;
  size_t hex_pos = no_index;
  uchar hex = 0;
  for (const char c : s)
    if (hex_pos == no_index)
    {
      if (c == '%')
        hex_pos = 0;
      else
        r += c;
    }
    else
    {
      ASSERT (hex_pos < hex_pos_max);
      if (! isHex (c))
        throw runtime_error (FUNC "Bad hexadecimal character: " + to_string (c));
      hex = uchar (hex + hex2uchar (c));
      if (! hex_pos)
      {
        ASSERT (hex < 16);
        hex = uchar (hex * 16);
      }
      hex_pos++;
      if (hex_pos == hex_pos_max)
      {
        r += char (hex);
        hex_pos = no_index;
        hex = 0;
      }
    }
      
  return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, 0x10(%rsp)
movq (%rsi), %r13
movq 0x8(%rsi), %r15
testq %r15, %r15
je 0x3969e
xorl %eax, %eax
movzbl (%r13,%rax), %ebp
cmpl $0x1f, %ebp
jbe 0x39812
incq %rax
cmpq %rax, %r15
jne 0x39687
movq 0x10(%rsp), %rax
leaq 0x10(%rax), %rcx
movq %rcx, 0x98(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
testq %r15, %r15
je 0x397fb
movq $-0x1, %rbx
xorl %r14d, %r14d
movl $0x0, 0xc(%rsp)
movq %r15, 0xa0(%rsp)
movsbl (%r13,%r14), %ebp
cmpq $-0x1, %rbx
je 0x3976b
movq %r13, %r15
callq 0xa070
movl $0x0, (%rax)
cmpq $0x2, %rbx
jae 0x3987b
movq %rax, %r12
movl $0xb, %edx
leaq 0x55798(%rip), %rdi     # 0x8eeac
movl %ebp, %esi
callq 0xa610
testq %rax, %rax
jne 0x39750
movq %rax, %r13
movl %ebp, %edi
callq 0xaa60
movsbl %al, %esi
movl $0x7, %edx
leaq 0x55799(%rip), %rdi     # 0x8eed2
callq 0xa610
testq %rax, %rax
je 0x399bb
testq %r13, %r13
je 0x397e9
addb $-0x30, %bpl
addb 0xc(%rsp), %bpl
testq %rbx, %rbx
movq %r15, %r13
je 0x39776
movq 0xa0(%rsp), %r15
jmp 0x39794
cmpb $0x25, %bpl
jne 0x397c5
xorl %r12d, %r12d
jmp 0x397d8
movl $0x0, (%r12)
cmpb $0x10, %bpl
movq 0xa0(%rsp), %r15
jae 0x39916
shlb $0x4, %bpl
movl $0x1, %r12d
cmpq $0x1, %rbx
je 0x397a6
movl %ebp, 0xc(%rsp)
jmp 0x397d8
movsbl %bpl, %esi
movq 0x10(%rsp), %rdi
callq 0xa4d0
movq $-0x1, %r12
movl $0x0, 0xc(%rsp)
jmp 0x397d8
movq $-0x1, %r12
movq 0x10(%rsp), %rdi
movl %ebp, %esi
callq 0xa4d0
incq %r14
movq %r12, %rbx
cmpq %r14, %r15
jne 0x396e1
jmp 0x397fb
movl %ebp, %edi
callq 0xaa60
movl %eax, %ebp
addb $-0x37, %bpl
jmp 0x39754
movq 0x10(%rsp), %rax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0xa2c0
movq %rax, %rbx
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x53388(%rip), %rsi     # 0x8cbb7
leaq 0x533ac(%rip), %rdx     # 0x8cbe2
leaq 0x18(%rsp), %rdi
callq 0x2fdd8
leaq 0x5339c(%rip), %rsi     # 0x8cbe3
leaq 0x18(%rsp), %rdi
callq 0xaac0
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x39a1b
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x39a28
callq 0xa6b0
testl %eax, %eax
jne 0x399b1
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5309b(%rip), %rsi     # 0x8c936
leaq 0x530a7(%rip), %rdx     # 0x8c949
leaq 0xe8(%rsp), %rdi
callq 0x2fdd8
leaq 0x108(%rsp), %rdi
movl $0x47f, %esi            # imm = 0x47F
callq 0x2d60a
leaq 0x78(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x108(%rsp), %rdx
callq 0x2d562
leaq 0x51303(%rip), %rsi     # 0x8abe5
leaq 0x78(%rsp), %rdi
callq 0xaac0
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x39af7
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x39b04
callq 0xa6b0
testl %eax, %eax
jne 0x399b1
leaq 0xf8(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x53000(%rip), %rsi     # 0x8c936
leaq 0x5300c(%rip), %rdx     # 0x8c949
leaq 0xe8(%rsp), %rdi
callq 0x2fdd8
leaq 0x108(%rsp), %rdi
movl $0x485, %esi            # imm = 0x485
callq 0x2d60a
leaq 0x78(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x108(%rsp), %rdx
callq 0x2d562
leaq 0x51268(%rip), %rsi     # 0x8abe5
leaq 0x78(%rsp), %rdi
callq 0xaac0
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x39b83
movups (%rcx), %xmm0
movups %xmm0, (%r12)
jmp 0x39b90
movl $0x1, %edi
callq 0xa6c0
movl $0x10, %edi
callq 0xa2c0
movq %rax, %r15
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x531de(%rip), %rsi     # 0x8cbb7
leaq 0x53202(%rip), %rdx     # 0x8cbe2
leaq 0x18(%rsp), %rdi
callq 0x2fdd8
leaq 0x53224(%rip), %rsi     # 0x8cc15
leaq 0x18(%rsp), %rdi
callq 0xaac0
leaq 0x48(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x39a8a
movups (%rcx), %xmm0
movups %xmm0, (%rbx)
jmp 0x39a97
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %rdi
movl %ebp, %esi
callq 0x64b1d
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x2d562
movb $0x1, %bpl
leaq 0x58(%rsp), %rsi
movq %rbx, %rdi
callq 0xa930
xorl %ebp, %ebp
movq 0x7656f(%rip), %rsi     # 0xaffe8
movq 0x764e0(%rip), %rdx     # 0xaff60
movq %rbx, %rdi
callq 0xa9b0
jmp 0x39af7
movq %rdx, 0x38(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x48(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x40(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x78(%rsp), %rdi
movl %ebp, %esi
callq 0x2d60a
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x78(%rsp), %rdx
callq 0x2d562
movb $0x1, %bpl
leaq 0x58(%rsp), %rsi
movq %r15, %rdi
callq 0xa930
xorl %ebp, %ebp
movq 0x76500(%rip), %rsi     # 0xaffe8
movq 0x76471(%rip), %rdx     # 0xaff60
movq %r15, %rdi
callq 0xa9b0
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x53088(%rip), %rsi     # 0x8cbb7
leaq 0x530ac(%rip), %rdx     # 0x8cbe2
leaq 0xc8(%rsp), %rdi
callq 0x2fdd8
leaq 0x52de9(%rip), %rsi     # 0x8c933
leaq 0xc8(%rsp), %rdi
callq 0xaac0
leaq 0xb8(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x39c0f
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x39c22
movq %rdx, 0x18(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x28(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x20(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xd8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x52ffc(%rip), %rsi     # 0x8cbb7
leaq 0x53020(%rip), %rdx     # 0x8cbe2
leaq 0xc8(%rsp), %rdi
callq 0x2fdd8
leaq 0x52d5d(%rip), %rsi     # 0x8c933
leaq 0xc8(%rsp), %rdi
callq 0xaac0
leaq 0xb8(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x39c85
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x39c98
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
movq 0x8(%rax), %rsi
leaq 0xa8(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2d562
leaq 0x52fa8(%rip), %rsi     # 0x8cbff
leaq 0x38(%rsp), %rdi
callq 0xaac0
leaq 0x68(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x39cf8
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x39d05
movq %rdx, 0xa8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xb8(%rsp)
movq 0x8(%rax), %rsi
leaq 0xa8(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x2d562
leaq 0x52f66(%rip), %rsi     # 0x8cc33
leaq 0x38(%rsp), %rdi
callq 0xaac0
leaq 0x68(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x39d26
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x39d33
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
movq 0x8(%rax), %rdx
leaq 0x58(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x3523b
movq %rdx, 0x58(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x68(%rsp)
movq 0x8(%rax), %rdx
leaq 0x58(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x3523b
jmp 0x39d5a
jmp 0x39d76
jmp 0x39d98
movq %rax, %r14
movq 0x58(%rsp), %rdi
cmpq %rbp, %rdi
je 0x39d79
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39d79
movq %rax, %r14
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39d9b
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39d9b
jmp 0x39dbc
movq %rax, %r14
movq 0xa8(%rsp), %rdi
cmpq %r13, %rdi
je 0x39dbf
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39dbf
jmp 0x39de0
movq %rax, %r14
movq 0xc8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x39de3
movq 0xd8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39de3
jmp 0x39e47
movq %rax, %r14
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x39e4a
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39e4a
movq %rax, %r14
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39e22
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39e22
movq %rax, %r14
movb $0x1, %bpl
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39e73
movq 0x88(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39e73
jmp 0x39e91
movq %rax, %r14
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39e94
movq 0x88(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39e94
movq %rax, %r14
movb $0x1, %bpl
movq 0x38(%rsp), %rdi
cmpq %rbx, %rdi
je 0x39ec1
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39ec1
jmp 0x39f2c
movq %rax, %r14
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39f2f
movq 0x118(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39f2f
movq %rax, %r14
movb $0x1, %bpl
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x39f54
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39f54
jmp 0x39fa3
movq %rax, %r14
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39f09
movq 0x68(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39f09
movq %rax, %r14
movb $0x1, %bpl
leaq 0x88(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39f69
movq 0x88(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39f69
movq %rax, %r14
movq 0xe8(%rsp), %rdi
cmpq %r15, %rdi
je 0x39fa6
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39fa6
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x39fa6
movq %r15, %rdi
callq 0xa440
jmp 0x39fa6
movq %rax, %r14
movb $0x1, %bpl
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x39f8a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39f8a
jmp 0x39fa3
movq %rax, %r14
movb $0x1, %bpl
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x39fd3
movq 0x28(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39fd3
movq %rax, %r14
movq 0x10(%rsp), %rax
movq (%rax), %rdi
cmpq 0x98(%rsp), %rdi
je 0x39fe0
movq 0x98(%rsp), %rax
movq (%rax), %rsi
incq %rsi
callq 0xa5a0
jmp 0x39fe0
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x39fe0
movq %rbx, %rdi
callq 0xa440
movq %r14, %rdi
callq 0xaa10