// File: /workspace/github_cpp_makefile_star2_O1/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/internal/dtoa.h
// Function: rapidjson::internal::Prettify(char*, int, int, int)
inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) {
    const int kk = length + k;  // 10^(kk-1) <= v < 10^kk

    if (0 <= k && kk <= 21) {
        // 1234e7 -> 12340000000
        for (int i = length; i < kk; i++)
            buffer[i] = '0';
        buffer[kk] = '.';
        buffer[kk + 1] = '0';
        return &buffer[kk + 2];
    }
    else if (0 < kk && kk <= 21) {
        // 1234e-2 -> 12.34
        std::memmove(&buffer[kk + 1], &buffer[kk], static_cast<size_t>(length - kk));
        buffer[kk] = '.';
        if (0 > k + maxDecimalPlaces) {
            // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1
            // Remove extra trailing zeros (at least one) after truncation.
            for (int i = kk + maxDecimalPlaces; i > kk + 1; i--)
                if (buffer[i] != '0')
                    return &buffer[i + 1];
            return &buffer[kk + 2]; // Reserve one zero
        }
        else
            return &buffer[length + 1];
    }
    else if (-6 < kk && kk <= 0) {
        // 1234e-6 -> 0.001234
        const int offset = 2 - kk;
        std::memmove(&buffer[offset], &buffer[0], static_cast<size_t>(length));
        buffer[0] = '0';
        buffer[1] = '.';
        for (int i = 2; i < offset; i++)
            buffer[i] = '0';
        if (length - kk > maxDecimalPlaces) {
            // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1
            // Remove extra trailing zeros (at least one) after truncation.
            for (int i = maxDecimalPlaces + 1; i > 2; i--)
                if (buffer[i] != '0')
                    return &buffer[i + 1];
            return &buffer[3]; // Reserve one zero
        }
        else
            return &buffer[length + offset];
    }
    else if (kk < -maxDecimalPlaces) {
        // Truncate to zero
        buffer[0] = '0';
        buffer[1] = '.';
        buffer[2] = '0';
        return &buffer[3];
    }
    else if (length == 1) {
        // 1e30
        buffer[1] = 'e';
        return WriteExponent(kk - 1, &buffer[2]);
    }
    else {
        // 1234e30 -> 1.234e33
        std::memmove(&buffer[2], &buffer[1], static_cast<size_t>(length - 1));
        buffer[1] = '.';
        buffer[length + 1] = 'e';
        return WriteExponent(kk - 1, &buffer[0 + length + 2]);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r15d
movl %edx, %r13d
movl %esi, %r14d
movq %rdi, %rsi
leal (%r14,%r13), %ebx
testl %edx, %edx
sets %al
cmpl $0x16, %ebx
setge %cl
orb %al, %cl
jne 0xc2ef
testl %r13d, %r13d
jle 0xc2d7
movslq %r14d, %rdi
addq %rsi, %rdi
leal 0x1(%r14), %eax
cmpl %eax, %ebx
cmovgl %ebx, %eax
notl %r14d
addl %eax, %r14d
incq %r14
movq %rsi, %r15
movl $0x30, %esi
movq %r14, %rdx
callq 0x7240
movq %r15, %rsi
movslq %ebx, %rax
leaq (%rsi,%rax), %r12
addq $0x2, %r12
movw $0x302e, -0x2(%r12)     # imm = 0x302E
jmp 0xc4bc
leal -0x1(%rbx), %r12d
cmpl $0x14, %r12d
ja 0xc346
movl %ebx, %eax
leaq (%rsi,%rax), %rdi
incq %rdi
movq %rdi, -0x40(%rbp)
movq %rax, -0x38(%rbp)
leaq (%rsi,%rax), %r12
movl %r13d, %eax
negl %eax
movslq %eax, %rdx
movq %rsi, -0x30(%rbp)
movq %r12, %rsi
callq 0x7760
movq -0x40(%rbp), %rax
movb $0x2e, -0x1(%rax)
addl %r15d, %r13d
js 0xc3d1
movslq %r14d, %rax
movq -0x30(%rbp), %rcx
leaq (%rcx,%rax), %r12
incq %r12
jmp 0xc4bc
leal 0x5(%rbx), %eax
cmpl $0x5, %eax
ja 0xc3b4
movl $0x2, %r12d
subl %ebx, %r12d
leaq (%rsi,%r12), %rdi
movslq %r14d, %rdx
movq %rsi, -0x30(%rbp)
movq -0x30(%rbp), %rsi
callq 0x7760
movq -0x30(%rbp), %rdx
movw $0x2e30, (%rdx)         # imm = 0x2E30
testl %ebx, %ebx
jns 0xc39a
leaq 0x2(%rdx), %rdi
cmpl $0x4, %r12d
movl $0x3, %edx
cmovgel %r12d, %edx
addl $-0x2, %edx
movl $0x30, %esi
callq 0x7240
movq -0x30(%rbp), %rdx
negl %r13d
cmpl %r15d, %r13d
jle 0xc40c
cmpl $0x2, %r15d
setl %al
jge 0xc442
jmp 0xc4af
negl %r15d
cmpl %r15d, %ebx
jge 0xc41a
movw $0x2e30, (%rsi)         # imm = 0x2E30
movb $0x30, 0x2(%rsi)
addq $0x3, %rsi
movq %rsi, %r12
jmp 0xc4bc
movq -0x38(%rbp), %rdx
movq -0x30(%rbp), %rsi
cmpl $0x2, %r15d
setge %al
jl 0xc436
movl %r15d, %ecx
addq %rdx, %rcx
cmpb $0x30, (%rsi,%rcx)
jne 0xc401
incl %ebx
decl %ecx
cmpl %ebx, %ecx
setg %al
jle 0xc436
movl %ecx, %edx
cmpb $0x30, (%rsi,%rdx)
je 0xc3f0
movslq %ecx, %rcx
addq %rsi, %rcx
incq %rcx
jmp 0xc436
addl %r14d, %r12d
movslq %r12d, %rax
addq %rax, %rdx
jmp 0xc4b9
cmpl $0x1, %r14d
jne 0xc46a
movb $0x65, 0x1(%rsi)
testl %r12d, %r12d
js 0xc4ce
addq $0x2, %rsi
jmp 0xc4df
addq $0x2, %r12
testb %al, %al
cmovneq %rcx, %r12
jmp 0xc4bc
movl %r15d, %ecx
cmpb $0x30, 0x1(%rdx,%rcx)
jne 0xc4a6
leal 0x1(%r15), %eax
cmpl $0x4, %eax
setl %al
jl 0xc3af
movl %r15d, %ecx
decl %r15d
cmpb $0x30, (%rdx,%rcx)
je 0xc44c
jmp 0xc4a9
leaq 0x2(%rsi), %rdi
movq %rsi, %r15
incq %rsi
leal -0x1(%r14), %eax
movslq %eax, %rdx
callq 0x7760
movq %r15, %rdx
movb $0x2e, 0x1(%r15)
movslq %r14d, %rax
movb $0x65, 0x1(%r15,%rax)
testl %r12d, %r12d
js 0xc537
addq %rax, %rdx
addq $0x2, %rdx
jmp 0xc54b
incq %rcx
addq %rdx, %rcx
incq %rcx
addq $0x3, %rdx
testb %al, %al
cmoveq %rcx, %rdx
movq %rdx, %r12
movq %r12, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb $0x2d, 0x2(%rsi)
addq $0x3, %rsi
movl $0x1, %r12d
subl %ebx, %r12d
cmpl $0x64, %r12d
jl 0xc513
movl %r12d, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
leal 0x30(%rax), %ecx
movb %cl, (%rsi)
imull $0x64, %eax, %eax
subl %eax, %r12d
movq 0xba5b(%rip), %rax      # 0x17f60
movzwl (%rax,%r12,2), %eax
movw %ax, 0x1(%rsi)
jmp 0xc3c5
cmpl $0xa, %r12d
jl 0xc5a3
movl %r12d, %eax
movq 0xba39(%rip), %rcx      # 0x17f60
movzwl (%rcx,%rax,2), %eax
movw %ax, (%rsi)
addq $0x2, %rsi
jmp 0xc3c9
addq %rax, %rdx
movb $0x2d, 0x2(%rdx)
addq $0x3, %rdx
movl $0x1, %r12d
subl %ebx, %r12d
cmpl $0x64, %r12d
jl 0xc583
movl %r12d, %eax
imulq $0x51eb851f, %rax, %rax # imm = 0x51EB851F
shrq $0x25, %rax
leal 0x30(%rax), %ecx
movb %cl, (%rdx)
imull $0x64, %eax, %eax
subl %eax, %r12d
movq 0xb9ef(%rip), %rax      # 0x17f60
movzwl (%rax,%r12,2), %eax
movw %ax, 0x1(%rdx)
addq $0x3, %rdx
jmp 0xc4b9
cmpl $0xa, %r12d
jl 0xc5b2
movl %r12d, %eax
movq 0xb9cd(%rip), %rcx      # 0x17f60
movzwl (%rcx,%rax,2), %eax
movw %ax, (%rdx)
addq $0x2, %rdx
jmp 0xc4b9
addb $0x30, %r12b
movb %r12b, (%rsi)
incq %rsi
jmp 0xc3c9
addb $0x30, %r12b
movb %r12b, (%rdx)
incq %rdx
jmp 0xc4b9
nop