// File: /workspace/github_cpp_makefile_star2_O3/essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: player_turn(actor*)
void player_turn(actor* a)
{
	update_map_seen();
	//draw_scene(true);
	int turn = -1;
	while(turn)
	{
		draw_scene(true);
		int kp;
		if(!forcefed_help)
		{
			kp = '?';
			//forcefed_help = true;
		}
		else
		{
			kp = fgetch();
		}
		switch(kp)
		{
		case KEY_UP: case 'k': case '8': case KEY_A2:
			turn = move_actor(a,0,-1); break;
		case KEY_DOWN: case 'j':case '2': case KEY_C2:
			turn = move_actor(a,0,1); break;
		case KEY_LEFT: case 'h': case '4': case KEY_B1:
			turn = move_actor(a,-1,0); break;
		case KEY_RIGHT: case 'l': case '6': case KEY_B3:
			turn = move_actor(a,1,0); break;
		case 'y':case '7': case KEY_A1:
			turn = move_actor(a,-1,-1); break;
		case 'u':case '9': case KEY_A3:
			turn = move_actor(a,1,-1); break;
		case 'b':case '1': case KEY_C1:
			turn = move_actor(a,-1,1); break;
		case 'n':case '3': case KEY_C3:
			turn = move_actor(a,1,1); break;
		case '.': case '5': case KEY_B2:
			turn = 0; break;
		case '?':
			{
				int kp = '?';
				int page = 0;
				while(kp == '?')
				{
					switch(page)
				{
					case 4:
					page = 0;
					case 0:
				pretty_print
				(
				/*"01234567890123456789012345678901234567890123456789"*/
				  "                                                  "
				  "      Find and destroy the radio transmitter      "
				  "            so that you can escape!               "
				  "                                                  "
				  "Movement: y/7  k/8  u/9  Fire:             f      "
				  "hjklyubn     \\  |  /     Throw:            t      "
				  "42867913      \\ | /      Run:              R      "
				  "          h/4--5/.--l/6  Check radio:      r      "
				  "              / | \\      Wield pistol      X      "
				  "             /  |  \\     Wield rifle       Y      "
				  "          b/1  j/2  n/3  Wield cannon      Z      "
				  "                         Mute advice       M      "
				  "                         Close ship doors  C      "
				  "               fire or //Autotarget:     tab      "
				  "               throw   ||Manual target: movement  "
				  "               mode    \\\\Info on tile:     i      "
				  "                         Quit game:        Q      "
				  "                         See this help:    ?      "
				  "                                                  "
				  "        Press ? again for more info.              "
				  "   You might also want to read the README.        "
				  "                                                  "
				); break;
				case 1:
				pretty_print
					(
				/*"01234567890123456789012345678901234567890123456789"*/
				  "Your guns:                           f to fire    "
				  " Pistol (low damage),                             "
				  " Rifle (med damage),                              "
				  " Cannon (high splash damage)                      "
				  "Your devices:                        t to throw   "
				  " Low explosives (rad. 2),                         "
				  " High explosives (rad. 4),                        "
				  " Distractions:                                    "
				  "  Hologram (C), Noise (D), Scent (E),             "
				  "  Brain slice (F) (for psychic aliens)            "
				  " Set a timer from 0 to 9 when throwing.           "
				  " All of these have very useful spy cameras.       "
				  "                                                  "
				  "       Press ? again for more info.               "
				  "                                                  "
					);break;
				case 2: pretty_print
			(
				/*"01234567890123456789012345678901234567890123456789"*/
				  "Monster memory:                                   "
				  "No-one has seen this planet or these aliens       "
				  "before and lived to tell the tale.                "
				  "To survive, you keep a note of your observations  "
				  "In the status panel.                              "
				  "The first column is size (small, medium, huge),   "
				  "The second is walk speed (slow, average, fast)    "
				  "   (relative to your walk speed)                  "
				  "The third is max run speed (slow, average, fast)  "
				  "   (relative to your max run speed)               "
				  "   (as stamina runs out, you get slower)          "
				  "The fourth is damage (weak, strong, dangerous)    "
				  "The last is health (frail or tough)               "
				  "Frail aliens are very easy to kill.               "
				  "Some tough aliens are easier to kill than others  "
				  "                                                  "
				  "     Press ? again for more info.                 "
				  "                                                  "
			);break;
				case 3:
					pretty_print
			(
				/*"01234567890123456789012345678901234567890123456789"*/
				  " Your ship is claiming, despite the surrounding   "
				  "   trees and hostile aliens, to be safely docked "
				  "    at a space station.                           "
				  "  You need to fix this malfunction and get off    "
				  "    this planet.                                  "
				  "  The ship uses automated radio signals to dock,  "
				  "    so there must be a radio transmitter here.    "
				  "  You can use your portable radio to try to find  "
				  "    the source of the transmissions,              "
				  "    then disable it with explosives and escape.   "
				  "                                                  "
				  "       Press ? again for more info.               "
				  "                                                  "
			);break;
				}
				page++;
				kp = fgetch();
				draw_scene();
				//clear_area(0,0,viewport_width,message_area_height+1);
				if(!forcefed_help && page != 4)
				{
					kp = '?';
					if(page == 3) {forcefed_help = true;}
				}
				}
			}break;
		case 'X':
			if(current_weapon != PISTOL) {turn = 0; add_message("You wield your pistol."); current_weapon = PISTOL;} break;
		case 'Y':
			if(current_weapon != RIFLE) {turn = 0; add_message("You wield your automatic rifle!"); current_weapon = RIFLE;} break;
		case 'Z':
			if(current_weapon != CANNON) {turn = 0; add_message("You get out the plasma cannon!!"); current_weapon = CANNON;} break;
		case 'r':
			turn = 0; add_message(signal_receive(p_ptr->x,p_ptr->y)); /*draw_last_msg();*/ break;
		case 'g':
			if(count_inv_devices(BRAIN_SLICE) > 0)
			{
				add_message("You wash a brain slice with Tx-PBS three times with gentle shaking.");
				draw_last_msg();
			}
			break;
		case 'Q':
			pretty_print("Are you sure you want to quit? press Y if you are.");
			if(fgetch() == 'Y')
			{
				endwin();
				exit(0);
			}
			break;
		case 'd':break;
			debug = !debug; break;
		case ' ':
			last_message_seen = rlmessages.size();
			last_word_seen  = rlmessage_words.size()-1;
			draw_last_msg(); break;
		case 'R':
			p_ptr->running = !p_ptr->running; draw_stats(); break;
		case 't':
			{

				current_mode = THROW_MODE;
				draw_scene();
				
				int tab_ind = autotarget();
				int lx = current_target->x; int ly = current_target->y;
				item* dev = select_individual_device();
				//item* dev = dev_inv[device_type][UNCONFIGURED].back();
				int t = ask_for_time();
				if(dev == NULL) break;
			while(current_mode==THROW_MODE)
			{
				draw_scene();
				draw_tile_description(lx,ly);
				draw_line(p_ptr->x,p_ptr->y,lx,ly,'*');
				clear_area(0,0,viewport_width,1);
				attron(COLOR_PAIR(COLOR_WHITE));
				mvaddstr(0,0,"Tab or movement to target, t to throw");
				int kpp = fgetch();
				undraw_line(p_ptr->x,p_ptr->y,lx,ly);
				undraw_tile_description();
				switch(kpp)
				{
				case '\t':
					if(visible_actors.size() > 0)
					{
						tab_ind = (tab_ind + 1)%visible_actors.size();
						lx = visible_actors[tab_ind]->x;
						ly = visible_actors[tab_ind]->y;
					}
					break;
				case KEY_UP: case 'k': case '8': case KEY_A2:
					ly = std::max(ly-1,viewport_top_edge()); break;
				case KEY_DOWN: case 'j': case '2': case KEY_C2:
					ly = std::min(ly+1,viewport_bottom_edge()); break;
				case KEY_LEFT: case 'h': case '4': case KEY_B1:
					lx = std::max(lx-1,viewport_left_edge()); break;
				case KEY_RIGHT: case 'l': case '6': case KEY_B3:
					lx = std::min(lx+1,viewport_right_edge()); break;
				case 'y': case '7': case KEY_A1:
					lx = std::max(lx-1,viewport_left_edge()); ly = std::max(ly-1,viewport_top_edge()); break;
				case 'u': case '9': case KEY_A3:
					lx = std::min(lx+1,viewport_right_edge()); ly = std::max(ly-1,viewport_top_edge()); break;
				case 'b': case '1': case KEY_C1:
					lx = std::max(lx-1,viewport_left_edge()); ly = std::min(ly+1,viewport_bottom_edge()); break;
				case 'n': case '3': case KEY_C3:
					lx = std::min(lx+1,viewport_right_edge()); ly = std::min(ly+1,viewport_bottom_edge()); break;
				case 't':
					{
						if(los_exists(p_ptr->x,p_ptr->y,lx,ly,blocks_shots))
						{
							//if(dev != NULL)
							{
								item_to_location(dev,lx,ly);
								inv_remove(dev);
								set_timer(dev,t);
								turn = 0;
								current_mode = WALK_MODE;
								dev->player_has = false;
							}
						}
						else
						{
							add_message("There's too much in the way!");
							draw_last_msg();
						}
					}
					break;
				case KEY_ESC:
					 current_mode = WALK_MODE; draw_scene(); break;
				case 'i':
					draw_info(lx,ly);
					current_mode = THROW_MODE; draw_stats();
					draw_line(p_ptr->x,p_ptr->y,lx,ly,'*');break;
				default: ;
				}
			}
			}
			break;
		case 'M':
			cycle_advice = !cycle_advice;
			draw_stats();
			break;
		case 'C':
			if(door_closable())
			{
				if(map_terrain[ship_x+2][ship_y] == DOOR)
				{
					map_terrain[ship_x+2][ship_y] = NS;
					turn = 0;
					add_message("You tell the computer to close the doors.");
					closed_doors = true;
				}
				else
				{
					add_message("Not going to open them again. No way.");
				}
			}
			else {add_message("Can't close the doors right now.");}
			break;
		case 'f':
		{
			current_mode = FIRE_MODE;
			draw_scene();
			int tab_ind = autotarget();
			int lx = current_target->x; int ly = current_target->y;
				
			
			while (current_mode == FIRE_MODE)
			{
				draw_tile_description(lx,ly);
				draw_line(p_ptr->x,p_ptr->y,lx,ly,'*');
				int kpp = fgetch();
				undraw_line(p_ptr->x,p_ptr->y,lx,ly);
				undraw_tile_description();
				
				switch(kpp)
				{
				case '\t':
					if(visible_actors.size() > 0)
					{
						tab_ind = (tab_ind + 1)%visible_actors.size();
						lx = visible_actors[tab_ind]->x;
						ly = visible_actors[tab_ind]->y;
					}
					break;
				case KEY_UP: case 'k': case '8': case KEY_A2:
					ly = std::max(ly-1,viewport_top_edge()); break;
				case KEY_DOWN: case 'j': case '2': case KEY_C2:
					ly = std::min(ly+1,viewport_bottom_edge()); break;
				case KEY_LEFT: case 'h': case '4': case KEY_B1:
					lx = std::max(lx-1,viewport_left_edge()); break;
				case KEY_RIGHT: case 'l': case '6': case KEY_B3:
					lx = std::min(lx+1,viewport_right_edge()); break;
				case 'y': case '7': case KEY_A1:
					lx = std::max(lx-1,viewport_left_edge()); ly = std::max(ly-1,viewport_top_edge()); break;
				case 'u': case '9': case KEY_A3:
					lx = std::min(lx+1,viewport_right_edge()); ly = std::max(ly-1,viewport_top_edge()); break;
				case 'b': case '1': case KEY_C1:
					lx = std::max(lx-1,viewport_left_edge()); ly = std::min(ly+1,viewport_bottom_edge()); break;
				case 'n': case '3': case KEY_C3:
					lx = std::min(lx+1,viewport_right_edge()); ly = std::min(ly+1,viewport_bottom_edge()); break;
				case 'f':
					if(ammo[current_weapon] == 0)
					{add_message("Can't fire this weapon, no ammo.");draw_last_msg();}
					else if(lx==p_ptr->x && ly==p_ptr->y)
					{
						add_message("Don't shoot yourself!");
						draw_last_msg();
					}
					else
					{
						if(fire_weapon(p_ptr->x,p_ptr->y,lx,ly))
						{
							current_mode = WALK_MODE;
							turn = 0;
						}
					}
					break;
				case KEY_ESC:
					 current_mode = WALK_MODE; 
					 draw_scene();
					 break;
				case 'i':
					draw_info(lx,ly);
					current_mode = FIRE_MODE; draw_stats();
					draw_line(p_ptr->x,p_ptr->y,lx,ly,'*');
				default:;
				}
			}
			if(map_occupants[lx][ly] != NULL)
			{
				current_target = map_occupants[lx][ly];
			}
			undraw_line(p_ptr->x,p_ptr->y,lx,ly);
			undraw_tile_description();
		}
		break;
			
		default: ;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x228, %rsp            # imm = 0x228
movq %rdi, 0x8(%rsp)
callq 0x1255b
leaq 0x50(%rsp), %r13
leaq 0x30(%rsp), %r14
movl $0xffffffff, 0x4(%rsp)  # imm = 0xFFFFFFFF
movq 0xd1c7(%rip), %rbx      # 0x20fd8
leaq 0x46c8(%rip), %r15      # 0x184e0
movq %rbx, %r12
movl $0x1, %edi
callq 0x10355
cmpb $0x1, 0xd4dc(%rip)      # 0x21308
jne 0x13e68
movq (%rbx), %rdi
callq 0x50f0
movl %eax, %ebx
callq 0x5130
cmpl $0x101, %ebx            # imm = 0x101
jg 0x13ffd
leal -0x2e(%rbx), %eax
cmpl $0x47, %eax
ja 0x140b0
leaq 0x439c(%rip), %rcx      # 0x181f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r12, %rbx
jmpq *%rax
movq %r13, %rbp
xorl %r13d, %r13d
cmpl $0x4, %r13d
ja 0x13faa
movl %r13d, %eax
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
leaq 0x198(%rsp), %rbx
movq %rbx, 0x188(%rsp)
leaq 0x188(%rsp), %r13
movq %r13, %rdi
leaq 0x57fd(%rip), %rsi      # 0x196a3
leaq 0x5c42(%rip), %rdx      # 0x19aef
callq 0x15b1a
movq %r13, %rdi
callq 0x688f
movq 0x188(%rsp), %rdi
xorl %r13d, %r13d
jmp 0x13f9d
leaq 0x138(%rsp), %rbx
movq %rbx, 0x128(%rsp)
leaq 0x128(%rsp), %r13
movq %r13, %rdi
leaq 0x6278(%rip), %rsi      # 0x1a164
leaq 0x64fa(%rip), %rdx      # 0x1a3ed
callq 0x15b1a
movq %r13, %rdi
callq 0x688f
movq 0x128(%rsp), %rdi
movl $0x3, %r13d
jmp 0x13f9d
leaq 0x178(%rsp), %rbx
movq %rbx, 0x168(%rsp)
leaq 0x168(%rsp), %r13
movq %r13, %rdi
leaq 0x5bbb(%rip), %rsi      # 0x19af0
leaq 0x5ea2(%rip), %rdx      # 0x19dde
callq 0x15b1a
movq %r13, %rdi
callq 0x688f
movq 0x168(%rsp), %rdi
movl $0x1, %r13d
jmp 0x13f9d
leaq 0x158(%rsp), %rbx
movq %rbx, 0x148(%rsp)
leaq 0x148(%rsp), %r13
movq %r13, %rdi
leaq 0x5e64(%rip), %rsi      # 0x19ddf
leaq 0x61e1(%rip), %rdx      # 0x1a163
callq 0x15b1a
movq %r13, %rdi
callq 0x688f
movq 0x148(%rsp), %rdi
movl $0x2, %r13d
cmpq %rbx, %rdi
movq %r12, %rbx
je 0x13faa
callq 0x5230
incl %r13d
movq (%rbx), %rdi
callq 0x50f0
movl %eax, %ebx
callq 0x5130
xorl %edi, %edi
callq 0x10355
cmpl $0x4, %r13d
sete %al
orb 0xd338(%rip), %al       # 0x21308
jne 0x13fe4
movl $0x3f, %ebx
cmpl $0x3, %r13d
jne 0x13fe4
movb $0x1, 0xd324(%rip)      # 0x21308
cmpl $0x3f, %ebx
movq %r12, %rbx
je 0x13e6e
movq %rbp, %r13
leaq 0x30(%rsp), %r14
jmp 0x140d9
leal -0x15c(%rbx), %eax
cmpl $0x4, %eax
jbe 0x14035
leal -0x102(%rbx), %eax
cmpl $0x3, %eax
jbe 0x14054
addl $0xfffffe3e, %ebx       # imm = 0xFFFFFE3E
cmpl $0x6, %ebx
ja 0x149e7
leaq 0x4313(%rip), %rcx      # 0x1833c
movslq (%rcx,%rbx,4), %rax
addq %rcx, %rax
movq %r12, %rbx
jmpq *%rax
leaq 0x42ec(%rip), %rcx      # 0x18328
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r12, %rbx
jmpq *%rax
movq 0x8(%rsp), %rdi
movl $0x1, %esi
jmp 0x140cb
leaq 0x42bd(%rip), %rcx      # 0x18318
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
movq %r12, %rbx
jmpq *%rax
movq 0x8(%rsp), %rdi
xorl %esi, %esi
jmp 0x140a9
movq 0x8(%rsp), %rdi
xorl %esi, %esi
jmp 0x140cb
movq 0x8(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0x1408f
movq 0x8(%rsp), %rdi
movl $0x1, %esi
xorl %edx, %edx
jmp 0x140d0
movq 0x8(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
jmp 0x140a9
movq 0x8(%rsp), %rdi
movl $0x1, %esi
movl $0x1, %edx
jmp 0x140d0
cmpl $0x20, %ebx
je 0x149b0
cmpl $0x79, %ebx
movq %r12, %rbx
jne 0x140d9
movq 0x8(%rsp), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x10460
movl %eax, 0x4(%rsp)
cmpl $0x0, 0x4(%rsp)
jne 0x13e1b
jmp 0x14c22
cmpl $0x2, 0xd1f4(%rip)      # 0x212e4
je 0x140d9
jmp 0x14a77
movl $0x2, 0xd217(%rip)      # 0x21318
xorl %edi, %edi
callq 0x10355
callq 0x13d43
movq %rax, 0x10(%rsp)
movq 0x5a3a7(%rip), %rax     # 0x6e4c0
movl 0x20(%rax), %ebp
movl 0x24(%rax), %r13d
callq 0x13cab
movq %rax, %r14
callq 0x133dd
movq %r14, 0x60(%rsp)
testq %r14, %r14
je 0x14896
cmpl $0x2, 0xd1d6(%rip)      # 0x21318
jne 0x14896
movl %eax, 0x1c(%rsp)
xorl %edi, %edi
callq 0x10355
movl %ebp, %edi
movl %r13d, %esi
callq 0xf7e8
movq 0x5a37c(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
movl %ebp, %edx
movl %r13d, %ecx
movl $0x2a, %r8d
callq 0xfeb6
xorl %edi, %edi
xorl %esi, %esi
movl $0x31, %edx
movl $0x1, %ecx
callq 0x742a
movq (%rbx), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x5150
movq (%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5280
cmpl $-0x1, %eax
je 0x141c1
movq (%rbx), %rdi
leaq 0x6305(%rip), %rsi      # 0x1a4bc
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x50d0
movq (%rbx), %rdi
callq 0x50f0
movl %eax, %ebx
callq 0x5130
movq 0x5a309(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
movl %ebp, %edx
movl %r13d, %ecx
callq 0x1021b
callq 0xfaf4
cmpl $0x101, %ebx            # imm = 0x101
jg 0x14215
cmpl $0x61, %ebx
jg 0x1424e
leal -0x31(%rbx), %eax
cmpl $0x8, %eax
ja 0x1436a
leaq 0x414c(%rip), %rcx      # 0x18358
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal -0x102(%rbx), %eax
cmpl $0x3, %eax
jbe 0x142c7
leal -0x15c(%rbx), %eax
cmpl $0x4, %eax
jbe 0x142a5
addl $0xfffffe3e, %ebx       # imm = 0xFFFFFE3E
cmpl $0x6, %ebx
ja 0x14355
leaq 0x41bb(%rip), %rcx      # 0x18400
movslq (%rcx,%rbx,4), %rax
addq %rcx, %rax
jmpq *%rax
addl $-0x62, %ebx
cmpl $0x17, %ebx
ja 0x14355
leaq 0x411b(%rip), %rcx      # 0x1837c
movslq (%rcx,%rbx,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %ebp, %edi
movl %r13d, %esi
callq 0x105b8
movl $0x2, 0xd09a(%rip)      # 0x21318
callq 0xf035
movq 0x5a256(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
movl %ebp, %edx
movl %r13d, %ecx
movl $0x2a, %r8d
callq 0xfeb6
jmp 0x14355
leaq 0x4140(%rip), %rcx      # 0x183ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
decl %ebp
movl 0x59f23(%rip), %eax     # 0x6e1e0
addl $-0x18, %eax
cmpl %eax, %ebp
cmovlel %eax, %ebp
jmp 0x1430b
leaq 0x410e(%rip), %rcx      # 0x183dc
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
decl %ebp
movl 0x59f01(%rip), %eax     # 0x6e1e0
addl $-0x18, %eax
cmpl %eax, %ebp
cmovlel %eax, %ebp
jmp 0x14355
incl %ebp
movl 0x59eef(%rip), %eax     # 0x6e1e0
addl $0x18, %eax
cmpl %ebp, %eax
cmovll %eax, %ebp
jmp 0x14355
incl %ebp
movl 0x59edd(%rip), %eax     # 0x6e1e0
addl $0x18, %eax
cmpl %ebp, %eax
cmovll %eax, %ebp
decl %r13d
movl 0x59ed0(%rip), %eax     # 0x6e1e4
addl $-0x8, %eax
cmpl %eax, %r13d
cmovlel %eax, %r13d
jmp 0x14355
incl %ebp
movl 0x59eb8(%rip), %eax     # 0x6e1e0
addl $0x18, %eax
cmpl %ebp, %eax
cmovll %eax, %ebp
jmp 0x14342
decl %ebp
movl 0x59ea6(%rip), %eax     # 0x6e1e0
addl $-0x18, %eax
cmpl %eax, %ebp
cmovlel %eax, %ebp
incl %r13d
movl 0x59e99(%rip), %eax     # 0x6e1e4
addl $0xa, %eax
cmpl %r13d, %eax
cmovll %eax, %r13d
movq %r12, %rbx
cmpl $0x2, 0xcfb9(%rip)      # 0x21318
je 0x1414c
jmp 0x14896
cmpl $0x9, %ebx
je 0x14408
cmpl $0x1b, %ebx
jne 0x14355
movl $0x0, 0xcf96(%rip)      # 0x21318
xorl %edi, %edi
callq 0x10355
jmp 0x14355
movq 0x5a14e(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
movl %ebp, %edx
movl %r13d, %ecx
leaq -0x6fe1(%rip), %r8      # 0xd3c3
callq 0xf58f
testb %al, %al
jne 0x14bc9
movq %r12, %rbx
leaq 0x98(%rsp), %r14
movq %r14, 0x88(%rsp)
leaq 0x88(%rsp), %rdi
leaq 0x610f(%rip), %rsi      # 0x1a4e2
leaq 0x6124(%rip), %rdx      # 0x1a4fe
callq 0x15b1a
leaq 0x88(%rsp), %rdi
callq 0x5f0e
movq 0x88(%rsp), %rdi
cmpq %r14, %rdi
je 0x143fe
callq 0x5230
callq 0x74d7
jmp 0x14358
movq 0x5a0c1(%rip), %rsi     # 0x6e4d0
movq 0x5a0b2(%rip), %rcx     # 0x6e4c8
subq %rcx, %rsi
movq %r12, %rbx
je 0x14358
sarq $0x3, %rsi
movq 0x10(%rsp), %rax
incl %eax
cltq
xorl %edx, %edx
divq %rsi
movq %rdx, 0x10(%rsp)
movslq %edx, %rax
movq (%rcx,%rax,8), %rax
movl 0x20(%rax), %ebp
movl 0x24(%rax), %r13d
jmp 0x14358
movq 0x5a08d(%rip), %rax     # 0x6e4e0
xorb $0x1, 0x14(%rax)
jmp 0x148a7
callq 0xc522
testb %al, %al
je 0x149ef
movslq 0x59d8c(%rip), %rax     # 0x6e1fc
imulq $0x258, %rax, %rax      # imm = 0x258
leaq 0xcec2(%rip), %rcx      # 0x21340
addq %rcx, %rax
movslq 0x59d78(%rip), %rcx     # 0x6e200
cmpl $0x5, 0x4b0(%rax,%rcx,4)
je 0x14b6d
leaq 0x78(%rsp), %rax
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rbp
movq %rbp, %rdi
leaq 0x607a(%rip), %rsi      # 0x1a529
leaq 0x6098(%rip), %rdx      # 0x1a54e
callq 0x15b1a
movq %rbp, %rdi
callq 0x5f0e
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
jne 0x14a25
jmp 0x140d9
movl $0x1, 0xce33(%rip)      # 0x21318
xorl %edi, %edi
callq 0x10355
callq 0x13d43
movq 0x59fc8(%rip), %rcx     # 0x6e4c0
movl 0x20(%rcx), %r14d
movl 0x24(%rcx), %r13d
cmpl $0x1, 0xce11(%rip)      # 0x21318
jne 0x14852
movq %rax, 0x10(%rsp)
movl %r14d, %edi
movl %r13d, %esi
callq 0xf7e8
movq 0x59fbc(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
movl %r14d, %edx
movl %r13d, %ecx
movl $0x2a, %r8d
callq 0xfeb6
movq (%rbx), %rdi
callq 0x50f0
movl %eax, %ebx
callq 0x5130
movq 0x59f8f(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
movl %r14d, %edx
movl %r13d, %ecx
callq 0x1021b
callq 0xfaf4
cmpl $0x101, %ebx            # imm = 0x101
jg 0x145a0
cmpl $0x61, %ebx
leaq 0xb8(%rsp), %rcx
leaq 0xd8(%rsp), %rdx
jg 0x145dd
leal -0x31(%rbx), %eax
cmpl $0x8, %eax
ja 0x14748
leaq 0x3e85(%rip), %rcx      # 0x1841c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leal -0x102(%rbx), %eax
cmpl $0x3, %eax
jbe 0x14696
leal -0x15c(%rbx), %eax
cmpl $0x4, %eax
jbe 0x14671
addl $0xfffffe3e, %ebx       # imm = 0xFFFFFE3E
cmpl $0x6, %ebx
ja 0x14733
leaq 0x3ef0(%rip), %rcx      # 0x184c4
movslq (%rcx,%rbx,4), %rax
addq %rcx, %rax
jmpq *%rax
addl $-0x62, %ebx
cmpl $0x17, %ebx
ja 0x14733
leaq 0x3e50(%rip), %rsi      # 0x18440
movslq (%rsi,%rbx,4), %rax
addq %rsi, %rax
jmpq *%rax
movslq 0xcce4(%rip), %rax      # 0x212e4
leaq 0x59be1(%rip), %rsi     # 0x6e1e8
cmpl $0x0, (%rsi,%rax,4)
je 0x147e0
movq %r12, %rbx
movq 0x59ec5(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
cmpl %edi, %r14d
jne 0x1482d
cmpl %esi, %r13d
jne 0x1482d
movq %rcx, 0xa8(%rsp)
leaq 0xa8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x5f44(%rip), %rsi      # 0x1a591
leaq 0x5f52(%rip), %rdx      # 0x1a5a6
movq %rcx, %rbp
callq 0x15b1a
movq %rbx, %rdi
callq 0x5f0e
movq 0xa8(%rsp), %rdi
jmp 0x14819
leaq 0x3e38(%rip), %rcx      # 0x184b0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
decl %r14d
movl 0x59b56(%rip), %eax     # 0x6e1e0
addl $-0x18, %eax
cmpl %eax, %r14d
cmovlel %eax, %r14d
jmp 0x146e3
leaq 0x3e03(%rip), %rcx      # 0x184a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
decl %r14d
movl 0x59b31(%rip), %eax     # 0x6e1e0
addl $-0x18, %eax
cmpl %eax, %r14d
cmovlel %eax, %r14d
jmp 0x14733
incl %r14d
movl 0x59b1c(%rip), %eax     # 0x6e1e0
addl $0x18, %eax
cmpl %r14d, %eax
cmovll %eax, %r14d
jmp 0x14733
incl %r14d
movl 0x59b07(%rip), %eax     # 0x6e1e0
addl $0x18, %eax
cmpl %r14d, %eax
cmovll %eax, %r14d
decl %r13d
movl 0x59af8(%rip), %eax     # 0x6e1e4
addl $-0x8, %eax
cmpl %eax, %r13d
cmovlel %eax, %r13d
jmp 0x14733
incl %r14d
movl 0x59adf(%rip), %eax     # 0x6e1e0
addl $0x18, %eax
cmpl %r14d, %eax
cmovll %eax, %r14d
jmp 0x14720
decl %r14d
movl 0x59aca(%rip), %eax     # 0x6e1e0
addl $-0x18, %eax
cmpl %eax, %r14d
cmovlel %eax, %r14d
incl %r13d
movl 0x59abb(%rip), %eax     # 0x6e1e4
addl $0xa, %eax
cmpl %r13d, %eax
cmovll %eax, %r13d
movq %r12, %rbx
cmpl $0x1, 0xcbdb(%rip)      # 0x21318
je 0x14512
jmp 0x14852
cmpl $0x9, %ebx
je 0x1479f
cmpl $0x1b, %ebx
jne 0x14733
movl $0x0, 0xcbbc(%rip)      # 0x21318
xorl %edi, %edi
callq 0x10355
jmp 0x14733
movl %r14d, %edi
movl %r13d, %esi
callq 0x105b8
movl $0x1, 0xcb9e(%rip)      # 0x21318
callq 0xf035
movq 0x59d5a(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
movl %r14d, %edx
movl %r13d, %ecx
movl $0x2a, %r8d
callq 0xfeb6
jmp 0x14733
movq 0x59d2a(%rip), %rsi     # 0x6e4d0
movq 0x59d1b(%rip), %rcx     # 0x6e4c8
subq %rcx, %rsi
movq %r12, %rbx
je 0x14736
sarq $0x3, %rsi
movq 0x10(%rsp), %rax
incl %eax
cltq
xorl %edx, %edx
divq %rsi
movq %rdx, 0x10(%rsp)
movslq %edx, %rax
movq (%rcx,%rax,8), %rax
movl 0x20(%rax), %r14d
movl 0x24(%rax), %r13d
jmp 0x14736
movq %rdx, 0xc8(%rsp)
leaq 0xc8(%rsp), %rbx
movq %rbx, %rdi
leaq 0x5d76(%rip), %rsi      # 0x1a570
movq %rdx, %rbp
leaq 0x5d8c(%rip), %rdx      # 0x1a590
callq 0x15b1a
movq %rbx, %rdi
callq 0x5f0e
movq 0xc8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x14823
callq 0x5230
callq 0x74d7
jmp 0x14733
movl %r14d, %edx
movl %r13d, %ecx
callq 0x1140b
testb %al, %al
je 0x14736
movl $0x0, 0xcace(%rip)      # 0x21318
movl $0x0, 0x4(%rsp)
movslq %r14d, %rax
movslq %r13d, %rcx
imulq $0x4b0, %rax, %rax      # imm = 0x4B0
leaq 0x59c8a(%rip), %rdx     # 0x6e4f0
addq %rdx, %rax
movq (%rax,%rcx,8), %rax
testq %rax, %rax
je 0x14879
movq %rax, 0x59c47(%rip)     # 0x6e4c0
movq 0x59c60(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %edi
movl 0x24(%rax), %esi
movl %r14d, %edx
movl %r13d, %ecx
callq 0x1021b
callq 0xfaf4
leaq 0x50(%rsp), %r13
jmp 0x13ff3
xorb $0x1, 0xca39(%rip)      # 0x212e0
callq 0xf035
jmp 0x140d9
movq 0xb1b88(%rip), %rax     # 0xc6440
movq 0x78(%rax), %rcx
xorl %eax, %eax
movl $0x8, %edx
movq (%rcx,%rdx), %rsi
subq -0x8(%rcx,%rdx), %rsi
shrq $0x3, %rsi
addl %esi, %eax
addq $0x18, %rdx
cmpq $0x50, %rdx
jne 0x148c3
testl %eax, %eax
leaq 0xf8(%rsp), %rbx
jle 0x149e7
movq %rbx, 0xe8(%rsp)
leaq 0xe8(%rsp), %rbp
movq %rbp, %rdi
leaq 0x5b3f(%rip), %rsi      # 0x1a445
leaq 0x5b7b(%rip), %rdx      # 0x1a488
callq 0x15b1a
movq %rbp, %rdi
callq 0x5f0e
movq 0xe8(%rsp), %rdi
cmpq %rbx, %rdi
je 0x149e2
callq 0x5230
jmp 0x149e2
movq %r14, 0x20(%rsp)
leaq 0x20(%rsp), %rbp
movq %rbp, %rdi
leaq 0x5b40(%rip), %rsi      # 0x1a489
leaq 0x5b6b(%rip), %rdx      # 0x1a4bb
callq 0x15b1a
movq %rbp, %rdi
callq 0x688f
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0x1496c
callq 0x5230
movq (%rbx), %rdi
callq 0x50f0
movl %eax, %ebx
callq 0x5130
cmpl $0x59, %ebx
movq %r12, %rbx
jne 0x140d9
jmp 0x14c34
cmpl $0x0, 0xc951(%rip)      # 0x212e4
je 0x140d9
jmp 0x14ac9
cmpl $0x1, 0xc93f(%rip)      # 0x212e4
je 0x140d9
jmp 0x14b1b
movq 0x59889(%rip), %rax     # 0x6e240
subq 0x5987a(%rip), %rax     # 0x6e238
shrq $0x5, %rax
movq 0x5988f(%rip), %rcx     # 0x6e258
subq 0x59880(%rip), %rcx     # 0x6e250
movl %eax, 0x59892(%rip)     # 0x6e268
shrq $0x5, %rcx
decl %ecx
movl %ecx, 0x5988a(%rip)     # 0x6e26c
callq 0x74d7
movq %r12, %rbx
jmp 0x140d9
movq %r13, 0x40(%rsp)
leaq 0x40(%rsp), %rbp
movq %rbp, %rdi
leaq 0x5b4c(%rip), %rsi      # 0x1a54f
leaq 0x5b65(%rip), %rdx      # 0x1a56f
callq 0x15b1a
movq %rbp, %rdi
callq 0x5f0e
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
je 0x140d9
callq 0x5230
jmp 0x140d9
movq 0x59aaa(%rip), %rax     # 0x6e4e0
movl 0x20(%rax), %esi
movl 0x24(%rax), %edx
leaq 0x108(%rsp), %rbx
movq %rbx, %rdi
callq 0x12612
movq %rbx, %rdi
callq 0x5f0e
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
cmpq %rax, %rdi
je 0x14c22
callq 0x5230
jmp 0x14c22
leaq 0x1c8(%rsp), %rbx
leaq 0x1d8(%rsp), %r14
movq %r14, (%rbx)
leaq 0x5994(%rip), %rsi      # 0x1a425
leaq 0x59ac(%rip), %rdx      # 0x1a444
movq %rbx, %rdi
callq 0x15b1a
movq %rbx, %rdi
callq 0x5f0e
movq 0x1c8(%rsp), %rdi
cmpq %r14, %rdi
je 0x14aba
callq 0x5230
movl $0x2, 0xc820(%rip)      # 0x212e4
jmp 0x14c22
leaq 0x208(%rsp), %rbx
leaq 0x218(%rsp), %r14
movq %r14, (%rbx)
leaq 0x590b(%rip), %rsi      # 0x1a3ee
leaq 0x591a(%rip), %rdx      # 0x1a404
movq %rbx, %rdi
callq 0x15b1a
movq %rbx, %rdi
callq 0x5f0e
movq 0x208(%rsp), %rdi
cmpq %r14, %rdi
je 0x14b0c
callq 0x5230
movl $0x0, 0xc7ce(%rip)      # 0x212e4
jmp 0x14c22
leaq 0x1e8(%rsp), %rbx
leaq 0x1f8(%rsp), %r14
movq %r14, (%rbx)
leaq 0x58d0(%rip), %rsi      # 0x1a405
leaq 0x58e8(%rip), %rdx      # 0x1a424
movq %rbx, %rdi
callq 0x15b1a
movq %rbx, %rdi
callq 0x5f0e
movq 0x1e8(%rsp), %rdi
cmpq %r14, %rdi
je 0x14b5e
callq 0x5230
movl $0x1, 0xc77c(%rip)      # 0x212e4
jmp 0x14c22
leaq (%rax,%rcx,4), %rax
addq $0x4b0, %rax            # imm = 0x4B0
movl $0xa, (%rax)
leaq 0x1a8(%rsp), %rbx
leaq 0x1b8(%rsp), %r14
movq %r14, (%rbx)
leaq 0x5968(%rip), %rsi      # 0x1a4ff
leaq 0x598a(%rip), %rdx      # 0x1a528
movq %rbx, %rdi
callq 0x15b1a
movq %rbx, %rdi
callq 0x5f0e
movq 0x1a8(%rsp), %rdi
cmpq %r14, %rdi
je 0x14bc0
callq 0x5230
movb $0x1, 0xc75f(%rip)      # 0x21326
jmp 0x14c22
movq 0x60(%rsp), %rbx
movq %rbx, %rdi
movl %ebp, %esi
movl %r13d, %edx
callq 0xb5ec
movslq 0x70(%rbx), %rax
movq 0xb185a(%rip), %rcx     # 0xc6440
leaq (%rax,%rax,2), %rax
movslq 0x8c(%rbx), %rdx
leaq (%rdx,%rdx,2), %rdi
shlq $0x3, %rdi
addq (%rcx,%rax,8), %rdi
movq %rbx, %rsi
callq 0x15a0e
movq %rbx, %rdi
movl 0x1c(%rsp), %esi
callq 0x13676
movl $0x0, 0xc6fd(%rip)      # 0x21318
movb $0x0, 0x98(%rbx)
addq $0x228, %rsp            # imm = 0x228
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x52d0
xorl %edi, %edi
callq 0x52f0
movq %rax, %r15
movq 0x1a8(%rsp), %rdi
jmp 0x14d00
movq %rax, %r15
movq 0x1e8(%rsp), %rdi
jmp 0x14d00
movq %rax, %r15
movq 0x208(%rsp), %rdi
jmp 0x14d00
movq %rax, %r15
movq 0x1c8(%rsp), %rdi
jmp 0x14d00
movq %rax, %r15
movq 0x108(%rsp), %rdi
leaq 0x118(%rsp), %rax
jmp 0x14cd5
movq %rax, %r15
movq 0xa8(%rsp), %rdi
jmp 0x14cad
movq %rax, %r15
movq 0xc8(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x14d3e
jmp 0x14d43
movq %rax, %r15
movq 0x88(%rsp), %rdi
jmp 0x14d00
movq %rax, %r15
movq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %rax
cmpq %rax, %rdi
jne 0x14d3e
jmp 0x14d43
movq %rax, %r15
movq 0x40(%rsp), %rdi
cmpq %r13, %rdi
jne 0x14d3e
jmp 0x14d43
movq %rax, %r15
movq 0xe8(%rsp), %rdi
jmp 0x14d39
movq %rax, %r15
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
jne 0x14d3e
jmp 0x14d43
movq %rax, %r15
movq 0x148(%rsp), %rdi
jmp 0x14d39
movq %rax, %r15
movq 0x168(%rsp), %rdi
jmp 0x14d39
movq %rax, %r15
movq 0x128(%rsp), %rdi
jmp 0x14d39
movq %rax, %r15
movq 0x188(%rsp), %rdi
cmpq %rbx, %rdi
je 0x14d43
callq 0x5230
movq %r15, %rdi
callq 0x53d0