// File: /workspace/github_cpp_makefile_star2_O1/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, %ebx
movq %rsi, %r14
movq %rdi, 0x18(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x2130
leaq 0x1160(%r14), %r13
movq %r13, %rdi
callq 0x3aae
movl %eax, %ebp
leaq 0x800(%r14), %r15
movq %r15, %rdi
callq 0x3aae
movl %eax, %r8d
movl %ebx, %eax
shrl $0x8, %eax
movl %eax, 0xc(%rsp)
movl %ebx, %r12d
shrl $0x10, %r12d
cmpl $0x1000000, %ebx        # imm = 0x1000000
jae 0x7caf
cmpl $0x20000, %ebx          # imm = 0x20000
jb 0x7d3c
leaq 0x30(%rsp), %r14
leaq 0x2c45(%rip), %rsi      # 0xa88f
movl $0x5, %edx
movq %r14, %rdi
callq 0x2200
movq 0x18(%rsp), %r13
movq %r14, %rdi
movl %r12d, %esi
callq 0x22c0
movq %rax, %r14
leaq 0x2c24(%rip), %rsi      # 0xa895
movl $0x14, %edx
movq %rax, %rdi
callq 0x2200
movzbl %bl, %esi
movq %r14, %rdi
callq 0x22c0
movq %rax, %r15
leaq 0x2c17(%rip), %rsi      # 0xa8aa
movl $0xf, %edx
movq %rax, %rdi
callq 0x2200
movzbl 0xc(%rsp), %eax
movq %rax, 0x10(%rsp)
jmp 0x803b
movl %ebx, %eax
andl $0xff, %eax
movq %rax, 0x10(%rsp)
je 0x7e76
movzbl %r12b, %ebx
cmpl $0x2, %ebx
jb 0x7efa
leaq 0x30(%rsp), %r14
leaq 0x2bb5(%rip), %rsi      # 0xa88f
movl $0x5, %edx
movq %r14, %rdi
callq 0x2200
movq 0x18(%rsp), %r13
movq %r14, %rdi
movl %ebx, %esi
callq 0x22c0
movq %rax, %rbx
leaq 0x2b95(%rip), %rsi      # 0xa895
movl $0x14, %edx
movq %rax, %rdi
callq 0x2200
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x22c0
movq %rax, %r15
leaq 0x2b86(%rip), %rsi      # 0xa8aa
movl $0xf, %edx
movq %rax, %rdi
callq 0x2200
movzbl 0xc(%rsp), %r14d
jmp 0x8017
movzbl %bl, %r14d
imulq $0x12c, %r14, %rax      # imm = 0x12C
addq %rax, %r15
movq %r15, %rdi
callq 0x3b1a
movzbl %ah, %eax
leaq 0x2b24(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r15, %rdi
callq 0x3b1a
movzbl %al, %eax
leaq 0x2bfb(%rip), %rcx      # 0xa96d
movb (%rax,%rcx), %bl
leaq 0x30(%rsp), %r15
leaq 0x2b0e(%rip), %rsi      # 0xa88f
movl $0x5, %edx
movq %r15, %rdi
callq 0x2200
leaq 0xb(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x2200
leaq 0xb(%rsp), %rsi
movb %bl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movq %rax, %r12
leaq 0x2af9(%rip), %rsi      # 0xa8ba
movl $0x6, %edx
movq %rax, %rdi
callq 0x2200
cmpl $0x9, %r14d
leaq 0x2aee(%rip), %rbp      # 0xa8c7
leaq 0x2ac1(%rip), %rbx      # 0xa8a1
movq %rbx, %rax
cmovaeq %rbp, %rax
testl %r14d, %r14d
leaq 0x2ad0(%rip), %r13      # 0xa8c1
cmovneq %rax, %r13
movq %r13, %rdi
callq 0x20d0
movq %r12, %rdi
movq %r13, %rsi
movq 0x18(%rsp), %r13
movq %rax, %rdx
callq 0x2200
leal -0x1(%r14), %eax
cmpl $0x6, %eax
ja 0x7e24
movq %r15, %rdi
movl %r14d, %esi
callq 0x22c0
leaq 0x2ae4(%rip), %rsi      # 0xa90f
movl $0x7, %edx
movq %r15, %rdi
callq 0x2200
movzbl 0xc(%rsp), %ecx
xorl %eax, %eax
movq %rcx, 0x10(%rsp)
cmpl $0x9, %ecx
setae %al
cmovaeq %rbp, %rbx
leaq 0x8(,%rax,2), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2200
movq 0x10(%rsp), %rax
decl %eax
cmpl $0x6, %eax
jbe 0x803b
jmp 0x8048
shrl $0x18, %ebx
movl %ebp, %r12d
subl %ebx, %r12d
jge 0x8088
leal (%r8,%rbp,2), %ecx
movl %ebx, %eax
subl %ecx, %eax
movl 0x1904(%r14), %edi
cltd
idivl %edi
movl %edx, %ecx
movl %eax, %esi
movl %ebp, %eax
cltd
idivl %edi
movl %eax, %r14d
addl %esi, %r14d
cmpl $0x1, %ecx
sbbl $-0x1, %r14d
cmpl $0x1, %edx
sbbl $-0x1, %r14d
leal (%r8,%rbp), %r12d
addl %r12d, %r12d
subl %ebx, %r12d
jle 0x80c8
notl %r12d
addl %r12d, %r8d
movq %r15, %rdi
movl %r8d, %esi
movq %r8, %rbx
callq 0x3afc
movzbl %ah, %eax
leaq 0x299e(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r15, %rdi
movl %ebx, %esi
callq 0x3afc
movq 0x18(%rsp), %r13
jmp 0x80f4
movl 0x10(%rsp), %eax
imulq $0x12c, %rax, %rax      # imm = 0x12C
addq %rax, %r15
movq %r15, %rdi
callq 0x3b1a
movq 0x18(%rsp), %r13
movzbl %ah, %eax
leaq 0x2961(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r15, %rdi
callq 0x3b1a
movzbl %al, %eax
leaq 0x2a38(%rip), %rcx      # 0xa96d
movb (%rax,%rcx), %bl
leaq 0x30(%rsp), %r15
leaq 0x294b(%rip), %rsi      # 0xa88f
movl $0x5, %edx
movq %r15, %rdi
callq 0x2200
leaq 0xb(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x2200
leaq 0xb(%rsp), %rsi
movb %bl, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movq %rax, %r14
leaq 0x2936(%rip), %rsi      # 0xa8ba
movl $0x6, %edx
movq %rax, %rdi
callq 0x2200
xorl %eax, %eax
cmpl $0x9, 0x10(%rsp)
setae %al
leaq 0x2925(%rip), %r12      # 0xa8c7
leaq 0x28f8(%rip), %rbx      # 0xa8a1
movq %rbx, %rsi
cmovaeq %r12, %rsi
leaq 0x8(,%rax,2), %rdx
movq %r14, %rdi
callq 0x2200
cmpl $0x7, 0x10(%rsp)
ja 0x7fd4
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x22c0
leaq 0x2934(%rip), %rsi      # 0xa90f
movl $0x7, %edx
movq %r15, %rdi
callq 0x2200
movzbl 0xc(%rsp), %r14d
xorl %eax, %eax
cmpl $0x9, %r14d
setae %al
cmovaeq %r12, %rbx
leaq 0x8(,%rax,2), %rdx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2200
leal -0x1(%r14), %eax
cmpl $0x6, %eax
ja 0x8022
movq %r15, %rdi
movl %r14d, %esi
callq 0x22c0
leaq 0x30(%rsp), %r15
leaq 0x28a4(%rip), %rsi      # 0xa8d2
movl $0x12, %edx
movq %r15, %rdi
callq 0x2200
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x22c0
leaq 0x38(%rsp), %rsi
movq %r13, %rdi
callq 0x2280
movq 0x5f5c(%rip), %rsi      # 0xdfb8
leaq 0x20(%rsp), %rdi
callq 0x2150
leaq 0xa0(%rsp), %rdi
callq 0x20a0
movq %r13, %rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x1904(%r14), %ebp
movq %r13, %rdi
movl %r12d, %esi
callq 0x3afc
movq %rax, %rcx
movl %ebx, %eax
xorl %edx, %edx
idivl %ebp
movl %eax, %r14d
cmpl $0x1, %edx
sbbl $-0x1, %r14d
movzbl %ch, %eax
leaq 0x27c9(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r13, %rdi
movl %r12d, %esi
callq 0x3afc
jmp 0x80ef
addl %ebp, %r12d
movq %r13, %rdi
movl %r12d, %esi
callq 0x3afc
movzbl %ah, %eax
leaq 0x27a0(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r13, %rdi
movl %r12d, %esi
callq 0x3afc
movq 0x18(%rsp), %r13
movzbl %al, %eax
leaq 0x286f(%rip), %rcx      # 0xa96d
movb (%rax,%rcx), %r12b
leaq 0x30(%rsp), %rbx
leaq 0x27d7(%rip), %rsi      # 0xa8e5
movl $0x5, %edx
movq %rbx, %rdi
callq 0x2200
movq %rbx, %rdi
movl %r14d, %esi
callq 0x22c0
movq %rax, %r15
xorl %edx, %edx
cmpl $0x1, %r14d
sete %dl
leaq 0x27b2(%rip), %rax      # 0xa8eb
leaq 0x27b2(%rip), %rsi      # 0xa8f2
cmoveq %rax, %rsi
xorq $0x7, %rdx
movq %r15, %rdi
callq 0x2200
leaq 0x27a3(%rip), %rsi      # 0xa8fa
movl $0x9, %edx
movq %r15, %rdi
callq 0x2200
leaq 0xb(%rsp), %rsi
movb %bpl, (%rsi)
movl $0x1, %edx
movq %r15, %rdi
callq 0x2200
leaq 0xb(%rsp), %rsi
movb %r12b, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movq %rax, %r14
leaq 0x276c(%rip), %rsi      # 0xa904
movl $0x12, %edx
movq %rax, %rdi
callq 0x2200
movzbl 0xc(%rsp), %r15d
xorl %eax, %eax
cmpl $0x9, %r15d
setae %al
leaq 0x270c(%rip), %rcx      # 0xa8c7
leaq 0x26df(%rip), %rsi      # 0xa8a1
cmovaeq %rcx, %rsi
leaq 0x8(,%rax,2), %rdx
movq %r14, %rdi
callq 0x2200
leal -0x1(%r15), %eax
cmpl $0x6, %eax
ja 0x8048
movq %rbx, %rdi
movl %r15d, %esi
callq 0x22c0
jmp 0x8048
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
jmp 0x820d
movq %rax, %rbx
movq 0x5da1(%rip), %rsi      # 0xdfb8
leaq 0x20(%rsp), %rdi
callq 0x2150
leaq 0xa0(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x22e0