// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_misc.c
// Function: path_corner_touch
void path_corner_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
{
	vec3_t		v;
	edict_t		*next;

	if (other->movetarget != self)
		return;
	
	if (other->enemy)
		return;

	if (self->pathtarget)
	{
		char *savetarget;

		savetarget = self->target;
		self->target = self->pathtarget;
		G_UseTargets (self, other);
		self->target = savetarget;
	}

	if (self->target)
		next = G_PickTarget(self->target);
	else
		next = NULL;

	if ((next) && (next->spawnflags & 1))
	{
		VectorCopy (next->s.origin, v);
		v[2] += next->mins[2];
		v[2] -= other->mins[2];
		VectorCopy (v, other->s.origin);
		next = G_PickTarget(next->target);
		other->s.event = EV_OTHER_TELEPORT;
	}

	other->goalentity = other->movetarget = next;

	if (self->wait)
	{
		other->monsterinfo.pausetime = level.time + self->wait;
		other->monsterinfo.stand (other);
		return;
	}

	if (!other->movetarget)
	{
		other->monsterinfo.pausetime = level.time + 100000000;
		other->monsterinfo.stand (other);
	}
	else
	{
		VectorSubtract (other->goalentity->s.origin, other->s.origin, v);
		other->ideal_yaw = vectoyaw (v);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x1f0(%rax), %rax
cmpq -0x8(%rbp), %rax
je 0x4014e
jmp 0x403bc
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2a0(%rax)
je 0x40161
jmp 0x403bc
movq -0x8(%rbp), %rax
cmpq $0x0, 0x170(%rax)
je 0x401b0
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq 0x170(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x150(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x19b50
movq -0x40(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x150(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x150(%rax)
je 0x401d4
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rdi
callq 0x18390
movq %rax, -0x38(%rbp)
jmp 0x401dc
movq $0x0, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x402a0
movq -0x38(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x402a0
movq -0x38(%rbp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, -0x2c(%rbp)
movq -0x38(%rbp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, -0x28(%rbp)
movq -0x38(%rbp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x38(%rbp), %rax
movss 0xd4(%rax), %xmm0
addss -0x24(%rbp), %xmm0
movss %xmm0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movss 0xd4(%rax), %xmm1
movss -0x24(%rbp), %xmm0
subss %xmm1, %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x2c(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0x24(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0xc(%rax)
movq -0x38(%rbp), %rax
movq 0x150(%rax), %rdi
callq 0x18390
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl $0x7, 0x50(%rax)
movq -0x38(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1f0(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x1e8(%rax)
movq -0x8(%rbp), %rax
movss 0x2f8(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x402d2
jp 0x402d2
jmp 0x4030c
movq 0x42ac7(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x2f8(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x420(%rax)
movq -0x10(%rbp), %rax
movq 0x3d0(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
jmp 0x403bc
movq -0x10(%rbp), %rax
cmpq $0x0, 0x1f0(%rax)
jne 0x4034d
movss 0x33eda(%rip), %xmm0    # 0x741fc
movq 0x42a77(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x420(%rax)
movq -0x10(%rbp), %rax
movq 0x3d0(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
jmp 0x403bc
movq -0x10(%rbp), %rax
movq 0x1e8(%rax), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x2c(%rbp)
movq -0x10(%rbp), %rax
movq 0x1e8(%rax), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x1e8(%rax), %rax
movss 0xc(%rax), %xmm0
movq -0x10(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x24(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0x18070
movq -0x10(%rbp), %rax
movss %xmm0, 0x1fc(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)