// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/g_chase.c
// Function: UpdateChaseCam
void UpdateChaseCam(edict_t *ent)
{
	vec3_t goal, forward, right, angles;
	edict_t *targ;
	trace_t trace;
	int i;

	// is our chase target gone?
	if (!ent->client->chase_target->inuse
		|| ent->client->chase_target->client->resp.spectator) {
		edict_t *old = ent->client->chase_target;
		ChaseNext(ent);
		if (ent->client->chase_target == old) {
			ent->client->chase_target = NULL;
			ent->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
			return;
		}
	}

	targ = ent->client->chase_target;
	VectorCopy(targ->client->v_angle, angles);
	VectorCopy (targ->s.origin, goal);
	goal[2] += targ->viewheight;

	vec3_t	targorigin;

	VectorCopy (goal, targorigin);

	AngleVectors (angles, forward, right, NULL);
	VectorMA (goal, 30, forward, goal);

	// trace from targorigin to final chase origin goal
	trace = gi.trace (targorigin, vec3_origin, vec3_origin, goal, targ, MASK_SOLID);

	// test for hit so we don't go out of the map!
	if (trace.fraction < 1) {
		vec3_t	temp;

		// we hit something, need to do a bit of avoidance

		// take real end point
		VectorCopy (trace.endpos, goal);

		// real dir vector
		VectorSubtract (goal, targorigin, temp);

		// scale it back bit more
		VectorMA (targorigin, 0.9f, temp, goal);
	}

	VectorCopy(goal, ent->s.origin);
	for (i=0 ; i<3 ; i++) {
		ent->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(targ->client->v_angle[i] - ent->client->resp.cmd_angles[i]);
	}

	if (targ->deadflag) {
		ent->client->ps.viewangles[ROLL] = 40;
		ent->client->ps.viewangles[PITCH] = -15;
		ent->client->ps.viewangles[YAW] = targ->client->killer_yaw;
		ent->client->ps.pmove.pm_type = PM_DEAD;
	} else {
		VectorCopy(targ->client->v_angle, ent->client->ps.viewangles);
		VectorCopy(targ->client->v_angle, ent->client->v_angle);
		ent->client->ps.pmove.pm_type = PM_FREEZE;
	}

	ent->viewheight = 0;
	ent->client->ps.pmove.pm_flags |= PMF_NO_PREDICTION;
	gi.linkentity(ent);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf30(%rax), %rax
cmpl $0x0, 0x60(%rax)
je 0x28910
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf30(%rax), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0xe04(%rax)
je 0x28973
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf30(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x8(%rbp), %rdi
callq 0x197b0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf30(%rax), %rax
cmpq -0x98(%rbp), %rax
jne 0x28971
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq $0x0, 0xf30(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movzbl 0x10(%rax), %ecx
andl $-0x41, %ecx
movb %cl, 0x10(%rax)
jmp 0x28d49
jmp 0x28973
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf30(%rax), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xebc(%rax), %xmm0
movss %xmm0, -0x38(%rbp)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xec0(%rax), %xmm0
movss %xmm0, -0x34(%rbp)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xec4(%rax), %xmm0
movss %xmm0, -0x30(%rbp)
movq -0x40(%rbp), %rax
movss 0x4(%rax), %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x40(%rbp), %rax
movss 0x8(%rax), %xmm0
movss %xmm0, -0x10(%rbp)
movq -0x40(%rbp), %rax
movss 0xc(%rax), %xmm0
movss %xmm0, -0xc(%rbp)
movq -0x40(%rbp), %rax
cvtsi2ssl 0x278(%rax), %xmm0
addss -0xc(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x14(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0x10(%rbp), %xmm0
movss %xmm0, -0xa0(%rbp)
movss -0xc(%rbp), %xmm0
movss %xmm0, -0x9c(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x2c(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x183e0
leaq -0x14(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x14(%rbp), %rdx
movss 0x4783b(%rip), %xmm0    # 0x70290
callq 0x199c0
movq 0x59b9f(%rip), %rax     # 0x82600
movq 0x60(%rax), %rax
leaq -0xa4(%rbp), %rsi
leaq -0x14(%rbp), %r8
movq -0x40(%rbp), %r9
leaq -0xf0(%rbp), %rdi
movq 0x59ce6(%rip), %rcx     # 0x82768
movq %rcx, %rdx
movl $0x3, (%rsp)
callq *%rax
leaq -0x88(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
movl $0x48, %edx
callq 0x18dc0
movss 0x4743e(%rip), %xmm0    # 0x6feec
ucomiss -0x80(%rbp), %xmm0
jbe 0x28b30
movss -0x7c(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
movss -0x78(%rbp), %xmm0
movss %xmm0, -0x10(%rbp)
movss -0x74(%rbp), %xmm0
movss %xmm0, -0xc(%rbp)
movss -0x14(%rbp), %xmm0
subss -0xa4(%rbp), %xmm0
movss %xmm0, -0xfc(%rbp)
movss -0x10(%rbp), %xmm0
subss -0xa0(%rbp), %xmm0
movss %xmm0, -0xf8(%rbp)
movss -0xc(%rbp), %xmm0
subss -0x9c(%rbp), %xmm0
movss %xmm0, -0xf4(%rbp)
leaq -0xa4(%rbp), %rdi
leaq -0xfc(%rbp), %rsi
leaq -0x14(%rbp), %rdx
movss 0x481f1(%rip), %xmm0    # 0x70d1c
callq 0x199c0
movss -0x14(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x4(%rax)
movss -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x8(%rax)
movss -0xc(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0xc(%rax)
movl $0x0, -0x8c(%rbp)
cmpl $0x3, -0x8c(%rbp)
jge 0x28be9
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x8c(%rbp), %rcx
movss 0xebc(%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x8c(%rbp), %rcx
subss 0xdf8(%rax,%rcx,4), %xmm0
movss 0x48183(%rip), %xmm1    # 0x70d28
mulss %xmm1, %xmm0
movss 0x48173(%rip), %xmm1    # 0x70d24
divss %xmm1, %xmm0
cvttss2si %xmm0, %eax
andl $0xffff, %eax           # imm = 0xFFFF
movw %ax, %dx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x8c(%rbp), %rcx
movw %dx, 0x14(%rax,%rcx,2)
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0x28b64
movq -0x40(%rbp), %rax
cmpl $0x0, 0x260(%rax)
je 0x28c50
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss 0x4811a(%rip), %xmm0    # 0x70d20
movss %xmm0, 0x24(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss 0x47681(%rip), %xmm0    # 0x7029c
movss %xmm0, 0x1c(%rax)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xe74(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0x20(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x2, (%rax)
jmp 0x28d15
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xebc(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0x1c(%rax)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xec0(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0x20(%rax)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xec4(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0x24(%rax)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xebc(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0xebc(%rax)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xec0(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0xec0(%rax)
movq -0x40(%rbp), %rax
movq 0x58(%rax), %rax
movss 0xec4(%rax), %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0xec4(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x4, (%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x278(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movzbl 0x10(%rax), %ecx
orl $0x40, %ecx
movb %cl, 0x10(%rax)
movq 0x598c4(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)