// File: /workspace/github_cpp_makefile_star2_O1/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 0x10343
movl $0x96, %eax
cmpl %eax, %ebx
setl %cl
cmpl %eax, %ebp
setl %al
testb %al, %cl
je 0x10343
movl %edx, %r15d
movslq %ebx, %r14
movslq %ebp, %r13
imulq $0x258, %r14, %rsi      # imm = 0x258
leaq 0x1111b(%rip), %rcx     # 0x21350
addq %rsi, %rcx
movslq (%rcx,%r13,4), %rcx
leaq 0x8321(%rip), %rdx      # 0x18564
movb (%rcx,%rdx), %al
leaq 0x82e3(%rip), %rdx      # 0x18530
movl (%rdx,%rcx,4), %r12d
imulq $0x96, %r14, %rcx
leaq 0x52fa1(%rip), %rdx     # 0x63200
addq %rcx, %rdx
cmpb $0x0, (%r13,%rdx)
jne 0x10277
cmpb $0x0, 0x110b1(%rip)     # 0x21322
je 0x103e5
cmpb $0x1, 0x110a4(%rip)     # 0x21322
jne 0x10295
leaq 0x27059(%rip), %rcx     # 0x372e0
addq %rsi, %rcx
movss (%rcx,%r13,4), %xmm0
callq 0x10167
imulq $0x4b0, %r14, %r14      # imm = 0x4B0
leaq 0x8a22d(%rip), %rcx     # 0x9a4d0
addq %r14, %rcx
movq (%rcx,%r13,8), %rcx
testq %rcx, %rcx
je 0x102b6
movb 0xc(%rcx), %al
movl 0x8(%rcx), %r12d
movq %rax, 0x8(%rsp)
movl %ebx, %edi
movl %ebp, %esi
callq 0xfcc5
testb %al, %al
je 0x1039b
leaq 0x5e22d(%rip), %rax     # 0x6e500
addq %r14, %rax
movq (%rax,%r13,8), %rax
testq %rax, %rax
je 0x10441
movq %rax, 0x10(%rsp)
movq (%rax), %rcx
movb 0x24(%rcx), %sil
leal -0x61(%rsi), %edx
cmpb $0x19, %dl
ja 0x1030a
movzbl %sil, %edx
addb $-0x20, %sil
movzbl %sil, %esi
cmpb $0x0, 0x14(%rax)
cmovel %edx, %esi
movq %rsi, 0x8(%rsp)
movl 0x4(%rcx), %edx
leal 0x3(%rdx), %esi
testl %edx, %edx
cmovnsl %edx, %esi
sarl $0x2, %esi
movl $0x1, %r12d
cmpl %esi, 0xc(%rax)
jl 0x1032c
movl 0x28(%rcx), %r12d
movb $0x1, 0x49(%rcx)
cmpb $0x1, 0x14(%rax)
jne 0x103fc
movb $0x1, 0x48(%rcx)
jmp 0x10400
movq 0x10c8e(%rip), %r14     # 0x20fd8
movq (%r14), %rdi
movl $0x700, %esi            # imm = 0x700
xorl %edx, %edx
callq 0x5150
movq (%r14), %rdi
subl 0x5de92(%rip), %ebp     # 0x6e1f4
addl $0xf, %ebp
subl 0x5de85(%rip), %ebx     # 0x6e1f0
addl $0x18, %ebx
movl %ebp, %esi
movl %ebx, %edx
callq 0x5280
cmpl $-0x1, %eax
je 0x10490
movq (%r14), %rdi
movl $0x20, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x50a0
movq 0x10c36(%rip), %r14     # 0x20fd8
movq (%r14), %rdi
shll $0x8, %r12d
movzwl %r12w, %esi
xorl %edx, %edx
callq 0x5150
movq (%r14), %rdi
subl 0x5de37(%rip), %ebp     # 0x6e1f4
addl $0xf, %ebp
subl 0x5de2a(%rip), %ebx     # 0x6e1f0
addl $0x18, %ebx
movl %ebp, %esi
movl %ebx, %edx
callq 0x5280
cmpl $-0x1, %eax
je 0x10490
movq (%r14), %rdi
movsbl 0x8(%rsp), %esi
jmp 0x10388
movq 0x10bec(%rip), %r14     # 0x20fd8
movq (%r14), %rdi
shll $0x8, %r12d
movzwl %r12w, %esi
jmp 0x10352
movb $0x1, 0x47(%rcx)
cmpq 0x5e0e9(%rip), %rax     # 0x6e4f0
sete %cl
xorb $0x1, %r15b
orb %cl, %r15b
jne 0x10441
movq 0x5e0c6(%rip), %rsi     # 0x6e4e0
cmpq 0x5e0c7(%rip), %rsi     # 0x6e4e8
je 0x10430
movq %rax, (%rsi)
addq $0x8, 0x5e0b2(%rip)     # 0x6e4e0
jmp 0x10441
leaq 0x5e0a1(%rip), %rdi     # 0x6e4d8
leaq 0x10(%rsp), %rdx
callq 0x16e3a
movq 0x10b90(%rip), %r14     # 0x20fd8
movq (%r14), %rdi
shll $0x8, %r12d
movzwl %r12w, %esi
xorl %edx, %edx
callq 0x5150
movq (%r14), %rdi
subl 0x5dd91(%rip), %ebp     # 0x6e1f4
addl $0xf, %ebp
subl 0x5dd84(%rip), %ebx     # 0x6e1f0
addl $0x18, %ebx
movl %ebp, %esi
movl %ebx, %edx
callq 0x5280
cmpl $-0x1, %eax
je 0x10490
movq (%r14), %rdi
movsbl 0x8(%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