// File: Kyle-Alvares[P]SQA1/session.cpp
// Function: Session::deposit()
bool Session::deposit() {
    cout << endl << "============DEPOSIT============" << 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;
    }
    double amount = askAmount();
    transactions.push_back("04" + username + to_string(amount));
    bool deposited = user.deposit(accountName, amount);
    cout << endl << "Successfully added funds!" << endl;
    int index = user.getAccountIndex(accountName);
    double balance = user.getAccounts()[index].balance;
    balance = (int) (balance * 100);
    balance = (float) balance / 100;
    cout << endl << "Account Balance: $" << balance << endl;
    return deposited;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x350, %rsp            # imm = 0x350
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq 0x9e7f(%rip), %rdi      # 0x12fc0
movq 0x9e58(%rip), %rsi      # 0x12fa0
callq 0x3310
movq %rax, %rdi
leaq 0x4372(%rip), %rsi      # 0xd4c9
callq 0x32d0
movq %rax, %rdi
movq 0x9e3a(%rip), %rsi      # 0x12fa0
callq 0x3310
movq -0x2a8(%rbp), %rdi
callq 0x5980
testb $0x1, %al
jne 0x917d
jmp 0x91d6
movq -0x2a8(%rbp), %rsi
leaq -0xb0(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x4210
movq -0x2b0(%rbp), %rdi
callq 0xc820
jmp 0x91a5
leaq -0xb0(%rbp), %rdi
callq 0x4330
jmp 0x91d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x4330
jmp 0x96fd
movb $0x0, -0xbd(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x3400
movb -0xbd(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x91fa
jmp 0x9360
movq -0x2a8(%rbp), %rsi
leaq -0x1a8(%rbp), %rdi
callq 0x4210
jmp 0x920f
leaq -0x100(%rbp), %rdi
leaq -0x1a8(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0xc6e0
jmp 0x9229
leaq -0xe0(%rbp), %rdi
movq %rdi, -0x2c0(%rbp)
leaq -0x100(%rbp), %rsi
movq %rsi, -0x2c8(%rbp)
callq 0x3380
movq -0x2c8(%rbp), %rdi
callq 0x31f0
leaq -0x1a8(%rbp), %rdi
callq 0x4330
movq -0x2a8(%rbp), %rax
movq -0x2c0(%rbp), %rsi
movq %rax, -0x2b8(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x3160
jmp 0x9285
movq -0x2b8(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x6600
movb %al, -0x2c9(%rbp)
jmp 0x92a0
movb -0x2c9(%rbp), %al
andb $0x1, %al
decb %al
andb $0x1, %al
movb %al, -0xbd(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x31f0
testb $0x1, -0xbd(%rbp)
jne 0x935b
movq 0x9cee(%rip), %rdi      # 0x12fc0
leaq 0x40be(%rip), %rsi      # 0xd397
callq 0x32d0
movq %rax, -0x2d8(%rbp)
jmp 0x92e7
movq -0x2d8(%rbp), %rdi
movq 0x9cab(%rip), %rsi      # 0x12fa0
callq 0x3310
jmp 0x92fc
jmp 0x935b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x96f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x4330
jmp 0x96f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x1c8(%rbp), %rdi
callq 0x31f0
jmp 0x96f1
jmp 0x91e9
callq 0xc9b0
movsd %xmm0, -0x2e0(%rbp)
jmp 0x936f
movq -0x2a8(%rbp), %rdx
movsd -0x2e0(%rbp), %xmm0
movsd %xmm0, -0x1d0(%rbp)
movq %rdx, %rax
addq $0xc8, %rax
movq %rax, -0x2e8(%rbp)
addq $0xa8, %rdx
leaq 0x4145(%rip), %rsi      # 0xd4e9
leaq -0x210(%rbp), %rdi
callq 0xa5e0
jmp 0x93b2
movsd -0x1d0(%rbp), %xmm0
leaq -0x230(%rbp), %rdi
callq 0xa6f0
jmp 0x93c8
leaq -0x1f0(%rbp), %rdi
leaq -0x210(%rbp), %rsi
leaq -0x230(%rbp), %rdx
callq 0xa4a0
jmp 0x93e4
movq -0x2e8(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
callq 0xa5b0
jmp 0x93f9
leaq -0x1f0(%rbp), %rdi
callq 0x31f0
leaq -0x230(%rbp), %rdi
callq 0x31f0
leaq -0x210(%rbp), %rdi
callq 0x31f0
movq -0x2a8(%rbp), %rax
movq %rax, -0x2f0(%rbp)
leaq -0x258(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3160
jmp 0x9440
movq -0x2f0(%rbp), %rdi
movsd -0x1d0(%rbp), %xmm0
leaq -0x258(%rbp), %rsi
callq 0x6240
movb %al, -0x2f1(%rbp)
jmp 0x9463
leaq -0x258(%rbp), %rdi
callq 0x31f0
movb -0x2f1(%rbp), %al
andb $0x1, %al
movb %al, -0x231(%rbp)
movq 0x9b3c(%rip), %rdi      # 0x12fc0
movq 0x9b15(%rip), %rsi      # 0x12fa0
callq 0x3310
movq %rax, -0x300(%rbp)
jmp 0x9499
movq -0x300(%rbp), %rdi
leaq 0x4045(%rip), %rsi      # 0xd4ec
callq 0x32d0
movq %rax, -0x308(%rbp)
jmp 0x94b5
movq -0x308(%rbp), %rdi
movq 0x9add(%rip), %rsi      # 0x12fa0
callq 0x3310
jmp 0x94ca
movq -0x2a8(%rbp), %rax
movq %rax, -0x310(%rbp)
leaq -0x280(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x3160
jmp 0x94ed
movq -0x310(%rbp), %rdi
leaq -0x280(%rbp), %rsi
callq 0x61b0
movl %eax, -0x314(%rbp)
jmp 0x9508
leaq -0x280(%rbp), %rdi
callq 0x31f0
movl -0x314(%rbp), %eax
movq -0x2a8(%rbp), %rsi
movl %eax, -0x25c(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x59a0
jmp 0x9535
movslq -0x25c(%rbp), %rsi
leaq -0x2a0(%rbp), %rdi
movq %rdi, -0x330(%rbp)
callq 0x6b20
movq -0x330(%rbp), %rdi
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x328(%rbp)
callq 0x44c0
movsd -0x328(%rbp), %xmm0
movsd %xmm0, -0x288(%rbp)
movsd -0x288(%rbp), %xmm0
movsd 0x3d80(%rip), %xmm1     # 0xd308
mulsd %xmm1, %xmm0
cvttpd2dq %xmm0, %xmm0
cvtdq2pd %xmm0, %xmm0
movlpd %xmm0, -0x288(%rbp)
movsd -0x288(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss 0x3d60(%rip), %xmm1     # 0xd310
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0x288(%rbp)
movq 0x99f9(%rip), %rdi      # 0x12fc0
movq 0x99d2(%rip), %rsi      # 0x12fa0
callq 0x3310
movq %rax, -0x320(%rbp)
jmp 0x95dc
movq -0x320(%rbp), %rdi
leaq 0x3f1c(%rip), %rsi      # 0xd506
callq 0x32d0
movq %rax, -0x338(%rbp)
jmp 0x95f8
movq -0x338(%rbp), %rdi
movsd -0x288(%rbp), %xmm0
callq 0x3500
movq %rax, -0x340(%rbp)
jmp 0x9615
movq -0x340(%rbp), %rdi
movq 0x997d(%rip), %rsi      # 0x12fa0
callq 0x3310
jmp 0x962a
movb -0x231(%rbp), %al
movb %al, -0x341(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x31f0
movb -0x341(%rbp), %al
andb $0x1, %al
addq $0x350, %rsp            # imm = 0x350
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x96a5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
jmp 0x9699
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x31f0
leaq -0x230(%rbp), %rdi
callq 0x31f0
leaq -0x210(%rbp), %rdi
callq 0x31f0
jmp 0x96f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x31f0
jmp 0x96f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xb8(%rbp)
movl %eax, -0xbc(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x31f0
leaq -0xe0(%rbp), %rdi
callq 0x31f0
movq -0xb8(%rbp), %rdi
callq 0x34c0
nopl (%rax)