// File: /workspace/github_c_makefile_star2_O3/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
movq %rdi, %rbx
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x2e40
jp 0x2e40
movl $0x302e30, (%rbx)       # imm = 0x302E30
movl $0x3, %r14d
jmp 0x34e3
ucomisd %xmm0, %xmm1
jbe 0x2e5e
movb $0x2d, (%rbx)
incq %rbx
xorpd 0x21dc(%rip), %xmm0     # 0x5030
movl $0x1, 0xc(%rsp)
jmp 0x2e66
movl $0x0, 0xc(%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), %r8
leal -0x1(%rdx), %edi
bsrq %r8, %rcx
xorq $0x3f, %rcx
addl $-0x2, %edx
cmpq %r9, %rax
leaq -0x1(%rax,%rax), %r9
movabsq $0x3fffffffffffff, %r11 # imm = 0x3FFFFFFFFFFFFF
cmovneq %r9, %r11
cmovnel %edi, %edx
shlq %cl, %r8
subl %ecx, %edi
notl %esi
movl %esi, %ecx
shlq %cl, %rax
subl %edi, %edx
movl %edx, %ecx
shlq %cl, %r11
movslq %edi, %rcx
leaq 0x535b(%rip), %rdx      # 0x8250
movzbl 0x471(%rcx,%rdx), %edx
leal (,%rdx,8), %r10d
leaq 0x4fd4(%rip), %rsi      # 0x7ee0
movq (%r10,%rsi), %rdi
leaq 0x5289(%rip), %rsi      # 0x81a0
movswl (%rsi,%rdx,2), %r9d
mulq %rdi
movq %rdx, %rsi
movq %rax, %r14
movq %r8, %rax
mulq %rdi
movq %rax, %r13
movq %rdx, %r15
sarq $0x3f, %r14
shrq $0x3f, %r13
addl %r9d, %ecx
movl $0xffffffc0, %r8d       # imm = 0xFFFFFFC0
subl %ecx, %r8d
movq %r11, %rax
mulq %rdi
shrq $0x3f, %rax
addq %rdx, %rax
notq %rax
leaq (%r15,%r13), %r11
leaq (%r15,%r13), %r9
decq %r9
negl %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %r9, %r12
shrq %cl, %r12
movq %r14, %rcx
subq %rsi, %rcx
leaq -0x1(%rdx), %rdi
cmpl $0x186a0, %r12d         # imm = 0x186A0
movq %r10, 0x10(%rsp)
movq %rdx, 0x30(%rsp)
movq %r14, 0x40(%rsp)
movq %r15, 0x38(%rsp)
movq %r13, 0x18(%rsp)
jb 0x2fd7
movl $0x6, %edx
cmpl $0xf4240, %r12d         # imm = 0xF4240
jb 0x300a
movl $0x7, %edx
cmpl $0x989680, %r12d        # imm = 0x989680
jb 0x300a
movl $0x8, %edx
cmpl $0x5f5e100, %r12d       # imm = 0x5F5E100
jb 0x300a
cmpl $0x3b9aca00, %r12d      # imm = 0x3B9ACA00
movl $0xa, %edx
sbbl $0x0, %edx
jmp 0x300a
movl $0x5, %edx
cmpl $0x270f, %r12d          # imm = 0x270F
ja 0x300a
movl $0x4, %edx
cmpl $0x3e7, %r12d           # imm = 0x3E7
ja 0x300a
movl $0x3, %edx
cmpl $0x63, %r12d
ja 0x300a
cmpl $0xa, %r12d
movl $0x1, %edx
sbbl $-0x1, %edx
addq %r11, %rax
decq %rax
addq %rcx, %r11
decq %r11
movq %rdi, 0x28(%rsp)
andq %rdi, %r9
movl %edx, %ecx
movq %rcx, 0x20(%rsp)
leaq (,%rcx,4), %rcx
leaq 0x5a5c(%rip), %r14      # 0x8a90
subq %rcx, %r14
xorl %ebp, %ebp
leaq 0x4e74(%rip), %r13      # 0x7eb4
movl %edx, %ecx
movslq (%r13,%rcx,4), %rcx
addq %r13, %rcx
jmpq *%rcx
xorl %r15d, %r15d
jmp 0x3145
movl %r12d, %ecx
shrl $0x9, %ecx
imulq $0x44b83, %rcx, %rcx    # imm = 0x44B83
shrq $0x27, %rcx
imull $0xc4653600, %ecx, %r15d # imm = 0xC4653600
jmp 0x313f
movl %r12d, %ecx
shrl $0x2, %ecx
leaq 0x5a42(%rip), %rdi      # 0x8ac0
movzbl (%rcx,%rdi), %ecx
imull $-0x64, %ecx, %r15d
addl %r12d, %r15d
movl %ecx, %r12d
jmp 0x3145
movl %r12d, %ecx
imulq $0x10624dd3, %rcx, %rcx # imm = 0x10624DD3
shrq $0x26, %rcx
imull $0xfffffc18, %ecx, %r15d # imm = 0xFFFFFC18
jmp 0x313f
movl %r12d, %ecx
imulq $0x6b5fca6b, %rcx, %rcx # imm = 0x6B5FCA6B
shrq $0x36, %rcx
imull $0xff676980, %ecx, %r15d # imm = 0xFF676980
jmp 0x313f
movl %r12d, %ecx
shrl $0x5, %ecx
imulq $0xa7c5ac5, %rcx, %rcx  # imm = 0xA7C5AC5
shrq $0x27, %rcx
imull $0xfffe7960, %ecx, %r15d # imm = 0xFFFE7960
jmp 0x313f
movl %r12d, %r15d
shrl %r12d
leaq 0x5ad7(%rip), %rcx      # 0x8bc0
movzbl (%r12,%rcx), %r12d
leal (%r12,%r12), %ecx
leal (%rcx,%rcx,4), %ecx
subl %ecx, %r15d
jmp 0x3145
movl %r12d, %ecx
imulq $0x431bde83, %rcx, %rcx # imm = 0x431BDE83
shrq $0x32, %rcx
imull $0xfff0bdc0, %ecx, %r15d # imm = 0xFFF0BDC0
jmp 0x313f
movl %r12d, %ecx
imulq $0x55e63b89, %rcx, %rcx # imm = 0x55E63B89
shrq $0x39, %rcx
imull $0xfa0a1f00, %ecx, %r15d # imm = 0xFA0A1F00
jmp 0x313f
movl %r12d, %ecx
movl $0xd1b71759, %edi       # imm = 0xD1B71759
imulq %rdi, %rcx
shrq $0x2d, %rcx
imull $0xffffd8f0, %ecx, %r15d # imm = 0xFFFFD8F0
addl %r12d, %r15d
movl %ecx, %r12d
addb $0x30, %r12b
movb %r12b, (%rbx,%rbp)
incq %rbp
decl %edx
movl %r15d, %edi
movl %r8d, %ecx
shlq %cl, %rdi
leaq (%rdi,%r9), %r10
addq $0x4, %r14
movl %r15d, %r12d
cmpq %rax, %r10
ja 0x3040
movl %edx, %ecx
leaq 0x5918(%rip), %r14      # 0x8a90
movl (%r14,%rcx,4), %r14d
movl %r8d, %ecx
shlq %cl, %r14
cmpq %r11, %r10
jae 0x31f2
leaq (%r14,%r10), %rcx
cmpq %rax, %rcx
ja 0x31f2
movl %ebp, %r8d
leaq (%r10,%r14,2), %r15
addq %r14, %r9
addq %rsi, %r9
movq 0x40(%rsp), %r12
subq %r12, %r9
subq 0x18(%rsp), %r9
movq 0x38(%rsp), %r13
subq %r13, %r9
addq %r9, %rdi
incq %rdi
addq 0x18(%rsp), %r12
addq %r13, %r12
notq %rsi
addq %r12, %rsi
subq %r10, %rsi
cmpq %r11, %rcx
jb 0x31d3
cmpq %rdi, %rsi
jbe 0x31f2
decb -0x1(%rbx,%r8)
cmpq %rax, %r15
ja 0x31f2
leaq (%rcx,%r14), %r9
addq %r14, %r15
addq %r14, %rdi
subq %r14, %rsi
cmpq %r11, %rcx
movq %r9, %rcx
jb 0x31c9
movq 0x10(%rsp), %rax
subl %eax, %edx
leal (%rdx,%rbp), %r15d
addl $0x15c, %r15d           # imm = 0x15C
cmpl $0x15, %r15d
jg 0x3367
movl %edx, %eax
addl $0x15c, %eax            # imm = 0x15C
js 0x3242
movslq %ebp, %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 0x34dc
testl %r15d, %r15d
jle 0x3321
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 %ebp, %r14
movb $0x0, 0x1(%rbx,%r14)
incq %r14
jmp 0x34dc
movq 0x28(%rsp), %rsi
addq %r9, %r9
leaq (%r9,%r9,4), %r9
movq %r9, %rdx
movl %r8d, %ecx
shrq %cl, %rdx
addq %rax, %rax
leaq (%rax,%rax,4), %rax
addb $0x30, %dl
movb %dl, (%rbx,%rbp)
incq %rbp
andq %rsi, %r9
addq $0x4, %r14
cmpq %rax, %r9
jae 0x3286
movq 0x30(%rsp), %r15
leaq (%r9,%r15), %rcx
movq 0x20(%rsp), %rdx
subq %rbp, %rdx
cmpq %rax, %rcx
ja 0x31f2
movl (%r14), %esi
imulq %rsi, %r11
movq %r11, %rsi
subq %r9, %rsi
jbe 0x31f2
movl %ebp, %edi
leaq (%r9,%r15,2), %r8
movq %r11, %r9
negq %r9
cmpq %r11, %rcx
jb 0x32fd
leaq (%r9,%rcx), %r10
cmpq %r10, %rsi
jbe 0x31f2
decb -0x1(%rbx,%rdi)
cmpq %rax, %r8
ja 0x31f2
leaq (%rcx,%r15), %r10
addq %r15, %r8
subq %r15, %rsi
cmpq %r11, %rcx
movq %r10, %rcx
jb 0x32eb
jmp 0x31f2
cmpl $-0x5, %r15d
jl 0x3367
movl $0x2, %r14d
subl %r15d, %r14d
leaq (%rbx,%r14), %rdi
movslq %ebp, %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 %ebp, %r14d
movslq %r14d, %rax
movb $0x0, (%rbx,%rax)
jmp 0x34dc
cmpl $0x1, %ebp
jne 0x33a3
movb $0x65, 0x1(%rbx)
leal -0x1(%r15), %ecx
testl %r15d, %r15d
setle %dl
addb %dl, %dl
addb $0x2b, %dl
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
movb %dl, 0x2(%rbx)
cmpl $0x9, %eax
ja 0x340c
orb $0x30, %al
movb %al, 0x3(%rbx)
movl $0x4, %r14d
movl $0x2, %eax
jmp 0x346b
leaq 0x2(%rbx), %rdi
leaq 0x1(%rbx), %rsi
leal -0x1(%rbp), %eax
movslq %eax, %rdx
callq 0x10a0
movb $0x2e, 0x1(%rbx)
movslq %ebp, %rax
movb $0x65, 0x1(%rbx,%rax)
movslq %ebp, %rax
leal -0x1(%r15), %esi
leaq (%rbx,%rax), %rcx
addq $0x2, %rcx
addq $0x2, %rax
testl %r15d, %r15d
setle %dil
addb %dil, %dil
addb $0x2b, %dil
movl %esi, %edx
negl %edx
cmovsl %esi, %edx
movb %dil, (%rcx)
cmpl $0x9, %edx
ja 0x3476
orb $0x30, %dl
movb %dl, 0x1(%rcx)
movl $0x2, %r14d
movl $0x2, %esi
jmp 0x34d5
movl $0x1, %r14d
cmpl $0x64, %eax
jb 0x3438
movl %eax, %ecx
shrl $0x2, %ecx
leaq 0x569d(%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 0x577a(%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
leal 0x2(%r14), %eax
movb %dl, 0x3(%rbx,%rcx)
orl $0x4, %r14d
movl 0xc(%rsp), %ecx
movb $0x0, 0x2(%rbx,%rax)
jmp 0x34e0
movl $0x1, %esi
cmpl $0x64, %edx
jb 0x34a1
movl %edx, %esi
shrl $0x2, %esi
leaq 0x5634(%rip), %rdi      # 0x8ac0
movzbl (%rsi,%rdi), %esi
imull $-0x64, %esi, %edi
addl %edi, %edx
addl $0x30, %esi
movb %sil, 0x1(%rcx)
movl $0x2, %esi
movl %edx, %edi
sarl %edi
movslq %edi, %rdi
leaq 0x5711(%rip), %r8       # 0x8bc0
movzbl (%rdi,%r8), %edi
imull $0xf6, %edi, %r8d
addl %edx, %r8d
leal 0x30(%rdi), %edx
movl %esi, %edi
movb %dl, (%rcx,%rdi)
addb $0x30, %r8b
addl $0x2, %esi
movb %r8b, 0x1(%rcx,%rdi)
movl %esi, %r14d
movb $0x0, (%rcx,%rsi)
addl %eax, %r14d
movl 0xc(%rsp), %ecx
addl %ecx, %r14d
movl %r14d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq