// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/p_view.c
// Function: G_SetClientFrame
void G_SetClientFrame (edict_t *ent)
{
	gclient_t	*client;
	qboolean	duck, run;

	if (ent->s.modelindex != 255)
		return;		// not in the player model

	client = ent->client;

	if (client->ps.pmove.pm_flags & PMF_DUCKED)
		duck = true;
	else
		duck = false;
	if (xyspeed)
		run = true;
	else
		run = false;

	// check for stand/duck and stop/go transitions
	if (duck != client->anim_duck && client->anim_priority < ANIM_DEATH)
		goto newanim;
	if (run != client->anim_run && client->anim_priority == ANIM_BASIC)
		goto newanim;
	if (!ent->groundentity && client->anim_priority <= ANIM_WAVE)
		goto newanim;

	if(client->anim_priority == ANIM_REVERSE)
	{
		if(ent->s.frame > client->anim_end)
		{
			ent->s.frame--;
			return;
		}
	}
	else if (ent->s.frame < client->anim_end)
	{	// continue an animation
		ent->s.frame++;
		return;
	}

	if (client->anim_priority == ANIM_DEATH)
		return;		// stay there
	if (client->anim_priority == ANIM_JUMP)
	{
		if (!ent->groundentity)
			return;		// stay there
		ent->client->anim_priority = ANIM_WAVE;
		ent->s.frame = FRAME_jump3;
		ent->client->anim_end = FRAME_jump6;
		return;
	}

newanim:
	// return to either a running or standing frame
	client->anim_priority = ANIM_BASIC;
	client->anim_duck = duck;
	client->anim_run = run;

	if (!ent->groundentity)
	{
		client->anim_priority = ANIM_JUMP;
		if (ent->s.frame != FRAME_jump2)
			ent->s.frame = FRAME_jump1;
		client->anim_end = FRAME_jump2;
	}
	else if (run)
	{	// running
		if (duck)
		{
			ent->s.frame = FRAME_crwalk1;
			client->anim_end = FRAME_crwalk6;
		}
		else
		{
			ent->s.frame = FRAME_run1;
			client->anim_end = FRAME_run6;
		}
	}
	else
	{	// standing
		if (duck)
		{
			ent->s.frame = FRAME_crstnd01;
			client->anim_end = FRAME_crstnd19;
		}
		else
		{
			ent->s.frame = FRAME_stand01;
			client->anim_end = FRAME_stand40;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0xff, 0x28(%rax)
je 0x649da
jmp 0x64c3e
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x649ff
movl $0x1, -0x14(%rbp)
jmp 0x64a06
movl $0x0, -0x14(%rbp)
movq 0x1e53b(%rip), %rax     # 0x82f48
movss (%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x64a1d
jp 0x64a1d
jmp 0x64a26
movl $0x1, -0x18(%rbp)
jmp 0x64a2d
movl $0x0, -0x18(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xefc(%rcx), %eax
je 0x64a4e
movq -0x10(%rbp), %rax
cmpl $0x5, 0xef8(%rax)
jge 0x64a4e
jmp 0x64b52
movl -0x18(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl 0xf00(%rcx), %eax
je 0x64a6f
movq -0x10(%rbp), %rax
cmpl $0x0, 0xef8(%rax)
jne 0x64a6f
jmp 0x64b52
movq -0x8(%rbp), %rax
cmpq $0x0, 0x2b8(%rax)
jne 0x64a8f
movq -0x10(%rbp), %rax
cmpl $0x1, 0xef8(%rax)
jg 0x64a8f
jmp 0x64b52
movq -0x10(%rbp), %rax
cmpl $0x6, 0xef8(%rax)
jne 0x64ac3
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0xef4(%rcx), %eax
jle 0x64ac1
movq -0x8(%rbp), %rax
movl 0x38(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x38(%rax)
jmp 0x64c3e
jmp 0x64aea
movq -0x8(%rbp), %rax
movl 0x38(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0xef4(%rcx), %eax
jge 0x64ae8
movq -0x8(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
jmp 0x64c3e
jmp 0x64aea
movq -0x10(%rbp), %rax
cmpl $0x5, 0xef8(%rax)
jne 0x64afc
jmp 0x64c3e
movq -0x10(%rbp), %rax
cmpl $0x2, 0xef8(%rax)
jne 0x64b50
movq -0x8(%rbp), %rax
cmpq $0x0, 0x2b8(%rax)
jne 0x64b1c
jmp 0x64c3e
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x1, 0xef8(%rax)
movq -0x8(%rbp), %rax
movl $0x44, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x47, 0xef4(%rax)
jmp 0x64c3e
jmp 0x64b52
movq -0x10(%rbp), %rax
movl $0x0, 0xef8(%rax)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xefc(%rax)
movl -0x18(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0xf00(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x2b8(%rax)
jne 0x64bbe
movq -0x10(%rbp), %rax
movl $0x2, 0xef8(%rax)
movq -0x8(%rbp), %rax
cmpl $0x43, 0x38(%rax)
je 0x64bab
movq -0x8(%rbp), %rax
movl $0x42, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x43, 0xef4(%rax)
jmp 0x64c3e
cmpl $0x0, -0x18(%rbp)
je 0x64c00
cmpl $0x0, -0x14(%rbp)
je 0x64be5
movq -0x8(%rbp), %rax
movl $0x9a, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x9f, 0xef4(%rax)
jmp 0x64bfe
movq -0x8(%rbp), %rax
movl $0x28, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x2d, 0xef4(%rax)
jmp 0x64c3c
cmpl $0x0, -0x14(%rbp)
je 0x64c21
movq -0x8(%rbp), %rax
movl $0x87, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x99, 0xef4(%rax)
jmp 0x64c3a
movq -0x8(%rbp), %rax
movl $0x0, 0x38(%rax)
movq -0x10(%rbp), %rax
movl $0x27, 0xef4(%rax)
jmp 0x64c3c
jmp 0x64c3e
popq %rbp
retq