// File: /workspace/github_cpp_makefile_star2_O2/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, 0x10(%rsp)
movq %rdi, %rbx
testl %esi, %esi
je 0x448b
movq 0x6b51(%rip), %rdi      # 0xafc0
callq 0x2120
leaq 0x2f1c(%rip), %rsi      # 0x7397
movq %rax, %rdi
callq 0x21f0
movq %rax, %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x339e
testb %al, %al
je 0x44bf
leaq 0xf8(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a82
movq %r14, %rdi
callq 0x6350
leaq 0xf8(%rsp), %rdi
callq 0x2b38
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x1a0(%rsp), %r14
leaq 0x18(%rsp), %r15
leaq 0x38(%rsp), %r12
leaq 0xd8(%rsp), %r13
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a82
movq %r15, %rdi
movq %r14, %rsi
pushq $-0x1
popq %rdx
callq 0x6265
movq %r12, %rdi
movq %r15, %rsi
callq 0x2250
movq %r15, %rdi
callq 0x2110
movq %r14, %rdi
callq 0x2b38
movq %r13, %rdi
movq %r12, %rsi
callq 0x2290
movq %rbx, %rdi
movq %r13, %rsi
callq 0x3a80
movl %eax, %ebp
movq %r13, %rdi
callq 0x2110
testb %bpl, %bpl
je 0x4560
movq 0x6a76(%rip), %rdi      # 0xafc0
leaq 0x2e66(%rip), %rsi      # 0x73b7
callq 0x21f0
movq %rax, %rdi
callq 0x2120
jmp 0x44ea
leaq 0xb8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x2290
leaq 0xb8(%rsp), %rsi
movq %rbx, %rdi
callq 0x37c0
movl %eax, %ebp
leaq 0xb8(%rsp), %rdi
callq 0x2110
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x33a6
movslq %ebp, %rax
leaq 0x18(%rsp), %rdi
movq (%rdi), %rcx
imulq $0x30, %rax, %rax
movsd 0x28(%rcx,%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x2bec
movq %rbx, %rdi
callq 0x339e
testb %al, %al
jne 0x45d8
movsd 0x10(%rsp), %xmm0
minsd 0x8(%rsp), %xmm0
jmp 0x45de
movsd 0x8(%rsp), %xmm0
callq 0x649f
movsd %xmm0, 0x8(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x2290
leaq 0x98(%rsp), %rsi
movq %rbx, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x38a8
leaq 0x98(%rsp), %rdi
callq 0x2110
leaq 0xa8(%rbx), %rdx
leaq 0x2da4(%rip), %rsi      # 0x73d0
leaq 0x78(%rsp), %rdi
callq 0x5927
leaq 0x58(%rsp), %rdi
movsd 0x8(%rsp), %xmm0
callq 0x599d
leaq 0x18(%rsp), %rdi
leaq 0x78(%rsp), %rsi
leaq 0x58(%rsp), %rdx
callq 0x58c0
addq $0xc8, %rbx
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x5e0e
leaq 0x18(%rsp), %rdi
callq 0x2110
leaq 0x58(%rsp), %rdi
callq 0x2110
leaq 0x78(%rsp), %rdi
callq 0x2110
leaq 0x38(%rsp), %rdi
callq 0x2110
movsd 0x8(%rsp), %xmm0
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
callq 0x2b38
jmp 0x473d
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2110
jmp 0x46d2
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x2110
jmp 0x46e1
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
jmp 0x4729
jmp 0x4730
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
jmp 0x4729
jmp 0x4730
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
jmp 0x4729
jmp 0x4730
jmp 0x4730
jmp 0x4730
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
callq 0x2b38
jmp 0x4733
movq %rax, %rbx
leaq 0xd8(%rsp), %rdi
callq 0x2110
jmp 0x4733
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2350
nop