// File: /workspace/github_cpp_makefile_star2_O3/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)
movq (%rdi), %r9
cmpq %rdx, %r9
je 0x47fc
fstp %st(0)
fldz
movl $0x1, %r8d
movabsq $0x174876e7ff, %r10     # imm = 0x174876E7FF
xorl %edi, %edi
leaq 0xefcf(%rip), %rcx      # 0x13748
movq $-0x30, %r11
movl $0xa, %ebx
movsbl (%r9), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x4801
xorl %eax, %eax
testq %r8, %r8
sets %al
xorl %r14d, %r14d
testq %rdi, %rdi
sets %r14b
cmpq %r10, %r8
movq %r8, 0x48(%rsp)
fildll 0x48(%rsp)
fadds (%rcx,%rax,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 (%r8,%r8), %r8
leaq 0x1(%r9), %rax
leaq (%r8,%r8,4), %r8
leaq (%rdi,%rdi,4), %rdi
leaq -0x30(%rdi,%rdi), %rdi
cmovaq %r11, %rdi
movq %rax, (%rsi)
cmovaq %rbx, %r8
movsbq (%r9), %r9
addq %r9, %rdi
movq %rax, %r9
cmpq %rdx, %rax
jne 0x4785
jmp 0x4804
movq %r9, %rax
jmp 0x483a
movq %r9, %rax
fld %st(0)
fstpt (%rsp)
cmpq $0x2, %r8
jb 0x483a
movq %r8, 0x38(%rsp)
fildll 0x38(%rsp)
movq %rdi, 0x40(%rsp)
xorl %r8d, %r8d
testq %rdi, %rdi
sets %r8b
fildll 0x40(%rsp)
fadds (%rcx,%r8,4)
fxch %st(2)
fmulp %st, %st(1)
faddp %st, %st(1)
fld %st(0)
fstpt (%rsp)
cmpq %rdx, %rax
je 0x48dd
cmpb $0x2e, (%rax)
jne 0x48dd
incq %rax
movq %rax, (%rsi)
cmpq %rdx, %rax
je 0x48e1
fld1
movl $0x1, %edi
movabsq $0x174876e7ff, %r9      # imm = 0x174876E7FF
xorl %r8d, %r8d
leaq 0xeed2(%rip), %rcx      # 0x13748
movsbl (%rax), %r10d
addl $-0x30, %r10d
cmpl $0x9, %r10d
ja 0x48e6
cmpq %r9, %rdi
jbe 0x48b5
movq %rdi, 0x28(%rsp)
fildll 0x28(%rsp)
fmulp %st, %st(1)
movq %r8, 0x30(%rsp)
xorl %edi, %edi
testq %r8, %r8
sets %dil
fildll 0x30(%rsp)
fadds (%rcx,%rdi,4)
fdiv %st(1), %st
faddp %st, %st(2)
movl $0x1, %edi
xorl %r8d, %r8d
leaq (%r8,%r8,4), %r8
leaq 0x1(%rax), %r10
movq %r10, (%rsi)
movsbq (%rax), %rax
leaq (%rax,%r8,2), %r8
addq $-0x30, %r8
addq %rdi, %rdi
leaq (%rdi,%rdi,4), %rdi
movq %r10, %rax
cmpq %rdx, %r10
jne 0x4876
jmp 0x48e9
fstp %st(0)
jmp 0x4923
fstpt (%rsp)
jmp 0x4923
movq %rax, %r10
fld %st(1)
fstpt (%rsp)
cmpq $0x2, %rdi
jb 0x491c
movq %r8, 0x18(%rsp)
xorl %eax, %eax
testq %r8, %r8
sets %al
fildll 0x18(%rsp)
fadds (%rcx,%rax,4)
movq %rdi, 0x20(%rsp)
fildll 0x20(%rsp)
fmulp %st, %st(2)
fdivp %st, %st(1)
faddp %st, %st(1)
fstpt (%rsp)
jmp 0x4920
fstp %st(1)
fstp %st(0)
movq %r10, %rax
cmpq %rdx, %rax
je 0x4940
cmpb $0x65, (%rax)
je 0x4932
cmpb $0x45, (%rax)
jne 0x4940
incq %rax
movq %rax, (%rsi)
movq %rsp, %rdi
callq 0x4309
fldt (%rsp)
addq $0x58, %rsp
popq %rbx
popq %r14
retq