// File: lotuskip[P]yuxtapa/server/actives.cpp
// Function: (anonymous namespace)::update_static_light_r(Coords const&, char)
void update_static_light_r(const Coords &c, const char r)
{
	char line, ind, oline;
	Coords d, obase;
	// see los_lookup.h
	for(line = 0; line < r*8; ++line)
	{
		for(ind = 0; ind < 2*r; ind += 2)
		{
			d.x = loslookup[r-2][line*2*r+ind] + c.x;
			d.y = loslookup[r-2][line*2*r+ind+1] + c.y;
			if(Game::curmap->point_out_of_map(d))
				break;
			//else
			Game::curmap->mod_tile(d)->flags |= TF_LIT;
			if(!(Game::curmap->mod_tile(d)->flags & TF_SEETHRU))
				break; // next line
		}
		// For unsymmetric lines we need to check the other direction, too. See
		// the comments in viewpoint.cpp where we do the same thing.
		if(line%r)
		{
			oline = (line+4*r)%(r*8);
			obase.x = loslookup[r-2][line*2*r] - loslookup[r-2][(oline+1)*2*r-2];
			obase.y = loslookup[r-2][line*2*r+1] - loslookup[r-2][(oline+1)*2*r-1];
			for(ind = 2*r-2; ind >= 0; ind -= 2)
			{
				d.x = loslookup[r-2][oline*2*r+ind] + obase.x + c.x;
				d.y = loslookup[r-2][oline*2*r+ind+1] + obase.y + c.y;
				if(Game::curmap->point_out_of_map(d))
					break;
				//else
				Game::curmap->mod_tile(d)->flags |= TF_LIT;
				if(!(Game::curmap->mod_tile(d)->flags & TF_SEETHRU))
					break; // next line
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
leaq -0x10(%rbp), %rdi
xorl %edx, %edx
movl %edx, -0x28(%rbp)
movl %edx, %esi
callq 0x60430
movl -0x28(%rbp), %edx
leaq -0x14(%rbp), %rdi
movl %edx, %esi
callq 0x60430
jmp 0x48372
movb $0x0, -0xa(%rbp)
movsbl -0xa(%rbp), %eax
movsbl -0x9(%rbp), %ecx
shll $0x3, %ecx
cmpl %ecx, %eax
jge 0x486a7
movb $0x0, -0xb(%rbp)
movsbl -0xb(%rbp), %eax
movsbl -0x9(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x484a6
movsbq -0x9(%rbp), %rax
movl %eax, %edx
leaq 0x44703(%rip), %rcx     # 0x8cab0
movq -0x10(%rcx,%rax,8), %rax
movsbl -0xa(%rbp), %edi
imull %edx, %edi
movsbl -0xb(%rbp), %esi
movl %esi, %edx
movl %edi, %esi
leal (%rdx,%rsi,2), %edx
movslq %edx, %rdx
movsbl (%rax,%rdx), %eax
movq -0x8(%rbp), %rdx
movzwl (%rdx), %edx
addl %edx, %eax
movw %ax, -0x10(%rbp)
movsbq -0x9(%rbp), %rdx
movl %edx, %eax
movq -0x10(%rcx,%rdx,8), %rcx
movsbl -0xa(%rbp), %esi
imull %eax, %esi
movsbl -0xb(%rbp), %edx
movl %edx, %eax
movl %esi, %edx
leal (%rax,%rdx,2), %eax
cltq
movsbl 0x1(%rax,%rcx), %eax
movq -0x8(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0xe(%rbp)
leaq 0x499c6(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x2ba40
movb %al, -0x29(%rbp)
jmp 0x48423
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x4842c
jmp 0x48459
jmp 0x484a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x486bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x14(%rbp), %rdi
callq 0x60460
jmp 0x486bf
leaq 0x49978(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x3d2d0
movzwl (%rax), %ecx
orl $0x10, %ecx
movw %cx, (%rax)
leaq 0x4995c(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x3d2d0
movzwl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x48495
jmp 0x484a6
jmp 0x48497
movsbl -0xb(%rbp), %eax
addl $0x2, %eax
movb %al, -0xb(%rbp)
jmp 0x4838d
movsbl -0xa(%rbp), %eax
movsbl -0x9(%rbp), %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x48698
movsbl -0xa(%rbp), %eax
movsbl -0x9(%rbp), %ecx
shll $0x2, %ecx
addl %ecx, %eax
movsbl -0x9(%rbp), %ecx
shll $0x3, %ecx
cltd
idivl %ecx
movb %dl, %al
movb %al, -0xc(%rbp)
movsbl -0x9(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x445c9(%rip), %rax     # 0x8cab0
movq (%rax,%rcx,8), %rax
movsbl -0xa(%rbp), %ecx
shll %ecx
movsbl -0x9(%rbp), %edx
imull %edx, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
movsbl -0x9(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rdx
leaq 0x445a0(%rip), %rcx     # 0x8cab0
movq (%rcx,%rdx,8), %rcx
movsbl -0xc(%rbp), %edx
addl $0x1, %edx
shll %edx
movsbl -0x9(%rbp), %esi
imull %esi, %edx
subl $0x2, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
subl %ecx, %eax
movw %ax, -0x14(%rbp)
movsbl -0x9(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0x4456b(%rip), %rax     # 0x8cab0
movq (%rax,%rcx,8), %rax
movsbl -0xa(%rbp), %ecx
shll %ecx
movsbl -0x9(%rbp), %edx
imull %edx, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
movsbl -0x9(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rdx
leaq 0x4453f(%rip), %rcx     # 0x8cab0
movq (%rcx,%rdx,8), %rcx
movsbl -0xc(%rbp), %edx
addl $0x1, %edx
shll %edx
movsbl -0x9(%rbp), %esi
imull %esi, %edx
subl $0x1, %edx
movslq %edx, %rdx
movsbl (%rcx,%rdx), %ecx
subl %ecx, %eax
movw %ax, -0x12(%rbp)
movsbl -0x9(%rbp), %eax
shll %eax
subl $0x2, %eax
movb %al, -0xb(%rbp)
movsbl -0xb(%rbp), %eax
cmpl $0x0, %eax
jl 0x48696
movsbq -0x9(%rbp), %rax
movl %eax, %edx
leaq 0x444f4(%rip), %rcx     # 0x8cab0
movq -0x10(%rcx,%rax,8), %rax
movsbl -0xc(%rbp), %edi
imull %edx, %edi
movsbl -0xb(%rbp), %esi
movl %esi, %edx
movl %edi, %esi
leal (%rdx,%rsi,2), %edx
movslq %edx, %rdx
movsbl (%rax,%rdx), %eax
movzwl -0x14(%rbp), %edx
addl %edx, %eax
movq -0x8(%rbp), %rdx
movzwl (%rdx), %edx
addl %edx, %eax
movw %ax, -0x10(%rbp)
movsbq -0x9(%rbp), %rdx
movl %edx, %eax
movq -0x10(%rcx,%rdx,8), %rcx
movsbl -0xc(%rbp), %esi
imull %eax, %esi
movsbl -0xb(%rbp), %edx
movl %edx, %eax
movl %esi, %edx
leal (%rax,%rdx,2), %eax
cltq
movsbl 0x1(%rax,%rcx), %eax
movzwl -0x12(%rbp), %ecx
addl %ecx, %eax
movq -0x8(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
addl %ecx, %eax
movw %ax, -0xe(%rbp)
leaq 0x497ab(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x2ba40
movb %al, -0x2a(%rbp)
jmp 0x4863e
movb -0x2a(%rbp), %al
testb $0x1, %al
jne 0x48647
jmp 0x48649
jmp 0x48696
leaq 0x49788(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x3d2d0
movzwl (%rax), %ecx
orl $0x10, %ecx
movw %cx, (%rax)
leaq 0x4976c(%rip), %rax     # 0x91dd8
movq (%rax), %rdi
leaq -0x10(%rbp), %rsi
callq 0x3d2d0
movzwl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x48685
jmp 0x48696
jmp 0x48687
movsbl -0xb(%rbp), %eax
subl $0x2, %eax
movb %al, -0xb(%rbp)
jmp 0x485a1
jmp 0x48698
jmp 0x4869a
movb -0xa(%rbp), %al
addb $0x1, %al
movb %al, -0xa(%rbp)
jmp 0x48376
leaq -0x14(%rbp), %rdi
callq 0x60460
leaq -0x10(%rbp), %rdi
callq 0x60460
addq $0x30, %rsp
popq %rbp
retq
leaq -0x10(%rbp), %rdi
callq 0x60460
movq -0x20(%rbp), %rdi
callq 0x5920
nopw %cs:(%rax,%rax)