// File: /workspace/github_cpp_makefile_star2_O1/joraso[P]Glassius/Particles.cpp
// Function: Particles::SaveTrajectory()
void Particles::SaveTrajectory(){
    /* Writes positions, velocities and forces to their respective trajectory
    files. */
    ofstream rtraj, vtraj, ftraj;
    
    rtraj.open("Data/rtraj.csv", std::ios::app);
    vtraj.open("Data/vtraj.csv", std::ios::app);
    ftraj.open("Data/ftraj.csv", std::ios::app);
    
    // File check-stops
    if(!rtraj.is_open()){
        cout << "Error opening position-trajectory file!" << endl;
        exit(1);
    }
    if(!vtraj.is_open()){
        cout << "Error opening velocity-trajectory file!" << endl;
        exit(1);
    }
    if(!ftraj.is_open()){
        cout << "Error opening force-trajectory file!" << endl;
        exit(1);
    }
    
    rtraj << positions; vtraj << velocities; ftraj << forces;
    rtraj.close(); vtraj.close(); ftraj.close();
    
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x608, %rsp            # imm = 0x608
movq %rdi, %rbx
leaq 0x408(%rsp), %rdi
callq 0x2280
leaq 0x208(%rsp), %rdi
callq 0x2280
leaq 0x8(%rsp), %rdi
callq 0x2280
leaq 0x4dcf(%rip), %rsi      # 0x8180
leaq 0x408(%rsp), %rdi
movl $0x1, %edx
callq 0x2060
leaq 0x4dc5(%rip), %rsi      # 0x818f
leaq 0x208(%rsp), %rdi
movl $0x1, %edx
callq 0x2060
leaq 0x4dbb(%rip), %rsi      # 0x819e
leaq 0x8(%rsp), %rdi
movl $0x1, %edx
callq 0x2060
leaq 0x478(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x3528
leaq 0x278(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x354e
leaq 0x78(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x3574
leaq 0x20(%rbx), %rsi
leaq 0x408(%rsp), %rdi
callq 0x3031
leaq 0x30(%rbx), %rsi
leaq 0x208(%rsp), %rdi
callq 0x3031
addq $0x40, %rbx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3031
leaq 0x408(%rsp), %rbx
movq %rbx, %rdi
callq 0x2220
leaq 0x208(%rsp), %r14
movq %r14, %rdi
callq 0x2220
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x2220
movq 0x7b3b(%rip), %rax      # 0xafd0
movq (%rax), %r12
movq 0x18(%rax), %r13
leaq 0x10(%rsp), %rdi
movq %r12, -0x8(%rdi)
movq -0x18(%r12), %rax
movq %r13, 0x8(%rsp,%rax)
callq 0x2180
movl $0xf8, %ebp
addq %rbp, %r15
movq %r15, %rdi
callq 0x2090
leaq 0x210(%rsp), %rdi
movq %r12, -0x8(%rdi)
movq -0x18(%r12), %rax
movq %r13, 0x208(%rsp,%rax)
callq 0x2180
addq %rbp, %r14
movq %r14, %rdi
callq 0x2090
leaq 0x410(%rsp), %rdi
movq %r12, -0x8(%rdi)
movq -0x18(%r12), %rax
movq %r13, 0x408(%rsp,%rax)
callq 0x2180
addq %rbp, %rbx
movq %rbx, %rdi
callq 0x2090
addq $0x608, %rsp            # imm = 0x608
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7aa9(%rip), %rdi      # 0xafd8
leaq 0x4c77(%rip), %rsi      # 0x81ad
movl $0x27, %edx
callq 0x21e0
movq 0x7a91(%rip), %rdi      # 0xafd8
callq 0x20e0
jmp 0x3598
movq 0x7a83(%rip), %rdi      # 0xafd8
leaq 0x4c79(%rip), %rsi      # 0x81d5
movl $0x27, %edx
callq 0x21e0
movq 0x7a6b(%rip), %rdi      # 0xafd8
callq 0x20e0
jmp 0x3598
movq 0x7a5d(%rip), %rdi      # 0xafd8
leaq 0x4c7b(%rip), %rsi      # 0x81fd
movl $0x24, %edx
callq 0x21e0
movq 0x7a45(%rip), %rdi      # 0xafd8
callq 0x20e0
movl $0x1, %edi
callq 0x21f0
movq %rax, %rbx
jmp 0x35b9
movq %rax, %rbx
jmp 0x35c6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2240
leaq 0x208(%rsp), %rdi
callq 0x2240
leaq 0x408(%rsp), %rdi
callq 0x2240
movq %rbx, %rdi
callq 0x22b0
nop