// File: /workspace/github_cpp_makefile_star2_O3/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 0x4dc9(%rip), %rsi      # 0x8180
leaq 0x408(%rsp), %rdi
movl $0x1, %edx
callq 0x2060
leaq 0x4dbf(%rip), %rsi      # 0x818f
leaq 0x208(%rsp), %rdi
movl $0x1, %edx
callq 0x2060
leaq 0x4db5(%rip), %rsi      # 0x819e
leaq 0x8(%rsp), %rdi
movl $0x1, %edx
callq 0x2060
leaq 0x478(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x352e
leaq 0x278(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x3554
leaq 0x78(%rsp), %rdi
callq 0x2070
testb %al, %al
je 0x357a
leaq 0x20(%rbx), %rsi
leaq 0x408(%rsp), %rdi
callq 0x3038
leaq 0x30(%rbx), %rsi
leaq 0x208(%rsp), %rdi
callq 0x3038
addq $0x40, %rbx
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0x3038
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 0x7b35(%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 0x7aa3(%rip), %rdi      # 0xafd8
leaq 0x4c71(%rip), %rsi      # 0x81ad
movl $0x27, %edx
callq 0x21e0
movq 0x7a8b(%rip), %rdi      # 0xafd8
callq 0x20e0
jmp 0x359e
movq 0x7a7d(%rip), %rdi      # 0xafd8
leaq 0x4c73(%rip), %rsi      # 0x81d5
movl $0x27, %edx
callq 0x21e0
movq 0x7a65(%rip), %rdi      # 0xafd8
callq 0x20e0
jmp 0x359e
movq 0x7a57(%rip), %rdi      # 0xafd8
leaq 0x4c75(%rip), %rsi      # 0x81fd
movl $0x24, %edx
callq 0x21e0
movq 0x7a3f(%rip), %rdi      # 0xafd8
callq 0x20e0
movl $0x1, %edi
callq 0x21f0
movq %rax, %rbx
jmp 0x35bf
movq %rax, %rbx
jmp 0x35cc
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