// File: /workspace/github_cpp_makefile_star2_O2/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebx
movl %edi, %ebp
movl %esi, %eax
orl %edi, %eax
js 0xc7fd
movl $0x96, %eax
cmpl %eax, %ebp
setl %cl
cmpl %eax, %ebx
setl %al
testb %al, %cl
je 0xc7fd
movl %edx, %r14d
movslq %ebp, %r15
movslq %ebx, %r13
imulq $0x258, %r15, %rax      # imm = 0x258
leaq 0x11b89(%rip), %rcx     # 0x1e340
addq %rax, %rcx
movslq (%rcx,%r13,4), %rdi
leaq 0x7d2b(%rip), %rdx      # 0x144f0
movl (%rdx,%rdi,4), %ecx
imulq $0x96, %r15, %rdx
leaq 0x53a1a(%rip), %rsi     # 0x601f0
addq %rdx, %rsi
movb 0x11b33(%rip), %dl      # 0x1e312
cmpb $0x0, (%r13,%rsi)
je 0xc81a
testb $0x1, %dl
jne 0xc823
movl %ecx, 0xc(%rsp)
leaq 0x7d2d(%rip), %rax      # 0x14524
movb (%rdi,%rax), %r12b
jmp 0xc83f
pushq $0x20
popq %rdx
pushq $0x7
popq %rcx
movl %ebp, %edi
movl %ebx, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11324
testb $0x1, %dl
je 0xc8da
movl %ecx, 0xc(%rsp)
leaq 0x27aa2(%rip), %rcx     # 0x342d0
addq %rax, %rcx
movss (%rcx,%r13,4), %xmm0
callq 0xc6f1
movl %eax, %r12d
imulq $0x4b0, %r15, %r15      # imm = 0x4B0
leaq 0x8ac73(%rip), %rax     # 0x974c0
addq %r15, %rax
movq (%rax,%r13,8), %rax
testq %rax, %rax
je 0xc864
movb 0xc(%rax), %r12b
movl 0x8(%rax), %eax
movl %eax, 0xc(%rsp)
movl %ebp, %edi
movl %ebx, %esi
callq 0xc2fd
testb %al, %al
je 0xc8c9
leaq 0x5ec78(%rip), %rax     # 0x6b4f0
addq %r15, %rax
movq (%rax,%r13,8), %rcx
testq %rcx, %rcx
je 0xc921
movq %rcx, 0x10(%rsp)
movq (%rcx), %rsi
movl 0x24(%rsi), %eax
movb 0x14(%rcx), %dil
leal -0x20(%rax), %edx
movzbl %dl, %r12d
testb $0x1, %dil
cmovel %eax, %r12d
leal -0x61(%rax), %edx
cmpb $0x1a, %dl
cmovael %eax, %r12d
movl 0x4(%rsi), %eax
movl 0xc(%rcx), %r8d
pushq $0x4
popq %r9
cltd
idivl %r9d
cmpl %eax, %r8d
jl 0xc8e2
movl 0x28(%rsi), %eax
jmp 0xc8e5
movsbl %r12b, %edx
movl %ebp, %edi
movl %ebx, %esi
movl 0xc(%rsp), %ecx
jmp 0xc807
pushq $0x20
popq %rdx
jmp 0xc803
pushq $0x1
popq %rax
movl %eax, 0xc(%rsp)
movb $0x1, 0x49(%rsi)
testb $0x1, %dil
je 0xc8f9
movb $0x1, 0x48(%rsi)
jmp 0xc8fd
movb $0x1, 0x47(%rsi)
cmpq 0x5ebdc(%rip), %rcx     # 0x6b4e0
sete %al
xorb $0x1, %r14b
orb %al, %r14b
jne 0xc921
leaq 0x5ebb1(%rip), %rdi     # 0x6b4c8
leaq 0x10(%rsp), %rsi
callq 0x1111e
movsbl %r12b, %edx
movl %ebp, %edi
movl %ebx, %esi
movl 0xc(%rsp), %ecx
callq 0x1138f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq