// File: /workspace/github_c_makefile_star2_O1/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), %rcx
movq 0x20(%rdi), %rax
cmpq %rax, %rcx
jae 0x4aeaf
cmpb $0x0, (%rcx)
jne 0x4aeaf
incq %rcx
movq %rcx, 0x18(%rbx)
movq 0x18(%rbx), %rsi
cmpq %rax, %rsi
jae 0x4af87
movq %rsi, 0x10(%rbx)
movb (%rsi), %r15b
leal -0x2b(%r15), %eax
andb $-0x3, %al
cmpb $0x1, %al
adcq $0x0, %rsi
movsd 0x2be59(%rip), %xmm0    # 0x76d30
xorpd %xmm3, %xmm3
xorl %ecx, %ecx
movl $0x1, %edx
movsd 0x2be4e(%rip), %xmm1    # 0x76d38
xorl %eax, %eax
movzbl (%rsi), %edi
leal -0x30(%rdi), %r8d
cmpb $0x9, %r8b
ja 0x4af17
movzbl %r8b, %edi
testl %edx, %edx
je 0x4af49
xorps %xmm2, %xmm2
cvtsi2sd %edi, %xmm2
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
movl $0x1, %edx
jmp 0x4af7f
cmpl $0x65, %edi
je 0x4af30
cmpl $0x45, %edi
je 0x4af30
cmpl $0x2e, %edi
jne 0x4afad
testl %edx, %edx
jne 0x4af53
jmp 0x4afad
leaq 0x1(%rsi), %rdi
movzbl 0x1(%rsi), %ecx
cmpl $0x2d, %ecx
je 0x4af57
cmpl $0x2b, %ecx
jne 0x4af61
movl $0x1, %ecx
jmp 0x4af5c
testl %ecx, %ecx
je 0x4af68
leal (%rax,%rax,4), %eax
leal (%rdi,%rax,2), %eax
xorl %edx, %edx
jmp 0x4af7f
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movq %rdi, %rsi
jmp 0x4af7f
movl $0x1, %ecx
jmp 0x4af7f
xorps %xmm2, %xmm2
cvtsi2sd %edi, %xmm2
mulsd %xmm0, %xmm2
addsd %xmm2, %xmm3
divsd %xmm1, %xmm0
xorl %edx, %edx
xorl %ecx, %ecx
incq %rsi
jmp 0x4aeec
movq 0x28(%rbx), %r14
movq %rbx, %rdi
callq 0x4ad2c
leaq 0x2bdb6(%rip), %rdi     # 0x76d50
movq %r14, %rsi
movl %eax, %edx
xorl %eax, %eax
callq 0x24cb4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x4b00d
movq %rsi, 0x18(%rbx)
testl %ecx, %ecx
je 0x4afda
imull %ecx, %eax
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x2bd71(%rip), %xmm0    # 0x76d38
movapd %xmm3, (%rsp)
callq 0x6380
movapd (%rsp), %xmm3
mulsd %xmm0, %xmm3
cmpb $0x2d, %r15b
jne 0x4afe8
xorpd 0x2bd58(%rip), %xmm3    # 0x76d40
movsd %xmm3, (%r14)
movq 0x18(%rbx), %r14
movzbl (%r14), %ecx
cmpq $0x20, %rcx
ja 0x4b017
xorl %eax, %eax
movabsq $0x100002601, %rdx      # imm = 0x100002601
btq %rcx, %rdx
jae 0x4b017
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq 0x20(%rbx), %rax
cmpq %rax, %r14
jae 0x4b034
movq %r14, %rcx
cmpb $0x0, (%rcx)
je 0x4b034
incq %rcx
movq %rcx, 0x18(%rbx)
cmpq %rax, %rcx
jne 0x4b023
movq 0x10(%rbx), %rsi
movq 0x28(%rbx), %r15
movq %rbx, %rdi
callq 0x4ad2c
leaq 0x2bd2a(%rip), %rdi     # 0x76d75
movq %r15, %rsi
movl %eax, %edx
movq %r14, %rcx
xorl %eax, %eax
callq 0x24cb4
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x4b00d