// File: /workspace/github_cpp_makefile_star2_O1/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 0x2bbe8
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2bbe8
testb %r14b, %r14b
je 0x20f56
movzbl %r14b, %eax
leal (,%rax,8), %ecx
movl %ecx, -0x34(%rbp)
leal (%rax,%rax), %ecx
movl %ecx, -0x38(%rbp)
leal -0x2(%rax), %ecx
leaq 0x1eda6(%rip), %rdx     # 0x3fb40
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
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 0x23e6f(%rip), %rax     # 0x44c68
movq (%rax), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1704c
testb %al, %al
jne 0x20e49
leaq 0x23e58(%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)
testb $0x4, %cl
je 0x20e49
addb $0x2, %r14b
movsbl %r14b, %r14d
cmpl -0x38(%rbp), %r14d
jl 0x20dd2
movl %r15d, %eax
cltd
idivl -0x48(%rbp)
testl %edx, %edx
je 0x20f42
movq -0x50(%rbp), %rax
addl %r15d, %eax
cltd
idivl -0x34(%rbp)
movq -0x58(%rbp), %rax
leaq 0x1ecd2(%rip), %rcx     # 0x3fb40
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 0x20f42
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 0x23d6f(%rip), %rax     # 0x44c68
movq (%rax), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1704c
testb %al, %al
jne 0x20f42
leaq 0x23d58(%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 0x20ec2
movq -0x60(%rbp), %rax
incb %al
movsbl %al, %r15d
cmpl %r15d, -0x34(%rbp)
jg 0x20dc1
leaq -0x30(%rbp), %rdi
callq 0x2bbf6
leaq -0x2c(%rbp), %rdi
callq 0x2bbf6
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x20f8a
jmp 0x20f7e
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2bbf6
leaq -0x2c(%rbp), %rdi
callq 0x2bbf6
movq %rbx, %rdi
callq 0x4750