// File: /workspace/github_cpp_makefile_star2_O1/thierry7100[P]CutOptim/include/nanosvg.h
// Function: nsvg__atof(char const*)
static double nsvg__atof(const char* s)
{
	char* cur = (char*)s;
	char* end = NULL;
	double res = 0.0, sign = 1.0;
	long long intPart = 0, fracPart = 0;
	char hasIntPart = 0, hasFracPart = 0;

	// Parse optional sign
	if (*cur == '+') {
		cur++;
	} else if (*cur == '-') {
		sign = -1;
		cur++;
	}

	// Parse integer part
	if (nsvg__isdigit(*cur)) {
		// Parse digit sequence
		intPart = (double)strtoll(cur, &end, 10);
		if (cur != end) {
			res = (double)intPart;
			hasIntPart = 1;
			cur = end;
		}
	}

	// Parse fractional part.
	if (*cur == '.') {
		cur++; // Skip '.'
		if (nsvg__isdigit(*cur)) {
			// Parse digit sequence
			fracPart = strtoll(cur, &end, 10);
			if (cur != end) {
				res += (double)fracPart / pow(10.0, (double)(end - cur));
				hasFracPart = 1;
				cur = end;
			}
		}
	}

	// A valid number should have integer or fractional part.
	if (!hasIntPart && !hasFracPart)
		return 0.0;

	// Parse optional exponent
	if (*cur == 'e' || *cur == 'E') {
		int expPart = 0;
		cur++; // skip 'E'
		expPart = strtol(cur, &end, 10); // Parse digit sequence with sign
		if (cur != end) {
			res *= pow(10.0, (double)expPart);
		}
	}

	return res * sign;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq $0x0, 0x8(%rsp)
movzbl (%rdi), %eax
cmpl $0x2d, %eax
je 0x3aba8
movsd 0x2470(%rip), %xmm0     # 0x3d008
movsd %xmm0, 0x10(%rsp)
cmpl $0x2b, %eax
jne 0x3abb9
incq %rbx
jmp 0x3abb9
incq %rbx
movsd 0x4595(%rip), %xmm0     # 0x3f148
movsd %xmm0, 0x10(%rsp)
movb (%rbx), %al
addb $-0x3a, %al
xorpd %xmm1, %xmm1
cmpb $-0xa, %al
jae 0x3abc9
xorl %ebp, %ebp
jmp 0x3ac09
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x70c0
movq (%r14), %rcx
cmpq %rcx, %rbx
je 0x3ac03
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
cvttsd2si %xmm0, %rax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
movb $0x1, %bpl
movq %rcx, %rbx
jmp 0x3ac09
xorl %ebp, %ebp
xorpd %xmm1, %xmm1
cmpb $0x2e, (%rbx)
jne 0x3ac1a
movb 0x1(%rbx), %al
incq %rbx
addb $-0x3a, %al
cmpb $-0xa, %al
jae 0x3ac81
xorl %eax, %eax
orb %al, %bpl
xorpd %xmm0, %xmm0
cmpb $0x1, %bpl
jne 0x3acf8
movzbl (%rbx), %eax
orl $0x20, %eax
cmpl $0x65, %eax
jne 0x3acee
movsd %xmm1, (%rsp)
incq %rbx
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x75a0
cmpq (%r14), %rbx
je 0x3ace9
xorps %xmm1, %xmm1
cvtsi2sd %eax, %xmm1
movsd 0x23a7(%rip), %xmm0     # 0x3d018
callq 0x7720
movsd (%rsp), %xmm1
mulsd %xmm0, %xmm1
jmp 0x3acee
movsd %xmm1, (%rsp)
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x70c0
movq (%r14), %r14
cmpq %r14, %rbx
je 0x3ad01
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
movsd %xmm0, 0x18(%rsp)
movq %r14, %rax
subq %rbx, %rax
xorps %xmm1, %xmm1
cvtsi2sd %rax, %xmm1
movsd 0x2351(%rip), %xmm0     # 0x3d018
callq 0x7720
movsd 0x18(%rsp), %xmm2
divsd %xmm0, %xmm2
movsd (%rsp), %xmm1
addsd %xmm2, %xmm1
movb $0x1, %al
movq %r14, %rbx
jmp 0x3ac1c
movsd (%rsp), %xmm1
movsd 0x10(%rsp), %xmm0
mulsd %xmm1, %xmm0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
movsd (%rsp), %xmm1
jmp 0x3ac1c