// File: cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/writer.h
// Function: rapidjson::Writer<rapidjson::GenericStringBuffer<rapidjson::UTF8<char>, rapidjson::CrtAllocator>, rapidjson::UTF8<char>, rapidjson::UTF8<char>, rapidjson::CrtAllocator, 0u>::WriteString(char const*, unsigned int)
bool WriteString(const Ch* str, SizeType length)  {
        static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
        static const char escape[256] = {
#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
            //0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F
            'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00
            'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10
              0,   0, '"',   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, // 20
            Z16, Z16,                                                                       // 30~4F
              0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,'\\',   0,   0,   0, // 50
            Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16                                // 60~FF
#undef Z16
        };

        if (TargetEncoding::supportUnicode)
            PutReserve(*os_, 2 + length * 6); // "\uxxxx..."
        else
            PutReserve(*os_, 2 + length * 12);  // "\uxxxx\uyyyy..."

        PutUnsafe(*os_, '\"');
        GenericStringStream<SourceEncoding> is(str);
        while (ScanWriteUnescapedString(is, length)) {
            const Ch c = is.Peek();
            if (!TargetEncoding::supportUnicode && static_cast<unsigned>(c) >= 0x80) {
                // Unicode escaping
                unsigned codepoint;
                if (RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint)))
                    return false;
                PutUnsafe(*os_, '\\');
                PutUnsafe(*os_, 'u');
                if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) {
                    PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]);
                    PutUnsafe(*os_, hexDigits[(codepoint >>  8) & 15]);
                    PutUnsafe(*os_, hexDigits[(codepoint >>  4) & 15]);
                    PutUnsafe(*os_, hexDigits[(codepoint      ) & 15]);
                }
                else {
                    RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF);
                    // Surrogate pair
                    unsigned s = codepoint - 0x010000;
                    unsigned lead = (s >> 10) + 0xD800;
                    unsigned trail = (s & 0x3FF) + 0xDC00;
                    PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]);
                    PutUnsafe(*os_, hexDigits[(lead >>  8) & 15]);
                    PutUnsafe(*os_, hexDigits[(lead >>  4) & 15]);
                    PutUnsafe(*os_, hexDigits[(lead      ) & 15]);
                    PutUnsafe(*os_, '\\');
                    PutUnsafe(*os_, 'u');
                    PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]);
                    PutUnsafe(*os_, hexDigits[(trail >>  8) & 15]);
                    PutUnsafe(*os_, hexDigits[(trail >>  4) & 15]);
                    PutUnsafe(*os_, hexDigits[(trail      ) & 15]);                    
                }
            }
            else if ((sizeof(Ch) == 1 || static_cast<unsigned>(c) < 256) && RAPIDJSON_UNLIKELY(escape[static_cast<unsigned char>(c)]))  {
                is.Take();
                PutUnsafe(*os_, '\\');
                PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(escape[static_cast<unsigned char>(c)]));
                if (escape[static_cast<unsigned char>(c)] == 'u') {
                    PutUnsafe(*os_, '0');
                    PutUnsafe(*os_, '0');
                    PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) >> 4]);
                    PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) & 0xF]);
                }
            }
            else if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ? 
                Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) :
                Transcoder<SourceEncoding, TargetEncoding>::TranscodeUnsafe(is, *os_))))
                return false;
        }
        PutUnsafe(*os_, '\"');
        return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq (%rax), %rdi
imull $0x6, -0x1c(%rbp), %eax
addl $0x2, %eax
movl %eax, %eax
movl %eax, %esi
callq 0xe0e0
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl $0x22, %esi
callq 0xf550
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xeb90
movq -0x40(%rbp), %rdi
movl -0x1c(%rbp), %eax
movl %eax, %edx
leaq -0x30(%rbp), %rsi
callq 0xedb0
testb $0x1, %al
jne 0x158f7
jmp 0x15a00
leaq -0x30(%rbp), %rdi
callq 0xebe0
movb %al, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
movl %eax, %ecx
movq 0x11660(%rip), %rax     # 0x26f70
cmpb $0x0, (%rax,%rcx)
setne %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x15924
jmp 0x159d7
leaq -0x30(%rbp), %rdi
callq 0xee40
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl $0x5c, %esi
callq 0xf550
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movzbl -0x31(%rbp), %eax
movl %eax, %ecx
movq 0x1161e(%rip), %rax     # 0x26f70
movsbl (%rax,%rcx), %esi
callq 0xf550
movzbl -0x31(%rbp), %eax
movl %eax, %ecx
movq 0x11608(%rip), %rax     # 0x26f70
movsbl (%rax,%rcx), %eax
cmpl $0x75, %eax
jne 0x159d5
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl $0x30, %esi
callq 0xf550
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl $0x30, %esi
callq 0xf550
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movzbl -0x31(%rbp), %eax
sarl $0x4, %eax
movslq %eax, %rcx
movq 0x1160d(%rip), %rax     # 0x26fb8
movsbl (%rax,%rcx), %esi
callq 0xf550
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movzbl -0x31(%rbp), %eax
andl $0xf, %eax
movslq %eax, %rcx
movq 0x115ec(%rip), %rax     # 0x26fb8
movsbl (%rax,%rcx), %esi
callq 0xf550
jmp 0x159fb
movq -0x40(%rbp), %rax
movq (%rax), %rsi
leaq -0x30(%rbp), %rdi
callq 0xf290
xorb $-0x1, %al
xorb $-0x1, %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x159f3
jmp 0x159f9
movb $0x0, -0x1(%rbp)
jmp 0x15a15
jmp 0x159fb
jmp 0x158dc
movq -0x40(%rbp), %rax
movq (%rax), %rdi
movl $0x22, %esi
callq 0xf550
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq