// File: /workspace/github_cpp_makefile_star2_O1/lvandeve[P]base256/base256.cpp
// Function: JSString::encodeChar[abi:cxx11](unsigned char, unsigned char, unsigned char)
std::string encodeChar(unsigned char c, unsigned char prev, unsigned char next) {
    if(c == '\b') return "\\b";
    if(c == '\f') return "\\f";
    if(c == '\n') return "\\n";
    if(c == '\r') return "\\r";
    if(c == '\t') return "\\t";
    if(c == '\\') return "\\\\";
    if(c == '\'') return "\\'";
    if(c >= 32 && c < 127) {
      std::string result;
      result += c;
      return result;
    }
    // in JS \0 is different than other octal, and should not have any *decimal* digit after it
    bool digitnext = (next >= '0' && next <= '9');
    if(c == 0 && !digitnext) return "\\0";
    int h0 = (c >> 4) & 15;
    int h1 = (c >> 0) & 15;
    static const std::string hex = "0123456789ABCDEF";
    std::string result = "\\x";
    result += hex[h0];
    result += hex[h1];
    return result;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rdi, %rbx
leal -0x8(%r14), %eax
cmpl $0x5, %eax
ja 0xe9eb
leaq 0x268c(%rip), %rcx      # 0x11054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3ca2(%rip), %rsi      # 0x12681
leaq 0x3c9d(%rip), %rdx      # 0x12683
jmp 0xeb4d
cmpl $0x27, %r14d
je 0xeaad
cmpl $0x5c, %r14d
jne 0xea15
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3c8a(%rip), %rsi      # 0x12693
leaq 0x3c85(%rip), %rdx      # 0x12695
jmp 0xeb4d
leal -0x20(%r14), %eax
cmpb $0x5e, %al
ja 0xeac7
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movsbl %r14b, %esi
movq %rbx, %rdi
callq 0x51f0
jmp 0xeb55
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3c3a(%rip), %rsi      # 0x1268d
leaq 0x3c35(%rip), %rdx      # 0x1268f
jmp 0xeb4d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3c1a(%rip), %rsi      # 0x12687
leaq 0x3c15(%rip), %rdx      # 0x12689
jmp 0xeb4d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3bfd(%rip), %rsi      # 0x12684
leaq 0x3bf8(%rip), %rdx      # 0x12686
jmp 0xeb4d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3be9(%rip), %rsi      # 0x1268a
leaq 0x3be4(%rip), %rdx      # 0x1268c
jmp 0xeb4d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3c06(%rip), %rsi      # 0x126c1
leaq 0x3c01(%rip), %rdx      # 0x126c3
jmp 0xeb4d
testb %r14b, %r14b
setne %al
addb $-0x30, %r8b
cmpb $0xa, %r8b
setb %cl
orb %al, %cl
je 0xeb38
movb 0xa05e(%rip), %al       # 0x18b40
testb %al, %al
je 0xeb64
movl %r14d, %r12d
shrl $0x4, %r12d
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
leaq 0x3bcc(%rip), %rsi      # 0x126c7
leaq 0x3bc7(%rip), %rdx      # 0x126c9
movq %rbx, %rdi
callq 0xc264
movq 0xa00f(%rip), %rax      # 0x18b20
movsbl (%rax,%r12), %esi
movq %rbx, %rdi
callq 0x51f0
andl $0xf, %r14d
movq 0x9ff7(%rip), %rax      # 0x18b20
movsbl (%rax,%r14), %esi
movq %rbx, %rdi
callq 0x51f0
jmp 0xeb55
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3b7e(%rip), %rsi      # 0x126c4
leaq 0x3b79(%rip), %rdx      # 0x126c6
movq %rbx, %rdi
callq 0xc264
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x9fd5(%rip), %rdi      # 0x18b40
callq 0x5400
testl %eax, %eax
je 0xeae6
leaq 0x9fb1(%rip), %rax      # 0x18b30
movq %rax, 0x9f9a(%rip)      # 0x18b20
leaq 0x9f93(%rip), %rdi      # 0x18b20
leaq 0x3ab1(%rip), %rsi      # 0x12645
leaq 0x3aba(%rip), %rdx      # 0x12655
callq 0xc264
movq 0x93f9(%rip), %rdi      # 0x17fa0
leaq 0x9f72(%rip), %rsi      # 0x18b20
leaq 0x9673(%rip), %rdx      # 0x18228
callq 0x5200
leaq 0x9f7f(%rip), %rdi      # 0x18b40
callq 0x5170
jmp 0xeae6
movq %rax, %r14
leaq 0x9f6b(%rip), %rdi      # 0x18b40
callq 0x5160
jmp 0xebee
jmp 0xebde
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xebee
callq 0x5210
movq %r14, %rdi
callq 0x53e0