// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rdx
movq %rdi, %rsi
fldz
fld %st(0)
fstpt (%rsp)
movq (%rdi), %rax
movabsq $0x174876e7ff, %rcx     # imm = 0x174876E7FF
cmpq %rdx, %rax
je 0x418a
fstp %st(0)
pushq $0x1
popq %r10
fldz
xorl %r11d, %r11d
leaq 0xb673(%rip), %rdi      # 0xf748
pushq $-0x30
popq %r8
pushq $0xa
popq %r9
cmpq %rdx, %rax
je 0x4154
movsbl (%rax), %ebx
addl $-0x30, %ebx
cmpl $0x9, %ebx
ja 0x4154
xorl %r14d, %r14d
testq %r10, %r10
sets %r14b
xorl %r15d, %r15d
testq %r11, %r11
sets %r15b
imulq $0xa, %r10, %rbx
movq %r10, 0x48(%rsp)
fildll 0x48(%rsp)
movq %r11, 0x50(%rsp)
imulq $0xa, %r11, %r11
addq $-0x30, %r11
leaq 0x1(%rax), %r12
cmpq %rcx, %r10
fadds (%rdi,%r14,4)
fildll 0x50(%rsp)
fadds (%rdi,%r15,4)
fxch %st(1)
fmul %st(2), %st
faddp %st, %st(1)
fxch %st(1)
fcmovnbe %st(1), %st
fstp %st(1)
movq %r12, (%rsi)
cmovaq %r8, %r11
movsbq (%rax), %rax
cmovaq %r9, %rbx
addq %rax, %r11
movq %r12, %rax
movq %rbx, %r10
jmp 0x40dd
fld %st(0)
fstpt (%rsp)
cmpq $0x2, %r10
jb 0x418a
movq %r10, 0x38(%rsp)
fildll 0x38(%rsp)
movq %r11, 0x40(%rsp)
xorl %r8d, %r8d
testq %r11, %r11
sets %r8b
fildll 0x40(%rsp)
fadds (%rdi,%r8,4)
fxch %st(2)
fmulp %st, %st(1)
faddp %st, %st(1)
fld %st(0)
fstpt (%rsp)
cmpq %rdx, %rax
je 0x424f
cmpb $0x2e, (%rax)
jne 0x424f
incq %rax
movq %rax, (%rsi)
pushq $0x1
popq %r8
fld1
xorl %r9d, %r9d
leaq 0xb596(%rip), %rdi      # 0xf748
movq %r8, %r10
cmpq %rdx, %rax
je 0x4218
movsbl (%rax), %r11d
addl $-0x30, %r11d
cmpl $0x9, %r11d
ja 0x4218
cmpq %rcx, %r10
jbe 0x41f9
movq %r10, 0x28(%rsp)
fildll 0x28(%rsp)
fmulp %st, %st(1)
movq %r9, 0x30(%rsp)
xorl %r10d, %r10d
testq %r9, %r9
sets %r10b
fildll 0x30(%rsp)
fadds (%rdi,%r10,4)
fdiv %st(1), %st
faddp %st, %st(2)
movq %r8, %r10
xorl %r9d, %r9d
imulq $0xa, %r9, %r9
leaq 0x1(%rax), %r11
movq %r11, (%rsi)
movsbq (%rax), %rax
addq %rax, %r9
addq $-0x30, %r9
imulq $0xa, %r10, %r10
movq %r11, %rax
jmp 0x41b5
fld %st(1)
fstpt (%rsp)
cmpq $0x2, %r10
jb 0x424d
movq %r10, 0x18(%rsp)
fildll 0x18(%rsp)
movq %r9, 0x20(%rsp)
xorl %ecx, %ecx
testq %r9, %r9
sets %cl
fildll 0x20(%rsp)
fadds (%rdi,%rcx,4)
fxch %st(2)
fmulp %st, %st(1)
fdivrp %st, %st(1)
faddp %st, %st(1)
fstpt (%rsp)
jmp 0x4251
fstp %st(1)
fstp %st(0)
cmpq %rdx, %rax
je 0x426e
cmpb $0x65, (%rax)
je 0x4260
cmpb $0x45, (%rax)
jne 0x426e
incq %rax
movq %rax, (%rsi)
movq %rsp, %rdi
callq 0x3cf7
fldt (%rsp)
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq