// File: /workspace/github_cpp_makefile_star2_O3/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 0x3a66
movl %eax, %ebp
leaq 0x800(%r14), %r15
movq %r15, %rdi
callq 0x3a66
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 0x7be3
cmpl $0x20000, %ebx          # imm = 0x20000
jb 0x7c70
leaq 0x30(%rsp), %r14
leaq 0x2d11(%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 0x2cf0(%rip), %rsi      # 0xa895
movl $0x14, %edx
movq %rax, %rdi
callq 0x2200
movzbl %bl, %esi
movq %r14, %rdi
callq 0x22c0
movq %rax, %r15
leaq 0x2ce3(%rip), %rsi      # 0xa8aa
movl $0xf, %edx
movq %rax, %rdi
callq 0x2200
movzbl 0xc(%rsp), %eax
movq %rax, 0x10(%rsp)
jmp 0x7f6f
movl %ebx, %eax
andl $0xff, %eax
movq %rax, 0x10(%rsp)
je 0x7daa
movzbl %r12b, %ebx
cmpl $0x2, %ebx
jb 0x7e2e
leaq 0x30(%rsp), %r14
leaq 0x2c81(%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 0x2c61(%rip), %rsi      # 0xa895
movl $0x14, %edx
movq %rax, %rdi
callq 0x2200
movq %rbx, %rdi
movq 0x10(%rsp), %rsi
callq 0x22c0
movq %rax, %r15
leaq 0x2c52(%rip), %rsi      # 0xa8aa
movl $0xf, %edx
movq %rax, %rdi
callq 0x2200
movzbl 0xc(%rsp), %r14d
jmp 0x7f4b
movzbl %bl, %r14d
imulq $0x12c, %r14, %rax      # imm = 0x12C
addq %rax, %r15
movq %r15, %rdi
callq 0x3ad2
movzbl %ah, %eax
leaq 0x2bf0(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r15, %rdi
callq 0x3ad2
movzbl %al, %eax
leaq 0x2cc7(%rip), %rcx      # 0xa96d
movb (%rax,%rcx), %bl
leaq 0x30(%rsp), %r15
leaq 0x2bda(%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 0x2bc5(%rip), %rsi      # 0xa8ba
movl $0x6, %edx
movq %rax, %rdi
callq 0x2200
cmpl $0x9, %r14d
leaq 0x2bba(%rip), %rbp      # 0xa8c7
leaq 0x2b8d(%rip), %rbx      # 0xa8a1
movq %rbx, %rax
cmovaeq %rbp, %rax
testl %r14d, %r14d
leaq 0x2b9c(%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 0x7d58
movq %r15, %rdi
movl %r14d, %esi
callq 0x22c0
leaq 0x2bb0(%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 0x7f6f
jmp 0x7f7c
shrl $0x18, %ebx
movl %ebp, %r12d
subl %ebx, %r12d
jge 0x7fbc
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 0x7ffc
notl %r12d
addl %r12d, %r8d
movq %r15, %rdi
movl %r8d, %esi
movq %r8, %rbx
callq 0x3ab4
movzbl %ah, %eax
leaq 0x2a6a(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r15, %rdi
movl %ebx, %esi
callq 0x3ab4
movq 0x18(%rsp), %r13
jmp 0x8028
movl 0x10(%rsp), %eax
imulq $0x12c, %rax, %rax      # imm = 0x12C
addq %rax, %r15
movq %r15, %rdi
callq 0x3ad2
movq 0x18(%rsp), %r13
movzbl %ah, %eax
leaq 0x2a2d(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r15, %rdi
callq 0x3ad2
movzbl %al, %eax
leaq 0x2b04(%rip), %rcx      # 0xa96d
movb (%rax,%rcx), %bl
leaq 0x30(%rsp), %r15
leaq 0x2a17(%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 0x2a02(%rip), %rsi      # 0xa8ba
movl $0x6, %edx
movq %rax, %rdi
callq 0x2200
xorl %eax, %eax
cmpl $0x9, 0x10(%rsp)
setae %al
leaq 0x29f1(%rip), %r12      # 0xa8c7
leaq 0x29c4(%rip), %rbx      # 0xa8a1
movq %rbx, %rsi
cmovaeq %r12, %rsi
leaq 0x8(,%rax,2), %rdx
movq %r14, %rdi
callq 0x2200
cmpl $0x7, 0x10(%rsp)
ja 0x7f08
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x22c0
leaq 0x2a00(%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 0x7f56
movq %r15, %rdi
movl %r14d, %esi
callq 0x22c0
leaq 0x30(%rsp), %r15
leaq 0x2970(%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 0x6028(%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 0x3ab4
movq %rax, %rcx
movl %ebx, %eax
xorl %edx, %edx
idivl %ebp
movl %eax, %r14d
cmpl $0x1, %edx
sbbl $-0x1, %r14d
movzbl %ch, %eax
leaq 0x2895(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r13, %rdi
movl %r12d, %esi
callq 0x3ab4
jmp 0x8023
addl %ebp, %r12d
movq %r13, %rdi
movl %r12d, %esi
callq 0x3ab4
movzbl %ah, %eax
leaq 0x286c(%rip), %rcx      # 0xa880
movb (%rax,%rcx), %bpl
movq %r13, %rdi
movl %r12d, %esi
callq 0x3ab4
movq 0x18(%rsp), %r13
movzbl %al, %eax
leaq 0x293b(%rip), %rcx      # 0xa96d
movb (%rax,%rcx), %r12b
leaq 0x30(%rsp), %rbx
leaq 0x28a3(%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 0x287e(%rip), %rax      # 0xa8eb
leaq 0x287e(%rip), %rsi      # 0xa8f2
cmoveq %rax, %rsi
xorq $0x7, %rdx
movq %r15, %rdi
callq 0x2200
leaq 0x286f(%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 0x2838(%rip), %rsi      # 0xa904
movl $0x12, %edx
movq %rax, %rdi
callq 0x2200
movzbl 0xc(%rsp), %r15d
xorl %eax, %eax
cmpl $0x9, %r15d
setae %al
leaq 0x27d8(%rip), %rcx      # 0xa8c7
leaq 0x27ab(%rip), %rsi      # 0xa8a1
cmovaeq %rcx, %rsi
leaq 0x8(,%rax,2), %rdx
movq %r14, %rdi
callq 0x2200
leal -0x1(%r15), %eax
cmpl $0x6, %eax
ja 0x7f7c
movq %rbx, %rdi
movl %r15d, %esi
callq 0x22c0
jmp 0x7f7c
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
jmp 0x8141
movq %rax, %rbx
movq 0x5e6d(%rip), %rsi      # 0xdfb8
leaq 0x20(%rsp), %rdi
callq 0x2150
leaq 0xa0(%rsp), %rdi
callq 0x20a0
movq %rbx, %rdi
callq 0x22e0