// File: /workspace/github_cpp_makefile_star2_O1/Kyle-Alvares[P]SQA1/session.cpp
// Function: Session::save()
void Session::save() {
    user.saveUserData();
    time_t rawtime;
    time (&rawtime);
    ofstream ofs("./transactions/" + to_string(user.getAccountNumber()) + ".txt", ios::app);
    if(ofs.fail()) {
        cerr << "Error! Unable to save transactions!";
        exit(1);
    }
    ofs << endl;
    ofs << ctime (&rawtime) << endl;
    for(int i = 0; i < transactions.size(); i++) {
        ofs << transactions[i] << endl;
    }
    ofs.close();
    transactions.clear();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movq %rdi, %rbx
callq 0x4200
leaq 0x40(%rsp), %rdi
callq 0x21f0
movq %rbx, %rdi
callq 0x3d92
movl %eax, %r14d
movl %eax, %ebp
negl %ebp
cmovsl %eax, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x824f
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x8246
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x824c
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x824f
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x8213
addl $-0x3, %r15d
jmp 0x824f
addl $-0x2, %r15d
jmp 0x824f
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x58(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x48(%rsp), %r12
movq %r12, %rdi
movl $0x2d, %edx
callq 0x2280
addq (%r12), %r14
movq %r14, %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x4d25
leaq 0x2423(%rip), %rcx      # 0xa6ad
movl $0xf, %r8d
movq %r12, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2260
leaq 0x10(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x82c2
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x82c9
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rsp, %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x1e59(%rip), %rsi      # 0xa143
callq 0x23d0
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x8316
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x831d
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x8(%rsi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x68(%rsp), %rdi
movl $0x1, %edx
callq 0x23e0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x835f
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x8375
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x838c
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x68(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x88(%rsp,%rax)
jne 0x851e
leaq (%rsp,%rax), %rdi
addq $0x68, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
leaq 0x68(%rsp), %r14
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
leaq 0x40(%rsp), %rdi
callq 0x20f0
testq %rax, %rax
je 0x83f9
movq %rax, %r15
movq %rax, %rdi
callq 0x2110
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2270
jmp 0x8415
movq 0x68(%rsp), %rax
movq -0x18(%rax), %rax
leaq (%rsp,%rax), %rdi
addq $0x68, %rdi
movl 0x20(%rdi), %esi
orl $0x1, %esi
callq 0x2390
movq 0x68(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
leaq 0x68(%rsp), %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq 0xc8(%rbx), %rax
cmpq %rax, 0xd0(%rbx)
je 0x84ba
movl $0x8, %r12d
xorl %r13d, %r13d
leaq 0x68(%rsp), %r14
movq -0x8(%rax,%r12), %rsi
movq (%rax,%r12), %rdx
movq %r14, %rdi
callq 0x2270
movq %rax, %r15
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
incq %r13
movq 0xc8(%rbx), %rax
movq 0xd0(%rbx), %rcx
subq %rax, %rcx
sarq $0x5, %rcx
addq $0x20, %r12
cmpq %r13, %rcx
ja 0x845e
leaq 0x68(%rsp), %rdi
callq 0x22e0
movq 0xc8(%rbx), %rsi
addq $0xc8, %rbx
movq %rbx, %rdi
callq 0x8c60
movq 0x5adf(%rip), %rax      # 0xdfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq 0x70(%rsp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, 0x68(%rsp,%rcx)
callq 0x21c0
leaq 0x160(%rsp), %rdi
callq 0x20d0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x5acb(%rip), %rdi      # 0xdff0
leaq 0x2191(%rip), %rsi      # 0xa6bd
callq 0x2210
movl $0x1, %edi
callq 0x2290
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x855a
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x855a
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x8575
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x8575
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x859d
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x859d
jmp 0x8590
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2310
movq %rbx, %rdi
callq 0x23b0