// File: /workspace/github_cpp_makefile_star2_O1/Kyle-Alvares[P]SQA1/session.cpp
// Function: Session::withdraw(double, bool)
double Session::withdraw(double max, bool displayHeader) {
    if(displayHeader)
        cout << endl << "============WITHDRAW===========" << endl;
    if(user.isAdmin())
        askNames(user);
    bool valid = false;
    string accountName;
    while(!valid) {
        accountName = askAccountName(user, -1);
        valid = user.isDisabled(accountName) ? false : true;
        if(!valid) cout << "Error: disabled account!" << endl;
    }
    int index = user.getAccountIndex(accountName);
    double balance = user.getAccounts()[index].balance;
    double amount;
    if(user.isAdmin()) amount = askAmount(balance);
    else amount = askAmount(min(balance, max));
    user.withdraw(accountName, amount);
    transactions.push_back("01" + username + to_string(amount));
    return amount;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movsd %xmm0, 0x90(%rsp)
movq %rdi, %rbx
testl %esi, %esi
je 0x5957
movq 0x86d6(%rip), %r14      # 0xdfc8
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq %rax, %r14
leaq 0x4a6b(%rip), %rsi      # 0xa38e
movl $0x1f, %edx
movq %rax, %rdi
callq 0x2270
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
movq %rbx, %rdi
callq 0x3e2c
testb %al, %al
je 0x5a13
leaq 0x1a0(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2ff6
movq %r14, %rdi
callq 0x9149
leaq 0x238(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x59a3
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x210(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x59c4
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x1f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x59e5
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x1d0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5a06
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x1a0(%rsp), %rdi
callq 0x32e6
movq %rbx, %r14
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xf8(%rsp), %rbx
leaq 0x30(%rsp), %r15
leaq 0x70(%rsp), %r13
movq 0x8585(%rip), %rbp      # 0xdfc8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2ff6
movq %r15, %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x8fe3
leaq 0x10(%rsp), %rdi
movq %r15, %rsi
callq 0x22a0
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5a87
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x5aac
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x5ad1
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x5af6
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x5b1b
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x32e6
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x3450
movq %r14, %rdi
movq %r13, %rsi
callq 0x4ac6
movl %eax, %r12d
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x5b75
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2230
testb %r12b, %r12b
je 0x5bbf
movl $0x18, %edx
movq %rbp, %rdi
leaq 0x4825(%rip), %rsi      # 0xa3ae
callq 0x2270
movq (%rbp), %rax
movq -0x18(%rax), %rdi
addq %rbp, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %rbp, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2180
testb %r12b, %r12b
jne 0x5a43
leaq 0xe8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd8(%rsp), %rdi
callq 0x3450
leaq 0xd8(%rsp), %rsi
movq %r14, %rdi
callq 0x46a8
movl %eax, %ebp
movq 0xd8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5c14
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x3e34
movslq %ebp, %rax
leaq 0x30(%rsp), %rdi
movq (%rdi), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movsd 0x28(%rcx,%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x32e6
movq %r14, %rdi
callq 0x3e2c
leaq 0x40(%rsp), %r15
testb %al, %al
jne 0x5c67
movsd 0x90(%rsp), %xmm0
minsd 0x8(%rsp), %xmm0
jmp 0x5c6d
movsd 0x8(%rsp), %xmm0
callq 0x9363
movsd %xmm0, 0x8(%rsp)
leaq 0xc8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0x3450
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x47dc
movq 0xb8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5cd1
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0xa8(%r14), %rdx
leaq 0x46e8(%rip), %rsi      # 0xa3c7
leaq 0x98(%rsp), %rdi
callq 0x85a5
movq 0x82bd(%rip), %rsi      # 0xdfb0
leaq 0x49e7(%rip), %rcx      # 0xa6e1
leaq 0x50(%rsp), %rdi
movl $0x148, %edx            # imm = 0x148
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x8946
leaq 0xa8(%rsp), %rbx
movq -0x10(%rbx), %rcx
movq -0x8(%rbx), %r8
movq 0x58(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %rbx, %rcx
je 0x5d3c
movq 0xa8(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x5d5b
leaq 0x60(%rsp), %rdi
movl $0xf, %esi
cmpq %rdi, -0x10(%rdi)
je 0x5d56
movq 0x60(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x5d6f
movq 0x50(%rsp), %rsi
leaq 0x98(%rsp), %rdi
callq 0x20c0
jmp 0x5d7d
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2260
movq %r15, 0x30(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x5d9d
movq %rdx, 0x30(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x5da6
movupd (%rcx), %xmm0
movupd %xmm0, (%r15)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x38(%rsp)
movq %rcx, (%rax)
addq $0xc8, %r14
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x30(%rsp), %rsi
movq %r14, %rdi
callq 0x89f8
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x5dee
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5e09
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x98(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5e26
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5e42
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movsd 0x8(%rsp), %xmm0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x1a0(%rsp), %rdi
callq 0x3138
jmp 0x5f63
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x5e8e
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x5e8e
movq %rax, %r14
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5eae
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x5eae
movq %rax, %r14
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5f47
movq 0xa8(%rsp), %rsi
jmp 0x5f26
jmp 0x5f44
movq %rax, %r14
movq 0xb8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5f47
movq 0xc8(%rsp), %rsi
jmp 0x5f26
jmp 0x5f44
movq %rax, %r14
movq 0xd8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5f47
movq 0xe8(%rsp), %rsi
jmp 0x5f26
jmp 0x5f44
jmp 0x5f44
movq %rax, %r14
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x5f47
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x5f47
jmp 0x5f44
movq %rax, %r14
leaq 0xf8(%rsp), %rdi
callq 0x3138
jmp 0x5f47
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq 0x10(%rsp), %rdi
cmpq %rax, %rdi
je 0x5f63
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23b0
nop