// File: /workspace/github_cpp_makefile_star2_O3/Doug0855[P]TigerZone/Board.cpp
// Function: Board::buildJungle(Structure*, Tile*, std::vector<std::vector<Block, std::allocator<Block>>, std::allocator<std::vector<Block, std::allocator<Block>>>>&, std::pair<int, int>, std::vector<Tile*, std::allocator<Tile*>>&)
void Board::buildJungle(Structure* struc, Tile *tile, std::vector< std::vector<Block> >& tileBlocks, std::pair<int,int> blockSpot, std::vector<Tile*> &visitedTiles) {
	int row = blockSpot.first;
	int col = blockSpot.second;
	//debugging std::cout<<"in build jungle at "<<row<<' '<<col<<std::endl;
	tileBlocks[row][col].visit();

	struc->structureBlocks.push_back(tileBlocks[row][col]);

	if(tileBlocks[row][col].hasMeeple())
		struc->hasMeeple = true;

	bool addedTileAnimals = false;
	for(int i = 0; i < visitedTiles.size(); i++) {
			if(visitedTiles[i] == tile)
			{
				addedTileAnimals = true;
				//debugging std::cout<<"Added animals already for this tile"<<std::endl;
			}
	}
	if(!addedTileAnimals) {
		struc->checkAnimals(tile);
	}

	if(tileBlocks[row][col].getType() == "mixed") {
		int trailFaces = 0;
		// Determine how many faces are trail faces. If there's only 1 than we know the mixed blocks don't connect within the tile
		// Otherwise we know that the mixed blocks connect to form only 1 jungle rather than 2
		if(tile->getUpFace()->getType() == "trail")
			trailFaces++;
		if(tile->getDownFace()->getType() == "trail")
			trailFaces++;
		if(tile->getRightFace()->getType() == "trail")
			trailFaces++;
		if(tile->getLeftFace()->getType() == "trail")
			trailFaces++;

		if(trailFaces > 0) {
			if(trailFaces != 1) {
				for(int i = 0; i < 3; i++) {
					for(int j = 0; j < 3; j++) {
						if(tileBlocks[i][j].getType() == "mixed" && !(tileBlocks[i][j].isVisited()))
							buildJungle(struc, tile, tileBlocks, std::pair<int,int>(i,j), visitedTiles);
					}
				}
			}
		}

	}

	// Check tiles above, below, left, and right of the current block to see if lake structure continues
	// std::cout<<"about to cehck row+1"<<std::endl;
	if((row + 1) <= 2 && !(tileBlocks[row + 1][col].isVisited()) &&
		(tileBlocks[row+1][col].getType() == "jungle" || tileBlocks[row+1][col].getType() == "mixed")) {
		buildJungle(struc, tile, tileBlocks, std::pair<int,int>(row+1,col), visitedTiles);
	}
	else if(row + 1 > 2 && tile->getDownTile() != NULL) {
		bool visitedNeighborTile = false;
		for(int i = 0; i < visitedTiles.size(); i++) {
			if(visitedTiles[i] == tile->getDownTile())
				visitedNeighborTile = true;
		}
		if(!visitedNeighborTile && tile->getDownTile()->getUpFaceType()!= "lake") {
			visitedTiles.push_back(tile->getDownTile());
			std::vector< std::vector<Block> > newBlocks = tile->getDownTile()->getInnerBlocks();
			buildJungle(struc, tile->getDownTile(), newBlocks, std::pair<int,int>(row-2,col), visitedTiles);
		}
	}
	// std::cout<<"about to check row-1"<<std::endl;
	if((row - 1) >= 0 && !(tileBlocks[row - 1][col].isVisited()) &&
		(tileBlocks[row - 1][col].getType() == "jungle" || tileBlocks[row-1][col].getType() == "mixed")) {
		buildJungle(struc, tile, tileBlocks, std::pair<int,int>(row-1,col), visitedTiles);
	}
	else if(row-1 < 0 && tile->getUpTile() != NULL) {
		bool visitedNeighborTile = false;
		for(int i = 0; i < visitedTiles.size(); i++) {
			if(visitedTiles[i] == tile->getUpTile())
				visitedNeighborTile = true;
		}
		if (!visitedNeighborTile && tile->getUpTile()->getDownFaceType() != "lake") {
			visitedTiles.push_back(tile->getUpTile());
			std::vector< std::vector<Block> > newBlocks = tile->getUpTile()->getInnerBlocks();
			buildJungle(struc, tile->getUpTile(), newBlocks, std::pair<int,int>(row+2,col), visitedTiles);
		}
	}
	// std::cout<<"about to check col+1"<<std::endl;
	if((col + 1) <= 2 && !(tileBlocks[row][col + 1].isVisited()) &&
		(tileBlocks[row][col + 1].getType() == "jungle" || tileBlocks[row][col+1].getType() == "mixed")) {
		buildJungle(struc, tile, tileBlocks, std::pair<int,int>(row,col+1), visitedTiles);
	}
	else if(col+1 > 2 && tile->getRightTile() != NULL) {
		bool visitedNeighborTile = false;
		for(int i = 0; i < visitedTiles.size(); i++) {
			if(visitedTiles[i] == tile->getRightTile())
				visitedNeighborTile = true;
		}
		if (!visitedNeighborTile && tile->getRightTile()->getLeftFaceType() != "lake") {
			visitedTiles.push_back(tile->getRightTile());
			std::vector< std::vector<Block> > newBlocks = tile->getRightTile()->getInnerBlocks();
			buildJungle(struc, tile->getRightTile(), newBlocks, std::pair<int,int>(row,col-2), visitedTiles);
		}
	}
	// std::cout<<"about to check col-1"<<std::endl;
	if((col - 1) >= 0 && !(tileBlocks[row][col-1].isVisited()) &&
		(tileBlocks[row][col - 1].getType() == "jungle" ||	 tileBlocks[row][col-1].getType() == "mixed")) {
		// std::cout<<"passing col-1"<<std::endl;
		buildJungle(struc, tile, tileBlocks, std::pair<int,int>(row,col-1), visitedTiles);
	}
	else if(col-1 < 0 && tile->getLeftTile() != NULL) {
		bool visitedNeighborTile = false;
		for(int i = 0; i < visitedTiles.size(); i++) {
			if(visitedTiles[i] == tile->getLeftTile())
				visitedNeighborTile = true;
		}
		if (!visitedNeighborTile && tile->getLeftTile()->getRightFaceType() != "lake") {
			visitedTiles.push_back(tile->getLeftTile());
			std::vector< std::vector<Block> > newBlocks = tile->getLeftTile()->getInnerBlocks();
			buildJungle(struc, tile->getLeftTile(), newBlocks, std::pair<int,int>(row,col+2), visitedTiles);
		}
	}
	return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r9, -0x70(%rbp)
movq %rcx, %r12
movq %rdx, %r13
movq %rsi, %rdx
movq %rdi, -0x68(%rbp)
movslq %r8d, %rcx
movq (%r12), %rax
movq %rcx, -0x90(%rbp)
leaq (,%rcx,8), %rcx
leaq (%rcx,%rcx,2), %r14
movq %r8, -0x88(%rbp)
movq %r8, %rbx
sarq $0x20, %rbx
movq (%rax,%r14), %rsi
leaq (,%rbx,8), %rax
leaq (%rax,%rax,4), %r15
movb $0x1, 0x1(%rsi,%r15)
addq %r15, %rsi
movq %rdx, -0x60(%rbp)
leaq 0x28(%rdx), %rdi
callq 0x13d7a
movq %r12, -0x58(%rbp)
movq (%r12), %rax
movq (%rax,%r14), %rax
cmpb $0x1, (%rax,%r15)
jne 0x11e1a
movq -0x60(%rbp), %rcx
movb $0x1, 0x50(%rcx)
movq -0x70(%rbp), %rdx
movq (%rdx), %rcx
movq 0x8(%rdx), %rdx
subq %rcx, %rdx
movq -0x58(%rbp), %r14
je 0x11e57
sarq $0x3, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %esi, %esi
xorl %edi, %edi
cmpq %r13, (%rcx,%rsi,8)
sete %r8b
orb %r8b, %dil
incq %rsi
cmpq %rsi, %rdx
jne 0x11e3e
testb $0x1, %dil
jne 0x11e75
movq -0x60(%rbp), %rdi
movq %r13, %rsi
callq 0x177cc
movq (%r14), %rax
movq -0x90(%rbp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq (%rax,%rcx,8), %rax
movq %r13, -0x50(%rbp)
leaq (%rbx,%rbx,4), %rcx
leaq -0x38(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq 0x8(%rax,%rcx,8), %rsi
movq %rcx, -0x80(%rbp)
movq 0x10(%rax,%rcx,8), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %r14
movq %r14, %rdi
callq 0x9cc4
leaq 0x69eb(%rip), %rsi      # 0x18894
movq %r14, %rdi
callq 0x30b0
movq %rbx, %r9
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r9, %rdi
je 0x11ec7
callq 0x3200
leaq -0x38(%rbp), %r9
testl %ebx, %ebx
movq -0x58(%rbp), %r13
jne 0x120eb
movq %r9, (%r14)
movq -0x50(%rbp), %r12
movq 0x10(%r12), %rsi
movq 0x18(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x9cc4
leaq 0x68c1(%rip), %rsi      # 0x187b7
movq %r14, %rdi
callq 0x30b0
leaq -0x38(%rbp), %rcx
movl %eax, %r13d
movq (%r14), %rdi
cmpq %rcx, %rdi
je 0x11f16
callq 0x3200
leaq -0x38(%rbp), %rcx
xorl %ebx, %ebx
testl %r13d, %r13d
sete %bl
leaq -0x48(%rbp), %r15
movq %rcx, (%r15)
movq 0x38(%r12), %rsi
movq 0x40(%r12), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x9cc4
leaq 0x6876(%rip), %rsi      # 0x187b7
movq %r15, %rdi
callq 0x30b0
leaq -0x38(%rbp), %rcx
movl %eax, %r14d
movq (%r15), %rdi
cmpq %rcx, %rdi
je 0x11f61
callq 0x3200
leaq -0x38(%rbp), %rcx
xorl %eax, %eax
cmpl $0x1, %r13d
adcl $0x1, %eax
testl %r14d, %r14d
cmovel %eax, %ebx
leaq -0x48(%rbp), %r14
movq %rcx, (%r14)
movq 0x88(%r12), %rsi
movq 0x90(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x9cc4
leaq 0x681e(%rip), %rsi      # 0x187b7
movq %r14, %rdi
callq 0x30b0
leaq -0x38(%rbp), %rcx
movl %eax, %r15d
movq (%r14), %rdi
cmpq %rcx, %rdi
je 0x11fb9
callq 0x3200
leaq -0x38(%rbp), %rcx
cmpl $0x1, %r15d
adcl $0x0, %ebx
movq %rcx, (%r14)
movq 0x60(%r12), %rsi
movq 0x68(%r12), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x9cc4
leaq 0x67d8(%rip), %rsi      # 0x187b7
movq %r14, %rdi
callq 0x30b0
leaq -0x38(%rbp), %r9
movl %eax, %r15d
movq (%r14), %rdi
cmpq %r9, %rdi
je 0x11fff
callq 0x3200
leaq -0x38(%rbp), %r9
cmpl $0x1, %r15d
adcl $0x0, %ebx
cmpl $0x2, %ebx
movq -0x58(%rbp), %r13
jb 0x120eb
xorl %ebx, %ebx
leaq (%rbx,%rbx,2), %r14
xorl %r12d, %r12d
movq %rbx, -0x78(%rbp)
movq (%r13), %rax
movq (%rax,%r14,8), %rax
movq %r9, -0x48(%rbp)
movq 0x8(%rax,%r12), %rsi
movq 0x10(%rax,%r12), %rdx
addq %rsi, %rdx
leaq -0x48(%rbp), %r13
movq %r13, %rdi
movq %r9, %r15
callq 0x9cc4
movq %r13, %rdi
leaq 0x6842(%rip), %rsi      # 0x18894
callq 0x30b0
testl %eax, %eax
je 0x12072
movq -0x58(%rbp), %r13
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
movq %r15, %r9
je 0x120bf
callq 0x3200
jmp 0x120bb
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq (%rax,%r14,8), %rax
movb 0x1(%rax,%r12), %r13b
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
movq %r15, %r9
je 0x12097
callq 0x3200
leaq -0x38(%rbp), %r9
testb %r13b, %r13b
movq -0x58(%rbp), %r13
jne 0x120bf
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq %r13, %rcx
movq %rbx, %r8
movq -0x70(%rbp), %r9
callq 0x11d8c
leaq -0x38(%rbp), %r9
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
addq $0x28, %r12
cmpq $0x78, %r12
jne 0x12020
movq -0x78(%rbp), %rbx
incq %rbx
cmpq $0x3, %rbx
jne 0x12015
movq -0x88(%rbp), %r12
cmpl $0x1, %r12d
jg 0x121cb
movq %r12, %rax
shlq $0x20, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rcx, %rax
sarq $0x20, %rax
movq (%r13), %rcx
leaq (%rax,%rax,2), %r14
movq (%rcx,%r14,8), %rax
movq -0x80(%rbp), %rcx
cmpb $0x0, 0x1(%rax,%rcx,8)
movq -0x70(%rbp), %r13
jne 0x12350
leaq -0x48(%rbp), %rbx
movq %r9, (%rbx)
movq -0x80(%rbp), %r15
movq 0x8(%rax,%r15,8), %rsi
movq 0x10(%rax,%r15,8), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x9cc4
leaq 0x6651(%rip), %rsi      # 0x187ab
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
je 0x12288
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq (%rax,%r14,8), %rax
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rax,%r15,8), %rsi
movq 0x10(%rax,%r15,8), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x9cc4
leaq 0x66f4(%rip), %rsi      # 0x18894
leaq -0xb0(%rbp), %rbx
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
sete %r15b
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x1228b
callq 0x3200
jmp 0x1228b
movq -0x50(%rbp), %rax
movq 0xb8(%rax), %rax
testq %rax, %rax
movq -0x70(%rbp), %r13
je 0x12359
movq (%r13), %rcx
movq 0x8(%r13), %rdx
subq %rcx, %rdx
je 0x1221d
sarq $0x3, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rax, (%rcx,%rsi,8)
sete %r8b
orb %r8b, %dil
incq %rsi
cmpq %rsi, %rdx
jne 0x12200
testb $0x1, %dil
jne 0x12350
leaq -0x48(%rbp), %r14
movq %r9, (%r14)
movq 0x10(%rax), %rsi
movq 0x18(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x9cc4
leaq 0x6574(%rip), %rsi      # 0x187b2
movq %r14, %rdi
callq 0x30b0
leaq -0x38(%rbp), %r9
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r9, %rdi
je 0x1225d
callq 0x3200
leaq -0x38(%rbp), %r9
testl %ebx, %ebx
je 0x12350
movq -0x50(%rbp), %rax
movq 0xb8(%rax), %rax
movq %rax, -0x48(%rbp)
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x122dc
movq %rax, (%rsi)
addq $0x8, 0x8(%r13)
jmp 0x122e8
movb $0x1, %r15b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r9
cmpq %r9, %rdi
je 0x122a1
callq 0x3200
leaq -0x38(%rbp), %r9
testb %r15b, %r15b
je 0x12350
leal 0x1(%r12), %r8d
movq %r12, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
orq %rax, %r8
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq %r13, %r9
callq 0x11d8c
jmp 0x1234c
leaq -0x48(%rbp), %rdx
movq %r13, %rdi
callq 0x146bc
movl $0xd0, %esi
movq -0x50(%rbp), %r14
addq 0xb8(%r14), %rsi
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
callq 0x8cd0
movq 0xb8(%r14), %rdx
movabsq $0x100000000, %rax      # imm = 0x100000000
leal (%rax,%r12), %r8d
addl $-0x2, %r8d
movq %r12, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
orq %rax, %r8
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rbx, %rcx
movq %r13, %r9
callq 0x11d8c
leaq -0x48(%rbp), %rdi
callq 0x13dcc
leaq -0x38(%rbp), %r9
testl %r12d, %r12d
jle 0x1241b
movabsq $0x100000000, %rax      # imm = 0x100000000
addl %r12d, %eax
decl %eax
movq -0x58(%rbp), %rcx
movq (%rcx), %rcx
leaq (%rax,%rax,2), %r14
movq (%rcx,%r14,8), %rax
movq -0x80(%rbp), %r15
cmpb $0x0, 0x1(%rax,%r15,8)
jne 0x1259b
leaq -0x48(%rbp), %rbx
movq %r9, (%rbx)
movq 0x8(%rax,%r15,8), %rsi
movq 0x10(%rax,%r15,8), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x9cc4
leaq 0x6401(%rip), %rsi      # 0x187ab
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
je 0x124d4
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq (%rax,%r14,8), %rax
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
movq 0x8(%rax,%r15,8), %rsi
movq 0x10(%rax,%r15,8), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x9cc4
leaq 0x64a4(%rip), %rsi      # 0x18894
leaq -0xb0(%rbp), %rbx
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
sete %r15b
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0x124d7
callq 0x3200
jmp 0x124d7
movq -0x50(%rbp), %rax
movq 0xb0(%rax), %rax
testq %rax, %rax
je 0x1259b
movq (%r13), %rcx
movq 0x8(%r13), %rdx
subq %rcx, %rdx
je 0x12469
sarq $0x3, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rax, (%rcx,%rsi,8)
sete %r8b
orb %r8b, %dil
incq %rsi
cmpq %rsi, %rdx
jne 0x1244c
testb $0x1, %dil
jne 0x1259b
leaq -0x48(%rbp), %r14
movq %r9, (%r14)
movq 0x38(%rax), %rsi
movq 0x40(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x9cc4
leaq 0x6328(%rip), %rsi      # 0x187b2
movq %r14, %rdi
callq 0x30b0
leaq -0x38(%rbp), %r9
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r9, %rdi
je 0x124a9
callq 0x3200
leaq -0x38(%rbp), %r9
testl %ebx, %ebx
je 0x1259b
movq -0x50(%rbp), %rax
movq 0xb0(%rax), %rax
movq %rax, -0x48(%rbp)
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x12534
movq %rax, (%rsi)
addq $0x8, 0x8(%r13)
jmp 0x12540
movb $0x1, %r15b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r9
cmpq %r9, %rdi
je 0x124ed
callq 0x3200
leaq -0x38(%rbp), %r9
testb %r15b, %r15b
je 0x1259b
movabsq $0x100000000, %rax      # imm = 0x100000000
leal (%rax,%r12), %r8d
decl %r8d
movq %r12, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
orq %rax, %r8
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq %r13, %r9
callq 0x11d8c
jmp 0x12597
leaq -0x48(%rbp), %rdx
movq %r13, %rdi
callq 0x146bc
movl $0xd0, %esi
movq -0x50(%rbp), %r14
addq 0xb0(%r14), %rsi
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
callq 0x8cd0
movq 0xb0(%r14), %rdx
leal 0x2(%r12), %r8d
movq %r12, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
orq %rax, %r8
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rbx, %rcx
movq %r13, %r9
callq 0x11d8c
leaq -0x48(%rbp), %rdi
callq 0x13dcc
leaq -0x38(%rbp), %r9
movq %r12, %r15
shrq $0x20, %r15
movq -0x90(%rbp), %rax
leaq (%rax,%rax,2), %rbx
cmpl $0x1, %r15d
jg 0x1267e
movq -0x58(%rbp), %rax
movq (%rax), %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %r12, %rcx
sarq $0x20, %rcx
movq (%rax,%rbx,8), %rax
leaq (%rcx,%rcx,4), %r14
cmpb $0x0, 0x1(%rax,%r14,8)
jne 0x1281f
movq %rbx, %r13
leaq -0x48(%rbp), %rbx
movq %r9, (%rbx)
movq 0x8(%rax,%r14,8), %rsi
movq 0x10(%rax,%r14,8), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x9cc4
leaq 0x61a2(%rip), %rsi      # 0x187ab
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
je 0x1273f
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq (%rax,%r13,8), %rax
leaq -0xa0(%rbp), %r12
movq %r12, -0x10(%r12)
movq 0x8(%rax,%r14,8), %rsi
movq 0x10(%rax,%r14,8), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x9cc4
leaq 0x6244(%rip), %rsi      # 0x18894
leaq -0xb0(%rbp), %rbx
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
sete %r14b
movq (%rbx), %rdi
cmpq %r12, %rdi
je 0x12672
callq 0x3200
movq -0x88(%rbp), %r12
jmp 0x12742
movq -0x50(%rbp), %rax
movq 0xc8(%rax), %rax
testq %rax, %rax
je 0x12828
movq (%r13), %rcx
movq 0x8(%r13), %rdx
subq %rcx, %rdx
je 0x126cc
sarq $0x3, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rax, (%rcx,%rsi,8)
sete %r8b
orb %r8b, %dil
incq %rsi
cmpq %rsi, %rdx
jne 0x126af
testb $0x1, %dil
jne 0x1281f
movq %rbx, -0x78(%rbp)
leaq -0x48(%rbp), %r14
movq %r9, (%r14)
movq 0x60(%rax), %rsi
movq 0x68(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
callq 0x9cc4
leaq 0x60c1(%rip), %rsi      # 0x187b2
movq %r14, %rdi
callq 0x30b0
leaq -0x38(%rbp), %r9
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r9, %rdi
je 0x12710
callq 0x3200
leaq -0x38(%rbp), %r9
testl %ebx, %ebx
movq -0x78(%rbp), %rbx
je 0x1281f
movq -0x50(%rbp), %rax
movq 0xc8(%rax), %rax
movq %rax, -0x48(%rbp)
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x127a9
movq %rax, (%rsi)
addq $0x8, 0x8(%r13)
jmp 0x127b5
movb $0x1, %r14b
movq %r13, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %r9
cmpq %r9, %rdi
movq -0x70(%rbp), %r13
je 0x1275f
callq 0x3200
leaq -0x38(%rbp), %r9
testb %r14b, %r14b
je 0x1281f
movq %r12, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
addq %rcx, %rax
movl %r12d, %r8d
orq %rax, %r8
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq %r13, %r9
callq 0x11d8c
leaq -0x38(%rbp), %r9
jmp 0x1281f
leaq -0x48(%rbp), %rdx
movq %r13, %rdi
callq 0x146bc
movl $0xd0, %esi
movq -0x50(%rbp), %r14
addq 0xc8(%r14), %rsi
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
callq 0x8cd0
movq 0xc8(%r14), %rdx
movq %r12, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
movl %r12d, %ecx
addq %rax, %rcx
movabsq $-0x200000000, %r8      # imm = 0xFFFFFFFE00000000
addq %rcx, %r8
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rbx, %rcx
movq %r13, %r9
callq 0x11d8c
leaq -0x48(%rbp), %rdi
callq 0x13dcc
leaq -0x38(%rbp), %r9
movq -0x78(%rbp), %rbx
testl %r15d, %r15d
jle 0x128e9
movq -0x58(%rbp), %rax
movq (%rax), %rax
movabsq $0x100000000, %rcx      # imm = 0x100000000
addl %r15d, %ecx
decl %ecx
movq (%rax,%rbx,8), %rax
leaq (%rcx,%rcx,4), %r14
cmpb $0x0, 0x1(%rax,%r14,8)
jne 0x12a5f
movq %rbx, %r15
leaq -0x48(%rbp), %rbx
movq %r9, (%rbx)
movq 0x8(%rax,%r14,8), %rsi
movq 0x10(%rax,%r14,8), %rdx
addq %rsi, %rdx
movq %rbx, %rdi
callq 0x9cc4
leaq 0x5f33(%rip), %rsi      # 0x187ab
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
je 0x129a3
movq -0x58(%rbp), %rax
movq (%rax), %rax
movq (%rax,%r15,8), %rax
leaq -0xa0(%rbp), %r15
movq %r15, -0x10(%r15)
movq 0x8(%rax,%r14,8), %rsi
movq 0x10(%rax,%r14,8), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x9cc4
leaq 0x5fd6(%rip), %rsi      # 0x18894
leaq -0xb0(%rbp), %rbx
movq %rbx, %rdi
callq 0x30b0
testl %eax, %eax
sete %r14b
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x129a6
callq 0x3200
jmp 0x129a6
movq -0x50(%rbp), %rax
movq 0xc0(%rax), %rax
testq %rax, %rax
je 0x12a5f
movq (%r13), %rcx
movq 0x8(%r13), %rdx
subq %rcx, %rdx
je 0x12937
sarq $0x3, %rdx
cmpq $0x1, %rdx
adcq $0x0, %rdx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rax, (%rcx,%rsi,8)
sete %r8b
orb %r8b, %dil
incq %rsi
cmpq %rsi, %rdx
jne 0x1291a
testb $0x1, %dil
jne 0x12a5f
leaq -0x48(%rbp), %r14
movq %r9, (%r14)
movq 0x88(%rax), %rsi
movq 0x90(%rax), %rdx
addq %rsi, %rdx
movq %r14, %rdi
movq %r9, %r15
callq 0x9cc4
leaq 0x5e51(%rip), %rsi      # 0x187b2
movq %r14, %rdi
callq 0x30b0
movl %eax, %ebx
movq (%r14), %rdi
cmpq %r15, %rdi
je 0x12978
callq 0x3200
testl %ebx, %ebx
je 0x12a5f
movq -0x50(%rbp), %rax
movq 0xc0(%rax), %rax
movq %rax, -0x48(%rbp)
movq 0x8(%r13), %rsi
cmpq 0x10(%r13), %rsi
je 0x129f4
movq %rax, (%rsi)
addq $0x8, 0x8(%r13)
jmp 0x12a00
movb $0x1, %r14b
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x129b8
callq 0x3200
testb %r14b, %r14b
je 0x12a5f
movq %r12, %rax
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %rcx, %rax
addq %rcx, %rax
movl %r12d, %r8d
orq %rax, %r8
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x50(%rbp), %rdx
movq -0x58(%rbp), %rcx
movq %r13, %r9
callq 0x11d8c
jmp 0x12a5f
leaq -0x48(%rbp), %rdx
movq %r13, %rdi
callq 0x146bc
movl $0xd0, %esi
movq -0x50(%rbp), %r14
addq 0xc0(%r14), %rsi
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
callq 0x8cd0
movq 0xc0(%r14), %rdx
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
andq %r12, %rcx
movl %r12d, %eax
addq %rcx, %rax
movabsq $0x200000000, %r8       # imm = 0x200000000
addq %rax, %r8
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rbx, %rcx
movq %r13, %r9
callq 0x11d8c
leaq -0x48(%rbp), %rdi
callq 0x13dcc
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x12a77
jmp 0x12a77
jmp 0x12a77
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x13dcc
jmp 0x12aa0
jmp 0x12a8b
jmp 0x12a8b
jmp 0x12a8b
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x12aa0
callq 0x3200
movq %rbx, %rdi
callq 0x33f0