// File: Kyle-Alvares[P]SQA1/user.cpp
// Function: User::createUser()
void User::createUser() {
    bool accountExists = true;
    while(accountExists) {
        int min = 10000, max = 99999;
        accountNumber = min + rand() % (max - min + 1); 
        ifstream ifs("./users/" + to_string(accountNumber) + ".txt");
        if(ifs.fail()){
            accountExists = false;
        }
    }
    cout << "Enter first name: ";
    cin >> firstName;
    cout << "Enter middle name: ";
    cin >> middleName;
    cout << "Enter last name: ";
    cin >> lastName;
    cout << "Enter password: ";
    cin >> password;
    isAdminAccount = false;
    account acc;
    acc.disabled = false;
    acc.isStudentPlan = false;
    acc.accountName = "chequings";
    acc.balance = 0;
    accounts.push_back(acc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2c8(%rbp)
movb $0x1, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
je 0x5c4e
movl $0x2710, -0x10(%rbp)    # imm = 0x2710
movl $0x1869f, -0x14(%rbp)   # imm = 0x1869F
movl -0x10(%rbp), %eax
movl %eax, -0x2d4(%rbp)
callq 0x30d0
movl -0x2d4(%rbp), %ecx
movl -0x14(%rbp), %esi
movl -0x10(%rbp), %edx
subl %edx, %esi
incl %esi
cltd
idivl %esi
movq -0x2c8(%rbp), %rax
addl %edx, %ecx
movl %ecx, 0x18(%rax)
movl 0x18(%rax), %esi
leaq -0x280(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
callq 0x6930
movq -0x2d0(%rbp), %rdx
leaq 0x7623(%rip), %rsi      # 0xd13a
leaq -0x260(%rbp), %rdi
callq 0x68e0
jmp 0x5b25
leaq 0x7617(%rip), %rdx      # 0xd143
leaq -0x240(%rbp), %rdi
leaq -0x260(%rbp), %rsi
callq 0x6890
jmp 0x5b41
leaq -0x220(%rbp), %rdi
leaq -0x240(%rbp), %rsi
movl $0x8, %edx
callq 0x3490
jmp 0x5b5b
leaq -0x240(%rbp), %rdi
callq 0x31f0
leaq -0x260(%rbp), %rdi
callq 0x31f0
leaq -0x280(%rbp), %rdi
callq 0x31f0
movq -0x220(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x220(%rbp,%rax), %rdi
callq 0x3030
movb %al, -0x2d5(%rbp)
jmp 0x5b9f
movb -0x2d5(%rbp), %al
testb $0x1, %al
jne 0x5bae
jmp 0x5c3d
movb $0x0, -0x9(%rbp)
jmp 0x5c3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x5c09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
jmp 0x5bfd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x31f0
leaq -0x260(%rbp), %rdi
callq 0x31f0
leaq -0x280(%rbp), %rdi
callq 0x31f0
jmp 0x5d97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x30c0
jmp 0x5d97
leaq -0x220(%rbp), %rdi
callq 0x30c0
jmp 0x5aae
movq 0xd36b(%rip), %rdi      # 0x12fc0
movq %rdi, -0x2e8(%rbp)
leaq 0x74e5(%rip), %rsi      # 0xd148
callq 0x32d0
movq -0x2c8(%rbp), %rsi
addq $0x20, %rsi
movq 0xd35e(%rip), %rdi      # 0x12fd8
movq %rdi, -0x2e0(%rbp)
callq 0x33b0
movq -0x2e8(%rbp), %rdi
leaq 0x74c7(%rip), %rsi      # 0xd15b
callq 0x32d0
movq -0x2e0(%rbp), %rdi
movq -0x2c8(%rbp), %rsi
addq $0x40, %rsi
callq 0x33b0
movq -0x2e8(%rbp), %rdi
leaq 0x74b1(%rip), %rsi      # 0xd16f
callq 0x32d0
movq -0x2e0(%rbp), %rdi
movq -0x2c8(%rbp), %rsi
addq $0x60, %rsi
callq 0x33b0
movq -0x2e8(%rbp), %rdi
leaq 0x7499(%rip), %rsi      # 0xd181
callq 0x32d0
movq -0x2e0(%rbp), %rdi
movq -0x2c8(%rbp), %rsi
addq $0x88, %rsi
callq 0x33b0
movq -0x2c8(%rbp), %rax
movb $0x0, 0x80(%rax)
leaq -0x2c0(%rbp), %rdi
callq 0x6a50
movb $0x0, -0x2c0(%rbp)
movb $0x0, -0x2bf(%rbp)
leaq -0x2b8(%rbp), %rdi
leaq 0x7455(%rip), %rsi      # 0xd192
callq 0x33f0
jmp 0x5d44
movq -0x2c8(%rbp), %rdi
movq $0x0, -0x298(%rbp)
leaq -0x2c0(%rbp), %rsi
callq 0x6a70
jmp 0x5d64
leaq -0x2c0(%rbp), %rdi
callq 0x4c20
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x288(%rbp)
movl %eax, -0x28c(%rbp)
leaq -0x2c0(%rbp), %rdi
callq 0x4c20
movq -0x288(%rbp), %rdi
callq 0x34c0
nopw %cs:(%rax,%rax)