// File: king1600[P]cordpp/./include/json.h
// 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>>::escape_codepoint(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&, unsigned long&)
static void escape_codepoint(int codepoint, string_t& result, std::size_t& pos)
    {
        // expecting a proper codepoint
        assert(0x00 <= codepoint and codepoint <= 0x10FFFF);

        // the last written character was the backslash before the 'u'
        assert(result[pos] == '\\');

        // write the 'u'
        result[++pos] = 'u';

        // convert a number 0..15 to its hex representation (0..f)
        static const std::array<char, 16> hexify =
        {
            {
                '0', '1', '2', '3', '4', '5', '6', '7',
                '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
            }
        };

        if (codepoint < 0x10000)
        {
            // codepoints U+0000..U+FFFF can be represented as \uxxxx.
            result[++pos] = hexify[(codepoint >> 12) & 0x0F];
            result[++pos] = hexify[(codepoint >> 8) & 0x0F];
            result[++pos] = hexify[(codepoint >> 4) & 0x0F];
            result[++pos] = hexify[codepoint & 0x0F];
        }
        else
        {
            // codepoints U+10000..U+10FFFF need a surrogate pair to be
            // represented as \uxxxx\uxxxx.
            // http://www.unicode.org/faq/utf_bom.html#utf16-4
            codepoint -= 0x10000;
            const int high_surrogate = 0xD800 | ((codepoint >> 10) & 0x3FF);
            const int low_surrogate = 0xDC00 | (codepoint & 0x3FF);
            result[++pos] = hexify[(high_surrogate >> 12) & 0x0F];
            result[++pos] = hexify[(high_surrogate >> 8) & 0x0F];
            result[++pos] = hexify[(high_surrogate >> 4) & 0x0F];
            result[++pos] = hexify[high_surrogate & 0x0F];
            ++pos;  // backslash is already in output
            result[++pos] = 'u';
            result[++pos] = hexify[(low_surrogate >> 12) & 0x0F];
            result[++pos] = hexify[(low_surrogate >> 8) & 0x0F];
            result[++pos] = hexify[(low_surrogate >> 4) & 0x0F];
            result[++pos] = hexify[low_surrogate & 0x0F];
        }

        ++pos;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
xorl %eax, %eax
xorl %ecx, %ecx
cmpl -0x4(%rbp), %ecx
movb %al, -0x21(%rbp)
jg 0x3018c
cmpl $0x10ffff, -0x4(%rbp)   # imm = 0x10FFFF
setle %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x30195
jmp 0x30197
jmp 0x301b6
leaq 0x615b1(%rip), %rdi     # 0x9174f
leaq 0x5f4a4(%rip), %rsi     # 0x8f649
movl $0x18c6, %edx           # imm = 0x18C6
leaq 0x615ca(%rip), %rcx     # 0x9177b
callq 0xc290
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0xce90
movsbl (%rax), %eax
cmpl $0x5c, %eax
jne 0x301d0
jmp 0x301ef
leaq 0x61640(%rip), %rdi     # 0x91817
leaq 0x5f46b(%rip), %rsi     # 0x8f649
movl $0x18c9, %edx           # imm = 0x18C9
leaq 0x61591(%rip), %rcx     # 0x9177b
callq 0xc290
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb $0x75, (%rax)
cmpl $0x10000, -0x4(%rbp)    # imm = 0x10000
jge 0x302fc
movl -0x4(%rbp), %eax
sarl $0xc, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x63247(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x25(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x25(%rbp), %cl
movb %cl, (%rax)
movl -0x4(%rbp), %eax
sarl $0x8, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x6320e(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x24(%rbp), %cl
movb %cl, (%rax)
movl -0x4(%rbp), %eax
sarl $0x4, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x631d5(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x23(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x23(%rbp), %cl
movb %cl, (%rax)
movl -0x4(%rbp), %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x6319f(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x22(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x22(%rbp), %cl
movb %cl, (%rax)
jmp 0x30514
movl -0x4(%rbp), %eax
subl $0x10000, %eax          # imm = 0x10000
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
sarl $0xa, %eax
andl $0x3ff, %eax            # imm = 0x3FF
orl $0xd800, %eax           # imm = 0xD800
movl %eax, -0x1c(%rbp)
movl -0x4(%rbp), %eax
andl $0x3ff, %eax            # imm = 0x3FF
orl $0xdc00, %eax           # imm = 0xDC00
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
sarl $0xc, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x63133(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x2d(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x2d(%rbp), %cl
movb %cl, (%rax)
movl -0x1c(%rbp), %eax
sarl $0x8, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x630fa(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x2c(%rbp), %cl
movb %cl, (%rax)
movl -0x1c(%rbp), %eax
sarl $0x4, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x630c1(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x2b(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x2b(%rbp), %cl
movb %cl, (%rax)
movl -0x1c(%rbp), %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x6308b(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x2a(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x2a(%rbp), %cl
movb %cl, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb $0x75, (%rax)
movl -0x20(%rbp), %eax
sarl $0xc, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x6302a(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x29(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x29(%rbp), %cl
movb %cl, (%rax)
movl -0x20(%rbp), %eax
sarl $0x8, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x62ff1(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x28(%rbp), %cl
movb %cl, (%rax)
movl -0x20(%rbp), %eax
sarl $0x4, %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x62fb8(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x27(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x27(%rbp), %cl
movb %cl, (%rax)
movl -0x20(%rbp), %eax
andl $0xf, %eax
movslq %eax, %rsi
leaq 0x62f82(%rip), %rdi     # 0x93470
callq 0x30530
movb (%rax), %al
movb %al, -0x26(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x1, %rsi
movq %rsi, (%rax)
callq 0xce90
movb -0x26(%rbp), %cl
movb %cl, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)