// File: /workspace/github_cpp_makefile_star2_O1/ShootMe[P]Klondike-Solver/Solitaire.cpp
// Function: Solitaire::MakeMove(Move)
void Solitaire::MakeMove(Move move) {
	movesMade[movesMadeCount++] = move;

	if (move.Count == 1) {
		if (move.From == WASTE && move.Extra > 0) {
			int stockSize = piles[STOCK].Size();
			if (move.Extra <= stockSize) {
				piles[STOCK].RemoveTalon(piles[WASTE], move.Extra);
			} else {
				roundCount++;
				stockSize += stockSize;
				int wasteSize = piles[WASTE].Size();
				stockSize += wasteSize;
				stockSize += wasteSize;
				stockSize -= move.Extra;
				if (stockSize > 0) {
					piles[WASTE].RemoveTalon(piles[STOCK], stockSize);
				} else {
					piles[STOCK].RemoveTalon(piles[WASTE], -stockSize);
				}
			}
		}
		piles[move.From].Remove(piles[move.To]);

		if (move.To >= FOUNDATION1C) {
			++foundationCount;
		} else if (move.From >= FOUNDATION1C) {
			--foundationCount;
		}
	} else {
		piles[move.From].Remove(piles[move.To], move.Count);
	}

	if (move.From != WASTE && move.Extra > 0) {
		piles[move.From].Flip();
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movl %esi, %r15d
shrl $0x8, %r15d
movl %esi, %eax
shrl $0x10, %eax
movl %esi, %r14d
shrl $0x18, %r14d
movslq 0x1914(%rdi), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x1914(%rdi)
movb %bpl, (%rdi,%rcx,4)
movb %r15b, 0x1(%rdi,%rcx,4)
movb %al, 0x2(%rdi,%rcx,4)
movb %r14b, 0x3(%rdi,%rcx,4)
movzbl %al, %edx
cmpl $0x1, %edx
jne 0x4360
movl %ebp, %r12d
andl $0xff, %r12d
setne %al
cmpl $0x1000000, %ebp        # imm = 0x1000000
setb %cl
orb %al, %cl
jne 0x43b7
leaq 0x800(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x1160(%rbx), %r13
movq %r13, %rdi
callq 0x3aae
cmpl %eax, %r14d
jle 0x4397
movq %r13, 0x10(%rsp)
incl 0x1908(%rbx)
movq 0x8(%rsp), %rdi
movl %eax, %r13d
callq 0x3aae
addl %r13d, %eax
addl %eax, %eax
subl %r14d, %eax
jle 0x43a4
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rsi
jmp 0x43b0
movl $0xff, %eax
movl %ebp, %ecx
andl %eax, %ecx
imulq $0x12c, %rcx, %rcx      # imm = 0x12C
leaq (%rbx,%rcx), %rdi
addq $0x800, %rdi            # imm = 0x800
andl %eax, %r15d
imulq $0x12c, %r15, %rax      # imm = 0x12C
leaq (%rbx,%rax), %rsi
addq $0x800, %rsi            # imm = 0x800
callq 0x3968
jmp 0x4409
movq %r13, %rdi
movq 0x8(%rsp), %rsi
movl %r14d, %edx
jmp 0x43b2
negl %eax
movq 0x10(%rsp), %rdi
movq 0x8(%rsp), %rsi
movl %eax, %edx
callq 0x39e2
movl %r12d, %eax
imulq $0x12c, %rax, %rax      # imm = 0x12C
leaq (%rbx,%rax), %rdi
addq $0x800, %rdi            # imm = 0x800
movzbl %r15b, %eax
imulq $0x12c, %rax, %rax      # imm = 0x12C
leaq (%rbx,%rax), %rsi
addq $0x800, %rsi            # imm = 0x800
callq 0x3912
movl %ebp, %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0x801, %eax            # imm = 0x801
jb 0x43fd
incl 0x190c(%rbx)
jmp 0x4409
cmpl $0x9, %r12d
jb 0x4409
decl 0x190c(%rbx)
movl %ebp, %eax
andl $0xff, %eax
sete %cl
cmpl $0x1000000, %ebp        # imm = 0x1000000
setb %dl
orb %cl, %dl
jne 0x4447
movl %eax, %eax
imulq $0x12c, %rax, %rax      # imm = 0x12C
leaq (%rbx,%rax), %rdi
addq $0x800, %rdi            # imm = 0x800
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x38a2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq