// File: /workspace/github_c_makefile_star2_O0/ccxvii[P]mujs/./jsdtoa.c
// Function: js_strtod
double
js_strtod(const char *string, char **endPtr)
{
	int sign, expSign = FALSE;
	double fraction, dblExp, *d;
	register const char *p;
	register int c;

	/* Exponent read from "EX" field. */
	int exp = 0;

	/* Exponent that derives from the fractional part. Under normal
	 * circumstances, it is the negative of the number of digits in F.
	 * However, if I is very long, the last digits of I get dropped
	 * (otherwise a long I with a large negative exponent could cause an
	 * unnecessary overflow on I alone). In this case, fracExp is
	 * incremented one for each dropped digit.
	 */
	int fracExp = 0;

	/* Number of digits in mantissa. */
	int mantSize;

	/* Number of mantissa digits BEFORE decimal point. */
	int decPt;

	/* Temporarily holds location of exponent in string. */
	const char *pExp;

	/*
	 * Strip off leading blanks and check for a sign.
	 */

	p = string;
	while (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\r') {
		p += 1;
	}
	if (*p == '-') {
		sign = TRUE;
		p += 1;
	} else {
		if (*p == '+') {
			p += 1;
		}
		sign = FALSE;
	}

	/*
	 * Count the number of digits in the mantissa (including the decimal
	 * point), and also locate the decimal point.
	 */

	decPt = -1;
	for (mantSize = 0; ; mantSize += 1)
	{
		c = *p;
		if (!(c>='0'&&c<='9')) {
			if ((c != '.') || (decPt >= 0)) {
				break;
			}
			decPt = mantSize;
		}
		p += 1;
	}

	/*
	 * Now suck up the digits in the mantissa. Use two integers to
	 * collect 9 digits each (this is faster than using floating-point).
	 * If the mantissa has more than 18 digits, ignore the extras, since
	 * they can't affect the value anyway.
	 */

	pExp = p;
	p -= mantSize;
	if (decPt < 0) {
		decPt = mantSize;
	} else {
		mantSize -= 1;			/* One of the digits was the point. */
	}
	if (mantSize > 18) {
		fracExp = decPt - 18;
		mantSize = 18;
	} else {
		fracExp = decPt - mantSize;
	}
	if (mantSize == 0) {
		fraction = 0.0;
		p = string;
		goto done;
	} else {
		int frac1, frac2;
		frac1 = 0;
		for ( ; mantSize > 9; mantSize -= 1)
		{
			c = *p;
			p += 1;
			if (c == '.') {
				c = *p;
				p += 1;
			}
			frac1 = 10*frac1 + (c - '0');
		}
		frac2 = 0;
		for (; mantSize > 0; mantSize -= 1)
		{
			c = *p;
			p += 1;
			if (c == '.') {
				c = *p;
				p += 1;
			}
			frac2 = 10*frac2 + (c - '0');
		}
		fraction = (1.0e9 * frac1) + frac2;
	}

	/*
	 * Skim off the exponent.
	 */

	p = pExp;
	if ((*p == 'E') || (*p == 'e')) {
		p += 1;
		if (*p == '-') {
			expSign = TRUE;
			p += 1;
		} else {
			if (*p == '+') {
				p += 1;
			}
			expSign = FALSE;
		}
		while ((*p >= '0') && (*p <= '9') && exp < INT_MAX/100) {
			exp = exp * 10 + (*p - '0');
			p += 1;
		}
		while ((*p >= '0') && (*p <= '9'))
			p += 1;
	}
	if (expSign) {
		exp = fracExp - exp;
	} else {
		exp = fracExp + exp;
	}

	/*
	 * Generate a floating-point number that represents the exponent.
	 * Do this by processing the exponent one bit at a time to combine
	 * many powers of 2 of 10. Then combine the exponent with the
	 * fraction.
	 */

	if (exp < -maxExponent) {
		exp = maxExponent;
		expSign = TRUE;
		errno = ERANGE;
	} else if (exp > maxExponent) {
		exp = maxExponent;
		expSign = FALSE;
		errno = ERANGE;
	} else if (exp < 0) {
		expSign = TRUE;
		exp = -exp;
	} else {
		expSign = FALSE;
	}
	dblExp = 1.0;
	for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
		if (exp & 01) {
			dblExp *= *d;
		}
	}
	if (expSign) {
		fraction /= dblExp;
	} else {
		fraction *= dblExp;
	}

done:
	if (endPtr != NULL) {
		*endPtr = (char *) p;
	}

	if (sign) {
		return -fraction;
	}
	return fraction;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x69(%rbp)
je 0xb600
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x69(%rbp)
je 0xb600
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0xa, %ecx
movb %al, -0x69(%rbp)
je 0xb600
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
sete %al
movb %al, -0x69(%rbp)
movb -0x69(%rbp), %al
testb $0x1, %al
jne 0xb609
jmp 0xb617
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xb5bd
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xb638
movl $0x1, -0x1c(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xb657
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0xb650
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0xffffffff, -0x54(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0x50(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
cmpl $0x30, -0x44(%rbp)
jl 0xb67b
cmpl $0x39, -0x44(%rbp)
jle 0xb68f
cmpl $0x2e, -0x44(%rbp)
jne 0xb687
cmpl $0x0, -0x54(%rbp)
jl 0xb689
jmp 0xb6a6
movl -0x50(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xb665
movq -0x40(%rbp), %rax
movq %rax, -0x60(%rbp)
movl -0x50(%rbp), %ecx
movq -0x40(%rbp), %rax
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x40(%rbp)
cmpl $0x0, -0x54(%rbp)
jge 0xb6d2
movl -0x50(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0xb6db
movl -0x50(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
cmpl $0x12, -0x50(%rbp)
jle 0xb6f3
movl -0x54(%rbp), %eax
subl $0x12, %eax
movl %eax, -0x4c(%rbp)
movl $0x12, -0x50(%rbp)
jmp 0xb6fc
movl -0x54(%rbp), %eax
subl -0x50(%rbp), %eax
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x50(%rbp)
jne 0xb717
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0xb9fe
movl $0x0, -0x64(%rbp)
cmpl $0x9, -0x50(%rbp)
jle 0xb770
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
cmpl $0x2e, -0x44(%rbp)
jne 0xb756
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
imull $0xa, -0x64(%rbp), %eax
movl -0x44(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x64(%rbp)
movl -0x50(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xb71e
movl $0x0, -0x68(%rbp)
cmpl $0x0, -0x50(%rbp)
jle 0xb7c9
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
cmpl $0x2e, -0x44(%rbp)
jne 0xb7af
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
imull $0xa, -0x68(%rbp), %eax
movl -0x44(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x68(%rbp)
movl -0x50(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xb777
cvtsi2sdl -0x64(%rbp), %xmm0
cvtsi2sdl -0x68(%rbp), %xmm1
movsd 0x27cbd(%rip), %xmm2    # 0x33498
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x45, %eax
je 0xb80c
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x65, %eax
jne 0xb8ef
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0xb839
movl $0x1, -0x20(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xb858
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0xb851
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movl $0x0, -0x20(%rbp)
jmp 0xb85a
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x6a(%rbp)
jl 0xb889
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x39, %ecx
movb %al, -0x6a(%rbp)
jg 0xb889
cmpl $0x147ae14, -0x48(%rbp) # imm = 0x147AE14
setl %al
movb %al, -0x6a(%rbp)
movb -0x6a(%rbp), %al
testb $0x1, %al
jne 0xb892
jmp 0xb8b3
imull $0xa, -0x48(%rbp), %eax
movq -0x40(%rbp), %rcx
movsbl (%rcx), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x48(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xb85a
jmp 0xb8b5
movq -0x40(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x30, %ecx
movb %al, -0x6b(%rbp)
jl 0xb8d6
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x39, %eax
setle %al
movb %al, -0x6b(%rbp)
movb -0x6b(%rbp), %al
testb $0x1, %al
jne 0xb8df
jmp 0xb8ed
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0xb8b5
jmp 0xb8ef
cmpl $0x0, -0x20(%rbp)
je 0xb900
movl -0x4c(%rbp), %eax
subl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0xb909
movl -0x4c(%rbp), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
xorl %ecx, %ecx
subl 0x3b90c(%rip), %ecx     # 0x47220
cmpl %ecx, %eax
jge 0xb935
movl 0x3b902(%rip), %eax     # 0x47220
movl %eax, -0x48(%rbp)
movl $0x1, -0x20(%rbp)
callq 0x32b0
movl $0x22, (%rax)
jmp 0xb97f
movl -0x48(%rbp), %eax
cmpl 0x3b8e2(%rip), %eax     # 0x47220
jle 0xb95d
movl 0x3b8da(%rip), %eax     # 0x47220
movl %eax, -0x48(%rbp)
movl $0x0, -0x20(%rbp)
callq 0x32b0
movl $0x22, (%rax)
jmp 0xb97d
cmpl $0x0, -0x48(%rbp)
jge 0xb974
movl $0x1, -0x20(%rbp)
xorl %eax, %eax
subl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
jmp 0xb97b
movl $0x0, -0x20(%rbp)
jmp 0xb97d
jmp 0xb97f
movsd 0x27ae9(%rip), %xmm0    # 0x33470
movsd %xmm0, -0x30(%rbp)
leaq 0x3b89d(%rip), %rax     # 0x47230
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x48(%rbp)
je 0xb9d2
movl -0x48(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xb9ba
movq -0x38(%rbp), %rax
movsd (%rax), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
jmp 0xb9bc
movl -0x48(%rbp), %eax
sarl %eax
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x38(%rbp)
jmp 0xb997
cmpl $0x0, -0x20(%rbp)
je 0xb9ed
movsd -0x30(%rbp), %xmm1
movsd -0x28(%rbp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0xb9fc
movsd -0x30(%rbp), %xmm0
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0xb9fe
cmpq $0x0, -0x18(%rbp)
je 0xba10
movq -0x40(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
cmpl $0x0, -0x1c(%rbp)
je 0xba39
movsd -0x28(%rbp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0xba43
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x70, %rsp
popq %rbp
retq
nop