// File: /workspace/github_c_makefile_star2_O1/lengjingzju[P]json/dragonbox.c
// Function: dragonbox_dtoa
int dragonbox_dtoa(double num, char *buffer)
{
    diy_fp_t v;
    char *s = buffer;
    union {double d; uint64_t n;} u = {.d = num};
    int32_t signbit = u.n >> (DIY_SIGNIFICAND_SIZE - 1);
    int32_t exponent = (u.n & DP_EXPONENT_MASK) >> DP_SIGNIFICAND_SIZE; /* Exponent */
    uint64_t significand = u.n & DP_SIGNIFICAND_MASK; /* Mantissa */

    if (signbit) {
        *s++ = '-';
    }

    switch (exponent) {
    case DP_EXPONENT_MAX:
        if (significand) {
            memcpy(buffer, "nan", 4);
            return 3;
        } else {
            memcpy(s, "inf", 4);
            return signbit + 3;
        }
        break;

    case 0:
        if (significand) {
            /* no-normalized double */
            v.f = significand; /* Non-normalized double doesn't have a extra integer bit for Mantissa */
            v.e = 1 - DP_EXPONENT_OFFSET - DP_SIGNIFICAND_SIZE; /* Fixed Exponent: -1022, divisor of Mantissa: pow(2,52) */
            dragonbox_convert(&v);
        } else {
            memcpy(s, "0.0", 4);
            return signbit + 3;
        }
        break;

    default:
        /* normalized double */
        v.f = significand + DP_HIDDEN_BIT; /* Normalized double has a extra integer bit for Mantissa */
        v.e = exponent - DP_EXPONENT_OFFSET - DP_SIGNIFICAND_SIZE; /* Exponent offset: -1023, divisor of Mantissa: pow(2,52) */

        if (0 <= -v.e && -v.e <= DP_SIGNIFICAND_SIZE && ((v.f & (((uint64_t)1 << -v.e) - 1)) == 0)) {
            /* small integer. */
            v.f >>= -v.e;
            v.e = 0;
        } else if (significand == 0 && exponent > 1) {
            /* Shorter interval case; proceed like Schubfach. */
            dragonbox_convert_asymmetric(&v);
        } else {
            dragonbox_convert(&v);
        }
        break;
    }

    s = dragonbox_format(s, v.f, v.e);
    return (int)(s - buffer);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movabsq $0xfffffffffffff, %rcx  # imm = 0xFFFFFFFFFFFFF
movq %xmm0, %rdx
movq %rdx, %rax
shrq $0x3f, %rax
movq %rdx, %rdi
shrq $0x34, %rdi
andl $0x7ff, %edi            # imm = 0x7FF
movq %rbx, %r14
testq %rdx, %rdx
jns 0x35a3
leaq 0x1(%rbx), %r14
movb $0x2d, (%rbx)
andq %rcx, %rdx
testl %edi, %edi
je 0x35cb
cmpl $0x7ff, %edi            # imm = 0x7FF
jne 0x35e8
testq %rdx, %rdx
je 0x36f8
movl $0x6e616e, (%rbx)       # imm = 0x6E616E
movl $0x3, %eax
jmp 0x3d79
testq %rdx, %rdx
je 0x3701
leaq 0x10(%rsp), %rdi
movq %rdx, (%rdi)
movl $0xfffffbce, 0x8(%rdi)  # imm = 0xFFFFFBCE
jmp 0x36f1
leaq (%rcx,%rdx), %rax
incq %rax
movq %rax, 0x10(%rsp)
leal -0x433(%rdi), %esi
movl %esi, 0x18(%rsp)
leal -0x3ff(%rdi), %ecx
cmpl $0x34, %ecx
ja 0x3626
movl $0x433, %ecx            # imm = 0x433
subl %edi, %ecx
movq $-0x1, %r8
shlq %cl, %r8
notq %r8
testq %r8, %rax
je 0x371d
testq %rdx, %rdx
sete %al
cmpl $0x2, %edi
setae %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x36ec
imull $0x134413, %esi, %edi   # imm = 0x134413
addl $0xfff80101, %edi       # imm = 0xFFF80101
sarl $0x16, %edi
imull $0xffe56cb1, %edi, %r9d # imm = 0xFFE56CB1
sarl $0x13, %r9d
addl %esi, %r9d
movl $0x124, %eax            # imm = 0x124
subl %edi, %eax
shlq $0x4, %rax
leaq 0x5594(%rip), %rcx      # 0x8c00
movq (%rax,%rcx), %r8
movq %r8, %rax
shrq $0x36, %rax
movq %r8, %rdx
subq %rax, %rdx
movb $0xb, %cl
subb %r9b, %cl
shrq %cl, %rdx
movq %r8, %rax
shrq $0x35, %rax
addq %r8, %rax
shrq %cl, %rax
movl %esi, %ecx
andl $-0x2, %ecx
xorl %r10d, %r10d
cmpl $0x2, %ecx
setne %r10b
addq %rdx, %r10
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rcx
shrq $0x3, %rdx
leaq (%rdx,%rdx), %rax
leaq (%rax,%rax,4), %rax
cmpq %r10, %rax
jae 0x3710
movb $0xa, %cl
subb %r9b, %cl
shrq %cl, %r8
incq %r8
shrq %r8
movq %r8, %rax
andq $-0x2, %rax
cmpq %r10, %r8
adcq $0x0, %r8
cmpl $-0x4d, %esi
cmoveq %rax, %r8
movq %r8, 0x10(%rsp)
jmp 0x3717
leaq 0x10(%rsp), %rdi
callq 0x3e3c
jmp 0x372d
movl $0x666e69, (%r14)       # imm = 0x666E69
jmp 0x3708
movl $0x302e30, (%r14)       # imm = 0x302E30
addl $0x3, %eax
jmp 0x3d79
movq %rdx, 0x10(%rsp)
incl %edi
movl %edi, 0x18(%rsp)
jmp 0x372d
shrq %cl, %rax
movq %rax, 0x10(%rsp)
movl $0x0, 0x18(%rsp)
movq 0x10(%rsp), %rsi
movl 0x18(%rsp), %r15d
movabsq $0x2386f26fc0ffff, %rax # imm = 0x2386F26FC0FFFF
cmpq %rax, %rsi
ja 0x3765
cmpq $0x5f5e0ff, %rsi        # imm = 0x5F5E0FF
ja 0x3808
leaq 0xc(%rsp), %rdx
movq %r14, %rdi
callq 0x4097
jmp 0x3cb5
movabsq $0x39a5652fb1137857, %rcx # imm = 0x39A5652FB1137857
movq %rsi, %rax
mulq %rcx
shrq $0x33, %rdx
movabsq $-0x2386f26fc10000, %rcx # imm = 0xFFDC790D903F0000
imulq %rdx, %rcx
leal 0x30(%rdx), %eax
movb %al, (%r14)
addq %rsi, %rcx
je 0x3895
cmpq $0x5f5e0ff, %rcx        # imm = 0x5F5E0FF
ja 0x38b2
movabsq $0x3030303030303030, %rax # imm = 0x3030303030303030
movq %rax, 0x1(%r14)
cmpq $0x270f, %rcx           # imm = 0x270F
ja 0x393d
movl $0x30303030, 0x9(%r14)  # imm = 0x30303030
imull $0x147b, %ecx, %eax     # imm = 0x147B
shrl $0x13, %eax
imull $-0x64, %eax, %edx
addl %ecx, %edx
leaq 0x7c65(%rip), %rcx      # 0xb440
movzwl (%rcx,%rax,2), %esi
movw %si, 0xd(%r14)
leal (%rdx,%rdx), %esi
movzwl (%rsi,%rcx), %ecx
movw %cx, 0xf(%r14)
testl %edx, %edx
jne 0x3bc3
leaq 0x7d11(%rip), %rcx      # 0xb510
movzbl (%rax,%rcx), %eax
jmp 0x3ca9
movabsq $-0x543388ee7b9e3103, %rcx # imm = 0xABCC77118461CEFD
movq %rsi, %rax
mulq %rcx
shrq $0x1a, %rdx
movl $0xfa0a1f00, %r12d      # imm = 0xFA0A1F00
imulq %rdx, %r12
addq %rsi, %r12
leaq 0xc(%rsp), %rax
movq %r14, %rdi
movl %edx, %esi
movq %rax, %rdx
callq 0x4097
cltq
addq %r14, %rax
testl %r12d, %r12d
je 0x3926
cmpl $0x270f, %r12d          # imm = 0x270F
ja 0x3994
movl $0x30303030, (%rax)     # imm = 0x30303030
imull $0x147b, %r12d, %ecx    # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %edx
addl %r12d, %edx
leaq 0x7bcd(%rip), %rsi      # 0xb440
movzwl (%rsi,%rcx,2), %edi
movw %di, 0x4(%rax)
leal (%rdx,%rdx), %edi
movzwl (%rdi,%rsi), %esi
movw %si, 0x6(%rax)
testl %edx, %edx
je 0x3a4f
movl %edx, %ecx
jmp 0x3ae9
leaq 0x1(%r14), %rax
movdqa 0x175f(%rip), %xmm0     # 0x5000
movdqu %xmm0, (%rax)
movl $0x10, 0xc(%rsp)
jmp 0x3cb0
movabsq $-0x543388ee7b9e3103, %rdx # imm = 0xABCC77118461CEFD
movq %rcx, %rax
mulq %rdx
shrq $0x1a, %rdx
movl $0xfa0a1f00, %eax       # imm = 0xFA0A1F00
imulq %rdx, %rax
addq %rcx, %rax
cmpl $0x270f, %edx           # imm = 0x270F
ja 0x39f1
movl $0x30303030, 0x1(%r14)  # imm = 0x30303030
imull $0x147b, %edx, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %esi
addl %edx, %esi
leaq 0x7b45(%rip), %rdx      # 0xb440
movzwl (%rdx,%rcx,2), %edi
movw %di, 0x5(%r14)
leal (%rsi,%rsi), %edi
movzwl (%rdi,%rdx), %edx
movw %dx, 0x7(%r14)
testl %esi, %esi
je 0x3a5f
movl %esi, %ecx
leaq 0x7bef(%rip), %rdx      # 0xb510
jmp 0x3b33
addl $0x8, 0xc(%rsp)
movabsq $0x3030303030303030, %rcx # imm = 0x3030303030303030
movq %rcx, (%rax)
jmp 0x3b6c
imulq $0x68db8bb, %rcx, %rdi  # imm = 0x68DB8BB
shrq $0x28, %rdi
imull $0xffffd8f0, %edi, %eax # imm = 0xFFFFD8F0
addl %ecx, %eax
imull $0x147b, %edi, %edx     # imm = 0x147B
shrl $0x13, %edx
imull $-0x64, %edx, %esi
addl %edi, %esi
leaq 0x7adb(%rip), %rcx      # 0xb440
movzwl (%rcx,%rdx,2), %edi
movw %di, 0x9(%r14)
leal (%rsi,%rsi), %edi
movzwl (%rdi,%rcx), %edi
movw %di, 0xb(%r14)
testl %esi, %esi
je 0x3a6f
movl %esi, %edx
leaq 0x7b85(%rip), %rsi      # 0xb510
movzbl (%rdx,%rsi), %edx
jmp 0x3a7d
movl %r12d, %ecx
imulq $0x68db8bb, %rcx, %rdx  # imm = 0x68DB8BB
shrq $0x28, %rdx
imull $0xffffd8f0, %edx, %ecx # imm = 0xFFFFD8F0
addl %r12d, %ecx
imull $0x147b, %edx, %esi     # imm = 0x147B
shrl $0x13, %esi
imull $-0x64, %esi, %edi
addl %edx, %edi
leaq 0x7a80(%rip), %rdx      # 0xb440
movzwl (%rdx,%rsi,2), %r8d
movw %r8w, (%rax)
leal (%rdi,%rdi), %r8d
movzwl (%r8,%rdx), %r8d
movw %r8w, 0x2(%rax)
testl %edi, %edi
je 0x3aac
movl %edi, %esi
leaq 0x7b28(%rip), %rdi      # 0xb510
movzbl (%rsi,%rdi), %esi
jmp 0x3aba
movl %edx, %ecx
imulq $0x68db8bb, %rcx, %rsi  # imm = 0x68DB8BB
shrq $0x28, %rsi
imull $0xffffd8f0, %esi, %ecx # imm = 0xFFFFD8F0
addl %edx, %ecx
imull $0x147b, %esi, %edi     # imm = 0x147B
shrl $0x13, %edi
imull $-0x64, %edi, %r8d
addl %esi, %r8d
leaq 0x7a23(%rip), %rsi      # 0xb440
movzwl (%rsi,%rdi,2), %edx
movw %dx, 0x1(%r14)
leal (%r8,%r8), %edx
movzwl (%rdx,%rsi), %edx
movw %dx, 0x3(%r14)
leaq 0x7ad6(%rip), %rdx      # 0xb510
testl %r8d, %r8d
je 0x3af6
movl %r8d, %edi
movzbl (%rdi,%rdx), %edi
jmp 0x3afd
leaq 0x7aba(%rip), %rdx      # 0xb510
movzbl (%rcx,%rdx), %ecx
jmp 0x3b65
leaq 0x7aaa(%rip), %rdx      # 0xb510
movzbl (%rcx,%rdx), %ecx
jmp 0x3b7b
leaq 0x7a9a(%rip), %rsi      # 0xb510
movzbl (%rdx,%rsi), %edx
addl $0x2, %edx
movl %edx, 0xc(%rsp)
testl %eax, %eax
je 0x3c8d
imull $0x147b, %eax, %edx     # imm = 0x147B
shrl $0x13, %edx
imull $-0x64, %edx, %esi
addl %eax, %esi
movzwl (%rcx,%rdx,2), %eax
movw %ax, 0xd(%r14)
leal (%rsi,%rsi), %eax
movzwl (%rax,%rcx), %eax
jmp 0x3c75
leaq 0x7a5d(%rip), %rdi      # 0xb510
movzbl (%rsi,%rdi), %esi
addl $0x2, %esi
movl %esi, 0xc(%rsp)
testl %ecx, %ecx
je 0x3b39
imull $0x147b, %ecx, %esi     # imm = 0x147B
shrl $0x13, %esi
imull $-0x64, %esi, %edi
addl %ecx, %edi
movzwl (%rdx,%rsi,2), %ecx
movw %cx, 0x4(%rax)
leal (%rdi,%rdi), %ecx
movzwl (%rcx,%rdx), %ecx
movw %cx, 0x6(%rax)
testl %edi, %edi
je 0x3b5a
movl %edi, %ecx
leaq 0x7a20(%rip), %rdx      # 0xb510
movzbl (%rcx,%rdx), %ecx
jmp 0x3b68
movzbl (%rdi,%rdx), %edi
addl $0x2, %edi
movl %edi, 0xc(%rsp)
testl %ecx, %ecx
je 0x3b49
imull $0x147b, %ecx, %edi     # imm = 0x147B
shrl $0x13, %edi
imull $-0x64, %edi, %r8d
addl %ecx, %r8d
movzwl (%rsi,%rdi,2), %ecx
movw %cx, 0x5(%r14)
leal (%r8,%r8), %ecx
movzwl (%rcx,%rsi), %ecx
movw %cx, 0x7(%r14)
testl %r8d, %r8d
je 0x3b77
movl %r8d, %ecx
movzbl (%rcx,%rdx), %ecx
jmp 0x3b7e
movl $0x30303030, 0x4(%rax)  # imm = 0x30303030
addl $0x4, %esi
movl %esi, 0xc(%rsp)
jmp 0x3b6c
movl $0x30303030, 0x5(%r14)  # imm = 0x30303030
addl $0x4, %edi
movl %edi, 0xc(%rsp)
jmp 0x3b82
leaq 0x79af(%rip), %rcx      # 0xb510
movzbl (%rsi,%rcx), %ecx
addl $0x2, %ecx
movl %ecx, 0xc(%rsp)
subl %r14d, %eax
addl $0x8, %eax
jmp 0x3cb5
movzbl (%rdi,%rdx), %ecx
addl $0x2, %ecx
movl %ecx, 0xc(%rsp)
testl %eax, %eax
je 0x3bca
cmpl $0x270f, %eax           # imm = 0x270F
ja 0x3be2
movl $0x30303030, 0x9(%r14)  # imm = 0x30303030
imull $0x147b, %eax, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %edx
addl %eax, %edx
leaq 0x7896(%rip), %rax      # 0xb440
movzwl (%rax,%rcx,2), %esi
movw %si, 0xd(%r14)
leal (%rdx,%rdx), %esi
movzwl (%rsi,%rax), %eax
movw %ax, 0xf(%r14)
testl %edx, %edx
je 0x3c34
movl %edx, %eax
jmp 0x3c80
movabsq $0x3030303030303030, %rax # imm = 0x3030303030303030
movq %rax, 0x9(%r14)
addl $0x8, 0xc(%rsp)
jmp 0x3cb0
movl %eax, %ecx
imulq $0x68db8bb, %rcx, %rdi  # imm = 0x68DB8BB
shrq $0x28, %rdi
imull $0xffffd8f0, %edi, %ecx # imm = 0xFFFFD8F0
addl %eax, %ecx
imull $0x147b, %edi, %edx     # imm = 0x147B
shrl $0x13, %edx
imull $-0x64, %edx, %esi
addl %edi, %esi
leaq 0x7834(%rip), %rax      # 0xb440
movzwl (%rax,%rdx,2), %edi
movw %di, 0x9(%r14)
leal (%rsi,%rsi), %edi
movzwl (%rdi,%rax), %edi
movw %di, 0xb(%r14)
testl %esi, %esi
je 0x3c41
movl %esi, %edx
leaq 0x78e2(%rip), %rsi      # 0xb510
movzbl (%rdx,%rsi), %edx
jmp 0x3c4f
leaq 0x78d5(%rip), %rax      # 0xb510
movzbl (%rcx,%rax), %eax
jmp 0x3ca9
leaq 0x78c8(%rip), %rsi      # 0xb510
movzbl (%rdx,%rsi), %edx
addl $0x2, %edx
movl %edx, 0xc(%rsp)
testl %ecx, %ecx
je 0x3c8d
imull $0x147b, %ecx, %edx     # imm = 0x147B
shrl $0x13, %edx
imull $-0x64, %edx, %esi
addl %ecx, %esi
movzwl (%rax,%rdx,2), %ecx
movw %cx, 0xd(%r14)
leal (%rsi,%rsi), %ecx
movzwl (%rcx,%rax), %eax
movw %ax, 0xf(%r14)
testl %esi, %esi
je 0x3c9e
movl %esi, %eax
leaq 0x7889(%rip), %rcx      # 0xb510
movzbl (%rax,%rcx), %eax
jmp 0x3cac
movl $0x30303030, 0xd(%r14)  # imm = 0x30303030
addl $0x4, %edx
movl %edx, 0xc(%rsp)
jmp 0x3cb0
leaq 0x786b(%rip), %rax      # 0xb510
movzbl (%rdx,%rax), %eax
addl $0x2, %eax
movl %eax, 0xc(%rsp)
movl $0x11, %eax
movslq 0xc(%rsp), %rcx
movslq %eax, %rdi
movq %rdi, %r12
subq %rcx, %r12
leal (%rdi,%r15), %r13d
leal (%rdi,%r15), %eax
decl %eax
cmpl $0x11, %eax
jae 0x3d29
movl %r12d, %eax
subl %r13d, %eax
jle 0x3d02
movslq %r13d, %rsi
leaq (%r14,%rsi), %r15
incq %r15
addq %r14, %rsi
movslq %eax, %rdx
movq %r15, %rdi
callq 0x10a0
movb $0x2e, -0x1(%r15)
movslq %r12d, %rax
addq %r14, %rax
incq %rax
jmp 0x3d74
testl %r15d, %r15d
jle 0x3d17
addq %r14, %rdi
movl $0x30, %esi
movq %r15, %rdx
callq 0x1080
movslq %r13d, %rax
addq %r14, %rax
addq $0x2, %rax
movw $0x302e, -0x2(%rax)     # imm = 0x302E
jmp 0x3d74
leal 0x6(%r13), %eax
cmpl $0x6, %eax
ja 0x3d87
movslq %r13d, %rax
negq %rax
leaq (%r14,%rax), %rdi
addq $0x2, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x10a0
movl $0x2, %eax
subl %r13d, %eax
movslq %eax, %r15
movq %r14, %rdi
movl $0x30, %esi
movq %r15, %rdx
callq 0x1080
movb $0x2e, 0x1(%r14)
addl %r12d, %r15d
movslq %r15d, %rax
addq %r14, %rax
movb $0x0, (%rax)
subl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpl $0x1, %r12d
je 0x3dad
leaq 0x2(%r14), %rdi
leaq 0x1(%r14), %rsi
leal -0x1(%r12), %eax
movslq %eax, %rdx
callq 0x10a0
movb $0x2e, 0x1(%r14)
movslq %r12d, %rax
addq %rax, %r14
leaq 0x2(%r14), %rax
movb $0x65, 0x1(%r14)
testl %r13d, %r13d
jle 0x3dc6
decl %r13d
movb $0x2b, (%rax)
movl %r13d, %ecx
jmp 0x3dd1
movb $0x2d, (%rax)
movl $0x1, %ecx
subl %r13d, %ecx
cmpl $0x63, %ecx
jg 0x3de9
cmpl $0x9, %ecx
jg 0x3e1d
addb $0x30, %cl
movb %cl, 0x3(%r14)
movl $0x2, %ecx
jmp 0x3e34
imull $0x147b, %ecx, %edx     # imm = 0x147B
shrl $0x13, %edx
imull $0x7fffff9c, %edx, %esi # imm = 0x7FFFFF9C
addl %ecx, %esi
addb $0x30, %dl
movb %dl, 0x3(%r14)
addl %esi, %esi
movslq %esi, %rcx
leaq 0x7633(%rip), %rdx      # 0xb440
movzwl (%rcx,%rdx), %ecx
movw %cx, 0x4(%r14)
movl $0x4, %ecx
jmp 0x3e34
movl %ecx, %ecx
leaq 0x761a(%rip), %rdx      # 0xb440
movzwl (%rdx,%rcx,2), %ecx
movw %cx, 0x3(%r14)
movl $0x3, %ecx
addq %rcx, %rax
jmp 0x3d74