// File: lotuskip[P]yuxtapa/server/viewpoint.cpp
// Function: ViewPoint::render(char*, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>&)
short ViewPoint::render(char *target, vector<string> &shouts)
{
	char x, y;
	Tile *tp;
	if(!blinded) // don't do LOS consideration if blind
	{
		// clear the part of the viewtable that is not constant:
		for(y = 1; y < VIEWSIZE-1; ++y)
		{
			for(x = 1; x < VIEWSIZE-1; ++x)
				loslittbl[x][y] = 0;
		}
		// Always fill the table with the full radius:
		fill_loslittbl(LOSrad);
		/* In addition, for the higher radii, in order to cover a few "blind
		 * spots", we have to run with another radius (this could be optimized a
		 * little more, I'm sure, but I haven't bothered figuring that out). */
		if(LOSrad >= 6)
		{
			if(LOSrad > 6)
				fill_loslittbl(LOSrad - 2);
			fill_loslittbl(LOSrad - 1);
			if(LOSrad == 10) // scouts have their own extra blind spots
				fill_loslittbl(6);
		}

		// The center point of the view needs to be checked separately.
		// It is always in LOS!
		loslittbl[VIEWSIZE/2][VIEWSIZE/2] = IN_LOS;
		*(tp = &(ownview[pos.y][pos.x])) = Game::curmap->get_tile(pos);
		if(tp->flags & TF_LIT // statically lit
				|| is_dynlit(pos))
			loslittbl[VIEWSIZE/2][VIEWSIZE/2] |= IS_LIT;
	} // (not blinded)

	// The actual "rendering":
	unsigned char cp;
	Coords c;
	list<string> titles;
	list<Coords> titlecoords;
	map<Coords, string>::const_iterator vit;
	for(y = 0; y < VIEWSIZE; ++y)
	{
		for(x = 0; x < VIEWSIZE; ++x)
		{
			c.x = pos.x + x - VIEWSIZE/2;
			c.y = pos.y + y - VIEWSIZE/2;
			if(Game::curmap->point_out_of_map(c))
			{
				// for out of map points, just print emptyness:
				*(target++) = EMPTY_TILE.cpair;
				*(target++) = EMPTY_TILE.symbol;
			}
			else // point is in map
			{
				tp = Game::curmap->mod_tile(c);
				// A sound overrules anything else (even when blind!),
				// so check for it first:
				if(tp->flags & TF_SOUND)
				{
					vit = voices.find(c);
					if(vit != voices.end()) // Voice?
					{
						*(target++) = VOICE_COLOUR;
						shouts.push_back("!: " + vit->second);
					}
					else // a regular sound!
						*(target++) = sound_col[reg_sounds[c]];
					*(target++) = '!';
				}
				else if(blinded)
				{
					*(target++) = EMPTY_TILE.cpair;
					*(target++) = EMPTY_TILE.symbol;
				}
				// If tile is not in LOS (Note that in this table it cannot be
				// "lit but not in LOS" -- if you don't see it, you can't see
				// that it's lit!)
				else if(!(loslittbl[x][y]))
				{
					if(!(tp->flags & TF_OCCUPIED)
						|| !render_pc_indir(c, target))
					{
						// No sound or PC, take the raw symbol and give dim
						// colour. Note that this symbol is taken from ownview,
						// not directly from the map!
						if(ownview[c.y][c.x].cpair == C_UNKNOWN) // can't be dimmed!
							*(target++) = C_UNKNOWN;
						else
							*(target++) = ownview[c.y][c.x].cpair - NUM_DIM_COLS;
						*(target++) = ownview[c.y][c.x].symbol;
					}
					else target += 2; // a scout-seen PC was rendered
				}
				// else (tile in LOS), if tile is occupied must see who's there
				else if((tp->flags & TF_OCCUPIED) &&
					render_occent_at(c, target, loslittbl[x][y] & IS_LIT))
					target += 2;
				// if render_occent returns false, it must be a PC:
				else if((tp->flags & TF_OCCUPIED) &&
					render_pc_at(c, target, loslittbl[x][y] & IS_LIT, titles))
				{
					target += 2;
					titlecoords.push_back(Coords(x,y));
				}
				// else check for item in steal mode
				else if(gamemode == GM_STEAL && the_item.getpos() == c
					&& pl_with_item == cur_players.end())
				{
					the_item.draw(target, loslittbl[x][y] & IS_LIT);
					target += 2;
				}
				// else check if there is a nonoccupying entity
				else if(tp->flags & TF_NOCCENT)
				{
					render_noccent_at(c, target, loslittbl[x][y] & IS_LIT);
					target += 2;
				}
				// else check for a seen trap
				else if(tp->flags & TF_TRAP && owner->team != T_SPEC // specs don't see traps
					&& render_trap_at(c, target, loslittbl[x][y] & IS_LIT))
					target += 2;
				else // tile in LOS, totally empty or unseen trap/PC
				{
					cp = tp->cpair;
					if(loslittbl[x][y] & IS_LIT)
						cp += NUM_NORM_COLS;
					*(target++) = cp;
					*(target++) = tp->symbol;
				}

				// printed something; now must check for an indicator:
				if(!blinded && tp->flags & TF_ACTION && loslittbl[x][y])
					*(target-2) = C_GREEN_ON_HEAL
						+ (axn_indicators[c]%NUM_ACTIONS)*7
						+ fg_map[*(target-2)-BASE_COLOURS];
			} // point is in map
		} // loop x
	} // loop y
	poschanged = false;

	// Add titles in the form [num of titles (char)][so many titles: [x][y][C-string]]
	*(target++) = titles.size();
	short sizeadd = 1;
	while(!titles.empty())
	{
		*(target++) = titlecoords.back().x;
		*(target++) = titlecoords.back().y;
		strcpy(target, titles.back().c_str());
		target += titles.back().size()+1;
		sizeadd += 3 + titles.back().size();
		titlecoords.pop_back();
		titles.pop_back();
	}
	return VIEWSIZE*VIEWSIZE*2+sizeadd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
cmpb $0x0, 0x20(%rax)
jne 0x416b6
movb $0x1, -0x1a(%rbp)
movsbl -0x1a(%rbp), %eax
cmpl $0x16, %eax
jge 0x415a8
movb $0x1, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x16, %eax
jge 0x4159c
movsbq -0x19(%rbp), %rcx
leaq 0x513de(%rip), %rax     # 0x92960
imulq $0x17, %rcx, %rcx
addq %rcx, %rax
movsbq -0x1a(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movb -0x19(%rbp), %al
addb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0x4156d
jmp 0x4159e
movb -0x1a(%rbp), %al
addb $0x1, %al
movb %al, -0x1a(%rbp)
jmp 0x41560
movq -0xf0(%rbp), %rax
movq %rax, %rdi
movsbl (%rax), %esi
callq 0x41160
movq -0xf0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6, %eax
jl 0x41624
movq -0xf0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6, %eax
jle 0x415ed
movq -0xf0(%rbp), %rdi
movsbl (%rdi), %eax
subl $0x2, %eax
movsbl %al, %esi
callq 0x41160
movq -0xf0(%rbp), %rdi
movsbl (%rdi), %eax
subl $0x1, %eax
movsbl %al, %esi
callq 0x41160
movq -0xf0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x41622
movq -0xf0(%rbp), %rdi
movl $0x6, %esi
callq 0x41160
jmp 0x41624
movq -0xf0(%rbp), %rsi
movb $0x1, 0x51436(%rip)     # 0x92a68
leaq 0x5079f(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
addq $0x2, %rsi
callq 0x3dcd0
movl %eax, %ecx
movq -0xf0(%rbp), %rax
movl %ecx, -0x2c(%rbp)
movq %rax, %rdi
addq $0x8, %rdi
movswq 0x4(%rax), %rsi
callq 0x2e6a0
movq %rax, %rdi
movq -0xf0(%rbp), %rax
movswq 0x2(%rax), %rsi
callq 0x2e6c0
movq %rax, -0x28(%rbp)
movl -0x2c(%rbp), %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0x416a4
movq -0xf0(%rbp), %rdi
addq $0x2, %rdi
callq 0x48d60
testb $0x1, %al
jne 0x416a4
jmp 0x416b4
movsbl 0x513bd(%rip), %eax     # 0x92a68
orl $0x2, %eax
movb %al, 0x513b4(%rip)      # 0x92a68
jmp 0x416b6
leaq -0x32(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x60430
leaq -0x50(%rbp), %rdi
callq 0x429f0
leaq -0x68(%rbp), %rdi
callq 0x42a10
leaq -0x70(%rbp), %rdi
callq 0x42a30
movb $0x0, -0x1a(%rbp)
movsbl -0x1a(%rbp), %eax
cmpl $0x17, %eax
jge 0x41f01
movb $0x0, -0x19(%rbp)
movsbl -0x19(%rbp), %eax
cmpl $0x17, %eax
jge 0x41ef2
movq -0xf0(%rbp), %rax
movzwl 0x2(%rax), %esi
movsbl -0x19(%rbp), %ecx
movl %ecx, %edx
movl %esi, %ecx
leal -0xb(%rcx,%rdx), %ecx
movw %cx, -0x32(%rbp)
movzwl 0x4(%rax), %edx
movsbl -0x1a(%rbp), %eax
movl %eax, %ecx
movl %edx, %eax
leal -0xb(%rax,%rcx), %eax
movw %ax, -0x30(%rbp)
leaq 0x506a2(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x32(%rbp), %rsi
callq 0x2ba40
movb %al, -0xf1(%rbp)
jmp 0x4174a
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x41756
jmp 0x41790
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x6d, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x3f, (%rax)
jmp 0x41ee3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
jmp 0x4204b
leaq 0x50641(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x32(%rbp), %rsi
callq 0x3d2d0
movq %rax, -0x100(%rbp)
jmp 0x417ac
movq -0x100(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
andl $0x100, %eax            # imm = 0x100
cmpl $0x0, %eax
je 0x41927
leaq 0x5192d(%rip), %rdi     # 0x93100
leaq -0x32(%rbp), %rsi
callq 0x1b160
movq %rax, -0x108(%rbp)
jmp 0x417e5
movq -0x108(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x42a50
movq -0x88(%rbp), %rax
movq %rax, -0x70(%rbp)
leaq 0x518e8(%rip), %rdi     # 0x93100
callq 0x1b1b0
movq %rax, -0xa0(%rbp)
leaq -0x98(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x42a50
leaq -0x70(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x42a70
testb $0x1, %al
jne 0x41850
jmp 0x418d1
movq -0x10(%rbp), %rax
movq %rax, %rcx
incq %rcx
movq %rcx, -0x10(%rbp)
movb $0x3b, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x42aa0
movq %rax, %rdx
addq $0x8, %rdx
leaq 0x22a4a(%rip), %rsi     # 0x642cd
leaq -0xc0(%rbp), %rdi
callq 0x1f390
jmp 0x41891
movq -0x110(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x1b400
jmp 0x418a6
leaq -0xc0(%rbp), %rdi
callq 0x5a48
jmp 0x41910
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0x5a48
jmp 0x4204b
leaq 0x517f8(%rip), %rdi     # 0x930d0
leaq -0x32(%rbp), %rsi
callq 0x42ac0
movq %rax, -0x118(%rbp)
jmp 0x418ea
movq -0x118(%rbp), %rax
movl (%rax), %eax
movl %eax, %ecx
leaq 0x229e8(%rip), %rax     # 0x642e4
movb (%rax,%rcx), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x21, (%rax)
jmp 0x41e4c
movq -0xf0(%rbp), %rax
cmpb $0x0, 0x20(%rax)
je 0x4195d
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x6d, (%rax)
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x3f, (%rax)
jmp 0x41e4a
movsbq -0x19(%rbp), %rcx
leaq 0x50ff7(%rip), %rax     # 0x92960
imulq $0x17, %rcx, %rcx
addq %rcx, %rax
movsbq -0x1a(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
jne 0x41a7e
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x419ba
movq -0xf0(%rbp), %rdi
movq -0x10(%rbp), %rdx
leaq -0x32(%rbp), %rsi
callq 0x42070
movb %al, -0x119(%rbp)
jmp 0x419aa
movb -0x119(%rbp), %al
testb $0x1, %al
jne 0x41a6d
jmp 0x419ba
movq -0xf0(%rbp), %rdi
addq $0x8, %rdi
movswq -0x30(%rbp), %rsi
callq 0x2e6a0
movq %rax, %rdi
movswq -0x32(%rbp), %rsi
callq 0x2e6c0
movzbl 0x3(%rax), %eax
cmpl $0x6d, %eax
jne 0x419f9
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movb $0x6d, (%rax)
jmp 0x41a35
movq -0xf0(%rbp), %rdi
addq $0x8, %rdi
movswq -0x30(%rbp), %rsi
callq 0x2e6a0
movq %rax, %rdi
movswq -0x32(%rbp), %rsi
callq 0x2e6c0
movzbl 0x3(%rax), %eax
subl $0x7, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0xf0(%rbp), %rdi
addq $0x8, %rdi
movswq -0x30(%rbp), %rsi
callq 0x2e6a0
movq %rax, %rdi
movswq -0x32(%rbp), %rsi
callq 0x2e6c0
movb 0x2(%rax), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x41a79
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x41e48
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x41ae7
movq -0x10(%rbp), %rsi
movsbq -0x19(%rbp), %rcx
leaq (%rcx,%rcx,2), %rax
shlq $0x3, %rax
subq %rcx, %rax
leaq 0x50eb8(%rip), %rcx     # 0x92960
addq %rax, %rcx
movsbq -0x1a(%rbp), %rax
movzbl (%rax,%rcx), %edx
andl $0x2, %edx
shrl %edx
leaq -0x32(%rbp), %rdi
callq 0x486e0
movb %al, -0x11a(%rbp)
jmp 0x41aca
movb -0x11a(%rbp), %al
testb $0x1, %al
jne 0x41ad6
jmp 0x41ae7
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x41e46
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x41bb0
movq -0xf0(%rbp), %rdi
movq -0x10(%rbp), %rdx
movsbq -0x19(%rbp), %rcx
leaq (%rcx,%rcx,2), %rax
shlq $0x3, %rax
subq %rcx, %rax
leaq 0x50e44(%rip), %rcx     # 0x92960
addq %rax, %rcx
movsbq -0x1a(%rbp), %rax
movzbl (%rax,%rcx), %ecx
andl $0x2, %ecx
shrl %ecx
leaq -0x32(%rbp), %rsi
leaq -0x50(%rbp), %r8
callq 0x42150
movb %al, -0x11b(%rbp)
jmp 0x41b42
movb -0x11b(%rbp), %al
testb $0x1, %al
jne 0x41b4e
jmp 0x41bb0
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
movsbl -0x19(%rbp), %esi
movsbl -0x1a(%rbp), %edx
leaq -0xc4(%rbp), %rdi
callq 0x60430
jmp 0x41b70
leaq -0x68(%rbp), %rdi
leaq -0xc4(%rbp), %rsi
callq 0x42ba0
jmp 0x41b82
leaq -0xc4(%rbp), %rdi
callq 0x60460
jmp 0x41e44
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0xc4(%rbp), %rdi
callq 0x60460
jmp 0x4204b
leaq 0x4f7dd(%rip), %rax     # 0x91394
movl (%rax), %ecx
movb $0x0, -0xc9(%rbp)
xorl %eax, %eax
cmpl $0x2, %ecx
movb %al, -0x11c(%rbp)
jne 0x41c59
leaq 0x515b0(%rip), %rsi     # 0x93188
leaq -0xc8(%rbp), %rdi
callq 0x1b190
jmp 0x41be6
movb $0x1, -0xc9(%rbp)
leaq -0xc8(%rbp), %rdi
leaq -0x32(%rbp), %rsi
callq 0x60860
movb %al, -0x11d(%rbp)
jmp 0x41c05
movb -0x11d(%rbp), %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x11c(%rbp)
jne 0x41c1a
jmp 0x41c59
leaq 0x4e60f(%rip), %rdi     # 0x90230
callq 0x189f0
movq %rax, -0xe0(%rbp)
leaq -0xd8(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x18a20
leaq 0x51531(%rip), %rdi     # 0x93178
leaq -0xd8(%rbp), %rsi
callq 0x3d5a0
movb %al, -0x11c(%rbp)
movb -0x11c(%rbp), %al
movb %al, -0x11e(%rbp)
testb $0x1, -0xc9(%rbp)
jne 0x41c70
jmp 0x41c7c
leaq -0xc8(%rbp), %rdi
callq 0x60460
movb -0x11e(%rbp), %al
testb $0x1, %al
jne 0x41c88
jmp 0x41cfb
movq -0x10(%rbp), %rsi
movsbq -0x19(%rbp), %rcx
leaq (%rcx,%rcx,2), %rax
shlq $0x3, %rax
subq %rcx, %rax
leaq 0x50cbd(%rip), %rcx     # 0x92960
addq %rax, %rcx
movsbq -0x1a(%rbp), %rax
movzbl (%rax,%rcx), %edx
andl $0x2, %edx
shrl %edx
leaq 0x514cd(%rip), %rdi     # 0x93188
callq 0x4d6c0
jmp 0x41cc2
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x41e42
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
testb $0x1, -0xc9(%rbp)
jne 0x41cea
jmp 0x41cf6
leaq -0xc8(%rbp), %rdi
callq 0x60460
jmp 0x4204b
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x41d52
movq -0x10(%rbp), %rsi
movsbq -0x19(%rbp), %rcx
leaq (%rcx,%rcx,2), %rax
shlq $0x3, %rax
subq %rcx, %rax
leaq 0x50c3b(%rip), %rcx     # 0x92960
addq %rax, %rcx
movsbq -0x1a(%rbp), %rax
movzbl (%rax,%rcx), %edx
andl $0x2, %edx
shrl %edx
leaq -0x32(%rbp), %rdi
callq 0x48b00
jmp 0x41d41
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x41e40
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x41dda
movq -0xf0(%rbp), %rdi
addq $0x28, %rdi
callq 0x24f40
cmpl $0x2, 0xac(%rax)
je 0x41dda
movq -0xf0(%rbp), %rdi
movq -0x10(%rbp), %rdx
movsbq -0x19(%rbp), %rcx
leaq (%rcx,%rcx,2), %rax
shlq $0x3, %rax
subq %rcx, %rax
leaq 0x50bc2(%rip), %rcx     # 0x92960
addq %rax, %rcx
movsbq -0x1a(%rbp), %rax
movzbl (%rax,%rcx), %ecx
andl $0x2, %ecx
shrl %ecx
leaq -0x32(%rbp), %rsi
callq 0x425a0
movb %al, -0x11f(%rbp)
jmp 0x41dc0
movb -0x11f(%rbp), %al
testb $0x1, %al
jne 0x41dcc
jmp 0x41dda
movq -0x10(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x10(%rbp)
jmp 0x41e3e
movq -0x28(%rbp), %rax
movb 0x3(%rax), %al
movb %al, -0x2d(%rbp)
movsbq -0x19(%rbp), %rcx
leaq 0x50b70(%rip), %rax     # 0x92960
imulq $0x17, %rcx, %rcx
addq %rcx, %rax
movsbq -0x1a(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x41e12
movzbl -0x2d(%rbp), %eax
addl $0x14, %eax
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x28(%rbp), %rax
movb 0x2(%rax), %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
jmp 0x41e40
jmp 0x41e42
jmp 0x41e44
jmp 0x41e46
jmp 0x41e48
jmp 0x41e4a
jmp 0x41e4c
movq -0xf0(%rbp), %rax
cmpb $0x0, 0x20(%rax)
jne 0x41ee1
movq -0x28(%rbp), %rax
movzwl (%rax), %eax
andl $0x80, %eax
cmpl $0x0, %eax
je 0x41ee1
movsbq -0x19(%rbp), %rcx
leaq 0x50ae6(%rip), %rax     # 0x92960
imulq $0x17, %rcx, %rcx
addq %rcx, %rax
movsbq -0x1a(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x41ee1
leaq 0x5120d(%rip), %rdi     # 0x930a0
leaq -0x32(%rbp), %rsi
callq 0x42be0
movq %rax, -0x128(%rbp)
jmp 0x41ea5
movq -0x128(%rbp), %rax
movzbl (%rax), %eax
movl $0x6, %ecx
cltd
idivl %ecx
imull $0x7, %edx, %eax
addl $0x43, %eax
movq -0x10(%rbp), %rcx
movsbl -0x2(%rcx), %ecx
subl $0x10, %ecx
movslq %ecx, %rdx
leaq 0x2241e(%rip), %rcx     # 0x642f0
movsbl (%rcx,%rdx), %ecx
addl %ecx, %eax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, -0x2(%rax)
jmp 0x41ee3
jmp 0x41ee5
movb -0x19(%rbp), %al
addb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0x416f3
jmp 0x41ef4
movb -0x1a(%rbp), %al
addb $0x1, %al
movb %al, -0x1a(%rbp)
jmp 0x416e2
movq -0xf0(%rbp), %rax
movb $0x0, 0x6(%rax)
leaq -0x50(%rbp), %rdi
callq 0x42cc0
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movw $0x1, -0xe2(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x42cf0
xorb $-0x1, %al
testb $0x1, %al
jne 0x41f45
jmp 0x4200d
leaq -0x68(%rbp), %rdi
callq 0x42d10
movw (%rax), %ax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
leaq -0x68(%rbp), %rdi
callq 0x42d10
movw 0x2(%rax), %ax
movb %al, %cl
movq -0x10(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x10(%rbp)
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x42d50
movq %rax, %rdi
callq 0x5200
movq -0x130(%rbp), %rdi
movq %rax, %rsi
callq 0x54d0
leaq -0x50(%rbp), %rdi
callq 0x42d50
movq %rax, %rdi
callq 0x5340
addq $0x1, %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x42d50
movq %rax, %rdi
callq 0x5340
movq %rax, %rcx
addq $0x3, %rcx
movswq -0xe2(%rbp), %rax
addq %rcx, %rax
movw %ax, -0xe2(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x42d90
leaq -0x50(%rbp), %rdi
callq 0x42dd0
jmp 0x41f31
movswl -0xe2(%rbp), %eax
addl $0x422, %eax            # imm = 0x422
movw %ax, -0x132(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x42e10
leaq -0x50(%rbp), %rdi
callq 0x42e30
leaq -0x32(%rbp), %rdi
callq 0x60460
movw -0x132(%rbp), %ax
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
leaq -0x68(%rbp), %rdi
callq 0x42e10
leaq -0x50(%rbp), %rdi
callq 0x42e30
leaq -0x32(%rbp), %rdi
callq 0x60460
movq -0x78(%rbp), %rdi
callq 0x5920
nop