// File: /workspace/github_cpp_makefile_star2_O3/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 0x41f8
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 0x8201
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x81f8
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x81fe
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x8201
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x81c5
addl $-0x3, %r15d
jmp 0x8201
addl $-0x2, %r15d
jmp 0x8201
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 0x4d15
leaq 0x2471(%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 0x8274
movq %rdx, (%rsp)
movq (%rcx), %rdx
movq %rdx, 0x10(%rsp)
jmp 0x827b
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 0x1ea7(%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 0x82c8
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x82cf
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 0x8311
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x8327
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x833e
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x68(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x88(%rsp,%rax)
jne 0x84cc
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 0x83ab
movq %rax, %r15
movq %rax, %rdi
callq 0x2110
leaq 0x68(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x2270
jmp 0x83c7
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 0x846c
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 0x8410
leaq 0x68(%rsp), %rdi
callq 0x22e0
addq $0xc8, %rbx
movq (%rbx), %rsi
movq %rbx, %rdi
callq 0x8c18
movq 0x5b31(%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 0x5b1d(%rip), %rdi      # 0xdff0
leaq 0x21e3(%rip), %rsi      # 0xa6bd
callq 0x2210
movl $0x1, %edi
callq 0x2290
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x8508
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x8508
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r14, %rdi
je 0x8523
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x8523
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x854b
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x854b
jmp 0x853e
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x2310
movq %rbx, %rdi
callq 0x23b0