// File: /workspace/github_cpp_makefile_star2_O2/sus304[P]ForRocket/./lib/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp
// Function: unsigned long boost::numeric::odeint::detail::integrate_adaptive<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>, std::reference_wrapper<forrocket::DynamicsBase>, std::array<double, 14ul>, double, boost::numeric::odeint::null_observer>(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>, std::reference_wrapper<forrocket::DynamicsBase>, std::array<double, 14ul>&, double&, double, double&, boost::numeric::odeint::null_observer, boost::numeric::odeint::controlled_stepper_tag)
size_t integrate_adaptive(
        Stepper stepper , System system , State &start_state ,
        Time &start_time , Time end_time , Time &dt ,
        Observer observer , controlled_stepper_tag
)
{
    typename odeint::unwrap_reference< Observer >::type &obs = observer;
    typename odeint::unwrap_reference< Stepper >::type &st = stepper;

    failed_step_checker fail_checker;  // to throw a runtime_error if step size adjustment fails
    size_t count = 0;
    while( less_with_sign( start_time , end_time , dt ) )
    {
        obs( start_state , start_time );
        if( less_with_sign( end_time , static_cast<Time>(start_time + dt) , dt ) )
        {
            dt = end_time - start_time;
        }

        controlled_step_result res;
        do
        {
            res = st.try_step( system , start_state , start_time , dt );
            fail_checker();  // check number of failed steps
        }
        while( res == fail );
        fail_checker.reset();  // if we reach here, the step was successful -> reset fail checker

        ++count;
    }
    obs( start_state , start_time );
    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x50(%rsp), %rbp
movq %rsp, %rax
movq $0x1f4, (%rax)          # imm = 0x1F4
xorl %eax, %eax
movsd 0xd758(%rip), %xmm5     # 0x35888
xorpd %xmm6, %xmm6
movsd %xmm0, 0x8(%rsp)
movsd (%r15), %xmm1
movapd %xmm0, %xmm4
subsd %xmm1, %xmm4
xorl %r9d, %r9d
ucomisd %xmm5, %xmm4
movsd (%r14), %xmm2
seta %r9b
movapd %xmm1, %xmm3
subsd %xmm0, %xmm3
xorl %edi, %edi
ucomisd %xmm5, %xmm3
seta %dil
ucomisd %xmm6, %xmm2
cmoval %r9d, %edi
cmpb $0x1, %dil
jne 0x281fe
movq %rax, 0x10(%rsp)
addsd %xmm2, %xmm1
movapd %xmm0, %xmm3
subsd %xmm1, %xmm3
subsd %xmm0, %xmm1
xorl %eax, %eax
ucomisd %xmm5, %xmm1
seta %al
xorl %edi, %edi
ucomisd %xmm5, %xmm3
seta %dil
ucomisd %xmm6, %xmm2
cmoval %eax, %edi
cmpb $0x1, %dil
jne 0x281b5
movsd %xmm4, (%r14)
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0x282aa
movl %eax, %r13d
movq %rsp, %rdi
callq 0x2820e
cmpl $0x1, %r13d
je 0x281b5
andl $0x0, 0x4(%rsp)
movq 0x10(%rsp), %rax
incq %rax
movsd 0x8(%rsp), %xmm0
movsd 0xd693(%rip), %xmm5     # 0x35888
xorpd %xmm6, %xmm6
jmp 0x2813a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop