// File: /workspace/github_cpp_makefile_star2_O2/Kyle-Alvares[P]SQA1/main.cpp
// Function: main
int main(int argc, char* argv[]) {
    if(argc == 3) {
        string cmd = "./cmdline.sh ";
        string arg1 = argv[1]; // input file
        string arg2 = argv[2]; // expected file
        cmd += arg1;
        cmd += " "; 
        cmd += arg2;
        return system(cmd.c_str());
    } else if(argc > 1) {
        cerr << "Invalid Args!" << endl << "Expected: <input-file> <expected-file>" << endl;
    }
    while(true) {
        User user;
        bool isAdmin = false;
        int action;
        cout << endl << "=============HOME=============" << endl;
        cout << "[1] Login" << endl << "[2] Create Account" << endl;
        cout << "Action: ";
        cin >> action;
        if(action == 1) {
            int accountNumber;
            string password;
            bool validPassword = false;
            while(!validPassword) {
                validPassword = true;
                cout << "Enter Account Number: "; 
                accountNumber = req::askAccountNumber();
                user.getUserData(accountNumber);
                cout << "Enter Password: ";
                cin >> password;
                if(user.getPassword().compare(password) != 0) {
                    cout << "Error: Incorrect password!" << endl;
                    validPassword = false;
                }
            }
        } else if(action == 2) {
            user.createUser();
        } else if(action == -1) {
            break;
        } else {
            continue;
        }
        cout << endl << "===========LOGGED IN===========" << endl;
        Session session(user);
        session.save();
        cout << endl << "===========LOGGED OUT===========" << endl;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x258, %rsp            # imm = 0x258
cmpl $0x3, %edi
jne 0x278f
movq %rsi, %rbx
leaq 0x4914(%rip), %rsi      # 0x7004
leaq 0x28(%rsp), %rdi
leaq 0x108(%rsp), %rdx
callq 0x2a46
movq 0x8(%rbx), %rsi
leaq 0x108(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2a46
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x2a46
leaq 0x28(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x23a0
leaq 0x496e(%rip), %rsi      # 0x70b2
leaq 0x28(%rsp), %rdi
callq 0x2370
leaq 0x28(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x23a0
movq 0x28(%rsp), %rdi
callq 0x21b0
movl %eax, %ebx
leaq 0x8(%rsp), %rdi
callq 0x2110
leaq 0x108(%rsp), %rdi
callq 0x2110
leaq 0x28(%rsp), %rdi
callq 0x2110
jmp 0x29a2
cmpl $0x2, %edi
jl 0x27c6
movq 0x8855(%rip), %rdi      # 0xaff0
leaq 0x4870(%rip), %rsi      # 0x7012
callq 0x21f0
movq %rax, %rdi
callq 0x2120
leaq 0x486a(%rip), %rsi      # 0x7020
movq %rax, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2120
leaq 0x108(%rsp), %rbx
movq 0x87eb(%rip), %r14      # 0xafc0
movq 0x87fc(%rip), %r15      # 0xafd8
leaq 0x28(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %rbx, %rdi
callq 0x2e9c
movq %r14, %rdi
callq 0x2120
movq %rax, %rdi
leaq 0x4847(%rip), %rsi      # 0x7047
callq 0x21f0
movq %rax, %rdi
callq 0x2120
movq %r14, %rdi
leaq 0x484f(%rip), %rsi      # 0x7066
callq 0x21f0
movq %rax, %rdi
callq 0x2120
movq %rax, %rdi
leaq 0x4842(%rip), %rsi      # 0x7070
callq 0x21f0
movq %rax, %rdi
callq 0x2120
movq %r14, %rdi
leaq 0x483e(%rip), %rsi      # 0x7083
callq 0x21f0
movq %r15, %rdi
leaq 0x4(%rsp), %rsi
callq 0x2160
movl 0x4(%rsp), %eax
cmpl $0x1, %eax
je 0x2880
cmpl $0x2, %eax
je 0x2873
cmpl $-0x1, %eax
jne 0x2986
jmp 0x2993
movq %rbx, %rdi
callq 0x33de
jmp 0x2912
leaq 0x38(%rsp), %rax
movq %rax, 0x28(%rsp)
andq $0x0, 0x30(%rsp)
movb $0x0, 0x38(%rsp)
movq %r14, %rdi
leaq 0x47ed(%rip), %rsi      # 0x708c
callq 0x21f0
callq 0x60e4
movq %rbx, %rdi
movl %eax, %esi
callq 0x2fb8
movq %r14, %rdi
leaq 0x47e6(%rip), %rsi      # 0x70a3
callq 0x21f0
movq %r15, %rdi
movq %r12, %rsi
callq 0x2260
movq %r13, %rdi
movq %rbx, %rsi
callq 0x3388
movq %r13, %rdi
movq %r12, %rsi
callq 0x2030
movl %eax, %ebp
movq %r13, %rdi
callq 0x2110
testl %ebp, %ebp
je 0x290a
movq %r14, %rdi
leaq 0x47b9(%rip), %rsi      # 0x70b4
callq 0x21f0
movq %rax, %rdi
callq 0x2120
jmp 0x2895
movq %r12, %rdi
callq 0x2110
movq %r14, %rdi
callq 0x2120
movq %rax, %rdi
leaq 0x47ab(%rip), %rsi      # 0x70cf
callq 0x21f0
movq %rax, %rdi
callq 0x2120
leaq 0x1b0(%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x2a82
movq %r12, %rdi
movq %rbp, %rsi
callq 0x40e8
movq %rbp, %rdi
callq 0x2b38
movq %r12, %rdi
callq 0x56b2
movq %r14, %rdi
callq 0x2120
movq %rax, %rdi
leaq 0x477e(%rip), %rsi      # 0x70ef
callq 0x21f0
movq %rax, %rdi
callq 0x2120
movq %r12, %rdi
callq 0x2b6c
movq %rbx, %rdi
callq 0x2b38
jmp 0x27e6
leaq 0x108(%rsp), %rdi
callq 0x2b38
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x258, %rsp            # imm = 0x258
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x29d2
movq %rax, %rbx
jmp 0x29df
movq %rax, %rbx
jmp 0x2a3e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2110
leaq 0x108(%rsp), %rdi
callq 0x2110
leaq 0x28(%rsp), %rdi
callq 0x2110
jmp 0x2a3e
jmp 0x2a1f
movq %rax, %rbx
leaq 0x1b0(%rsp), %rdi
callq 0x2b38
jmp 0x2a31
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2b6c
jmp 0x2a31
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x2110
jmp 0x2a27
jmp 0x2a24
movq %rax, %rbx
jmp 0x2a31
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x2110
leaq 0x108(%rsp), %rdi
callq 0x2b38
movq %rbx, %rdi
callq 0x2350