// File: 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
movq %rsp, %rbp
subq $0x370, %rsp            # imm = 0x370
movq %rdi, -0x220(%rbp)
movq %rdi, %rax
movq %rax, -0x218(%rbp)
movq %rdi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x210(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x3170
movq -0x210(%rbp), %rdi
addq $0x1160, %rdi           # imm = 0x1160
callq 0x6400
movl %eax, -0x204(%rbp)
jmp 0xcdc9
movq -0x210(%rbp), %rdi
movl -0x204(%rbp), %eax
movl %eax, -0x1a4(%rbp)
addq $0x800, %rdi            # imm = 0x800
callq 0x6400
movl %eax, -0x224(%rbp)
jmp 0xcdf0
movl -0x224(%rbp), %eax
movl %eax, -0x1b8(%rbp)
movb $0x30, -0x1b9(%rbp)
movb $0x58, -0x1ba(%rbp)
movzbl -0x9(%rbp), %eax
cmpl $0x0, %eax
jle 0xd58c
movzbl -0xc(%rbp), %eax
cmpl $0x0, %eax
je 0xd125
movzbl -0xa(%rbp), %eax
cmpl $0x1, %eax
jle 0xcef1
leaq -0x190(%rbp), %rdi
leaq 0x7b4b(%rip), %rsi      # 0x1498a
callq 0x3230
movq %rax, -0x230(%rbp)
jmp 0xce4d
movq -0x230(%rbp), %rdi
movzbl -0xa(%rbp), %esi
callq 0x33b0
movq %rax, -0x238(%rbp)
jmp 0xce66
movq -0x238(%rbp), %rdi
leaq 0x7b1c(%rip), %rsi      # 0x14990
callq 0x3230
movq %rax, -0x240(%rbp)
jmp 0xce82
movq -0x240(%rbp), %rdi
movzbl -0xc(%rbp), %esi
callq 0x33b0
movq %rax, -0x248(%rbp)
jmp 0xce9b
movq -0x248(%rbp), %rdi
leaq 0x7afc(%rip), %rsi      # 0x149a5
callq 0x3230
movq %rax, -0x250(%rbp)
jmp 0xceb7
movq -0x250(%rbp), %rdi
movzbl -0xb(%rbp), %esi
callq 0x33b0
jmp 0xcec9
jmp 0xd0f2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x1a0(%rbp), %rdi
callq 0x3190
jmp 0xd86a
movq -0x210(%rbp), %rax
movzbl -0xc(%rbp), %ecx
imulq $0x12c, %rcx, %rcx      # imm = 0x12C
leaq 0x800(%rax,%rcx), %rdi
callq 0x6550
movq %rax, -0x258(%rbp)
jmp 0xcf19
movq -0x210(%rbp), %rax
movq -0x258(%rbp), %rcx
movl %ecx, %edx
movl %edx, -0x1c0(%rbp)
shrq $0x20, %rcx
movw %cx, -0x1bc(%rbp)
movzbl -0x1bf(%rbp), %ecx
leaq 0x7988(%rip), %rdx      # 0x148d0
movb (%rcx,%rdx), %cl
movb %cl, -0x1b9(%rbp)
movzbl -0xc(%rbp), %ecx
imulq $0x12c, %rcx, %rcx      # imm = 0x12C
leaq 0x800(%rax,%rcx), %rdi
callq 0x6550
movq %rax, -0x260(%rbp)
jmp 0xcf72
movq -0x260(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x1c6(%rbp)
shrq $0x20, %rax
movw %ax, -0x1c2(%rbp)
movzbl -0x1c6(%rbp), %eax
leaq 0x7945(%rip), %rcx      # 0x148df
movb (%rax,%rcx), %al
movb %al, -0x1ba(%rbp)
leaq -0x190(%rbp), %rdi
leaq 0x79d9(%rip), %rsi      # 0x1498a
callq 0x3230
movq %rax, -0x268(%rbp)
jmp 0xcfbf
movq -0x268(%rbp), %rdi
movsbl -0x1b9(%rbp), %esi
callq 0x32d0
movq %rax, -0x270(%rbp)
jmp 0xcfdb
movq -0x270(%rbp), %rdi
movsbl -0x1ba(%rbp), %esi
callq 0x32d0
movq %rax, -0x278(%rbp)
jmp 0xcff7
movq -0x278(%rbp), %rdi
leaq 0x79b0(%rip), %rsi      # 0x149b5
callq 0x3230
movq %rax, -0x280(%rbp)
jmp 0xd013
movzbl -0xc(%rbp), %eax
cmpl $0x0, %eax
jne 0xd02c
leaq 0x7999(%rip), %rax      # 0x149bc
movq %rax, -0x288(%rbp)
jmp 0xd04c
movzbl -0xc(%rbp), %edx
leaq 0x7965(%rip), %rax      # 0x1499c
leaq 0x7984(%rip), %rcx      # 0x149c2
cmpl $0x9, %edx
cmovgeq %rcx, %rax
movq %rax, -0x288(%rbp)
movq -0x280(%rbp), %rdi
movq -0x288(%rbp), %rsi
callq 0x3230
jmp 0xd061
movzbl -0xc(%rbp), %eax
cmpl $0x1, %eax
jl 0xd087
movzbl -0xc(%rbp), %eax
cmpl $0x7, %eax
jg 0xd087
leaq -0x190(%rbp), %rdi
movzbl -0xc(%rbp), %esi
callq 0x33b0
jmp 0xd085
jmp 0xd087
leaq -0x190(%rbp), %rdi
leaq 0x7975(%rip), %rsi      # 0x14a0a
callq 0x3230
movq %rax, -0x290(%rbp)
jmp 0xd0a3
movq -0x290(%rbp), %rdi
movzbl -0xb(%rbp), %eax
subl $0x9, %eax
leaq 0x790a(%rip), %rax      # 0x149c2
leaq 0x78dd(%rip), %rsi      # 0x1499c
cmovgeq %rax, %rsi
callq 0x3230
jmp 0xd0ca
movzbl -0xb(%rbp), %eax
cmpl $0x1, %eax
jl 0xd0f0
movzbl -0xb(%rbp), %eax
cmpl $0x7, %eax
jg 0xd0f0
leaq -0x190(%rbp), %rdi
movzbl -0xb(%rbp), %esi
callq 0x33b0
jmp 0xd0ee
jmp 0xd0f0
jmp 0xd0f2
leaq -0x190(%rbp), %rdi
leaq 0x78cd(%rip), %rsi      # 0x149cd
callq 0x3230
movq %rax, -0x298(%rbp)
jmp 0xd10e
movq -0x298(%rbp), %rdi
movzbl -0xc(%rbp), %esi
callq 0x33b0
jmp 0xd120
jmp 0xd587
movl $0x0, -0x1cc(%rbp)
movzbl -0x9(%rbp), %eax
cmpl -0x1a4(%rbp), %eax
jg 0xd212
movq -0x210(%rbp), %rdi
movzbl -0x9(%rbp), %eax
movl 0x1904(%rdi), %ecx
xorl %edx, %edx
idivl %ecx
subl $0x1, %edx
sbbl $-0x1, %eax
movl %eax, -0x1cc(%rbp)
addq $0x1160, %rdi           # imm = 0x1160
movl -0x1a4(%rbp), %esi
movzbl -0x9(%rbp), %eax
subl %eax, %esi
callq 0x6500
movq %rax, -0x2a0(%rbp)
jmp 0xd181
movq -0x210(%rbp), %rdi
movq -0x2a0(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x1d2(%rbp)
shrq $0x20, %rax
movw %ax, -0x1ce(%rbp)
movzbl -0x1d1(%rbp), %eax
leaq 0x7720(%rip), %rcx      # 0x148d0
movb (%rax,%rcx), %al
movb %al, -0x1b9(%rbp)
addq $0x1160, %rdi           # imm = 0x1160
movl -0x1a4(%rbp), %esi
movzbl -0x9(%rbp), %eax
subl %eax, %esi
callq 0x6500
movq %rax, -0x2a8(%rbp)
jmp 0xd1da
movq -0x2a8(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x1d8(%rbp)
shrq $0x20, %rax
movw %ax, -0x1d4(%rbp)
movzbl -0x1d8(%rbp), %eax
movl %eax, %ecx
leaq 0x76db(%rip), %rax      # 0x148df
movb (%rax,%rcx), %al
movb %al, -0x1ba(%rbp)
jmp 0xd461
movq -0x210(%rbp), %rcx
movzbl -0x9(%rbp), %eax
subl -0x1a4(%rbp), %eax
subl -0x1a4(%rbp), %eax
subl -0x1b8(%rbp), %eax
movl %eax, -0x1cc(%rbp)
movl -0x1cc(%rbp), %eax
cltd
idivl 0x1904(%rcx)
movl %eax, -0x2b0(%rbp)
movl -0x1cc(%rbp), %eax
cltd
idivl 0x1904(%rcx)
movl -0x2b0(%rbp), %eax
movl %edx, %edi
movl $0x1, %edx
xorl %esi, %esi
cmpl $0x0, %edi
cmovel %esi, %edx
addl %edx, %eax
movl %eax, -0x1cc(%rbp)
movl -0x1a4(%rbp), %eax
cltd
idivl 0x1904(%rcx)
movl %eax, -0x2ac(%rbp)
movl -0x1a4(%rbp), %eax
cltd
idivl 0x1904(%rcx)
movl -0x2ac(%rbp), %eax
movl %edx, %esi
movl $0x1, %ecx
xorl %edx, %edx
cmpl $0x0, %esi
cmovel %edx, %ecx
addl %ecx, %eax
addl -0x1cc(%rbp), %eax
movl %eax, -0x1cc(%rbp)
movl -0x1a4(%rbp), %eax
addl -0x1a4(%rbp), %eax
addl -0x1b8(%rbp), %eax
addl -0x1b8(%rbp), %eax
movzbl -0x9(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x1dc(%rbp)
cmpl $0x0, -0x1dc(%rbp)
jle 0xd3a7
movq -0x210(%rbp), %rdi
addq $0x800, %rdi            # imm = 0x800
movl -0x1b8(%rbp), %eax
movl -0x1dc(%rbp), %esi
notl %esi
addl %eax, %esi
callq 0x6500
movq %rax, -0x2b8(%rbp)
jmp 0xd312
movq -0x210(%rbp), %rdi
movq -0x2b8(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x1e2(%rbp)
shrq $0x20, %rax
movw %ax, -0x1de(%rbp)
movzbl -0x1e1(%rbp), %eax
leaq 0x758f(%rip), %rcx      # 0x148d0
movb (%rax,%rcx), %al
movb %al, -0x1b9(%rbp)
addq $0x800, %rdi            # imm = 0x800
movl -0x1b8(%rbp), %eax
movl -0x1dc(%rbp), %esi
notl %esi
addl %eax, %esi
callq 0x6500
movq %rax, -0x2c0(%rbp)
jmp 0xd36f
movq -0x2c0(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x1e8(%rbp)
shrq $0x20, %rax
movw %ax, -0x1e4(%rbp)
movzbl -0x1e8(%rbp), %eax
movl %eax, %ecx
leaq 0x7546(%rip), %rax      # 0x148df
movb (%rax,%rcx), %al
movb %al, -0x1ba(%rbp)
jmp 0xd45f
movq -0x210(%rbp), %rdi
addq $0x1160, %rdi           # imm = 0x1160
movl -0x1a4(%rbp), %esi
movl -0x1dc(%rbp), %eax
addl %eax, %esi
callq 0x6500
movq %rax, -0x2c8(%rbp)
jmp 0xd3d1
movq -0x210(%rbp), %rdi
movq -0x2c8(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x1ee(%rbp)
shrq $0x20, %rax
movw %ax, -0x1ea(%rbp)
movzbl -0x1ed(%rbp), %eax
leaq 0x74d0(%rip), %rcx      # 0x148d0
movb (%rax,%rcx), %al
movb %al, -0x1b9(%rbp)
addq $0x1160, %rdi           # imm = 0x1160
movl -0x1a4(%rbp), %esi
movl -0x1dc(%rbp), %eax
addl %eax, %esi
callq 0x6500
movq %rax, -0x2d0(%rbp)
jmp 0xd42c
movq -0x2d0(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x1f4(%rbp)
shrq $0x20, %rax
movw %ax, -0x1f0(%rbp)
movzbl -0x1f4(%rbp), %eax
movl %eax, %ecx
leaq 0x7489(%rip), %rax      # 0x148df
movb (%rax,%rcx), %al
movb %al, -0x1ba(%rbp)
jmp 0xd461
leaq -0x190(%rbp), %rdi
leaq 0x7571(%rip), %rsi      # 0x149e0
callq 0x3230
movq %rax, -0x2d8(%rbp)
jmp 0xd47d
movq -0x2d8(%rbp), %rdi
movl -0x1cc(%rbp), %esi
callq 0x33b0
movq %rax, -0x2e0(%rbp)
jmp 0xd498
movq -0x2e0(%rbp), %rdi
movl -0x1cc(%rbp), %eax
subl $0x1, %eax
leaq 0x7537(%rip), %rax      # 0x149e6
leaq 0x7537(%rip), %rsi      # 0x149ed
cmoveq %rax, %rsi
callq 0x3230
movq %rax, -0x2e8(%rbp)
jmp 0xd4c8
movq -0x2e8(%rbp), %rdi
leaq 0x751f(%rip), %rsi      # 0x149f5
callq 0x3230
movq %rax, -0x2f0(%rbp)
jmp 0xd4e4
movq -0x2f0(%rbp), %rdi
movsbl -0x1b9(%rbp), %esi
callq 0x32d0
movq %rax, -0x2f8(%rbp)
jmp 0xd500
movq -0x2f8(%rbp), %rdi
movsbl -0x1ba(%rbp), %esi
callq 0x32d0
movq %rax, -0x300(%rbp)
jmp 0xd51c
movq -0x300(%rbp), %rdi
leaq 0x74d5(%rip), %rsi      # 0x149ff
callq 0x3230
movq %rax, -0x308(%rbp)
jmp 0xd538
movq -0x308(%rbp), %rdi
movzbl -0xb(%rbp), %eax
subl $0x9, %eax
leaq 0x7475(%rip), %rax      # 0x149c2
leaq 0x7448(%rip), %rsi      # 0x1499c
cmovgeq %rax, %rsi
callq 0x3230
jmp 0xd55f
movzbl -0xb(%rbp), %eax
cmpl $0x1, %eax
jl 0xd585
movzbl -0xb(%rbp), %eax
cmpl $0x7, %eax
jg 0xd585
leaq -0x190(%rbp), %rdi
movzbl -0xb(%rbp), %esi
callq 0x33b0
jmp 0xd583
jmp 0xd585
jmp 0xd587
jmp 0xd839
movzbl -0xa(%rbp), %eax
cmpl $0x1, %eax
jle 0xd636
leaq -0x190(%rbp), %rdi
leaq 0x73e3(%rip), %rsi      # 0x1498a
callq 0x3230
movq %rax, -0x310(%rbp)
jmp 0xd5b5
movq -0x310(%rbp), %rdi
movzbl -0xa(%rbp), %esi
callq 0x33b0
movq %rax, -0x318(%rbp)
jmp 0xd5ce
movq -0x318(%rbp), %rdi
leaq 0x73b4(%rip), %rsi      # 0x14990
callq 0x3230
movq %rax, -0x320(%rbp)
jmp 0xd5ea
movq -0x320(%rbp), %rdi
movzbl -0xc(%rbp), %esi
callq 0x33b0
movq %rax, -0x328(%rbp)
jmp 0xd603
movq -0x328(%rbp), %rdi
leaq 0x7394(%rip), %rsi      # 0x149a5
callq 0x3230
movq %rax, -0x330(%rbp)
jmp 0xd61f
movq -0x330(%rbp), %rdi
movzbl -0xb(%rbp), %esi
callq 0x33b0
jmp 0xd631
jmp 0xd837
movq -0x210(%rbp), %rax
movzbl -0xc(%rbp), %ecx
imulq $0x12c, %rcx, %rcx      # imm = 0x12C
leaq 0x800(%rax,%rcx), %rdi
callq 0x6550
movq %rax, -0x338(%rbp)
jmp 0xd65e
movq -0x210(%rbp), %rax
movq -0x338(%rbp), %rcx
movl %ecx, %edx
movl %edx, -0x1fa(%rbp)
shrq $0x20, %rcx
movw %cx, -0x1f6(%rbp)
movzbl -0x1f9(%rbp), %ecx
leaq 0x7243(%rip), %rdx      # 0x148d0
movb (%rcx,%rdx), %cl
movb %cl, -0x1b9(%rbp)
movzbl -0xc(%rbp), %ecx
imulq $0x12c, %rcx, %rcx      # imm = 0x12C
leaq 0x800(%rax,%rcx), %rdi
callq 0x6550
movq %rax, -0x340(%rbp)
jmp 0xd6b7
movq -0x340(%rbp), %rax
movl %eax, %ecx
movl %ecx, -0x200(%rbp)
shrq $0x20, %rax
movw %ax, -0x1fc(%rbp)
movzbl -0x200(%rbp), %eax
leaq 0x7200(%rip), %rcx      # 0x148df
movb (%rax,%rcx), %al
movb %al, -0x1ba(%rbp)
leaq -0x190(%rbp), %rdi
leaq 0x7294(%rip), %rsi      # 0x1498a
callq 0x3230
movq %rax, -0x348(%rbp)
jmp 0xd704
movq -0x348(%rbp), %rdi
movsbl -0x1b9(%rbp), %esi
callq 0x32d0
movq %rax, -0x350(%rbp)
jmp 0xd720
movq -0x350(%rbp), %rdi
movsbl -0x1ba(%rbp), %esi
callq 0x32d0
movq %rax, -0x358(%rbp)
jmp 0xd73c
movq -0x358(%rbp), %rdi
leaq 0x726b(%rip), %rsi      # 0x149b5
callq 0x3230
movq %rax, -0x360(%rbp)
jmp 0xd758
movzbl -0xc(%rbp), %eax
cmpl $0x0, %eax
jne 0xd771
leaq 0x7254(%rip), %rax      # 0x149bc
movq %rax, -0x368(%rbp)
jmp 0xd791
movzbl -0xc(%rbp), %edx
leaq 0x7220(%rip), %rax      # 0x1499c
leaq 0x723f(%rip), %rcx      # 0x149c2
cmpl $0x9, %edx
cmovgeq %rcx, %rax
movq %rax, -0x368(%rbp)
movq -0x360(%rbp), %rdi
movq -0x368(%rbp), %rsi
callq 0x3230
jmp 0xd7a6
movzbl -0xc(%rbp), %eax
cmpl $0x1, %eax
jl 0xd7cc
movzbl -0xc(%rbp), %eax
cmpl $0x7, %eax
jg 0xd7cc
leaq -0x190(%rbp), %rdi
movzbl -0xc(%rbp), %esi
callq 0x33b0
jmp 0xd7ca
jmp 0xd7cc
leaq -0x190(%rbp), %rdi
leaq 0x7230(%rip), %rsi      # 0x14a0a
callq 0x3230
movq %rax, -0x370(%rbp)
jmp 0xd7e8
movq -0x370(%rbp), %rdi
movzbl -0xb(%rbp), %eax
subl $0x9, %eax
leaq 0x71c5(%rip), %rax      # 0x149c2
leaq 0x7198(%rip), %rsi      # 0x1499c
cmovgeq %rax, %rsi
callq 0x3230
jmp 0xd80f
movzbl -0xb(%rbp), %eax
cmpl $0x1, %eax
jl 0xd835
movzbl -0xb(%rbp), %eax
cmpl $0x7, %eax
jg 0xd835
leaq -0x190(%rbp), %rdi
movzbl -0xb(%rbp), %esi
callq 0x33b0
jmp 0xd833
jmp 0xd835
jmp 0xd837
jmp 0xd839
movq -0x220(%rbp), %rdi
leaq -0x1a0(%rbp), %rsi
callq 0x3220
jmp 0xd84e
leaq -0x1a0(%rbp), %rdi
callq 0x3190
movq -0x218(%rbp), %rax
addq $0x370, %rsp            # imm = 0x370
popq %rbp
retq
movq -0x1b0(%rbp), %rdi
callq 0x33d0
nopw %cs:(%rax,%rax)