// File: /workspace/github_cpp_makefile_star2_O1/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 0x2bbe8
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x2bbe8
testb %r14b, %r14b
jle 0x1e2f1
movsbl %r14b, %eax
leal (,%rax,8), %ecx
movl %ecx, -0x38(%rbp)
leal (%rax,%rax), %ecx
movl %ecx, -0x3c(%rbp)
movq %rax, -0x48(%rbp)
cltq
leaq -0x2(%rax), %rcx
movq %rcx, -0x60(%rbp)
leaq 0x21977(%rip), %rdx     # 0x3fac0
leal 0xa(,%rax,2), %ecx
imulq $0x55555556, %rcx, %rcx # imm = 0x55555556
shrq $0x20, %rcx
leal (,%rax,4), %esi
movq %rsi, -0x58(%rbp)
leal -0x2(,%rax,2), %esi
movsbl %sil, %edi
movl %edi, -0x34(%rbp)
movq %rcx, -0x70(%rbp)
subl %ecx, %esi
movl %esi, -0x4c(%rbp)
movq -0x10(%rdx,%rax,8), %r14
xorl %r15d, %r15d
xorl %eax, %eax
movq %rax, -0x68(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, %r12d
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 0x1e00e
testb %al, %al
jne 0x1e1f7
addb $0x2, %r13b
movsbl %r13b, %r13d
cmpl -0x3c(%rbp), %r13d
jl 0x1e198
movl %r15d, %eax
cltd
idivl -0x48(%rbp)
testl %edx, %edx
je 0x1e2dd
movq -0x58(%rbp), %rax
addl %r15d, %eax
cltd
idivl -0x38(%rbp)
movq -0x60(%rbp), %rax
leaq 0x218a4(%rip), %rcx     # 0x3fac0
movq (%rcx,%rax,8), %r13
movq -0x48(%rbp), %rsi
imull %esi, %r15d
addl %r15d, %r15d
movslq %r15d, %rax
movsbl (%r13,%rax), %ecx
movsbl %dl, %r15d
leal 0x2(,%r15,2), %edx
imull %esi, %edx
movslq %edx, %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)
cmpl $0x0, -0x34(%rbp)
js 0x1e2dd
addl %r15d, %r15d
imull -0x48(%rbp), %r15d
movl -0x34(%rbp), %eax
movl %eax, %r12d
leal (%r12,%r15), %eax
cltq
movb (%r13,%rax), %cl
movb 0x1(%r13,%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 -0x4c(%rbp), %r12d
setge %r8b
movq %rbx, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x1e00e
testb %al, %al
jne 0x1e2dd
addb $-0x2, %r12b
movsbl %r12b, %r12d
testl %r12d, %r12d
jns 0x1e278
movq -0x68(%rbp), %rax
incb %al
movsbl %al, %r15d
cmpl %r15d, -0x38(%rbp)
jg 0x1e187
leaq -0x30(%rbp), %rdi
callq 0x2bbf6
leaq -0x2c(%rbp), %rdi
callq 0x2bbf6
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x1e325
jmp 0x1e319
movq %rax, %rbx
leaq -0x30(%rbp), %rdi
callq 0x2bbf6
leaq -0x2c(%rbp), %rdi
callq 0x2bbf6
movq %rbx, %rdi
callq 0x4750