// File: lotuskip[P]yuxtapa/server/actives.cpp
// Function: is_dynlit(Coords const&)
bool is_dynlit(const Coords &c)
{
	// A tile is dynamically lit <=> there is a lighting OccEnt close to it,
	// in LOS. (There is no such thing as a "dynamic light" entity.)
	for(list<PCEnt>::const_iterator pc_it = PCs.begin(); pc_it != PCs.end(); ++pc_it)
	{
		/* NOTE! This works as long as CARRIED_TORCH_RAD <= 6. If it becomes 7
		 * or more, we need to worry about "blind spots" the same way as with
		 * the LOS considerations in update_static_light. */
		if(!pc_it->isvoid() && pc_it->torch_is_lit()
			&& Game::curmap->LOS_between(c, pc_it->getpos(), CARRIED_TORCH_RAD))
			return true;
	}
	for(list<MM>::const_iterator m_it = MMs.begin(); m_it != MMs.end(); ++m_it)
	{
		if(!m_it->isvoid()
			&& Game::curmap->LOS_between(c, m_it->getpos(), 1))
			return true;
	}
	for(list<Zap>::const_iterator z_it = zaps.begin(); z_it != zaps.end(); ++z_it)
	{
		if(!z_it->isvoid()
			&& Game::curmap->LOS_between(c, z_it->getpos(), 1))
			return true;
	}
	for(list<Coords>::const_iterator fb_it = fball_centers.begin(); 
		fb_it != fball_centers.end(); ++fb_it)
	{
		// fireballs light a rad 4
		if(Game::curmap->LOS_between(c, *fb_it, 4))
			return true;
	}
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0x10(%rbp)
leaq 0x4a2da(%rip), %rdi     # 0x93050
callq 0x3cfb0
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x3d0b0
leaq 0x4a2bd(%rip), %rdi     # 0x93050
callq 0x3d010
movq %rax, -0x30(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x3d0b0
leaq -0x18(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x4a4f0
testb $0x1, %al
jne 0x48dbf
jmp 0x48ee4
leaq -0x18(%rbp), %rdi
callq 0x4a520
movq %rax, %rdi
callq 0x3ce40
movb %al, %cl
movb $0x0, -0x35(%rbp)
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xb9(%rbp)
jne 0x48e80
leaq -0x18(%rbp), %rdi
callq 0x4a520
movq %rax, %rdi
callq 0x3d0d0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xb9(%rbp)
jne 0x48e09
jmp 0x48e80
leaq 0x48fc8(%rip), %rax     # 0x91dd8
movq (%rax), %rax
movq %rax, -0xd8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x4a520
movq %rax, %rsi
leaq -0x34(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0x1b190
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
movb $0x1, -0x35(%rbp)
movl $0x6, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x2c2b0
movb %al, -0xba(%rbp)
jmp 0x48e72
movb -0xba(%rbp), %al
movb %al, -0xb9(%rbp)
jmp 0x48e80
movb -0xb9(%rbp), %al
movb %al, -0xd9(%rbp)
testb $0x1, -0x35(%rbp)
jne 0x48e94
jmp 0x48e9d
leaq -0x34(%rbp), %rdi
callq 0x60460
movb -0xd9(%rbp), %al
testb $0x1, %al
jne 0x48ea9
jmp 0x48ed4
movb $0x1, -0x1(%rbp)
jmp 0x49274
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x35(%rbp)
jne 0x48ec6
jmp 0x48ecf
leaq -0x34(%rbp), %rdi
callq 0x60460
jmp 0x49282
jmp 0x48ed6
leaq -0x18(%rbp), %rdi
callq 0x4a550
jmp 0x48d8c
leaq 0x4a135(%rip), %rdi     # 0x93020
callq 0x3cbc0
movq %rax, -0x58(%rbp)
leaq -0x50(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x3cf20
leaq 0x4a118(%rip), %rdi     # 0x93020
callq 0x3cc20
movq %rax, -0x68(%rbp)
leaq -0x60(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x3cf20
leaq -0x50(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x4a3d0
testb $0x1, %al
jne 0x48f34
jmp 0x49033
leaq -0x50(%rbp), %rdi
callq 0x4a400
movq %rax, %rdi
callq 0x3ce40
movb %al, %cl
movb $0x0, -0x6d(%rbp)
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xda(%rbp)
jne 0x48fcf
leaq 0x48e79(%rip), %rax     # 0x91dd8
movq (%rax), %rax
movq %rax, -0xf8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x4a400
movq %rax, %rsi
leaq -0x6c(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0x1b190
movq -0xf8(%rbp), %rdi
movq -0xf0(%rbp), %rsi
movq -0xe8(%rbp), %rdx
movb $0x1, -0x6d(%rbp)
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x2c2b0
movb %al, -0xdb(%rbp)
jmp 0x48fc1
movb -0xdb(%rbp), %al
movb %al, -0xda(%rbp)
jmp 0x48fcf
movb -0xda(%rbp), %al
movb %al, -0xf9(%rbp)
testb $0x1, -0x6d(%rbp)
jne 0x48fe3
jmp 0x48fec
leaq -0x6c(%rbp), %rdi
callq 0x60460
movb -0xf9(%rbp), %al
testb $0x1, %al
jne 0x48ff8
jmp 0x49023
movb $0x1, -0x1(%rbp)
jmp 0x49274
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x6d(%rbp)
jne 0x49015
jmp 0x4901e
leaq -0x6c(%rbp), %rdi
callq 0x60460
jmp 0x49282
jmp 0x49025
leaq -0x50(%rbp), %rdi
callq 0x4a430
jmp 0x48f01
leaq 0x49ffe(%rip), %rdi     # 0x93038
callq 0x3ccc0
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x3cf90
leaq 0x49fe1(%rip), %rdi     # 0x93038
callq 0x3cd20
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x3cf90
leaq -0x78(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4a450
testb $0x1, %al
jne 0x4908f
jmp 0x491a3
leaq -0x78(%rbp), %rdi
callq 0x4a480
movq %rax, %rdi
callq 0x3ce40
movb %al, %cl
movb $0x0, -0x95(%rbp)
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0xfa(%rbp)
jne 0x49133
leaq 0x48d1b(%rip), %rax     # 0x91dd8
movq (%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x4a480
movq %rax, %rsi
leaq -0x94(%rbp), %rdi
movq %rdi, -0x108(%rbp)
callq 0x1b190
movq -0x118(%rbp), %rdi
movq -0x110(%rbp), %rsi
movq -0x108(%rbp), %rdx
movb $0x1, -0x95(%rbp)
movl $0x1, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x2c2b0
movb %al, -0xfb(%rbp)
jmp 0x49125
movb -0xfb(%rbp), %al
movb %al, -0xfa(%rbp)
jmp 0x49133
movb -0xfa(%rbp), %al
movb %al, -0x119(%rbp)
testb $0x1, -0x95(%rbp)
jne 0x4914a
jmp 0x49156
leaq -0x94(%rbp), %rdi
callq 0x60460
movb -0x119(%rbp), %al
testb $0x1, %al
jne 0x49162
jmp 0x49193
movb $0x1, -0x1(%rbp)
jmp 0x49274
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x95(%rbp)
jne 0x49182
jmp 0x4918e
leaq -0x94(%rbp), %rdi
callq 0x60460
jmp 0x49282
jmp 0x49195
leaq -0x78(%rbp), %rdi
callq 0x4a4b0
jmp 0x49050
leaq 0x49f86(%rip), %rdi     # 0x93130
callq 0x4a570
movq %rax, -0xa8(%rbp)
leaq -0xa0(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x4a5a0
leaq 0x49f60(%rip), %rdi     # 0x93130
callq 0x444a0
movq %rax, -0xb8(%rbp)
leaq -0xb0(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4a5a0
leaq -0xa0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4a5c0
testb $0x1, %al
jne 0x49208
jmp 0x49270
leaq 0x48bc9(%rip), %rax     # 0x91dd8
movq (%rax), %rax
movq %rax, -0x130(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x4a5f0
movq -0x130(%rbp), %rdi
movq -0x128(%rbp), %rsi
movq %rax, %rdx
movl $0x4, %ecx
movl $0xffffffff, %r8d       # imm = 0xFFFFFFFF
callq 0x2c2b0
testb $0x1, %al
jne 0x49257
jmp 0x4925d
movb $0x1, -0x1(%rbp)
jmp 0x49274
jmp 0x4925f
leaq -0xa0(%rbp), %rdi
callq 0x4a620
jmp 0x491c9
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x5920
nopl (%rax,%rax)