// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leaq -0x2c(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x24d90
movzbl %r14b, %eax
leal (,%rax,8), %ecx
movl %ecx, -0x34(%rbp)
leal (%rax,%rax), %ecx
movl %ecx, -0x38(%rbp)
leal -0x2(%rax), %ecx
movq %rcx, -0x50(%rbp)
leal (,%rax,4), %ecx
movq %rcx, -0x58(%rbp)
movq %rax, -0x48(%rbp)
shll $0x19, %eax
addl $0xfe000000, %eax       # imm = 0xFE000000
movl %eax, -0x3c(%rbp)
xorl %eax, %eax
leaq 0x26809(%rip), %r14     # 0x41c58
movsbl %al, %r15d
cmpl %r15d, -0x34(%rbp)
jle 0x1b5d7
movl %eax, -0x40(%rbp)
movl -0x38(%rbp), %eax
movl %eax, %r12d
imull %r15d, %r12d
xorl %r13d, %r13d
movsbl %r13b, %r13d
cmpl -0x38(%rbp), %r13d
jge 0x1b4e4
movq -0x50(%rbp), %rax
leaq 0x2167e(%rip), %rcx     # 0x3cb00
movq (%rcx,%rax,8), %rax
leal (%r12,%r13), %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %edx
addw (%rbx), %dx
movw %dx, -0x2c(%rbp)
movsbl 0x1(%rax,%rcx), %eax
addw 0x2(%rbx), %ax
movw %ax, -0x2a(%rbp)
movq (%r14), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1256c
testb %al, %al
jne 0x1b4e4
movq (%r14), %rax
movswq -0x2a(%rbp), %rcx
movq 0x8(%rax), %rax
imulq $0x18, %rcx, %rcx
movswq -0x2c(%rbp), %rdx
movq (%rax,%rcx), %rax
movzwl (%rax,%rdx,4), %ecx
movl %ecx, %esi
orl $0x10, %esi
movw %si, (%rax,%rdx,4)
addl $0x2, %r13d
testb $0x4, %cl
jne 0x1b46d
movl %r15d, %eax
cltd
idivl -0x48(%rbp)
testl %edx, %edx
je 0x1b5cd
movq -0x58(%rbp), %rax
addl %r15d, %eax
cltd
idivl -0x34(%rbp)
movq -0x50(%rbp), %rax
leaq 0x215f7(%rip), %rcx     # 0x3cb00
movq (%rcx,%rax,8), %r12
movq -0x48(%rbp), %rdi
imull %edi, %r15d
addl %r15d, %r15d
movslq %r15d, %rax
movsbl (%r12,%rax), %ecx
movsbl %dl, %edx
leal 0x2(,%rdx,2), %esi
movl %edx, %r15d
addl %edx, %r15d
imull %edi, %esi
movslq %esi, %rdx
movsbl -0x2(%r12,%rdx), %esi
subl %esi, %ecx
movw %cx, -0x30(%rbp)
movsbl 0x1(%r12,%rax), %eax
movsbl -0x1(%r12,%rdx), %ecx
subl %ecx, %eax
movw %ax, -0x2e(%rbp)
imull %edi, %r15d
movl -0x3c(%rbp), %r13d
movl %r13d, %eax
sarl $0x18, %eax
js 0x1b5cd
addl %r15d, %eax
cltq
movsbl (%r12,%rax), %ecx
addw -0x30(%rbp), %cx
addw (%rbx), %cx
movw %cx, -0x2c(%rbp)
movsbl 0x1(%r12,%rax), %eax
addw -0x2e(%rbp), %ax
addw 0x2(%rbx), %ax
movw %ax, -0x2a(%rbp)
movq (%r14), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1256c
testb %al, %al
jne 0x1b5cd
movq (%r14), %rax
movswq -0x2a(%rbp), %rcx
movq 0x8(%rax), %rax
imulq $0x18, %rcx, %rcx
movswq -0x2c(%rbp), %rdx
movq (%rax,%rcx), %rax
movzwl (%rax,%rdx,4), %ecx
movl %ecx, %esi
orl $0x10, %esi
movw %si, (%rax,%rdx,4)
addl $0xfe000000, %r13d      # imm = 0xFE000000
testb $0x4, %cl
jne 0x1b55c
movl -0x40(%rbp), %eax
incb %al
jmp 0x1b44f
leaq -0x30(%rbp), %rdi
callq 0x24d9e
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1b60b
jmp 0x1b5ff
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x24d9e
leaq -0x2c(%rbp), %rdi
callq 0x24d9e
movq %rbx, %rdi
callq 0x4710