// File: /workspace/github_cpp_makefile_star2_O3/istellartech[P]OpenTsiolkovsky/src/rocket.cpp
// Function: RocketStage::free_flight_ballistic(std::array<double, 14ul> const&, double)
void RocketStage::free_flight_ballistic(const RocketStage::state& x, double t){
    flight_mode = "free_ballistic";
    //    aerodynamics term
    vel_AIR_NEDframe_ = vel_ECEF_NEDframe_ - vel_wind_NEDframe_;
    vel_AIR_NEDframe_abs = vel_AIR_NEDframe_.norm();
    mach_number = vel_AIR_NEDframe_abs / air.airspeed;
    dynamic_pressure = 0.5 * air.density * vel_AIR_NEDframe_abs * vel_AIR_NEDframe_abs;
    force_axial = dynamic_pressure / ballistic_coef;
    force_air_vector_NEDframe = force_axial * (-1) * (vel_AIR_NEDframe_ / vel_AIR_NEDframe_abs);
    force_normal_pitch = force_normal_yaw = 0.0; // for csv output
    force_air_vector_BODYframe << -force_axial, 0.0, 0.0; // for csv output
    //    dv/dt
    accECI_ = dcmNED2ECI_ * force_air_vector_NEDframe + gravityECI_;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdi, %rbx
addq $0x230, %rdi            # imm = 0x230
movq 0x238(%rbx), %rdx
leaq 0x13595(%rip), %rcx     # 0x26a64
xorl %r14d, %r14d
movl $0xe, %r8d
xorl %esi, %esi
callq 0x5540
movupd 0xbb8(%rbx), %xmm0
subpd 0xbd0(%rbx), %xmm0
movapd %xmm0, 0xc00(%rbx)
movsd 0xbc8(%rbx), %xmm1
subsd 0xbe0(%rbx), %xmm1
movsd %xmm1, 0xc10(%rbx)
movapd %xmm0, %xmm2
mulpd %xmm0, %xmm2
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
movapd %xmm2, %xmm4
unpckhpd %xmm2, %xmm4            # xmm4 = xmm4[1],xmm2[1]
addsd %xmm3, %xmm4
addsd %xmm2, %xmm4
xorps %xmm3, %xmm3
sqrtsd %xmm4, %xmm3
movsd %xmm3, 0x7d0(%rbx)
movapd %xmm3, %xmm2
divsd 0x900(%rbx), %xmm2
movsd %xmm2, 0x958(%rbx)
movsd 0x910(%rbx), %xmm2
mulsd 0x127be(%rip), %xmm2    # 0x25d20
mulsd %xmm3, %xmm2
mulsd %xmm3, %xmm2
movsd %xmm2, 0x7d8(%rbx)
divsd 0x288(%rbx), %xmm2
movsd %xmm2, 0x7e0(%rbx)
xorpd 0x129c6(%rip), %xmm2    # 0x25f50
divsd %xmm3, %xmm1
unpcklpd %xmm3, %xmm3            # xmm3 = xmm3[0,0]
divpd %xmm3, %xmm0
pshufd $0x44, %xmm2, %xmm3     # xmm3 = xmm2[0,1,0,1]
mulpd %xmm0, %xmm3
movapd %xmm3, 0xe10(%rbx)
mulsd %xmm2, %xmm1
movsd %xmm1, 0xe20(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x7e8(%rbx)
leaq 0xdf8(%rbx), %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
movq %r14, 0x8(%rdi)
movl $0x1, %eax
movq %rax, 0x10(%rdi)
movq %rax, 0x18(%rdi)
movlpd %xmm2, 0xdf8(%rbx)
leaq 0x30(%rsp), %rsi
movq %r14, (%rsi)
callq 0x15520
leaq 0x28(%rsp), %rsi
movq $0x0, (%rsi)
movq %rax, %rdi
callq 0x15520
movq 0x20(%rsp), %rax
addq 0x10(%rsp), %rax
cmpq $0x3, %rax
jne 0x136f6
cmpq $0x1, 0x18(%rsp)
jne 0x136f6
movapd 0xb70(%rbx), %xmm4
movsd 0xe10(%rbx), %xmm2
movsd 0xe18(%rbx), %xmm1
movsd 0xe20(%rbx), %xmm0
movsd 0xb80(%rbx), %xmm3
mulsd %xmm2, %xmm3
movsd 0xb98(%rbx), %xmm5
mulsd %xmm1, %xmm5
addsd %xmm3, %xmm5
movsd 0xbb0(%rbx), %xmm3
mulsd %xmm0, %xmm3
unpcklpd %xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0]
movhpd 0xb78(%rbx), %xmm2      # xmm2 = xmm2[0],mem[0]
addsd %xmm5, %xmm3
mulpd %xmm4, %xmm2
movupd 0xb88(%rbx), %xmm4
unpcklpd %xmm1, %xmm1            # xmm1 = xmm1[0,0]
mulpd %xmm4, %xmm1
unpcklpd %xmm0, %xmm0            # xmm0 = xmm0[0,0]
mulpd 0xba0(%rbx), %xmm0
addpd %xmm2, %xmm1
addpd %xmm1, %xmm0
movupd 0xe58(%rbx), %xmm1
addpd %xmm0, %xmm1
movapd %xmm1, 0x9f0(%rbx)
addsd 0xe68(%rbx), %xmm3
movsd %xmm3, 0xa00(%rbx)
addq $0x38, %rsp
popq %rbx
popq %r14
retq
jmp 0x136d6
movq 0x20(%rsp), %rcx
addq 0x10(%rsp), %rcx
cmpq $0x3, %rcx
jne 0x136f6
cmpq $0x1, 0x18(%rsp)
jne 0x136f6
movq %rax, %rdi
callq 0x5650
leaq 0x13bd7(%rip), %rdi     # 0x272d4
leaq 0x13c57(%rip), %rsi     # 0x2735b
leaq 0x13c7d(%rip), %rcx     # 0x27388
movl $0x6a, %edx
callq 0x5250
nop