// File: /workspace/github_c_makefile_star2_O1/ccxvii[P]mujs/./jsdtoa.c
// Function: js_grisu2
int
js_grisu2(double v, char *buffer, int *K)
{
	int length, mk;
	diy_fp_t w_m, w_p, c_mk, Wp, Wm, delta;
	int q = 64, alpha = -59, gamma = -56;
	normalized_boundaries(v, &w_m, &w_p);
	mk = k_comp(w_p.e + q, alpha, gamma);
	c_mk = cached_power(mk);
	Wp = multiply(w_p, c_mk);
	Wm = multiply(w_m, c_mk);
	Wm.f++; Wp.f--;
	delta = minus(Wp, Wm);
	*K = -mk;
	digit_gen(Wp, delta, buffer, &length, K);
	return length;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %xmm0, %rax
movabsq $0x10000000000000, %rdx # imm = 0x10000000000000
leaq -0x1(%rdx), %rcx
andq %rax, %rcx
movq %rax, %r9
shrq $0x34, %r9
andl $0x7ff, %r9d            # imm = 0x7FF
movq %rcx, %rsi
btsq $0x34, %rsi
testl %r9d, %r9d
cmoveq %rcx, %rsi
leal -0x433(%r9), %eax
movl $0xfffffbce, %edi       # imm = 0xFFFFFBCE
cmovnel %eax, %edi
leaq (%rsi,%rsi), %r8
leal -0x1(%rdi), %eax
leaq 0x1(,%rsi,2), %r12
testl %r9d, %r9d
je 0xc361
movl %eax, %ebp
jmp 0xc389
movabsq $0x1fffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFF
andq %r12, %rcx
bsrq %rcx, %rcx
movl %ecx, %r9d
notb %cl
addb $0x36, %cl
shlq %cl, %r12
xorl $0x3f, %r9d
movl %edi, %ebp
subl %r9d, %ebp
addl $0x9, %ebp
shlq $0xa, %r12
addl $-0x2, %edi
decq %r8
cmpq %rdx, %rsi
movabsq $0x3fffffffffffff, %r15 # imm = 0x3FFFFFFFFFFFFF
cmovneq %r8, %r15
cmovel %edi, %eax
subl %ebp, %eax
addb $0xa, %al
movl %eax, %ecx
shlq %cl, %r15
movl $0xffffffce, %eax       # imm = 0xFFFFFFCE
subl %ebp, %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x1f152(%rip), %xmm0    # 0x2b518
callq 0x3090
cvttsd2si %xmm0, %eax
cltq
leaq 0x245f8(%rip), %rcx     # 0x309d0
movq 0xab8(%rcx,%rax,8), %rdx
movq %r12, %rcx
shrq $0x20, %rcx
movl %r12d, %edi
movl %edx, %r8d
shrq $0x20, %rdx
movq %rdx, %r9
imulq %rcx, %r9
movq %rdx, %rsi
imulq %rdi, %rsi
imulq %r8, %rcx
imulq %r8, %rdi
shrq $0x20, %rdi
movl %ecx, %r10d
addq %rdi, %r10
movl %esi, %edi
addq %r10, %rdi
subq $-0x80000000, %rdi      # imm = 0x80000000
shrq $0x20, %rcx
addq %r9, %rcx
shrq $0x20, %rsi
shrq $0x20, %rdi
movq %r15, %r9
shrq $0x20, %r9
movl %r15d, %r10d
movq %r9, %r11
imulq %rdx, %r11
imulq %r10, %rdx
imulq %r8, %r9
imulq %r8, %r10
shrq $0x20, %r10
movl %r9d, %r8d
addq %r10, %r8
movl %edx, %r10d
addq %r8, %r10
subq $-0x80000000, %r10      # imm = 0x80000000
shrq $0x20, %r9
addq %r11, %r9
shrq $0x20, %rdx
shrq $0x20, %r10
addq %r9, %rdx
addq %r10, %rdx
incq %rdx
addq %rcx, %rsi
leaq (%rdi,%rsi), %r8
decq %r8
movq %r8, %r9
subq %rdx, %r9
jb 0xc560
leaq 0x157(%rax), %rcx
leaq 0x25ab4(%rip), %rdx     # 0x31f50
addl (%rdx,%rcx,4), %ebp
movl $0xffffffca, %ecx       # imm = 0xFFFFFFCA
subl %ebp, %ecx
movq %r8, %rdi
shrq %cl, %rdi
movq $-0x1, %r10
shlq %cl, %r10
negl %eax
movl %eax, (%rbx)
notq %r10
andq %r10, %r8
movl $0x64, %r15d
movl $0x3, %r11d
xorl %esi, %esi
movl $0xcccccccd, %r12d      # imm = 0xCCCCCCCD
subl $0x1, %r11d
jb 0xc51f
cmpl %edi, %r15d
seta %al
testl %esi, %esi
sete %dl
testb %dl, %al
jne 0xc4fb
movl %edi, %eax
xorl %edx, %edx
divl %r15d
addb $0x30, %al
movslq %esi, %rdx
incl %esi
movb %al, (%r14,%rdx)
movl %edi, %eax
xorl %edx, %edx
divl %r15d
movl %r15d, %r15d
movl %edx, %edi
movq %rdi, %rax
shlq %cl, %rax
imulq %r12, %r15
shrq $0x23, %r15
addq %r8, %rax
cmpq %r9, %rax
ja 0xc4d4
jmp 0xc552
xorl %r11d, %r11d
addq %r8, %r8
leaq (%r8,%r8,4), %r8
movq %r8, %rax
shrq %cl, %rax
movl %eax, %edx
orl %esi, %edx
je 0xc540
addb $0x30, %al
movslq %esi, %rdx
incl %esi
movb %al, (%r14,%rdx)
andq %r10, %r8
decl %r11d
addq %r9, %r9
leaq (%r9,%r9,4), %r9
cmpq %r9, %r8
ja 0xc522
addl %r11d, (%rbx)
movl %esi, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27d5d(%rip), %rdi     # 0x342c4
leaq 0x27d28(%rip), %rsi     # 0x34296
leaq 0x27d2c(%rip), %rcx     # 0x342a1
movl $0x183, %edx            # imm = 0x183
callq 0x3130