// File: /workspace/github_c_makefile_star2_O0/ccxvii[P]mujs/./jsvalue.c
// Function: jsV_numbertostring
const char *jsV_numbertostring(js_State *J, char buf[32], double f)
{
	char digits[32], *p = buf, *s = digits;
	int exp, ndigits, point;

	if (f == 0) return "0";
	if (isnan(f)) return "NaN";
	if (isinf(f)) return f < 0 ? "-Infinity" : "Infinity";

	/* Fast case for integers. This only works assuming all integers can be
	 * exactly represented by a float. This is true for 32-bit integers and
	 * 64-bit floats. */
	if (f >= INT_MIN && f <= INT_MAX) {
		int i = (int)f;
		if ((double)i == f)
			return js_itoa(buf, i);
	}

	ndigits = js_grisu2(f, digits, &exp);
	point = ndigits + exp;

	if (signbit(f))
		*p++ = '-';

	if (point < -5 || point > 21) {
		*p++ = *s++;
		if (ndigits > 1) {
			int n = ndigits - 1;
			*p++ = '.';
			while (n--)
				*p++ = *s++;
		}
		js_fmtexp(p, point - 1);
	}

	else if (point <= 0) {
		*p++ = '0';
		*p++ = '.';
		while (point++ < 0)
			*p++ = '0';
		while (ndigits-- > 0)
			*p++ = *s++;
		*p = 0;
	}

	else {
		while (ndigits-- > 0) {
			*p++ = *s++;
			if (--point == 0 && ndigits > 0)
				*p++ = '.';
		}
		while (point-- > 0)
			*p++ = '0';
		*p = 0;
	}

	return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movsd %xmm0, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
movsd -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x13085
jp 0x13085
leaq 0x2a682(%rip), %rax     # 0x3d6fe
movq %rax, -0x8(%rbp)
jmp 0x1336a
movsd -0x20(%rbp), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x13097
jmp 0x130a7
leaq 0x28233(%rip), %rax     # 0x3b2d1
movq %rax, -0x8(%rbp)
jmp 0x1336a
movsd -0x20(%rbp), %xmm1
movaps %xmm1, %xmm0
movaps 0x27fba(%rip), %xmm2    # 0x3b070
pand %xmm2, %xmm0
movq %xmm1, %rdx
movl $0x1, %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq $0x0, %rdx
cmovll %eax, %ecx
movsd 0x20330(%rip), %xmm1    # 0x33408
xorl %eax, %eax
ucomisd %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
cmpl $0x0, %eax
je 0x13117
movsd -0x20(%rbp), %xmm1
xorps %xmm0, %xmm0
leaq 0x29032(%rip), %rax     # 0x3c131
leaq 0x29034(%rip), %rcx     # 0x3c13a
ucomisd %xmm1, %xmm0
cmovaq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x1336a
movsd -0x20(%rbp), %xmm0
movsd 0x203ac(%rip), %xmm1    # 0x334d0
ucomisd %xmm1, %xmm0
jb 0x13166
movsd 0x20376(%rip), %xmm0    # 0x334a8
ucomisd -0x20(%rbp), %xmm0
jb 0x13166
cvttsd2si -0x20(%rbp), %eax
movl %eax, -0x60(%rbp)
cvtsi2sdl -0x60(%rbp), %xmm0
ucomisd -0x20(%rbp), %xmm0
jne 0x13164
jp 0x13164
movq -0x18(%rbp), %rdi
movl -0x60(%rbp), %esi
callq 0x12b50
movq %rax, -0x8(%rbp)
jmp 0x1336a
jmp 0x13166
movsd -0x20(%rbp), %xmm0
leaq -0x40(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xaf70
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
addl -0x54(%rbp), %eax
movl %eax, -0x5c(%rbp)
movsd -0x20(%rbp), %xmm0
movq %xmm0, %rax
cmpq $0x0, %rax
jge 0x131a6
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movb $0x2d, (%rax)
cmpl $-0x5, -0x5c(%rbp)
jl 0x131b6
cmpl $0x15, -0x5c(%rbp)
jle 0x13243
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x50(%rbp)
movb (%rax), %cl
movq -0x48(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
movb %cl, (%rax)
cmpl $0x1, -0x58(%rbp)
jle 0x1322f
movl -0x58(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x64(%rbp)
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movb $0x2e, (%rax)
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x64(%rbp)
cmpl $0x0, %eax
je 0x1322d
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x50(%rbp)
movb (%rax), %cl
movq -0x48(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
movb %cl, (%rax)
jmp 0x131f9
jmp 0x1322f
movq -0x48(%rbp), %rdi
movl -0x5c(%rbp), %esi
subl $0x1, %esi
callq 0xae80
jmp 0x13362
cmpl $0x0, -0x5c(%rbp)
jg 0x132d7
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movb $0x30, (%rax)
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movb $0x2e, (%rax)
movl -0x5c(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x5c(%rbp)
cmpl $0x0, %eax
jge 0x13295
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movb $0x30, (%rax)
jmp 0x13271
jmp 0x13297
movl -0x58(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x58(%rbp)
cmpl $0x0, %eax
jle 0x132cb
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x50(%rbp)
movb (%rax), %cl
movq -0x48(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
movb %cl, (%rax)
jmp 0x13297
movq -0x48(%rbp), %rax
movb $0x0, (%rax)
jmp 0x13360
jmp 0x132d9
movl -0x58(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x58(%rbp)
cmpl $0x0, %eax
jle 0x13333
movq -0x50(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x50(%rbp)
movb (%rax), %cl
movq -0x48(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x48(%rbp)
movb %cl, (%rax)
movl -0x5c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x5c(%rbp)
cmpl $0x0, %eax
jne 0x13331
cmpl $0x0, -0x58(%rbp)
jle 0x13331
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movb $0x2e, (%rax)
jmp 0x132d9
jmp 0x13335
movl -0x5c(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x5c(%rbp)
cmpl $0x0, %eax
jle 0x13359
movq -0x48(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x48(%rbp)
movb $0x30, (%rax)
jmp 0x13335
movq -0x48(%rbp), %rax
movb $0x0, (%rax)
jmp 0x13362
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)