// File: AngelPn[P]L5R-card_game/src/Player.cpp
// Function: Player::discardSurplusFateCards()
void Player::discardSurplusFateCards()
{
	unsigned int card;

	if (hand.size() > NO_HAND)
	{
		cout << "You have surplus fate cards in your hand (max " << NO_HAND << " and you have " << hand.size() << " )" << endl;
		cout << "You need to discard " << hand.size() - NO_HAND << " cards from your hand ..." << endl;
		for (unsigned int i = 0; i < hand.size() - NO_HAND; i++)
		{
			card = 0;
			while (card < 1 || card > hand.size())
			{
				this->printHand();
				cout << this->name<< ", choose a card from your hand to discard : (1-" << hand.size() << ")" << endl;
				cin >> card;
			}

			hand.erase(hand.begin() + (card-1)); //erase card from hand
		}
	}

	cout << "Surplus fate cards discarded! " << endl << endl;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x38(%rbp)
addq $0x20, %rdi
callq 0xbd80
cmpq $0x6, %rax
jbe 0x13401
movq 0x11dd2(%rip), %rdi     # 0x24fd0
leaq 0x62cd(%rip), %rsi      # 0x194d2
callq 0x4200
movq %rax, %rdi
movl $0x6, %esi
callq 0x4330
movq %rax, %rdi
leaq 0x62e0(%rip), %rsi      # 0x19501
callq 0x4200
movq -0x38(%rbp), %rdi
movq %rax, -0x48(%rbp)
addq $0x20, %rdi
callq 0xbd80
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x4090
movq %rax, %rdi
leaq 0x62c3(%rip), %rsi      # 0x19510
callq 0x4200
movq %rax, %rdi
movq 0x11d64(%rip), %rsi     # 0x24fc0
callq 0x4230
movq 0x11d68(%rip), %rdi     # 0x24fd0
leaq 0x62a4(%rip), %rsi      # 0x19513
callq 0x4200
movq -0x38(%rbp), %rdi
movq %rax, -0x40(%rbp)
addq $0x20, %rdi
callq 0xbd80
movq -0x40(%rbp), %rdi
movq %rax, %rsi
subq $0x6, %rsi
callq 0x4090
movq %rax, %rdi
leaq 0x6289(%rip), %rsi      # 0x19528
callq 0x4200
movq %rax, %rdi
movq 0x11d12(%rip), %rsi     # 0x24fc0
callq 0x4230
movl $0x0, -0x10(%rbp)
movq -0x38(%rbp), %rdi
movl -0x10(%rbp), %eax
movq %rax, -0x50(%rbp)
addq $0x20, %rdi
callq 0xbd80
movq %rax, %rcx
movq -0x50(%rbp), %rax
subq $0x6, %rcx
cmpq %rcx, %rax
jae 0x133ff
movl $0x0, -0xc(%rbp)
movb $0x1, %al
cmpl $0x1, -0xc(%rbp)
movb %al, -0x51(%rbp)
jb 0x13318
movq -0x38(%rbp), %rdi
movl -0xc(%rbp), %eax
movq %rax, -0x60(%rbp)
addq $0x20, %rdi
callq 0xbd80
movq %rax, %rcx
movq -0x60(%rbp), %rax
cmpq %rcx, %rax
seta %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0x13321
jmp 0x133a0
movq -0x38(%rbp), %rdi
callq 0xfcd0
movq -0x38(%rbp), %rsi
addq $0xa8, %rsi
movq 0x11c94(%rip), %rdi     # 0x24fd0
callq 0x41d0
movq %rax, %rdi
leaq 0x61f7(%rip), %rsi      # 0x19542
callq 0x4200
movq -0x38(%rbp), %rdi
movq %rax, -0x68(%rbp)
addq $0x20, %rdi
callq 0xbd80
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x4090
movq %rax, %rdi
leaq 0x619a(%rip), %rsi      # 0x19511
callq 0x4200
movq %rax, %rdi
movq 0x11c3a(%rip), %rsi     # 0x24fc0
callq 0x4230
movq 0x11c4e(%rip), %rdi     # 0x24fe0
leaq -0xc(%rbp), %rsi
callq 0x4050
jmp 0x132e9
movq -0x38(%rbp), %rdi
movq %rdi, %rax
addq $0x20, %rax
movq %rax, -0x70(%rbp)
addq $0x20, %rdi
callq 0x7d50
movq %rax, -0x28(%rbp)
movl -0xc(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0xc010
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x13e60
movq -0x70(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x13df0
movq %rax, -0x30(%rbp)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x132ba
jmp 0x13401
movq 0x11bc8(%rip), %rdi     # 0x24fd0
leaq 0x6163(%rip), %rsi      # 0x19572
callq 0x4200
movq %rax, %rdi
movq 0x11ba2(%rip), %rsi     # 0x24fc0
callq 0x4230
movq %rax, %rdi
movq 0x11b93(%rip), %rsi     # 0x24fc0
callq 0x4230
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)