// File: /workspace/github_c_makefile_star2_O1/lengjingzju[P]json/grisu2.c
// Function: grisu2_dtoa
int grisu2_dtoa(double num, char *buffer)
{
    int length, K, pre = 0;

    if (num == 0) {
        memcpy(buffer, "0.0", 4);
        return 3;
    }

    if (num < 0) {
        *buffer++ = '-';
        num = -num;
        pre = 1;
    }

    grisu2(num, buffer, &length, &K);
    return (pre + prettify_string(buffer, length, K));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2ea1
jp 0x2ea1
movl $0x302e30, (%rdi)       # imm = 0x302E30
movl $0x3, %r14d
jmp 0x354f
ucomisd %xmm0, %xmm1
jbe 0x2ebf
movb $0x2d, (%rdi)
incq %rdi
xorpd 0x217b(%rip), %xmm0     # 0x5030
movl $0x1, 0x14(%rsp)
jmp 0x2ec7
movl $0x0, 0x14(%rsp)
movq %rdi, 0x8(%rsp)
movq %xmm0, %rax
movabsq $0x10000000000000, %r9  # imm = 0x10000000000000
leaq -0x1(%r9), %rcx
andq %rax, %rcx
movq %rax, %rdx
shrq $0x34, %rdx
andl $0x7ff, %edx            # imm = 0x7FF
movq %rcx, %rax
btsq $0x34, %rax
leal -0x433(%rdx), %esi
testl %edx, %edx
cmoveq %rcx, %rax
movl $0xfffffbce, %edx       # imm = 0xFFFFFBCE
cmovnel %esi, %edx
bsrq %rax, %rsi
leaq 0x1(,%rax,2), %r10
leal -0x1(%rdx), %r8d
bsrq %r10, %rcx
xorq $0x3f, %rcx
addl $-0x2, %edx
cmpq %r9, %rax
leaq -0x1(%rax,%rax), %r9
movabsq $0x3fffffffffffff, %r11 # imm = 0x3FFFFFFFFFFFFF
cmovneq %r9, %r11
cmovnel %r8d, %edx
shlq %cl, %r10
subl %ecx, %r8d
notl %esi
movl %esi, %ecx
shlq %cl, %rax
subl %r8d, %edx
movl %edx, %ecx
shlq %cl, %r11
movslq %r8d, %rcx
leaq 0x52f1(%rip), %rdx      # 0x8250
movzbl 0x471(%rcx,%rdx), %edx
leal (,%rdx,8), %edi
leaq 0x4f6b(%rip), %rsi      # 0x7ee0
movq %rdi, 0x40(%rsp)
movq (%rdi,%rsi), %r8
leaq 0x521b(%rip), %rsi      # 0x81a0
movswl (%rsi,%rdx,2), %r9d
mulq %r8
movq %rdx, %rsi
movq %rax, %rdi
movq %r10, %rax
mulq %r8
movq %rax, %rbx
movq %rdx, %r10
sarq $0x3f, %rdi
shrq $0x3f, %rbx
addl %r9d, %ecx
movl $0xffffffc0, %ebp       # imm = 0xFFFFFFC0
subl %ecx, %ebp
movq %r11, %rax
mulq %r8
shrq $0x3f, %rax
addq %rdx, %rax
notq %rax
leaq (%r10,%rbx), %r8
movq %r10, 0x28(%rsp)
movq %rbx, 0x20(%rsp)
leaq (%r10,%rbx), %r12
decq %r12
negl %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %r12, %r14
shrq %cl, %r14
movq %rdi, 0x30(%rsp)
subq %rsi, %rdi
movq %rdx, 0x38(%rsp)
leaq -0x1(%rdx), %r11
cmpl $0x186a0, %r14d         # imm = 0x186A0
jb 0x303b
movl $0x6, %edx
cmpl $0xf4240, %r14d         # imm = 0xF4240
jb 0x306e
movl $0x7, %edx
cmpl $0x989680, %r14d        # imm = 0x989680
jb 0x306e
movl $0x8, %edx
cmpl $0x5f5e100, %r14d       # imm = 0x5F5E100
jb 0x306e
cmpl $0x3b9aca00, %r14d      # imm = 0x3B9ACA00
movl $0xa, %edx
sbbl $0x0, %edx
jmp 0x306e
movl $0x5, %edx
cmpl $0x270f, %r14d          # imm = 0x270F
ja 0x306e
movl $0x4, %edx
cmpl $0x3e7, %r14d           # imm = 0x3E7
ja 0x306e
movl $0x3, %edx
cmpl $0x63, %r14d
ja 0x306e
cmpl $0xa, %r14d
movl $0x1, %edx
sbbl $-0x1, %edx
addq %r8, %rax
decq %rax
leaq (%rdi,%r8), %rcx
decq %rcx
movq %rcx, 0x18(%rsp)
andq %r11, %r12
movl %edx, %r9d
xorl %r13d, %r13d
leaq 0x4e24(%rip), %r8       # 0x7eb4
movq 0x8(%rsp), %rdi
cmpq %r13, %r9
je 0x3267
decl %edx
movslq (%r8,%rdx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
xorl %r10d, %r10d
jmp 0x31a4
movl %r14d, %ecx
movl $0xd1b71759, %r10d      # imm = 0xD1B71759
imulq %r10, %rcx
shrq $0x2d, %rcx
imull $0xffffd8f0, %ecx, %r10d # imm = 0xFFFFD8F0
jmp 0x319e
movl %r14d, %ecx
shrl $0x9, %ecx
imulq $0x44b83, %rcx, %rcx    # imm = 0x44B83
shrq $0x27, %rcx
imull $0xc4653600, %ecx, %r10d # imm = 0xC4653600
jmp 0x319e
movl %r14d, %ecx
shrl $0x2, %ecx
leaq 0x59c8(%rip), %r10      # 0x8ac0
movzbl (%rcx,%r10), %ecx
imull $-0x64, %ecx, %r10d
addl %r14d, %r10d
movl %ecx, %r14d
jmp 0x31a4
movl %r14d, %ecx
imulq $0x10624dd3, %rcx, %rcx # imm = 0x10624DD3
shrq $0x26, %rcx
imull $0xfffffc18, %ecx, %r10d # imm = 0xFFFFFC18
jmp 0x319e
movl %r14d, %ecx
imulq $0x6b5fca6b, %rcx, %rcx # imm = 0x6B5FCA6B
shrq $0x36, %rcx
imull $0xff676980, %ecx, %r10d # imm = 0xFF676980
jmp 0x319e
movl %r14d, %r10d
shrl %r14d
leaq 0x5a79(%rip), %rcx      # 0x8bc0
movzbl (%r14,%rcx), %r14d
leal (%r14,%r14), %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %r10d
jmp 0x31a4
movl %r14d, %ecx
shrl $0x5, %ecx
imulq $0xa7c5ac5, %rcx, %rcx  # imm = 0xA7C5AC5
shrq $0x27, %rcx
imull $0xfffe7960, %ecx, %r10d # imm = 0xFFFE7960
jmp 0x319e
movl %r14d, %ecx
imulq $0x431bde83, %rcx, %rcx # imm = 0x431BDE83
shrq $0x32, %rcx
imull $0xfff0bdc0, %ecx, %r10d # imm = 0xFFF0BDC0
jmp 0x319e
movl %r14d, %ecx
imulq $0x55e63b89, %rcx, %rcx # imm = 0x55E63B89
shrq $0x39, %rcx
imull $0xfa0a1f00, %ecx, %r10d # imm = 0xFA0A1F00
addl %r14d, %r10d
movl %ecx, %r14d
addb $0x30, %r14b
movb %r14b, (%rdi,%r13)
movl %r10d, %r15d
movl %ebp, %ecx
shlq %cl, %r15
incq %r13
leaq (%r15,%r12), %rbx
movl %r10d, %r14d
cmpq %rax, %rbx
ja 0x3095
movl %edx, %ecx
leaq 0x58c0(%rip), %r8       # 0x8a90
movl (%r8,%rcx,4), %r8d
movl %ebp, %ecx
shlq %cl, %r8
movq 0x18(%rsp), %r11
cmpq %r11, %rbx
jae 0x3304
leaq (%r8,%rbx), %rdi
cmpq %rax, %rdi
ja 0x3304
leaq (%rbx,%r8,2), %rcx
addq %r8, %r12
addq %rsi, %r12
movq 0x30(%rsp), %r10
subq %r10, %r12
movq 0x20(%rsp), %rbp
subq %rbp, %r12
movq 0x28(%rsp), %r14
subq %r14, %r12
leaq (%r12,%r15), %r9
incq %r9
addq %rbp, %r10
addq %r14, %r10
notq %rsi
addq %r10, %rsi
subq %rbx, %rsi
movq 0x8(%rsp), %rbx
cmpq %r11, %rdi
jb 0x323f
cmpq %r9, %rsi
jbe 0x3309
decb -0x1(%rbx,%r13)
cmpq %rax, %rcx
ja 0x3309
leaq (%rdi,%r8), %r10
addq %r8, %rcx
addq %r8, %r9
subq %r8, %rsi
cmpq %r11, %rdi
movq %r10, %rdi
jb 0x3231
jmp 0x3309
movq 0x8(%rsp), %rbx
leaq (%rbx,%r13), %r8
leaq 0x5819(%rip), %rsi      # 0x8a90
xorl %edx, %edx
addq %r12, %r12
leaq (%r12,%r12,4), %r12
addq %rax, %rax
movq %r12, %r9
movl %ebp, %ecx
shrq %cl, %r9
leaq (%rax,%rax,4), %rax
addb $0x30, %r9b
movb %r9b, (%r8)
andq %r11, %r12
incq %r8
decq %rdx
addq $0x4, %rsi
cmpq %rax, %r12
jae 0x3279
movq 0x38(%rsp), %r14
leaq (%r12,%r14), %rcx
subq %rdx, %r13
cmpq %rax, %rcx
movq 0x18(%rsp), %r11
ja 0x3309
movl (%rsi), %esi
imulq %rsi, %r11
movq %r11, %rsi
subq %r12, %rsi
jbe 0x3309
movl %r13d, %edi
leaq (%r12,%r14,2), %r8
movq %r11, %r9
negq %r9
cmpq %r11, %rcx
jb 0x32e7
leaq (%r9,%rcx), %r10
cmpq %r10, %rsi
jbe 0x3309
decb -0x1(%rbx,%rdi)
cmpq %rax, %r8
ja 0x3309
leaq (%rcx,%r14), %r10
addq %r14, %r8
subq %r14, %rsi
cmpq %r11, %rcx
movq %r10, %rcx
jb 0x32d9
jmp 0x3309
movq 0x8(%rsp), %rbx
subl 0x40(%rsp), %edx
leal (%rdx,%r13), %r15d
addl $0x15c, %r15d           # imm = 0x15C
cmpl $0x15, %r15d
jg 0x33d7
movl %edx, %eax
addl $0x15c, %eax            # imm = 0x15C
js 0x3356
movslq %r13d, %rdi
addq %rbx, %rdi
movl %eax, %edx
movl $0x30, %esi
callq 0x1080
movslq %r15d, %r14
movw $0x302e, (%rbx,%r14)    # imm = 0x302E
movb $0x0, 0x2(%rbx,%r14)
addq $0x2, %r14
jmp 0x354a
testl %r15d, %r15d
jle 0x3391
movl %r15d, %eax
leaq (%rbx,%rax), %rsi
leaq (%rbx,%rax), %r14
incq %r14
movl $0xfffffea4, %eax       # imm = 0xFFFFFEA4
subl %edx, %eax
movslq %eax, %rdx
movq %r14, %rdi
callq 0x10a0
movb $0x2e, -0x1(%r14)
movslq %r13d, %r14
movb $0x0, 0x1(%rbx,%r14)
incq %r14
jmp 0x354a
cmpl $-0x5, %r15d
jl 0x33d7
movl $0x2, %r14d
subl %r15d, %r14d
leaq (%rbx,%r14), %rdi
movslq %r13d, %rdx
movq %rbx, %rsi
callq 0x10a0
movw $0x2e30, (%rbx)         # imm = 0x2E30
leaq 0x2(%rbx), %rdi
negl %r15d
movl $0x30, %esi
movq %r15, %rdx
callq 0x1080
addl %r13d, %r14d
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
jmp 0x354a
cmpl $0x1, %r13d
jne 0x33f2
movb $0x65, 0x1(%rbx)
testl %r15d, %r15d
jle 0x3433
decl %r15d
movb $0x2b, 0x2(%rbx)
movl %r15d, %eax
jmp 0x343f
leaq 0x2(%rbx), %rdi
leaq 0x1(%rbx), %rsi
leal -0x1(%r13), %eax
movslq %eax, %rdx
callq 0x10a0
movb $0x2e, 0x1(%rbx)
movslq %r13d, %rax
movb $0x65, 0x1(%rbx,%rax)
movslq %r13d, %rax
addq %rbx, %rax
addq $0x2, %rax
testl %r15d, %r15d
jle 0x34bd
decl %r15d
movb $0x2b, (%rax)
movl %r15d, %edx
jmp 0x34c8
movb $0x2d, 0x2(%rbx)
movl $0x1, %eax
subl %r15d, %eax
cmpl $0x9, %eax
jg 0x3458
addb $0x30, %al
movb %al, 0x3(%rbx)
movb $0x0, 0x4(%rbx)
movl $0x4, %r14d
jmp 0x354a
movl $0x1, %r14d
cmpl $0x64, %eax
jl 0x3484
movl %eax, %ecx
shrl $0x2, %ecx
leaq 0x5651(%rip), %rdx      # 0x8ac0
movzbl (%rcx,%rdx), %ecx
imull $-0x64, %ecx, %edx
addl %edx, %eax
addl $0x30, %ecx
movb %cl, 0x3(%rbx)
movl $0x2, %r14d
movl %eax, %ecx
sarl %ecx
movslq %ecx, %rcx
leaq 0x572e(%rip), %rdx      # 0x8bc0
movzbl (%rcx,%rdx), %ecx
imull $0xf6, %ecx, %edx
addl %eax, %edx
leal 0x30(%rcx), %eax
movl %r14d, %ecx
movb %al, 0x2(%rbx,%rcx)
addb $0x30, %dl
movb %dl, 0x3(%rbx,%rcx)
movb $0x0, 0x4(%rbx,%rcx)
orl $0x4, %r14d
jmp 0x354a
movb $0x2d, (%rax)
movl $0x1, %edx
subl %r15d, %edx
leal 0x2(%r13), %ecx
cmpl $0x9, %edx
jg 0x34e4
addb $0x30, %dl
movb %dl, 0x1(%rax)
movl $0x2, %r14d
movl $0x2, %esi
jmp 0x3543
movl $0x1, %esi
cmpl $0x64, %edx
jl 0x350f
movl %edx, %esi
shrl $0x2, %esi
leaq 0x55c6(%rip), %rdi      # 0x8ac0
movzbl (%rsi,%rdi), %esi
imull $-0x64, %esi, %edi
addl %edi, %edx
addl $0x30, %esi
movb %sil, 0x1(%rax)
movl $0x2, %esi
movl %edx, %edi
sarl %edi
movslq %edi, %rdi
leaq 0x56a3(%rip), %r8       # 0x8bc0
movzbl (%rdi,%r8), %edi
imull $0xf6, %edi, %r8d
addl %edx, %r8d
leal 0x30(%rdi), %edx
movl %esi, %edi
movb %dl, (%rax,%rdi)
addb $0x30, %r8b
addl $0x2, %esi
movb %r8b, 0x1(%rax,%rdi)
movl %esi, %r14d
addl %ecx, %r14d
movb $0x0, (%rax,%rsi)
addl 0x14(%rsp), %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq