// File: /workspace/github_c_makefile_star2_O3/jonof[P]jftekwar/jfbuild/src/scriptfile.c
// Function: scriptfile_getdouble
int scriptfile_getdouble(scriptfile *sf, double *num)
{
	skipoverws(sf);
	if (sf->textptr >= sf->eof)
	{
		buildprintf("Error on line %s:%d: unexpected eof\n",sf->filename,scriptfile_getlinum(sf,sf->textptr));
		return -1;
	}
	
	sf->ltextptr = sf->textptr;

	// On Linux, locale settings interfere with interpreting x.y format numbers
	//(*num) = strtod((const char *)sf->textptr,&sf->textptr);
	(*num) = parsedouble(sf->textptr, &sf->textptr);
	
	if (!ISWS(*sf->textptr) && *sf->textptr) {
		char *p = sf->textptr;
		skipovertoken(sf);
		buildprintf("Error on line %s:%d: expecting float, got \"%s\"\n",sf->filename,scriptfile_getlinum(sf,sf->ltextptr),p);
		return -2;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x18(%rdi), %rsi
movq 0x20(%rdi), %rax
cmpq %rax, %rsi
jae 0x4d68e
cmpb $0x0, (%rsi)
jne 0x4d68e
incq %rsi
movq %rsi, 0x18(%rbx)
cmpq %rax, %rsi
jae 0x4d76d
movq %rsi, 0x10(%rbx)
movb (%rsi), %r15b
leal -0x2b(%r15), %eax
andb $-0x3, %al
cmpb $0x1, %al
adcq $0x0, %rsi
movsd 0x2a96e(%rip), %xmm0    # 0x78020
xorpd %xmm3, %xmm3
xorl %ecx, %ecx
movl $0x1, %edx
movsd 0x2a963(%rip), %xmm1    # 0x78028
xorl %eax, %eax
movzbl (%rsi), %edi
leal -0x30(%rdi), %r8d
cmpb $0x9, %r8b
ja 0x4d6f2
testl %edx, %edx
je 0x4d727
movsbl %r8b, %edx
xorps %xmm2, %xmm2
cvtsi2sd %edx, %xmm2
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movl $0x1, %edx
jmp 0x4d765
cmpl $0x65, %edi
je 0x4d70e
cmpl $0x45, %edi
je 0x4d70e
cmpl $0x2e, %edi
jne 0x4d793
testl %edx, %edx
jne 0x4d735
jmp 0x4d793
leaq 0x1(%rsi), %rdi
movzbl 0x1(%rsi), %ecx
cmpl $0x2d, %ecx
je 0x4d739
cmpl $0x2b, %ecx
jne 0x4d743
movl $0x1, %ecx
jmp 0x4d73e
testl %ecx, %ecx
je 0x4d74a
movzbl %r8b, %edx
leal (%rax,%rax,4), %eax
leal (%rdx,%rax,2), %eax
xorl %edx, %edx
jmp 0x4d765
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rdi, %rsi
jmp 0x4d765
movl $0x1, %ecx
jmp 0x4d765
movsbl %r8b, %ecx
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm2, %xmm3
divsd %xmm1, %xmm0
xorl %edx, %edx
xorl %ecx, %ecx
incq %rsi
jmp 0x4d6c7
movq 0x28(%rbx), %r14
movq %rbx, %rdi
callq 0x4d50c
leaq 0x2a8c0(%rip), %rdi     # 0x78040
movq %r14, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x25221
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4d7f3
movq %rsi, 0x18(%rbx)
testl %ecx, %ecx
je 0x4d7c0
imull %ecx, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x2a87b(%rip), %xmm0    # 0x78028
movapd %xmm3, (%rsp)
callq 0x6380
movapd (%rsp), %xmm3
mulsd %xmm0, %xmm3
cmpb $0x2d, %r15b
jne 0x4d7ce
xorpd 0x2a862(%rip), %xmm3    # 0x78030
movsd %xmm3, (%r14)
movq 0x18(%rbx), %r14
movzbl (%r14), %ecx
cmpq $0x20, %rcx
ja 0x4d7fd
xorl %eax, %eax
movabsq $0x100002601, %rdx      # imm = 0x100002601
btq %rcx, %rdx
jae 0x4d7fd
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x20(%rbx), %rax
cmpq %rax, %r14
jae 0x4d81c
leaq 0x1(%r14), %rcx
movq %rcx, 0x18(%rbx)
cmpq %rax, %rcx
je 0x4d81c
cmpb $0x0, (%rcx)
leaq 0x1(%rcx), %rcx
jne 0x4d80a
movq 0x10(%rbx), %rsi
movq 0x28(%rbx), %r15
movq %rbx, %rdi
callq 0x4d50c
leaq 0x2a832(%rip), %rdi     # 0x78065
movq %r15, %rsi
movl %eax, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x25221
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x4d7f3