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

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

	if (self->target)
	{
		other->target = self->target;
		other->goalentity = other->movetarget = G_PickTarget(other->target);
		if (!other->goalentity)
		{
			gi.dprintf("%s at %s target %s does not exist\n", self->classname, vtos(self->s.origin), self->target);
			other->movetarget = self;
		}
		self->target = NULL;
	}
	else if ((self->spawnflags & 1) && !(other->flags & (FL_SWIM|FL_FLY)))
	{
		other->monsterinfo.pausetime = level.time + 100000000;
		other->monsterinfo.aiflags |= AI_STAND_GROUND;
		other->monsterinfo.stand (other);
	}

	if (other->movetarget == self)
	{
		other->target = NULL;
		other->movetarget = NULL;
		other->goalentity = other->enemy;
		other->monsterinfo.aiflags &= ~AI_COMBAT_POINT;
	}

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

		savetarget = self->target;
		self->target = self->pathtarget;
		if (other->enemy && other->enemy->client)
			activator = other->enemy;
		else if (other->oldenemy && other->oldenemy->client)
			activator = other->oldenemy;
		else if (other->activator && other->activator->client)
			activator = other->activator;
		else
			activator = other;
		G_UseTargets (self, activator);
		self->target = savetarget;
	}
}

// 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 0x4051e
jmp 0x407a1
movq -0x8(%rbp), %rax
cmpq $0x0, 0x150(%rax)
je 0x405ea
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x150(%rax)
movq -0x10(%rbp), %rax
movq 0x150(%rax), %rdi
callq 0x18390
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1f0(%rax)
movq -0x10(%rbp), %rax
movq %rcx, 0x1e8(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x1e8(%rax)
jne 0x405d9
movq 0x4207c(%rip), %rax     # 0x82600
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x138(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
addq $0x4, %rdi
callq 0x19260
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %r8
movq %rax, %rdx
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rcx
leaq 0x33cd9(%rip), %rdi     # 0x7429e
movb $0x0, %al
callq *%r8
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1f0(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x150(%rax)
jmp 0x40654
movq -0x8(%rbp), %rax
movl 0x140(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x40652
movq -0x10(%rbp), %rax
movl 0x11c(%rax), %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x40652
movss 0x33be6(%rip), %xmm0    # 0x741fc
movq 0x42783(%rip), %rax     # 0x82da0
addss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x420(%rax)
movq -0x10(%rbp), %rax
movl 0x3c0(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x3c0(%rax)
movq -0x10(%rbp), %rax
movq 0x3d0(%rax), %rax
movq -0x10(%rbp), %rdi
callq *%rax
jmp 0x40654
movq -0x10(%rbp), %rax
movq 0x1f0(%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x406af
movq -0x10(%rbp), %rax
movq $0x0, 0x150(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x1f0(%rax)
movq -0x10(%rbp), %rax
movq 0x2a0(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x1e8(%rax)
movq -0x10(%rbp), %rax
movl 0x3c0(%rax), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movl %ecx, 0x3c0(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x170(%rax)
je 0x407a1
movq -0x8(%rbp), %rax
movq 0x150(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x170(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x150(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2a0(%rax)
je 0x40717
movq -0x10(%rbp), %rax
movq 0x2a0(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x40717
movq -0x10(%rbp), %rax
movq 0x2a0(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x40785
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2a8(%rax)
je 0x40748
movq -0x10(%rbp), %rax
movq 0x2a8(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x40748
movq -0x10(%rbp), %rax
movq 0x2a8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x40783
movq -0x10(%rbp), %rax
cmpq $0x0, 0x2b0(%rax)
je 0x40779
movq -0x10(%rbp), %rax
movq 0x2b0(%rax), %rax
cmpq $0x0, 0x58(%rax)
je 0x40779
movq -0x10(%rbp), %rax
movq 0x2b0(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x40781
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x40783
jmp 0x40785
movq -0x8(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x19b50
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x150(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)