// File: lvandeve[P]base256/base256.cpp
// Function: Hex::decode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string decode(const std::string& s) {
    std::string result;
    int count = 0;
    int val = 0;
    for(size_t i = 0; i < s.size(); i++) {
      if(prefix && i + 2 < s.size() && s[i] == '0' && s[i + 1] == 'x') i += 2;
      char c = s[i];
      if((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) {
        int d = 0;
        if(c >= '0' && c <= '9') d = c - '0';
        if(c >= 'a' && c <= 'f') d = c - 'a' + 10;
        if(c >= 'A' && c <= 'F') d = c - 'A' + 10;
        if(count % 2 == 1) {
          val <<= 4;
          val |= d;
          result.push_back(val);
        } else {
          val = d;
        }
        count++;
      }
    }
    return result;
  }

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x18(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq %rdx, 0x60(%rsp)
movq 0x68(%rsp), %rax
movq %rax, 0x28(%rsp)
movb $0x0, 0x5f(%rsp)
callq 0x5400
movl $0x0, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movq $0x0, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rdi
callq 0x5220
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0x18a18
movq 0x28(%rsp), %rax
testb $0x1, 0x20(%rax)
je 0x188d2
movq 0x48(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
callq 0x5220
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x188d2
movq 0x60(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x5320
movsbl (%rax), %eax
cmpl $0x30, %eax
jne 0x188d2
movq 0x60(%rsp), %rdi
movq 0x48(%rsp), %rsi
addq $0x1, %rsi
callq 0x5320
movsbl (%rax), %eax
cmpl $0x78, %eax
jne 0x188d2
movq 0x48(%rsp), %rax
addq $0x2, %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rdi
movq 0x48(%rsp), %rsi
callq 0x5320
movb (%rax), %al
movb %al, 0x47(%rsp)
movsbl 0x47(%rsp), %eax
cmpl $0x30, %eax
jl 0x188fb
movsbl 0x47(%rsp), %eax
cmpl $0x39, %eax
jle 0x1892b
movsbl 0x47(%rsp), %eax
cmpl $0x61, %eax
jl 0x1890f
movsbl 0x47(%rsp), %eax
cmpl $0x66, %eax
jle 0x1892b
movsbl 0x47(%rsp), %eax
cmpl $0x41, %eax
jl 0x18a03
movsbl 0x47(%rsp), %eax
cmpl $0x46, %eax
jg 0x18a03
movl $0x0, 0x40(%rsp)
movsbl 0x47(%rsp), %eax
cmpl $0x30, %eax
jl 0x18953
movsbl 0x47(%rsp), %eax
cmpl $0x39, %eax
jg 0x18953
movsbl 0x47(%rsp), %eax
subl $0x30, %eax
movl %eax, 0x40(%rsp)
movsbl 0x47(%rsp), %eax
cmpl $0x61, %eax
jl 0x18976
movsbl 0x47(%rsp), %eax
cmpl $0x66, %eax
jg 0x18976
movsbl 0x47(%rsp), %eax
subl $0x61, %eax
addl $0xa, %eax
movl %eax, 0x40(%rsp)
movsbl 0x47(%rsp), %eax
cmpl $0x41, %eax
jl 0x18999
movsbl 0x47(%rsp), %eax
cmpl $0x46, %eax
jg 0x18999
movsbl 0x47(%rsp), %eax
subl $0x41, %eax
addl $0xa, %eax
movl %eax, 0x40(%rsp)
movl 0x58(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x1, %edx
jne 0x189f0
movq 0x18(%rsp), %rdi
movl 0x54(%rsp), %eax
shll $0x4, %eax
movl %eax, 0x54(%rsp)
movl 0x40(%rsp), %ecx
movl 0x54(%rsp), %eax
orl %ecx, %eax
movl %eax, 0x54(%rsp)
movsbl 0x54(%rsp), %esi
callq 0x5240
jmp 0x189d4
jmp 0x189f8
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x38(%rsp)
movl %eax, 0x34(%rsp)
callq 0x5558
jmp 0x18a38
movl 0x40(%rsp), %eax
movl %eax, 0x54(%rsp)
movl 0x58(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x58(%rsp)
jmp 0x18a05
movq 0x48(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x48(%rsp)
jmp 0x1883d
movb $0x1, 0x5f(%rsp)
testb $0x1, 0x5f(%rsp)
jne 0x18a2e
movq 0x18(%rsp), %rdi
callq 0x5558
movq 0x20(%rsp), %rax
addq $0x78, %rsp
retq
movq 0x38(%rsp), %rdi
callq 0x54e0
nopw %cs:(%rax,%rax)
nopl (%rax)