// File: /workspace/github_cpp_makefile_star2_O3/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 0x2b798
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2b798
testb %r14b, %r14b
je 0x20df4
movzbl %r14b, %eax
leal (,%rax,8), %ecx
movl %ecx, -0x34(%rbp)
leal (%rax,%rax), %ecx
movl %ecx, -0x38(%rbp)
leal -0x2(%rax), %ecx
leaq 0x1eeb8(%rip), %rdx     # 0x3faf0
leal (,%rax,4), %esi
movq %rsi, -0x50(%rbp)
movq %rax, -0x48(%rbp)
shll $0x19, %eax
movq %rcx, -0x58(%rbp)
movq (%rdx,%rcx,8), %r12
addl $0xfe000000, %eax       # imm = 0xFE000000
movl %eax, -0x3c(%rbp)
xorl %r15d, %r15d
xorl %eax, %eax
movq %rax, -0x60(%rbp)
movl -0x38(%rbp), %eax
movl %eax, %r13d
imull %r15d, %r13d
leaq 0x23ff4(%rip), %rax     # 0x44c68
movq (%rax), %rdi
xorl %r14d, %r14d
leal (%r14,%r13), %eax
cltq
movsbl (%r12,%rax), %ecx
addw (%rbx), %cx
movw %cx, -0x2c(%rbp)
movsbl 0x1(%r12,%rax), %eax
addw 0x2(%rbx), %ax
movw %ax, -0x2a(%rbp)
leaq -0x2c(%rbp), %rsi
callq 0x16f24
testb %al, %al
jne 0x20ce7
leaq 0x23fba(%rip), %rax     # 0x44c68
movq (%rax), %rdi
movswq -0x2a(%rbp), %rax
movq 0x8(%rdi), %rcx
leaq (%rax,%rax,2), %rax
movswq -0x2c(%rbp), %rdx
movq (%rcx,%rax,8), %rax
movzwl (%rax,%rdx,4), %ecx
movl %ecx, %esi
orl $0x10, %esi
movw %si, (%rax,%rdx,4)
testb $0x4, %cl
je 0x20ce7
addb $0x2, %r14b
movsbl %r14b, %r14d
cmpl -0x38(%rbp), %r14d
jl 0x20c7a
movl %r15d, %eax
cltd
idivl -0x48(%rbp)
testl %edx, %edx
je 0x20de0
movq -0x50(%rbp), %rax
addl %r15d, %eax
cltd
idivl -0x34(%rbp)
movq -0x58(%rbp), %rax
leaq 0x1ede4(%rip), %rcx     # 0x3faf0
movq (%rcx,%rax,8), %r13
movq -0x48(%rbp), %rdi
imull %edi, %r15d
addl %r15d, %r15d
movslq %r15d, %rax
movsbl (%r13,%rax), %ecx
movsbl %dl, %edx
leal 0x2(,%rdx,2), %esi
movl %edx, %r15d
addl %edx, %r15d
imull %edi, %esi
movslq %esi, %rdx
movsbl -0x2(%r13,%rdx), %esi
subl %esi, %ecx
movw %cx, -0x30(%rbp)
movsbl 0x1(%r13,%rax), %eax
movsbl -0x1(%r13,%rdx), %ecx
subl %ecx, %eax
movw %ax, -0x2e(%rbp)
imull %edi, %r15d
movl -0x3c(%rbp), %r14d
movl %r14d, %eax
sarl $0x18, %eax
js 0x20de0
addl %r15d, %eax
cltq
movsbl (%r13,%rax), %ecx
addw -0x30(%rbp), %cx
addw (%rbx), %cx
movw %cx, -0x2c(%rbp)
movsbl 0x1(%r13,%rax), %eax
addw -0x2e(%rbp), %ax
addw 0x2(%rbx), %ax
movw %ax, -0x2a(%rbp)
leaq 0x23ed1(%rip), %rax     # 0x44c68
movq (%rax), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x16f24
testb %al, %al
jne 0x20de0
leaq 0x23eba(%rip), %rax     # 0x44c68
movq (%rax), %rax
movswq -0x2a(%rbp), %rcx
movq 0x8(%rax), %rax
leaq (%rcx,%rcx,2), %rcx
movswq -0x2c(%rbp), %rdx
movq (%rax,%rcx,8), %rax
movzwl (%rax,%rdx,4), %ecx
movl %ecx, %esi
orl $0x10, %esi
movw %si, (%rax,%rdx,4)
addl $0xfe000000, %r14d      # imm = 0xFE000000
testb $0x4, %cl
jne 0x20d60
movq -0x60(%rbp), %rax
incb %al
movsbl %al, %r15d
cmpl %r15d, -0x34(%rbp)
jg 0x20c5f
leaq -0x30(%rbp), %rdi
callq 0x2b7a6
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x20e28
jmp 0x20e1c
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2b7a6
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
movq %rbx, %rdi
callq 0x4740