// File: lotuskip[P]yuxtapa/client/view.cpp
// Function: (anonymous namespace)::draw_aimer()
void draw_aimer()
{
	char x, y;
	// if the radius is 0 we don't need all the fancy logic:
	if(aimer.x || aimer.y)
	{
		char rad = std::max(std::abs(aimer.x), std::abs(aimer.y));
		if(rad > 1) // rad == 1 does not require LOS-lookup, either
		{
			char line;
			if(aimer.y == -rad) line = aimer.x+rad;
			else if(aimer.x == rad) line = 3*rad+aimer.y;
			else if(aimer.y == rad) line = 5*rad-aimer.x;
			else /* aimer.x == -rad */ line = 7*rad-aimer.y;

			// Note that we follow the line only two the second last point
			for(char ind = 0; ind < 2*(rad-1); ind += 2)
			{
				x = loslookup[rad-2][line*2*rad+ind] + VIEWSIZE/2;
				y = loslookup[rad-2][line*2*rad+ind+1] + VIEWSIZE/2;
				// do not draw past PCs or unpassables; and end in red for PCs
				if(some_pc_at(x,y))
				{
					Base::print_str(aimerpath, C_FIREB_TRAP, x, y, VIEW_WIN);
					break;
				} // else
				Base::print_str(aimerpath, C_ARROW, x, y, VIEW_WIN);
				if(viewbuffer[(y*VIEWSIZE+x)*2+1] == '#'
					|| viewbuffer[(y*VIEWSIZE+x)*2+1] == '+'
					|| viewbuffer[(y*VIEWSIZE+x)*2+1] == 'O')
					break;
			}
		}
	}
	x = VIEWSIZE/2 + aimer.x;
	y = VIEWSIZE/2 + aimer.y;
	if((x == VIEWSIZE/2 && y == VIEWSIZE/2) || viewbuffer[(y*VIEWSIZE+x)*2+1] != '@')
		Base::print_str(aimerend, C_ARROW_LIT, x, y, VIEW_WIN);
	else
		Base::print_str(aimerend, C_FIREB_TRAP, x, y, VIEW_WIN);

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xfa31(%rip), %rax      # 0x28ea0
cmpw $0x0, (%rax)
jne 0x19487
leaq 0xfa24(%rip), %rax      # 0x28ea0
cmpw $0x0, 0x2(%rax)
je 0x196da
leaq 0xfa12(%rip), %rax      # 0x28ea0
movswl (%rax), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0x8(%rbp)
leaq 0xf9fe(%rip), %rax      # 0x28ea0
movswl 0x2(%rax), %eax
movl %eax, %ecx
negl %ecx
cmovnsl %ecx, %eax
movl %eax, -0xc(%rbp)
leaq -0x8(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0xd440
movl (%rax), %eax
movb %al, -0x3(%rbp)
movsbl -0x3(%rbp), %eax
cmpl $0x1, %eax
jle 0x196d8
leaq 0xf9ca(%rip), %rax      # 0x28ea0
movswl 0x2(%rax), %eax
movsbl -0x3(%rbp), %edx
xorl %ecx, %ecx
subl %edx, %ecx
cmpl %ecx, %eax
jne 0x194fb
leaq 0xf9b3(%rip), %rax      # 0x28ea0
movswl (%rax), %eax
movsbl -0x3(%rbp), %ecx
addl %ecx, %eax
movb %al, -0xd(%rbp)
jmp 0x1956c
leaq 0xf99e(%rip), %rax      # 0x28ea0
movswl (%rax), %eax
movsbl -0x3(%rbp), %ecx
cmpl %ecx, %eax
jne 0x19526
movsbl -0x3(%rbp), %eax
imull $0x3, %eax, %eax
leaq 0xf985(%rip), %rcx      # 0x28ea0
movswl 0x2(%rcx), %ecx
addl %ecx, %eax
movb %al, -0xd(%rbp)
jmp 0x1956a
leaq 0xf973(%rip), %rax      # 0x28ea0
movswl 0x2(%rax), %eax
movsbl -0x3(%rbp), %ecx
cmpl %ecx, %eax
jne 0x19551
movsbl -0x3(%rbp), %eax
imull $0x5, %eax, %eax
leaq 0xf959(%rip), %rcx      # 0x28ea0
movswl (%rcx), %ecx
subl %ecx, %eax
movb %al, -0xd(%rbp)
jmp 0x19568
movsbl -0x3(%rbp), %eax
imull $0x7, %eax, %eax
leaq 0xf941(%rip), %rcx      # 0x28ea0
movswl 0x2(%rcx), %ecx
subl %ecx, %eax
movb %al, -0xd(%rbp)
jmp 0x1956a
jmp 0x1956c
movb $0x0, -0xe(%rbp)
movsbl -0xe(%rbp), %eax
movsbl -0x3(%rbp), %ecx
subl $0x1, %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x196d6
movsbl -0x3(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0xe76a(%rip), %rax      # 0x27d00
movq (%rax,%rcx,8), %rax
movsbl -0xd(%rbp), %ecx
shll %ecx
movsbl -0x3(%rbp), %edx
imull %edx, %ecx
movsbl -0xe(%rbp), %edx
addl %edx, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
addl $0xb, %eax
movb %al, -0x1(%rbp)
movsbl -0x3(%rbp), %eax
subl $0x2, %eax
movslq %eax, %rcx
leaq 0xe735(%rip), %rax      # 0x27d00
movq (%rax,%rcx,8), %rax
movsbl -0xd(%rbp), %ecx
shll %ecx
movsbl -0x3(%rbp), %edx
imull %edx, %ecx
movsbl -0xe(%rbp), %edx
addl %edx, %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
addl $0xb, %eax
movb %al, -0x2(%rbp)
movb -0x1(%rbp), %al
movsbl %al, %edi
movsbl -0x2(%rbp), %esi
callq 0x19a70
testb $0x1, %al
jne 0x19607
jmp 0x19630
movb -0x1(%rbp), %al
leaq 0x3a9e(%rip), %rdi      # 0x1d0af
movl $0x25, %esi
movl $0x3, %r8d
xorl %r9d, %r9d
movsbl %al, %edx
movsbl -0x2(%rbp), %ecx
callq 0x9480
jmp 0x196d6
movb -0x1(%rbp), %al
leaq 0x3a75(%rip), %rdi      # 0x1d0af
movl $0x2a, %esi
movl $0x3, %r8d
xorl %r9d, %r9d
movsbl %al, %edx
movsbl -0x2(%rbp), %ecx
callq 0x9480
movsbl -0x2(%rbp), %eax
imull $0x17, %eax, %eax
movsbl -0x1(%rbp), %ecx
addl %ecx, %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x111b0(%rip), %rax     # 0x2a820
movsbl (%rax,%rcx), %eax
cmpl $0x23, %eax
je 0x196c3
movsbl -0x2(%rbp), %eax
imull $0x17, %eax, %eax
movsbl -0x1(%rbp), %ecx
addl %ecx, %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x1118b(%rip), %rax     # 0x2a820
movsbl (%rax,%rcx), %eax
cmpl $0x2b, %eax
je 0x196c3
movsbl -0x2(%rbp), %eax
imull $0x17, %eax, %eax
movsbl -0x1(%rbp), %ecx
addl %ecx, %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x11166(%rip), %rax     # 0x2a820
movsbl (%rax,%rcx), %eax
cmpl $0x4f, %eax
jne 0x196c5
jmp 0x196d6
jmp 0x196c7
movsbl -0xe(%rbp), %eax
addl $0x2, %eax
movb %al, -0xe(%rbp)
jmp 0x19570
jmp 0x196d8
jmp 0x196da
leaq 0xf7bf(%rip), %rax      # 0x28ea0
movswl (%rax), %eax
addl $0xb, %eax
movb %al, -0x1(%rbp)
leaq 0xf7af(%rip), %rax      # 0x28ea0
movswl 0x2(%rax), %eax
addl $0xb, %eax
movb %al, -0x2(%rbp)
movsbl -0x1(%rbp), %eax
cmpl $0xb, %eax
jne 0x1970d
movsbl -0x2(%rbp), %eax
cmpl $0xb, %eax
je 0x19732
movsbl -0x2(%rbp), %eax
imull $0x17, %eax, %eax
movsbl -0x1(%rbp), %ecx
addl %ecx, %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x110f7(%rip), %rax     # 0x2a820
movsbl (%rax,%rcx), %eax
cmpl $0x40, %eax
je 0x19758
movb -0x1(%rbp), %al
leaq 0x3975(%rip), %rdi      # 0x1d0b1
movl $0x3e, %esi
movl $0x3, %r8d
xorl %r9d, %r9d
movsbl %al, %edx
movsbl -0x2(%rbp), %ecx
callq 0x9480
jmp 0x1977c
movb -0x1(%rbp), %al
leaq 0x394f(%rip), %rdi      # 0x1d0b1
movl $0x25, %esi
movl $0x3, %r8d
xorl %r9d, %r9d
movsbl %al, %edx
movsbl -0x2(%rbp), %ecx
callq 0x9480
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)