// File: /workspace/github_c_makefile_star2_O0/lengjingzju[P]json/grisu2.c
// Function: digit_gen
static inline void digit_gen(diy_fp_t Wv, diy_fp_t Wp, uint64_t delta, char* buffer, int* len, int* K)
{
    static const uint32_t divs[] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000};
    uint32_t p1;
    uint64_t p2, p3;
    int d, kappa;
    diy_fp_t one, W_pv;

    one.f = ((uint64_t)1) << -Wp.e;
    one.e = Wp.e;

    W_pv.f = Wp.f - Wv.f;
    W_pv.e = Wp.e;

    p1 = (uint32_t)(Wp.f >> -one.e); /* Mp_cut */
    p2 = Wp.f & (one.f - 1);

    /* count decimal digit 32bit */
    if (p1 >= 100000) {
        if      (p1 < 1000000)    kappa = 6;
        else if (p1 < 10000000)   kappa = 7;
        else if (p1 < 100000000)  kappa = 8;
        else if (p1 < 1000000000) kappa = 9;
        else                      kappa = 10;
    } else {
        if      (p1 >= 10000)     kappa = 5;
        else if (p1 >= 1000)      kappa = 4;
        else if (p1 >= 100)       kappa = 3;
        else if (p1 >= 10)        kappa = 2;
        else                      kappa = 1;
    }

    *len = 0;
    while (kappa > 0) {
        switch (kappa) {
        case 10: d = p1 / 1000000000      ; p1 -= d * 1000000000      ; break;
        case  9: d = p1 /  100000000      ; p1 -= d *  100000000      ; break;
        case  8: d = p1 /   10000000      ; p1 -= d *   10000000      ; break;
        case  7: d = p1 /    1000000      ; p1 -= d *    1000000      ; break;
        case  6: d = p1 /     100000      ; p1 -= d *     100000      ; break;
        case  5: d = p1 /      10000      ; p1 -= d *      10000      ; break;
        case  4: d = p1 /       1000      ; p1 -= d *       1000      ; break;
        case  3: d = get_100_quotient(p1) ; p1 -= get_100_multiple(d) ; break;
        case  2: d = get_10_quotient(p1)  ; p1 -= get_10_multiple(d)  ; break;
        case  1: d = p1                   ; p1  =              0      ; break;
        default:
#if defined(_MSC_VER)
            __assume(0);
#elif __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
            __builtin_unreachable();
#else
            d = 0;
#endif
            break;
        }

        buffer[(*len)++] = '0' + d; /* Mp_inv1 */
        --kappa;
        p3 = (((uint64_t)p1) << -one.e) + p2;
        if (p3 <= delta) { /* Mp_delta */
            *K += kappa;
            grisu_round(buffer, *len, delta, p3, ((uint64_t)divs[kappa]) << -one.e, W_pv.f);
            return;
        }
    }

    while (1) {
        p2 = (p2 << 1) + (p2 << 3);
        delta = (delta << 1) + (delta << 3);
        d = (int)(p2 >> -one.e);

        buffer[(*len)++] = '0' + d;
        --kappa;
        p2 &= one.f - 1;
        if (p2 < delta) {
            *K += kappa;
            grisu_round(buffer, *len, delta, p2, one.f, W_pv.f * divs[-kappa]);
            return;
        }
    }
}

// Assembly:
subq $0x88, %rsp
movq 0x98(%rsp), %rax
movq 0x90(%rsp), %rax
movq %rdi, 0x78(%rsp)
movl %esi, 0x80(%rsp)
movq %rdx, 0x68(%rsp)
movl %ecx, 0x70(%rsp)
movq %r8, 0x60(%rsp)
movq %r9, 0x58(%rsp)
xorl %eax, %eax
subl 0x70(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, 0x28(%rsp)
movl 0x70(%rsp), %eax
movl %eax, 0x30(%rsp)
movq 0x68(%rsp), %rax
subq 0x78(%rsp), %rax
movq %rax, 0x18(%rsp)
movl 0x70(%rsp), %eax
movl %eax, 0x20(%rsp)
movq 0x68(%rsp), %rax
xorl %ecx, %ecx
subl 0x30(%rsp), %ecx
movl %ecx, %ecx
shrq %cl, %rax
movl %eax, 0x54(%rsp)
movq 0x68(%rsp), %rax
movq 0x28(%rsp), %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq %rax, 0x48(%rsp)
cmpl $0x186a0, 0x54(%rsp)    # imm = 0x186A0
jb 0x49a0
cmpl $0xf4240, 0x54(%rsp)    # imm = 0xF4240
jae 0x4954
movl $0x6, 0x38(%rsp)
jmp 0x499e
cmpl $0x989680, 0x54(%rsp)   # imm = 0x989680
jae 0x4968
movl $0x7, 0x38(%rsp)
jmp 0x499c
cmpl $0x5f5e100, 0x54(%rsp)  # imm = 0x5F5E100
jae 0x497c
movl $0x8, 0x38(%rsp)
jmp 0x499a
cmpl $0x3b9aca00, 0x54(%rsp) # imm = 0x3B9ACA00
jae 0x4990
movl $0x9, 0x38(%rsp)
jmp 0x4998
movl $0xa, 0x38(%rsp)
jmp 0x499a
jmp 0x499c
jmp 0x499e
jmp 0x49fa
cmpl $0x2710, 0x54(%rsp)     # imm = 0x2710
jb 0x49b4
movl $0x5, 0x38(%rsp)
jmp 0x49f8
cmpl $0x3e8, 0x54(%rsp)      # imm = 0x3E8
jb 0x49c8
movl $0x4, 0x38(%rsp)
jmp 0x49f6
cmpl $0x64, 0x54(%rsp)
jb 0x49d9
movl $0x3, 0x38(%rsp)
jmp 0x49f4
cmpl $0xa, 0x54(%rsp)
jb 0x49ea
movl $0x2, 0x38(%rsp)
jmp 0x49f2
movl $0x1, 0x38(%rsp)
jmp 0x49f4
jmp 0x49f6
jmp 0x49f8
jmp 0x49fa
movq 0x90(%rsp), %rax
movl $0x0, (%rax)
cmpl $0x0, 0x38(%rsp)
jle 0x4c9e
movl 0x38(%rsp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, 0x10(%rsp)
subl $0x9, %eax
ja 0x4bdb
movq 0x10(%rsp), %rax
leaq 0x5477(%rip), %rcx      # 0x9eac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0x54(%rsp), %eax
movl $0x3b9aca00, %ecx       # imm = 0x3B9ACA00
xorl %edx, %edx
divl %ecx
movl %eax, 0x3c(%rsp)
imull $0x3b9aca00, 0x3c(%rsp), %ecx # imm = 0x3B9ACA00
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
movl $0x5f5e100, %ecx        # imm = 0x5F5E100
xorl %edx, %edx
divl %ecx
movl %eax, 0x3c(%rsp)
imull $0x5f5e100, 0x3c(%rsp), %ecx # imm = 0x5F5E100
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
movl $0x989680, %ecx         # imm = 0x989680
xorl %edx, %edx
divl %ecx
movl %eax, 0x3c(%rsp)
imull $0x989680, 0x3c(%rsp), %ecx # imm = 0x989680
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
movl $0xf4240, %ecx          # imm = 0xF4240
xorl %edx, %edx
divl %ecx
movl %eax, 0x3c(%rsp)
imull $0xf4240, 0x3c(%rsp), %ecx # imm = 0xF4240
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
movl $0x186a0, %ecx          # imm = 0x186A0
xorl %edx, %edx
divl %ecx
movl %eax, 0x3c(%rsp)
imull $0x186a0, 0x3c(%rsp), %ecx # imm = 0x186A0
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
movl $0x2710, %ecx           # imm = 0x2710
xorl %edx, %edx
divl %ecx
movl %eax, 0x3c(%rsp)
imull $0x2710, 0x3c(%rsp), %ecx # imm = 0x2710
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
movl $0x3e8, %ecx            # imm = 0x3E8
xorl %edx, %edx
divl %ecx
movl %eax, 0x3c(%rsp)
imull $0x3e8, 0x3c(%rsp), %ecx # imm = 0x3E8
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
shrl $0x2, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x5f58(%rip), %rax      # 0xaac0
movzbl (%rax,%rcx), %eax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %ecx
shll $0x2, %ecx
movl 0x3c(%rsp), %eax
shll $0x5, %eax
addl %eax, %ecx
movl 0x3c(%rsp), %eax
shll $0x6, %eax
addl %eax, %ecx
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
shrl %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x601a(%rip), %rax      # 0xabc0
movzbl (%rax,%rcx), %eax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %ecx
shll %ecx
movl 0x3c(%rsp), %eax
shll $0x3, %eax
addl %eax, %ecx
movl 0x54(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x54(%rsp)
jmp 0x4be3
movl 0x54(%rsp), %eax
movl %eax, 0x3c(%rsp)
movl $0x0, 0x54(%rsp)
jmp 0x4be3
movl $0x0, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
addl $0x30, %eax
movb %al, %dl
movq 0x58(%rsp), %rax
movq 0x90(%rsp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl 0x38(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x38(%rsp)
movl 0x54(%rsp), %eax
xorl %ecx, %ecx
subl 0x30(%rsp), %ecx
movl %ecx, %ecx
shlq %cl, %rax
addq 0x48(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
cmpq 0x60(%rsp), %rax
ja 0x4c99
movl 0x38(%rsp), %ecx
movq 0x98(%rsp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq 0x58(%rsp), %rdi
movq 0x90(%rsp), %rax
movl (%rax), %esi
movq 0x60(%rsp), %rdx
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movslq 0x38(%rsp), %rcx
leaq 0x5e1e(%rip), %rax      # 0xaa90
movl (%rax,%rcx,4), %eax
movl %eax, %r8d
xorl %eax, %eax
subl 0x30(%rsp), %eax
movl %eax, %eax
movl %eax, %ecx
shlq %cl, %r8
movq 0x8(%rsp), %rcx
movq 0x18(%rsp), %r9
callq 0x4da0
jmp 0x4d8c
jmp 0x4a08
jmp 0x4ca0
movq 0x48(%rsp), %rax
shlq %rax
movq 0x48(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x48(%rsp)
movq 0x60(%rsp), %rax
shlq %rax
movq 0x60(%rsp), %rcx
shlq $0x3, %rcx
addq %rcx, %rax
movq %rax, 0x60(%rsp)
movq 0x48(%rsp), %rax
xorl %ecx, %ecx
subl 0x30(%rsp), %ecx
movl %ecx, %ecx
shrq %cl, %rax
movl %eax, 0x3c(%rsp)
movl 0x3c(%rsp), %eax
addl $0x30, %eax
movb %al, %dl
movq 0x58(%rsp), %rax
movq 0x90(%rsp), %rsi
movl (%rsi), %ecx
movl %ecx, %edi
addl $0x1, %edi
movl %edi, (%rsi)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl 0x38(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x38(%rsp)
movq 0x28(%rsp), %rax
subq $0x1, %rax
andq 0x48(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
cmpq 0x60(%rsp), %rax
jae 0x4d87
movl 0x38(%rsp), %ecx
movq 0x98(%rsp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movq 0x58(%rsp), %rdi
movq 0x90(%rsp), %rax
movl (%rax), %esi
movq 0x60(%rsp), %rdx
movq 0x48(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x18(%rsp), %r9
xorl %eax, %eax
subl 0x38(%rsp), %eax
movslq %eax, %r10
leaq 0x5d18(%rip), %rax      # 0xaa90
movl (%rax,%r10,4), %eax
imulq %rax, %r9
callq 0x4da0
jmp 0x4d8c
jmp 0x4ca0
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)
nop