// File: lvandeve[P]base256/base256.cpp
// Function: Decimal::encodeChar[abi:cxx11](unsigned char, unsigned char, unsigned char)
std::string encodeChar(unsigned char c, unsigned char prev, unsigned char next) {
    static const std::string d = "0123456789";
    std::string result;
    if(prefix) {
      if(c >= 100) result += d[c / 100];
      if(c >= 10) result += d[(c / 10) % 10];
      result += d[c % 10];
    } else {
      result += d[c / 100];
      result += d[(c / 10) % 10];
      result += d[c % 10];
    }
    return result;
  }

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x8(%rsp)
movb %r8b, %al
movq %rdi, %r8
movq %r8, 0x10(%rsp)
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movb %dl, 0x37(%rsp)
movb %cl, 0x36(%rsp)
movb %al, 0x35(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpb $0x0, 0x14085(%rip)     # 0x2cb80
jne 0x18b65
leaq 0x1407c(%rip), %rdi     # 0x2cb80
callq 0x5500
cmpl $0x0, %eax
je 0x18b65
leaq 0x34(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x54f0
movq (%rsp), %rdx
leaq 0x14039(%rip), %rdi     # 0x2cb60
leaq 0x9695(%rip), %rsi      # 0x221c3
callq 0x53d0
jmp 0x18b35
leaq 0x34(%rsp), %rdi
callq 0x5300
movq 0x13472(%rip), %rdi     # 0x2bfb8
leaq 0x14013(%rip), %rsi     # 0x2cb60
leaq 0x13764(%rip), %rdx     # 0x2c2b8
callq 0x5250
leaq 0x14020(%rip), %rdi     # 0x2cb80
callq 0x51f0
movq 0x8(%rsp), %rdi
movb $0x0, 0x23(%rsp)
callq 0x5400
movq 0x18(%rsp), %rax
testb $0x1, 0x8(%rax)
je 0x18c92
movzbl 0x37(%rsp), %eax
cmpl $0x64, %eax
jl 0x18c00
movzbl 0x37(%rsp), %eax
imulq $0x28f5c29, %rax, %rsi  # imm = 0x28F5C29
shrq $0x20, %rsi
leaq 0x13fbc(%rip), %rdi     # 0x2cb60
callq 0x5320
movq 0x8(%rsp), %rdi
movsbl (%rax), %esi
callq 0x51d0
jmp 0x18bb8
jmp 0x18c00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
leaq 0x34(%rsp), %rdi
callq 0x5300
leaq 0x13fa7(%rip), %rdi     # 0x2cb80
callq 0x51e0
jmp 0x18d60
movq 0x8(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x28(%rsp)
movl %eax, 0x24(%rsp)
callq 0x5558
jmp 0x18d60
movzbl 0x37(%rsp), %eax
cmpl $0xa, %eax
jl 0x18c51
movzbl 0x37(%rsp), %eax
imulq $0x1999999a, %rax, %rcx # imm = 0x1999999A
shrq $0x20, %rcx
movl %ecx, %eax
imulq $0x1999999a, %rcx, %rcx # imm = 0x1999999A
shrq $0x20, %rcx
movl %ecx, %edx
addl %edx, %edx
movl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
movl %eax, %esi
leaq 0x13f25(%rip), %rdi     # 0x2cb60
callq 0x5320
movq 0x8(%rsp), %rdi
movsbl (%rax), %esi
callq 0x51d0
jmp 0x18c4f
jmp 0x18c51
movzbl 0x37(%rsp), %eax
movl %eax, %ecx
movl %ecx, %eax
imulq $0x1999999a, %rcx, %rcx # imm = 0x1999999A
shrq $0x20, %rcx
movl %ecx, %edx
addl %edx, %edx
movl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
movl %eax, %esi
leaq 0x13ee7(%rip), %rdi     # 0x2cb60
callq 0x5320
movq 0x8(%rsp), %rdi
movsbl (%rax), %esi
callq 0x51d0
jmp 0x18c8d
jmp 0x18d40
movzbl 0x37(%rsp), %eax
imulq $0x28f5c29, %rax, %rsi  # imm = 0x28F5C29
shrq $0x20, %rsi
leaq 0x13eb7(%rip), %rdi     # 0x2cb60
callq 0x5320
movq 0x8(%rsp), %rdi
movsbl (%rax), %esi
callq 0x51d0
jmp 0x18cbd
movzbl 0x37(%rsp), %eax
imulq $0x1999999a, %rax, %rcx # imm = 0x1999999A
shrq $0x20, %rcx
movl %ecx, %eax
imulq $0x1999999a, %rcx, %rcx # imm = 0x1999999A
shrq $0x20, %rcx
movl %ecx, %edx
addl %edx, %edx
movl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
movl %eax, %esi
leaq 0x13e72(%rip), %rdi     # 0x2cb60
callq 0x5320
movq 0x8(%rsp), %rdi
movsbl (%rax), %esi
callq 0x51d0
jmp 0x18d02
movzbl 0x37(%rsp), %eax
movl %eax, %ecx
movl %ecx, %eax
imulq $0x1999999a, %rcx, %rcx # imm = 0x1999999A
shrq $0x20, %rcx
movl %ecx, %edx
addl %edx, %edx
movl %edx, %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %eax
movl %eax, %esi
leaq 0x13e36(%rip), %rdi     # 0x2cb60
callq 0x5320
movq 0x8(%rsp), %rdi
movsbl (%rax), %esi
callq 0x51d0
jmp 0x18d3e
jmp 0x18d40
movb $0x1, 0x23(%rsp)
testb $0x1, 0x23(%rsp)
jne 0x18d56
movq 0x8(%rsp), %rdi
callq 0x5558
movq 0x10(%rsp), %rax
addq $0x48, %rsp
retq
movq 0x28(%rsp), %rdi
callq 0x54e0
nopw (%rax,%rax)