// File: tewalds[P]pentagod/agentmcts.cpp
// Function: AgentMCTS::search(double, unsigned long, int)
void AgentMCTS::search(double time, uint64_t max_runs, int verbose){
	time_used = 0;
	int toplay = rootboard.toplay();

	if(rootboard.won() >= 0 || (time <= 0 && max_runs == 0))
		return;

	Time starttime;

	stop_threads();

	if(runs)
		logerr("Pondered " + to_str(runs) + " runs\n");

	runs = 0;
	maxruns = max_runs;
	for(unsigned int i = 0; i < threads.size(); i++)
		threads[i]->reset();


	//let them run!
	start_threads();

	Alarm timer;
	if(time > 0)
		timer(time - (Time() - starttime), std::bind(&AgentMCTS::timedout, this));

	//wait for the timer to stop them
	runbarrier.wait();
	CAS(threadstate, Thread_Wait_End, Thread_Wait_Start);
	assert(threadstate == Thread_Wait_Start);

	time_used = Time() - starttime;


	if(verbose){
		DepthStats gamelen, treelen;
		double times[4] = {0,0,0,0};
		for(unsigned int i = 0; i < threads.size(); i++){
			gamelen += threads[i]->gamelen;
			treelen += threads[i]->treelen;
			for(int a = 0; a < 4; a++)
				times[a] += threads[i]->times[a];
		}

		logerr("Finished:    " + to_str(runs) + " runs in " + to_str(time_used*1000, 0) + " msec: " + to_str(runs/time_used, 0) + " Games/s\n");
		if(runs > 0){
			logerr("Game length: " + gamelen.to_s() + "\n");
			logerr("Tree depth:  " + treelen.to_s() + "\n");
			if(profile)
				logerr("Times:       " + to_str(times[0], 3) + ", " + to_str(times[1], 3) + ", " + to_str(times[2], 3) + ", " + to_str(times[3], 3) + "\n");
		}

		if(root.outcome != -3){
			logerr("Solved as a ");
			if(     root.outcome == 0)        logerr("draw\n");
			else if(root.outcome == 3)        logerr("draw by simultaneous win\n");
			else if(root.outcome == toplay)   logerr("win\n");
			else if(root.outcome == 3-toplay) logerr("loss\n");
			else if(root.outcome == -toplay)  logerr("win or draw\n");
			else if(root.outcome == toplay-3) logerr("loss or draw\n");
		}

		vector<Move> pv = get_pv();
		string pvstr;
		for(vector<Move>::iterator m = pv.begin(); m != pv.end(); ++m)
			pvstr += " " + m->to_s();
		logerr("PV:         " + pvstr + "\n");

		if(verbose >= 3 && !root.children.empty())
			logerr("Move stats:\n" + move_stats(vector<Move>()));
	}

	for(unsigned int i = 0; i < threads.size(); i++)
		threads[i]->reset();
	runs = 0;


	if(ponder && root.outcome < 0)
		start_threads();
}

// Assembly:
subq $0x7a8, %rsp            # imm = 0x7A8
movq %rdi, 0x7a0(%rsp)
vmovsd %xmm0, 0x798(%rsp)
movq %rsi, 0x790(%rsp)
movl %edx, 0x78c(%rsp)
movq 0x7a0(%rsp), %rdi
movq %rdi, 0x90(%rsp)
vpxor %xmm0, %xmm0, %xmm0
vmovsd %xmm0, 0xb60(%rdi)
addq $0x80, %rdi
callq 0x17190
movq 0x90(%rsp), %rdi
movzbl %al, %eax
movl %eax, 0x788(%rsp)
addq $0x80, %rdi
callq 0x15fb0
movsbl %al, %eax
cmpl $0x0, %eax
jge 0x292af
vpxor %xmm0, %xmm0, %xmm0
vucomisd 0x798(%rsp), %xmm0
jb 0x292b4
cmpq $0x0, 0x790(%rsp)
jne 0x292b4
jmp 0x2aa72
leaq 0x780(%rsp), %rdi
callq 0x5500
movq 0x90(%rsp), %rdi
callq 0x2aaa0
movq 0x90(%rsp), %rax
cmpq $0x0, 0xe0(%rax)
je 0x293e8
movq 0x90(%rsp), %rax
movq 0xe0(%rax), %rsi
leaq 0x720(%rsp), %rdi
movq %rdi, 0x88(%rsp)
callq 0x161a0
movq 0x88(%rsp), %rdx
leaq 0x17389(%rip), %rsi     # 0x406a0
leaq 0x740(%rsp), %rdi
callq 0xe5f0
jmp 0x29326
leaq 0x1737d(%rip), %rdx     # 0x406aa
leaq 0x760(%rsp), %rdi
leaq 0x740(%rsp), %rsi
callq 0x93b0
jmp 0x29344
leaq 0x760(%rsp), %rdi
callq 0x15ad0
jmp 0x29353
leaq 0x760(%rsp), %rdi
callq 0x4210
leaq 0x740(%rsp), %rdi
callq 0x4210
leaq 0x720(%rsp), %rdi
callq 0x4210
jmp 0x293e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x293d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x293c9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x760(%rsp), %rdi
callq 0x4210
leaq 0x740(%rsp), %rdi
callq 0x4210
leaq 0x720(%rsp), %rdi
callq 0x4210
jmp 0x2aa87
movq 0x90(%rsp), %rax
movq $0x0, 0xe0(%rax)
movq 0x790(%rsp), %rcx
movq %rcx, 0xe8(%rax)
movl $0x0, 0x710(%rsp)
movq 0x90(%rsp), %rdi
movl 0x710(%rsp), %eax
movq %rax, 0x80(%rsp)
addq $0xa88, %rdi            # imm = 0xA88
callq 0x2cd30
movq %rax, %rcx
movq 0x80(%rsp), %rax
cmpq %rcx, %rax
jae 0x29480
movq 0x90(%rsp), %rdi
addq $0xa88, %rdi            # imm = 0xA88
movl 0x710(%rsp), %eax
movl %eax, %esi
callq 0x2cd50
movq (%rax), %rdi
callq 0x2cd70
movl 0x710(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x710(%rsp)
jmp 0x29415
movq 0x90(%rsp), %rdi
callq 0x2ab40
leaq 0x70c(%rsp), %rdi
callq 0x2cde0
vmovsd 0x798(%rsp), %xmm0
vpxor %xmm1, %xmm1, %xmm1
vucomisd %xmm1, %xmm0
jbe 0x295cb
vmovsd 0x798(%rsp), %xmm0
vmovsd %xmm0, 0x78(%rsp)
leaq 0x700(%rsp), %rdi
callq 0x5500
jmp 0x294cf
leaq 0x700(%rsp), %rdi
leaq 0x780(%rsp), %rsi
callq 0x116e0
vmovsd %xmm0, 0x70(%rsp)
jmp 0x294ec
movq 0x90(%rsp), %rax
vmovsd 0x78(%rsp), %xmm0
vmovsd 0x70(%rsp), %xmm1
vsubsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, 0x68(%rsp)
movq $0x0, 0x6c0(%rsp)
movq $0x59, 0x6b8(%rsp)
movq %rax, 0x6b0(%rsp)
leaq 0x6c8(%rsp), %rdi
leaq 0x6b8(%rsp), %rsi
leaq 0x6b0(%rsp), %rdx
callq 0x2ceb0
jmp 0x29549
leaq 0x6e0(%rsp), %rdi
leaq 0x6c8(%rsp), %rsi
callq 0x2cef0
jmp 0x29560
vmovsd 0x68(%rsp), %xmm0
leaq 0x70c(%rsp), %rdi
leaq 0x6e0(%rsp), %rsi
callq 0x2ce00
jmp 0x2957d
leaq 0x6e0(%rsp), %rdi
callq 0x114c0
jmp 0x295cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2aa7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x6e0(%rsp), %rdi
callq 0x114c0
jmp 0x2aa7a
movq 0x90(%rsp), %rdi
addq $0xaa0, %rdi            # imm = 0xAA0
callq 0x2c5d0
jmp 0x295e1
movq 0x90(%rsp), %rdi
addq $0xa80, %rdi            # imm = 0xA80
movl $0x6, 0x6ac(%rsp)
movl $0x1, 0x6a8(%rsp)
leaq 0x6ac(%rsp), %rsi
leaq 0x6a8(%rsp), %rdx
callq 0x2c6b0
jmp 0x2961d
movq 0x90(%rsp), %rax
movl 0xa80(%rax), %eax
cmpl $0x1, %eax
jne 0x29632
jmp 0x29651
leaq 0x17078(%rip), %rdi     # 0x406b1
leaq 0x17092(%rip), %rsi     # 0x406d2
movl $0x67, %edx
leaq 0x17094(%rip), %rcx     # 0x406e0
callq 0x4250
leaq 0x6a0(%rsp), %rdi
callq 0x5500
jmp 0x29660
leaq 0x6a0(%rsp), %rdi
leaq 0x780(%rsp), %rsi
callq 0x116e0
vmovsd %xmm0, 0x60(%rsp)
jmp 0x2967d
movq 0x90(%rsp), %rax
vmovsd 0x60(%rsp), %xmm0
vmovsd %xmm0, 0xb60(%rax)
cmpl $0x0, 0x78c(%rsp)
je 0x2a9b3
leaq 0x680(%rsp), %rdi
callq 0x2cfa0
jmp 0x296b0
leaq 0x660(%rsp), %rdi
callq 0x2cfa0
jmp 0x296bf
leaq 0x640(%rsp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x41c0
movl $0x0, 0x63c(%rsp)
movq 0x90(%rsp), %rdi
movl 0x63c(%rsp), %eax
movq %rax, 0x58(%rsp)
addq $0xa88, %rdi            # imm = 0xA88
callq 0x2cd30
movq %rax, %rcx
movq 0x58(%rsp), %rax
cmpq %rcx, %rax
jae 0x29803
movq 0x90(%rsp), %rdi
addq $0xa88, %rdi            # imm = 0xA88
movl 0x63c(%rsp), %eax
movl %eax, %esi
callq 0x2cd50
movq (%rax), %rsi
addq $0x98, %rsi
leaq 0x680(%rsp), %rdi
callq 0x2cfb0
jmp 0x29745
movq 0x90(%rsp), %rdi
addq $0xa88, %rdi            # imm = 0xA88
movl 0x63c(%rsp), %eax
movl %eax, %esi
callq 0x2cd50
movq (%rax), %rsi
addq $0x78, %rsi
leaq 0x660(%rsp), %rdi
callq 0x2cfb0
jmp 0x29778
movl $0x0, 0x638(%rsp)
cmpl $0x4, 0x638(%rsp)
jge 0x297eb
movq 0x90(%rsp), %rdi
addq $0xa88, %rdi            # imm = 0xA88
movl 0x63c(%rsp), %eax
movl %eax, %esi
callq 0x2cd50
movq (%rax), %rax
movslq 0x638(%rsp), %rcx
vmovsd 0xb8(%rax,%rcx,8), %xmm0
movslq 0x638(%rsp), %rax
vaddsd 0x640(%rsp,%rax,8), %xmm0, %xmm0
vmovsd %xmm0, 0x640(%rsp,%rax,8)
movl 0x638(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x638(%rsp)
jmp 0x29783
jmp 0x297ed
movl 0x63c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x63c(%rsp)
jmp 0x296de
movq 0x90(%rsp), %rax
movq 0xe0(%rax), %rsi
leaq 0x558(%rsp), %rdi
callq 0x161a0
jmp 0x29821
leaq 0x16eee(%rip), %rsi     # 0x40716
leaq 0x578(%rsp), %rdi
leaq 0x558(%rsp), %rdx
callq 0xe5f0
jmp 0x2983f
leaq 0x16ede(%rip), %rdx     # 0x40724
leaq 0x598(%rsp), %rdi
leaq 0x578(%rsp), %rsi
callq 0x93b0
jmp 0x2985d
movq 0x90(%rsp), %rax
vmovsd 0xb60(%rax), %xmm0
vmovsd 0x1379b(%rip), %xmm1    # 0x3d010
vmulsd %xmm1, %xmm0, %xmm0
leaq 0x538(%rsp), %rdi
xorl %esi, %esi
callq 0x1e870
jmp 0x2988a
leaq 0x5b8(%rsp), %rdi
leaq 0x598(%rsp), %rsi
leaq 0x538(%rsp), %rdx
callq 0xe470
jmp 0x298a9
leaq 0x16e7e(%rip), %rdx     # 0x4072e
leaq 0x5d8(%rsp), %rdi
leaq 0x5b8(%rsp), %rsi
callq 0x93b0
jmp 0x298c7
movq 0x90(%rsp), %rax
vcvtusi2sdq 0xe0(%rax), %xmm0, %xmm0
vmovsd 0xb60(%rax), %xmm1
vdivsd %xmm1, %xmm0, %xmm0
leaq 0x518(%rsp), %rdi
xorl %esi, %esi
callq 0x1e870
jmp 0x298f3
leaq 0x5f8(%rsp), %rdi
leaq 0x5d8(%rsp), %rsi
leaq 0x518(%rsp), %rdx
callq 0xe470
jmp 0x29912
leaq 0x16e1d(%rip), %rdx     # 0x40736
leaq 0x618(%rsp), %rdi
leaq 0x5f8(%rsp), %rsi
callq 0x93b0
jmp 0x29930
leaq 0x618(%rsp), %rdi
callq 0x15ad0
jmp 0x2993f
leaq 0x618(%rsp), %rdi
callq 0x4210
leaq 0x5f8(%rsp), %rdi
callq 0x4210
leaq 0x518(%rsp), %rdi
callq 0x4210
leaq 0x5d8(%rsp), %rdi
callq 0x4210
leaq 0x5b8(%rsp), %rdi
callq 0x4210
leaq 0x538(%rsp), %rdi
callq 0x4210
leaq 0x598(%rsp), %rdi
callq 0x4210
leaq 0x578(%rsp), %rdi
callq 0x4210
leaq 0x558(%rsp), %rdi
callq 0x4210
movq 0x90(%rsp), %rax
cmpq $0x0, 0xe0(%rax)
jbe 0x2a0eb
leaq 0x4b8(%rsp), %rdi
leaq 0x680(%rsp), %rsi
callq 0x2d040
jmp 0x299e1
leaq 0x16d58(%rip), %rsi     # 0x40740
leaq 0x4d8(%rsp), %rdi
leaq 0x4b8(%rsp), %rdx
callq 0xe5f0
jmp 0x299ff
leaq 0x140aa(%rip), %rdx     # 0x3dab0
leaq 0x4f8(%rsp), %rdi
leaq 0x4d8(%rsp), %rsi
callq 0x93b0
jmp 0x29a1d
leaq 0x4f8(%rsp), %rdi
callq 0x15ad0
jmp 0x29a2c
leaq 0x4f8(%rsp), %rdi
callq 0x4210
leaq 0x4d8(%rsp), %rdi
callq 0x4210
leaq 0x4b8(%rsp), %rdi
callq 0x4210
leaq 0x458(%rsp), %rdi
leaq 0x660(%rsp), %rsi
callq 0x2d040
jmp 0x29a6a
leaq 0x16cdd(%rip), %rsi     # 0x4074e
leaq 0x478(%rsp), %rdi
leaq 0x458(%rsp), %rdx
callq 0xe5f0
jmp 0x29a88
leaq 0x14021(%rip), %rdx     # 0x3dab0
leaq 0x498(%rsp), %rdi
leaq 0x478(%rsp), %rsi
callq 0x93b0
jmp 0x29aa6
leaq 0x498(%rsp), %rdi
callq 0x15ad0
jmp 0x29ab5
leaq 0x498(%rsp), %rdi
callq 0x4210
leaq 0x478(%rsp), %rdi
callq 0x4210
leaq 0x458(%rsp), %rdi
callq 0x4210
movq 0x90(%rsp), %rax
testb $0x1, 0x48(%rax)
je 0x2a0e9
vmovsd 0x640(%rsp), %xmm0
leaq 0x338(%rsp), %rdi
movl $0x3, %esi
callq 0x1e870
jmp 0x29b0b
leaq 0x16c4a(%rip), %rsi     # 0x4075c
leaq 0x358(%rsp), %rdi
leaq 0x338(%rsp), %rdx
callq 0xe5f0
jmp 0x29b29
leaq 0x17e34(%rip), %rdx     # 0x41964
leaq 0x378(%rsp), %rdi
leaq 0x358(%rsp), %rsi
callq 0x93b0
jmp 0x29b47
vmovsd 0x648(%rsp), %xmm0
leaq 0x318(%rsp), %rdi
movl $0x3, %esi
callq 0x1e870
jmp 0x29b64
leaq 0x398(%rsp), %rdi
leaq 0x378(%rsp), %rsi
leaq 0x318(%rsp), %rdx
callq 0xe470
jmp 0x29b83
leaq 0x17dda(%rip), %rdx     # 0x41964
leaq 0x3b8(%rsp), %rdi
leaq 0x398(%rsp), %rsi
callq 0x93b0
jmp 0x29ba1
vmovsd 0x650(%rsp), %xmm0
leaq 0x2f8(%rsp), %rdi
movl $0x3, %esi
callq 0x1e870
jmp 0x29bbe
leaq 0x3d8(%rsp), %rdi
leaq 0x3b8(%rsp), %rsi
leaq 0x2f8(%rsp), %rdx
callq 0xe470
jmp 0x29bdd
leaq 0x17d80(%rip), %rdx     # 0x41964
leaq 0x3f8(%rsp), %rdi
leaq 0x3d8(%rsp), %rsi
callq 0x93b0
jmp 0x29bfb
vmovsd 0x658(%rsp), %xmm0
leaq 0x2d8(%rsp), %rdi
movl $0x3, %esi
callq 0x1e870
jmp 0x29c18
leaq 0x418(%rsp), %rdi
leaq 0x3f8(%rsp), %rsi
leaq 0x2d8(%rsp), %rdx
callq 0xe470
jmp 0x29c37
leaq 0x13e72(%rip), %rdx     # 0x3dab0
leaq 0x438(%rsp), %rdi
leaq 0x418(%rsp), %rsi
callq 0x93b0
jmp 0x29c55
leaq 0x438(%rsp), %rdi
callq 0x15ad0
jmp 0x29c64
leaq 0x438(%rsp), %rdi
callq 0x4210
leaq 0x418(%rsp), %rdi
callq 0x4210
leaq 0x2d8(%rsp), %rdi
callq 0x4210
leaq 0x3f8(%rsp), %rdi
callq 0x4210
leaq 0x3d8(%rsp), %rdi
callq 0x4210
leaq 0x2f8(%rsp), %rdi
callq 0x4210
leaq 0x3b8(%rsp), %rdi
callq 0x4210
leaq 0x398(%rsp), %rdi
callq 0x4210
leaq 0x318(%rsp), %rdi
callq 0x4210
leaq 0x378(%rsp), %rdi
callq 0x4210
leaq 0x358(%rsp), %rdi
callq 0x4210
leaq 0x338(%rsp), %rdi
callq 0x4210
jmp 0x2a0e9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29e40
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29e33
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29e26
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29e19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29e0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29dff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29df2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29de5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x618(%rsp), %rdi
callq 0x4210
leaq 0x5f8(%rsp), %rdi
callq 0x4210
leaq 0x518(%rsp), %rdi
callq 0x4210
leaq 0x5d8(%rsp), %rdi
callq 0x4210
leaq 0x5b8(%rsp), %rdi
callq 0x4210
leaq 0x538(%rsp), %rdi
callq 0x4210
leaq 0x598(%rsp), %rdi
callq 0x4210
leaq 0x578(%rsp), %rdi
callq 0x4210
leaq 0x558(%rsp), %rdi
callq 0x4210
jmp 0x2aa7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29eac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29e9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x4f8(%rsp), %rdi
callq 0x4210
leaq 0x4d8(%rsp), %rdi
callq 0x4210
leaq 0x4b8(%rsp), %rdi
callq 0x4210
jmp 0x2aa7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29f18
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x29f0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x498(%rsp), %rdi
callq 0x4210
leaq 0x478(%rsp), %rdi
callq 0x4210
leaq 0x458(%rsp), %rdi
callq 0x4210
jmp 0x2aa7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a0d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a0ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a0bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a0b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a0a3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a096
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a089
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a07c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a06f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a062
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a055
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x438(%rsp), %rdi
callq 0x4210
leaq 0x418(%rsp), %rdi
callq 0x4210
leaq 0x2d8(%rsp), %rdi
callq 0x4210
leaq 0x3f8(%rsp), %rdi
callq 0x4210
leaq 0x3d8(%rsp), %rdi
callq 0x4210
leaq 0x2f8(%rsp), %rdi
callq 0x4210
leaq 0x3b8(%rsp), %rdi
callq 0x4210
leaq 0x398(%rsp), %rdi
callq 0x4210
leaq 0x318(%rsp), %rdi
callq 0x4210
leaq 0x378(%rsp), %rdi
callq 0x4210
leaq 0x358(%rsp), %rdi
callq 0x4210
leaq 0x338(%rsp), %rdi
callq 0x4210
jmp 0x2aa7a
jmp 0x2a0eb
movq 0x90(%rsp), %rax
movsbl 0xba(%rax), %eax
cmpl $-0x3, %eax
je 0x2a633
leaq 0x2b7(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x4670
movq 0x50(%rsp), %rdx
leaq 0x16649(%rip), %rsi     # 0x4076a
leaq 0x2b8(%rsp), %rdi
callq 0x44d0
jmp 0x2a130
leaq 0x2b8(%rsp), %rdi
callq 0x15ad0
jmp 0x2a13f
leaq 0x2b8(%rsp), %rdi
callq 0x4210
leaq 0x2b7(%rsp), %rdi
callq 0x43f0
movq 0x90(%rsp), %rax
movsbl 0xba(%rax), %eax
cmpl $0x0, %eax
jne 0x2a25e
leaq 0x28f(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0x4670
movq 0x48(%rsp), %rdx
leaq 0x1660f(%rip), %rsi     # 0x4079e
leaq 0x290(%rsp), %rdi
callq 0x44d0
jmp 0x2a19e
leaq 0x290(%rsp), %rdi
callq 0x15ad0
jmp 0x2a1ad
leaq 0x290(%rsp), %rdi
callq 0x4210
leaq 0x28f(%rsp), %rdi
callq 0x43f0
jmp 0x2a631
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a203
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x2b8(%rsp), %rdi
callq 0x4210
leaq 0x2b7(%rsp), %rdi
callq 0x43f0
jmp 0x2aa7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a24c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x290(%rsp), %rdi
callq 0x4210
leaq 0x28f(%rsp), %rdi
callq 0x43f0
jmp 0x2aa7a
movq 0x90(%rsp), %rax
movsbl 0xba(%rax), %eax
cmpl $0x3, %eax
jne 0x2a31a
leaq 0x267(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x4670
movq 0x40(%rsp), %rdx
leaq 0x164e3(%rip), %rsi     # 0x40777
leaq 0x268(%rsp), %rdi
callq 0x44d0
jmp 0x2a2a3
leaq 0x268(%rsp), %rdi
callq 0x15ad0
jmp 0x2a2b2
leaq 0x268(%rsp), %rdi
callq 0x4210
leaq 0x267(%rsp), %rdi
callq 0x43f0
jmp 0x2a62f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a308
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x268(%rsp), %rdi
callq 0x4210
leaq 0x267(%rsp), %rdi
callq 0x43f0
jmp 0x2aa7a
movq 0x90(%rsp), %rax
movsbl 0xba(%rax), %eax
cmpl 0x788(%rsp), %eax
jne 0x2a3da
leaq 0x23f(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x4670
movq 0x38(%rsp), %rdx
leaq 0x16438(%rip), %rsi     # 0x4078c
leaq 0x240(%rsp), %rdi
callq 0x44d0
jmp 0x2a363
leaq 0x240(%rsp), %rdi
callq 0x15ad0
jmp 0x2a372
leaq 0x240(%rsp), %rdi
callq 0x4210
leaq 0x23f(%rsp), %rdi
callq 0x43f0
jmp 0x2a62d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a3c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x240(%rsp), %rdi
callq 0x4210
leaq 0x23f(%rsp), %rdi
callq 0x43f0
jmp 0x2aa7a
movq 0x90(%rsp), %rax
movsbl 0xba(%rax), %eax
movl $0x3, %ecx
subl 0x788(%rsp), %ecx
cmpl %ecx, %eax
jne 0x2a4a1
leaq 0x217(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x4670
movq 0x30(%rsp), %rdx
leaq 0x16376(%rip), %rsi     # 0x40791
leaq 0x218(%rsp), %rdi
callq 0x44d0
jmp 0x2a42a
leaq 0x218(%rsp), %rdi
callq 0x15ad0
jmp 0x2a439
leaq 0x218(%rsp), %rdi
callq 0x4210
leaq 0x217(%rsp), %rdi
callq 0x43f0
jmp 0x2a62b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a48f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x218(%rsp), %rdi
callq 0x4210
leaq 0x217(%rsp), %rdi
callq 0x43f0
jmp 0x2aa7a
movq 0x90(%rsp), %rax
movsbl 0xba(%rax), %eax
xorl %ecx, %ecx
subl 0x788(%rsp), %ecx
cmpl %ecx, %eax
jne 0x2a565
leaq 0x1ef(%rsp), %rdi
movq %rdi, 0x28(%rsp)
callq 0x4670
movq 0x28(%rsp), %rdx
leaq 0x162b8(%rip), %rsi     # 0x40797
leaq 0x1f0(%rsp), %rdi
callq 0x44d0
jmp 0x2a4ee
leaq 0x1f0(%rsp), %rdi
callq 0x15ad0
jmp 0x2a4fd
leaq 0x1f0(%rsp), %rdi
callq 0x4210
leaq 0x1ef(%rsp), %rdi
callq 0x43f0
jmp 0x2a629
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a553
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x1f0(%rsp), %rdi
callq 0x4210
leaq 0x1ef(%rsp), %rdi
callq 0x43f0
jmp 0x2aa7a
movq 0x90(%rsp), %rax
movsbl 0xba(%rax), %eax
movl 0x788(%rsp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jne 0x2a627
leaq 0x1c7(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0x4670
movq 0x20(%rsp), %rdx
leaq 0x16200(%rip), %rsi     # 0x407a4
leaq 0x1c8(%rsp), %rdi
callq 0x44d0
jmp 0x2a5b3
leaq 0x1c8(%rsp), %rdi
callq 0x15ad0
jmp 0x2a5c2
leaq 0x1c8(%rsp), %rdi
callq 0x4210
leaq 0x1c7(%rsp), %rdi
callq 0x43f0
jmp 0x2a627
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a615
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0x4210
leaq 0x1c7(%rsp), %rdi
callq 0x43f0
jmp 0x2aa7a
jmp 0x2a629
jmp 0x2a62b
jmp 0x2a62d
jmp 0x2a62f
jmp 0x2a631
jmp 0x2a633
movq 0x90(%rsp), %rsi
movq (%rsi), %rax
movq 0x40(%rax), %rax
leaq 0x1a8(%rsp), %rdi
callq *%rax
jmp 0x2a64e
leaq 0x188(%rsp), %rdi
callq 0x44e0
leaq 0x1a8(%rsp), %rdi
callq 0x176e0
movq %rax, 0x180(%rsp)
leaq 0x1a8(%rsp), %rdi
callq 0x17560
movq %rax, 0x178(%rsp)
leaq 0x180(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x2d4b0
testb $0x1, %al
jne 0x2a6a3
jmp 0x2a787
leaq 0x180(%rsp), %rdi
callq 0x2d4f0
movq %rax, %rsi
leaq 0x138(%rsp), %rdi
xorl %edx, %edx
callq 0xdec0
jmp 0x2a6c4
leaq 0x160f2(%rip), %rsi     # 0x407bd
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rdx
callq 0xe5f0
jmp 0x2a6e2
leaq 0x188(%rsp), %rdi
leaq 0x158(%rsp), %rsi
callq 0x4490
jmp 0x2a6f9
leaq 0x158(%rsp), %rdi
callq 0x4210
leaq 0x138(%rsp), %rdi
callq 0x4210
leaq 0x180(%rsp), %rdi
callq 0x2d500
jmp 0x2a670
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a994
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a775
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x158(%rsp), %rdi
callq 0x4210
leaq 0x138(%rsp), %rdi
callq 0x4210
jmp 0x2a994
leaq 0x16024(%rip), %rsi     # 0x407b2
leaq 0xf8(%rsp), %rdi
leaq 0x188(%rsp), %rdx
callq 0x9440
jmp 0x2a7a5
leaq 0x13304(%rip), %rdx     # 0x3dab0
leaq 0x118(%rsp), %rdi
leaq 0xf8(%rsp), %rsi
callq 0x93b0
jmp 0x2a7c3
leaq 0x118(%rsp), %rdi
callq 0x15ad0
jmp 0x2a7d2
leaq 0x118(%rsp), %rdi
callq 0x4210
leaq 0xf8(%rsp), %rdi
callq 0x4210
cmpl $0x3, 0x78c(%rsp)
jl 0x2a978
movq 0x90(%rsp), %rdi
addq $0xc8, %rdi
callq 0x2d520
movb %al, 0x1f(%rsp)
jmp 0x2a814
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x2a978
jmp 0x2a822
vpxor %xmm0, %xmm0, %xmm0
vmovdqa %xmm0, 0xa0(%rsp)
movq $0x0, 0xb0(%rsp)
leaq 0xa0(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0xcea0
movq 0x90(%rsp), %rsi
movq 0x10(%rsp), %rdx
movq (%rsi), %rax
movq 0x48(%rax), %rax
leaq 0xb8(%rsp), %rdi
callq *%rax
jmp 0x2a86d
leaq 0x15f4b(%rip), %rsi     # 0x407bf
leaq 0xd8(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0xe5f0
jmp 0x2a88b
leaq 0xd8(%rsp), %rdi
callq 0x15ad0
jmp 0x2a89a
leaq 0xd8(%rsp), %rdi
callq 0x4210
leaq 0xb8(%rsp), %rdi
callq 0x4210
leaq 0xa0(%rsp), %rdi
callq 0xfb50
jmp 0x2a978
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a8fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0x118(%rsp), %rdi
callq 0x4210
leaq 0xf8(%rsp), %rdi
callq 0x4210
jmp 0x2a994
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a969
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
jmp 0x2a95c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x718(%rsp)
movl %eax, 0x714(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x4210
leaq 0xb8(%rsp), %rdi
callq 0x4210
leaq 0xa0(%rsp), %rdi
callq 0xfb50
jmp 0x2a994
leaq 0x188(%rsp), %rdi
callq 0x4210
leaq 0x1a8(%rsp), %rdi
callq 0xfb50
jmp 0x2a9b3
leaq 0x188(%rsp), %rdi
callq 0x4210
leaq 0x1a8(%rsp), %rdi
callq 0xfb50
jmp 0x2aa7a
movl $0x0, 0x9c(%rsp)
movq 0x90(%rsp), %rdi
movl 0x9c(%rsp), %eax
movq %rax, 0x8(%rsp)
addq $0xa88, %rdi            # imm = 0xA88
callq 0x2cd30
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x2aa27
movq 0x90(%rsp), %rdi
addq $0xa88, %rdi            # imm = 0xA88
movl 0x9c(%rsp), %eax
movl %eax, %esi
callq 0x2cd50
movq (%rax), %rdi
callq 0x2cd70
jmp 0x2aa12
jmp 0x2aa14
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x2a9be
movq 0x90(%rsp), %rax
movq $0x0, 0xe0(%rax)
testb $0x1, 0x38(%rax)
je 0x2aa65
movq 0x90(%rsp), %rax
movsbl 0xba(%rax), %eax
cmpl $0x0, %eax
jge 0x2aa65
movq 0x90(%rsp), %rdi
callq 0x2ab40
jmp 0x2aa63
jmp 0x2aa65
leaq 0x70c(%rsp), %rdi
callq 0x2d540
addq $0x7a8, %rsp            # imm = 0x7A8
retq
leaq 0x70c(%rsp), %rdi
callq 0x2d540
movq 0x718(%rsp), %rdi
callq 0x4660
nopw %cs:(%rax,%rax)