// File: /workspace/github_cpp_makefile_star2_O3/ShootMe[P]Klondike-Solver/Solitaire.cpp
// Function: Solitaire::SolveFast(int, int, int)
SolveResult Solitaire::SolveFast(int maxClosedCount, int twoShift, int threeShift) {
	MakeAutoMoves();
	if (movesAvailableCount == 0) { return foundationCount == 52 ? SolvedMinimal : Impossible; }

	int openCount = 1;
	int maxFoundationCount = foundationCount;
	int bestSolutionMoveCount = 512;
	int totalOpenCount = 1;

	int powerOf2 = 1;
	while (maxClosedCount > (1 << (powerOf2 + 2))) {
		powerOf2++;
	}
	HashMap<int> closed(powerOf2);
	stack<shared_ptr<MoveNode>> open[512];
	Move movesToMake[512];
	Move bestSolution[512];
	bestSolution[0].Count = 255;
	int startMoves = MovesMadeNormalizedCount() + MinimumMovesLeft();
	int threeClosed = maxClosedCount >> threeShift;
	int twoClosed = maxClosedCount >> twoShift;
	shared_ptr<MoveNode> firstNode = movesMadeCount > 0 ? make_shared<MoveNode>(movesMade[movesMadeCount - 1]) : NULL;
	shared_ptr<MoveNode> node = firstNode;
	for (int i = movesMadeCount - 2; i >= 0; i--) {
		node->Parent = make_shared<MoveNode>(movesMade[i]);
		node = node->Parent;
	}
	open[startMoves].push(firstNode);
	while (closed.Size() < maxClosedCount) {
		//Check for lowest score length
		int index = startMoves;
		while (index < 512 && open[index].size() == 0) { index++; }

		//End solver if no more states
		if (index >= 512) { break; }

		//Get next state to evaluate
		openCount--;
		firstNode = open[index].top();
		open[index].pop();

		//Initialize game to the found state
		ResetGame(drawCount);
		int movesTotal = 0;
		node = firstNode;
		while (node != NULL) {
			movesToMake[movesTotal++] = node->Value;
			node = node->Parent;
		}
		while (movesTotal > 0) {
			MakeMove(movesToMake[--movesTotal]);
		}

		//Make any auto moves
		UpdateAvailableMoves();
		while (movesAvailableCount == 1) {
			Move move = movesAvailable[0];
			MakeMove(move);
			firstNode = make_shared<MoveNode>(move, firstNode);
			UpdateAvailableMoves();
		}
		movesTotal = MovesMadeNormalizedCount();

		//Check for best solution to foundations
		if (foundationCount > maxFoundationCount || (foundationCount == maxFoundationCount && bestSolutionMoveCount > movesTotal)) {
			bestSolutionMoveCount = movesTotal;
			maxFoundationCount = foundationCount;

			//Save solution
			for (int i = 0; i < movesMadeCount; i++) {
				bestSolution[i] = movesMade[i];
			}
			bestSolution[movesMadeCount].Count = 255;
		} else if (maxFoundationCount == 52) {
			//Dont check state if above or equal to current best solution
			int helper = MinimumMovesLeft();
			helper += movesTotal;
			if (helper >= bestSolutionMoveCount) { continue; }
		}

		//Make available moves and add them to be evaulated
		Move bestMove1, bestMove2, bestMove3;
		int bestMoveAdded1 = 512, bestMoveHelper1 = 512, bestMoveAdded2 = 512, bestMoveHelper2 = 512, bestMoveAdded3 = 512, bestMoveHelper3 = 512;
		for (int i = 0; i < movesAvailableCount; i++) {
			Move move = movesAvailable[i];
			int movesAdded = MovesAdded(move);

			MakeMove(move);

			movesAdded += movesTotal;
			movesAdded += MinimumMovesLeft();
			if (maxFoundationCount < 52 || movesAdded < bestSolutionMoveCount) {
				int helper = movesAdded;
				helper += 52 - foundationCount + roundCount;

				if (helper < bestMoveHelper1) {
					if (bestMoveHelper1 <= bestMoveHelper2) {
						if (bestMoveHelper2 <= bestMoveHelper3) {
							bestMove3 = bestMove2;
							bestMoveAdded3 = bestMoveAdded2;
							bestMoveHelper3 = bestMoveHelper2;
						}
						bestMove2 = bestMove1;
						bestMoveAdded2 = bestMoveAdded1;
						bestMoveHelper2 = bestMoveHelper1;
					} else if (bestMoveHelper1 <= bestMoveHelper3) {
						bestMove3 = bestMove1;
						bestMoveAdded3 = bestMoveAdded1;
						bestMoveHelper3 = bestMoveHelper1;
					}
					bestMove1 = move;
					bestMoveAdded1 = movesAdded;
					bestMoveHelper1 = helper;
				} else if (helper < bestMoveHelper2) {
					if (bestMoveHelper2 <= bestMoveHelper3) {
						bestMove3 = bestMove2;
						bestMoveAdded3 = bestMoveAdded2;
						bestMoveHelper3 = bestMoveHelper2;
					}
					bestMove2 = move;
					bestMoveAdded2 = movesAdded;
					bestMoveHelper2 = helper;
				} else if (helper < bestMoveHelper3) {
					bestMove3 = move;
					bestMoveAdded3 = movesAdded;
					bestMoveHelper3 = helper;
				}
			}

			UndoMove();
		}

		if (bestMoveHelper1 < 512) {
			MakeMove(bestMove1);

			HashKey key = GameState();
			KeyValue<int> * result = closed.Add(key, bestMoveAdded1);
			if (result == NULL || result->Value > bestMoveAdded1) {
				node = make_shared<MoveNode>(bestMove1, firstNode);
				if (result != NULL) { result->Value = bestMoveAdded1; }

				totalOpenCount++;
				openCount++;
				open[bestMoveHelper1].push(node);
			}

			UndoMove();
		}
		if (closed.Size() < twoClosed && bestMoveHelper2 < 512) {
			MakeMove(bestMove2);

			HashKey key = GameState();
			KeyValue<int> * result = closed.Add(key, bestMoveAdded2);
			if (result == NULL || result->Value > bestMoveAdded2) {
				node = make_shared<MoveNode>(bestMove2, firstNode);
				if (result != NULL) { result->Value = bestMoveAdded2; }

				totalOpenCount++;
				openCount++;
				open[bestMoveHelper2].push(node);
			}

			UndoMove();
		}
		if (closed.Size() < threeClosed && bestMoveHelper3 < 512) {
			MakeMove(bestMove3);

			HashKey key = GameState();
			KeyValue<int> * result = closed.Add(key, bestMoveAdded3);
			if (result == NULL || result->Value > bestMoveAdded3) {
				node = make_shared<MoveNode>(bestMove3, firstNode);
				if (result != NULL) { result->Value = bestMoveAdded3; }

				totalOpenCount++;
				openCount++;
				open[bestMoveHelper3].push(node);
			}

			UndoMove();
		}
	}

	//Reset game to best solution found
	ResetGame(drawCount);
	for (int i = 0; bestSolution[i].Count < 255; i++) {
		MakeMove(bestSolution[i]);
	}
	return maxFoundationCount == 52 ? SolvedMayNotBeMinimal : CouldNotComplete;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb0f8, %rsp           # imm = 0xB0F8
movl %ecx, %r12d
movl %edx, %r15d
movl %esi, %ebp
movq %rdi, %rbx
callq 0x54ec
cmpl $0x0, 0x1910(%rbx)
movl 0x190c(%rbx), %r13d
je 0x5c2a
xorl %ecx, %ecx
incl %ecx
movl $0x4, %eax
shll %cl, %eax
cmpl %ebp, %eax
jl 0x5adf
leaq 0xb8(%rsp), %rdi
movl %ecx, %esi
callq 0x916a
xorl %r14d, %r14d
leaq (%rsp,%r14), %rdi
addq $0x10f0, %rdi           # imm = 0x10F0
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rdi)
movaps %xmm0, 0x30(%rdi)
movaps %xmm0, 0x20(%rdi)
movaps %xmm0, 0x10(%rdi)
movaps %xmm0, (%rdi)
xorl %esi, %esi
callq 0x944c
addq $0x50, %r14
cmpq $0xa000, %r14           # imm = 0xA000
jne 0x5afe
xorl %r14d, %r14d
leaq (%rsp,%r14), %rdi
addq $0x8f0, %rdi            # imm = 0x8F0
callq 0x3704
addq $0x4, %r14
cmpq $0x800, %r14            # imm = 0x800
jne 0x5b36
xorl %r14d, %r14d
leaq (%rsp,%r14), %rdi
addq $0xf0, %rdi
callq 0x3704
addq $0x4, %r14
cmpq $0x800, %r14            # imm = 0x800
jne 0x5b56
movb $-0x1, 0xf2(%rsp)
movq %rbx, %rdi
callq 0x4a7e
movl %eax, %r14d
movq %rbx, %rdi
callq 0x4b36
movl %eax, 0x58(%rsp)
movl %r14d, 0x8(%rsp)
movl %ebp, %eax
movl %r12d, %ecx
sarl %cl, %eax
movl %eax, 0xa8(%rsp)
movl %ebp, %eax
movl %r15d, %ecx
sarl %cl, %eax
movl %eax, 0xac(%rsp)
movl 0x1914(%rbx), %eax
testl %eax, %eax
movl %r13d, 0x7c(%rsp)
movl %ebp, 0x2c(%rsp)
jle 0x5c38
decl %eax
leaq (%rbx,%rax,4), %rcx
leaq 0x68(%rsp), %r14
movq $0x0, -0x8(%r14)
leaq 0x60(%rsp), %rsi
leaq 0x80(%rsp), %rdx
movq %r14, %rdi
callq 0x9a6a
movq 0x60(%rsp), %rcx
movq 0x68(%rsp), %rax
leaq 0x48(%rsp), %rdx
movq %rcx, -0x8(%rdx)
movq %rax, (%rdx)
testq %rax, %rax
movq %r14, 0xb0(%rsp)
movq %rdx, 0xa0(%rsp)
je 0x5c63
movq 0x83b0(%rip), %rcx      # 0xdfd0
cmpb $0x0, (%rcx)
je 0x5c5f
incl 0x8(%rax)
jmp 0x5c63
xorl %ebx, %ebx
cmpl $0x34, %r13d
sete %bl
jmp 0x658d
xorps %xmm0, %xmm0
leaq 0x68(%rsp), %rax
movq %rax, 0xb0(%rsp)
movaps %xmm0, -0x8(%rax)
leaq 0x48(%rsp), %rax
movq %rax, 0xa0(%rsp)
movaps %xmm0, -0x8(%rax)
jmp 0x5c63
lock
incl 0x8(%rax)
movl 0x1914(%rbx), %ebp
cmpl $0x2, %ebp
jl 0x5d10
addl $-0x2, %ebp
leaq 0x88(%rsp), %r15
leaq (%rbx,%rbp,4), %r13
incq %rbp
leaq 0x80(%rsp), %r14
leaq 0x30(%rsp), %r12
movq $0x0, 0x80(%rsp)
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
movq %r13, %rcx
callq 0x9a6a
movq 0x40(%rsp), %rax
movaps 0x80(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x80(%rsp)
movq 0x8(%rax), %rdi
movups %xmm0, (%rax)
testq %rdi, %rdi
je 0x5cd7
callq 0x3748
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x5ce9
callq 0x3748
movq 0x40(%rsp), %rsi
movq (%rsi), %rax
movq %rax, 0x40(%rsp)
addq $0x8, %rsi
movq 0xa0(%rsp), %rdi
callq 0x37b8
addq $-0x4, %r13
decq %rbp
jg 0x5c91
movl 0x58(%rsp), %r13d
addl 0x8(%rsp), %r13d
movslq %r13d, %r15
leaq (%r15,%r15,4), %r14
shlq $0x4, %r14
leaq (%rsp,%r14), %rdi
addq $0x10f0, %rdi           # imm = 0x10F0
leaq 0x60(%rsp), %rsi
callq 0x971a
movl 0x2c(%rsp), %ebp
cmpl %ebp, 0xc0(%rsp)
movl 0x7c(%rsp), %r12d
jge 0x64ef
movq %r15, %rax
shlq $0x20, %rax
movq %rax, 0xe0(%rsp)
leaq 0x10f0(%rsp), %rax
addq %r14, %rax
addq $0x48, %rax
movq %rax, 0xd8(%rsp)
incq %r15
movq %r15, 0xe8(%rsp)
movl %r12d, %r15d
movl $0x200, 0x5c(%rsp)      # imm = 0x200
cmpl $0x1ff, %r13d           # imm = 0x1FF
jg 0x64ef
movq 0xe8(%rsp), %rcx
movq 0xd8(%rsp), %rdx
movq 0xe0(%rsp), %rax
movq (%rdx), %rsi
movq %rsi, %rdi
subq -0x20(%rdx), %rdi
shrq $0x3, %rdi
cmpq $0x1, %rsi
adcq $-0x1, %rdi
shlq $0x5, %rdi
movq -0x28(%rdx), %rsi
movq -0x18(%rdx), %r8
subq -0x10(%rdx), %r8
sarq $0x4, %r8
addq %rdi, %r8
subq -0x38(%rdx), %rsi
sarq $0x4, %rsi
addq %r8, %rsi
jne 0x5e12
movabsq $0x100000000, %rsi      # imm = 0x100000000
addq %rsi, %rax
addq $0x50, %rdx
movq %rcx, %rsi
incq %rsi
cmpl $0x200, %ecx            # imm = 0x200
movq %rsi, %rcx
jne 0x5db1
jmp 0x64f6
movl %r12d, %ebp
sarq $0x20, %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %r14
addq $0x10f0, %r14           # imm = 0x10F0
movq 0x30(%r14), %rsi
cmpq 0x38(%r14), %rsi
jne 0x5e46
movq 0x48(%r14), %rax
movq -0x8(%rax), %rsi
movl $0x200, %eax            # imm = 0x200
addq %rax, %rsi
movq -0x10(%rsi), %rax
movq %rax, 0x60(%rsp)
addq $-0x8, %rsi
movq 0xb0(%rsp), %r12
movq %r12, %rdi
callq 0x37b8
movq %r14, %rdi
callq 0x95c4
movl 0x1904(%rbx), %esi
movq %rbx, %rdi
callq 0x5958
movq 0x60(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0xa0(%rsp), %rdi
movq %r12, %rsi
callq 0x37b8
movq 0x40(%rsp), %rsi
xorl %r14d, %r14d
testq %rsi, %rsi
je 0x5ed7
movq 0xa0(%rsp), %r12
movl 0x10(%rsi), %eax
movl %eax, 0x8f0(%rsp,%r14,4)
incq %r14
movq (%rsi), %rax
movq %rax, 0x40(%rsp)
addq $0x8, %rsi
movq %r12, %rdi
callq 0x37b8
movq 0x40(%rsp), %rsi
testq %rsi, %rsi
jne 0x5ea8
movl %r14d, %r14d
leaq 0x80(%rsp), %r12
testl %r14d, %r14d
jle 0x5ef9
movl 0x8ec(%rsp,%r14,4), %esi
decq %r14
movq %rbx, %rdi
callq 0x4232
jmp 0x5edf
movq %rbx, %rdi
callq 0x43e4
cmpl $0x1, 0x1910(%rbx)
leaq 0x88(%rsp), %r14
jne 0x5f9c
movl 0x1874(%rbx), %esi
movl %esi, 0x30(%rsp)
movq %rbx, %rdi
callq 0x4232
movq $0x0, 0x80(%rsp)
movq %r14, %rdi
movq %r12, %rsi
leaq 0x28(%rsp), %rdx
leaq 0x30(%rsp), %rcx
leaq 0x60(%rsp), %r8
callq 0x9638
movaps 0x80(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x80(%rsp)
movq 0x68(%rsp), %rdi
movaps %xmm0, 0x60(%rsp)
testq %rdi, %rdi
je 0x5f87
callq 0x3748
movq 0x88(%rsp), %rdi
testq %rdi, %rdi
je 0x5f87
callq 0x3748
movq %rbx, %rdi
callq 0x43e4
cmpl $0x1, 0x1910(%rbx)
je 0x5f16
movq %rbx, %rdi
callq 0x4a7e
movl %eax, %r14d
movl 0x190c(%rbx), %eax
movl %eax, 0x8(%rsp)
cmpl %r15d, %eax
jg 0x5fcc
sete %al
cmpl %r14d, 0x5c(%rsp)
setg %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x639f
movslq 0x1914(%rbx), %r15
testq %r15, %r15
movl %ebp, %r12d
jle 0x5ff3
leaq (,%r15,4), %rdx
leaq 0xf0(%rsp), %rdi
movq %rbx, %rsi
callq 0x2180
movb $-0x1, 0xf2(%rsp,%r15,4)
movl %r14d, 0x5c(%rsp)
movl 0x2c(%rsp), %ebp
leaq 0x28(%rsp), %rdi
callq 0x3704
leaq 0x24(%rsp), %rdi
callq 0x3704
leaq 0x20(%rsp), %rdi
callq 0x3704
movl $0x200, %eax            # imm = 0x200
movl %eax, 0x1c(%rsp)
movl %eax, 0x14(%rsp)
movl %eax, 0x10(%rsp)
cmpl $0x0, 0x1910(%rbx)
jle 0x64d1
movl %r13d, 0x58(%rsp)
movl $0x200, 0xc(%rsp)       # imm = 0x200
xorl %ebp, %ebp
movl $0x200, 0x18(%rsp)      # imm = 0x200
movl $0x200, %r12d           # imm = 0x200
movl 0x1874(%rbx,%rbp,4), %r13d
movl %r13d, 0x80(%rsp)
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
callq 0x4cbe
movl %eax, %r15d
movq %rbx, %rdi
movl %r13d, %esi
callq 0x4232
movq %rbx, %rdi
callq 0x4b36
cmpl $0x34, 0x8(%rsp)
setl %cl
addl %r14d, %r15d
addl %eax, %r15d
cmpl 0x5c(%rsp), %r15d
setl %al
orb %cl, %al
cmpb $0x1, %al
jne 0x6189
movl 0x1908(%rbx), %eax
movl %r15d, %ecx
subl 0x190c(%rbx), %ecx
addl %ecx, %eax
addl $0x34, %eax
cmpl %r12d, %eax
jge 0x60eb
movl 0x18(%rsp), %esi
cmpl %esi, %r12d
jle 0x611d
movl 0xc(%rsp), %ecx
cmpl %ecx, %r12d
jle 0x6167
movl %ecx, %r12d
jmp 0x6177
movl 0x18(%rsp), %edx
cmpl %edx, %eax
jge 0x6151
cmpl 0xc(%rsp), %edx
jg 0x610d
movl 0x24(%rsp), %ecx
movl %ecx, 0x20(%rsp)
movl 0x14(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movl %edx, 0xc(%rsp)
movl %r13d, 0x24(%rsp)
movl %r15d, 0x14(%rsp)
movl %eax, 0x18(%rsp)
jmp 0x6189
movl 0xc(%rsp), %edx
cmpl %edx, %esi
jg 0x6137
movl 0x24(%rsp), %ecx
movl %ecx, 0x20(%rsp)
movl 0x14(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movl %esi, %edx
movl 0x28(%rsp), %ecx
movl %ecx, 0x24(%rsp)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl %r12d, 0x18(%rsp)
movl %edx, %r12d
jmp 0x6177
cmpl 0xc(%rsp), %eax
jge 0x6189
movl %r13d, 0x20(%rsp)
movl %r15d, 0x10(%rsp)
movl %eax, 0xc(%rsp)
jmp 0x6189
movl 0x28(%rsp), %ecx
movl %ecx, 0x20(%rsp)
movl 0x1c(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movl %r12d, 0xc(%rsp)
movl %r13d, 0x28(%rsp)
movl %r15d, 0x1c(%rsp)
movl %eax, %r12d
movq %rbx, %rdi
callq 0x4f6e
incq %rbp
movslq 0x1910(%rbx), %rax
cmpq %rax, %rbp
jl 0x605e
cmpl $0x200, %r12d           # imm = 0x200
movl 0x2c(%rsp), %ebp
jge 0x628b
movl 0x28(%rsp), %esi
movq %rbx, %rdi
callq 0x4232
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d4a
leaq 0xb8(%rsp), %rdi
movq %r14, %rsi
leaq 0x1c(%rsp), %rdx
callq 0x9050
movq %rax, %r14
testq %rax, %rax
je 0x61ff
movl 0x20(%r14), %eax
cmpl 0x1c(%rsp), %eax
jle 0x6283
movq $0x0, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x28(%rsp), %rcx
leaq 0x60(%rsp), %r8
callq 0x9638
movaps 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x48(%rsp), %rdi
movaps %xmm0, 0x40(%rsp)
testq %rdi, %rdi
je 0x6256
callq 0x3748
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x6256
callq 0x3748
testq %r14, %r14
je 0x6263
movl 0x1c(%rsp), %eax
movl %eax, 0x20(%r14)
movslq %r12d, %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %rdi
addq $0x10f0, %rdi           # imm = 0x10F0
leaq 0x40(%rsp), %rsi
callq 0x971a
movq %rbx, %rdi
callq 0x4f6e
movl 0xc0(%rsp), %eax
cmpl 0xac(%rsp), %eax
movl 0x18(%rsp), %ecx
jge 0x63d2
cmpl $0x1ff, %ecx            # imm = 0x1FF
movl 0x7c(%rsp), %r12d
movl 0x58(%rsp), %r13d
movl 0xc(%rsp), %r15d
jg 0x63e1
movl 0x24(%rsp), %esi
movq %rbx, %rdi
callq 0x4232
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d4a
leaq 0xb8(%rsp), %rdi
movq %r14, %rsi
leaq 0x14(%rsp), %rdx
callq 0x9050
movq %rax, %r14
testq %rax, %rax
je 0x6308
movl 0x20(%r14), %eax
cmpl 0x14(%rsp), %eax
jle 0x638e
movq $0x0, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x24(%rsp), %rcx
leaq 0x60(%rsp), %r8
callq 0x9638
movaps 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x48(%rsp), %rdi
movaps %xmm0, 0x40(%rsp)
testq %rdi, %rdi
je 0x635f
callq 0x3748
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x635f
callq 0x3748
testq %r14, %r14
je 0x636c
movl 0x14(%rsp), %eax
movl %eax, 0x20(%r14)
movslq 0x18(%rsp), %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %rdi
addq $0x10f0, %rdi           # imm = 0x10F0
leaq 0x40(%rsp), %rsi
callq 0x971a
movq %rbx, %rdi
callq 0x4f6e
movl 0xc0(%rsp), %eax
jmp 0x63e1
cmpl $0x34, %r15d
movl %ebp, %r12d
jne 0x64e5
movq %rbx, %rdi
callq 0x4b36
movl 0x2c(%rsp), %ebp
addl %r14d, %eax
movl $0x34, 0x8(%rsp)
cmpl 0x5c(%rsp), %eax
jl 0x6005
jmp 0x64d1
movl 0x7c(%rsp), %r12d
movl 0x58(%rsp), %r13d
movl 0xc(%rsp), %r15d
cmpl 0xa8(%rsp), %eax
jge 0x64d1
cmpl $0x1ff, %r15d           # imm = 0x1FF
jg 0x64d1
movl 0x20(%rsp), %esi
movq %rbx, %rdi
callq 0x4232
leaq 0x80(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d4a
leaq 0xb8(%rsp), %rdi
movq %r14, %rsi
leaq 0x10(%rsp), %rdx
callq 0x9050
movq %rax, %r14
testq %rax, %rax
je 0x6445
movl 0x20(%r14), %eax
cmpl 0x10(%rsp), %eax
jle 0x64c9
movq $0x0, 0x30(%rsp)
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x7(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x60(%rsp), %r8
callq 0x9638
movaps 0x30(%rsp), %xmm0
xorps %xmm1, %xmm1
movaps %xmm1, 0x30(%rsp)
movq 0x48(%rsp), %rdi
movaps %xmm0, 0x40(%rsp)
testq %rdi, %rdi
je 0x649c
callq 0x3748
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x649c
callq 0x3748
testq %r14, %r14
je 0x64a9
movl 0x10(%rsp), %eax
movl %eax, 0x20(%r14)
movslq %r15d, %rax
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq (%rsp,%rax), %rdi
addq $0x10f0, %rdi           # imm = 0x10F0
leaq 0x40(%rsp), %rsi
callq 0x971a
movq %rbx, %rdi
callq 0x4f6e
movl 0x8(%rsp), %r15d
cmpl %ebp, 0xc0(%rsp)
jl 0x5d8c
jmp 0x64fb
movl %r15d, 0x8(%rsp)
jmp 0x6001
movl %r12d, 0x8(%rsp)
jmp 0x64fb
movl %r15d, 0x8(%rsp)
movl 0x1904(%rbx), %esi
movq %rbx, %rdi
callq 0x5958
cmpb $-0x1, 0xf2(%rsp)
je 0x6531
leaq 0xf0(%rsp), %r14
movl (%r14), %esi
movq %rbx, %rdi
callq 0x4232
cmpb $-0x1, 0x6(%r14)
leaq 0x4(%r14), %r14
jne 0x651b
xorl %ebx, %ebx
cmpl $0x34, 0x8(%rsp)
sete %bpl
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x654b
callq 0x3748
movb %bpl, %bl
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x655d
callq 0x3748
orl $-0x2, %ebx
movl $0x9fb0, %r14d          # imm = 0x9FB0
leaq (%rsp,%r14), %rdi
addq $0x10f0, %rdi           # imm = 0x10F0
callq 0x92e2
addq $-0x50, %r14
cmpq $-0x50, %r14
jne 0x6566
leaq 0xb8(%rsp), %rdi
callq 0x927a
movl %ebx, %eax
addq $0xb0f8, %rsp           # imm = 0xB0F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65d3
jmp 0x65d3
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65f9
jmp 0x65d3
movq %rax, %rbx
jmp 0x661a
movq %rax, %rbx
testq %r14, %r14
je 0x663a
leaq 0x10a0(%rsp), %r15
leaq (%r15,%r14), %rdi
callq 0x92e2
addq $-0x50, %r14
jne 0x65e8
jmp 0x663a
movq %rax, %rbx
movq 0x48(%rsp), %rdi
testq %rdi, %rdi
je 0x660b
callq 0x3748
movq 0x68(%rsp), %rdi
testq %rdi, %rdi
je 0x661a
callq 0x3748
movl $0x9fb0, %r14d          # imm = 0x9FB0
leaq (%rsp,%r14), %rdi
addq $0x10f0, %rdi           # imm = 0x10F0
callq 0x92e2
addq $-0x50, %r14
cmpq $-0x50, %r14
jne 0x6620
leaq 0xb8(%rsp), %rdi
callq 0x927a
movq %rbx, %rdi
callq 0x22e0
nop