// File: /workspace/github_cpp_makefile_star2_O2/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/internal/dtoa.h
// Function: rapidjson::internal::DigitGen(rapidjson::internal::DiyFp const&, rapidjson::internal::DiyFp const&, unsigned long, char*, int*, int*)
inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) {
    static const uint32_t kPow10[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000 };
    const DiyFp one(uint64_t(1) << -Mp.e, Mp.e);
    const DiyFp wp_w = Mp - W;
    uint32_t p1 = static_cast<uint32_t>(Mp.f >> -one.e);
    uint64_t p2 = Mp.f & (one.f - 1);
    int kappa = CountDecimalDigit32(p1); // kappa in [0, 9]
    *len = 0;

    while (kappa > 0) {
        uint32_t d = 0;
        switch (kappa) {
            case  9: d = p1 /  100000000; p1 %=  100000000; break;
            case  8: d = p1 /   10000000; p1 %=   10000000; break;
            case  7: d = p1 /    1000000; p1 %=    1000000; break;
            case  6: d = p1 /     100000; p1 %=     100000; break;
            case  5: d = p1 /      10000; p1 %=      10000; break;
            case  4: d = p1 /       1000; p1 %=       1000; break;
            case  3: d = p1 /        100; p1 %=        100; break;
            case  2: d = p1 /         10; p1 %=         10; break;
            case  1: d = p1;              p1 =           0; break;
            default:;
        }
        if (d || *len)
            buffer[(*len)++] = static_cast<char>('0' + static_cast<char>(d));
        kappa--;
        uint64_t tmp = (static_cast<uint64_t>(p1) << -one.e) + p2;
        if (tmp <= delta) {
            *K += kappa;
            GrisuRound(buffer, *len, delta, tmp, static_cast<uint64_t>(kPow10[kappa]) << -one.e, wp_w.f);
            return;
        }
    }

    // kappa = 0
    for (;;) {
        p2 *= 10;
        delta *= 10;
        char d = static_cast<char>(p2 >> -one.e);
        if (d || *len)
            buffer[(*len)++] = static_cast<char>('0' + d);
        p2 &= one.f - 1;
        kappa--;
        if (p2 < delta) {
            *K += kappa;
            int index = -kappa;
            GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 9 ? kPow10[index] : 0));
            return;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, -0x38(%rbp)
movq %r8, %r13
movq %rcx, -0x30(%rbp)
xorl %r12d, %r12d
subl 0x8(%rsi), %r12d
pushq $0x1
popq %r8
movl %r12d, %ecx
shlq %cl, %r8
movq (%rsi), %rbx
movq %rbx, %rax
subq (%rdi), %rax
movq %rax, -0x40(%rbp)
movq %rdx, %r15
movq %r8, -0x50(%rbp)
leaq -0x1(%r8), %r14
movq %r14, -0x48(%rbp)
andq %rbx, %r14
shrq %cl, %rbx
movl %ebx, %edi
callq 0x94a0
movl %eax, %esi
andl $0x0, (%r13)
movl %eax, %edi
sarl $0x1f, %edi
andl %eax, %edi
leaq 0x3a22(%rip), %r8       # 0x11078
movl $0xf4240, %r11d         # imm = 0xF4240
movl $0x989680, %r9d         # imm = 0x989680
movl $0x5f5e100, %r10d       # imm = 0x5F5E100
testl %esi, %esi
jle 0xd748
decl %esi
cmpl $0x8, %esi
ja 0xd6e6
movslq (%r8,%rsi,4), %rax
addq %r8, %rax
jmpq *%rax
xorl %edx, %edx
jmp 0xd6c1
movl %ebx, %eax
xorl %edx, %edx
movl $0x2710, %ecx           # imm = 0x2710
jmp 0xd6bd
movl %ebx, %eax
xorl %edx, %edx
pushq $0x64
jmp 0xd6b1
movl %ebx, %eax
xorl %edx, %edx
movl $0x3e8, %ecx            # imm = 0x3E8
jmp 0xd6bd
movl %ebx, %eax
xorl %edx, %edx
divl %r9d
jmp 0xd6bf
movl %ebx, %eax
xorl %edx, %edx
pushq $0xa
popq %rcx
jmp 0xd6bd
movl %ebx, %eax
xorl %edx, %edx
movl $0x186a0, %ecx          # imm = 0x186A0
divl %ecx
movl %eax, %ebx
movl (%r13), %eax
testl %ebx, %ebx
je 0xd6d0
addb $0x30, %bl
movl %ebx, %ecx
jmp 0xd6f2
movl %edx, %ebx
jmp 0xd6ec
movl %ebx, %eax
xorl %edx, %edx
divl %r11d
jmp 0xd6bf
movl %ebx, %eax
xorl %edx, %edx
divl %r10d
jmp 0xd6bf
movl (%r13), %eax
movl %ebx, %edx
movb $0x30, %cl
testl %eax, %eax
je 0xd704
leal 0x1(%rax), %ebx
movl %ebx, (%r13)
cltq
movq -0x30(%rbp), %rbx
movb %cl, (%rbx,%rax)
movl %edx, %ebx
movl %ebx, %eax
movl %r12d, %ecx
shlq %cl, %rax
addq %r14, %rax
cmpq %r15, %rax
ja 0xd668
movq -0x38(%rbp), %rcx
addl %esi, (%rcx)
movl %esi, %ecx
movq 0xb861(%rip), %rdx      # 0x18f88
movl (%rdx,%rcx,4), %r8d
movl %r12d, %ecx
shlq %cl, %r8
movl (%r13), %esi
movq -0x30(%rbp), %rdi
movq %r15, %rdx
movq %rax, %rcx
movq -0x40(%rbp), %r9
jmp 0xd7c8
negl %edi
movq -0x48(%rbp), %r8
imulq $0xa, %r14, %r14
movq %r14, %rax
movl %r12d, %ecx
shrq %cl, %rax
testb %al, %al
sete %dl
movl (%r13), %ecx
testl %ecx, %ecx
sete %sil
testb %sil, %dl
jne 0xd781
movslq %ecx, %rdx
addb $0x30, %al
incl %ecx
movl %ecx, (%r13)
movq -0x30(%rbp), %rcx
movb %al, (%rcx,%rdx)
imulq $0xa, %r15, %r15
andq %r8, %r14
incl %edi
cmpq %r15, %r14
jae 0xd74e
movq -0x38(%rbp), %rax
subl %edi, (%rax)
movl (%r13), %esi
pushq $0x1
popq %rax
subl %edi, %eax
cmpl $-0x7, %eax
jl 0xd7b2
movl %edi, %eax
movq 0xb7dc(%rip), %rcx      # 0x18f88
movl (%rcx,%rax,4), %r9d
jmp 0xd7b5
xorl %r9d, %r9d
imulq -0x40(%rbp), %r9
movq -0x30(%rbp), %rdi
movq %r15, %rdx
movq %r14, %rcx
movq -0x50(%rbp), %r8
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9710
nop