// File: 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 %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movsd %xmm0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x118(%rbp)
addq $0x230, %rdi            # imm = 0x230
leaq 0x38bd7(%rip), %rsi     # 0x53c88
callq 0x6600
movq -0x118(%rbp), %rdx
movq %rdx, %rsi
addq $0xbb8, %rsi            # imm = 0xBB8
addq $0xbd0, %rdx            # imm = 0xBD0
leaq -0x30(%rbp), %rdi
movq %rdi, -0x150(%rbp)
callq 0x20e20
movq -0x150(%rbp), %rsi
movq -0x118(%rbp), %rdi
addq $0xc00, %rdi            # imm = 0xC00
movq %rdi, -0x148(%rbp)
callq 0x20e90
movq -0x148(%rbp), %rdi
callq 0x205d0
movq -0x148(%rbp), %rsi
movq -0x118(%rbp), %rax
movq %rax, %rdx
addq $0x7d0, %rdx            # imm = 0x7D0
movsd %xmm0, 0x7d0(%rax)
movsd 0x7d0(%rax), %xmm0
movsd 0x900(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x958(%rax)
movsd 0x7d0(%rax), %xmm1
movsd 0x910(%rax), %xmm0
movsd 0x37d01(%rip), %xmm2    # 0x52e60
mulsd %xmm2, %xmm0
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x7d8(%rax)
movsd 0x7d8(%rax), %xmm0
movsd 0x288(%rax), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x7e0(%rax)
movsd 0x7e0(%rax), %xmm0
movapd 0x37ea1(%rip), %xmm1    # 0x53040
movaps %xmm1, -0x130(%rbp)
pxor %xmm1, %xmm0
movlpd %xmm0, -0x58(%rbp)
leaq -0x68(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0x205f0
movq -0x140(%rbp), %rdx
leaq -0x50(%rbp), %rdi
movq %rdi, -0x138(%rbp)
leaq -0x58(%rbp), %rsi
callq 0x20ef0
movq -0x138(%rbp), %rsi
movq -0x118(%rbp), %rdi
addq $0xe10, %rdi            # imm = 0xE10
callq 0x20f30
movaps -0x130(%rbp), %xmm1
movq -0x118(%rbp), %rax
movq $0x0, 0x7f0(%rax)
movq $0x0, 0x7e8(%rax)
movq %rax, %rsi
addq $0xdf8, %rsi            # imm = 0xDF8
movsd 0x7e0(%rax), %xmm0
pxor %xmm1, %xmm0
movlpd %xmm0, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0x110(%rbp)
leaq -0x90(%rbp), %rdx
callq 0x1e1e0
movq -0x110(%rbp), %rdi
movq $0x0, -0x98(%rbp)
leaq -0x98(%rbp), %rsi
callq 0x1e220
movq %rax, -0x108(%rbp)
jmp 0x1b277
movq -0x108(%rbp), %rdi
movq $0x0, -0xb0(%rbp)
leaq -0xb0(%rbp), %rsi
callq 0x1e220
jmp 0x1b297
leaq -0x88(%rbp), %rdi
callq 0x1e390
movq -0x118(%rbp), %rdx
movq %rdx, %rsi
addq $0xb70, %rsi            # imm = 0xB70
addq $0xe10, %rdx            # imm = 0xE10
leaq -0x100(%rbp), %rdi
callq 0x20520
movq -0x118(%rbp), %rdx
addq $0xe58, %rdx            # imm = 0xE58
leaq -0xd8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
callq 0x20f60
movq -0x118(%rbp), %rdi
addq $0x9f0, %rdi            # imm = 0x9F0
leaq -0xd8(%rbp), %rsi
callq 0x20fd0
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa0(%rbp)
movl %eax, -0xa4(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x1e390
movq -0xa0(%rbp), %rdi
callq 0x67a0
nopw %cs:(%rax,%rax)