// File: SYZYGYfpga[P]brain-tools/include/json.hpp
// Function: nlohmann::detail::serializer<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, unsigned long, double, std::allocator, nlohmann::adl_serializer>>::dump_escaped(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool) const
void dump_escaped(const string_t& s, const bool ensure_ascii) const
    {
        throw_if_invalid_utf8(s);

        const auto space = extra_space(s, ensure_ascii);
        if (space == 0)
        {
            o->write_characters(s.c_str(), s.size());
            return;
        }

        // create a result string of necessary size
        string_t result(s.size() + space, '\\');
        std::size_t pos = 0;

        for (std::size_t i = 0; i < s.size(); ++i)
        {
            switch (s[i])
            {
                case '"': // quotation mark (0x22)
                {
                    result[pos + 1] = '"';
                    pos += 2;
                    break;
                }

                case '\\': // reverse solidus (0x5C)
                {
                    // nothing to change
                    pos += 2;
                    break;
                }

                case '\b': // backspace (0x08)
                {
                    result[pos + 1] = 'b';
                    pos += 2;
                    break;
                }

                case '\f': // formfeed (0x0C)
                {
                    result[pos + 1] = 'f';
                    pos += 2;
                    break;
                }

                case '\n': // newline (0x0A)
                {
                    result[pos + 1] = 'n';
                    pos += 2;
                    break;
                }

                case '\r': // carriage return (0x0D)
                {
                    result[pos + 1] = 'r';
                    pos += 2;
                    break;
                }

                case '\t': // horizontal tab (0x09)
                {
                    result[pos + 1] = 't';
                    pos += 2;
                    break;
                }

                default:
                {
                    // escape control characters (0x00..0x1F) or, if
                    // ensure_ascii parameter is used, non-ASCII characters
                    if ((0x00 <= s[i] and s[i] <= 0x1F) or
                            (ensure_ascii and (s[i] & 0x80 or s[i] == 0x7F)))
                    {
                        const auto bytes = bytes_following(static_cast<uint8_t>(s[i]));
                        // invalid characters will be detected by throw_if_invalid_utf8
                        assert (bytes != std::string::npos);

                        // check that the additional bytes are present
                        assert(i + bytes < s.size());

                        // to use \uxxxx escaping, we first need to calculate
                        // the codepoint from the UTF-8 bytes
                        int codepoint = 0;

                        // bytes is unsigned type:
                        assert(bytes <= 3);
                        switch (bytes)
                        {
                            case 0:
                            {
                                codepoint = s[i] & 0xFF;
                                break;
                            }

                            case 1:
                            {
                                codepoint = ((s[i] & 0x3F) << 6)
                                            + (s[i + 1] & 0x7F);
                                break;
                            }

                            case 2:
                            {
                                codepoint = ((s[i] & 0x1F) << 12)
                                            + ((s[i + 1] & 0x7F) << 6)
                                            + (s[i + 2] & 0x7F);
                                break;
                            }

                            case 3:
                            {
                                codepoint = ((s[i] & 0xF) << 18)
                                            + ((s[i + 1] & 0x7F) << 12)
                                            + ((s[i + 2] & 0x7F) << 6)
                                            + (s[i + 3] & 0x7F);
                                break;
                            }

                            default:
                                break;  // LCOV_EXCL_LINE
                        }

                        escape_codepoint(codepoint, result, pos);
                        i += bytes;
                    }
                    else
                    {
                        // all other characters are added as-is
                        result[pos++] = s[i];
                    }
                    break;
                }
            }
        }

        assert(pos == result.size());
        o->write_characters(result.c_str(), result.size());
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8f30
movq -0x10(%rbp), %rdi
movb -0x11(%rbp), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x9470
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x7e5c
movq -0x80(%rbp), %rdi
callq 0x7d60
movq %rax, -0x90(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3120
movq %rax, -0x88(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3200
movq -0x90(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq %rax, %rdx
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x84c0
movq -0x10(%rbp), %rdi
callq 0x3200
movq -0x20(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
leaq -0x41(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0x3460
movq -0xa0(%rbp), %rsi
movq -0x98(%rbp), %rcx
leaq -0x40(%rbp), %rdi
movl $0x5c, %edx
callq 0x31e0
jmp 0x7ea1
leaq -0x41(%rbp), %rdi
callq 0x32e0
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3200
movq %rax, %rcx
movq -0xa8(%rbp), %rax
cmpq %rcx, %rax
jae 0x8424
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %eax
movl %eax, -0xac(%rbp)
subl $0x8, %eax
je 0x7fdc
jmp 0x7f02
movl -0xac(%rbp), %eax
subl $0x9, %eax
je 0x80ac
jmp 0x7f13
movl -0xac(%rbp), %eax
subl $0xa, %eax
je 0x8044
jmp 0x7f24
movl -0xac(%rbp), %eax
subl $0xc, %eax
je 0x8010
jmp 0x7f35
movl -0xac(%rbp), %eax
subl $0xd, %eax
je 0x8078
jmp 0x7f46
movl -0xac(%rbp), %eax
subl $0x22, %eax
je 0x7f7d
jmp 0x7f53
movl -0xac(%rbp), %eax
subl $0x5c, %eax
je 0x7fcb
jmp 0x80e0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x41(%rbp), %rdi
callq 0x32e0
jmp 0x84c9
movq -0x60(%rbp), %rsi
incq %rsi
leaq -0x40(%rbp), %rdi
callq 0x34c0
movq %rax, -0xb8(%rbp)
jmp 0x7f96
movq -0xb8(%rbp), %rax
movb $0x22, (%rax)
movq -0x60(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
jmp 0x8411
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x31c0
jmp 0x84c9
movq -0x60(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
jmp 0x8411
movq -0x60(%rbp), %rsi
incq %rsi
leaq -0x40(%rbp), %rdi
callq 0x34c0
movq %rax, -0xc0(%rbp)
jmp 0x7ff5
movq -0xc0(%rbp), %rax
movb $0x62, (%rax)
movq -0x60(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
jmp 0x8411
movq -0x60(%rbp), %rsi
incq %rsi
leaq -0x40(%rbp), %rdi
callq 0x34c0
movq %rax, -0xc8(%rbp)
jmp 0x8029
movq -0xc8(%rbp), %rax
movb $0x66, (%rax)
movq -0x60(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
jmp 0x8411
movq -0x60(%rbp), %rsi
incq %rsi
leaq -0x40(%rbp), %rdi
callq 0x34c0
movq %rax, -0xd0(%rbp)
jmp 0x805d
movq -0xd0(%rbp), %rax
movb $0x6e, (%rax)
movq -0x60(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
jmp 0x8411
movq -0x60(%rbp), %rsi
incq %rsi
leaq -0x40(%rbp), %rdi
callq 0x34c0
movq %rax, -0xd8(%rbp)
jmp 0x8091
movq -0xd8(%rbp), %rax
movb $0x72, (%rax)
movq -0x60(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
jmp 0x8411
movq -0x60(%rbp), %rsi
incq %rsi
leaq -0x40(%rbp), %rdi
callq 0x34c0
movq %rax, -0xe0(%rbp)
jmp 0x80c5
movq -0xe0(%rbp), %rax
movb $0x74, (%rax)
movq -0x60(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x60(%rbp)
jmp 0x8411
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x810b
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %eax
cmpl $0x1f, %eax
jle 0x8148
testb $0x1, -0x11(%rbp)
je 0x83cb
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
jne 0x8148
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %eax
cmpl $0x7f, %eax
jne 0x83cb
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movzbl (%rax), %edi
callq 0x9600
movq %rax, -0xe8(%rbp)
jmp 0x8166
movq -0xe8(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $-0x1, -0x70(%rbp)
je 0x817a
jmp 0x8199
leaq 0xcb08(%rip), %rdi      # 0x14c89
leaq 0xc9c1(%rip), %rsi      # 0x14b49
movl $0x19a1, %edx           # imm = 0x19A1
leaq 0xcb10(%rip), %rcx      # 0x14ca4
callq 0x31d0
movq -0x68(%rbp), %rax
addq -0x70(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x10(%rbp), %rdi
callq 0x3200
movq %rax, %rcx
movq -0xf0(%rbp), %rax
cmpq %rcx, %rax
jae 0x81c2
jmp 0x81e1
leaq 0xcb70(%rip), %rdi      # 0x14d39
leaq 0xc979(%rip), %rsi      # 0x14b49
movl $0x19a4, %edx           # imm = 0x19A4
leaq 0xcac8(%rip), %rcx      # 0x14ca4
callq 0x31d0
movl $0x0, -0x74(%rbp)
cmpq $0x3, -0x70(%rbp)
ja 0x81f1
jmp 0x8210
leaq 0xcb56(%rip), %rdi      # 0x14d4e
leaq 0xc94a(%rip), %rsi      # 0x14b49
movl $0x19ab, %edx           # imm = 0x19AB
leaq 0xca99(%rip), %rcx      # 0x14ca4
callq 0x31d0
movq -0x70(%rbp), %rax
movq %rax, -0xf8(%rbp)
subq $0x3, %rax
ja 0x83a9
movq -0xf8(%rbp), %rax
leaq 0xbf15(%rip), %rcx      # 0x14148
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %eax
andl $0xff, %eax
movl %eax, -0x74(%rbp)
jmp 0x83ab
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %eax
andl $0x3f, %eax
shll $0x6, %eax
movl %eax, -0xfc(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x1, %rsi
callq 0x32f0
movq %rax, %rcx
movl -0xfc(%rbp), %eax
movsbl (%rcx), %ecx
andl $0x7f, %ecx
addl %ecx, %eax
movl %eax, -0x74(%rbp)
jmp 0x83ab
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %eax
andl $0x1f, %eax
shll $0xc, %eax
movl %eax, -0x104(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x1, %rsi
callq 0x32f0
movq %rax, %rcx
movl -0x104(%rbp), %eax
movsbl (%rcx), %ecx
andl $0x7f, %ecx
shll $0x6, %ecx
addl %ecx, %eax
movl %eax, -0x100(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x2, %rsi
callq 0x32f0
movq %rax, %rcx
movl -0x100(%rbp), %eax
movsbl (%rcx), %ecx
andl $0x7f, %ecx
addl %ecx, %eax
movl %eax, -0x74(%rbp)
jmp 0x83ab
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movsbl (%rax), %eax
andl $0xf, %eax
shll $0x12, %eax
movl %eax, -0x110(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x1, %rsi
callq 0x32f0
movq %rax, %rcx
movl -0x110(%rbp), %eax
movsbl (%rcx), %ecx
andl $0x7f, %ecx
shll $0xc, %ecx
addl %ecx, %eax
movl %eax, -0x10c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x2, %rsi
callq 0x32f0
movq %rax, %rcx
movl -0x10c(%rbp), %eax
movsbl (%rcx), %ecx
andl $0x7f, %ecx
shll $0x6, %ecx
addl %ecx, %eax
movl %eax, -0x108(%rbp)
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
addq $0x3, %rsi
callq 0x32f0
movq %rax, %rcx
movl -0x108(%rbp), %eax
movsbl (%rcx), %ecx
andl $0x7f, %ecx
addl %ecx, %eax
movl %eax, -0x74(%rbp)
jmp 0x83ab
jmp 0x83ab
movl -0x74(%rbp), %edi
leaq -0x40(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x96c0
jmp 0x83bd
movq -0x70(%rbp), %rax
addq -0x68(%rbp), %rax
movq %rax, -0x68(%rbp)
jmp 0x840f
movq -0x10(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x32f0
movb (%rax), %al
movb %al, -0x119(%rbp)
movq -0x60(%rbp), %rsi
movq %rsi, %rax
incq %rax
movq %rax, -0x60(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x34c0
movq %rax, -0x118(%rbp)
jmp 0x8400
movq -0x118(%rbp), %rax
movb -0x119(%rbp), %cl
movb %cl, (%rax)
jmp 0x8411
jmp 0x8413
movq -0x68(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x68(%rbp)
jmp 0x7eba
movq -0x60(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3200
movq %rax, %rcx
movq -0x128(%rbp), %rax
cmpq %rcx, %rax
jne 0x8449
jmp 0x8468
leaq 0xc909(%rip), %rdi      # 0x14d59
leaq 0xc6f2(%rip), %rsi      # 0x14b49
movl $0x19dd, %edx           # imm = 0x19DD
leaq 0xc841(%rip), %rcx      # 0x14ca4
callq 0x31d0
movq -0x80(%rbp), %rdi
callq 0x7d60
movq %rax, -0x138(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x3120
movq -0x140(%rbp), %rdi
movq %rax, -0x130(%rbp)
callq 0x3200
movq -0x138(%rbp), %rdi
movq -0x130(%rbp), %rsi
movq %rax, %rdx
movq (%rdi), %rax
movq 0x8(%rax), %rax
callq *%rax
jmp 0x84b7
leaq -0x40(%rbp), %rdi
callq 0x31c0
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x3450
nopw %cs:(%rax,%rax)
nopl (%rax)