// File: Kyle-Alvares[P]SQA1/session.cpp
// Function: Session::prompt()
void Session::prompt() {
    int max = user.isAdmin() ? 8 : 4;
    while(true) {
        int option;
        bool validOption = false;
        cout << endl << "===========OPTIONS============" << endl;
        cout << "[0] Logout" << endl;
        cout << "[1] Withdraw" << endl;
        cout << "[2] Transfer" << endl;
        cout << "[3] Pay-Bill" << endl;
        cout << "[4] Deposit" << endl;
        if(user.isAdmin()) {
            cout << "[5] Create Account" << endl;
            cout << "[6] Delete Account" << endl;
            cout << "[7] Disable Account" << endl;
            cout << "[8] Change Plan" << endl;
        }
        while(!validOption) {
            validOption = true;
            cout << "Option: ";
            cin >> option;
            if(option < 0 || option > max) { validOption = false; } 
        }
        if(option == 0) {
            break;
        } else if (option == 1) {
            withdraw(500, true);
        } else if (option == 2) {
            transfer();
        } else if (option == 3) {
            payBill();
        } else if (option == 4) {
            deposit();
        } else if (option == 5) {
            createAccount();
        } else if (option == 6) {
            deleteAccount();
        } else if (option == 7) {
            disableAccount();
        } else if (option == 8) {
            changePlan();
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
callq 0x5980
movb %al, %dl
movl $0x4, %eax
movl $0x8, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
movl %eax, -0xc(%rbp)
movb $0x0, -0x11(%rbp)
movq 0xb017(%rip), %rdi      # 0x12fc0
movq 0xaff0(%rip), %rsi      # 0x12fa0
callq 0x3310
movq %rax, %rdi
leaq 0x5627(%rip), %rsi      # 0xd5e6
callq 0x32d0
movq %rax, %rdi
movq 0xafd2(%rip), %rsi      # 0x12fa0
callq 0x3310
movq 0xafe6(%rip), %rdi      # 0x12fc0
leaq 0x5624(%rip), %rsi      # 0xd605
callq 0x32d0
movq %rax, %rdi
movq 0xafb0(%rip), %rsi      # 0x12fa0
callq 0x3310
movq 0xafc4(%rip), %rdi      # 0x12fc0
leaq 0x560d(%rip), %rsi      # 0xd610
callq 0x32d0
movq %rax, %rdi
movq 0xaf8e(%rip), %rsi      # 0x12fa0
callq 0x3310
movq 0xafa2(%rip), %rdi      # 0x12fc0
leaq 0x55f8(%rip), %rsi      # 0xd61d
callq 0x32d0
movq %rax, %rdi
movq 0xaf6c(%rip), %rsi      # 0x12fa0
callq 0x3310
movq 0xaf80(%rip), %rdi      # 0x12fc0
leaq 0x55e3(%rip), %rsi      # 0xd62a
callq 0x32d0
movq %rax, %rdi
movq 0xaf4a(%rip), %rsi      # 0x12fa0
callq 0x3310
movq 0xaf5e(%rip), %rdi      # 0x12fc0
leaq 0x55ce(%rip), %rsi      # 0xd637
callq 0x32d0
movq %rax, %rdi
movq 0xaf28(%rip), %rsi      # 0x12fa0
callq 0x3310
movq -0x20(%rbp), %rdi
callq 0x5980
testb $0x1, %al
jne 0x808f
jmp 0x8117
movq 0xaf2a(%rip), %rdi      # 0x12fc0
leaq 0x55a6(%rip), %rsi      # 0xd643
callq 0x32d0
movq %rax, %rdi
movq 0xaef4(%rip), %rsi      # 0x12fa0
callq 0x3310
movq 0xaf08(%rip), %rdi      # 0x12fc0
leaq 0x5597(%rip), %rsi      # 0xd656
callq 0x32d0
movq %rax, %rdi
movq 0xaed2(%rip), %rsi      # 0x12fa0
callq 0x3310
movq 0xaee6(%rip), %rdi      # 0x12fc0
leaq 0x5588(%rip), %rsi      # 0xd669
callq 0x32d0
movq %rax, %rdi
movq 0xaeb0(%rip), %rsi      # 0x12fa0
callq 0x3310
movq 0xaec4(%rip), %rdi      # 0x12fc0
leaq 0x557a(%rip), %rsi      # 0xd67d
callq 0x32d0
movq %rax, %rdi
movq 0xae8e(%rip), %rsi      # 0x12fa0
callq 0x3310
jmp 0x8119
movb -0x11(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x8124
jmp 0x815f
movb $0x1, -0x11(%rbp)
movq 0xae91(%rip), %rdi      # 0x12fc0
leaq 0x5557(%rip), %rsi      # 0xd68d
callq 0x32d0
movq 0xae96(%rip), %rdi      # 0x12fd8
leaq -0x10(%rbp), %rsi
callq 0x31e0
cmpl $0x0, -0x10(%rbp)
jl 0x8159
movl -0x10(%rbp), %eax
cmpl -0xc(%rbp), %eax
jle 0x815d
movb $0x0, -0x11(%rbp)
jmp 0x8119
cmpl $0x0, -0x10(%rbp)
jne 0x816a
jmp 0x8215
cmpl $0x1, -0x10(%rbp)
jne 0x818b
movq -0x20(%rbp), %rdi
movsd 0x5174(%rip), %xmm0     # 0xd2f0
movl $0x1, %esi
callq 0x8250
jmp 0x820e
cmpl $0x2, -0x10(%rbp)
jne 0x819c
movq -0x20(%rbp), %rdi
callq 0x87b0
jmp 0x820c
cmpl $0x3, -0x10(%rbp)
jne 0x81ad
movq -0x20(%rbp), %rdi
callq 0x8c00
jmp 0x820a
cmpl $0x4, -0x10(%rbp)
jne 0x81be
movq -0x20(%rbp), %rdi
callq 0x9120
jmp 0x8208
cmpl $0x5, -0x10(%rbp)
jne 0x81cf
movq -0x20(%rbp), %rdi
callq 0x9710
jmp 0x8206
cmpl $0x6, -0x10(%rbp)
jne 0x81e0
movq -0x20(%rbp), %rdi
callq 0x9a50
jmp 0x8204
cmpl $0x7, -0x10(%rbp)
jne 0x81f1
movq -0x20(%rbp), %rdi
callq 0x9c90
jmp 0x8202
cmpl $0x8, -0x10(%rbp)
jne 0x8200
movq -0x20(%rbp), %rdi
callq 0x9ed0
jmp 0x8202
jmp 0x8204
jmp 0x8206
jmp 0x8208
jmp 0x820a
jmp 0x820c
jmp 0x820e
jmp 0x8210
jmp 0x7f9e
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)