// File: ShootMe[P]Klondike-Solver/Solitaire.cpp
// Function: Solitaire::LoadPysol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
bool Solitaire::LoadPysol(string const& cardSet) {
	int used[52] = {};
	if (cardSet.size() < 211) { return false; }
	unsigned int j = 7;
	for (int i = 28; i < 52; i++) {
		int rank = cardSet[j] == 'A' ? ACE : (cardSet[j] == 'T' ? TEN : (cardSet[j] == 'J' ? JACK : (cardSet[j] == 'Q' ? QUEEN : (cardSet[j] == 'K' ? KING : cardSet[j] ^ 0x30))));
		if (rank < ACE || rank > KING) { return false; }
		j++;

		int suit = cardSet[j] == 'C' ? CLUBS : (cardSet[j] == 'D' ? DIAMONDS : (cardSet[j] == 'S' ? SPADES : HEARTS));
		if (suit < CLUBS || suit > HEARTS) { return false; }
		j += 2;

		int value = suit * 13 + rank - 1;
		if (used[value] == 1) { return false; }
		used[value] = 1;
		cards[i].Set(value);
	}

	const int order[28] = { 0, 1, 7, 2, 8, 13, 3, 9, 14, 18, 4, 10, 15, 19, 22, 5, 11, 16, 20, 23, 25, 6, 12, 17, 21, 24, 26, 27 };
	for (int i = 0; i < 28; i++) {
		while (j < cardSet.size() && (cardSet[j] == '\r' || cardSet[j] == '\n' || cardSet[j] == '\t' || cardSet[j] == ' ' || cardSet[j] == ':' || cardSet[j] == '<')) { j++; }
		if (j + 1 >= cardSet.size()) { return false; }

		int rank = cardSet[j] == 'A' ? ACE : (cardSet[j] == 'T' ? TEN : (cardSet[j] == 'J' ? JACK : (cardSet[j] == 'Q' ? QUEEN : (cardSet[j] == 'K' ? KING : cardSet[j] ^ 0x30))));
		if (rank < ACE || rank > KING) { return false; }
		j++;

		int suit = cardSet[j] == 'C' ? CLUBS : (cardSet[j] == 'D' ? DIAMONDS : (cardSet[j] == 'S' ? SPADES : HEARTS));
		if (suit < CLUBS || suit > HEARTS) { return false; }
		j += 3;

		int value = suit * 13 + rank - 1;
		if (used[value] == 1) { return false; }
		used[value] = 1;
		cards[order[i]].Set(value);
	}
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1f0, %rsp            # imm = 0x1F0
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x198(%rbp)
leaq -0xf0(%rbp), %rdi
xorl %esi, %esi
movl $0xd0, %edx
callq 0x3110
movq -0x18(%rbp), %rdi
callq 0x3160
cmpq $0xd3, %rax
jae 0xc35b
movb $0x0, -0x1(%rbp)
jmp 0xca11
movl $0x7, -0xf4(%rbp)
movl $0x1c, -0xf8(%rbp)
cmpl $0x34, -0xf8(%rbp)
jge 0xc5fb
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x41, %eax
jne 0xc3a5
movl $0x1, %eax
movl %eax, -0x19c(%rbp)
jmp 0xc490
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x54, %eax
jne 0xc3ce
movl $0xa, %eax
movl %eax, -0x1a0(%rbp)
jmp 0xc484
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x4a, %eax
jne 0xc3f7
movl $0xb, %eax
movl %eax, -0x1a4(%rbp)
jmp 0xc478
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x51, %eax
jne 0xc41d
movl $0xc, %eax
movl %eax, -0x1a8(%rbp)
jmp 0xc46c
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x4b, %eax
jne 0xc443
movl $0xd, %eax
movl %eax, -0x1ac(%rbp)
jmp 0xc460
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
xorl $0x30, %eax
movl %eax, -0x1ac(%rbp)
movl -0x1ac(%rbp), %eax
movl %eax, -0x1a8(%rbp)
movl -0x1a8(%rbp), %eax
movl %eax, -0x1a4(%rbp)
movl -0x1a4(%rbp), %eax
movl %eax, -0x1a0(%rbp)
movl -0x1a0(%rbp), %eax
movl %eax, -0x19c(%rbp)
movl -0x19c(%rbp), %eax
movl %eax, -0xfc(%rbp)
cmpl $0x1, -0xfc(%rbp)
jl 0xc4ae
cmpl $0xd, -0xfc(%rbp)
jle 0xc4b7
movb $0x0, -0x1(%rbp)
jmp 0xca11
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x43, %eax
jne 0xc4e9
xorl %eax, %eax
movl %eax, -0x1b0(%rbp)
jmp 0xc545
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x44, %eax
jne 0xc50f
movl $0x1, %eax
movl %eax, -0x1b4(%rbp)
jmp 0xc539
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %edx
movl $0x3, %eax
movl $0x2, %ecx
cmpl $0x53, %edx
cmovel %ecx, %eax
movl %eax, -0x1b4(%rbp)
movl -0x1b4(%rbp), %eax
movl %eax, -0x1b0(%rbp)
movl -0x1b0(%rbp), %eax
movl %eax, -0x100(%rbp)
cmpl $0x0, -0x100(%rbp)
jl 0xc563
cmpl $0x3, -0x100(%rbp)
jle 0xc56c
movb $0x0, -0x1(%rbp)
jmp 0xca11
movl -0xf4(%rbp), %eax
addl $0x2, %eax
movl %eax, -0xf4(%rbp)
imull $0xd, -0x100(%rbp), %eax
addl -0xfc(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x104(%rbp)
movslq -0x104(%rbp), %rax
cmpl $0x1, -0xf0(%rbp,%rax,4)
jne 0xc5ab
movb $0x0, -0x1(%rbp)
jmp 0xca11
movq -0x198(%rbp), %rdi
movslq -0x104(%rbp), %rax
movl $0x1, -0xf0(%rbp,%rax,4)
addq $0x173c, %rdi           # imm = 0x173C
movslq -0xf8(%rbp), %rax
imulq $0x6, %rax, %rax
addq %rax, %rdi
movl -0x104(%rbp), %eax
movzbl %al, %esi
callq 0x13220
movl -0xf8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf8(%rbp)
jmp 0xc36f
leaq -0x180(%rbp), %rdi
leaq 0x8257(%rip), %rsi      # 0x14860
movl $0x70, %edx
callq 0x31d0
movl $0x0, -0x184(%rbp)
cmpl $0x1c, -0x184(%rbp)
jge 0xca0d
jmp 0xc62c
movl -0xf4(%rbp), %eax
movq %rax, -0x1c0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3160
movq -0x1c0(%rbp), %rcx
movq %rax, %rdx
xorl %eax, %eax
cmpq %rdx, %rcx
movb %al, -0x1b5(%rbp)
jae 0xc736
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0xd, %ecx
movb %al, -0x1c1(%rbp)
je 0xc72a
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0xa, %ecx
movb %al, -0x1c1(%rbp)
je 0xc72a
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x9, %ecx
movb %al, -0x1c1(%rbp)
je 0xc72a
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x20, %ecx
movb %al, -0x1c1(%rbp)
je 0xc72a
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x3a, %ecx
movb %al, -0x1c1(%rbp)
je 0xc72a
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x3c, %eax
sete %al
movb %al, -0x1c1(%rbp)
movb -0x1c1(%rbp), %al
movb %al, -0x1b5(%rbp)
movb -0x1b5(%rbp), %al
testb $0x1, %al
jne 0xc742
jmp 0xc756
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
jmp 0xc62c
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, %eax
movq %rax, -0x1d0(%rbp)
movq -0x18(%rbp), %rdi
callq 0x3160
movq %rax, %rcx
movq -0x1d0(%rbp), %rax
cmpq %rcx, %rax
jb 0xc789
movb $0x0, -0x1(%rbp)
jmp 0xca11
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x41, %eax
jne 0xc7b2
movl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0xc89d
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x54, %eax
jne 0xc7db
movl $0xa, %eax
movl %eax, -0x1d8(%rbp)
jmp 0xc891
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x4a, %eax
jne 0xc804
movl $0xb, %eax
movl %eax, -0x1dc(%rbp)
jmp 0xc885
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x51, %eax
jne 0xc82a
movl $0xc, %eax
movl %eax, -0x1e0(%rbp)
jmp 0xc879
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x4b, %eax
jne 0xc850
movl $0xd, %eax
movl %eax, -0x1e4(%rbp)
jmp 0xc86d
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
xorl $0x30, %eax
movl %eax, -0x1e4(%rbp)
movl -0x1e4(%rbp), %eax
movl %eax, -0x1e0(%rbp)
movl -0x1e0(%rbp), %eax
movl %eax, -0x1dc(%rbp)
movl -0x1dc(%rbp), %eax
movl %eax, -0x1d8(%rbp)
movl -0x1d8(%rbp), %eax
movl %eax, -0x1d4(%rbp)
movl -0x1d4(%rbp), %eax
movl %eax, -0x188(%rbp)
cmpl $0x1, -0x188(%rbp)
jl 0xc8bb
cmpl $0xd, -0x188(%rbp)
jle 0xc8c4
movb $0x0, -0x1(%rbp)
jmp 0xca11
movl -0xf4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xf4(%rbp)
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x43, %eax
jne 0xc8f6
xorl %eax, %eax
movl %eax, -0x1e8(%rbp)
jmp 0xc952
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %eax
cmpl $0x44, %eax
jne 0xc91c
movl $0x1, %eax
movl %eax, -0x1ec(%rbp)
jmp 0xc946
movq -0x18(%rbp), %rdi
movl -0xf4(%rbp), %eax
movl %eax, %esi
callq 0x32b0
movsbl (%rax), %edx
movl $0x3, %eax
movl $0x2, %ecx
cmpl $0x53, %edx
cmovel %ecx, %eax
movl %eax, -0x1ec(%rbp)
movl -0x1ec(%rbp), %eax
movl %eax, -0x1e8(%rbp)
movl -0x1e8(%rbp), %eax
movl %eax, -0x18c(%rbp)
cmpl $0x0, -0x18c(%rbp)
jl 0xc970
cmpl $0x3, -0x18c(%rbp)
jle 0xc979
movb $0x0, -0x1(%rbp)
jmp 0xca11
movl -0xf4(%rbp), %eax
addl $0x3, %eax
movl %eax, -0xf4(%rbp)
imull $0xd, -0x18c(%rbp), %eax
addl -0x188(%rbp), %eax
subl $0x1, %eax
movl %eax, -0x190(%rbp)
movslq -0x190(%rbp), %rax
cmpl $0x1, -0xf0(%rbp,%rax,4)
jne 0xc9b5
movb $0x0, -0x1(%rbp)
jmp 0xca11
movq -0x198(%rbp), %rdi
movslq -0x190(%rbp), %rax
movl $0x1, -0xf0(%rbp,%rax,4)
addq $0x173c, %rdi           # imm = 0x173C
movslq -0x184(%rbp), %rax
movslq -0x180(%rbp,%rax,4), %rax
imulq $0x6, %rax, %rax
addq %rax, %rdi
movl -0x190(%rbp), %eax
movzbl %al, %esi
callq 0x13220
movl -0x184(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x184(%rbp)
jmp 0xc61d
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x1f0, %rsp            # imm = 0x1F0
popq %rbp
retq
nop