// File: /workspace/github_cpp_makefile_star2_O3/sus304[P]ForRocket/src/rocket/engine.cpp
// Function: forrocket::Engine::Engine(std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, std::vector<double, std::allocator<double>>, double, double, double)
forrocket::Engine::Engine(const std::vector<double> time_vector, const std::vector<double> thrust_vacuum_vector, const std::vector<double> mdot_prop_vector, const double area_exit,
                    const double mis_alignment_angle_y_axis, const double mis_alignment_angle_z_axis) {
    Reset();
    enable_gimbal = false;

    this->area_exit = area_exit;
    this->burn_duration = time_vector[time_vector.size()-1];
    this->mis_alignment_angle_y_axis = mis_alignment_angle_y_axis;
    this->mis_alignment_angle_z_axis = mis_alignment_angle_z_axis;

    thrust_vacuum_src = InterpolateParameter(time_vector, thrust_vacuum_vector, "zero");
    mdot_prop_src = InterpolateParameter(time_vector, mdot_prop_vector, "zero");

    getTotalImpulse(thrust_vacuum_vector, time_vector.back());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %r15
movb $0x0, (%rdi)
addq $0x58, %rdi
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r15)
movups %xmm0, 0x18(%r15)
movups %xmm0, 0x28(%r15)
movups %xmm0, 0x38(%r15)
movups %xmm0, 0x41(%r15)
movq %rdi, (%rsp)
callq 0x19348
leaq 0xf8(%r15), %r14
movq %r14, %rdi
callq 0x19348
leaq 0x8(%r15), %rax
movb $0x0, (%r15)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movups %xmm0, 0x38(%r15)
movups %xmm0, 0x41(%r15)
movups %xmm0, 0x28(%r15)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x38(%r15)
movq 0x8(%r12), %rax
movsd -0x8(%rax), %xmm0
movsd %xmm0, 0x8(%r15)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x40(%r15)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x48(%r15)
leaq 0x68(%rsp), %rdi
movq %r12, %rsi
callq 0x7bca
leaq 0x50(%rsp), %rdi
movq %r13, %rsi
callq 0x7bca
leaq 0xb0(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x1ef91(%rip), %rsi     # 0x3a2d5
leaq 0x1ef8e(%rip), %rdx     # 0x3a2d9
leaq 0xa0(%rsp), %rdi
callq 0x9382
leaq 0xd8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x50(%rsp), %rdx
leaq 0xa0(%rsp), %rcx
callq 0x193b6
leaq 0xd8(%rsp), %rsi
movq (%rsp), %rdi
callq 0x196d2
movq 0x158(%rsp), %rdi
callq 0x53d0
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x1b3b2
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x1b3cf
movq 0x138(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x1b3ec
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x1b409
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0xa0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1b426
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5350
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1b43d
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x1b454
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0x7bca
leaq 0x20(%rsp), %rdi
movq %rbp, %rsi
callq 0x7bca
leaq 0x90(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x1ee54(%rip), %rsi     # 0x3a2d5
leaq 0x1ee51(%rip), %rdx     # 0x3a2d9
leaq 0x80(%rsp), %rdi
callq 0x9382
leaq 0xd8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x20(%rsp), %rdx
leaq 0x80(%rsp), %rcx
callq 0x193b6
leaq 0xd8(%rsp), %rsi
movq %r14, %rdi
callq 0x196d2
movq 0x158(%rsp), %rdi
callq 0x53d0
movq 0x140(%rsp), %rdi
testq %rdi, %rdi
je 0x1b4ee
movq 0x150(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0x128(%rsp), %rdi
testq %rdi, %rdi
je 0x1b50b
movq 0x138(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0x100(%rsp), %rdi
testq %rdi, %rdi
je 0x1b528
movq 0x110(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0xe8(%rsp), %rdi
testq %rdi, %rdi
je 0x1b545
movq 0xf8(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0x80(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1b562
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5350
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1b579
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1b590
movq 0x48(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
leaq 0xc0(%rsp), %rdi
movq %r13, %rsi
callq 0x7bca
movq 0x8(%r12), %rax
movsd -0x8(%rax), %xmm0
movq 0xc0(%rsp), %rdi
movq 0xc8(%rsp), %rax
xorpd %xmm1, %xmm1
cmpq %rax, %rdi
je 0x1b5d3
movq %rdi, %rcx
addsd (%rcx), %xmm1
addq $0x8, %rcx
cmpq %rax, %rcx
jne 0x1b5c6
subq %rdi, %rax
sarq $0x3, %rax
movq %rax, %xmm2
punpckldq 0x1bc79(%rip), %xmm2 # xmm2 = xmm2[0],mem[0],xmm2[1],mem[1]
subpd 0x1bc81(%rip), %xmm2    # 0x37270
movapd %xmm2, %xmm3
unpckhpd %xmm2, %xmm3            # xmm3 = xmm3[1],xmm2[1]
addsd %xmm2, %xmm3
divsd %xmm3, %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, 0x20(%r15)
testq %rdi, %rdi
je 0x1b61e
movq 0xd0(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1b707
movq %rax, %r15
leaq 0xd8(%rsp), %rdi
callq 0x18702
jmp 0x1b64a
movq %rax, %r15
movq 0x80(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1b66c
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x5350
jmp 0x1b66c
movq %rax, %r15
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x1b688
movq 0x30(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
jmp 0x1b688
movq %rax, %r15
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x1b70a
movq 0x48(%rsp), %rsi
jmp 0x1b6fd
jmp 0x1b707
movq %rax, %r15
leaq 0xd8(%rsp), %rdi
callq 0x18702
jmp 0x1b6b0
movq %rax, %r15
movq 0xa0(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1b6d2
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x5350
jmp 0x1b6d2
movq %rax, %r15
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1b6ee
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
jmp 0x1b6ee
movq %rax, %r15
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x1b70a
movq 0x78(%rsp), %rsi
subq %rdi, %rsi
callq 0x5350
jmp 0x1b70a
movq %rax, %r15
movq %r14, %rdi
callq 0x18702
movq (%rsp), %rdi
callq 0x18702
movq %r15, %rdi
callq 0x55e0
movq %rax, %r15
jmp 0x1b712