// File: /workspace/github_cpp_makefile_star2_O2/Kyle-Alvares[P]SQA1/user.cpp
// Function: User::getUserData(int)
void User::getUserData(int accountNumber) {
    this->accountNumber = accountNumber;
    
    ifstream ifs("./users/" + to_string(accountNumber) + ".txt");
    if(ifs.fail()){
        cerr << "Error. Unable to load user." << endl;
        exit(1);
    }
    string line;
    ifs >> line;
    firstName = line;
    ifs >> line;
    middleName = line;
    ifs >> line;
    lastName = line;
    ifs >> line;
    password = line;
    ifs >> line;
    isAdminAccount = stoi(line);
    while(ifs >> line) {
        account acc;
        int index = line.find("$");
        acc.disabled = line.substr(0,1).compare("0") != 0;
        acc.isStudentPlan = line.substr(1,1).compare("0") != 0;
        acc.accountName = line.substr(2, index-2);
        acc.balance = stoi(line.substr(index+1)); 
        accounts.push_back(acc);
    }
    ifs.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x288, %rsp            # imm = 0x288
movq %rdi, 0x8(%rsp)
movl %esi, 0x18(%rdi)
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x3c01
leaq 0x4155(%rip), %rsi      # 0x713a
leaq 0x10(%rsp), %rdi
movq %rbx, %rdx
callq 0x3bdd
leaq 0x414a(%rip), %rdx      # 0x7143
leaq 0x30(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x3bbe
leaq 0x80(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0x2320
leaq 0x30(%rsp), %rdi
callq 0x2110
leaq 0x10(%rsp), %rdi
callq 0x2110
leaq 0x60(%rsp), %rdi
callq 0x2110
movq 0x80(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0xa0(%rsp,%rax)
jne 0x32b0
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2260
movq 0x8(%rsp), %rax
leaq 0x20(%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2140
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2260
movq 0x8(%rsp), %rax
leaq 0x40(%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2140
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2260
movq 0x8(%rsp), %rax
leaq 0x60(%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2140
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2260
movq 0x8(%rsp), %rax
leaq 0x88(%rax), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2140
leaq 0x80(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x2260
leaq 0x10(%rsp), %rdi
pushq $0xa
popq %rdx
xorl %esi, %esi
callq 0x3c86
testl %eax, %eax
movq 0x8(%rsp), %rax
setne 0x80(%rax)
leaq 0x38(%rsp), %r14
leaq 0x10(%rsp), %r12
leaq 0x60(%rsp), %rbp
pushq $0x1
popq %r13
leaq 0x40aa(%rip), %r15      # 0x71f0
leaq 0x80(%rsp), %rdi
movq %r12, %rsi
callq 0x2260
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x327a
leaq 0x48(%rsp), %rax
movq %rax, 0x38(%rsp)
andq $0x0, 0x40(%rsp)
movb $0x0, 0x48(%rsp)
movq %r12, %rdi
leaq 0x43b0(%rip), %rsi      # 0x7537
xorl %edx, %edx
callq 0x23b0
movq %rax, %rbx
movq %rbp, %rdi
movq %r12, %rsi
xorl %edx, %edx
movq %r13, %rcx
callq 0x2220
movq %rbp, %rdi
movq %r15, %rsi
callq 0x20b0
testl %eax, %eax
setne 0x30(%rsp)
movq %rbp, %rdi
callq 0x2110
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r13, %rcx
callq 0x2220
movq %rbp, %rdi
movq %r15, %rsi
callq 0x20b0
testl %eax, %eax
setne 0x31(%rsp)
movq %rbp, %rdi
callq 0x2110
shlq $0x20, %rbx
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
leaq (%rbx,%rax), %rcx
sarq $0x20, %rcx
movq %rbp, %rdi
movq %r12, %rsi
pushq $0x2
popq %rdx
callq 0x2220
movq %r14, %rdi
movq %rbp, %rsi
callq 0x2250
movq %rbp, %rdi
callq 0x2110
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
sarq $0x20, %rbx
movq %rbp, %rdi
movq %r12, %rsi
movq %rbx, %rdx
pushq $-0x1
popq %rcx
callq 0x2220
movq %rbp, %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0x3c86
cvtsi2sd %eax, %xmm0
movsd %xmm0, 0x58(%rsp)
movq %rbp, %rdi
callq 0x2110
movq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x3c5a
movq %r14, %rdi
callq 0x2110
jmp 0x3146
leaq 0x80(%rsp), %rdi
callq 0x2060
leaq 0x10(%rsp), %rdi
callq 0x2110
leaq 0x80(%rsp), %rdi
callq 0x2080
addq $0x288, %rsp            # imm = 0x288
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x7d39(%rip), %rdi      # 0xaff0
leaq 0x3ede(%rip), %rsi      # 0x719c
callq 0x21f0
movq %rax, %rdi
callq 0x2120
pushq $0x1
popq %rdi
callq 0x2240
movq %rax, %rbx
jmp 0x3333
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x2110
jmp 0x32ea
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2110
jmp 0x32f9
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2110
jmp 0x3340
jmp 0x3348
jmp 0x331e
jmp 0x331e
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x2110
jmp 0x3321
jmp 0x331e
jmp 0x331e
movq %rax, %rbx
movq %r14, %rdi
callq 0x2110
leaq 0x10(%rsp), %rdi
callq 0x2110
leaq 0x80(%rsp), %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2350
movq %rax, %rbx
jmp 0x3329
nop