// File: /workspace/github_cpp_makefile_star2_O3/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, %r12
testl %esi, %esi
je 0x5911
movq 0x871c(%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 0x4ab1(%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 %r12, %rdi
callq 0x3e2c
testb %al, %al
je 0x59cd
leaq 0x1a0(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
callq 0x2fe4
movq %r14, %rdi
callq 0x9101
leaq 0x238(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x595d
movq 0x238(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x210(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x597e
movq 0x210(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x1f0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x599f
movq 0x1f0(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x1d0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x59c0
movq 0x1d0(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x1a0(%rsp), %rdi
callq 0x32d4
leaq 0x40(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0xf8(%rsp), %rbx
leaq 0x10(%rsp), %r15
leaq 0x70(%rsp), %r13
movq 0x85ce(%rip), %rbp      # 0xdfc8
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2fe4
movq %r15, %rdi
movq %rbx, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x8f9b
leaq 0x30(%rsp), %rdi
movq %r15, %rsi
callq 0x22a0
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x5a3e
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x180(%rsp), %rdi
leaq 0x190(%rsp), %rax
cmpq %rax, %rdi
je 0x5a63
movq 0x190(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x158(%rsp), %rdi
leaq 0x168(%rsp), %rax
cmpq %rax, %rdi
je 0x5a88
movq 0x168(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x138(%rsp), %rdi
leaq 0x148(%rsp), %rax
cmpq %rax, %rdi
je 0x5aad
movq 0x148(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x118(%rsp), %rdi
leaq 0x128(%rsp), %rax
cmpq %rax, %rdi
je 0x5ad2
movq 0x128(%rsp), %rsi
incq %rsi
callq 0x2230
movq %rbx, %rdi
callq 0x32d4
leaq 0x80(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
movq %r13, %rdi
callq 0x3440
movq %r12, %r14
movq %r12, %rdi
movq %r13, %rsi
callq 0x4abc
movl %eax, %r12d
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x5b2f
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2230
testb %r12b, %r12b
je 0x5b78
movl $0x18, %edx
movq %rbp, %rdi
leaq 0x486b(%rip), %rsi      # 0xa3ae
callq 0x2270
movq %r14, %r12
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
jmp 0x59fa
leaq 0xe8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0xd8(%rsp), %rdi
callq 0x3440
leaq 0xd8(%rsp), %rsi
movq %r14, %rdi
callq 0x46a0
movl %eax, %ebp
movq 0xd8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5bcd
movq 0xe8(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x3e34
movslq %ebp, %rax
leaq 0x10(%rsp), %rdi
movq (%rdi), %rcx
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movsd 0x28(%rcx,%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x32d4
movq %r14, %rdi
callq 0x3e2c
leaq 0x20(%rsp), %r15
testb %al, %al
jne 0x5c20
movsd 0x90(%rsp), %xmm0
minsd 0x8(%rsp), %xmm0
jmp 0x5c26
movsd 0x8(%rsp), %xmm0
callq 0x9305
movsd %xmm0, 0x8(%rsp)
leaq 0xc8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
addq %rsi, %rdx
leaq 0xb8(%rsp), %rdi
callq 0x3440
leaq 0xb8(%rsp), %rsi
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x47d4
movq 0xb8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5c8a
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0xa8(%r14), %rdx
leaq 0x472f(%rip), %rsi      # 0xa3c7
leaq 0x98(%rsp), %rdi
callq 0x8553
movq 0x8304(%rip), %rsi      # 0xdfb0
leaq 0x4a2e(%rip), %rcx      # 0xa6e1
leaq 0x50(%rsp), %rdi
movl $0x148, %edx            # imm = 0x148
movsd 0x8(%rsp), %xmm0
movb $0x1, %al
callq 0x88f6
leaq 0xa8(%rsp), %rbx
movq -0x10(%rbx), %rcx
movq -0x8(%rbx), %r8
movq 0x58(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %rbx, %rcx
je 0x5cf5
movq 0xa8(%rsp), %rdi
movq 0x50(%rsp), %rsi
cmpq %rdi, %rax
jbe 0x5d18
leaq 0x60(%rsp), %r9
movl $0xf, %edi
cmpq %r9, %rsi
je 0x5d13
movq 0x60(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x5d27
leaq 0x98(%rsp), %rdi
callq 0x20c0
jmp 0x5d35
leaq 0x50(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2260
movq %r15, 0x10(%rsp)
movq (%rax), %rdx
leaq 0x10(%rax), %rcx
cmpq %rcx, %rdx
je 0x5d55
movq %rdx, 0x10(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x20(%rsp)
jmp 0x5d5c
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x18(%rsp)
movq %rcx, (%rax)
addq $0xc8, %r14
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x89a8
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x5da4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5dbf
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x98(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5ddc
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5df8
movq 0x40(%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 0x3126
jmp 0x5f19
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x5e44
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x5e44
movq %rax, %r14
leaq 0x60(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5e64
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x5e64
movq %rax, %r14
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5efd
movq 0xa8(%rsp), %rsi
jmp 0x5ef0
jmp 0x5efa
movq %rax, %r14
movq 0xb8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5efd
movq 0xc8(%rsp), %rsi
jmp 0x5ef0
jmp 0x5efa
movq %rax, %r14
movq 0xd8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x5efd
movq 0xe8(%rsp), %rsi
jmp 0x5ef0
jmp 0x5efa
jmp 0x5efa
jmp 0x5efa
movq %rax, %r14
leaq 0xf8(%rsp), %rdi
callq 0x3126
jmp 0x5efd
movq %rax, %r14
movq 0x70(%rsp), %rdi
leaq 0x80(%rsp), %rax
cmpq %rax, %rdi
je 0x5efd
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0x5efd
movq %rax, %r14
movq 0x30(%rsp), %rdi
leaq 0x40(%rsp), %rax
cmpq %rax, %rdi
je 0x5f19
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2230
movq %r14, %rdi
callq 0x23b0
nop