// 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)
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) {
    Reset();
    enable_gimbal = false;

    this->area_exit = area_exit;
    this->burn_duration = time_vector[time_vector.size()-1];
    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 $0x280, %rsp            # imm = 0x280
movq %rsi, -0x270(%rbp)
movq %rdx, -0x268(%rbp)
movq %rcx, -0x260(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movsd %xmm0, -0x28(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x250(%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, -0x258(%rbp)
callq 0x3bb50
movq -0x250(%rbp), %rdi
addq $0xf8, %rdi
movq %rdi, -0x248(%rbp)
callq 0x3bb50
jmp 0x4362b
movq -0x250(%rbp), %rdi
callq 0x43050
movq -0x250(%rbp), %rax
movq -0x270(%rbp), %rdi
movb $0x0, 0x50(%rax)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0x38(%rax)
callq 0x86e0
movq -0x270(%rbp), %rdi
movq %rax, %rsi
decq %rsi
callq 0x27ce0
movq -0x270(%rbp), %rsi
movq %rax, %rcx
movq -0x250(%rbp), %rax
movsd (%rcx), %xmm0
movsd %xmm0, 0x8(%rax)
leaq -0xf0(%rbp), %rdi
callq 0x85f0
jmp 0x43692
movq -0x268(%rbp), %rsi
leaq -0x108(%rbp), %rdi
callq 0x85f0
jmp 0x436a7
leaq -0x129(%rbp), %rdi
movq %rdi, -0x278(%rbp)
callq 0x6770
movq -0x278(%rbp), %rdx
leaq 0x519c5(%rip), %rsi     # 0x9508d
leaq -0x128(%rbp), %rdi
callq 0xd1d0
jmp 0x436d6
leaq -0xd8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0x108(%rbp), %rdx
leaq -0x128(%rbp), %rcx
callq 0x3bc30
jmp 0x436f9
movq -0x250(%rbp), %rdi
addq $0x58, %rdi
leaq -0xd8(%rbp), %rsi
callq 0x3bfd0
jmp 0x43712
leaq -0xd8(%rbp), %rdi
callq 0x365b0
leaq -0x128(%rbp), %rdi
callq 0x6898
leaq -0x129(%rbp), %rdi
callq 0x6490
leaq -0x108(%rbp), %rdi
callq 0x7760
leaq -0xf0(%rbp), %rdi
callq 0x7760
movq -0x270(%rbp), %rsi
leaq -0x1e8(%rbp), %rdi
callq 0x85f0
jmp 0x43763
movq -0x260(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x85f0
jmp 0x43778
leaq -0x221(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x6770
movq -0x280(%rbp), %rdx
leaq 0x518f4(%rip), %rsi     # 0x9508d
leaq -0x220(%rbp), %rdi
callq 0xd1d0
jmp 0x437a7
leaq -0x1d0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
leaq -0x200(%rbp), %rdx
leaq -0x220(%rbp), %rcx
callq 0x3bc30
jmp 0x437ca
movq -0x250(%rbp), %rdi
addq $0xf8, %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x3bfd0
jmp 0x437e6
leaq -0x1d0(%rbp), %rdi
callq 0x365b0
leaq -0x220(%rbp), %rdi
callq 0x6898
leaq -0x221(%rbp), %rdi
callq 0x6490
leaq -0x200(%rbp), %rdi
callq 0x7760
leaq -0x1e8(%rbp), %rdi
callq 0x7760
movq -0x268(%rbp), %rsi
leaq -0x240(%rbp), %rdi
callq 0x85f0
jmp 0x43837
movq -0x270(%rbp), %rdi
callq 0x28390
movq -0x250(%rbp), %rdi
movsd (%rax), %xmm0
leaq -0x240(%rbp), %rsi
callq 0x430e0
jmp 0x4385c
leaq -0x240(%rbp), %rdi
callq 0x7760
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x439a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x43996
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x438f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x438e1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x438d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x365b0
leaq -0x128(%rbp), %rdi
callq 0x6898
leaq -0x129(%rbp), %rdi
callq 0x6490
leaq -0x108(%rbp), %rdi
callq 0x7760
leaq -0xf0(%rbp), %rdi
callq 0x7760
jmp 0x43996
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x43970
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x43958
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4394c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0x365b0
leaq -0x220(%rbp), %rdi
callq 0x6898
leaq -0x221(%rbp), %rdi
callq 0x6490
leaq -0x200(%rbp), %rdi
callq 0x7760
leaq -0x1e8(%rbp), %rdi
callq 0x7760
jmp 0x43996
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x7760
movq -0x248(%rbp), %rdi
callq 0x365b0
movq -0x258(%rbp), %rdi
callq 0x365b0
movq -0x30(%rbp), %rdi
callq 0x6760
nopw (%rax,%rax)