// File: /workspace/github_cpp_makefile_star2_O2/ATOMIC-LICHESS[P]ATOMKRAFT/create_book.cpp
// Function: createBookEAO()
void createBookEAO() {

	FILE* rf;
	rf = fopen("d:/eao.txt", "r");
	if (rf == NULL) {
		cout << "ERROR: open eao.txt" << endl;
	}

	FILE* wf;
	wf = fopen("d:/eao.bin", "wb");
	if (rf == NULL) {
		cout << "ERROR: open eao.bin" << endl;
	}

	Position pos("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", 0, 0);




	int st_index = 0;

	//Move pv[LINE_COUNT][BOOK_MAX_PLY];	// deepest variation has 22 plies
	int pv_index = 0;


	list<char*> strlist;
	char token[MAX_LINE_LENGTH];
	char* s;	// traverses str
	char* t;	// traverses token

	int lines = 0;
	while (!feof(rf)) {
		// read a line
		fgets(str[lines], MAX_LINE_LENGTH, rf);

		// clear the line of unwanted characters and comments
		char* c = strchr(str[lines], '#');
		if (c) *c = 0;
		c = strchr(str[lines], 10);
		if (c) *c = 0;

		for (c = str[lines] + strlen(str[lines]) - 1; c >= str[lines]; --c) {
			if (isspace(*c) || *c == 0) {
				*c = 0;
			} else {
				break;
			}
		}


		if (*str[lines]) {
			//cout << str[lines] << endl;

			strlist.push_back(str[lines]);
			++lines;
		}
	}


	// 1. clear the file of redundancies
	//    that way we guarantee that the position at the end of every pv is unique
	for (list<char*>::iterator it1 = strlist.begin(); it1 != strlist.end(); ++it1) {
		for (list<char*>::iterator it2 = strlist.begin(); it2 != strlist.end(); ++it2) {
			if (*it1 != *it2) {
				if (strlen(*it2) < strlen (*it1)) {
					if (strncmp(*it2, *it1, strlen(*it2) - 1) == 0) {
						// *it1 starts with of *it2 so delete *it2
						it2 = strlist.erase(it2);
					}
				}
			}
		}
	}

	// 2. fill the pv array
	for (list<char*>::iterator it = strlist.begin(); it != strlist.end(); ++it) {
		cout << *it << endl;

		pos.from_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", 0);

		// parse the string
		s = *it;
		t = token;

		Color color = WHITE;
		int move_count = 0;
		while (*s != 10 && *s != 0) {

			*t++ = *s++;

			if (*s == ' ' || *s == 10 || *s == 0) {
				*t = 0;

				// we have a new token
				bool playable = (*token != '?');

				Move m = san_to_move(pos, playable ? token : token+1);

				//cout << "  " << token << " ";
				if (m == MOVE_NONE) {
					cout << "ERROR: " << token << endl;
					return;
				} else {
					//cout << move_to_string(m) << endl;
				}

				pos.do_move(m, st[st_index]);
				pv[pv_index][move_count].move = m;
				pv[pv_index][move_count].playable = playable;


				++st_index;
				if (st_index >= STATEINFO_COUNT) st_index = 0;
				++move_count;
				color = opposite_color(color);
				t = token;
				if (*s == ' ') ++s;
			}
		}

		// undo all moves of the pv
		for (int k = move_count - 1; k >= 0; --k) {
			pos.undo_move(pv[pv_index][k].move );
		}
		pv[pv_index][move_count].move  = MOVE_NONE;
		++pv_index;
	}

	// 3. create a tree from the pvs
	//    note that it is important that the pvs are already sorted
	MoveTreeNode rootNode;
	MoveTreeNode* node = &rootNode;
	rootNode.ms.move = MOVE_NONE;
	rootNode.child_count = 0;
	rootNode.depth = 0;
	rootNode.parent = 0;
	rootNode.visited = false;

	BookPV* pv_curr;
	BookPV* pv_next;
	int depth = 0;
	int split_depth = 0;

	for (int i = 0; i < pv_index; ++i) {
		pv_curr = pv[i];

		if (i + 1 < pv_index) {
			pv_next = pv[i+1];
		} else {
			pv_next = pv_curr;
		}

		depth = split_depth;

		// correct indentation
		for (int k = 0; k < split_depth; ++k) {
			//cout << "     ";
		}

		while (pv_curr[depth].move != MOVE_NONE) {
			//cout << move_to_string(pv_curr[depth]) << " ";

			// create new node
			node->child[node->child_count] = new MoveTreeNode();
			node->child[node->child_count]->child_count = 0;
			node->child[node->child_count]->depth = depth + 1;
			node->child[node->child_count]->parent = node;
			node->child[node->child_count]->ms.move  = pv_curr[depth].move;
			node->child[node->child_count]->ms.score = pv_curr[depth].playable;
			node->child[node->child_count]->visited = false;
			++node->child_count;

			node = node->child[node->child_count-1];


			++depth;
		}
		//cout << endl;

		// find the split depth
		depth = 0;
		split_depth = 0;
		// the ending position of any pv is unique so the exit condition will never be reached
		while (pv_curr[depth].move != MOVE_NONE) {
			if (pv_curr[depth].move != pv_next[depth].move) {
				split_depth = depth;
				break;
			}
			++depth;
		}

		// move inside the tree such that node->depth == split_depth
		while (node->depth > split_depth) {
			node = node->parent;
		}

		assert(node->depth == split_depth);
	}



	// 4. score the nodes by the number of successors
	//    if ms.score == false holds, the move is considered not playable
	rootNode.ms.score = 1;

	printTree(&rootNode);
	cout << "positions: " << numberOfNodes(&rootNode) << endl;

//	// don't play bad openings as white
//	for (int k = 0; k < rootNode.child_count; ++k) {
//		Square to = move_to(rootNode.child[k]->ms.move);
//		if (   to == SQ_B4 || to == SQ_G3 || to == SQ_B4 || to == SQ_H3
//			|| to == SQ_E4 || to == SQ_A3 || to == SQ_C3 || to == SQ_D4) {
//			rootNode.child[k]->ms.score = 0;
//		}
//	}


	// 5. breadth-first search to write the moves into the book
	list<BookEntry*> book_entries;

	queue<MoveTreeNode*> qu;

	qu.push(&rootNode);
	rootNode.visited = true;

	pos.from_fen("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1", 0);
	st_index = 0;
	Move pv_tree[30];
	int pv_len = 0;
	int moves_made = 0;

	while (!qu.empty()) {
		node = qu.front();
		qu.pop();

//		for (int k = 0; k < node->depth; ++k) {
//			cout << "     ";
//		}
//		cout << move_to_string(node->ms.move) << endl;


		// get the pv of our current node in reversed order
		pv_len = 0;
		MoveTreeNode* node_aux = node;
		while (node_aux->parent) {
			pv_tree[pv_len] = node_aux->ms.move;
			++pv_len;
			node_aux = node_aux->parent;
		}

		// do all moves of the pv
		for (int k = pv_len - 1; k >= 0; --k) {
			pos.do_move(pv_tree[k], st[st_index]);
			++st_index;
			if (st_index >= STATEINFO_COUNT) st_index = 0;
			++moves_made;
		}


		// the actual bfs
		for (int k = 0; k < node->child_count; ++k) {
			if(node->child[k]->visited == false) {
				qu.push(node->child[k]);
				node->child[k]->visited = true;

				// write the move to the book
//				write_entry(
//					wf,
//					book_key(pos),
//					node->child[k]->ms.move,
//					node->child[k]->ms.score
//				);
				BookEntry* be = new BookEntry;
				be->key = book_key(pos);
				be->move = uint16_t(node->child[k]->ms.move);
				be->count = node->child[k]->ms.score;
				be->learn = 0;
				book_entries.push_back(be);
			}
		}



		// undo all moves of the pv
		for (int k = 0; k < pv_len; ++k) {
			//cout << ".";
			pos.undo_move(pv_tree[k]);
		}
	}


	cout << moves_made << " moves made" << endl;

	book_entries.sort(compare_key);
	for (list<BookEntry*>::iterator it = book_entries.begin(); it != book_entries.end(); ++it) {
		//cout << (*it)->key << endl;
		write_entry(wf, (*it)->key, Move((*it)->move), (*it)->count);
		delete *it;
	}
	killChildren(&rootNode);

	fclose(rf);
	fclose(wf);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d38, %rsp           # imm = 0x1D38
leaq 0x1f2d1(%rip), %rdi     # 0x28562
leaq 0x211c6(%rip), %rsi     # 0x2a45e
callq 0x5470
movq %rax, %r15
testq %rax, %rax
jne 0x92c0
movq 0x2bcf4(%rip), %rdi     # 0x34fa0
leaq 0x1f2ba(%rip), %rsi     # 0x2856d
callq 0x53b0
movq %rax, %rdi
callq 0x51d0
leaq 0x1f2ba(%rip), %rdi     # 0x28581
leaq 0x1f2be(%rip), %rsi     # 0x2858c
callq 0x5470
movq %rax, %rbx
testq %r15, %r15
jne 0x92f6
movq 0x2bcbe(%rip), %rdi     # 0x34fa0
leaq 0x1f2a6(%rip), %rsi     # 0x2858f
callq 0x53b0
movq %rax, %rdi
callq 0x51d0
leaq 0x1f2a6(%rip), %rsi     # 0x285a3
leaq 0x200(%rsp), %rdi
leaq 0x140(%rsp), %rdx
callq 0x9c42
leaq 0x3f8(%rsp), %rdi
leaq 0x200(%rsp), %rsi
xorl %r12d, %r12d
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x173dc
movq %rbx, 0x30(%rsp)
leaq 0x200(%rsp), %rdi
callq 0x5858
leaq 0x58(%rsp), %r14
movq %r14, 0x8(%r14)
movq %r14, (%r14)
andq $0x0, 0x10(%r14)
leaq 0x2addc7(%rip), %rbx    # 0x2b711f
leaq 0x2addc1(%rip), %rcx    # 0x2b7120
pushq $0xa
popq %rbp
movq %r15, 0x28(%rsp)
movl %r12d, (%rsp)
movl %r12d, %eax
imulq $0x1f4, %rax, %r13      # imm = 0x1F4
addq %rcx, %r13
movq %r15, %rdi
callq 0x5620
testl %eax, %eax
jne 0x9432
movq %r13, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movq %r15, %rdx
callq 0x5660
movq %r13, %rdi
pushq $0x23
popq %rsi
callq 0x5150
testq %rax, %rax
je 0x93ab
movb $0x0, (%rax)
movq %r13, %rdi
movl %ebp, %esi
callq 0x5150
testq %rax, %rax
je 0x93bd
movb $0x0, (%rax)
movq %r13, %rdi
callq 0x5180
movq %rax, %r12
addq %rbx, %r12
cmpq %r13, %r12
jb 0x93f0
movsbl (%r12), %r15d
movl %r15d, %edi
callq 0x5090
testl %r15d, %r15d
je 0x93e6
testl %eax, %eax
je 0x93f0
movb $0x0, (%r12)
decq %r12
jmp 0x93cb
cmpb $0x0, (%r13)
movq 0x28(%rsp), %r15
je 0x9378
movq %r13, 0x140(%rsp)
movq %r14, %rdi
leaq 0x140(%rsp), %rsi
callq 0x9c7e
movl (%rsp), %r12d
incl %r12d
addq $0x1f4, %rbx            # imm = 0x1F4
leaq 0x2adcf3(%rip), %rcx    # 0x2b7120
jmp 0x9367
movq %r14, %r15
movq (%r15), %r15
cmpq %r14, %r15
je 0x9492
movq %r14, %rbx
movq (%rbx), %rbx
cmpq %r14, %rbx
je 0x9435
movq 0x10(%r15), %r12
movq 0x10(%rbx), %r13
cmpq %r13, %r12
je 0x9440
movq %r13, %rdi
callq 0x5180
movq %rax, %rbp
movq %r12, %rdi
callq 0x5180
cmpq %rax, %rbp
jae 0x9440
decq %rbp
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x51b0
testl %eax, %eax
jne 0x9440
movq %r14, %rdi
movq %rbx, %rsi
callq 0x9c8a
movq %rax, %rbx
jmp 0x9440
leaq 0x58(%rsp), %r15
leaq 0x12727a(%rip), %r14    # 0x130718
leaq 0x140(%rsp), %r12
leaq 0x3f8(%rsp), %rbx
movq $0x0, 0x8(%rsp)
movq $0x0, (%rsp)
movq (%r15), %r15
leaq 0x58(%rsp), %rax
cmpq %rax, %r15
je 0x9693
movq 0x10(%r15), %rsi
movq 0x2bac5(%rip), %rdi     # 0x34fa0
callq 0x53b0
movq %rax, %rdi
callq 0x51d0
movq %r12, %rdi
leaq 0x1f0b1(%rip), %rsi     # 0x285a3
leaq 0xc0(%rsp), %rdx
callq 0x9c42
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
callq 0x1740c
movq %r12, %rdi
callq 0x5858
movq %r15, 0x38(%rsp)
movq 0x10(%r15), %r15
xorl %ebp, %ebp
movq %r14, 0x10(%rsp)
leaq 0x200(%rsp), %rax
movabsq $0x100000401, %rdx      # imm = 0x100000401
movzbl (%r15), %ecx
movl %ebp, %r13d
testl %ecx, %ecx
je 0x9625
cmpl $0xa, %ecx
je 0x9625
movb %cl, (%rax)
incq %rax
movzbl 0x1(%r15), %ecx
incq %r15
cmpq $0x20, %rcx
ja 0x9536
btq %rcx, %rdx
jae 0x9536
movb $0x0, (%rax)
xorl %eax, %eax
cmpb $0x3f, 0x200(%rsp)
setne 0x18(%rsp)
sete %al
leaq (%rsp,%rax), %rsi
addq $0x200, %rsi            # imm = 0x200
movq %rbx, %rdi
callq 0x8e09
movl %eax, %ebx
testl %eax, %eax
je 0x9663
movslq (%rsp), %rax
imulq $0xa0, %rax, %rdx
leaq 0x1138f5(%rip), %rax    # 0x11cea0
addq %rax, %rdx
leaq 0x3f8(%rsp), %rdi
movl %ebx, %esi
callq 0x19114
imulq $0x320, 0x8(%rsp), %rax # imm = 0x320
leaq 0x127153(%rip), %rcx    # 0x130720
addq %rcx, %rax
movl %ebx, (%rax,%r13,8)
movb 0x18(%rsp), %cl
movb %cl, 0x4(%rax,%r13,8)
movq (%rsp), %rax
cmpl $0x1f3, %eax            # imm = 0x1F3
leal 0x1(%rax), %eax
movl $0x0, %ecx
cmovgel %ecx, %eax
incl %ebp
leaq 0x1(%r15), %rcx
cmpb $0x20, (%r15)
cmoveq %rcx, %r15
addq $0x8, %r14
movq %rax, (%rsp)
leaq 0x3f8(%rsp), %rbx
jmp 0x9524
movl (%r14), %esi
decl %ebp
addq $-0x8, %r14
movq %rbx, %rdi
callq 0x1a056
testl %ebp, %ebp
jg 0x9614
movq 0x8(%rsp), %rdx
imulq $0x320, %rdx, %rax      # imm = 0x320
leaq 0x1270e4(%rip), %rcx    # 0x130720
addq %rcx, %rax
andl $0x0, (%rax,%r13,8)
incq %rdx
movq %rdx, 0x8(%rsp)
movq 0x10(%rsp), %r14
movl $0x320, %eax            # imm = 0x320
addq %rax, %r14
movq 0x38(%rsp), %r15
jmp 0x94bf
movq 0x2b936(%rip), %rdi     # 0x34fa0
leaq 0x1ef6b(%rip), %rsi     # 0x285dc
callq 0x53b0
leaq 0x200(%rsp), %rsi
movq %rax, %rdi
callq 0x53b0
movq %rax, %rdi
callq 0x51d0
jmp 0x9aa2
andq $0x0, 0x1e8(%rsp)
andl $0x0, 0x1f8(%rsp)
andq $0x0, 0x140(%rsp)
movb $0x0, 0x1fc(%rsp)
movl 0x8(%rsp), %eax
xorl %edx, %edx
leaq 0x12705e(%rip), %rsi    # 0x130720
movq %rsi, %r15
xorl %edi, %edi
xorl %r14d, %r14d
movq %rax, 0x10(%rsp)
cmpq %rax, %rdi
je 0x97e8
leaq 0x1(%rdi), %rcx
cmpq %rax, %rcx
movq %rcx, 0x8(%rsp)
cmovbq %rcx, %rdi
movq %rdi, 0x18(%rsp)
movl %r14d, %eax
movq %rdx, (%rsp)
leaq (%rdx,%rax,8), %rbp
incl %r14d
movl (%rbp,%rsi), %r13d
testl %r13d, %r13d
je 0x978e
movl $0xc0, %edi
callq 0x53d0
movq %rax, %rbx
movl $0xc0, %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x5210
movslq 0xa8(%r12), %rax
movq %rbx, 0x8(%r12,%rax,8)
andl $0x0, 0xa8(%rbx)
movslq 0xa8(%r12), %rax
movq 0x8(%r12,%rax,8), %rcx
movl %r14d, 0xb8(%rcx)
movq %r12, (%rcx)
movq 0x8(%r12,%rax,8), %rcx
movl %r13d, 0xac(%rcx)
leaq 0x126fbd(%rip), %rsi    # 0x130720
movzbl 0x4(%rbp,%rsi), %edx
movl %edx, 0xb0(%rcx)
movb $0x0, 0xbc(%rcx)
incl %eax
movl %eax, 0xa8(%r12)
addq $0x8, %rbp
incl %r14d
movq %rcx, %r12
jmp 0x96fb
imulq $0x320, 0x18(%rsp), %rax # imm = 0x320
leaq 0x126f82(%rip), %rsi    # 0x130720
addq %rsi, %rax
xorl %r14d, %r14d
movq (%rsp), %rdx
movl (%r15,%r14,8), %ecx
testl %ecx, %ecx
je 0x97bb
cmpl (%rax,%r14,8), %ecx
jne 0x97be
incq %r14
jmp 0x97a8
xorl %r14d, %r14d
movq 0x10(%rsp), %rax
cmpl %r14d, 0xb8(%r12)
jle 0x97d3
movq (%r12), %r12
jmp 0x97c3
movl $0x320, %ecx            # imm = 0x320
addq %rcx, %rdx
addq %rcx, %r15
movq 0x8(%rsp), %rdi
jmp 0x96cf
leaq 0x140(%rsp), %rdi
movl $0x1, 0xb0(%rdi)
callq 0x903f
movq 0x2b79a(%rip), %rdi     # 0x34fa0
leaq 0x1edd7(%rip), %rsi     # 0x285e4
callq 0x53b0
movq %rax, %r14
leaq 0x140(%rsp), %rbx
movq %rbx, %rdi
callq 0x9165
movq %r14, %rdi
movl %eax, %esi
callq 0x5760
movq %rax, %rdi
callq 0x51d0
leaq 0x40(%rsp), %rax
movq %rax, 0x8(%rax)
movq %rax, (%rax)
andq $0x0, 0x10(%rax)
leaq 0x70(%rsp), %rdi
callq 0x9c98
leaq 0x113647(%rip), %r12    # 0x11cea0
leaq 0xc0(%rsp), %rsi
movq %rbx, (%rsi)
leaq 0x70(%rsp), %rdi
callq 0xa2a2
movb $0x1, 0x1fc(%rsp)
leaq 0x1ed26(%rip), %rsi     # 0x285a3
leaq 0xc0(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x9c42
leaq 0x3f8(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
xorl %edx, %edx
callq 0x1740c
leaq 0xc0(%rsp), %rdi
callq 0x5858
leaq 0x3f8(%rsp), %r13
xorl %ebp, %ebp
xorl %r15d, %r15d
movq 0x80(%rsp), %rax
cmpq %rax, 0xa0(%rsp)
je 0x99fc
movq (%rax), %r14
leaq 0x70(%rsp), %rdi
callq 0xa502
xorl %ebx, %ebx
movq %r14, %rax
movq (%rax), %rcx
testq %rcx, %rcx
je 0x9905
movl 0xac(%rax), %eax
movl %eax, 0xc0(%rsp,%rbx,4)
incq %rbx
movq %rcx, %rax
jmp 0x98e8
movl %r15d, %r15d
addq %rbx, %r15
movq %r15, (%rsp)
movq %rbx, %r15
testl %r15d, %r15d
je 0x994c
movl 0xbc(%rsp,%r15,4), %esi
movslq %ebp, %rax
imulq $0xa0, %rax, %rdx
addq %r12, %rdx
movq %r13, %rdi
callq 0x19114
cmpl $0x1f3, %ebp            # imm = 0x1F3
leal 0x1(%rbp), %eax
movl $0x0, %ecx
cmovgel %ecx, %eax
decq %r15
movl %eax, %ebp
jmp 0x9912
leaq 0x8(%r14), %r15
xorl %r12d, %r12d
movslq 0xa8(%r14), %rax
cmpq %rax, %r12
jge 0x99d0
movq (%r15), %rax
cmpb $0x0, 0xbc(%rax)
jne 0x99c7
leaq 0x70(%rsp), %rdi
movq %r15, %rsi
callq 0xa558
movq (%r15), %rax
movb $0x1, 0xbc(%rax)
pushq $0x10
popq %rdi
callq 0x53d0
movq %rax, 0x20(%rsp)
movq %r13, %rdi
callq 0x82c8
movq 0x20(%rsp), %rcx
movq %rax, (%rcx)
movq (%r15), %rax
movq 0xac(%rax), %xmm0
pshuflw $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3,4,5,6,7]
movd %xmm0, 0x8(%rcx)
andl $0x0, 0xc(%rcx)
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x9cb4
incq %r12
addq $0x8, %r15
jmp 0x9953
xorl %r14d, %r14d
leaq 0x1134c6(%rip), %r12    # 0x11cea0
movq (%rsp), %r15
cmpq %r14, %rbx
je 0x98c0
movl 0xc0(%rsp,%r14,4), %esi
movq %r13, %rdi
callq 0x1a056
incq %r14
jmp 0x99de
movq 0x2b59d(%rip), %rdi     # 0x34fa0
movl %r15d, %esi
callq 0x5760
leaq 0x1ebde(%rip), %rsi     # 0x285f0
movq %rax, %rdi
callq 0x53b0
movq %rax, %rdi
callq 0x51d0
leaq -0x7ba(%rip), %rsi      # 0x926f
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
callq 0x9cc0
pushq $0x10
popq %r14
movq %rbx, %r15
movq 0x30(%rsp), %r12
movq (%r15), %r15
cmpq %rbx, %r15
je 0x9a6f
movq 0x10(%r15), %rax
movq (%rax), %rsi
movzwl 0x8(%rax), %edx
movzwl 0xa(%rax), %ecx
movq %r12, %rdi
callq 0x91aa
movq 0x10(%r15), %rdi
movq %r14, %rsi
callq 0x53e0
jmp 0x9a42
leaq 0x140(%rsp), %rdi
callq 0x8d7b
movq 0x28(%rsp), %rdi
callq 0x53c0
movq %r12, %rdi
callq 0x53c0
leaq 0x70(%rsp), %rdi
callq 0x9e76
leaq 0x40(%rsp), %rdi
callq 0x9ece
leaq 0x58(%rsp), %rdi
callq 0x9ef8
addq $0x1d38, %rsp           # imm = 0x1D38
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x5858
jmp 0x9b22
jmp 0x9b1f
jmp 0x9b1f
movq %rax, %rbx
jmp 0x9b2c
jmp 0x9b1a
movq %rax, %rbx
leaq 0x200(%rsp), %rdi
callq 0x5858
jmp 0x9b40
movq %rax, %rbx
jmp 0x9b40
jmp 0x9b1a
jmp 0x9b1f
jmp 0x9b1a
jmp 0x9b1f
jmp 0x9b1a
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0x5858
jmp 0x9b36
jmp 0x9b1a
jmp 0x9b1a
jmp 0x9b1f
jmp 0x9b1a
jmp 0x9b1f
jmp 0x9b1f
movq %rax, %rbx
jmp 0x9b36
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x9e76
leaq 0x40(%rsp), %rdi
callq 0x9ece
leaq 0x58(%rsp), %rdi
callq 0x9ef8
movq %rbx, %rdi
callq 0x5780