// File: /workspace/github_cpp_makefile_star2_O3/Konano[P]UselessDatabase/./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)
void dump_escaped(const string_t& s, const bool ensure_ascii)
    {
        std::uint32_t codepoint;
        std::uint8_t state = UTF8_ACCEPT;
        std::size_t bytes = 0;  // number of bytes written to string_buffer

        // number of bytes written at the point of the last valid byte
        std::size_t bytes_after_last_accept = 0;
        std::size_t undumped_chars = 0;

        for (std::size_t i = 0; i < s.size(); ++i)
        {
            const auto byte = static_cast<uint8_t>(s[i]);

            switch (decode(state, codepoint, byte))
            {
                case UTF8_ACCEPT:  // decode found a new code point
                {
                    switch (codepoint)
                    {
                        case 0x08: // backspace
                        {
                            string_buffer[bytes++] = '\\';
                            string_buffer[bytes++] = 'b';
                            break;
                        }

                        case 0x09: // horizontal tab
                        {
                            string_buffer[bytes++] = '\\';
                            string_buffer[bytes++] = 't';
                            break;
                        }

                        case 0x0A: // newline
                        {
                            string_buffer[bytes++] = '\\';
                            string_buffer[bytes++] = 'n';
                            break;
                        }

                        case 0x0C: // formfeed
                        {
                            string_buffer[bytes++] = '\\';
                            string_buffer[bytes++] = 'f';
                            break;
                        }

                        case 0x0D: // carriage return
                        {
                            string_buffer[bytes++] = '\\';
                            string_buffer[bytes++] = 'r';
                            break;
                        }

                        case 0x22: // quotation mark
                        {
                            string_buffer[bytes++] = '\\';
                            string_buffer[bytes++] = '\"';
                            break;
                        }

                        case 0x5C: // reverse solidus
                        {
                            string_buffer[bytes++] = '\\';
                            string_buffer[bytes++] = '\\';
                            break;
                        }

                        default:
                        {
                            // escape control characters (0x00..0x1F) or, if
                            // ensure_ascii parameter is used, non-ASCII characters
                            if ((codepoint <= 0x1F) or (ensure_ascii and (codepoint >= 0x7F)))
                            {
                                if (codepoint <= 0xFFFF)
                                {
                                    (std::snprintf)(string_buffer.data() + bytes, 7, "\\u%04x",
                                                    static_cast<std::uint16_t>(codepoint));
                                    bytes += 6;
                                }
                                else
                                {
                                    (std::snprintf)(string_buffer.data() + bytes, 13, "\\u%04x\\u%04x",
                                                    static_cast<std::uint16_t>(0xD7C0u + (codepoint >> 10u)),
                                                    static_cast<std::uint16_t>(0xDC00u + (codepoint & 0x3FFu)));
                                    bytes += 12;
                                }
                            }
                            else
                            {
                                // copy byte to buffer (all previous bytes
                                // been copied have in default case above)
                                string_buffer[bytes++] = s[i];
                            }
                            break;
                        }
                    }

                    // write buffer and reset index; there must be 13 bytes
                    // left, as this is the maximal number of bytes to be
                    // written ("\uxxxx\uxxxx\0") for one code point
                    if (string_buffer.size() - bytes < 13)
                    {
                        o->write_characters(string_buffer.data(), bytes);
                        bytes = 0;
                    }

                    // remember the byte position of this accept
                    bytes_after_last_accept = bytes;
                    undumped_chars = 0;
                    break;
                }

                case UTF8_REJECT:  // decode found invalid UTF-8 byte
                {
                    switch (error_handler)
                    {
                        case error_handler_t::strict:
                        {
                            std::string sn(3, '\0');
                            (std::snprintf)(&sn[0], sn.size(), "%.2X", byte);
                            JSON_THROW(type_error::create(316, "invalid UTF-8 byte at index " + std::to_string(i) + ": 0x" + sn));
                        }

                        case error_handler_t::ignore:
                        case error_handler_t::replace:
                        {
                            // in case we saw this character the first time, we
                            // would like to read it again, because the byte
                            // may be OK for itself, but just not OK for the
                            // previous sequence
                            if (undumped_chars > 0)
                            {
                                --i;
                            }

                            // reset length buffer to the last accepted index;
                            // thus removing/ignoring the invalid characters
                            bytes = bytes_after_last_accept;

                            if (error_handler == error_handler_t::replace)
                            {
                                // add a replacement character
                                if (ensure_ascii)
                                {
                                    string_buffer[bytes++] = '\\';
                                    string_buffer[bytes++] = 'u';
                                    string_buffer[bytes++] = 'f';
                                    string_buffer[bytes++] = 'f';
                                    string_buffer[bytes++] = 'f';
                                    string_buffer[bytes++] = 'd';
                                }
                                else
                                {
                                    string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xEF');
                                    string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBF');
                                    string_buffer[bytes++] = detail::binary_writer<BasicJsonType, char>::to_char_type('\xBD');
                                }

                                // write buffer and reset index; there must be 13 bytes
                                // left, as this is the maximal number of bytes to be
                                // written ("\uxxxx\uxxxx\0") for one code point
                                if (string_buffer.size() - bytes < 13)
                                {
                                    o->write_characters(string_buffer.data(), bytes);
                                    bytes = 0;
                                }

                                bytes_after_last_accept = bytes;
                            }

                            undumped_chars = 0;

                            // continue processing the string
                            state = UTF8_ACCEPT;
                            break;
                        }

                        default:            // LCOV_EXCL_LINE
                            assert(false);  // LCOV_EXCL_LINE
                    }
                    break;
                }

                default:  // decode found yet incomplete multi-byte code point
                {
                    if (not ensure_ascii)
                    {
                        // code point will not be escaped - copy byte to buffer
                        string_buffer[bytes++] = s[i];
                    }
                    ++undumped_chars;
                    break;
                }
            }
        }

        // we finished processing the string
        if (JSON_HEDLEY_LIKELY(state == UTF8_ACCEPT))
        {
            // write buffer
            if (bytes > 0)
            {
                o->write_characters(string_buffer.data(), bytes);
            }
        }
        else
        {
            // we finish reading, but do not accept: string was incomplete
            switch (error_handler)
            {
                case error_handler_t::strict:
                {
                    std::string sn(3, '\0');
                    (std::snprintf)(&sn[0], sn.size(), "%.2X", static_cast<std::uint8_t>(s.back()));
                    JSON_THROW(type_error::create(316, "incomplete UTF-8 string; last byte: 0x" + sn));
                }

                case error_handler_t::ignore:
                {
                    // write all accepted bytes
                    o->write_characters(string_buffer.data(), bytes_after_last_accept);
                    break;
                }

                case error_handler_t::replace:
                {
                    // write all accepted bytes
                    o->write_characters(string_buffer.data(), bytes_after_last_accept);
                    // add a replacement character
                    if (ensure_ascii)
                    {
                        o->write_characters("\\ufffd", 6);
                    }
                    else
                    {
                        o->write_characters("\xEF\xBF\xBD", 3);
                    }
                    break;
                }

                default:            // LCOV_EXCL_LINE
                    assert(false);  // LCOV_EXCL_LINE
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
cmpq $0x0, 0x8(%rsi)
je 0xb526
movl %edx, %r9d
movq %rsi, %rbx
leaq 0x5a(%rdi), %r12
leaq 0x349c5(%rip), %r10     # 0x3fc7c
xorl %ebp, %ebp
xorl %r14d, %r14d
xorl %esi, %esi
xorl %edx, %edx
xorl %eax, %eax
movq %rdi, 0x10(%rsp)
movl %r9d, 0xc(%rsp)
movq (%rbx), %rcx
movzbl (%rcx,%r14), %r15d
movzbl (%r15,%r10), %ecx
testb %al, %al
je 0xb2ed
movl %r15d, %r8d
andl $0x3f, %r8d
shll $0x6, %r13d
orl %r8d, %r13d
jmp 0xb2f9
movl $0xff, %r13d
shrl %cl, %r13d
andl %r15d, %r13d
movzbl %al, %eax
shll $0x4, %eax
movl %ecx, %ecx
addq %rax, %rcx
movzbl 0x100(%rcx,%r10), %eax
cmpl $0x1, %eax
je 0xb33b
testl %eax, %eax
jne 0xb37c
leal -0x8(%r13), %eax
cmpl $0x5, %eax
ja 0xb390
leaq 0x30df2(%rip), %rcx     # 0x3c118
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movw $0x625c, (%r12,%rbp)    # imm = 0x625C
jmp 0xb43b
movl 0x280(%rdi), %eax
leal -0x1(%rax), %ecx
cmpl $0x2, %ecx
jae 0xb538
cmpq $0x1, %rsi
adcq $-0x1, %r14
cmpl $0x1, %eax
jne 0xb476
testb %r9b, %r9b
je 0xb3ac
movl $0x6666755c, (%r12,%rdx) # imm = 0x6666755C
movw $0x6466, 0x4(%r12,%rdx) # imm = 0x6466
addq $0x6, %rdx
jmp 0xb442
testb %r9b, %r9b
jne 0xb388
movb %r15b, (%r12,%rbp)
incq %rbp
incq %rsi
jmp 0xb47d
cmpl $0x22, %r13d
je 0xb434
cmpl $0x5c, %r13d
jne 0xb3c2
movw $0x5c5c, (%r12,%rbp)    # imm = 0x5C5C
jmp 0xb43b
movw $0xbfef, (%r12,%rdx)    # imm = 0xBFEF
movb $-0x43, 0x2(%r12,%rdx)
addq $0x3, %rdx
jmp 0xb442
cmpl $0x20, %r13d
setae %al
cmpl $0x7f, %r13d
setb %cl
movl %r9d, %edx
xorb $0x1, %dl
orb %cl, %dl
testb %dl, %al
jne 0xb48c
leaq (%r12,%rbp), %rdi
cmpl $0xffff, %r13d          # imm = 0xFFFF
ja 0xb495
movl $0x7, %esi
leaq 0x3153d(%rip), %rdx     # 0x3c93a
movl %r13d, %ecx
xorl %eax, %eax
callq 0x5610
addq $0x6, %rbp
jmp 0xb4cb
movw $0x745c, (%r12,%rbp)    # imm = 0x745C
jmp 0xb43b
movw $0x6e5c, (%r12,%rbp)    # imm = 0x6E5C
jmp 0xb43b
movw $0x665c, (%r12,%rbp)    # imm = 0x665C
jmp 0xb43b
movw $0x725c, (%r12,%rbp)    # imm = 0x725C
jmp 0xb43b
movw $0x225c, (%r12,%rbp)    # imm = 0x225C
addq $0x2, %rbp
movq %rbp, %rdx
leaq -0x1f4(%rdx), %rax
cmpq $0xc, %rax
ja 0xb476
movq (%rdi), %rdi
movq (%rdi), %rax
movq %r12, %rsi
callq *0x8(%rax)
leaq 0x3481a(%rip), %r10     # 0x3fc7c
movl 0xc(%rsp), %r9d
movq 0x10(%rsp), %rdi
xorl %eax, %eax
xorl %edx, %edx
xorl %esi, %esi
xorl %ebp, %ebp
jmp 0xb47d
xorl %eax, %eax
xorl %esi, %esi
movq %rdx, %rbp
incq %r14
cmpq 0x8(%rbx), %r14
jb 0xb2cc
jmp 0xb4e4
movb %r15b, (%r12,%rbp)
incq %rbp
jmp 0xb43f
movl %r13d, %eax
shrl $0xa, %eax
addl $0xd7c0, %eax           # imm = 0xD7C0
movzwl %ax, %ecx
movl %r13d, %r8d
andl $0x3ff, %r8d            # imm = 0x3FF
orl $0xdc00, %r8d           # imm = 0xDC00
movl $0xd, %esi
leaq 0x31474(%rip), %rdx     # 0x3c934
xorl %eax, %eax
callq 0x5610
addq $0xc, %rbp
movq %rbp, %rdx
movq 0x10(%rsp), %rdi
movl 0xc(%rsp), %r9d
leaq 0x3479d(%rip), %r10     # 0x3fc7c
jmp 0xb442
testb %al, %al
jne 0xb510
testq %rbp, %rbp
je 0xb526
movq (%rdi), %rdi
movq (%rdi), %rax
movq 0x8(%rax), %rax
movq %r12, %rsi
movq %rbp, %rdx
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
movzbl %r9b, %eax
movq %rdx, %rsi
movl %eax, %edx
callq 0x58cb
testb $0x1, %al
jne 0xb66d
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jne 0xb5e1
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x18(%rsp), %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x5460
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rsi
leaq 0x313d5(%rip), %rdx     # 0x3c941
movl %r15d, %ecx
xorl %eax, %eax
callq 0x5610
movl $0x20, %edi
callq 0x5210
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
movq %r14, %rsi
callq 0xbd8e
leaq 0x313af(%rip), %rsi     # 0x3c946
leaq 0x98(%rsp), %rdi
leaq 0x58(%rsp), %rdx
callq 0xbd1e
leaq 0x31464(%rip), %rsi     # 0x3ca14
leaq 0x98(%rsp), %rdi
callq 0x5780
leaq 0x88(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0xb600
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0xb610
leaq 0x31335(%rip), %rdi     # 0x3c91d
leaq 0x3120b(%rip), %rsi     # 0x3c7fa
leaq 0x3136d(%rip), %rcx     # 0x3c963
movl $0x3793, %edx           # imm = 0x3793
callq 0x5280
movq %rdx, 0x78(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x88(%rsp)
movq 0x8(%rax), %rdx
leaq 0x78(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rdx
callq 0xbcc4
movb $0x1, %bpl
leaq 0x38(%rsp), %rdx
movq %rbx, %rdi
movl $0x13c, %esi            # imm = 0x13C
callq 0xbb5e
xorl %ebp, %ebp
leaq 0x471df(%rip), %rsi     # 0x52838
leaq 0x6232(%rip), %rdx      # 0x11892
movq %rbx, %rdi
callq 0x56b0
jmp 0xb6fb
leaq 0x28(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x18(%rsp), %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0x5460
leaq 0x18(%rsp), %r14
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movzbl -0x1(%rax,%rcx), %ecx
leaq 0x3129b(%rip), %rdx     # 0x3c941
xorl %eax, %eax
callq 0x5610
movl $0x20, %edi
callq 0x5210
movq %rax, %rbx
leaq 0x31331(%rip), %rsi     # 0x3c9f2
leaq 0x38(%rsp), %rdi
movq %r14, %rdx
callq 0xbe1e
movb $0x1, %bpl
leaq 0x38(%rsp), %rdx
movq %rbx, %rdi
movl $0x13c, %esi            # imm = 0x13C
callq 0xbb5e
xorl %ebp, %ebp
leaq 0x4714c(%rip), %rsi     # 0x52838
leaq 0x619f(%rip), %rdx      # 0x11892
movq %rbx, %rdi
callq 0x56b0
movq %rax, %r14
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb719
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53a0
testb %bpl, %bpl
jne 0xb723
jmp 0xb72b
movq %rax, %r14
movq %rbx, %rdi
callq 0x52d0
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
jne 0xb803
jmp 0xb815
jmp 0xb812
movq %rax, %r14
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb769
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x53a0
jmp 0xb769
movq %rax, %r14
movb $0x1, %bpl
movq 0x78(%rsp), %rdi
cmpq %r15, %rdi
je 0xb78b
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x53a0
jmp 0xb78b
movq %rax, %r14
movb $0x1, %bpl
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb7ac
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x53a0
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb7c7
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53a0
testb %bpl, %bpl
jne 0xb7f1
jmp 0xb7f9
movq %rax, %r14
leaq 0x68(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xb7f1
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x53a0
jmp 0xb7f1
movq %rax, %r14
movq %rbx, %rdi
callq 0x52d0
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0xb815
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x53a0
jmp 0xb815
movq %rax, %r14
movq %r14, %rdi
callq 0x56e0
nop