// File: lvandeve[P]base256/base256.cpp
// Function: Printer::encodeChar[abi:cxx11](unsigned char, unsigned char, unsigned char, unsigned long*)
std::string encodeChar(unsigned char c, unsigned char prev, unsigned char next, size_t* width) {
    std::string temp = n->encodeChar(c, prev, next);
    *width = temp.size();
    if(printspace && c == 32 && (mix || n->printable())) {
      std::string result;
      for(size_t i = 0; i < n->width(); i++) {
        result += " ";
      }
      return result;
    }
    if(temp == "\n") return temp;
    if(c == 10 && printnewline && (mix || n->printable())) return "\n";
    std::string result;
    if(mix && c > 32 && c < 127 && !n->printable()) {
      size_t size = n->width() - 1;
      for(size_t i = 0; i < size; i++) {
        result += " ";
      }
      result += c;
      return result;
    }
    bool usecolor = colored && !(temp.size() == 1 && (unsigned char)temp[0] == c);
    if(usecolor) {
      // the gray values (7, 8, 15) are unused in case standard color for printable ASCII is used
      static const int colors[16] = {1,  2,  3, 7, 15, 8, 15,  4,
                                     9, 10, 11, 5, 13, 6, 14, 12};
      int color = colors[c >> 4];
      result += std::string() + "\x1b" + "[" + valtostr((color < 8 ? 30 : 82) + color) + "m";
      // dark blue is quite unreadable against black background, so give it a background. Also
      // give background to the one duplicate color to distinguish it.
      // This assumes terminal with white-ish text on black background
      if(color == 4 || (c >> 4) == 6) result += std::string() + "\x1b" + "[" + valtostr(100) + "m";
      if((c >> 4) == 6) result += std::string() + "\x1b" + "[" + valtostr(100) + "m";
      result += temp;
      result += "\x1b[0m";
      if(color == 4 || (c >> 4) == 6) result += "\x1b[0m";
    } else {
      result += temp;
    }
    return result;
  }

// Assembly:
subq $0x338, %rsp            # imm = 0x338
movq %rdi, 0x50(%rsp)
movb %r8b, %al
movq %rdi, %r8
movq %r8, 0x58(%rsp)
movq %rdi, 0x330(%rsp)
movq %rsi, 0x328(%rsp)
movb %dl, 0x327(%rsp)
movb %cl, 0x326(%rsp)
movb %al, 0x325(%rsp)
movq %r9, 0x318(%rsp)
movq 0x328(%rsp), %rax
movq %rax, 0x60(%rsp)
movq (%rax), %rsi
movb 0x327(%rsp), %dl
movb 0x326(%rsp), %cl
movb 0x325(%rsp), %r8b
movq (%rsi), %rax
leaq 0x2f8(%rsp), %rdi
movzbl %dl, %edx
movzbl %cl, %ecx
movzbl %r8b, %r8d
callq *0x10(%rax)
leaq 0x2f8(%rsp), %rdi
callq 0x5220
movq %rax, %rdx
movq 0x60(%rsp), %rax
movq 0x318(%rsp), %rcx
movq %rdx, (%rcx)
testb $0x1, 0x1c(%rax)
je 0x1d132
movzbl 0x327(%rsp), %eax
cmpl $0x20, %eax
jne 0x1d132
movq 0x60(%rsp), %rax
testb $0x1, 0x1a(%rax)
jne 0x1d04c
movq 0x60(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movb %al, 0x4f(%rsp)
jmp 0x1d03f
movb 0x4f(%rsp), %al
testb $0x1, %al
jne 0x1d04c
jmp 0x1d132
movq 0x50(%rsp), %rdi
movb $0x0, 0x2eb(%rsp)
callq 0x5400
movq $0x0, 0x2e0(%rsp)
movq 0x60(%rsp), %rax
movq 0x2e0(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
movl %eax, 0x48(%rsp)
jmp 0x1d08e
movq 0x40(%rsp), %rax
movl 0x48(%rsp), %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jae 0x1d106
movq 0x50(%rsp), %rdi
leaq 0x5194(%rip), %rsi      # 0x2223f
callq 0x5280
jmp 0x1d0b2
jmp 0x1d0b4
movq 0x2e0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2e0(%rsp)
jmp 0x1d06a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1daa4
movq 0x50(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
callq 0x5558
jmp 0x1daa4
movb $0x1, 0x2eb(%rsp)
movl $0x1, 0x2dc(%rsp)
testb $0x1, 0x2eb(%rsp)
jne 0x1d12d
movq 0x50(%rsp), %rdi
callq 0x5558
jmp 0x1da8a
leaq 0x4146(%rip), %rsi      # 0x2127f
leaq 0x2f8(%rsp), %rdi
callq 0xfd20
movb %al, 0x3f(%rsp)
jmp 0x1d14c
movb 0x3f(%rsp), %al
testb $0x1, %al
jne 0x1d156
jmp 0x1d178
movq 0x50(%rsp), %rdi
leaq 0x2f8(%rsp), %rsi
callq 0x51b0
movl $0x1, 0x2dc(%rsp)
jmp 0x1da8a
movzbl 0x327(%rsp), %eax
cmpl $0xa, %eax
jne 0x1d231
movq 0x60(%rsp), %rax
testb $0x1, 0x1b(%rax)
je 0x1d231
movq 0x60(%rsp), %rax
testb $0x1, 0x1a(%rax)
jne 0x1d1c4
movq 0x60(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movb %al, 0x3e(%rsp)
jmp 0x1d1ba
movb 0x3e(%rsp), %al
testb $0x1, %al
jne 0x1d1c4
jmp 0x1d231
leaq 0x2db(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x54f0
movq 0x50(%rsp), %rdi
movq 0x30(%rsp), %rdx
leaq 0x4098(%rip), %rsi      # 0x2127f
callq 0x53d0
jmp 0x1d1ee
leaq 0x2db(%rsp), %rdi
callq 0x5300
movl $0x1, 0x2dc(%rsp)
jmp 0x1da8a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
leaq 0x2db(%rsp), %rdi
callq 0x5300
jmp 0x1daa4
movq 0x50(%rsp), %rdi
movb $0x0, 0x2da(%rsp)
callq 0x5400
movq 0x60(%rsp), %rax
testb $0x1, 0x1a(%rax)
je 0x1d34f
movzbl 0x327(%rsp), %eax
cmpl $0x20, %eax
jle 0x1d34f
movzbl 0x327(%rsp), %eax
cmpl $0x7f, %eax
jge 0x1d34f
movq 0x60(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x38(%rax), %rax
callq *%rax
movb %al, 0x2f(%rsp)
jmp 0x1d28b
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x1d34f
jmp 0x1d299
movq 0x60(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
movl %eax, 0x28(%rsp)
jmp 0x1d2b0
movl 0x28(%rsp), %eax
subl $0x1, %eax
cltq
movq %rax, 0x2d0(%rsp)
movq $0x0, 0x2c8(%rsp)
movq 0x2c8(%rsp), %rax
cmpq 0x2d0(%rsp), %rax
jae 0x1d323
movq 0x50(%rsp), %rdi
leaq 0x4f54(%rip), %rsi      # 0x2223f
callq 0x5280
jmp 0x1d2f2
jmp 0x1d2f4
movq 0x2c8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2c8(%rsp)
jmp 0x1d2cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1da7e
movq 0x50(%rsp), %rdi
movsbl 0x327(%rsp), %esi
callq 0x51d0
jmp 0x1d337
movb $0x1, 0x2da(%rsp)
movl $0x1, 0x2dc(%rsp)
jmp 0x1da68
movq 0x60(%rsp), %rcx
xorl %eax, %eax
testb $0x1, 0x18(%rcx)
movb %al, 0x27(%rsp)
je 0x1d3b7
leaq 0x2f8(%rsp), %rdi
callq 0x5220
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x1, %rcx
movb %al, 0x26(%rsp)
jne 0x1d3ad
xorl %eax, %eax
movl %eax, %esi
leaq 0x2f8(%rsp), %rdi
callq 0x5540
movq %rax, 0x18(%rsp)
jmp 0x1d394
movq 0x18(%rsp), %rax
movzbl (%rax), %eax
movzbl 0x327(%rsp), %ecx
cmpl %ecx, %eax
sete %al
movb %al, 0x26(%rsp)
movb 0x26(%rsp), %al
xorb $-0x1, %al
movb %al, 0x27(%rsp)
movb 0x27(%rsp), %al
andb $0x1, %al
movb %al, 0x2c7(%rsp)
testb $0x1, 0x2c7(%rsp)
je 0x1da3f
movzbl 0x327(%rsp), %eax
shrl $0x2, %eax
andl $0x3c, %eax
leaq 0x4f09(%rip), %rcx      # 0x222f0
movl (%rax,%rcx), %eax
movl %eax, 0x2c0(%rsp)
leaq 0x220(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x5400
movq 0x10(%rsp), %rsi
leaq 0x4dcb(%rip), %rdx      # 0x221da
leaq 0x240(%rsp), %rdi
callq 0x11c10
jmp 0x1d41e
leaq 0x4e1e(%rip), %rdx      # 0x22243
leaq 0x260(%rsp), %rdi
leaq 0x240(%rsp), %rsi
callq 0x11c10
jmp 0x1d43c
movl 0x2c0(%rsp), %edx
movl %edx, %eax
addl $0x52, %eax
movl %edx, %ecx
addl $0x1e, %ecx
subl $0x8, %edx
cmovll %ecx, %eax
movl %eax, 0x1fc(%rsp)
leaq 0x200(%rsp), %rdi
leaq 0x1fc(%rsp), %rsi
xorl %edx, %edx
callq 0x19af0
jmp 0x1d473
leaq 0x280(%rsp), %rdi
leaq 0x260(%rsp), %rsi
leaq 0x200(%rsp), %rdx
callq 0x19a00
jmp 0x1d492
leaq 0x4d4d(%rip), %rdx      # 0x221e6
leaq 0x2a0(%rsp), %rdi
leaq 0x280(%rsp), %rsi
callq 0x11c10
jmp 0x1d4b0
movq 0x50(%rsp), %rdi
leaq 0x2a0(%rsp), %rsi
callq 0x5360
jmp 0x1d4c4
leaq 0x2a0(%rsp), %rdi
callq 0x5558
leaq 0x280(%rsp), %rdi
callq 0x5558
leaq 0x200(%rsp), %rdi
callq 0x5558
leaq 0x260(%rsp), %rdi
callq 0x5558
leaq 0x240(%rsp), %rdi
callq 0x5558
leaq 0x220(%rsp), %rdi
callq 0x5558
cmpl $0x4, 0x2c0(%rsp)
je 0x1d530
movzbl 0x327(%rsp), %eax
sarl $0x4, %eax
cmpl $0x6, %eax
jne 0x1d7f9
leaq 0x158(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x5400
movq 0x8(%rsp), %rsi
leaq 0x4c8c(%rip), %rdx      # 0x221da
leaq 0x178(%rsp), %rdi
callq 0x11c10
jmp 0x1d55d
leaq 0x4cdf(%rip), %rdx      # 0x22243
leaq 0x198(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x11c10
jmp 0x1d57b
movl $0x64, 0x134(%rsp)
leaq 0x138(%rsp), %rdi
leaq 0x134(%rsp), %rsi
xorl %edx, %edx
callq 0x19af0
jmp 0x1d59f
leaq 0x1b8(%rsp), %rdi
leaq 0x198(%rsp), %rsi
leaq 0x138(%rsp), %rdx
callq 0x19a00
jmp 0x1d5be
leaq 0x4c21(%rip), %rdx      # 0x221e6
leaq 0x1d8(%rsp), %rdi
leaq 0x1b8(%rsp), %rsi
callq 0x11c10
jmp 0x1d5dc
movq 0x50(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x5360
jmp 0x1d5f0
leaq 0x1d8(%rsp), %rdi
callq 0x5558
leaq 0x1b8(%rsp), %rdi
callq 0x5558
leaq 0x138(%rsp), %rdi
callq 0x5558
leaq 0x198(%rsp), %rdi
callq 0x5558
leaq 0x178(%rsp), %rdi
callq 0x5558
leaq 0x158(%rsp), %rdi
callq 0x5558
jmp 0x1d7f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d70c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d6ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d6f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d6e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d6d8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
leaq 0x2a0(%rsp), %rdi
callq 0x5558
leaq 0x280(%rsp), %rdi
callq 0x5558
leaq 0x200(%rsp), %rdi
callq 0x5558
leaq 0x260(%rsp), %rdi
callq 0x5558
leaq 0x240(%rsp), %rdi
callq 0x5558
leaq 0x220(%rsp), %rdi
callq 0x5558
jmp 0x1da7e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d7e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d7da
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d7cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d7c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d7b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
leaq 0x1d8(%rsp), %rdi
callq 0x5558
leaq 0x1b8(%rsp), %rdi
callq 0x5558
leaq 0x138(%rsp), %rdi
callq 0x5558
leaq 0x198(%rsp), %rdi
callq 0x5558
leaq 0x178(%rsp), %rdi
callq 0x5558
leaq 0x158(%rsp), %rdi
callq 0x5558
jmp 0x1da7e
movzbl 0x327(%rsp), %eax
sarl $0x4, %eax
cmpl $0x6, %eax
jne 0x1d9e7
leaq 0x90(%rsp), %rdi
movq %rdi, (%rsp)
callq 0x5400
movq (%rsp), %rsi
leaq 0x49b1(%rip), %rdx      # 0x221da
leaq 0xb0(%rsp), %rdi
callq 0x11c10
jmp 0x1d838
leaq 0x4a04(%rip), %rdx      # 0x22243
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x11c10
jmp 0x1d856
movl $0x64, 0x6c(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x6c(%rsp), %rsi
xorl %edx, %edx
callq 0x19af0
jmp 0x1d871
leaq 0xf0(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
leaq 0x70(%rsp), %rdx
callq 0x19a00
jmp 0x1d88d
leaq 0x4952(%rip), %rdx      # 0x221e6
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x11c10
jmp 0x1d8ab
movq 0x50(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x5360
jmp 0x1d8bf
leaq 0x110(%rsp), %rdi
callq 0x5558
leaq 0xf0(%rsp), %rdi
callq 0x5558
leaq 0x70(%rsp), %rdi
callq 0x5558
leaq 0xd0(%rsp), %rdi
callq 0x5558
leaq 0xb0(%rsp), %rdi
callq 0x5558
leaq 0x90(%rsp), %rdi
callq 0x5558
jmp 0x1d9e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d9d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d9c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d9bb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d9b1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
jmp 0x1d9a4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x2f0(%rsp)
movl %eax, 0x2ec(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x5558
leaq 0xf0(%rsp), %rdi
callq 0x5558
leaq 0x70(%rsp), %rdi
callq 0x5558
leaq 0xd0(%rsp), %rdi
callq 0x5558
leaq 0xb0(%rsp), %rdi
callq 0x5558
leaq 0x90(%rsp), %rdi
callq 0x5558
jmp 0x1da7e
movq 0x50(%rsp), %rdi
leaq 0x2f8(%rsp), %rsi
callq 0x5360
jmp 0x1d9fb
movq 0x50(%rsp), %rdi
leaq 0x47dc(%rip), %rsi      # 0x221e3
callq 0x5280
jmp 0x1da0e
cmpl $0x4, 0x2c0(%rsp)
je 0x1da28
movzbl 0x327(%rsp), %eax
sarl $0x4, %eax
cmpl $0x6, %eax
jne 0x1da3d
movq 0x50(%rsp), %rdi
leaq 0x47af(%rip), %rsi      # 0x221e3
callq 0x5280
jmp 0x1da3b
jmp 0x1da3d
jmp 0x1da55
movq 0x50(%rsp), %rdi
leaq 0x2f8(%rsp), %rsi
callq 0x5360
jmp 0x1da53
jmp 0x1da55
movb $0x1, 0x2da(%rsp)
movl $0x1, 0x2dc(%rsp)
testb $0x1, 0x2da(%rsp)
jne 0x1da7c
movq 0x50(%rsp), %rdi
callq 0x5558
jmp 0x1da8a
movq 0x50(%rsp), %rdi
callq 0x5558
jmp 0x1daa4
leaq 0x2f8(%rsp), %rdi
callq 0x5558
movq 0x58(%rsp), %rax
addq $0x338, %rsp            # imm = 0x338
retq
leaq 0x2f8(%rsp), %rdi
callq 0x5558
movq 0x2f0(%rsp), %rdi
callq 0x54e0
nop