// File: /workspace/github_cpp_makefile_star2_O1/joncampbell123[P]haxcc/haxpp.cpp
// Function: parse_dec_number_float_sub(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>&, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
long double parse_dec_number_float_sub(string::iterator &li,const string::iterator lie) {
    long double r = 0;

    if (li != lie) {
        unsigned long long tmp = 0,tmpdiv = 1;

        /* NTS: Process digits in batches to allow precision in integer math and reduce cumulative floating point error */
        while (li != lie && isdigit(*li)) {
            if (tmpdiv >= 100000000000ull) {
                r = (r * tmpdiv) + tmp;
                tmpdiv = 1;
                tmp = 0;
            }

            tmp = (tmp * 10ull) + ((unsigned long long)(*(li++) - '0'));
            tmpdiv *= 10ull;
        }

        if (tmpdiv > 1ull) {
            r = (r * tmpdiv) + tmp;
        }
    }

    if (li != lie && *li == '.') {
        unsigned long long tmp = 0,tmpdiv = 1;
        long double d = 1.0;

        /* skip '.' */
        li++;

        /* NTS: Process digits in batches to allow precision in integer math and reduce cumulative floating point error */
        while (li != lie && isdigit(*li)) {
            if (tmpdiv >= 100000000000ull) {
                d *= (signed long long)tmpdiv; /* only because on x86 there is only a signed divide by int */
                r += tmp / d;
                tmpdiv = 1;
                tmp = 0;
            }

            tmp = (tmp * 10ull) + ((unsigned long long)(*(li++) - '0'));
            tmpdiv *= 10ull;
        }

        if (tmpdiv > 1ull) {
            d *= (signed long long)tmpdiv; /* only because on x86 there is only a signed divide by int */
            r += tmp / d;
        }
    }

    if (strit_next_match_inc(li,lie,'e'))
        parse_float_exponent(r,li,lie);
    else if (strit_next_match_inc(li,lie,'E'))
        parse_float_exponent(r,li,lie);

    return r;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rdx
movq %rdi, %rsi
fldz
fld %st(0)
fstpt (%rsp)
cmpq %rdx, (%rdi)
je 0x48fc
movq (%rsi), %r9
fldt (%rsp)
cmpq %rdx, %r9
je 0x48c7
fstp %st(1)
movl $0x1, %eax
movabsq $0x174876e7ff, %r8      # imm = 0x174876E7FF
xorl %edi, %edi
leaq 0xee8e(%rip), %rcx      # 0x136b8
movq $-0x30, %r10
movl $0xa, %r11d
movsbl (%r9), %ebx
addl $-0x30, %ebx
cmpl $0x9, %ebx
ja 0x48ac
xorl %ebx, %ebx
testq %rax, %rax
sets %bl
xorl %r14d, %r14d
testq %rdi, %rdi
sets %r14b
cmpq %r8, %rax
movq %rax, 0x48(%rsp)
fildll 0x48(%rsp)
fadds (%rcx,%rbx,4)
movq %rdi, 0x50(%rsp)
fildll 0x50(%rsp)
fadds (%rcx,%r14,4)
fxch %st(1)
fmul %st(2), %st
faddp %st, %st(1)
fxch %st(1)
fcmovnbe %st(1), %st
fstp %st(1)
leaq (%rax,%rax), %rax
leaq 0x1(%r9), %rbx
leaq (%rax,%rax,4), %rax
leaq (%rdi,%rdi,4), %rdi
leaq -0x30(%rdi,%rdi), %rdi
cmovaq %r10, %rdi
movq %rbx, (%rsi)
cmovaq %r11, %rax
movsbq (%r9), %r9
addq %r9, %rdi
movq %rbx, %r9
cmpq %rdx, %rbx
jne 0x4837
movq %rdi, 0x40(%rsp)
xorl %r8d, %r8d
testq %rdi, %rdi
sets %r8b
fildll 0x40(%rsp)
fadds (%rcx,%r8,4)
fxch %st(1)
jmp 0x48cc
movl $0x1, %eax
fstpt (%rsp)
cmpq $0x2, %rax
jb 0x48fc
fldt (%rsp)
movq %rax, 0x38(%rsp)
xorl %ecx, %ecx
testq %rax, %rax
sets %cl
fildll 0x38(%rsp)
leaq 0xedc8(%rip), %rax      # 0x136b8
fadds (%rax,%rcx,4)
fmulp %st, %st(1)
faddp %st, %st(1)
fstpt (%rsp)
fldz
fstp %st(0)
movq (%rsi), %rdi
cmpq %rdx, %rdi
fldz
fldz
je 0x49fe
fstp %st(1)
fstp %st(0)
cmpb $0x2e, (%rdi)
fldz
fldz
jne 0x49fe
fstp %st(1)
fstp %st(0)
incq %rdi
movq %rdi, (%rsi)
fldt (%rsp)
fldz
fld1
cmpq %rdx, %rdi
je 0x49d5
fstp %st(0)
fstp %st(0)
fld1
movl $0x1, %eax
movabsq $0x174876e7ff, %r8      # imm = 0x174876E7FF
xorl %r9d, %r9d
leaq 0xed60(%rip), %rcx      # 0x136b8
movsbl (%rdi), %r10d
addl $-0x30, %r10d
cmpl $0x9, %r10d
ja 0x49bc
cmpq %r8, %rax
jbe 0x4996
movq %rax, 0x28(%rsp)
fildll 0x28(%rsp)
fmulp %st, %st(1)
movq %r9, 0x30(%rsp)
xorl %eax, %eax
testq %r9, %r9
sets %al
fildll 0x30(%rsp)
fadds (%rcx,%rax,4)
fdiv %st(1), %st
faddp %st, %st(2)
movl $0x1, %eax
xorl %r9d, %r9d
leaq (%r9,%r9,4), %r9
leaq 0x1(%rdi), %r10
movq %r10, (%rsi)
movsbq (%rdi), %rdi
leaq (%rdi,%r9,2), %r9
addq $-0x30, %r9
addq %rax, %rax
leaq (%rax,%rax,4), %rax
movq %r10, %rdi
cmpq %rdx, %r10
jne 0x4958
movq %r9, 0x20(%rsp)
xorl %edi, %edi
testq %r9, %r9
sets %dil
fildll 0x20(%rsp)
fadds (%rcx,%rdi,4)
fxch %st(1)
jmp 0x49da
movl $0x1, %eax
fxch %st(2)
fstpt (%rsp)
cmpq $0x2, %rax
jb 0x49fe
movq %rax, 0x18(%rsp)
fildll 0x18(%rsp)
fmulp %st, %st(2)
fdivp %st, %st(1)
fldt (%rsp)
faddp %st, %st(1)
fstpt (%rsp)
fldz
fldz
fstp %st(1)
fstp %st(0)
movq (%rsi), %rax
cmpq %rdx, %rax
je 0x4a0f
cmpb $0x65, (%rax)
je 0x4a1c
movq (%rsi), %rax
cmpq %rdx, %rax
je 0x4a2a
cmpb $0x45, (%rax)
jne 0x4a2a
incq %rax
movq %rax, (%rsi)
movq %rsp, %rdi
callq 0x4350
fldt (%rsp)
addq $0x58, %rsp
popq %rbx
popq %r14
retq