// File: 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
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rsi, -0x280(%rbp)
movq %rdx, -0x278(%rbp)
movq %rcx, -0x270(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x30(%rbp)
movsd %xmm2, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x260(%rbp)
movb $0x0, (%rdi)
movq $0x0, 0x8(%rdi)
movq $0x0, 0x10(%rdi)
movq $0x0, 0x18(%rdi)
movq $0x0, 0x20(%rdi)
movq $0x0, 0x28(%rdi)
movq $0x0, 0x30(%rdi)
movq $0x0, 0x38(%rdi)
movq $0x0, 0x40(%rdi)
movq $0x0, 0x48(%rdi)
movb $0x0, 0x50(%rdi)
addq $0x58, %rdi
movq %rdi, -0x268(%rbp)
callq 0x3bb50
movq -0x260(%rbp), %rdi
addq $0xf8, %rdi
movq %rdi, -0x258(%rbp)
callq 0x3bb50
jmp 0x43a85
movq -0x260(%rbp), %rdi
callq 0x43050
movq -0x260(%rbp), %rax
movq -0x280(%rbp), %rdi
movb $0x0, 0x50(%rax)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0x38(%rax)
callq 0x86e0
movq -0x280(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x27ce0
movq -0x280(%rbp), %rsi
movq %rax, %rcx
movq -0x260(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x8(%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, 0x40(%rax)
movsd -0x38(%rbp), %xmm0
movsd %xmm0, 0x48(%rax)
leaq -0x100(%rbp), %rdi
callq 0x85f0
jmp 0x43b00
movq -0x278(%rbp), %rsi
leaq -0x118(%rbp), %rdi
callq 0x85f0
jmp 0x43b15
leaq -0x139(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0x6770
movq -0x288(%rbp), %rdx
leaq 0x51557(%rip), %rsi     # 0x9508d
leaq -0x138(%rbp), %rdi
callq 0xd1d0
jmp 0x43b44
leaq -0xe8(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x118(%rbp), %rdx
leaq -0x138(%rbp), %rcx
callq 0x3bc30
jmp 0x43b67
movq -0x260(%rbp), %rdi
addq $0x58, %rdi
leaq -0xe8(%rbp), %rsi
callq 0x3bfd0
jmp 0x43b80
leaq -0xe8(%rbp), %rdi
callq 0x365b0
leaq -0x138(%rbp), %rdi
callq 0x6898
leaq -0x139(%rbp), %rdi
callq 0x6490
leaq -0x118(%rbp), %rdi
callq 0x7760
leaq -0x100(%rbp), %rdi
callq 0x7760
movq -0x280(%rbp), %rsi
leaq -0x1f8(%rbp), %rdi
callq 0x85f0
jmp 0x43bd1
movq -0x270(%rbp), %rsi
leaq -0x210(%rbp), %rdi
callq 0x85f0
jmp 0x43be6
leaq -0x231(%rbp), %rdi
movq %rdi, -0x290(%rbp)
callq 0x6770
movq -0x290(%rbp), %rdx
leaq 0x51486(%rip), %rsi     # 0x9508d
leaq -0x230(%rbp), %rdi
callq 0xd1d0
jmp 0x43c15
leaq -0x1e0(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
leaq -0x210(%rbp), %rdx
leaq -0x230(%rbp), %rcx
callq 0x3bc30
jmp 0x43c38
movq -0x260(%rbp), %rdi
addq $0xf8, %rdi
leaq -0x1e0(%rbp), %rsi
callq 0x3bfd0
jmp 0x43c54
leaq -0x1e0(%rbp), %rdi
callq 0x365b0
leaq -0x230(%rbp), %rdi
callq 0x6898
leaq -0x231(%rbp), %rdi
callq 0x6490
leaq -0x210(%rbp), %rdi
callq 0x7760
leaq -0x1f8(%rbp), %rdi
callq 0x7760
movq -0x278(%rbp), %rsi
leaq -0x250(%rbp), %rdi
callq 0x85f0
jmp 0x43ca5
movq -0x280(%rbp), %rdi
callq 0x28390
movq -0x260(%rbp), %rdi
movsd (%rax), %xmm0
leaq -0x250(%rbp), %rsi
callq 0x430e0
jmp 0x43cca
leaq -0x250(%rbp), %rdi
callq 0x7760
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43e10
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43e04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43d67
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43d4f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43d43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe8(%rbp), %rdi
callq 0x365b0
leaq -0x138(%rbp), %rdi
callq 0x6898
leaq -0x139(%rbp), %rdi
callq 0x6490
leaq -0x118(%rbp), %rdi
callq 0x7760
leaq -0x100(%rbp), %rdi
callq 0x7760
jmp 0x43e04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43dde
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43dc6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x43dba
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x365b0
leaq -0x230(%rbp), %rdi
callq 0x6898
leaq -0x231(%rbp), %rdi
callq 0x6490
leaq -0x210(%rbp), %rdi
callq 0x7760
leaq -0x1f8(%rbp), %rdi
callq 0x7760
jmp 0x43e04
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x250(%rbp), %rdi
callq 0x7760
movq -0x258(%rbp), %rdi
callq 0x365b0
movq -0x268(%rbp), %rdi
callq 0x365b0
movq -0x40(%rbp), %rdi
callq 0x6760
nopw %cs:(%rax,%rax)