// File: /workspace/github_cpp_makefile_star2_O3/lotuskip[P]yuxtapa/server/viewpoint.cpp
// Function: ViewPoint::fill_loslittbl(char)
void ViewPoint::fill_loslittbl(const char rad)
{
	char line, ind, x, y, oline;
	Coords c, obase;
	// determine which tiles are lit and which are in LOS (see los_lookup.h)
	for(line = 0; line < rad*8; ++line)
	{
		for(ind = 0; ind < 2*rad; ind += 2)
		{
			// lookup next point (NOTE: x,y point directly to loslittbl!!)
			x = loslookup[rad-2][line*2*rad+ind] + VIEWSIZE/2;
			y = loslookup[rad-2][line*2*rad+ind+1] + VIEWSIZE/2;
			c.x = pos.x + x - VIEWSIZE/2;
			c.y = pos.y + y - VIEWSIZE/2;
			if(fill_loslittbl_xy(c, x, y, ind <= 2*(rad+5)/3))
				break;
		}
		// For unsymmetric lines we need to check the other direction, too:
		if(line%rad)
		{
			oline = (line+4*rad)%(rad*8); // the "opposite" line
			obase.x = loslookup[rad-2][line*2*rad] // start pt of orig 'line'
				- loslookup[rad-2][(oline+1)*2*rad-2]; // end pt of 'oline'
			obase.y = loslookup[rad-2][line*2*rad+1] // same thing here
				- loslookup[rad-2][(oline+1)*2*rad-1];
			for(ind = 2*rad-2; ind >= 0; ind -= 2)
			{
				x = loslookup[rad-2][oline*2*rad+ind] + VIEWSIZE/2 + obase.x;
				y = loslookup[rad-2][oline*2*rad+ind+1] + VIEWSIZE/2 + obase.y;
				c.x = pos.x + x - VIEWSIZE/2;
				c.y = pos.y + y - VIEWSIZE/2;
				if(fill_loslittbl_xy(c, x, y, 2*rad-2-ind <= 2*(rad+5)/3))
					break;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %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
jle 0x1e14f
movsbl %r14b, %eax
leal (,%rax,8), %ecx
movl %ecx, -0x38(%rbp)
leal (%rax,%rax), %edx
movq %rax, -0x40(%rbp)
cltq
leaq -0x2(%rax), %rcx
movq %rcx, -0x60(%rbp)
leaq 0x21ab2(%rip), %rsi     # 0x3fa60
leal 0xa(%rdx), %ecx
movl $0xaaaaaaab, %edi       # imm = 0xAAAAAAAB
imulq %rcx, %rdi
shrq $0x21, %rdi
leal (,%rax,4), %ecx
movq %rcx, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
leal -0x2(%rdx), %ecx
movsbl %cl, %edx
movl %edx, -0x34(%rbp)
movq %rdi, -0x70(%rbp)
subl %edi, %ecx
movl %ecx, -0x44(%rbp)
movq -0x10(%rsi,%rax,8), %r14
xorl %r15d, %r15d
xorl %eax, %eax
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %r12
imull %r15d, %r12d
xorl %r13d, %r13d
leal (%r12,%r13), %eax
cltq
movb (%r14,%rax), %cl
movb 0x1(%r14,%rax), %al
addb $0xb, %cl
addb $0xb, %al
movsbl %cl, %edx
movzwl 0x2(%rbx), %ecx
addw %dx, %cx
addl $-0xb, %ecx
movw %cx, -0x2c(%rbp)
movsbl %al, %ecx
movzwl 0x4(%rbx), %eax
addw %cx, %ax
addl $-0xb, %eax
movw %ax, -0x2a(%rbp)
xorl %r8d, %r8d
cmpl -0x70(%rbp), %r13d
setle %r8b
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1de70
testb %al, %al
jne 0x1e057
addb $0x2, %r13b
movsbl %r13b, %r13d
cmpl -0x50(%rbp), %r13d
jl 0x1dff8
movl %r15d, %eax
cltd
idivl -0x40(%rbp)
testl %edx, %edx
je 0x1e13b
movq -0x58(%rbp), %rax
addl %r15d, %eax
cltd
idivl -0x38(%rbp)
movq -0x60(%rbp), %rax
leaq 0x219e4(%rip), %rcx     # 0x3fa60
movq (%rcx,%rax,8), %r12
movq -0x40(%rbp), %rsi
imull %esi, %r15d
addl %r15d, %r15d
movslq %r15d, %rax
movsbl (%r12,%rax), %ecx
movsbl %dl, %r15d
leal 0x2(,%r15,2), %edx
imull %esi, %edx
movslq %edx, %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)
cmpl $0x0, -0x34(%rbp)
js 0x1e13b
addl %r15d, %r15d
imull -0x40(%rbp), %r15d
movl -0x34(%rbp), %eax
movl %eax, %r13d
leal (%r15,%r13), %eax
cltq
movb (%r12,%rax), %cl
movb 0x1(%r12,%rax), %al
addb -0x30(%rbp), %cl
addb $0xb, %cl
addb -0x2e(%rbp), %al
addb $0xb, %al
movsbl %cl, %edx
movzwl 0x2(%rbx), %ecx
addw %dx, %cx
addl $-0xb, %ecx
movw %cx, -0x2c(%rbp)
movsbl %al, %ecx
movzwl 0x4(%rbx), %eax
addw %cx, %ax
addl $-0xb, %eax
movw %ax, -0x2a(%rbp)
xorl %r8d, %r8d
cmpl -0x44(%rbp), %r13d
setge %r8b
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1de70
testb %al, %al
jne 0x1e13b
addb $-0x2, %r13b
movsbl %r13b, %r13d
testl %r13d, %r13d
jns 0x1e0d7
movq -0x68(%rbp), %rax
incb %al
movsbl %al, %r15d
cmpl %r15d, -0x38(%rbp)
jg 0x1dfe9
leaq -0x30(%rbp), %rdi
callq 0x2b7a6
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1e183
jmp 0x1e177
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2b7a6
leaq -0x2c(%rbp), %rdi
callq 0x2b7a6
movq %rbx, %rdi
callq 0x4740