// File: /workspace/github_cpp_makefile_star2_O3/lvandeve[P]base256/base256.cpp
// Function: JavaString::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;
    }
    // octal: we work byte-based, so don't use \u unicode escapes, which are longer
    bool digitnext = (next >= '0' && next <= '7');
    int o0 = (c >> 6) & 7;
    int o1 = (c >> 3) & 7;
    int o2 = (c >> 0) & 7;
    std::string result = "\\";
    // shorten if possible, e.g. many nulls in a row will be \0\0\0\0 instead of \000\\000\000\000
    // using \0 and other less than 3 digit codes is only ok if no real octal digit after it, else the next character becomes part of the code
    if(c < 8 && !digitnext) {
      result += ('0' + o2);
    } else if (c < 64 && !digitnext) {
      result += ('0' + o1);
      result += ('0' + o2);
    } else {
      result += ('0' + o0);
      result += ('0' + o1);
      result += ('0' + o2);
    }
    return result;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movl %edx, %r14d
movq %rdi, %rbx
leal -0x8(%r14), %eax
cmpl $0x5, %eax
ja 0xe49b
leaq 0x2bc4(%rip), %rcx      # 0x1103c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x41f2(%rip), %rsi      # 0x12681
leaq 0x41ed(%rip), %rdx      # 0x12683
jmp 0xe563
cmpl $0x22, %r14d
je 0xe54e
cmpl $0x5c, %r14d
jne 0xe4c5
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x41da(%rip), %rsi      # 0x12693
leaq 0x41d5(%rip), %rdx      # 0x12695
jmp 0xe563
leal -0x20(%r14), %eax
cmpb $0x5e, %al
ja 0xe57d
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movsbl %r14b, %esi
movq %rbx, %rdi
callq 0x51f0
jmp 0xe56b
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x418d(%rip), %rsi      # 0x1268d
leaq 0x4188(%rip), %rdx      # 0x1268f
jmp 0xe563
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x4170(%rip), %rsi      # 0x12687
leaq 0x416b(%rip), %rdx      # 0x12689
jmp 0xe563
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x4156(%rip), %rsi      # 0x12684
leaq 0x4151(%rip), %rdx      # 0x12686
jmp 0xe563
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x4145(%rip), %rsi      # 0x1268a
leaq 0x4140(%rip), %rdx      # 0x1268c
jmp 0xe563
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x413a(%rip), %rsi      # 0x12696
leaq 0x4135(%rip), %rdx      # 0x12698
movq %rbx, %rdi
callq 0xbfd2
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
andb $-0x8, %bpl
cmpb $0x30, %bpl
sete %r12b
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
leaq 0x40fd(%rip), %rsi      # 0x12694
leaq 0x40f7(%rip), %rdx      # 0x12695
movq %rbx, %rdi
callq 0xbfd2
cmpb $0x8, %r14b
setae %al
orb %r12b, %al
je 0xe60f
movl %r14d, %r13d
shrl $0x3, %r13d
movl %r14d, %r12d
andl $0x7, %r12d
cmpb $0x30, %bpl
sete %al
cmpb $0x40, %r14b
setae %cl
orb %al, %cl
je 0xe5fc
shrb $0x6, %r14b
orb $0x30, %r14b
movzbl %r14b, %esi
movq %rbx, %rdi
callq 0x51f0
andb $0x7, %r13b
orb $0x30, %r13b
movzbl %r13b, %esi
movq %rbx, %rdi
callq 0x51f0
jmp 0xe60c
orb $0x30, %r13b
movzbl %r13b, %esi
movq %rbx, %rdi
callq 0x51f0
movl %r12d, %r14d
orb $0x30, %r14b
movsbl %r14b, %esi
movq %rbx, %rdi
callq 0x51f0
jmp 0xe56b
jmp 0xe626
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xe636
callq 0x5210
movq %r14, %rdi
callq 0x53e0