// File: /workspace/github_c_makefile_star2_O0/TurkeyMcMac[P]ts3d/src/json.c
// Function: parse_number
static int parse_number(json_reader *reader, struct json_item *result)
{
	int status = JSON_ERROR_TOKEN;
	double num = 0.0;
	double sign = 1.0;
	int ch;
	NEXT_CHAR(reader, ch, goto error);
	if (ch == '-') {
		sign = -1.0;
		NEXT_CHAR(reader, ch, goto error);
	}
	if (ch == '0') {
		status = 0;
		NEXT_CHAR(reader, ch, goto finish);
	} else if (is_digit(ch)) {
		status = 0;
		do {
			num *= 10;
			num += to_digit(ch);
			NEXT_CHAR(reader, ch, goto finish);
		} while (is_digit(ch));
	} else {
		goto error;
	}
	if (ch == '.') {
		double fraction = 0.0;
		long n_digits = 0;
		status = JSON_ERROR_NUMBER_FORMAT;
		NEXT_CHAR(reader, ch, goto error);
		if (is_digit(ch)) {
			status = 0;
			do {
				n_digits++;
				fraction *= 10;
				fraction += to_digit(ch);
				NEXT_CHAR(reader, ch,
					num += fraction / pow(10, n_digits);
					goto finish);
			} while (is_digit(ch));
		} else {
			goto error;
		}
		num += fraction / pow(10, n_digits);
	}
	if (ch == 'e' || ch == 'E') {
		long expsign = 1;
		long exponent = 0;
		status = JSON_ERROR_NUMBER_FORMAT;
		NEXT_CHAR(reader, ch, goto error);
		switch (ch) {
		case '-':
			expsign = -1;
			/* FALLTHROUGH */
		case '+':
			NEXT_CHAR(reader, ch, goto error);
			break;
		}
		while (is_digit(ch)) {
			status = 0;
			if (exponent > (LONG_MAX - 9) / 10) {
				/* Avoid undefined signed overflow. */
				status = JSON_ERROR_NUMBER_FORMAT;
				goto error;
			}
			exponent *= 10;
			exponent += to_digit(ch);
			NEXT_CHAR(reader, ch,
				num *= pow(expsign * 10, exponent);
				goto finish;
			);
		}
		num *= pow(expsign * 10, exponent);
	}
	if (status) goto error;
	reexamine_char(reader);
finish:
	num *= sign;
	result->type = JSON_NUMBER;
	result->val.num = num;
	return -has_error(reader);

error:
	reexamine_char(reader);
	set_error(reader, status);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0xb, -0x1c(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x8631(%rip), %xmm0     # 0x11038
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8a22
jmp 0x8d6d
jmp 0x8a24
cmpl $0x2d, -0x34(%rbp)
jne 0x8a51
movsd 0x8aee(%rip), %xmm0     # 0x11520
movsd %xmm0, -0x30(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8a4d
jmp 0x8d6d
jmp 0x8a4f
jmp 0x8a51
cmpl $0x30, -0x34(%rbp)
jne 0x8a78
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8a74
jmp 0x8d31
jmp 0x8a76
jmp 0x8ae4
movl -0x34(%rbp), %edi
callq 0x8da0
cmpl $0x0, %eax
je 0x8add
movl $0x0, -0x1c(%rbp)
movsd 0x8a94(%rip), %xmm0     # 0x11528
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movl -0x34(%rbp), %edi
callq 0x8dd0
cvtsi2sd %eax, %xmm0
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8aca
jmp 0x8d31
jmp 0x8acc
jmp 0x8ace
movl -0x34(%rbp), %edi
callq 0x8da0
cmpl $0x0, %eax
jne 0x8a8c
jmp 0x8ae2
jmp 0x8d6d
jmp 0x8ae4
cmpl $0x2e, -0x34(%rbp)
jne 0x8c01
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl $0xa, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8b1b
jmp 0x8d6d
jmp 0x8b1d
movl -0x34(%rbp), %edi
callq 0x8da0
cmpl $0x0, %eax
je 0x8bc9
movl $0x0, -0x1c(%rbp)
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movsd 0x89df(%rip), %xmm0     # 0x11528
mulsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x34(%rbp), %edi
callq 0x8dd0
cvtsi2sd %eax, %xmm0
addsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8bb2
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
cvtsi2sdq -0x48(%rbp), %xmm1
movsd 0x8996(%rip), %xmm0     # 0x11528
callq 0x24f0
movaps %xmm0, %xmm1
movsd -0x60(%rbp), %xmm0
divsd %xmm1, %xmm0
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x8d31
jmp 0x8bb4
jmp 0x8bb6
movl -0x34(%rbp), %edi
callq 0x8da0
cmpl $0x0, %eax
jne 0x8b35
jmp 0x8bce
jmp 0x8d6d
movsd -0x40(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
cvtsi2sdq -0x48(%rbp), %xmm1
movsd 0x8942(%rip), %xmm0     # 0x11528
callq 0x24f0
movaps %xmm0, %xmm1
movsd -0x68(%rbp), %xmm0
divsd %xmm1, %xmm0
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
cmpl $0x65, -0x34(%rbp)
je 0x8c11
cmpl $0x45, -0x34(%rbp)
jne 0x8d20
movq $0x1, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movl $0xa, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8c3e
jmp 0x8d6d
jmp 0x8c40
movl -0x34(%rbp), %eax
movl %eax, -0x6c(%rbp)
subl $0x2b, %eax
je 0x8c5f
jmp 0x8c4d
movl -0x6c(%rbp), %eax
subl $0x2d, %eax
jne 0x8c7b
jmp 0x8c57
movq $-0x1, -0x50(%rbp)
jmp 0x8c61
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8c77
jmp 0x8d6d
jmp 0x8c79
jmp 0x8c7b
jmp 0x8c7d
movl -0x34(%rbp), %edi
callq 0x8da0
cmpl $0x0, %eax
je 0x8d01
movl $0x0, -0x1c(%rbp)
movabsq $0xccccccccccccccb, %rax # imm = 0xCCCCCCCCCCCCCCB
cmpq %rax, -0x58(%rbp)
jle 0x8cad
movl $0xa, -0x1c(%rbp)
jmp 0x8d6d
imulq $0xa, -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movl -0x34(%rbp), %edi
callq 0x8dd0
cltq
addq -0x58(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
callq 0x83e0
movl %eax, -0x34(%rbp)
cmpl $0x0, %eax
jge 0x8cfa
imulq $0xa, -0x50(%rbp), %rax
cvtsi2sd %rax, %xmm0
cvtsi2sdq -0x58(%rbp), %xmm1
callq 0x24f0
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x8d31
jmp 0x8cfc
jmp 0x8c7d
imulq $0xa, -0x50(%rbp), %rax
cvtsi2sd %rax, %xmm0
cvtsi2sdq -0x58(%rbp), %xmm1
callq 0x24f0
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x8d28
jmp 0x8d6d
movq -0x10(%rbp), %rdi
callq 0x8620
movsd -0x30(%rbp), %xmm0
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl $0x7, 0x10(%rax)
movsd -0x28(%rbp), %xmm0
movq -0x18(%rbp), %rax
movsd %xmm0, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0x7960
movl %eax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movl %eax, -0x4(%rbp)
jmp 0x8d89
movq -0x10(%rbp), %rdi
callq 0x8620
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x7d30
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)