// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsp, %rdi
xorl %ebp, %ebp
movl $0xd0, %edx
xorl %esi, %esi
callq 0x2100
cmpq $0xd3, 0x8(%rbx)
jb 0x7923
leaq 0x17e4(%r14), %r15
movl $0x7, %r12d
movl $0x1c, %r13d
xorl %ebp, %ebp
movl %r12d, %ecx
movq (%rbx), %rax
movzbl (%rax,%rcx), %edx
cmpl $0x4a, %edx
jle 0x7752
cmpl $0x4b, %edx
je 0x7768
cmpl $0x51, %edx
je 0x776f
cmpl $0x54, %edx
jne 0x7776
movl $0xa, %ecx
jmp 0x777c
movl $0x1, %ecx
cmpl $0x41, %edx
je 0x777c
cmpl $0x4a, %edx
jne 0x7776
movl $0xb, %ecx
jmp 0x777c
movl $0xd, %ecx
jmp 0x777c
movl $0xc, %ecx
jmp 0x777c
movsbl %dl, %ecx
xorl $0x30, %ecx
leal -0xe(%rcx), %esi
xorl %edx, %edx
cmpl $-0xd, %esi
jb 0x77d5
leal 0x1(%r12), %esi
movzbl (%rax,%rsi), %eax
cmpl $0x43, %eax
je 0x77af
cmpl $0x44, %eax
jne 0x77a0
movl $0xd, %edx
jmp 0x77af
cmpb $0x53, %al
movl $0x27, %edx
movl $0x1a, %eax
cmovel %eax, %edx
addl $0x3, %r12d
leal (%rcx,%rdx), %eax
decl %eax
cmpl $0x1, (%rsp,%rax,4)
setne %dl
je 0x77d5
movl $0x1, (%rsp,%rax,4)
movzbl %al, %esi
movq %r15, %rdi
callq 0x9d8e
movb $0x1, %dl
testb %dl, %dl
je 0x77f6
cmpq $0x33, %r13
leaq 0x1(%r13), %rax
setae %bpl
addq $0x6, %r15
movq %rax, %r13
cmpq $0x34, %rax
jne 0x772d
testb $0x1, %bpl
je 0x7921
addq $0x173c, %r14           # imm = 0x173C
xorl %r15d, %r15d
movabsq $0x1400000100002600, %r13 # imm = 0x1400000100002600
xorl %ebp, %ebp
movq 0x8(%rbx), %rcx
movl %r12d, %edx
cmpq %rdx, %rcx
jbe 0x7840
movq (%rbx), %rax
movzbl (%rax,%rdx), %esi
cmpq $0x3c, %rsi
ja 0x7840
btq %rsi, %r13
jae 0x7840
incl %r12d
movq %r12, %rdx
cmpq %r12, %rcx
ja 0x7825
leal 0x1(%r12), %eax
cmpq %rax, %rcx
jbe 0x7923
movq (%rbx), %rcx
movzbl (%rcx,%rdx), %esi
cmpl $0x4a, %esi
jle 0x7870
cmpl $0x4b, %esi
je 0x7886
cmpl $0x51, %esi
je 0x788d
cmpl $0x54, %esi
jne 0x7894
movl $0xa, %edx
jmp 0x789b
movl $0x1, %edx
cmpl $0x41, %esi
je 0x789b
cmpl $0x4a, %esi
jne 0x7894
movl $0xb, %edx
jmp 0x789b
movl $0xd, %edx
jmp 0x789b
movl $0xc, %edx
jmp 0x789b
movsbl %sil, %edx
xorl $0x30, %edx
leal -0xe(%rdx), %edi
xorl %esi, %esi
cmpl $-0xd, %edi
jb 0x7901
movzbl (%rcx,%rax), %eax
cmpl $0x43, %eax
je 0x78c9
cmpl $0x44, %eax
jne 0x78ba
movl $0xd, %esi
jmp 0x78c9
cmpb $0x53, %al
movl $0x27, %esi
movl $0x1a, %eax
cmovel %eax, %esi
addl $0x4, %r12d
leal (%rdx,%rsi), %eax
decl %eax
cmpl $0x1, (%rsp,%rax,4)
setne %sil
je 0x7901
movl $0x1, (%rsp,%rax,4)
leaq 0x30d6(%rip), %rcx      # 0xa9c0
movslq (%rcx,%r15,4), %rcx
leaq (%rcx,%rcx,2), %rcx
leaq (%r14,%rcx,2), %rdi
movzbl %al, %esi
callq 0x9d8e
movb $0x1, %sil
testb %sil, %sil
je 0x7923
cmpq $0x1b, %r15
leaq 0x1(%r15), %rax
setae %bpl
movq %rax, %r15
cmpq $0x1c, %rax
jne 0x7816
jmp 0x7923
xorl %ebp, %ebp
andb $0x1, %bpl
movl %ebp, %eax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop