// File: /workspace/github_cpp_makefile_star2_O3/ShootMe[P]Klondike-Solver/KlondikeSolver.cpp
// Function: LoadGame(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, Solitaire&, unsigned int&)
bool LoadGame(string const& f, Solitaire & s, unsigned int & index) {
	while (index < f.size() && f[index] == '\r' || f[index] == '\n' || f[index] == '\t' || f[index] == ' ') { index++; }
	if (index >= f.size()) { return false; }
	int gameType = 0;
	int startIndex = index;
	if (f[index] == '#') {
		while (index < f.size() && f[index++] != '\n') {}
		return false;
	} else if (f[index] == 'T' || f[index] == 't') {
		int lineCount = 0;
		while (index < f.size() && lineCount < 8) {
			if (f[index++] == '\n') { lineCount++; }
		}
		s.LoadPysol(f.substr(startIndex, index - startIndex));
	} else if (f[index] == 'G' || f[index] == 'g') {
		while (index < f.size() && f[index++] != ' ') {}
		startIndex = index;
		while (index < f.size() && f[index++] != '\n') {}
		s.Shuffle1(atoi(f.substr(startIndex, index - startIndex).c_str()));
	} else {
		while (index < f.size() && f[index++] != '\n') {}
		s.LoadSolitaire(f.substr(startIndex, index - startIndex));
	}
	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
movq (%rdi), %rdi
movq 0x8(%rsi), %r8
movl (%rdx), %eax
movabsq $0x100000600, %rcx      # imm = 0x100000600
movl %eax, %r9d
cmpq %r9, %r8
seta %r11b
movb (%rdi,%r9), %r10b
cmpb $0xd, %r10b
sete %bpl
testb %bpl, %r11b
jne 0x24ab
movzbl %r10b, %r10d
cmpl $0x20, %r10d
ja 0x24b1
movl %r10d, %r11d
btq %r11, %rcx
jae 0x24b1
incl %eax
movl %eax, (%rdx)
jmp 0x247d
cmpq %r9, %r8
jbe 0x2593
cmpl $0x53, %r10d
jle 0x2529
cmpl $0x54, %r10d
je 0x24d8
cmpl $0x67, %r10d
je 0x2537
movl %eax, %ecx
cmpl $0x74, %r10d
jne 0x25a2
xorl %ecx, %ecx
xorl %r10d, %r10d
movq %r9, %r14
leal (%rcx,%rax), %r9d
incl %r9d
movl %r9d, (%rdx)
xorl %r11d, %r11d
cmpb $0xa, (%rdi,%r14)
sete %bpl
incl %ecx
cmpq %r9, %r8
jbe 0x2509
movb %bpl, %r11b
addl %r11d, %r10d
cmpl $0x8, %r10d
jb 0x24dd
movslq %eax, %rdx
movl %ecx, %ecx
movq %rsp, %r14
movq %r14, %rdi
callq 0x21e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7662
jmp 0x25c5
cmpl $0x23, %r10d
je 0x258c
movl %eax, %ecx
cmpl $0x47, %r10d
jne 0x25a2
movl %eax, %ecx
cmpq %rcx, %r8
jbe 0x2548
incl %eax
movl %eax, (%rdx)
cmpb $0x20, (%rdi,%rcx)
jne 0x2537
movl %eax, %ecx
movl %ecx, %r9d
cmpq %r9, %r8
jbe 0x255d
incl %ecx
movl %ecx, (%rdx)
cmpb $0xa, (%rdi,%r9)
jne 0x254a
movslq %eax, %rdx
subl %edx, %ecx
movq %rsp, %r14
movq %r14, %rdi
callq 0x21e0
movq (%r14), %rdi
callq 0x2270
movq %rbx, %rdi
movl %eax, %esi
callq 0x7158
jmp 0x25c5
leal 0x1(%rcx), %eax
movl %eax, (%rdx)
cmpb $0xa, (%rdi,%rcx)
je 0x2593
movl %eax, %ecx
cmpq %rcx, %r8
ja 0x2581
xorl %eax, %eax
jmp 0x25e2
incl %ecx
movl %ecx, (%rdx)
cmpb $0xa, (%rdi,%r9)
je 0x25aa
movl %ecx, %r9d
cmpq %r9, %r8
ja 0x2597
movslq %eax, %rdx
subl %eax, %ecx
movq %rsp, %r14
movq %r14, %rdi
callq 0x21e0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x7424
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x25e0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
jmp 0x25ef
jmp 0x25ef
movq %rax, %rbx
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x260d
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21d0
movq %rbx, %rdi
callq 0x22e0