// File: Kyle-Alvares[P]SQA1/session.cpp
// Function: Session::createAccount()
void Session::createAccount() {
    cout << endl << "========CREATE ACCOUNT========" << endl;
    if(!user.isAdmin()) { 
        cerr << "Error: privileged transaction!" << endl; 
    } else {
        int session = 0;
        while(session == 0) {
            string accountName = askAccountName(user, 0);
            if (std::any_of(accountName.begin(), accountName.end(), ::isdigit) == true){
                cerr << "Error: Invalid account name!" << endl;
            } else if (accountName.size() > 20) {
                cerr << "Error: Invalid account name!" << endl;
            } else {
                session += 1;
                user.createAccount(accountName);
                transactions.push_back("05" + username + "00000000");
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1a0, %rsp            # imm = 0x1A0
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x160(%rbp)
movq 0x988f(%rip), %rdi      # 0x12fc0
movq 0x9868(%rip), %rsi      # 0x12fa0
callq 0x3310
movq %rax, %rdi
leaq 0x3dd2(%rip), %rsi      # 0xd519
callq 0x32d0
movq %rax, %rdi
movq 0x984a(%rip), %rsi      # 0x12fa0
callq 0x3310
movq -0x160(%rbp), %rdi
callq 0x5980
testb $0x1, %al
jne 0x9792
movq 0x987e(%rip), %rdi      # 0x12ff0
leaq 0x3dbf(%rip), %rsi      # 0xd538
callq 0x32d0
movq %rax, %rdi
movq 0x9818(%rip), %rsi      # 0x12fa0
callq 0x3310
jmp 0x9a32
movl $0x0, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x9a30
movq -0x160(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x4210
movq -0x168(%rbp), %rsi
leaq -0x30(%rbp), %rdi
xorl %edx, %edx
callq 0xc6e0
jmp 0x97d1
leaq -0xd8(%rbp), %rdi
callq 0x4330
leaq -0x30(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x3280
movq -0x178(%rbp), %rdi
movq %rax, -0xf0(%rbp)
callq 0x31b0
movq %rax, -0xf8(%rbp)
movq -0xf0(%rbp), %rdi
movq -0xf8(%rbp), %rsi
movq 0x979c(%rip), %rdx      # 0x12fb8
callq 0xa810
movb %al, -0x169(%rbp)
jmp 0x9829
movb -0x169(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x98a9
movq 0x97b0(%rip), %rdi      # 0x12ff0
leaq 0x3d10(%rip), %rsi      # 0xd557
callq 0x32d0
movq %rax, -0x180(%rbp)
jmp 0x9855
movq -0x180(%rbp), %rdi
movq 0x973d(%rip), %rsi      # 0x12fa0
callq 0x3310
jmp 0x986a
jmp 0x9a17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x4330
jmp 0x9a3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x9a25
leaq -0x30(%rbp), %rdi
callq 0x3210
cmpq $0x14, %rax
jbe 0x98ee
movq 0x9731(%rip), %rdi      # 0x12ff0
leaq 0x3c91(%rip), %rsi      # 0xd557
callq 0x32d0
movq %rax, -0x188(%rbp)
jmp 0x98d4
movq -0x188(%rbp), %rdi
movq 0x96be(%rip), %rsi      # 0x12fa0
callq 0x3310
jmp 0x98e9
jmp 0x9a15
movq -0x160(%rbp), %rax
movl -0xc(%rbp), %ecx
incl %ecx
movl %ecx, -0xc(%rbp)
movq %rax, -0x190(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3160
jmp 0x9916
movq -0x190(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x63f0
jmp 0x992b
leaq -0x118(%rbp), %rdi
callq 0x31f0
movq -0x160(%rbp), %rdx
movq %rdx, %rax
addq $0xc8, %rax
movq %rax, -0x198(%rbp)
addq $0xa8, %rdx
leaq 0x3c18(%rip), %rsi      # 0xd574
leaq -0x158(%rbp), %rdi
callq 0xa5e0
jmp 0x996a
leaq 0x3c06(%rip), %rdx      # 0xd577
leaq -0x138(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x6890
jmp 0x9986
movq -0x198(%rbp), %rdi
leaq -0x138(%rbp), %rsi
callq 0xa5b0
jmp 0x999b
leaq -0x138(%rbp), %rdi
callq 0x31f0
leaq -0x158(%rbp), %rdi
callq 0x31f0
jmp 0x9a15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x31f0
jmp 0x9a25
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
jmp 0x9a07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xe0(%rbp)
movl %eax, -0xe4(%rbp)
leaq -0x138(%rbp), %rdi
callq 0x31f0
leaq -0x158(%rbp), %rdi
callq 0x31f0
jmp 0x9a25
jmp 0x9a17
leaq -0x30(%rbp), %rdi
callq 0x31f0
jmp 0x9799
leaq -0x30(%rbp), %rdi
callq 0x31f0
jmp 0x9a3b
jmp 0x9a32
addq $0x1a0, %rsp            # imm = 0x1A0
popq %rbp
retq
movq -0xe0(%rbp), %rdi
callq 0x34c0
nopw (%rax,%rax)