// File: essarrdee[P]mutantaliens/mutantaliens.cpp
// Function: draw_tile(int, int, bool)
void draw_tile(int x, int y, bool record_actors = false)
{
	if(!on_map(x,y))
	{draw_ch(x,y,' ',COLOR_WHITE); return;}
	char ch = terrain_chars[map_terrain[x][y]];
	int colour = terrain_colours[map_terrain[x][y]];
	if (!map_seen[x][y] && !debug)
	{draw_ch(x,y,' ',colour); return;}
	if(debug)
		ch = scent_strength(map_human_scent[x][y]);
	if (map_items[x][y] != NULL)
	{
		ch = map_items[x][y]->ch;
		colour = map_items[x][y]->colour;
	}
	//if(sym_los_in_range(p_ptr->x,p_ptr->y,x,y,is_opaque)|| debug)
	if(tile_visible(x,y))
	{
		if (map_occupants[x][y] != NULL)
		{
			actor* a = map_occupants[x][y];
			ch = a->sspecies->ch;
			if('a'<= ch && ch <= 'z' && a->running)
			{
				ch -= ('a'-'A');
			}
			colour = a->sspecies->colour;
			if(a->health < a->sspecies->min_health/4)
			{colour = COLOR_RED;}
			a->sspecies->size_known = true;
			if(a->running) a->sspecies->run_known = true;
			else a->sspecies->walk_known = true;
			if(a != p_ptr && record_actors)
			{
				visible_actors.push_back(a);
			}
		}
		draw_ch_bright(x,y,ch,colour);//ch = ch | A_BOLD;
	}
	else
	{
		draw_ch(x,y,ch,colour);
	}
}

// Assembly:
subq $0x28, %rsp
movb %dl, %al
movl %edi, 0x24(%rsp)
movl %esi, 0x20(%rsp)
andb $0x1, %al
movb %al, 0x1f(%rsp)
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
callq 0x20770
testb $0x1, %al
jne 0x16f81
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
movl $0x20, %edx
movl $0x7, %ecx
callq 0x21460
jmp 0x17229
movslq 0x24(%rsp), %rcx
leaq 0x24423(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
leaq 0x168cd(%rip), %rax     # 0x2d874
movb (%rax,%rcx), %al
movb %al, 0x1e(%rsp)
movslq 0x24(%rsp), %rcx
leaq 0x243f6(%rip), %rax     # 0x3b3b0
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
leaq 0x1686c(%rip), %rax     # 0x2d840
movl (%rax,%rcx,4), %eax
movl %eax, 0x18(%rsp)
movslq 0x24(%rsp), %rcx
leaq 0x66279(%rip), %rax     # 0x7d260
imulq $0x96, %rcx, %rcx
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
testb $0x1, (%rax,%rcx)
jne 0x17020
testb $0x1, 0x2437f(%rip)     # 0x3b382
jne 0x17020
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
movl 0x18(%rsp), %ecx
movl $0x20, %edx
callq 0x21460
jmp 0x17229
testb $0x1, 0x2435b(%rip)     # 0x3b382
je 0x17052
movslq 0x24(%rsp), %rcx
leaq 0x3a30b(%rip), %rax     # 0x51340
imulq $0x258, %rcx, %rcx      # imm = 0x258
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
movss (%rax,%rcx,4), %xmm0
callq 0x16e00
movb %al, 0x1e(%rsp)
movslq 0x24(%rsp), %rcx
leaq 0x9d4d2(%rip), %rax     # 0xb4530
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x170c0
movslq 0x24(%rsp), %rcx
leaq 0x9d4b0(%rip), %rax     # 0xb4530
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movb 0xc(%rax), %al
movb %al, 0x1e(%rsp)
movslq 0x24(%rsp), %rcx
leaq 0x9d48a(%rip), %rax     # 0xb4530
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movl 0x8(%rax), %eax
movl %eax, 0x18(%rsp)
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
callq 0x16590
testb $0x1, %al
jne 0x170d6
jmp 0x17211
movslq 0x24(%rsp), %rcx
leaq 0x7147e(%rip), %rax     # 0x88560
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x171f7
movslq 0x24(%rsp), %rcx
leaq 0x71458(%rip), %rax     # 0x88560
imulq $0x4b0, %rcx, %rcx      # imm = 0x4B0
addq %rcx, %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movb 0x24(%rax), %al
movb %al, 0x1e(%rsp)
movsbl 0x1e(%rsp), %ecx
movl $0x61, %eax
cmpl %ecx, %eax
jg 0x1715e
movsbl 0x1e(%rsp), %eax
cmpl $0x7a, %eax
jg 0x1715e
movq 0x10(%rsp), %rax
testb $0x1, 0x14(%rax)
je 0x1715e
movsbl 0x1e(%rsp), %eax
subl $0x20, %eax
movb %al, 0x1e(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl 0x28(%rax), %eax
movl %eax, 0x18(%rsp)
movq 0x10(%rsp), %rax
movl 0xc(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movl 0x4(%rax), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x1719e
movl $0x1, 0x18(%rsp)
movq 0x10(%rsp), %rax
movq (%rax), %rax
movb $0x1, 0x49(%rax)
movq 0x10(%rsp), %rax
testb $0x1, 0x14(%rax)
je 0x171c3
movq 0x10(%rsp), %rax
movq (%rax), %rax
movb $0x1, 0x48(%rax)
jmp 0x171cf
movq 0x10(%rsp), %rax
movq (%rax), %rax
movb $0x1, 0x47(%rax)
movq 0x10(%rsp), %rax
cmpq 0x71375(%rip), %rax     # 0x88550
je 0x171f5
testb $0x1, 0x1f(%rsp)
je 0x171f5
leaq 0x7134d(%rip), %rdi     # 0x88538
leaq 0x10(%rsp), %rsi
callq 0x20ce0
jmp 0x171f7
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
movb 0x1e(%rsp), %al
movl 0x18(%rsp), %ecx
movsbl %al, %edx
callq 0x21500
jmp 0x17229
movl 0x24(%rsp), %edi
movl 0x20(%rsp), %esi
movb 0x1e(%rsp), %al
movl 0x18(%rsp), %ecx
movsbl %al, %edx
callq 0x21460
addq $0x28, %rsp
retq
nop