// File: /workspace/github_cpp_makefile_star2_O2/ShootMe[P]Klondike-Solver/Solitaire.cpp
// Function: Solitaire::GetMoveInfo[abi:cxx11](Move)
string Solitaire::GetMoveInfo(Move move) {
	stringstream ss;
	int stockSize = piles[STOCK].Size();
	int wasteSize = piles[WASTE].Size();

	char fromRank = '0';
	char fromSuit = 'X';

	if (move.Extra > 0) {
		if (move.From != WASTE) {
			if (move.Count > 1) {
				ss << "Move " << (int)move.Count << " cards from tableau " << (int)move.From << " on to tableau " << (int)move.To;
			} else {
				fromRank = RANKS[piles[move.From].Low().Rank];
				fromSuit = SUITS[piles[move.From].Low().Suit];
				ss << "Move " << fromRank << fromSuit << " from " << (move.From == WASTE ? "waste" : (move.From >= FOUNDATION1C ? "foundation" : "tableau "));
				if (move.From >= TABLEAU1 && move.From <= TABLEAU7) { ss << (int)move.From; }
				ss << " on to " << (move.To >= FOUNDATION1C ? "foundation" : "tableau ");
				if (move.To >= TABLEAU1 && move.To <= TABLEAU7) { ss << (int)move.To; }
			}
			ss << " and flip tableau " << (int)move.From;
		} else {
			int drawAmount = 0;
			if (move.Extra <= stockSize) {
				drawAmount = move.Extra / drawCount + ((move.Extra % drawCount) == 0 ? 0 : 1);
				fromRank = RANKS[piles[STOCK].Up(stockSize - move.Extra).Rank];
				fromSuit = SUITS[piles[STOCK].Up(stockSize - move.Extra).Suit];
			} else {
				drawAmount = move.Extra - stockSize - stockSize - wasteSize;
				drawAmount = drawAmount / drawCount + ((drawAmount % drawCount) == 0 ? 0 : 1);
				drawAmount += stockSize / drawCount + ((stockSize % drawCount) == 0 ? 0 : 1);

				int cardsToMove = stockSize + stockSize + wasteSize + wasteSize - move.Extra;
				if (cardsToMove > 0) {
					fromRank = RANKS[piles[WASTE].Up(wasteSize - cardsToMove - 1).Rank];
					fromSuit = SUITS[piles[WASTE].Up(wasteSize - cardsToMove - 1).Suit];
				} else {
					fromRank = RANKS[piles[STOCK].Up(stockSize + cardsToMove).Rank];
					fromSuit = SUITS[piles[STOCK].Up(stockSize + cardsToMove).Suit];
				}
			}
			ss << "Draw " << drawAmount << (drawAmount == 1 ? " time " : " times ") << "and move " << fromRank << fromSuit << " from waste on to " << (move.To >= FOUNDATION1C ? "foundation" : "tableau ");
			if (move.To >= TABLEAU1 && move.To <= TABLEAU7) { ss << (int)move.To; }
		}
	} else if (move.Count > 1) {
		ss << "Move " << (int)move.Count << " cards from tableau " << (int)move.From << " on to tableau " << (int)move.To;
	} else {
		fromRank = RANKS[piles[move.From].Low().Rank];
		fromSuit = SUITS[piles[move.From].Low().Suit];
		ss << "Move " << fromRank << fromSuit << " from " << (move.From == WASTE ? "waste" : (move.From >= FOUNDATION1C ? "foundation" : "tableau "));
		if (move.From >= TABLEAU1 && move.From <= TABLEAU7) { ss << (int)move.From; }
		ss << " on to " << (move.To >= FOUNDATION1C ? "foundation" : "tableau ");
		if (move.To >= TABLEAU1 && move.To <= TABLEAU7) { ss << (int)move.To; }
	}
	return ss.str();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %edx, %r14d
movq %rsi, %rbx
movq %rdi, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x2120
leaq 0x1160(%rbx), %r13
movq %r13, %rdi
callq 0x3874
movl %eax, %ebp
leaq 0x800(%rbx), %r15
movq %r15, %rdi
callq 0x3874
movl %eax, %r8d
movl %r14d, %eax
shrl $0x8, %eax
movl %eax, 0xc(%rsp)
movl %r14d, %r12d
shrl $0x10, %r12d
cmpl $0x1000000, %r14d       # imm = 0x1000000
jae 0x6f51
cmpl $0x20000, %r14d         # imm = 0x20000
jb 0x6fca
leaq 0x30(%rsp), %rdi
leaq 0x2976(%rip), %rsi      # 0x9876
callq 0x21c0
movq 0x18(%rsp), %r13
movq %rax, %rdi
movl %r12d, %esi
callq 0x22e0
leaq 0x2960(%rip), %rsi      # 0x987c
movq %rax, %rdi
callq 0x21c0
movzbl %r14b, %esi
movq %rax, %rdi
callq 0x22e0
leaq 0x295a(%rip), %rsi      # 0x9891
movq %rax, %rdi
callq 0x21c0
movq %rax, %r15
movzbl 0xc(%rsp), %eax
movq %rax, 0x10(%rsp)
jmp 0x7245
movl %r14d, %eax
andl $0xff, %eax
movq %rax, 0x10(%rsp)
je 0x70c5
movzbl %r12b, %ebx
cmpl $0x2, %ebx
jb 0x7147
leaq 0x30(%rsp), %rdi
leaq 0x28f9(%rip), %rsi      # 0x9876
callq 0x21c0
movq 0x18(%rsp), %r13
movq %rax, %rdi
movl %ebx, %esi
callq 0x22e0
leaq 0x28e4(%rip), %rsi      # 0x987c
movq %rax, %rdi
callq 0x21c0
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x22e0
leaq 0x28dd(%rip), %rsi      # 0x9891
movq %rax, %rdi
callq 0x21c0
movq %rax, %r15
movzbl 0xc(%rsp), %r14d
jmp 0x7226
movzbl %r14b, %r14d
imulq $0x12c, %r14, %rax      # imm = 0x12C
addq %rax, %r15
movq %r15, %rdi
callq 0x38e0
movq 0x18(%rsp), %r13
movzbl %ah, %eax
leaq 0x2878(%rip), %rcx      # 0x9867
movb (%rax,%rcx), %bl
movq %r15, %rdi
callq 0x38e0
movzbl %al, %eax
leaq 0x2950(%rip), %rcx      # 0x9954
movb (%rax,%rcx), %bpl
leaq 0x30(%rsp), %r15
leaq 0x2862(%rip), %rsi      # 0x9876
movq %r15, %rdi
callq 0x21c0
movsbl %bl, %esi
movq %rax, %rdi
callq 0x2210
movsbl %bpl, %esi
movq %rax, %rdi
callq 0x2210
leaq 0x2867(%rip), %rsi      # 0x98a1
movq %rax, %rdi
callq 0x21c0
cmpl $0x9, %r14d
leaq 0x2861(%rip), %r12      # 0x98ae
leaq 0x2834(%rip), %rbx      # 0x9888
movq %rbx, %rcx
cmovaeq %r12, %rcx
testl %r14d, %r14d
leaq 0x2843(%rip), %rsi      # 0x98a8
cmovneq %rcx, %rsi
movq %rax, %rdi
callq 0x21c0
leal -0x1(%r14), %eax
cmpl $0x6, %eax
ja 0x7085
movq %r15, %rdi
movl %r14d, %esi
callq 0x22e0
leaq 0x286a(%rip), %rsi      # 0x98f6
movq %r15, %rdi
callq 0x21c0
movzbl 0xc(%rsp), %ecx
movq %rcx, 0x10(%rsp)
cmpl $0x9, %ecx
cmovaeq %r12, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21c0
movq 0x10(%rsp), %rax
decl %eax
cmpl $0x6, %eax
jbe 0x7245
jmp 0x7252
shrl $0x18, %r14d
movl %ebp, %r12d
subl %r14d, %r12d
jge 0x727e
leal (%r8,%rbp,2), %ecx
movl %r14d, %eax
subl %ecx, %eax
movl 0x1904(%rbx), %edi
cltd
idivl %edi
movl %edx, %ecx
movl %eax, %esi
movl %ebp, %eax
cltd
idivl %edi
movl %eax, %ebx
addl %esi, %ebx
cmpl $0x1, %ecx
sbbl $-0x1, %ebx
cmpl $0x1, %edx
sbbl $-0x1, %ebx
leal (%r8,%rbp), %r12d
addl %r12d, %r12d
subl %r14d, %r12d
jle 0x72bc
notl %r12d
addl %r12d, %r8d
movq %r15, %rdi
movl %r8d, %esi
movq %r8, %r14
callq 0x38c2
movzbl %ah, %eax
leaq 0x2739(%rip), %rcx      # 0x9867
movb (%rax,%rcx), %bpl
movq %r15, %rdi
movl %r14d, %esi
callq 0x38c2
movq 0x18(%rsp), %r13
jmp 0x72e8
movl 0x10(%rsp), %eax
imulq $0x12c, %rax, %rax      # imm = 0x12C
addq %rax, %r15
movq %r15, %rdi
callq 0x38e0
movq 0x18(%rsp), %r13
movzbl %ah, %eax
leaq 0x26fb(%rip), %rcx      # 0x9867
movb (%rax,%rcx), %bl
movq %r15, %rdi
callq 0x38e0
movzbl %al, %eax
leaq 0x27d3(%rip), %rcx      # 0x9954
movb (%rax,%rcx), %bpl
leaq 0x30(%rsp), %r15
leaq 0x26e5(%rip), %rsi      # 0x9876
movq %r15, %rdi
callq 0x21c0
movsbl %bl, %esi
movq %rax, %rdi
callq 0x2210
movsbl %bpl, %esi
movq %rax, %rdi
callq 0x2210
leaq 0x26ea(%rip), %rsi      # 0x98a1
movq %rax, %rdi
callq 0x21c0
cmpl $0x9, 0x10(%rsp)
leaq 0x26e3(%rip), %r12      # 0x98ae
leaq 0x26b6(%rip), %rbx      # 0x9888
movq %rbx, %rsi
cmovaeq %r12, %rsi
movq %rax, %rdi
callq 0x21c0
cmpl $0x7, 0x10(%rsp)
ja 0x71f5
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x22e0
leaq 0x26fa(%rip), %rsi      # 0x98f6
movq %r15, %rdi
callq 0x21c0
movzbl 0xc(%rsp), %r14d
cmpl $0x9, %r14d
cmovaeq %r12, %rbx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x21c0
leal -0x1(%r14), %eax
cmpl $0x6, %eax
ja 0x7231
movq %r15, %rdi
movl %r14d, %esi
callq 0x22e0
leaq 0x30(%rsp), %rdi
leaq 0x267c(%rip), %rsi      # 0x98b9
callq 0x21c0
movq %rax, %r15
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x22e0
leaq 0x38(%rsp), %rsi
movq %r13, %rdi
callq 0x22a0
leaq 0x20(%rsp), %rdi
callq 0x2140
movq %r13, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x1904(%rbx), %ebx
movq %r13, %rdi
movl %r12d, %esi
callq 0x38c2
movq %rax, %rcx
movl %r14d, %eax
xorl %edx, %edx
idivl %ebx
movl %eax, %ebx
cmpl $0x1, %edx
sbbl $-0x1, %ebx
movzbl %ch, %eax
leaq 0x25bc(%rip), %rcx      # 0x9867
movb (%rax,%rcx), %bpl
movq %r13, %rdi
movl %r12d, %esi
callq 0x38c2
jmp 0x72e3
addl %ebp, %r12d
movq %r13, %rdi
movl %r12d, %esi
callq 0x38c2
movzbl %ah, %eax
leaq 0x2593(%rip), %rcx      # 0x9867
movb (%rax,%rcx), %bpl
movq %r13, %rdi
movl %r12d, %esi
callq 0x38c2
movq 0x18(%rsp), %r13
movzbl %al, %eax
leaq 0x2662(%rip), %rcx      # 0x9954
movb (%rax,%rcx), %r15b
leaq 0x30(%rsp), %r14
leaq 0x25ca(%rip), %rsi      # 0x98cc
movq %r14, %rdi
callq 0x21c0
movq %rax, %rdi
movl %ebx, %esi
callq 0x22e0
cmpl $0x1, %ebx
leaq 0x25b4(%rip), %rcx      # 0x98d2
leaq 0x25b4(%rip), %rsi      # 0x98d9
cmoveq %rcx, %rsi
movq %rax, %rdi
callq 0x21c0
leaq 0x25a9(%rip), %rsi      # 0x98e1
movq %rax, %rdi
callq 0x21c0
movsbl %bpl, %esi
movq %rax, %rdi
callq 0x2210
movsbl %r15b, %esi
movq %rax, %rdi
callq 0x2210
leaq 0x258c(%rip), %rsi      # 0x98eb
movq %rax, %rdi
callq 0x21c0
movzbl 0xc(%rsp), %ebx
cmpl $0x9, %ebx
leaq 0x2538(%rip), %rcx      # 0x98ae
leaq 0x250b(%rip), %rsi      # 0x9888
cmovaeq %rcx, %rsi
movq %rax, %rdi
callq 0x21c0
leal -0x1(%rbx), %eax
cmpl $0x6, %eax
ja 0x7252
movq %r14, %rdi
movl %ebx, %esi
callq 0x22e0
jmp 0x7252
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
jmp 0x73be
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2140
movq %rbx, %rdi
callq 0x2300
nop