// File: /workspace/github_cpp_makefile_star2_O1/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 0x2999
movq %rsi, %rbx
leaq 0x38(%rsp), %rdi
movq %r14, (%rdi)
leaq 0x7747(%rip), %rsi      # 0xa004
leaq 0x774d(%rip), %rdx      # 0xa011
callq 0x353c
movq 0x8(%rbx), %rsi
leaq 0x118(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2fb8
movq 0x10(%rbx), %rsi
leaq 0x8(%rsp), %rdi
leaq 0x4(%rsp), %rdx
callq 0x2fb8
movq 0x118(%rsp), %rsi
movq 0x120(%rsp), %rdx
leaq 0x38(%rsp), %rdi
callq 0x20c0
leaq 0x779f(%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 0x2958
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x128(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2979
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x2edb
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2edb
cmpl $0x2, %edi
jl 0x2a22
movq 0xb647(%rip), %rbx      # 0xdff0
leaq 0x7662(%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 0x7632(%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 0xb579(%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 0x75b7(%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 0x759b(%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 0x7567(%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 0x753f(%rip), %rsi      # 0xa083
callq 0x2270
movq 0xb488(%rip), %rdi      # 0xdfd8
leaq 0x4(%rsp), %rsi
callq 0x2160
movl 0x4(%rsp), %eax
cmpl $-0x1, %eax
je 0x2c8a
cmpl $0x2, %eax
je 0x2c80
cmpl $0x1, %eax
jne 0x2e39
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
movl $0x16, %edx
movq %r15, %rdi
leaq 0x74ec(%rip), %rsi      # 0xa08c
callq 0x2270
callq 0x8cb4
movq %r14, %rdi
movl %eax, %esi
callq 0x3702
movl $0x10, %edx
movq %r15, %rdi
leaq 0x74e0(%rip), %rsi      # 0xa0a3
callq 0x2270
movq 0xb409(%rip), %rdi      # 0xdfd8
leaq 0x38(%rsp), %rsi
callq 0x22b0
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x3e02
movq 0x10(%rsp), %rbx
movq 0x40(%rsp), %rbp
cmpq %rbx, %rbp
movq %rbx, %rdx
cmovbq %rbp, %rdx
testq %rdx, %rdx
je 0x2c16
movq 0x38(%rsp), %rsi
movq 0x8(%rsp), %rdi
callq 0x2240
testl %eax, %eax
sete %r13b
jmp 0x2c19
movb $0x1, %r13b
cmpq %rbp, %rbx
sete %bl
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x2c3b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
andb %bl, %r13b
jne 0x2c91
movl $0x1a, %edx
movq %r15, %rdi
leaq 0x7465(%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 0x2b91
movq %r14, %rdi
callq 0x3e6c
jmp 0x2cad
movb $0x1, %bl
jmp 0x2e3b
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2cad
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 0x73e9(%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 0x2ff6
leaq 0x38(%rsp), %rdi
movq %r12, %rsi
callq 0x50dc
movq 0x248(%rsp), %rdi
cmpq 0x28(%rsp), %rdi
je 0x2d49
movq 0x258(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x220(%rsp), %rdi
leaq 0x230(%rsp), %rax
cmpq %rax, %rdi
je 0x2d6e
movq 0x230(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x200(%rsp), %rdi
leaq 0x210(%rsp), %rax
cmpq %rax, %rdi
je 0x2d93
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x1e0(%rsp), %rdi
leaq 0x1f0(%rsp), %rax
cmpq %rax, %rdi
je 0x2db8
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x2230
movq %r12, %rdi
callq 0x32e6
leaq 0x38(%rsp), %rdi
callq 0x81c6
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 0x72ec(%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 0x31ac
xorl %ebx, %ebx
movq 0x1a0(%rsp), %rdi
cmpq 0x30(%rsp), %rdi
je 0x2e5a
movq 0x1b0(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x178(%rsp), %rdi
leaq 0x188(%rsp), %rax
cmpq %rax, %rdi
je 0x2e7f
movq 0x188(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x2ea4
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x2ec9
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
callq 0x32e6
testb %bl, %bl
je 0x2a4f
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 0x2f1f
movq %rax, %rbx
jmp 0x2f40
movq %rax, %rbx
jmp 0x2faf
movq %rax, %rbx
leaq 0x18(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f1f
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x128(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f40
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x2faf
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x2faf
jmp 0x2f7e
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x3138
jmp 0x2fa2
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x31ac
jmp 0x2fa2
jmp 0x2f83
movq %rax, %rbx
jmp 0x2fa2
movq %rax, %rbx
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2fa2
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x118(%rsp), %rdi
callq 0x3138
movq %rbx, %rdi
callq 0x23b0
nop