// File: /workspace/github_cpp_makefile_star2_O1/alfanick[P]rest-cpp/src/rest/json.hpp
// Function: nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool, long, double, std::allocator>::escape_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
static string_t escape_string(const string_t& s) noexcept
    {
        const auto space = extra_space(s);
        if (space == 0)
        {
            return s;
        }

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

        for (const auto& c : s)
        {
            switch (c)
            {
                // quotation mark (0x22)
                case '"':
                {
                    result[pos + 1] = '"';
                    pos += 2;
                    break;
                }

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

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

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

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

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

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

                default:
                {
                    if (c >= 0x00 and c <= 0x1f)
                    {
                        // convert a number 0..15 to its hex representation (0..f)
                        auto hexify = [](const char v) -> char
                        {
                            return (v < 10) ? ('0' + v) : ('a' + v - 10);
                        };

                        // print character c as \uxxxx
                        for (const char m :
                    { 'u', '0', '0', hexify(c >> 4), hexify(c & 0x0f)
                        })
                        {
                            result[++pos] = m;
                        }

                        ++pos;
                    }
                    else
                    {
                        // all other characters are added as-is
                        result[pos++] = c;
                    }
                    break;
                }
            }
        }

        return result;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x21610
testq %rax, %rax
je 0x3bbd5
addq 0x8(%r14), %rax
leaq 0x10(%rbx), %rcx
movq %rcx, (%rbx)
movq %rbx, %rdi
movq %rax, %rsi
movl $0x5c, %edx
callq 0x22520
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x3bbee
movq (%r14), %rcx
addq %rcx, %rax
xorl %edx, %edx
movl $0x30, %esi
leaq 0x4e6b(%rip), %rdi      # 0x40948
movb (%rcx), %r8b
movzbl %r8b, %r9d
leal -0x8(%r9), %r10d
cmpl $0x5, %r10d
ja 0x3bb06
movslq (%rdi,%r10,4), %r9
addq %rdi, %r9
jmpq *%r9
movq (%rbx), %r8
movb $0x62, 0x1(%r8,%rdx)
jmp 0x3bbb7
cmpl $0x5c, %r9d
je 0x3bbb7
cmpl $0x22, %r9d
jne 0x3bb24
movq (%rbx), %r8
movb $0x22, 0x1(%r8,%rdx)
jmp 0x3bbb7
cmpb $0x1f, %r8b
ja 0x3bbc9
movw $0x3075, 0x3(%rsp)      # imm = 0x3075
movb $0x30, 0x5(%rsp)
movb (%rcx), %r8b
movl %r8d, %r9d
sarb $0x4, %r9b
addb $0x30, %r9b
movb %r9b, 0x6(%rsp)
andb $0xf, %r8b
cmpb $0xa, %r8b
movl $0x57, %r9d
cmovbl %esi, %r9d
addb %r8b, %r9b
movb %r9b, 0x7(%rsp)
leaq 0x1(%rdx), %r8
xorl %r9d, %r9d
movb 0x3(%rsp,%r9), %r10b
movq (%rbx), %r11
addq %r8, %r11
movb %r10b, (%r9,%r11)
incq %r9
cmpq $0x5, %r9
jne 0x3bb6e
leaq 0x1(%rdx,%r9), %rdx
jmp 0x3bbbb
movq (%rbx), %r8
movb $0x74, 0x1(%r8,%rdx)
jmp 0x3bbb7
movq (%rbx), %r8
movb $0x6e, 0x1(%r8,%rdx)
jmp 0x3bbb7
movq (%rbx), %r8
movb $0x66, 0x1(%r8,%rdx)
jmp 0x3bbb7
movq (%rbx), %r8
movb $0x72, 0x1(%r8,%rdx)
addq $0x2, %rdx
incq %rcx
cmpq %rax, %rcx
jne 0x3badd
jmp 0x3bbee
movq (%rbx), %r9
movb %r8b, (%r9,%rdx)
incq %rdx
jmp 0x3bbbb
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x21600
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rdi
callq 0x249b5
nop