// File: /workspace/github_cpp_makefile_star2_O3/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 $0x268, %rsp            # imm = 0x268
leaq 0x48(%rsp), %r14
cmpl $0x3, %edi
jne 0x2989
movq %rsi, %rbx
leaq 0x38(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x7757(%rip), %rsi      # 0xa004
leaq 0x775d(%rip), %rdx      # 0xa011
callq 0x3534
movq 0x8(%rbx), %rsi
leaq 0x118(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2fa6
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x2fa6
movq 0x118(%rsp), %rsi
movq 0x120(%rsp), %rdx
leaq 0x38(%rsp), %rdi
callq 0x20c0
leaq 0x77af(%rip), %rsi      # 0xa0b2
leaq 0x38(%rsp), %rdi
callq 0x23d0
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
leaq 0x38(%rsp), %rdi
callq 0x20c0
movq 0x38(%rsp), %rdi
callq 0x21d0
movl %eax, %ebx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2948
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x128(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2969
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x2eca
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2eca
cmpl $0x2, %edi
jl 0x2a12
movq 0xb657(%rip), %rbx      # 0xdff0
leaq 0x7672(%rip), %rsi      # 0xa012
movl $0xd, %edx
movq %rbx, %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
movq %rax, %rbx
leaq 0x7642(%rip), %rsi      # 0xa020
movl $0x26, %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
movl $0x98, %eax
leaq 0x1c0(%rsp), %r12
leaq (%r12,%rax), %rcx
movq %rcx, 0x28(%rsp)
leaq 0x118(%rsp), %r14
addq %r14, %rax
movq %rax, 0x30(%rsp)
movq 0xb589(%rip), %r15      # 0xdfc8
movq %r14, %rdi
callq 0x35cc
movq (%r15), %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
movq %rax, %rbx
movl $0x1e, %edx
movq %rax, %rdi
leaq 0x75c7(%rip), %rsi      # 0xa047
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
movl $0x9, %edx
movq %r15, %rdi
leaq 0x75ab(%rip), %rsi      # 0xa066
callq 0x2270
movq (%r15), %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
movq %rax, %rbx
movl $0x12, %edx
movq %rax, %rdi
leaq 0x7577(%rip), %rsi      # 0xa070
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
movl $0x8, %edx
movq %r15, %rdi
leaq 0x754f(%rip), %rsi      # 0xa083
callq 0x2270
movq 0xb498(%rip), %rdi      # 0xdfd8
leaq 0x4(%rsp), %rsi
callq 0x2160
movl 0x4(%rsp), %eax
cmpl $-0x1, %eax
je 0x2c79
cmpl $0x2, %eax
je 0x2c6f
cmpl $0x1, %eax
jne 0x2e28
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
movl $0x16, %edx
movq %r15, %rdi
leaq 0x74fc(%rip), %rsi      # 0xa08c
callq 0x2270
callq 0x8c6c
movq %r14, %rdi
movl %eax, %esi
callq 0x3702
movl $0x10, %edx
movq %r15, %rdi
leaq 0x74f0(%rip), %rsi      # 0xa0a3
callq 0x2270
movq 0xb419(%rip), %rdi      # 0xdfd8
leaq 0x38(%rsp), %rsi
callq 0x22b0
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3e02
movq 0x8(%rsp), %rbx
movq 0x10(%rsp), %rbp
movq 0x40(%rsp), %r13
cmpq %rbp, %r13
movq %rbp, %rdx
cmovbq %r13, %rdx
testq %rdx, %rdx
je 0x2c09
movq 0x38(%rsp), %rsi
movq %rbx, %rdi
callq 0x2240
testl %eax, %eax
je 0x2c09
xorl %ebp, %ebp
jmp 0x2c10
cmpq %r13, %rbp
sete %bpl
leaq 0x18(%rsp), %rax
cmpq %rax, %rbx
je 0x2c2a
movq 0x18(%rsp), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x2230
testb %bpl, %bpl
jne 0x2c80
movl $0x1a, %edx
movq %r15, %rdi
leaq 0x7476(%rip), %rsi      # 0xa0b4
callq 0x2270
movq (%r15), %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
jmp 0x2b81
movq %r14, %rdi
callq 0x3e6c
jmp 0x2c9c
movb $0x1, %bl
jmp 0x2e2a
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2c9c
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
movq (%r15), %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
movq %rax, %rbx
movl $0x1f, %edx
movq %rax, %rdi
leaq 0x73fa(%rip), %rsi      # 0xa0cf
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
movq %r12, %rdi
movq %r14, %rsi
callq 0x2fe4
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0x5098
movq 0x248(%rsp), %rdi
cmpq 0x28(%rsp), %rdi
je 0x2d38
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x220(%rsp), %rdi
leaq 0x230(%rsp), %rax
cmpq %rax, %rdi
je 0x2d5d
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x200(%rsp), %rdi
leaq 0x210(%rsp), %rax
cmpq %rax, %rdi
je 0x2d82
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x2da7
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x2230
movq %r12, %rdi
callq 0x32d4
leaq 0x38(%rsp), %rdi
callq 0x8178
movq (%r15), %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
movq %rax, %rbx
movl $0x20, %edx
movq %rax, %rdi
leaq 0x72fd(%rip), %rsi      # 0xa0ef
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 0x38(%rsp), %rdi
callq 0x319a
xorl %ebx, %ebx
movq 0x1a0(%rsp), %rdi
cmpq 0x30(%rsp), %rdi
je 0x2e49
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0x2e6e
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x2e93
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x2eb8
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
callq 0x32d4
testb %bl, %bl
je 0x2a3f
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x2f0e
movq %rax, %rbx
jmp 0x2f2f
movq %rax, %rbx
jmp 0x2f9e
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f0e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x128(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f2f
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x2f9e
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2f9e
jmp 0x2f6d
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x3126
jmp 0x2f91
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x319a
jmp 0x2f91
jmp 0x2f72
movq %rax, %rbx
jmp 0x2f91
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2f91
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x118(%rsp), %rdi
callq 0x3126
movq %rbx, %rdi
callq 0x23b0