// File: 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
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x28(%rbp)
movsd 0x91fc(%rip), %xmm0     # 0x840f8
movsd %xmm0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movb $0x0, -0x41(%rbp)
movb $0x0, -0x42(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2b, %eax
jne 0x7af33
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7af5a
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x7af58
movsd 0x91c1(%rip), %xmm0     # 0x84108
movsd %xmm0, -0x30(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x7af5a
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x7b0f0
cmpl $0x0, %eax
je 0x7afae
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0xa, %edx
callq 0x90e0
cvtsi2sd %rax, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0x7afac
cvtsi2sdq -0x38(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movb $0x1, -0x41(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x7afae
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
jne 0x7b049
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x7b0f0
cmpl $0x0, %eax
je 0x7b047
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0xa, %edx
callq 0x90e0
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0x7b045
cvtsi2sdq -0x40(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
cvtsi2sd %rax, %xmm1
movsd 0x6fea(%rip), %xmm0     # 0x82008
callq 0x9940
movaps %xmm0, %xmm1
movsd -0x50(%rbp), %xmm0
divsd %xmm1, %xmm0
addsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
movb $0x1, -0x42(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0x7b047
jmp 0x7b049
cmpb $0x0, -0x41(%rbp)
jne 0x7b05f
cmpb $0x0, -0x42(%rbp)
jne 0x7b05f
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x7b0d6
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x65, %eax
je 0x7b077
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x45, %eax
jne 0x7b0c7
movl $0x0, -0x48(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0xa, %edx
callq 0x9780
movl %eax, -0x48(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
je 0x7b0c5
cvtsi2sdl -0x48(%rbp), %xmm1
movsd 0x6f52(%rip), %xmm0     # 0x82008
callq 0x9940
mulsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x28(%rbp)
jmp 0x7b0c7
movsd -0x28(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)