// File: lvandeve[P]base256/base256.cpp
// Function: Printer::encode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
std::string encode(const std::string& s) {
    size_t lnlen = valtostr(s.size(), linenumbersbase == 16).size();
    std::string result;
    for(int i = 0; i < s.size(); i++) {
      bool wrapped = false;
      if(wrap && numbytes >= wrap) {
        result += n->lineend();
        if(n->allowlinebreaks()) result += "\n";
        numbytes = 0;
        wrapped = true;
      }
      if(printlinenumbers && numbytes == 0) {
        std::string ln = valtostr(i, linenumbersbase == 16);
        while (ln.size() < lnlen) ln = " " + ln;
        result += ln + ": ";
      }
      if(i == 0) result += n->open();
      if(wrapped) result += n->linebeg();
      unsigned char prev = (i > 0) ? s[i - 1] : 0;
      unsigned char next = (i + 1 < s.size()) ? s[i + 1] : 0;
      size_t outwidth = 0;
      std::string temp = encodeChar(s[i], prev, next, &outwidth);
      result += temp;
      if(comma) result += ",";
      if(comma || n->space()) result += " ";
      if(temp == "\n") {
        numbytes = 0;
      }
      if(n->outwidth()) {
        // For C string literals, with variable length characters, align the width
        // based on the output width rather than the input width.
        numbytes += outwidth;
      } else {
        numbytes++;
      }
    }
    result += n->close();
    return result;
  }

// Assembly:
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdi, 0x38(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x1b0(%rsp)
movq %rsi, 0x1a8(%rsp)
movq %rdx, 0x1a0(%rsp)
movq 0x1a8(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0x1a0(%rsp), %rdi
callq 0x5220
movq %rax, %rcx
movq 0x28(%rsp), %rax
movq %rcx, 0x170(%rsp)
cmpl $0x10, 0x14(%rax)
sete %al
movzbl %al, %edx
andl $0x1, %edx
leaq 0x178(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0x10fa0
leaq 0x178(%rsp), %rdi
callq 0x5220
movq %rax, 0x30(%rsp)
leaq 0x178(%rsp), %rdi
callq 0x5558
movq 0x30(%rsp), %rax
movq 0x38(%rsp), %rdi
movq %rax, 0x198(%rsp)
movb $0x0, 0x16f(%rsp)
callq 0x5400
movl $0x0, 0x168(%rsp)
movslq 0x168(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x1a0(%rsp), %rdi
callq 0x5220
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jae 0x10b26
movq 0x28(%rsp), %rax
movb $0x0, 0x167(%rsp)
cmpl $0x0, 0x8(%rax)
je 0x106f9
movq 0x28(%rsp), %rcx
movl 0xc(%rcx), %eax
cmpl 0x8(%rcx), %eax
jl 0x106f9
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x58(%rax), %rax
leaq 0x140(%rsp), %rdi
callq *%rax
jmp 0x1064f
movq 0x38(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x5360
jmp 0x10663
leaq 0x140(%rsp), %rdi
callq 0x5558
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rax
callq *%rax
movb %al, 0x17(%rsp)
jmp 0x10687
movb 0x17(%rsp), %al
testb $0x1, %al
jne 0x10691
jmp 0x106e5
movq 0x38(%rsp), %rdi
leaq 0x10be2(%rip), %rsi     # 0x2127f
callq 0x5280
jmp 0x106a4
jmp 0x106e5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x10ba4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x140(%rsp), %rdi
callq 0x5558
jmp 0x10ba4
movq 0x28(%rsp), %rax
movl $0x0, 0xc(%rax)
movb $0x1, 0x167(%rsp)
movq 0x28(%rsp), %rax
testb $0x1, 0x10(%rax)
je 0x10831
movq 0x28(%rsp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x10831
movq 0x28(%rsp), %rax
movl 0x14(%rax), %eax
subl $0x10, %eax
sete %al
movzbl %al, %edx
leaq 0x110(%rsp), %rdi
leaq 0x168(%rsp), %rsi
callq 0x19af0
jmp 0x1073f
jmp 0x10741
leaq 0x110(%rsp), %rdi
callq 0x5220
cmpq 0x198(%rsp), %rax
jae 0x107b0
leaq 0x11ae0(%rip), %rsi     # 0x2223f
leaq 0xf0(%rsp), %rdi
leaq 0x110(%rsp), %rdx
callq 0x11ae0
jmp 0x10776
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x5330
leaq 0xf0(%rsp), %rdi
callq 0x5558
jmp 0x10741
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x1081f
leaq 0x117f3(%rip), %rdx     # 0x21faa
leaq 0xd0(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x1db10
jmp 0x107ce
movq 0x38(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x5360
jmp 0x107e2
leaq 0xd0(%rsp), %rdi
callq 0x5558
leaq 0x110(%rsp), %rdi
callq 0x5558
jmp 0x10831
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x5558
leaq 0x110(%rsp), %rdi
callq 0x5558
jmp 0x10ba4
cmpl $0x0, 0x168(%rsp)
jne 0x1089f
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x40(%rax), %rax
leaq 0xb0(%rsp), %rdi
callq *%rax
jmp 0x10856
movq 0x38(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x5360
jmp 0x1086a
leaq 0xb0(%rsp), %rdi
callq 0x5558
jmp 0x1089f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x5558
jmp 0x10ba4
testb $0x1, 0x167(%rsp)
je 0x1090d
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x50(%rax), %rax
leaq 0x90(%rsp), %rdi
callq *%rax
jmp 0x108c4
movq 0x38(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x5360
jmp 0x108d8
leaq 0x90(%rsp), %rdi
callq 0x5558
jmp 0x1090d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x5558
jmp 0x10ba4
cmpl $0x0, 0x168(%rsp)
jle 0x1093a
movq 0x1a0(%rsp), %rdi
movl 0x168(%rsp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x5320
movsbl (%rax), %eax
movl %eax, 0x10(%rsp)
jmp 0x10942
xorl %eax, %eax
movl %eax, 0x10(%rsp)
jmp 0x10942
movl 0x10(%rsp), %eax
movb %al, 0x8f(%rsp)
movl 0x168(%rsp), %eax
addl $0x1, %eax
cltq
movq %rax, 0x8(%rsp)
movq 0x1a0(%rsp), %rdi
callq 0x5220
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x1099b
movq 0x1a0(%rsp), %rdi
movl 0x168(%rsp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x5320
movsbl (%rax), %eax
movl %eax, 0x4(%rsp)
jmp 0x109a3
xorl %eax, %eax
movl %eax, 0x4(%rsp)
jmp 0x109a3
movl 0x4(%rsp), %eax
movb %al, 0x8e(%rsp)
movq $0x0, 0x80(%rsp)
movq 0x1a0(%rsp), %rdi
movslq 0x168(%rsp), %rsi
callq 0x5320
movq 0x28(%rsp), %rsi
movzbl (%rax), %edx
movzbl 0x8f(%rsp), %ecx
movzbl 0x8e(%rsp), %r8d
leaq 0x60(%rsp), %rdi
leaq 0x80(%rsp), %r9
callq 0x1cf60
jmp 0x109fc
movq 0x38(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x5360
jmp 0x10a0d
movq 0x28(%rsp), %rax
testb $0x1, 0x19(%rax)
je 0x10a50
movq 0x38(%rsp), %rdi
leaq 0x11821(%rip), %rsi     # 0x22245
callq 0x5280
jmp 0x10a2b
jmp 0x10a50
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x5558
jmp 0x10ba4
movq 0x28(%rsp), %rax
testb $0x1, 0x19(%rax)
jne 0x10a7c
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
movb %al, 0x3(%rsp)
jmp 0x10a72
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x10a7c
jmp 0x10a91
movq 0x38(%rsp), %rdi
leaq 0x117b7(%rip), %rsi     # 0x2223f
callq 0x5280
jmp 0x10a8f
jmp 0x10a91
leaq 0x107e7(%rip), %rsi     # 0x2127f
leaq 0x60(%rsp), %rdi
callq 0xfd20
movb %al, 0x2(%rsp)
jmp 0x10aa8
movb 0x2(%rsp), %al
testb $0x1, %al
jne 0x10ab2
jmp 0x10abe
movq 0x28(%rsp), %rax
movl $0x0, 0xc(%rax)
movq 0x28(%rsp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rax
callq *%rax
movb %al, 0x1(%rsp)
jmp 0x10ad5
movb 0x1(%rsp), %al
testb $0x1, %al
jne 0x10adf
jmp 0x10af8
movq 0x28(%rsp), %rax
movq 0x80(%rsp), %rdx
movslq 0xc(%rax), %rcx
addq %rdx, %rcx
movl %ecx, 0xc(%rax)
jmp 0x10b06
movq 0x28(%rsp), %rax
movl 0xc(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xc(%rax)
leaq 0x60(%rsp), %rdi
callq 0x5558
movl 0x168(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x168(%rsp)
jmp 0x105e1
movq 0x28(%rsp), %rax
movq (%rax), %rsi
movq (%rsi), %rax
movq 0x48(%rax), %rax
leaq 0x40(%rsp), %rdi
callq *%rax
jmp 0x10b3e
movq 0x38(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x5360
jmp 0x10b4f
leaq 0x40(%rsp), %rdi
callq 0x5558
movb $0x1, 0x16f(%rsp)
testb $0x1, 0x16f(%rsp)
jne 0x10b97
jmp 0x10b8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x40(%rsp), %rdi
callq 0x5558
jmp 0x10ba4
movq 0x38(%rsp), %rdi
callq 0x5558
movq 0x20(%rsp), %rax
addq $0x1b8, %rsp            # imm = 0x1B8
retq
movq 0x38(%rsp), %rdi
callq 0x5558
movq 0x138(%rsp), %rdi
callq 0x54e0
nopl (%rax,%rax)