// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movabsq $0xfffffffffffff, %rcx  # imm = 0xFFFFFFFFFFFFF
movq %xmm0, %rdx
movq %rdx, %rax
shrq $0x3f, %rax
movq %rdx, %r8
shrq $0x34, %r8
andl $0x7ff, %r8d            # imm = 0x7FF
movq %rdi, %r14
testq %rdx, %rdx
jns 0x3539
leaq 0x1(%rbx), %r14
movb $0x2d, (%rbx)
andq %rcx, %rdx
testl %r8d, %r8d
je 0x3563
cmpl $0x7ff, %r8d            # imm = 0x7FF
jne 0x357e
testq %rdx, %rdx
je 0x3759
movl $0x6e616e, (%rbx)       # imm = 0x6E616E
movl $0x3, %eax
jmp 0x3cb9
testq %rdx, %rdx
je 0x3762
movq %rdx, 0x8(%rsp)
movl $0xfffffbce, 0x10(%rsp) # imm = 0xFFFFFBCE
jmp 0x368f
leaq (%rcx,%rdx), %rsi
incq %rsi
movq %rsi, 0x8(%rsp)
leal -0x433(%r8), %edi
movl %edi, 0x10(%rsp)
leal -0x3ff(%r8), %eax
cmpl $0x34, %eax
ja 0x35bf
movl $0x433, %ecx            # imm = 0x433
subl %r8d, %ecx
movq $-0x1, %rax
shlq %cl, %rax
notq %rax
testq %rax, %rsi
je 0x3805
testq %rdx, %rdx
sete %al
cmpl $0x2, %r8d
setae %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x368f
imull $0x134413, %edi, %r12d  # imm = 0x134413
addl $0xfff80101, %r12d      # imm = 0xFFF80101
sarl $0x16, %r12d
imull $0xffe56cb1, %r12d, %r9d # imm = 0xFFE56CB1
sarl $0x13, %r9d
addl %edi, %r9d
movl $0x124, %eax            # imm = 0x124
subl %r12d, %eax
shlq $0x4, %rax
leaq 0x55f6(%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 %edi, %ecx
andl $-0x2, %ecx
xorl %r10d, %r10d
cmpl $0x2, %ecx
setne %r10b
addq %rdx, %r10
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
mulq %rcx
movq %rdx, %rsi
shrq $0x3, %rsi
leaq (%rsi,%rsi), %rax
leaq (%rax,%rax,4), %rax
cmpq %r10, %rax
jae 0x37fd
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, %edi
cmoveq %rax, %r8
movq %r8, %rsi
jmp 0x36a3
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x3d7c
movq (%r15), %rsi
movl 0x8(%r15), %r12d
movabsq $0x2386f26fc0ffff, %rax # imm = 0x2386F26FC0FFFF
cmpq %rax, %rsi
jbe 0x380b
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 0x3771
cmpq $0x5f5e0ff, %rcx        # imm = 0x5F5E0FF
ja 0x3790
movabsq $0x3030303030303030, %rax # imm = 0x3030303030303030
movq %rax, 0x1(%r14)
cmpq $0x270f, %rcx           # imm = 0x270F
ja 0x3927
movl $0x30303030, 0x9(%r14)  # imm = 0x30303030
imull $0x147b, %ecx, %eax     # imm = 0x147B
shrl $0x13, %eax
imull $-0x64, %eax, %edx
addl %ecx, %edx
leaq 0x7d14(%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 0x3b29
leaq 0x7dc0(%rip), %rcx      # 0xb510
movzbl (%rax,%rcx), %ecx
jmp 0x3beb
movl $0x666e69, (%r14)       # imm = 0x666E69
jmp 0x3769
movl $0x302e30, (%r14)       # imm = 0x302E30
addl $0x3, %eax
jmp 0x3cb9
leaq 0x1(%r14), %rax
movdqa 0x1883(%rip), %xmm0     # 0x5000
movdqu %xmm0, (%rax)
movl $0x11, %eax
movl $0x10, %ecx
jmp 0x3c00
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 0x397e
movl $0x30303030, 0x1(%r14)  # imm = 0x30303030
imull $0x147b, %edx, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %esi
addl %edx, %esi
leaq 0x7c67(%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 0x3ac9
movl %esi, %ecx
jmp 0x3abc
incl %r12d
jmp 0x36a3
shrq %cl, %rsi
xorl %r12d, %r12d
cmpq $0x5f5e0ff, %rsi        # imm = 0x5F5E0FF
ja 0x382c
leaq 0x4(%rsp), %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x3fca
movl (%r15), %ecx
jmp 0x3c00
movabsq $-0x543388ee7b9e3103, %rcx # imm = 0xABCC77118461CEFD
movq %rsi, %rax
mulq %rcx
shrq $0x1a, %rdx
movl $0xfa0a1f00, %r15d      # imm = 0xFA0A1F00
imulq %rdx, %r15
addq %rsi, %r15
leaq 0x4(%rsp), %rax
movq %r14, %rdi
movl %edx, %esi
movq %rax, %rdx
callq 0x3fca
cltq
addq %r14, %rax
testl %r15d, %r15d
je 0x38b1
cmpl $0x270f, %r15d          # imm = 0x270F
ja 0x38ca
movl $0x30303030, (%rax)     # imm = 0x30303030
imull $0x147b, %r15d, %ecx    # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %edx
addl %r15d, %edx
leaq 0x7bb1(%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 0x3a23
movl %edx, %ecx
jmp 0x3a16
movl 0x4(%rsp), %ecx
addl $0x8, %ecx
movabsq $0x3030303030303030, %rdx # imm = 0x3030303030303030
movq %rdx, (%rax)
jmp 0x3a3d
movl %r15d, %ecx
imulq $0x68db8bb, %rcx, %rsi  # imm = 0x68DB8BB
shrq $0x28, %rsi
imull $0xffffd8f0, %esi, %edx # imm = 0xFFFFD8F0
addl %r15d, %edx
imull $0x147b, %esi, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %edi
addl %esi, %edi
leaq 0x7b4a(%rip), %rsi      # 0xb440
movzwl (%rsi,%rcx,2), %r8d
movw %r8w, (%rax)
leal (%rdi,%rdi), %r8d
movzwl (%r8,%rsi), %r8d
movw %r8w, 0x2(%rax)
testl %edi, %edi
je 0x39dd
movl %edi, %ecx
leaq 0x7bf2(%rip), %rdi      # 0xb510
movzbl (%rcx,%rdi), %ecx
jmp 0x39eb
imulq $0x68db8bb, %rcx, %rdx  # imm = 0x68DB8BB
shrq $0x28, %rdx
imull $0xffffd8f0, %edx, %eax # imm = 0xFFFFD8F0
addl %ecx, %eax
imull $0x147b, %edx, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %esi
addl %edx, %esi
leaq 0x7af1(%rip), %rdx      # 0xb440
movzwl (%rdx,%rcx,2), %edi
movw %di, 0x9(%r14)
leal (%rsi,%rsi), %edi
movzwl (%rdi,%rdx), %edi
movw %di, 0xb(%r14)
testl %esi, %esi
je 0x3a48
movl %esi, %ecx
leaq 0x7b9b(%rip), %rsi      # 0xb510
movzbl (%rcx,%rsi), %ecx
jmp 0x3a56
movl %edx, %ecx
imulq $0x68db8bb, %rcx, %r8   # imm = 0x68DB8BB
shrq $0x28, %r8
imull $0xffffd8f0, %r8d, %esi # imm = 0xFFFFD8F0
addl %edx, %esi
imull $0x147b, %r8d, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %edi
addl %r8d, %edi
leaq 0x7a95(%rip), %rdx      # 0xb440
movzwl (%rdx,%rcx,2), %r8d
movw %r8w, 0x1(%r14)
leal (%rdi,%rdi), %r8d
movzwl (%r8,%rdx), %r8d
movw %r8w, 0x3(%r14)
testl %edi, %edi
je 0x3a81
movl %edi, %ecx
leaq 0x7b3c(%rip), %rdi      # 0xb510
movzbl (%rcx,%rdi), %ecx
jmp 0x3a8f
leaq 0x7b2c(%rip), %rdi      # 0xb510
movzbl (%rcx,%rdi), %ecx
addl $0x2, %ecx
testl %edx, %edx
je 0x3a33
imull $0x147b, %edx, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %edi
addl %edx, %edi
movzwl (%rsi,%rcx,2), %edx
movw %dx, 0x4(%rax)
leal (%rdi,%rdi), %edx
movzwl (%rdx,%rsi), %edx
movw %dx, 0x6(%rax)
testl %edi, %edi
je 0x3a23
movl %edi, %ecx
leaq 0x7af3(%rip), %rdx      # 0xb510
movzbl (%rcx,%rdx), %ecx
jmp 0x3a3d
leaq 0x7ae6(%rip), %rdx      # 0xb510
movzbl (%rcx,%rdx), %ecx
addl $0x2, %ecx
jmp 0x3a3d
movl $0x30303030, 0x4(%rax)  # imm = 0x30303030
addl $0x4, %ecx
subl %r14d, %eax
addl $0x8, %eax
jmp 0x3c00
leaq 0x7ac1(%rip), %rsi      # 0xb510
movzbl (%rcx,%rsi), %ecx
addl $0x2, %ecx
testl %eax, %eax
je 0x3bf0
imull $0x147b, %eax, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %esi
addl %eax, %esi
movzwl (%rdx,%rcx,2), %eax
movw %ax, 0xd(%r14)
leal (%rsi,%rsi), %eax
movzwl (%rax,%rdx), %eax
jmp 0x3bc8
leaq 0x7a88(%rip), %rdi      # 0xb510
movzbl (%rcx,%rdi), %ecx
addl $0x2, %ecx
testl %esi, %esi
je 0x3ad9
imull $0x147b, %esi, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %edi
addl %esi, %edi
movzwl (%rdx,%rcx,2), %esi
movw %si, 0x5(%r14)
leal (%rdi,%rdi), %esi
movzwl (%rsi,%rdx), %edx
movw %dx, 0x7(%r14)
testl %edi, %edi
je 0x3ac9
movl %edi, %ecx
leaq 0x7a4d(%rip), %rdx      # 0xb510
movzbl (%rcx,%rdx), %ecx
jmp 0x3ae4
leaq 0x7a40(%rip), %rdx      # 0xb510
movzbl (%rcx,%rdx), %ecx
addl $0x2, %ecx
jmp 0x3ae4
movl $0x30303030, 0x5(%r14)  # imm = 0x30303030
addl $0x4, %ecx
testl %eax, %eax
je 0x3b30
cmpl $0x270f, %eax           # imm = 0x270F
ja 0x3b46
movl $0x30303030, 0x9(%r14)  # imm = 0x30303030
imull $0x147b, %eax, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %edx
addl %eax, %edx
leaq 0x7934(%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 0x3be0
movl %edx, %eax
jmp 0x3bd3
movabsq $0x3030303030303030, %rax # imm = 0x3030303030303030
movq %rax, 0x9(%r14)
addl $0x8, %ecx
jmp 0x3bfb
movl %eax, %ecx
imulq $0x68db8bb, %rcx, %rdi  # imm = 0x68DB8BB
shrq $0x28, %rdi
imull $0xffffd8f0, %edi, %edx # imm = 0xFFFFD8F0
addl %eax, %edx
imull $0x147b, %edi, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %esi
addl %edi, %esi
leaq 0x78d0(%rip), %rax      # 0xb440
movzwl (%rax,%rcx,2), %edi
movw %di, 0x9(%r14)
leal (%rsi,%rsi), %edi
movzwl (%rdi,%rax), %edi
movw %di, 0xb(%r14)
testl %esi, %esi
je 0x3b98
movl %esi, %ecx
leaq 0x797e(%rip), %rsi      # 0xb510
movzbl (%rcx,%rsi), %ecx
jmp 0x3ba6
leaq 0x7971(%rip), %rsi      # 0xb510
movzbl (%rcx,%rsi), %ecx
addl $0x2, %ecx
testl %edx, %edx
je 0x3bf0
imull $0x147b, %edx, %ecx     # imm = 0x147B
shrl $0x13, %ecx
imull $-0x64, %ecx, %esi
addl %edx, %esi
movzwl (%rax,%rcx,2), %edx
movw %dx, 0xd(%r14)
leal (%rsi,%rsi), %edx
movzwl (%rdx,%rax), %eax
movw %ax, 0xf(%r14)
testl %esi, %esi
je 0x3be0
movl %esi, %eax
leaq 0x7936(%rip), %rcx      # 0xb510
movzbl (%rax,%rcx), %ecx
jmp 0x3bfb
leaq 0x7929(%rip), %rax      # 0xb510
movzbl (%rcx,%rax), %ecx
addl $0x2, %ecx
jmp 0x3bfb
movl $0x30303030, 0xd(%r14)  # imm = 0x30303030
addl $0x4, %ecx
movl $0x11, %eax
movl %eax, %ebp
subl %ecx, %ebp
leal (%rax,%r12), %r13d
leal (%rax,%r12), %ecx
decl %ecx
cmpl $0x11, %ecx
jae 0x3c6b
movl %ebp, %ecx
subl %r13d, %ecx
jle 0x3c41
movl %r13d, %esi
leaq (%r14,%rsi), %r15
incq %r15
addq %r14, %rsi
movslq %ecx, %rdx
movq %r15, %rdi
callq 0x10a0
movb $0x2e, -0x1(%r15)
movl %ebp, %eax
addq %r14, %rax
incq %rax
jmp 0x3cb4
testl %r12d, %r12d
jle 0x3c59
movslq %eax, %rdi
addq %r14, %rdi
movl %r12d, %edx
movl $0x30, %esi
callq 0x1080
movl %r13d, %eax
addq %r14, %rax
addq $0x2, %rax
movw $0x302e, -0x2(%rax)     # imm = 0x302E
jmp 0x3cb4
leal 0x6(%r13), %eax
cmpl $0x6, %eax
ja 0x3cc8
movslq %r13d, %rax
negq %rax
leaq (%r14,%rax), %rdi
addq $0x2, %rdi
movslq %ebp, %rdx
movq %r14, %rsi
callq 0x10a0
movl $0x2, %r15d
subl %r13d, %r15d
movq %r14, %rdi
movl $0x30, %esi
movq %r15, %rdx
callq 0x1080
movb $0x2e, 0x1(%r14)
addl %ebp, %r15d
movslq %r15d, %rax
addq %r14, %rax
movb $0x0, (%rax)
subl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1, %ebp
je 0x3ceb
leaq 0x2(%r14), %rdi
leaq 0x1(%r14), %rsi
leal -0x1(%rbp), %eax
movslq %eax, %rdx
callq 0x10a0
movb $0x2e, 0x1(%r14)
movslq %ebp, %rax
addq %rax, %r14
leaq 0x2(%r14), %rax
movb $0x65, 0x1(%r14)
leal -0x1(%r13), %edx
testl %r13d, %r13d
setle %sil
addb %sil, %sil
addb $0x2b, %sil
movl %edx, %ecx
negl %ecx
cmovsl %edx, %ecx
movb %sil, 0x2(%r14)
cmpl $0x63, %ecx
ja 0x3d29
cmpl $0x9, %ecx
ja 0x3d5d
orb $0x30, %cl
movb %cl, 0x3(%r14)
movl $0x2, %ecx
jmp 0x3d74
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 0x76f3(%rip), %rdx      # 0xb440
movzwl (%rcx,%rdx), %ecx
movw %cx, 0x4(%r14)
movl $0x4, %ecx
jmp 0x3d74
movl %ecx, %ecx
leaq 0x76da(%rip), %rdx      # 0xb440
movzwl (%rdx,%rcx,2), %ecx
movw %cx, 0x3(%r14)
movl $0x3, %ecx
addq %rcx, %rax
jmp 0x3cb4