// File: Doug0855[P]TigerZone/Board.cpp
// Function: Board::checkPlacement(Tile, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::vector< std::pair<int, int> > Board::checkPlacement(Tile tile, int i, int j, std::string openFaces)
{
	std::vector< std::pair<int, int> > places;
	if (openFaces == "up"){
		for (int ii = 0; ii < 4; ii++)
		{
			// if the bottom face of the tile we're trying to place equals the top face of the tile on the board
			// and it equals the faces of all the other surrounding tiles
			if (m_board[i][j]->getUpFace()->faceEquals(*tile.getDownFace()) &&
				 (m_board[i - 1][j - 1] == NULL || m_board[i - 1][j - 1]->getRightFace()->faceEquals(*tile.getLeftFace())) &&
				 (m_board[i - 1][j + 1] == NULL || m_board[i - 1][j + 1]->getLeftFace()->faceEquals(*tile.getRightFace())) &&
				 (m_board[i - 2][j] == NULL || m_board[i - 2][j]->getDownFace()->faceEquals(*tile.getUpFace())))
			{
				places.push_back(std::pair<int, int>(i - 1, j));
				break;
			}
			tile.rotate();
		}
	}
	else if (openFaces == "down")
	{
		for (int ii = 0; ii < 4; ii++)
		{
			// same thing as above but with down
			if ((m_board[i + 2][j] == NULL || m_board[i + 2][j]->getUpFace()->faceEquals(*tile.getDownFace())) &&
				 (m_board[i + 1][j - 1] == NULL || m_board[i + 1][j - 1]->getRightFace()->faceEquals(*tile.getLeftFace())) &&
				 (m_board[i + 1][j + 1] == NULL || m_board[i + 1][j + 1]->getLeftFace()->faceEquals(*tile.getRightFace())) &&
				 (m_board[i][j]->getDownFace()->faceEquals(*tile.getUpFace())))
			{
				//debugging std::cout<<"Checking down face equals"<<m_board[i][j]->getDownFace()->faceEquals(*tile.getUpFace())<<std::endl;
				//debugging std::cout<<"Down face type: "<<m_board[i][j]->getDownFaceType()<<std::endl;
				//debugging std::cout<<"Tile up face type: "<<tile.getUpFaceType()<<std::endl;
				places.push_back(std::pair<int, int>(i + 1, j));
				break;
			}
			tile.rotate();
		}
	}
	else if (openFaces == "left")
	{
		for (int ii = 0; ii < 4; ii++)
		{
			// same thing as above but with left
			if ((m_board[i + 1][j - 1] == NULL || m_board[i + 1][j - 1]->getUpFace()->faceEquals(*tile.getDownFace())) &&
				 (m_board[i][j - 2] == NULL || m_board[i][j - 2]->getRightFace()->faceEquals(*tile.getLeftFace())) &&
				 (m_board[i][j]->getLeftFace()->faceEquals(*tile.getRightFace())) &&
				 (m_board[i - 1][j - 1] == NULL || m_board[i - 1][j - 1]->getDownFace()->faceEquals(*tile.getUpFace())))
			{
				// std::cout<<"Can connect to left face at i,j"<<std::endl;
				places.push_back(std::pair<int, int>(i, j - 1));
				break;
			}
			tile.rotate();
		}
	}
	else if (openFaces == "right")
	{
		for (int ii = 0; ii < 4; ii++)
		{
			// same thing as above but with right
			if ((m_board[i + 1][j + 1] == NULL || m_board[i + 1][j + 1]->getUpFace()->faceEquals(*tile.getDownFace())) &&
				 (m_board[i][j]->getRightFace()->faceEquals(*tile.getLeftFace())) &&
				 (m_board[i][j + 2] == NULL || m_board[i][j + 2]->getLeftFace()->faceEquals(*tile.getRightFace())) &&
				 (m_board[i - 1][j + 1] == NULL || m_board[i - 1][j + 1]->getDownFace()->faceEquals(*tile.getUpFace())))
			{
				// std::cout<<"Can connect to right face at i,j"<<std::endl;
				places.push_back(std::pair<int, int>(i, j + 1));
				break;
			}
			tile.rotate();
		}
	}
	return places;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x520, %rsp            # imm = 0x520
movq %r9, -0x380(%rbp)
movq %rdx, -0x3a0(%rbp)
movq %rdi, -0x398(%rbp)
movq %rdi, %rax
movq %rax, -0x390(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x388(%rbp)
movb $0x0, -0x29(%rbp)
callq 0x151a0
movq -0x380(%rbp), %rdi
leaq 0x10c36(%rip), %rsi     # 0x29779
callq 0x85b0
movb %al, -0x371(%rbp)
jmp 0x18b50
movb -0x371(%rbp), %al
testb $0x1, %al
jne 0x18b5f
jmp 0x18fd3
movl $0x0, -0x40(%rbp)
cmpl $0x4, -0x40(%rbp)
jge 0x18fce
movq -0x388(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
movb $0x0, -0x91(%rbp)
movb $0x0, -0xc1(%rbp)
movb $0x0, -0xf1(%rbp)
callq 0x203a0
movq %rax, -0x3a8(%rbp)
jmp 0x18bb2
movq -0x3a0(%rbp), %rdi
callq 0x203c0
movq %rax, -0x3b0(%rbp)
jmp 0x18bc7
movq -0x3b0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0x8e70
jmp 0x18bd9
movq -0x3a8(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x281c0
movb %al, -0x3b1(%rbp)
jmp 0x18bf1
movb -0x3b1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x3b2(%rbp)
jne 0x18c09
jmp 0x18e69
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x18cd2
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203e0
movq %rax, -0x3c0(%rbp)
jmp 0x18c6e
movq -0x3a0(%rbp), %rdi
callq 0x20400
movq %rax, -0x3c8(%rbp)
jmp 0x18c83
movq -0x3c8(%rbp), %rsi
leaq -0x90(%rbp), %rdi
callq 0x8e70
jmp 0x18c98
movq -0x3c0(%rbp), %rdi
movb $0x1, -0x91(%rbp)
leaq -0x90(%rbp), %rsi
callq 0x281c0
movb %al, -0x3c9(%rbp)
jmp 0x18cba
movb -0x3c9(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x3b2(%rbp)
jne 0x18cd2
jmp 0x18e69
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x18d9b
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x20400
movq %rax, -0x3d8(%rbp)
jmp 0x18d37
movq -0x3a0(%rbp), %rdi
callq 0x203e0
movq %rax, -0x3e0(%rbp)
jmp 0x18d4c
movq -0x3e0(%rbp), %rsi
leaq -0xc0(%rbp), %rdi
callq 0x8e70
jmp 0x18d61
movq -0x3d8(%rbp), %rdi
movb $0x1, -0xc1(%rbp)
leaq -0xc0(%rbp), %rsi
callq 0x281c0
movb %al, -0x3e1(%rbp)
jmp 0x18d83
movb -0x3e1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x3b2(%rbp)
jne 0x18d9b
jmp 0x18e69
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8230
movq %rax, %rcx
movb $0x1, %al
cmpq $0x0, (%rcx)
movb %al, -0x3e2(%rbp)
je 0x18e5d
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl $-0x2, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203c0
movq %rax, -0x3f0(%rbp)
jmp 0x18e03
movq -0x3a0(%rbp), %rdi
callq 0x203a0
movq %rax, -0x3f8(%rbp)
jmp 0x18e18
movq -0x3f8(%rbp), %rsi
leaq -0xf0(%rbp), %rdi
callq 0x8e70
jmp 0x18e2d
movq -0x3f0(%rbp), %rdi
movb $0x1, -0xf1(%rbp)
leaq -0xf0(%rbp), %rsi
callq 0x281c0
movb %al, -0x3f9(%rbp)
jmp 0x18e4f
movb -0x3f9(%rbp), %al
movb %al, -0x3e2(%rbp)
jmp 0x18e5d
movb -0x3e2(%rbp), %al
movb %al, -0x3b2(%rbp)
movb -0x3b2(%rbp), %al
movb %al, -0x3fa(%rbp)
testb $0x1, -0xf1(%rbp)
jne 0x18e80
jmp 0x18e8c
leaq -0xf0(%rbp), %rdi
callq 0x28160
testb $0x1, -0xc1(%rbp)
jne 0x18e97
jmp 0x18ea3
leaq -0xc0(%rbp), %rdi
callq 0x28160
testb $0x1, -0x91(%rbp)
jne 0x18eae
jmp 0x18eba
leaq -0x90(%rbp), %rdi
callq 0x28160
leaq -0x68(%rbp), %rdi
callq 0x28160
movb -0x3fa(%rbp), %al
testb $0x1, %al
jne 0x18ed2
jmp 0x18fb0
movl -0x1c(%rbp), %eax
decl %eax
movl %eax, -0x100(%rbp)
leaq -0xfc(%rbp), %rdi
leaq -0x100(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x20450
jmp 0x18ef6
movq -0x398(%rbp), %rdi
leaq -0xfc(%rbp), %rsi
callq 0x20420
jmp 0x18f0b
jmp 0x18fce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x19e46
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x18fa2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x18f89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x18f70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
testb $0x1, -0xf1(%rbp)
jne 0x18f62
jmp 0x18f6e
leaq -0xf0(%rbp), %rdi
callq 0x28160
jmp 0x18f70
testb $0x1, -0xc1(%rbp)
jne 0x18f7b
jmp 0x18f87
leaq -0xc0(%rbp), %rdi
callq 0x28160
jmp 0x18f89
testb $0x1, -0x91(%rbp)
jne 0x18f94
jmp 0x18fa0
leaq -0x90(%rbp), %rdi
callq 0x28160
jmp 0x18fa2
leaq -0x68(%rbp), %rdi
callq 0x28160
jmp 0x19e46
movq -0x3a0(%rbp), %rdi
callq 0x268d0
jmp 0x18fbe
jmp 0x18fc0
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x18b66
jmp 0x19e20
movq -0x380(%rbp), %rdi
leaq 0x1079b(%rip), %rsi     # 0x2977c
callq 0x85b0
movb %al, -0x3fb(%rbp)
jmp 0x18fee
movb -0x3fb(%rbp), %al
testb $0x1, %al
jne 0x18ffd
jmp 0x19488
movl $0x0, -0x104(%rbp)
cmpl $0x4, -0x104(%rbp)
jge 0x19483
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8230
movq (%rax), %rax
movb $0x0, -0x131(%rbp)
movb $0x0, -0x161(%rbp)
movb $0x0, -0x191(%rbp)
movb $0x0, -0x1c1(%rbp)
cmpq $0x0, %rax
je 0x190f4
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203a0
movq %rax, -0x408(%rbp)
jmp 0x19090
movq -0x3a0(%rbp), %rdi
callq 0x203c0
movq %rax, -0x410(%rbp)
jmp 0x190a5
movq -0x410(%rbp), %rsi
leaq -0x130(%rbp), %rdi
callq 0x8e70
jmp 0x190ba
movq -0x408(%rbp), %rdi
movb $0x1, -0x131(%rbp)
leaq -0x130(%rbp), %rsi
callq 0x281c0
movb %al, -0x411(%rbp)
jmp 0x190dc
movb -0x411(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x412(%rbp)
jne 0x190f4
jmp 0x1930d
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x191bd
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203e0
movq %rax, -0x420(%rbp)
jmp 0x19159
movq -0x3a0(%rbp), %rdi
callq 0x20400
movq %rax, -0x428(%rbp)
jmp 0x1916e
movq -0x428(%rbp), %rsi
leaq -0x160(%rbp), %rdi
callq 0x8e70
jmp 0x19183
movq -0x420(%rbp), %rdi
movb $0x1, -0x161(%rbp)
leaq -0x160(%rbp), %rsi
callq 0x281c0
movb %al, -0x429(%rbp)
jmp 0x191a5
movb -0x429(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x412(%rbp)
jne 0x191bd
jmp 0x1930d
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x19286
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x20400
movq %rax, -0x438(%rbp)
jmp 0x19222
movq -0x3a0(%rbp), %rdi
callq 0x203e0
movq %rax, -0x440(%rbp)
jmp 0x19237
movq -0x440(%rbp), %rsi
leaq -0x190(%rbp), %rdi
callq 0x8e70
jmp 0x1924c
movq -0x438(%rbp), %rdi
movb $0x1, -0x191(%rbp)
leaq -0x190(%rbp), %rsi
callq 0x281c0
movb %al, -0x441(%rbp)
jmp 0x1926e
movb -0x441(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x412(%rbp)
jne 0x19286
jmp 0x1930d
movq -0x388(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203c0
movq %rax, -0x450(%rbp)
jmp 0x192b3
movq -0x3a0(%rbp), %rdi
callq 0x203a0
movq %rax, -0x458(%rbp)
jmp 0x192c8
movq -0x458(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0x8e70
jmp 0x192dd
movq -0x450(%rbp), %rdi
movb $0x1, -0x1c1(%rbp)
leaq -0x1c0(%rbp), %rsi
callq 0x281c0
movb %al, -0x459(%rbp)
jmp 0x192ff
movb -0x459(%rbp), %al
movb %al, -0x412(%rbp)
jmp 0x1930d
movb -0x412(%rbp), %al
movb %al, -0x45a(%rbp)
testb $0x1, -0x1c1(%rbp)
jne 0x19324
jmp 0x19330
leaq -0x1c0(%rbp), %rdi
callq 0x28160
testb $0x1, -0x191(%rbp)
jne 0x1933b
jmp 0x19347
leaq -0x190(%rbp), %rdi
callq 0x28160
testb $0x1, -0x161(%rbp)
jne 0x19352
jmp 0x1935e
leaq -0x160(%rbp), %rdi
callq 0x28160
testb $0x1, -0x131(%rbp)
jne 0x19369
jmp 0x19375
leaq -0x130(%rbp), %rdi
callq 0x28160
movb -0x45a(%rbp), %al
testb $0x1, %al
jne 0x19384
jmp 0x1945f
movl -0x1c(%rbp), %eax
incl %eax
movl %eax, -0x1d0(%rbp)
leaq -0x1cc(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0x20450
jmp 0x193a8
movq -0x398(%rbp), %rdi
leaq -0x1cc(%rbp), %rsi
callq 0x20420
jmp 0x193bd
jmp 0x19483
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x19443
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1942a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x19411
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
testb $0x1, -0x1c1(%rbp)
jne 0x19403
jmp 0x1940f
leaq -0x1c0(%rbp), %rdi
callq 0x28160
jmp 0x19411
testb $0x1, -0x191(%rbp)
jne 0x1941c
jmp 0x19428
leaq -0x190(%rbp), %rdi
callq 0x28160
jmp 0x1942a
testb $0x1, -0x161(%rbp)
jne 0x19435
jmp 0x19441
leaq -0x160(%rbp), %rdi
callq 0x28160
jmp 0x19443
testb $0x1, -0x131(%rbp)
jne 0x1944e
jmp 0x1945a
leaq -0x130(%rbp), %rdi
callq 0x28160
jmp 0x19e46
movq -0x3a0(%rbp), %rdi
callq 0x268d0
jmp 0x1946d
jmp 0x1946f
movl -0x104(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x104(%rbp)
jmp 0x19007
jmp 0x19e1e
movq -0x380(%rbp), %rdi
leaq 0x102eb(%rip), %rsi     # 0x29781
callq 0x85b0
movb %al, -0x45b(%rbp)
jmp 0x194a3
movb -0x45b(%rbp), %al
testb $0x1, %al
jne 0x194b2
jmp 0x19954
movl $0x0, -0x1d4(%rbp)
cmpl $0x4, -0x1d4(%rbp)
jge 0x1994f
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rax
movb $0x0, -0x201(%rbp)
movb $0x0, -0x231(%rbp)
movb $0x0, -0x261(%rbp)
movb $0x0, -0x291(%rbp)
cmpq $0x0, %rax
je 0x195b1
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203a0
movq %rax, -0x468(%rbp)
jmp 0x1954d
movq -0x3a0(%rbp), %rdi
callq 0x203c0
movq %rax, -0x470(%rbp)
jmp 0x19562
movq -0x470(%rbp), %rsi
leaq -0x200(%rbp), %rdi
callq 0x8e70
jmp 0x19577
movq -0x468(%rbp), %rdi
movb $0x1, -0x201(%rbp)
leaq -0x200(%rbp), %rsi
callq 0x281c0
movb %al, -0x471(%rbp)
jmp 0x19599
movb -0x471(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x472(%rbp)
jne 0x195b1
jmp 0x197d9
movq -0x388(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x19672
movq -0x388(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
addl $-0x2, %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203e0
movq %rax, -0x480(%rbp)
jmp 0x1960e
movq -0x3a0(%rbp), %rdi
callq 0x20400
movq %rax, -0x488(%rbp)
jmp 0x19623
movq -0x488(%rbp), %rsi
leaq -0x230(%rbp), %rdi
callq 0x8e70
jmp 0x19638
movq -0x480(%rbp), %rdi
movb $0x1, -0x231(%rbp)
leaq -0x230(%rbp), %rsi
callq 0x281c0
movb %al, -0x489(%rbp)
jmp 0x1965a
movb -0x489(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x472(%rbp)
jne 0x19672
jmp 0x197d9
movq -0x388(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x20400
movq %rax, -0x498(%rbp)
jmp 0x1969f
movq -0x3a0(%rbp), %rdi
callq 0x203e0
movq %rax, -0x4a0(%rbp)
jmp 0x196b4
movq -0x4a0(%rbp), %rsi
leaq -0x260(%rbp), %rdi
callq 0x8e70
jmp 0x196c9
movq -0x498(%rbp), %rdi
movb $0x1, -0x261(%rbp)
leaq -0x260(%rbp), %rsi
callq 0x281c0
movb %al, -0x4a1(%rbp)
jmp 0x196eb
movb -0x4a1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x472(%rbp)
jne 0x19703
jmp 0x197d9
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
movq %rax, %rcx
movb $0x1, %al
cmpq $0x0, (%rcx)
movb %al, -0x4a2(%rbp)
je 0x197cd
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203c0
movq %rax, -0x4b0(%rbp)
jmp 0x19773
movq -0x3a0(%rbp), %rdi
callq 0x203a0
movq %rax, -0x4b8(%rbp)
jmp 0x19788
movq -0x4b8(%rbp), %rsi
leaq -0x290(%rbp), %rdi
callq 0x8e70
jmp 0x1979d
movq -0x4b0(%rbp), %rdi
movb $0x1, -0x291(%rbp)
leaq -0x290(%rbp), %rsi
callq 0x281c0
movb %al, -0x4b9(%rbp)
jmp 0x197bf
movb -0x4b9(%rbp), %al
movb %al, -0x4a2(%rbp)
jmp 0x197cd
movb -0x4a2(%rbp), %al
movb %al, -0x472(%rbp)
movb -0x472(%rbp), %al
movb %al, -0x4ba(%rbp)
testb $0x1, -0x291(%rbp)
jne 0x197f0
jmp 0x197fc
leaq -0x290(%rbp), %rdi
callq 0x28160
testb $0x1, -0x261(%rbp)
jne 0x19807
jmp 0x19813
leaq -0x260(%rbp), %rdi
callq 0x28160
testb $0x1, -0x231(%rbp)
jne 0x1981e
jmp 0x1982a
leaq -0x230(%rbp), %rdi
callq 0x28160
testb $0x1, -0x201(%rbp)
jne 0x19835
jmp 0x19841
leaq -0x200(%rbp), %rdi
callq 0x28160
movb -0x4ba(%rbp), %al
testb $0x1, %al
jne 0x19850
jmp 0x1992b
movl -0x20(%rbp), %eax
decl %eax
movl %eax, -0x2a0(%rbp)
leaq -0x29c(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
leaq -0x2a0(%rbp), %rdx
callq 0x20480
jmp 0x19874
movq -0x398(%rbp), %rdi
leaq -0x29c(%rbp), %rsi
callq 0x20420
jmp 0x19889
jmp 0x1994f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x1990f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x198f6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x198dd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
testb $0x1, -0x291(%rbp)
jne 0x198cf
jmp 0x198db
leaq -0x290(%rbp), %rdi
callq 0x28160
jmp 0x198dd
testb $0x1, -0x261(%rbp)
jne 0x198e8
jmp 0x198f4
leaq -0x260(%rbp), %rdi
callq 0x28160
jmp 0x198f6
testb $0x1, -0x231(%rbp)
jne 0x19901
jmp 0x1990d
leaq -0x230(%rbp), %rdi
callq 0x28160
jmp 0x1990f
testb $0x1, -0x201(%rbp)
jne 0x1991a
jmp 0x19926
leaq -0x200(%rbp), %rdi
callq 0x28160
jmp 0x19e46
movq -0x3a0(%rbp), %rdi
callq 0x268d0
jmp 0x19939
jmp 0x1993b
movl -0x1d4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1d4(%rbp)
jmp 0x194bc
jmp 0x19e1c
movq -0x380(%rbp), %rdi
leaq 0xfe24(%rip), %rsi      # 0x29786
callq 0x85b0
movb %al, -0x4bb(%rbp)
jmp 0x1996f
movb -0x4bb(%rbp), %al
testb $0x1, %al
jne 0x1997e
jmp 0x19e1a
movl $0x0, -0x2a4(%rbp)
cmpl $0x4, -0x2a4(%rbp)
jge 0x19e18
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rax
movb $0x0, -0x2d1(%rbp)
movb $0x0, -0x301(%rbp)
movb $0x0, -0x331(%rbp)
movb $0x0, -0x361(%rbp)
cmpq $0x0, %rax
je 0x19a7d
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203a0
movq %rax, -0x4c8(%rbp)
jmp 0x19a19
movq -0x3a0(%rbp), %rdi
callq 0x203c0
movq %rax, -0x4d0(%rbp)
jmp 0x19a2e
movq -0x4d0(%rbp), %rsi
leaq -0x2d0(%rbp), %rdi
callq 0x8e70
jmp 0x19a43
movq -0x4c8(%rbp), %rdi
movb $0x1, -0x2d1(%rbp)
leaq -0x2d0(%rbp), %rsi
callq 0x281c0
movb %al, -0x4d1(%rbp)
jmp 0x19a65
movb -0x4d1(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x4d2(%rbp)
jne 0x19a7d
jmp 0x19ca5
movq -0x388(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movslq -0x20(%rbp), %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203e0
movq %rax, -0x4e0(%rbp)
jmp 0x19aaa
movq -0x3a0(%rbp), %rdi
callq 0x20400
movq %rax, -0x4e8(%rbp)
jmp 0x19abf
movq -0x4e8(%rbp), %rsi
leaq -0x300(%rbp), %rdi
callq 0x8e70
jmp 0x19ad4
movq -0x4e0(%rbp), %rdi
movb $0x1, -0x301(%rbp)
leaq -0x300(%rbp), %rsi
callq 0x281c0
movb %al, -0x4e9(%rbp)
jmp 0x19af6
movb -0x4e9(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x4d2(%rbp)
jne 0x19b0e
jmp 0x19ca5
movq -0x388(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rsi
callq 0x8230
cmpq $0x0, (%rax)
je 0x19bcf
movq -0x388(%rbp), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x20400
movq %rax, -0x4f8(%rbp)
jmp 0x19b6b
movq -0x3a0(%rbp), %rdi
callq 0x203e0
movq %rax, -0x500(%rbp)
jmp 0x19b80
movq -0x500(%rbp), %rsi
leaq -0x330(%rbp), %rdi
callq 0x8e70
jmp 0x19b95
movq -0x4f8(%rbp), %rdi
movb $0x1, -0x331(%rbp)
leaq -0x330(%rbp), %rsi
callq 0x281c0
movb %al, -0x501(%rbp)
jmp 0x19bb7
movb -0x501(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x4d2(%rbp)
jne 0x19bcf
jmp 0x19ca5
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x8230
movq %rax, %rcx
movb $0x1, %al
cmpq $0x0, (%rcx)
movb %al, -0x502(%rbp)
je 0x19c99
movq -0x388(%rbp), %rdi
movl -0x1c(%rbp), %eax
decl %eax
movslq %eax, %rsi
callq 0x81d0
movq %rax, %rdi
movl -0x20(%rbp), %eax
incl %eax
movslq %eax, %rsi
callq 0x8230
movq (%rax), %rdi
callq 0x203c0
movq %rax, -0x510(%rbp)
jmp 0x19c3f
movq -0x3a0(%rbp), %rdi
callq 0x203a0
movq %rax, -0x518(%rbp)
jmp 0x19c54
movq -0x518(%rbp), %rsi
leaq -0x360(%rbp), %rdi
callq 0x8e70
jmp 0x19c69
movq -0x510(%rbp), %rdi
movb $0x1, -0x361(%rbp)
leaq -0x360(%rbp), %rsi
callq 0x281c0
movb %al, -0x519(%rbp)
jmp 0x19c8b
movb -0x519(%rbp), %al
movb %al, -0x502(%rbp)
jmp 0x19c99
movb -0x502(%rbp), %al
movb %al, -0x4d2(%rbp)
movb -0x4d2(%rbp), %al
movb %al, -0x51a(%rbp)
testb $0x1, -0x361(%rbp)
jne 0x19cbc
jmp 0x19cc8
leaq -0x360(%rbp), %rdi
callq 0x28160
testb $0x1, -0x331(%rbp)
jne 0x19cd3
jmp 0x19cdf
leaq -0x330(%rbp), %rdi
callq 0x28160
testb $0x1, -0x301(%rbp)
jne 0x19cea
jmp 0x19cf6
leaq -0x300(%rbp), %rdi
callq 0x28160
testb $0x1, -0x2d1(%rbp)
jne 0x19d01
jmp 0x19d0d
leaq -0x2d0(%rbp), %rdi
callq 0x28160
movb -0x51a(%rbp), %al
testb $0x1, %al
jne 0x19d1c
jmp 0x19df4
movl -0x20(%rbp), %eax
incl %eax
movl %eax, -0x370(%rbp)
leaq -0x36c(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
leaq -0x370(%rbp), %rdx
callq 0x20480
jmp 0x19d40
movq -0x398(%rbp), %rdi
leaq -0x36c(%rbp), %rsi
callq 0x20420
jmp 0x19d55
jmp 0x19e18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x19ddb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x19dc2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x19da9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
testb $0x1, -0x361(%rbp)
jne 0x19d9b
jmp 0x19da7
leaq -0x360(%rbp), %rdi
callq 0x28160
jmp 0x19da9
testb $0x1, -0x331(%rbp)
jne 0x19db4
jmp 0x19dc0
leaq -0x330(%rbp), %rdi
callq 0x28160
jmp 0x19dc2
testb $0x1, -0x301(%rbp)
jne 0x19dcd
jmp 0x19dd9
leaq -0x300(%rbp), %rdi
callq 0x28160
jmp 0x19ddb
testb $0x1, -0x2d1(%rbp)
jne 0x19de6
jmp 0x19df2
leaq -0x2d0(%rbp), %rdi
callq 0x28160
jmp 0x19e46
movq -0x3a0(%rbp), %rdi
callq 0x268d0
jmp 0x19e02
jmp 0x19e04
movl -0x2a4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2a4(%rbp)
jmp 0x19988
jmp 0x19e1a
jmp 0x19e1c
jmp 0x19e1e
jmp 0x19e20
movb $0x1, -0x29(%rbp)
testb $0x1, -0x29(%rbp)
jne 0x19e36
movq -0x398(%rbp), %rdi
callq 0x15320
movq -0x390(%rbp), %rax
addq $0x520, %rsp            # imm = 0x520
popq %rbp
retq
movq -0x398(%rbp), %rdi
callq 0x15320
movq -0x38(%rbp), %rdi
callq 0x34f0
nopl (%rax,%rax)