// File: istellartech[P]OpenTsiolkovsky/./boost/numeric/odeint/integrate/detail/integrate_const.hpp
// Function: unsigned long boost::numeric::odeint::detail::integrate_const<boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::array<double, 14ul>, double, std::array<double, 14ul>, double, boost::numeric::odeint::array_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>, boost::numeric::odeint::default_error_checker<double, boost::numeric::odeint::array_algebra, boost::numeric::odeint::default_operations>, boost::numeric::odeint::default_step_adjuster<double, double>, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_fsal_tag>, boost::numeric::odeint::explicit_controlled_stepper_fsal_tag>, RocketStage, std::array<double, 14ul>, double, std::reference_wrapper<CsvObserver>>(boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::array<double, 14ul>, double, std::array<double, 14ul>, double, boost::numeric::odeint::array_algebra, boost::numeric::odeint::default_operations, boost::numeric::odeint::initially_resizer>, boost::numeric::odeint::default_error_checker<double, boost::numeric::odeint::array_algebra, boost::numeric::odeint::default_operations>, boost::numeric::odeint::default_step_adjuster<double, double>, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_fsal_tag>, boost::numeric::odeint::explicit_controlled_stepper_fsal_tag>, RocketStage, std::array<double, 14ul>&, double, double, double, std::reference_wrapper<CsvObserver>, boost::numeric::odeint::dense_output_stepper_tag)
size_t integrate_const(
        Stepper stepper , System system , State &start_state ,
        Time start_time , Time end_time , Time dt ,
        Observer observer , dense_output_stepper_tag
)
{
    typename odeint::unwrap_reference< Observer >::type &obs = observer;
    typename odeint::unwrap_reference< Stepper >::type &st = stepper;

    Time time = start_time;
    
    st.initialize( start_state , time , dt );
    obs( start_state , time );
    time += dt;

    int obs_step( 1 );
    int real_step( 0 );
    
    while( less_eq_with_sign( static_cast<Time>(time+dt) , end_time , dt ) )
    {
        while( less_eq_with_sign( time , st.current_time() , dt ) )
        {
            st.calc_state( time , start_state );
            obs( start_state , time );
            ++obs_step;
            // direct computation of the time avoids error propagation happening when using time += dt
            // we need clumsy type analysis to get boost units working here
            time = start_time + static_cast< typename unit_value_type<Time>::type >(obs_step) * dt;
        }
        // we have not reached the end, do another real step
        if( less_with_sign( static_cast<Time>(st.current_time()+st.current_time_step()) ,
                            end_time ,
                            st.current_time_step() ) )
        {
            while( less_eq_with_sign( st.current_time() , time , dt ) )
            {
                st.do_step( system );
                ++real_step;
            }
        }
        else if( less_with_sign( st.current_time() , end_time , st.current_time_step() ) )
        { // do the last step ending exactly on the end point
            st.initialize( st.current_state() , st.current_time() , end_time - st.current_time() );
            st.do_step( system );
            ++real_step;
        }
        
    }
    // last observation, if we are still in observation interval
    // might happen due to finite precision problems when computing the the time
    if( less_eq_with_sign( time , end_time , dt ) )
    {
        st.calc_state( time , start_state );
        obs( start_state , time );
    }
    
    return real_step;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1eb0, %rsp           # imm = 0x1EB0
movq %rdi, -0x1e20(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x1e18(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x30(%rbp)
movsd %xmm2, -0x38(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x2cbf0
movq %rax, %rcx
movq -0x1e18(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x20(%rbp), %rsi
movsd -0x50(%rbp), %xmm0
movsd -0x38(%rbp), %xmm1
callq 0x2cc10
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movsd -0x50(%rbp), %xmm0
movq (%rdi), %rax
callq *0x8(%rax)
movsd -0x38(%rbp), %xmm0
addsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x50(%rbp)
movl $0x1, -0x54(%rbp)
movl $0x0, -0x58(%rbp)
movsd -0x50(%rbp), %xmm0
addsd -0x38(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
callq 0x2cce0
testb $0x1, %al
jne 0x2c886
jmp 0x2cb94
jmp 0x2c888
movsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x1e28(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2cd60
movaps %xmm0, %xmm1
movsd -0x1e28(%rbp), %xmm0
movsd -0x38(%rbp), %xmm2
callq 0x2cce0
testb $0x1, %al
jne 0x2c8b9
jmp 0x2c905
movq -0x48(%rbp), %rdi
movsd -0x50(%rbp), %xmm0
movq -0x20(%rbp), %rsi
callq 0x2cd80
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movsd -0x50(%rbp), %xmm0
movq (%rdi), %rax
callq *0x8(%rax)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
movsd -0x28(%rbp), %xmm1
cvtsi2sdl -0x54(%rbp), %xmm0
movsd -0x38(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x50(%rbp)
jmp 0x2c888
movq -0x48(%rbp), %rdi
callq 0x2cd60
movsd %xmm0, -0x1e40(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2cec0
movaps %xmm0, %xmm1
movsd -0x1e40(%rbp), %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x1e30(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x1e38(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2cec0
movsd -0x1e38(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x1e30(%rbp), %xmm0
callq 0x2ce30
testb $0x1, %al
jne 0x2c96d
jmp 0x2ca3c
jmp 0x2c96f
movq -0x48(%rbp), %rdi
callq 0x2cd60
movsd -0x50(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
callq 0x2cce0
testb $0x1, %al
jne 0x2c990
jmp 0x2ca37
movq -0x1e20(%rbp), %rsi
movq -0x48(%rbp), %rax
movq %rax, -0x1e60(%rbp)
leaq -0xf20(%rbp), %rdi
movq %rdi, -0x1e58(%rbp)
callq 0x1f580
movq -0x1e60(%rbp), %rdi
movq -0x1e58(%rbp), %rsi
callq 0x2cee0
movsd %xmm1, -0x1e50(%rbp)
movsd %xmm0, -0x1e48(%rbp)
jmp 0x2c9da
movsd -0x1e50(%rbp), %xmm0
movsd -0x1e48(%rbp), %xmm1
movsd %xmm1, -0xf40(%rbp)
movsd %xmm0, -0xf38(%rbp)
leaq -0xf20(%rbp), %rdi
callq 0xb260
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x2c96f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf28(%rbp)
movl %eax, -0xf2c(%rbp)
leaq -0xf20(%rbp), %rdi
callq 0xb260
jmp 0x2cbe0
jmp 0x2cb8f
movq -0x48(%rbp), %rdi
callq 0x2cd60
movsd %xmm0, -0x1e68(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x1e70(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2cec0
movsd -0x1e70(%rbp), %xmm1
movaps %xmm0, %xmm2
movsd -0x1e68(%rbp), %xmm0
callq 0x2ce30
testb $0x1, %al
jne 0x2ca84
jmp 0x2cb8d
movq -0x48(%rbp), %rdi
movq %rdi, -0x1ea8(%rbp)
callq 0x2d120
movq %rax, -0x1ea0(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2cd60
movsd %xmm0, -0x1e98(%rbp)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x1eb0(%rbp)
movq -0x48(%rbp), %rdi
callq 0x2cd60
movsd -0x1eb0(%rbp), %xmm1
movq -0x1ea8(%rbp), %rdi
movq -0x1ea0(%rbp), %rsi
movaps %xmm0, %xmm2
movsd -0x1e98(%rbp), %xmm0
subsd %xmm2, %xmm1
callq 0x2cc10
movq -0x1e20(%rbp), %rsi
movq -0x48(%rbp), %rax
movq %rax, -0x1e90(%rbp)
leaq -0x1e00(%rbp), %rdi
movq %rdi, -0x1e88(%rbp)
callq 0x1f580
movq -0x1e90(%rbp), %rdi
movq -0x1e88(%rbp), %rsi
callq 0x2cee0
movsd %xmm1, -0x1e80(%rbp)
movsd %xmm0, -0x1e78(%rbp)
jmp 0x2cb36
movsd -0x1e80(%rbp), %xmm0
movsd -0x1e78(%rbp), %xmm1
movsd %xmm1, -0x1e10(%rbp)
movsd %xmm0, -0x1e08(%rbp)
leaq -0x1e00(%rbp), %rdi
callq 0xb260
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0x2cb8d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf28(%rbp)
movl %eax, -0xf2c(%rbp)
leaq -0x1e00(%rbp), %rdi
callq 0xb260
jmp 0x2cbe0
jmp 0x2cb8f
jmp 0x2c864
movsd -0x50(%rbp), %xmm0
movsd -0x30(%rbp), %xmm1
movsd -0x38(%rbp), %xmm2
callq 0x2cce0
testb $0x1, %al
jne 0x2cbae
jmp 0x2cbd3
movq -0x48(%rbp), %rdi
movsd -0x50(%rbp), %xmm0
movq -0x20(%rbp), %rsi
callq 0x2cd80
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movsd -0x50(%rbp), %xmm0
movq (%rdi), %rax
callq *0x8(%rax)
movslq -0x58(%rbp), %rax
addq $0x1eb0, %rsp           # imm = 0x1EB0
popq %rbp
retq
movq -0xf28(%rbp), %rdi
callq 0x67a0
nopl (%rax)