// File: /workspace/github_cpp_makefile_star2_O1/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 0xe765
leaq 0x28fa(%rip), %rcx      # 0x1103c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3f28(%rip), %rsi      # 0x12681
leaq 0x3f23(%rip), %rdx      # 0x12683
jmp 0xe82d
cmpl $0x22, %r14d
je 0xe818
cmpl $0x5c, %r14d
jne 0xe78f
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3f10(%rip), %rsi      # 0x12693
leaq 0x3f0b(%rip), %rdx      # 0x12695
jmp 0xe82d
leal -0x20(%r14), %eax
cmpb $0x5e, %al
ja 0xe847
leaq 0x10(%rbx), %r15
movq %r15, (%rbx)
movq $0x0, 0x8(%rbx)
movb $0x0, 0x10(%rbx)
movsbl %r14b, %esi
movq %rbx, %rdi
callq 0x51f0
jmp 0xe835
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3ec3(%rip), %rsi      # 0x1268d
leaq 0x3ebe(%rip), %rdx      # 0x1268f
jmp 0xe82d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3ea6(%rip), %rsi      # 0x12687
leaq 0x3ea1(%rip), %rdx      # 0x12689
jmp 0xe82d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3e8c(%rip), %rsi      # 0x12684
leaq 0x3e87(%rip), %rdx      # 0x12686
jmp 0xe82d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3e7b(%rip), %rsi      # 0x1268a
leaq 0x3e76(%rip), %rdx      # 0x1268c
jmp 0xe82d
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
leaq 0x3e70(%rip), %rsi      # 0x12696
leaq 0x3e6b(%rip), %rdx      # 0x12698
movq %rbx, %rdi
callq 0xc264
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 0x3e33(%rip), %rsi      # 0x12694
leaq 0x3e2d(%rip), %rdx      # 0x12695
movq %rbx, %rdi
callq 0xc264
cmpb $0x8, %r14b
setae %al
orb %r12b, %al
je 0xe8d9
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 0xe8c6
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 0xe8d6
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 0xe835
jmp 0xe8f0
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0xe900
callq 0x5210
movq %r14, %rdi
callq 0x53e0