// File: /workspace/github_cpp_makefile_star2_O3/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, %ebp
movl %edi, %ebx
movl %esi, %eax
orl %edi, %eax
js 0xfc96
movl $0x96, %eax
cmpl %eax, %ebx
setl %cl
cmpl %eax, %ebp
setl %al
testb %al, %cl
je 0xfc96
movl %edx, %r15d
movslq %ebx, %r14
movslq %ebp, %r13
imulq $0x258, %r14, %rax      # imm = 0x258
leaq 0x116ec(%rip), %rcx     # 0x21340
addq %rax, %rcx
movslq (%rcx,%r13,4), %rcx
leaq 0x88ee(%rip), %rdx      # 0x18550
movl (%rdx,%rcx,4), %r12d
imulq $0x96, %r14, %rdx
leaq 0x5357c(%rip), %rsi     # 0x631f0
addq %rdx, %rsi
movb 0x11695(%rip), %dl      # 0x21312
cmpb $0x0, (%r13,%rsi)
je 0xfcee
testb $0x1, %dl
jne 0xfcf7
leaq 0x88f3(%rip), %rax      # 0x18584
movb (%rcx,%rax), %al
jmp 0xfd0c
movq 0x1133b(%rip), %r14     # 0x20fd8
movq (%r14), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x5150
movq (%r14), %rdi
subl 0x5e52f(%rip), %ebp     # 0x6e1e4
addl $0xf, %ebp
subl 0x5e522(%rip), %ebx     # 0x6e1e0
addl $0x18, %ebx
movl %ebp, %esi
movl %ebx, %edx
callq 0x5280
cmpl $-0x1, %eax
je 0xfea7
movq (%r14), %rdi
movl $0x20, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50a0
testb $0x1, %dl
je 0xfdfc
leaq 0x275d2(%rip), %rcx     # 0x372d0
addq %rax, %rcx
movss (%rcx,%r13,4), %xmm0
callq 0xfb8e
imulq $0x4b0, %r14, %r14      # imm = 0x4B0
leaq 0x8a7a6(%rip), %rcx     # 0x9a4c0
addq %r14, %rcx
movq (%rcx,%r13,8), %rcx
testq %rcx, %rcx
je 0xfd2d
movb 0xc(%rcx), %al
movl 0x8(%rcx), %r12d
movl %eax, 0xc(%rsp)
movl %ebx, %edi
movl %ebp, %esi
callq 0xf6f1
testb %al, %al
je 0xfdaf
leaq 0x5e7ab(%rip), %rax     # 0x6e4f0
addq %r14, %rax
movq (%rax,%r13,8), %rax
testq %rax, %rax
je 0xfe58
movq %rax, 0x10(%rsp)
movq (%rax), %rcx
movl 0x4(%rcx), %esi
movl 0x24(%rcx), %edi
movb 0x14(%rax), %dl
leal -0x20(%rdi), %r8d
movzbl %r8b, %r9d
testb $0x1, %dl
cmovel %edi, %r9d
leal -0x61(%rdi), %r8d
cmpb $0x1a, %r8b
cmovael %edi, %r9d
movl %r9d, 0xc(%rsp)
leal 0x3(%rsi), %edi
testl %esi, %esi
cmovnsl %esi, %edi
sarl $0x2, %edi
movl $0x1, %r12d
cmpl %edi, 0xc(%rax)
jl 0xfda0
movl 0x28(%rcx), %r12d
movb $0x1, 0x49(%rcx)
testb $0x1, %dl
je 0xfe13
movb $0x1, 0x48(%rcx)
jmp 0xfe17
movq 0x11222(%rip), %r14     # 0x20fd8
movq (%r14), %rdi
shll $0x8, %r12d
movzwl %r12w, %esi
xorl %edx, %edx
callq 0x5150
movq (%r14), %rdi
subl 0x5e413(%rip), %ebp     # 0x6e1e4
addl $0xf, %ebp
subl 0x5e406(%rip), %ebx     # 0x6e1e0
addl $0x18, %ebx
movl %ebp, %esi
movl %ebx, %edx
callq 0x5280
cmpl $-0x1, %eax
je 0xfea7
movq (%r14), %rdi
movsbl 0xc(%rsp), %esi
jmp 0xfcdb
movq 0x111d5(%rip), %r14     # 0x20fd8
movq (%r14), %rdi
shll $0x8, %r12d
movzwl %r12w, %esi
jmp 0xfca5
movb $0x1, 0x47(%rcx)
cmpq 0x5e6c2(%rip), %rax     # 0x6e4e0
sete %cl
xorb $0x1, %r15b
orb %cl, %r15b
jne 0xfe58
movq 0x5e69f(%rip), %rsi     # 0x6e4d0
cmpq 0x5e6a0(%rip), %rsi     # 0x6e4d8
je 0xfe47
movq %rax, (%rsi)
addq $0x8, 0x5e68b(%rip)     # 0x6e4d0
jmp 0xfe58
leaq 0x5e67a(%rip), %rdi     # 0x6e4c8
leaq 0x10(%rsp), %rdx
callq 0x166c2
movq 0x11179(%rip), %r14     # 0x20fd8
movq (%r14), %rdi
shll $0x8, %r12d
movzwl %r12w, %esi
xorl %edx, %edx
callq 0x5150
movq (%r14), %rdi
subl 0x5e36a(%rip), %ebp     # 0x6e1e4
addl $0xf, %ebp
subl 0x5e35d(%rip), %ebx     # 0x6e1e0
addl $0x18, %ebx
movl %ebp, %esi
movl %ebx, %edx
callq 0x5280
cmpl $-0x1, %eax
je 0xfea7
movq (%r14), %rdi
movsbl 0xc(%rsp), %esi
orl $0x200000, %esi         # imm = 0x200000
callq 0x50a0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq