// File: /workspace/github_c_makefile_star2_O3/ArtifexSoftware[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 0xc0a5
movl %eax, %ebp
jmp 0xc0c9
movabsq $0x1fffffffffffff, %rcx # imm = 0x1FFFFFFFFFFFFF
andq %r12, %rcx
bsrq %rcx, %rcx
movl %ecx, %ebp
xorl $-0x40, %ebp
notb %cl
addb $0x36, %cl
shlq %cl, %r12
addl $0xfffffbd8, %ebp       # imm = 0xFFFFFBD8
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 0x1f412(%rip), %xmm0    # 0x2b518
callq 0x3090
cvttsd2si %xmm0, %eax
cltq
leaq 0x248e8(%rip), %rcx     # 0x30a00
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 0xc2af
leaq 0x157(%rax), %rcx
leaq 0x25da4(%rip), %rdx     # 0x31f80
addl (%rdx,%rcx,4), %ebp
movl $0xffffffca, %ecx       # imm = 0xFFFFFFCA
subl %ebp, %ecx
movq %r8, %rsi
shrq %cl, %rsi
movq $-0x1, %r10
shlq %cl, %r10
negl %eax
movl %eax, (%rbx)
notq %r10
andq %r10, %r8
movl $0x64, %r15d
movl $0x3, %r11d
xorl %ebp, %ebp
movl $0xcccccccd, %r12d      # imm = 0xCCCCCCCD
subl $0x1, %r11d
jb 0xc265
cmpl %esi, %r15d
seta %al
testl %ebp, %ebp
sete %dl
xorl %edi, %edi
testb %dl, %al
jne 0xc23f
movl %esi, %eax
xorl %edx, %edx
divl %r15d
addb $0x30, %al
movslq %ebp, %rdx
incl %ebp
movb %al, (%r14,%rdx)
movl %ebp, %edi
movl %esi, %eax
xorl %edx, %edx
divl %r15d
movl %r15d, %r15d
imulq %r12, %r15
movl %edx, %esi
movq %rsi, %rax
shlq %cl, %rax
shrq $0x23, %r15
addq %r8, %rax
movl %edi, %ebp
cmpq %r9, %rax
ja 0xc214
jmp 0xc2a1
xorl %r11d, %r11d
addq %r8, %r8
leaq (%r8,%r8,4), %r8
movq %r8, %rax
shrq %cl, %rax
movl %eax, %edx
orl %ebp, %edx
movl $0x0, %edi
je 0xc28d
addb $0x30, %al
movslq %ebp, %rdx
incl %ebp
movb %al, (%r14,%rdx)
movl %ebp, %edi
andq %r10, %r8
decl %r11d
addq %r9, %r9
leaq (%r9,%r9,4), %r9
movl %edi, %ebp
cmpq %r9, %r8
ja 0xc268
addl %r11d, (%rbx)
movl %edi, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2803e(%rip), %rdi     # 0x342f4
leaq 0x28009(%rip), %rsi     # 0x342c6
leaq 0x2800d(%rip), %rcx     # 0x342d1
movl $0x183, %edx            # imm = 0x183
callq 0x3130