// File: lotuskip[P]yuxtapa/server/occent.cpp
// Function: Arrow::Arrow(Coords, std::_List_iterator<Player>)
Arrow::Arrow(Coords t, const list<Player>::iterator o)
	: OwnedEnt(o->own_pc->getpos(), '|', C_ARROW, o)
{
	char r = t.dist_walk(Coords(0,0));
	if(r == 1)
		path.push_back(Coords(t.x+pos.x, t.y+pos.y)); // and done
	else
	{
		char line, ind;
		// see common/los_lookup.h
		if(t.y == -r) line = t.x + r;
		else if(t.x == r) line = 3*r + t.y;
		else if(t.y == r) line = 5*r - t.x;
		else /* t.x == -r */ line = 7*r - t.y;
		for(ind = 0; ind < 2*r; ind += 2)
			path.push_back(Coords(loslookup[r-2][line*2*r+ind] + pos.x,
				loslookup[r-2][line*2*r+ind+1] + pos.y));
	}
	pos = Coords(0,0); // indicates the arrow isn't anywhere yet
	init_path_len = path.size();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rsi, -0x60(%rbp)
movq %rdx, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x8(%rbp), %rdi
callq 0x1b050
movq 0x138(%rax), %rsi
leaq -0x1c(%rbp), %rdi
movq %rdi, -0x50(%rbp)
callq 0x1b190
movq -0x58(%rbp), %rdi
movq -0x50(%rbp), %rsi
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %r8
movl $0x7c, %edx
movl $0x2a, %ecx
callq 0x4d970
jmp 0x4db25
leaq -0x1c(%rbp), %rdi
callq 0x60460
movq -0x58(%rbp), %rdi
leaq 0x3f0c7(%rip), %rax     # 0x8cc00
movq %rax, (%rdi)
addq $0x18, %rdi
movq %rdi, -0x68(%rbp)
callq 0x42a10
leaq -0x3a(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x60430
jmp 0x4db58
movq -0x60(%rbp), %rdi
leaq -0x3a(%rbp), %rsi
callq 0x604f0
movw %ax, -0x6a(%rbp)
jmp 0x4db6b
movw -0x6a(%rbp), %ax
movb %al, -0x6b(%rbp)
leaq -0x3a(%rbp), %rdi
callq 0x60460
movb -0x6b(%rbp), %al
movb %al, -0x35(%rbp)
movsbl -0x35(%rbp), %eax
cmpl $0x1, %eax
jne 0x4dc40
movq -0x58(%rbp), %rdx
movq -0x60(%rbp), %rax
movq %rdx, %rcx
addq $0x18, %rcx
movq %rcx, -0x78(%rbp)
movzwl (%rax), %ecx
movl 0x8(%rdx), %esi
addl %esi, %ecx
movzwl 0x2(%rax), %eax
movzwl 0xa(%rdx), %edx
addl %edx, %eax
movswl %cx, %esi
movswl %ax, %edx
leaq -0x3e(%rbp), %rdi
callq 0x60430
jmp 0x4dbc4
movq -0x78(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
callq 0x42ba0
jmp 0x4dbd3
leaq -0x3e(%rbp), %rdi
callq 0x60460
jmp 0x4dd7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x1c(%rbp), %rdi
callq 0x60460
jmp 0x4ddce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x4ddbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x3a(%rbp), %rdi
callq 0x60460
jmp 0x4ddbc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x3e(%rbp), %rdi
callq 0x60460
jmp 0x4ddbc
movq -0x60(%rbp), %rax
movswl 0x2(%rax), %eax
movsbl -0x35(%rbp), %edx
xorl %ecx, %ecx
subl %edx, %ecx
cmpl %ecx, %eax
jne 0x4dc66
movq -0x60(%rbp), %rax
movswl (%rax), %eax
movsbl -0x35(%rbp), %ecx
addl %ecx, %eax
movb %al, -0x3f(%rbp)
jmp 0x4dcc8
movq -0x60(%rbp), %rax
movswl (%rax), %eax
movsbl -0x35(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4dc8b
movq -0x60(%rbp), %rcx
movsbl -0x35(%rbp), %eax
imull $0x3, %eax, %eax
movswl 0x2(%rcx), %ecx
addl %ecx, %eax
movb %al, -0x3f(%rbp)
jmp 0x4dcc6
movq -0x60(%rbp), %rax
movswl 0x2(%rax), %eax
movsbl -0x35(%rbp), %ecx
cmpl %ecx, %eax
jne 0x4dcb0
movq -0x60(%rbp), %rcx
movsbl -0x35(%rbp), %eax
imull $0x5, %eax, %eax
movswl (%rcx), %ecx
subl %ecx, %eax
movb %al, -0x3f(%rbp)
jmp 0x4dcc4
movq -0x60(%rbp), %rcx
movsbl -0x35(%rbp), %eax
imull $0x7, %eax, %eax
movswl 0x2(%rcx), %ecx
subl %ecx, %eax
movb %al, -0x3f(%rbp)
jmp 0x4dcc6
jmp 0x4dcc8
movb $0x0, -0x40(%rbp)
movsbl -0x40(%rbp), %eax
movsbl -0x35(%rbp), %ecx
shll %ecx
cmpl %ecx, %eax
jge 0x4dd78
movq -0x58(%rbp), %rdx
movq %rdx, %rax
addq $0x18, %rax
movq %rax, -0x80(%rbp)
movsbq -0x35(%rbp), %rsi
movl %esi, %ecx
leaq 0x3ef25(%rip), %rax     # 0x8cc20
movq -0x10(%rax,%rsi,8), %rax
movsbl -0x3f(%rbp), %edi
imull %ecx, %edi
movsbl -0x40(%rbp), %esi
movl %esi, %ecx
movl %edi, %esi
leal (%rcx,%rsi,2), %ecx
movslq %ecx, %rsi
movsbl (%rax,%rsi), %ecx
movl 0x8(%rdx), %edi
addl %edi, %ecx
movsbl 0x1(%rax,%rsi), %eax
movzwl 0xa(%rdx), %edx
addl %edx, %eax
movswl %cx, %esi
movswl %ax, %edx
leaq -0x44(%rbp), %rdi
callq 0x60430
jmp 0x4dd3a
movq -0x80(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x42ba0
jmp 0x4dd49
leaq -0x44(%rbp), %rdi
callq 0x60460
movsbl -0x40(%rbp), %eax
addl $0x2, %eax
movb %al, -0x40(%rbp)
jmp 0x4dccc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x44(%rbp), %rdi
callq 0x60460
jmp 0x4ddbc
jmp 0x4dd7a
leaq -0x48(%rbp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x60430
jmp 0x4dd89
movq -0x58(%rbp), %rax
movl -0x48(%rbp), %ecx
movl %ecx, 0x8(%rax)
leaq -0x48(%rbp), %rdi
callq 0x60460
movq -0x58(%rbp), %rdi
addq $0x18, %rdi
callq 0x4e9a0
movq %rax, %rcx
movq -0x58(%rbp), %rax
movb %cl, 0x30(%rax)
addq $0x80, %rsp
popq %rbp
retq
movq -0x68(%rbp), %rdi
callq 0x42e10
movq -0x58(%rbp), %rdi
callq 0x3e480
movq -0x30(%rbp), %rdi
callq 0x5920
nopw (%rax,%rax)