// File: /workspace/github_cpp_makefile_star2_O3/Kyle-Alvares[P]SQA1/session.cpp
// Function: Session::payBill()
void Session::payBill() {
    cout << endl << "============PAYBILL===========" << endl;
    // cin.ignore(); // clears buffer from cin for getline
    int numCompanies = sizeof(companyAcc) / sizeof(int);
    string company;
    int accountNumber;
    bool validCompany = false;
    while(!validCompany) {
        cout << "Companies: " << endl;
        for(int i = 0; i < numCompanies; i++)
            cout << companies[i] + " (" + companyAbbrv[i] << ")" << endl;
        cout << "Enter company name: ";
        cin >> company;
        for(int i = 0; i < numCompanies; i++) {
            if(company.compare(companyAbbrv[i]) == 0) {
                accountNumber = companyAcc[i];
                validCompany = true;
            }
        }
        if (!validCompany)
            cerr << "Error: Invalid company name!" << endl;
    }
    cout << "Choose account to use to pay bill." << endl;
    double amount = withdraw(2000, false);
    User other(accountNumber);
    other.deposit("chequings", amount);
    other.saveUserData();
    transactions.push_back("03" + username + to_string(amount));
    cout << endl <<  "Bill paid successfully!" << endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdi, 0x78(%rsp)
movq 0x7b43(%rip), %rbx      # 0xdfc8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq %rax, %rbx
leaq 0x3f8a(%rip), %rsi      # 0xa440
movl $0x1e, %edx
movq %rax, %rdi
callq 0x2270
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
leaq 0x68(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xd0(%rsp), %r13
movq $0x0, 0x28(%rsp)
leaq 0x7d1a(%rip), %rbx      # 0xe230
leaq 0x8(%rsp), %r12
leaq 0x7d6e(%rip), %r14      # 0xe290
movl $0xb, %edx
movq 0x7a9a(%rip), %rdi      # 0xdfc8
leaq 0x3f2a(%rip), %rsi      # 0xa45f
callq 0x2270
movq 0x7a87(%rip), %rcx      # 0xdfc8
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq 0x7a69(%rip), %rdi      # 0xdfc8
callq 0x2030
movq %rax, %rdi
callq 0x2180
movl $0x8, %r15d
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq -0x8(%r15,%rbx), %rsi
movq (%r15,%rbx), %rdx
addq %rsi, %rdx
movq %r12, %rdi
callq 0x3440
movq %r12, %rdi
leaq 0x3ed1(%rip), %rsi      # 0xa46b
callq 0x23d0
movq -0x8(%r15,%r14), %rsi
movq (%r15,%r14), %rdx
movq %r12, %rdi
callq 0x20c0
movq %r13, 0xc0(%rsp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x65dc
movq %rdx, 0xc0(%rsp)
movq (%rcx), %rdx
movq %rdx, 0xd0(%rsp)
jmp 0x65e4
movups (%rcx), %xmm0
movups %xmm0, (%r13)
movq 0x8(%rax), %rdx
movq %rdx, 0xc8(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xc0(%rsp), %rsi
movq 0xc8(%rsp), %rdx
movq 0x79b2(%rip), %rdi      # 0xdfc8
callq 0x2270
movq %rax, %rbp
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3e41(%rip), %rsi      # 0xa46e
callq 0x2270
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq 0xc0(%rsp), %rdi
cmpq %r13, %rdi
je 0x6677
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6693
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
addq $0x20, %r15
cmpq $0x68, %r15
jne 0x6572
movl $0x14, %edx
movq 0x791b(%rip), %rdi      # 0xdfc8
leaq 0x3dbc(%rip), %rsi      # 0xa470
callq 0x2270
movq 0x7918(%rip), %rdi      # 0xdfd8
leaq 0x58(%rsp), %rsi
callq 0x22b0
movq %r14, %rbp
xorl %r15d, %r15d
leaq 0x58(%rsp), %rdi
movq %rbp, %rsi
callq 0x2040
testl %eax, %eax
jne 0x66f7
leaq 0x3c4c(%rip), %rax      # 0xa334
movl (%r15,%rax), %eax
movl %eax, 0x34(%rsp)
movb $0x1, %al
movq %rax, 0x28(%rsp)
addq $0x4, %r15
addq $0x20, %rbp
cmpq $0xc, %r15
jne 0x66d0
testb $0x1, 0x28(%rsp)
jne 0x675b
movl $0x1c, %edx
movq 0x78d8(%rip), %rdi      # 0xdff0
leaq 0x3d66(%rip), %rsi      # 0xa485
callq 0x2270
movq 0x78c5(%rip), %rcx      # 0xdff0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq 0x78a7(%rip), %rdi      # 0xdff0
callq 0x2030
movq %rax, %rdi
callq 0x2180
jmp 0x6522
movq 0x7866(%rip), %rbx      # 0xdfc8
leaq 0x3d39(%rip), %rsi      # 0xa4a2
movl $0x22, %edx
movq %rbx, %rdi
callq 0x2270
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq 0x7834(%rip), %rbx      # 0xdfc8
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movsd 0x3b54(%rip), %xmm0     # 0xa300
movq 0x78(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x5884
movsd %xmm0, 0x28(%rsp)
leaq 0xc0(%rsp), %rdi
movl 0x34(%rsp), %esi
callq 0x3622
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x39ad(%rip), %rsi      # 0xa192
leaq 0x39af(%rip), %rdx      # 0xa19b
leaq 0xa0(%rsp), %rdi
callq 0x3534
leaq 0xc0(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
movsd 0x28(%rsp), %xmm0
callq 0x4716
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x6831
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0xc0(%rsp), %rdi
callq 0x41f8
leaq 0xa8(%r15), %rdx
leaq 0x3c79(%rip), %rsi      # 0xa4c5
leaq 0x80(%rsp), %rdi
callq 0x8553
movq 0x7750(%rip), %rsi      # 0xdfb0
leaq 0x3e7a(%rip), %rcx      # 0xa6e1
leaq 0x38(%rsp), %rdi
movl $0x148, %edx            # imm = 0x148
movsd 0x28(%rsp), %xmm0
movb $0x1, %al
callq 0x88f6
leaq 0x90(%rsp), %r14
movq -0x10(%r14), %rcx
movq -0x8(%r14), %r8
movq 0x40(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0x68a9
movq 0x90(%rsp), %rdi
movq 0x38(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x68cc
leaq 0x48(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x68c7
movq 0x48(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x68db
leaq 0x80(%rsp), %rdi
callq 0x20c0
jmp 0x68e9
leaq 0x38(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2260
leaq 0x18(%rsp), %rsi
movq %rsi, 0x8(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x690e
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
jmp 0x6914
movups (%rcx), %xmm0
movups %xmm0, (%rsi)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x10(%rsp)
movq %rcx, (%rax)
addq $0xc8, %r15
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x89a8
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6961
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x697c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x80(%rsp), %rdi
cmpq %r14, %rdi
je 0x6999
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2230
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq 0x7611(%rip), %rdi      # 0xdfc8
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq %rax, %rbx
leaq 0x3afa(%rip), %rsi      # 0xa4c8
movl $0x17, %edx
movq %rax, %rdi
callq 0x2270
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
leaq 0x158(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6a23
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x130(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6a44
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x110(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6a65
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0xf0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6a86
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0xc0(%rsp), %rdi
callq 0x32d4
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x6aaf
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2230
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6ae5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x6ae5
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6b05
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x6b05
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6b4f
movq 0x90(%rsp), %rsi
jmp 0x6b3a
jmp 0x6b4c
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x6b4f
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x6b4f
jmp 0x6b4c
jmp 0x6b64
jmp 0x6b64
jmp 0x6b64
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x3126
jmp 0x6baa
jmp 0x6b64
jmp 0x6b64
jmp 0x6b69
movq %rax, %rbx
jmp 0x6baa
movq %rax, %rbx
jmp 0x6b8e
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r13, %rdi
je 0x6b8e
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x6baa
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x6bc6
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x23b0