// File: /workspace/github_c_makefile_star2_O0/Ihsoh[P]ilang/util.c
// Function: util_get_double_val
double util_get_double_val(const char *str, uint32_t len) {
	assert(str);
	assert(len > 0);

	double v = 0.0;
	double base = 1.0;

	#define	_GET_CHAR(idx)	((idx) >= len ? '\0' : str[(idx)])

	int idx = 0;
	
	while ((_GET_CHAR(idx) >= '0' && _GET_CHAR(idx) <= '9') || _GET_CHAR(idx) == '_') {
		if (_GET_CHAR(idx) == '_') {
			idx++;
			continue;
		}

		v *= 10.0;
		v += _GET_CHAR(idx) - '0';
		idx++;
	}

	if (_GET_CHAR(idx) == '.') {
		idx++;
	}

	base = 0.1;

	while ((_GET_CHAR(idx) >= '0' && _GET_CHAR(idx) <= '9') || _GET_CHAR(idx) == '_') {
		if (_GET_CHAR(idx) == '_') {
			idx++;
			continue;
		}

		v += (_GET_CHAR(idx) - '0') * base;
		base *= 0.1;
		idx++;
	}

	return v;

	#undef	_GET_CHAR
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x144d8
jmp 0x144f7
leaq 0x336ab(%rip), %rdi     # 0x47b8a
leaq 0x3405a(%rip), %rsi     # 0x48540
movl $0x29d, %edx            # imm = 0x29D
leaq 0x346ab(%rip), %rcx     # 0x48b9d
callq 0xa0b0
cmpl $0x0, -0xc(%rbp)
jbe 0x144ff
jmp 0x1451e
leaq 0x341a3(%rip), %rdi     # 0x486a9
leaq 0x34033(%rip), %rsi     # 0x48540
movl $0x29e, %edx            # imm = 0x29E
leaq 0x34684(%rip), %rcx     # 0x48b9d
callq 0xa0b0
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x33ffa(%rip), %xmm0    # 0x48528
movsd %xmm0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x14549
xorl %eax, %eax
movl %eax, -0x28(%rbp)
jmp 0x14558
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl $0x30, %eax
jl 0x1458b
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x1456f
xorl %eax, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1457e
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
movb $0x1, %al
cmpl $0x39, %ecx
movb %al, -0x2d(%rbp)
jle 0x145b5
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x1459a
xorl %eax, %eax
movl %eax, -0x34(%rbp)
jmp 0x145a9
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl $0x5f, %eax
sete %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
testb $0x1, %al
jne 0x145c1
jmp 0x14647
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x145d0
xorl %eax, %eax
movl %eax, -0x38(%rbp)
jmp 0x145df
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl $0x5f, %eax
jne 0x145f5
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1453a
movsd 0x33f3b(%rip), %xmm0    # 0x48538
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x14616
xorl %eax, %eax
movl %eax, -0x3c(%rbp)
jmp 0x14625
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
subl $0x30, %eax
cvtsi2sd %eax, %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1453a
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x14656
xorl %eax, %eax
movl %eax, -0x40(%rbp)
jmp 0x14665
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl $0x2e, %eax
jne 0x14676
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
movsd 0x33eb2(%rip), %xmm0    # 0x48530
movsd %xmm0, -0x20(%rbp)
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x14692
xorl %eax, %eax
movl %eax, -0x44(%rbp)
jmp 0x146a1
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl $0x30, %eax
jl 0x146d4
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x146b8
xorl %eax, %eax
movl %eax, -0x48(%rbp)
jmp 0x146c7
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %ecx
movb $0x1, %al
cmpl $0x39, %ecx
movb %al, -0x49(%rbp)
jle 0x146fe
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x146e3
xorl %eax, %eax
movl %eax, -0x50(%rbp)
jmp 0x146f2
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl $0x5f, %eax
sete %al
movb %al, -0x49(%rbp)
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x1470a
jmp 0x1479d
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x14719
xorl %eax, %eax
movl %eax, -0x54(%rbp)
jmp 0x14728
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl $0x5f, %eax
jne 0x1473e
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x14683
movl -0x24(%rbp), %eax
cmpl -0xc(%rbp), %eax
jb 0x1474d
xorl %eax, %eax
movl %eax, -0x58(%rbp)
jmp 0x1475c
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x58(%rbp)
movl -0x58(%rbp), %eax
subl $0x30, %eax
cvtsi2sd %eax, %xmm0
movsd -0x20(%rbp), %xmm2
movsd -0x18(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x33dab(%rip), %xmm0    # 0x48530
mulsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x14683
movsd -0x18(%rbp), %xmm0
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)