// File: /workspace/github_c_makefile_star2_O0/lengjingzju[P]json/jnum.c
// Function: ldouble_convert_n
static inline int32_t ldouble_convert_n(diy_fp_t *v, char *buffer, int32_t *vnum_digits)
{
#define MIM_POW10_EXP      -325
#define MIM_POW10_DELTA    49
#define MIM_POW10_SPLIT    26
#define MIM_POW10_SHIFT    6
#define MIM_POW10_SMALL_M  0xc5a05278
#define MIM_POW10_LARGE_M  0xc5a05277621be294

    v->f = (v->f << MIM_POW10_SHIFT) + (1 << (MIM_POW10_SHIFT - 1));
    v->e = MIM_POW10_EXP;

    if (v->f <= (1 << MIM_POW10_SPLIT)) {
        v->f = v->f * MIM_POW10_SMALL_M >> 32;
    } else {
        v->f = u128_mul(v->f, MIM_POW10_LARGE_M).hi;
    }

    uint64_t orig = v->f;
    uint64_t remainder;
    v->f = orig / 100;
    remainder = orig - v->f * 100;

    if (v->f == 0) {
        v->e += 1;
        remainder = ch_100_lut[remainder << 1] - '0';
    } else {
        if (remainder <= MIM_POW10_DELTA) {
            v->e += 2;
            remainder = 0;
        } else {
            v->e += 1;
            remainder = ch_100_lut[remainder << 1] - '0';
        }
    }

    int32_t num_digits = 0, trailing_zeros = 0;
    if (v->f) {
        num_digits = fill_1_16_digits(buffer, v->f, &trailing_zeros);
    }
    if (remainder) {
        buffer[num_digits++] = (char)(remainder + '0');
        trailing_zeros = 0;
    }
    *vnum_digits = num_digits - trailing_zeros;
    return num_digits;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq 0x40(%rsp), %rax
movq (%rax), %rcx
shlq $0x6, %rcx
addq $0x20, %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movl $0xfffffebb, 0x8(%rax)  # imm = 0xFFFFFEBB
movq 0x40(%rsp), %rax
cmpq $0x4000000, (%rax)      # imm = 0x4000000
ja 0xd2d6
movq 0x40(%rsp), %rax
movabsq $0xc5a05278, %rcx       # imm = 0xC5A05278
imulq (%rax), %rcx
shrq $0x20, %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
jmp 0xd304
movq 0x40(%rsp), %rax
movq (%rax), %rdi
movabsq $-0x3a5fad889de41d6c, %rsi # imm = 0xC5A05277621BE294
callq 0xefb0
movq %rax, 0x20(%rsp)
movq %rdx, 0x28(%rsp)
movq 0x20(%rsp), %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x40(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rax
movl $0x64, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x18(%rsp), %rax
movq 0x40(%rsp), %rcx
imulq $0x64, (%rcx), %rcx
subq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rax
cmpq $0x0, (%rax)
jne 0xd379
movq 0x40(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rsp), %rcx
shlq %rcx
leaq 0x3d07(%rip), %rax      # 0x11070
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
cltq
movq %rax, 0x10(%rsp)
jmp 0xd3c7
cmpq $0x31, 0x10(%rsp)
ja 0xd39a
movq 0x40(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0x8(%rax)
movq $0x0, 0x10(%rsp)
jmp 0xd3c5
movq 0x40(%rsp), %rax
movl 0x8(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x8(%rax)
movq 0x10(%rsp), %rcx
shlq %rcx
leaq 0x3cb9(%rip), %rax      # 0x11070
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
cltq
movq %rax, 0x10(%rsp)
jmp 0xd3c7
movl $0x0, 0xc(%rsp)
movl $0x0, 0x8(%rsp)
movq 0x40(%rsp), %rax
cmpq $0x0, (%rax)
je 0xd3fd
movq 0x38(%rsp), %rdi
movq 0x40(%rsp), %rax
movq (%rax), %rsi
leaq 0x8(%rsp), %rdx
callq 0xd450
movl %eax, 0xc(%rsp)
cmpq $0x0, 0x10(%rsp)
je 0xd430
movq 0x10(%rsp), %rax
addq $0x30, %rax
movb %al, %dl
movq 0x38(%rsp), %rax
movl 0xc(%rsp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0xc(%rsp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
movl $0x0, 0x8(%rsp)
movl 0xc(%rsp), %ecx
subl 0x8(%rsp), %ecx
movq 0x30(%rsp), %rax
movl %ecx, (%rax)
movl 0xc(%rsp), %eax
addq $0x48, %rsp
retq
nopl (%rax,%rax)