// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: ClientThink
void ClientThink (edict_t *ent, usercmd_t *ucmd)
{
	gclient_t	*client;
	edict_t	*other;
	int		i, j;
	pmove_t	pm;
	edict_t		*flag;  // CTF CODE -- LM_JORM
	vec3_t 	offset; // CTF CODE -- LM_JORM

#ifdef ZBOT
	if (use_zbotdetect->value)
	{
		char message[100];

		if (((int) use_zbotdetect->value > 0) && ZbotCheck(ent, ucmd))
		{
			if ((int) use_zbotdetect->value == 2)
			{
				sprintf(message, "%s was kicked by ZBot detection.\n", 
					ent->client->pers.netname);
				ctf_BSafePrint(PRINT_HIGH, message);
				ForceCommand(ent, "disconnect\n");
			}
			else if ((int) use_zbotdetect->value == 1)
			{
				sprintf(message, "WARNING:  ZBOT DETECTOR THINKS %s IS A BOT.\n", 
					ent->client->pers.netname);
				ctf_BSafePrint(PRINT_HIGH, message);
			}
		}
	}
#endif
	
	level.current_entity = ent;
	client = ent->client;
	
	// CTF CODE -- LM_JORM
	//surt spam control
	ent->client->spam_band_count+=CTF_SPAM_BAND_RECOVER; //this locks based on bandwidth
	if (ent->client->spam_band_count > CTF_SPAM_BAND_MAX)
		ent->client->spam_band_count = CTF_SPAM_BAND_MAX;
	if (ent->client->spam_band_count < CTF_SPAM_BAND_MIN)
		ent->client->spam_band_count = CTF_SPAM_BAND_MIN;
	
	ent->client->spam_freq_count--; //this locks based on frequency
	if (ent->client->spam_freq_count > CTF_SPAM_FREQ_MAX)
		ent->client->spam_freq_count = CTF_SPAM_FREQ_MAX;
	if (ent->client->spam_freq_count < CTF_SPAM_FREQ_MIN)
		ent->client->spam_freq_count = CTF_SPAM_FREQ_MIN;
	//surt end spam control

	if (ent->client->ctf.printready)
		ctf_SafePrint(ent, 0, NULL); //trigger a queued print
	
	if (GamePaused() && !(ent->client->ctf.extra_flags & CTF_EXTRAFLAGS_REFEREE))
	{
		client->ps.pmove.pm_type = PM_FREEZE;
		gi.linkentity (ent); //they call this below, but we abort early here!
		return;
	}

#ifdef OLDOBSERVERCODE
	if (!ctf_validateplayer(ent,CTF_TEAM_ANYTEAM)) //surt if not on a team, you're observer 
	{
		if (ent->client->ctf.teamnum != CTF_TEAM_OBSERVER)
		{
			ctf_SetEntTeam(ent, CTF_TEAM_OBSERVER); //catch anyone on wierd teams
			Observer_Start(ent);
		}
		// Let's us check buttons in Camera Think
		client->oldbuttons = client->buttons;
		client->buttons = ucmd->buttons;
		client->latched_buttons |= client->buttons & ~client->oldbuttons;
		gi.linkentity (ent); //they call this below, but we abort early here!
	
		if (Camera_Think(ent))
			return;
	}
#endif
	
	// END CTF CODE -- LM_JORM

	if (level.intermissiontime)
	{
		client->ps.pmove.pm_type = PM_FREEZE;
		// can exit intermission after five seconds
		if (level.time > level.intermissiontime + 5.0 
			&& (ucmd->buttons & BUTTON_ANY) )
			level.exitintermission = true;
		return;
	}

	pm_passent = ent;

	if (ent->client->chase_target) {

		client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]);
		client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]);
		client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]);

	} else {

		// set up for pmove
		memset (&pm, 0, sizeof(pm));

		if (ent->movetype == MOVETYPE_NOCLIP)
			client->ps.pmove.pm_type = PM_SPECTATOR;
		else if (ent->s.modelindex != 255)
			client->ps.pmove.pm_type = PM_GIB;
		else if (ent->deadflag)
			client->ps.pmove.pm_type = PM_DEAD;
		else
			client->ps.pmove.pm_type = PM_NORMAL;

		client->ps.pmove.gravity = sv_gravity->value;

		/* QwazyWabbit */
		/* This causes gravity to go negative if 
		   your player Z-position goes above 0. 
		   Original code by gaia, I added the 
		   macro condition. */

#ifdef WANT_FUNKY_GRAVITY
		if(ent->s.origin[2] > 0) //gaia
			client->ps.pmove.gravity = -800;
		else
			client->ps.pmove.gravity = 800;
#endif

		pm.s = client->ps.pmove;

		for (i=0 ; i<3 ; i++)
		{
			pm.s.origin[i] = ent->s.origin[i]*8;
			pm.s.velocity[i] = ent->velocity[i]*8;
		}

		if (memcmp(&client->old_pmove, &pm.s, sizeof(pm.s)))
		{
			pm.snapinitial = true;
	//		gi.dprintf ("pmove changed!\n");
		}

		pm.cmd = *ucmd;

		pm.trace = PM_trace;	// adds default parms
		pm.pointcontents = gi.pointcontents;

		// Stop that damn bobbing of the client!
		if (client->hookstate == 2 && client->hooklength < 50)
		{
			pm.s.gravity = 0;
		}
		// END CTF CODE -- LM_JORM

		// perform a pmove
		gi.Pmove (&pm);

		// save results of pmove
		client->ps.pmove = pm.s;
		client->old_pmove = pm.s;

		for (i=0 ; i<3 ; i++)
		{
			ent->s.origin[i] = pm.s.origin[i]*0.125;
			ent->velocity[i] = pm.s.velocity[i]*0.125;
		}

		VectorCopy (pm.mins, ent->mins);
		VectorCopy (pm.maxs, ent->maxs);

		client->resp.cmd_angles[0] = SHORT2ANGLE(ucmd->angles[0]);
		client->resp.cmd_angles[1] = SHORT2ANGLE(ucmd->angles[1]);
		client->resp.cmd_angles[2] = SHORT2ANGLE(ucmd->angles[2]);

		if (ent->groundentity && !pm.groundentity && (pm.cmd.upmove >= 10) && (pm.waterlevel == 0))
		{
			gi.sound(ent, CHAN_VOICE, gi.soundindex("*jump1.wav"), 1, ATTN_NORM, 0);
			PlayerNoise(ent, ent->s.origin, PNOISE_SELF);
		}

		ent->viewheight = pm.viewheight;
		ent->waterlevel = pm.waterlevel;
		ent->watertype = pm.watertype;
		ent->groundentity = pm.groundentity;
		if (pm.groundentity)
			ent->groundentity_linkcount = pm.groundentity->linkcount;

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

		gi.linkentity (ent);

		if (ent->movetype != MOVETYPE_NOCLIP)
			G_TouchTriggers (ent);

		// touch other objects
		for (i=0 ; i<pm.numtouch ; i++)
		{
			other = pm.touchents[i];
			for (j=0 ; j<i ; j++)
				if (pm.touchents[j] == other)
					break;
			if (j != i)
				continue;	// duplicated
			if (!other->touch)
				continue;
			other->touch (other, ent, NULL, NULL);
		}

	}

	client->oldbuttons = client->buttons;
	client->buttons = ucmd->buttons;
	client->latched_buttons |= client->buttons & ~client->oldbuttons;

	// save light level the player is standing on for
	// monster sighting AI
	ent->light_level = ucmd->lightlevel;

	// fire weapon from final position if needed
	//bat not needed for team observers
	//if(client->ctf.teamnum != CTF_TEAM_OBSERVER_RED &&
	//	client->ctf.teamnum != CTF_TEAM_OBSERVER_BLUE)
	// Paril
	if (!GamePaused())
	// Paril
	{
		if (client->latched_buttons & BUTTON_ATTACK)
		{
			if (client->resp.spectator) 
			{

				client->latched_buttons = 0;

				if (client->chase_target) 
				{
					client->chase_target = NULL;
					client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION;
				} 
				else
					GetChaseTarget(ent);

			} 
			else if (!client->weapon_thunk) 
			{
				client->weapon_thunk = true;
				Think_Weapon (ent);
			}
		}
	}

	if (client->resp.spectator) 
	{
		if(client->ctf.teamnum == CTF_TEAM_OBSERVER_RED &&
			!Team_Observer_OK(CTF_TEAM_RED, ent))
		{
			Cmd_Observe_f(ent, CTF_TEAM_OBSERVER);
			return;
		}
		else if(client->ctf.teamnum == CTF_TEAM_OBSERVER_BLUE &&
			!Team_Observer_OK(CTF_TEAM_BLUE, ent))
		{
			Cmd_Observe_f(ent, CTF_TEAM_OBSERVER);
			return;
		}
		
	
		//When we first start, we are observing nobody
		if(client->ctf.teamnum == CTF_TEAM_OBSERVER_RED)
		{
			if(!client->chase_target)
			{
				GetChaseTarget(ent);
				return;
			}
			else if(client->chase_target->client->ctf.teamnum != CTF_TEAM_RED)
			{
				Cmd_Observe_f(ent, CTF_TEAM_OBSERVER);
				return;
			}

		}
		else if(client->ctf.teamnum == CTF_TEAM_OBSERVER_BLUE)
		{
			if(!client->chase_target)
			{	
				GetChaseTarget(ent);
				return;
			}
			else if(client->chase_target->client->ctf.teamnum != CTF_TEAM_BLUE)
			{
				Cmd_Observe_f(ent, CTF_TEAM_OBSERVER);
				return;
			}

		}
		


		if (ucmd->upmove >= 10) 
		{
			if (!(client->ps.pmove.pm_flags & PMF_JUMP_HELD)) 
			{
				client->ps.pmove.pm_flags |= PMF_JUMP_HELD;
				if(client->chase_target)
				{
					//Debug_Show("Chase Next");
					ChaseNext(ent);
				}
				else
				{
					//Debug_Show("Get chase target");
					GetChaseTarget(ent);
				}
			}
		} 
		else
			client->ps.pmove.pm_flags &= ~PMF_JUMP_HELD;
	}
	else
	{
		// CTF CODE -- LM_JORM
		// Were we carrying a flag?  MJD Suggest Parens
		flag = ClientHasFlag(ent);
		if (flag)
		{
			// MOVE THE FLAG!
			VectorCopy(ent->s.origin, flag->s.origin);
			VectorNormalize2(ent->s.angles, offset);
			VectorScale(offset, 6, offset);
			//offset[2] = -10;
			VectorSubtract (flag->s.origin, offset, flag->s.origin);
		
		/*
		// Make sure flag is not inside another object
		tr = gi.trace (ent->s.origin, flag->mins, flag->maxs, flag->s.origin, ent, MASK_SHOT);
		VectorCopy(tr.endpos, flag->s.origin);
		*/
		
			VectorCopy(ent->velocity, flag->velocity);
			VectorCopy (offset, flag->movedir);
			vectoangles (offset, flag->s.angles);
		
		}
	
		// END CTF CODE -- LM_JORM
	}

	// update chase cam if being followed
	for (i = 1; i <= maxclients->value; i++) 
	{
		other = g_edicts + i;
		if (other->inuse && other->client->chase_target == ent)
			UpdateChaseCam(other);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movq %rsi, %r14
movq %rdi, %rbx
movq 0x22c3a(%rip), %r15     # 0x68da0
movq %rdi, 0x148(%r15)
movq 0x58(%rdi), %r13
movq 0x10e0(%r13), %rcx
leaq 0x5(%rcx), %rax
movq %rax, 0x10e0(%r13)
movl $0x1c2, %eax            # imm = 0x1C2
cmpq $0x1bd, %rcx            # imm = 0x1BD
jg 0x461a1
movq $-0x96, %rax
cmpq $-0x9c, %rcx
jg 0x461a8
movq %rax, 0x10e0(%r13)
movq 0x10d8(%r13), %rcx
leaq -0x1(%rcx), %rax
movq %rax, 0x10d8(%r13)
movl $0xb4, %eax
cmpq $0xb5, %rcx
jg 0x461cf
testq %rcx, %rcx
jg 0x461d6
xorl %eax, %eax
movq %rax, 0x10d8(%r13)
cmpl $0x0, 0x911c(%r13)
je 0x461ec
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x18da0
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
je 0x4622d
movq 0x58(%rbx), %rax
testb $0x2, 0x1108(%rax)
jne 0x4622d
movl $0x4, (%r13)
movq 0x223ed(%rip), %rax     # 0x68600
movq %rbx, %rdi
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *0x90(%rax)
movss 0xc8(%r15), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x46240
jnp 0x46282
movl $0x4, (%r13)
xorps %xmm1, %xmm1
cvtss2sd 0x4(%r15), %xmm1
cvtss2sd %xmm0, %xmm0
addsd 0x136cb(%rip), %xmm0    # 0x59928
ucomisd %xmm0, %xmm1
jbe 0x4698e
cmpb $0x0, 0x1(%r14)
jns 0x4698e
movl $0x1, 0xd8(%r15)
jmp 0x4698e
movq 0x22bdf(%rip), %rax     # 0x68e68
movq %rbx, (%rax)
movq 0x58(%rbx), %rax
cmpq $0x0, 0xf30(%rax)
je 0x462e9
movd 0x2(%r14), %xmm0
pshuflw $0x60, %xmm0, %xmm0     # xmm0 = xmm0[0,0,2,1,4,5,6,7]
psrad $0x10, %xmm0
cvtdq2pd %xmm0, %xmm0
mulpd 0x1352a(%rip), %xmm0    # 0x597e0
cvtpd2ps %xmm0, %xmm0
movlpd %xmm0, 0xdf8(%r13)
movswl 0x6(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x13649(%rip), %xmm0    # 0x59920
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xe00(%r13)
jmp 0x46691
leaq 0x20(%rsp), %rdi
movl $0x180, %edx            # imm = 0x180
xorl %esi, %esi
callq 0x18880
movl $0x1, %eax
cmpl $0x1, 0x118(%rbx)
je 0x46324
movl $0x3, %eax
cmpl $0xff, 0x28(%rbx)
jne 0x46324
xorl %eax, %eax
cmpl $0x0, 0x260(%rbx)
setne %al
addl %eax, %eax
movl %eax, (%r13)
movq 0x22c91(%rip), %rax     # 0x68fc0
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
movw %ax, 0x12(%r13)
movups (%r13), %xmm0
movaps %xmm0, 0x20(%rsp)
movups 0xc(%r13), %xmm0
movups %xmm0, 0x2c(%rsp)
leaq 0x4(%rbx), %rax
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movss 0xcb99(%rip), %xmm0     # 0x52efc
movss 0x4(%rbx,%rax,4), %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movw %cx, 0x24(%rsp,%rax,2)
movss 0x1c0(%rbx,%rax,4), %xmm1
mulss %xmm0, %xmm1
cvttss2si %xmm1, %ecx
movw %cx, 0x2a(%rsp,%rax,2)
incq %rax
cmpq $0x3, %rax
jne 0x46363
movdqu 0xe08(%r13), %xmm0
movdqu 0xe14(%r13), %xmm1
movdqu 0x2c(%rsp), %xmm2
pcmpeqb 0x20(%rsp), %xmm0
pcmpeqb %xmm1, %xmm2
pand %xmm2, %xmm0
pmovmskb %xmm0, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0x463ce
movl $0x1, 0x4c(%rsp)
leaq 0xe08(%r13), %r15
movups (%r14), %xmm0
movups %xmm0, 0x3c(%rsp)
movq 0x2240b(%rip), %rax     # 0x687f0
movq %rax, 0x190(%rsp)
movq 0x2220c(%rip), %rbp     # 0x68600
movq 0x68(%rbp), %rax
movq %rax, 0x198(%rsp)
cmpl $0x2, 0xf40(%r13)
jne 0x4641b
cmpl $0x31, 0xf5c(%r13)
jg 0x4641b
movw $0x0, 0x32(%rsp)
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq *0xa8(%rbp)
movups 0xc(%r12), %xmm0
movups %xmm0, 0xc(%r13)
movaps (%r12), %xmm0
movups %xmm0, (%r13)
movups 0xc(%r12), %xmm0
movups %xmm0, 0xc(%r15)
movaps (%r12), %xmm0
movups %xmm0, (%r15)
movq $-0x3, %rax
movsd 0x1159f(%rip), %xmm0    # 0x57a00
movswl 0x2a(%rsp,%rax,2), %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
mulsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
movss %xmm1, 0x10(%rbx,%rax,4)
movswl 0x30(%rsp,%rax,2), %ecx
xorps %xmm1, %xmm1
cvtsi2sd %ecx, %xmm1
mulsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm1
movss %xmm1, 0x1cc(%rbx,%rax,4)
incq %rax
jne 0x46461
movups 0x168(%rsp), %xmm0
movups %xmm0, 0xcc(%rbx)
movsd 0x178(%rsp), %xmm0
movsd %xmm0, 0xdc(%rbx)
movd 0x2(%r14), %xmm0
pshuflw $0x60, %xmm0, %xmm0     # xmm0 = xmm0[0,0,2,1,4,5,6,7]
psrad $0x10, %xmm0
cvtdq2pd %xmm0, %xmm0
mulpd 0x13307(%rip), %xmm0    # 0x597e0
cvtpd2ps %xmm0, %xmm0
movlpd %xmm0, 0xdf8(%r13)
movswl 0x6(%r14), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x13426(%rip), %xmm0    # 0x59920
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0xe00(%r13)
cmpq $0x0, 0x2b8(%rbx)
setne %cl
movq 0x180(%rsp), %rax
testq %rax, %rax
sete %dl
andb %cl, %dl
cmpw $0xa, 0x48(%rsp)
setge %sil
movl 0x18c(%rsp), %ecx
testl %ecx, %ecx
sete %dil
andb %sil, %dil
andb %dl, %dil
cmpb $0x1, %dil
jne 0x4658d
movq 0x20(%rbp), %r15
leaq 0x1268f(%rip), %rdi     # 0x58bdf
callq *0x48(%rbp)
movss 0xc9cd(%rip), %xmm0     # 0x52f28
pxor %xmm2, %xmm2
movq %rbx, %rdi
movl $0x2, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r15
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
xorl %edx, %edx
callq 0x18ef0
movl 0x18c(%rsp), %ecx
movq 0x180(%rsp), %rax
cvttss2si 0x164(%rsp), %edx
movl %edx, 0x278(%rbx)
movl %ecx, 0x30c(%rbx)
movl 0x188(%rsp), %ecx
movl %ecx, 0x308(%rbx)
movq %rax, 0x2b8(%rbx)
testq %rax, %rax
je 0x465c4
movl 0x64(%rax), %eax
movl %eax, 0x2c0(%rbx)
cmpl $0x0, 0x260(%rbx)
je 0x465e8
movl $0xc1700000, 0x1c(%r13) # imm = 0xC1700000
movss 0xe74(%r13), %xmm0
movss 0xf662(%rip), %xmm1     # 0x55c48
jmp 0x46616
movsd 0x158(%rsp), %xmm0
movsd %xmm0, 0xebc(%r13)
movss 0x160(%rsp), %xmm1
movss %xmm1, 0xec4(%r13)
movss %xmm0, 0x1c(%r13)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movss %xmm0, 0x20(%r13)
movss %xmm1, 0x24(%r13)
movq %rbx, %rdi
callq *0x90(%rbp)
cmpl $0x1, 0x118(%rbx)
je 0x4663c
movq %rbx, %rdi
callq 0x19200
movl 0x50(%rsp), %eax
testl %eax, %eax
jle 0x46691
xorl %r15d, %r15d
movq 0x58(%rsp,%r15,8), %rdi
xorl %ecx, %ecx
testq %r15, %r15
je 0x46667
cmpq %rdi, 0x58(%rsp,%rcx,8)
je 0x46665
incq %rcx
cmpq %rcx, %r15
jne 0x46653
movq %r15, %rcx
movl %ecx, %ecx
cmpq %r15, %rcx
jne 0x46686
movq 0x220(%rdi), %r8
testq %r8, %r8
je 0x46686
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq *%r8
movl 0x50(%rsp), %eax
incq %r15
movslq %eax, %rcx
cmpq %rcx, %r15
jl 0x46647
movl 0xe3c(%r13), %eax
movl %eax, 0xe40(%r13)
movzbl 0x1(%r14), %ecx
movl %ecx, 0xe3c(%r13)
notl %eax
andl %ecx, %eax
orl %eax, 0xe44(%r13)
movzbl 0xf(%r14), %eax
movl %eax, 0x328(%rbx)
xorl %eax, %eax
callq 0x18160
testl %eax, %eax
jne 0x4672e
testb $0x1, 0xe44(%r13)
je 0x4672e
cmpl $0x0, 0xe04(%r13)
je 0x46707
movl $0x0, 0xe44(%r13)
cmpq $0x0, 0xf30(%r13)
je 0x46726
movq $0x0, 0xf30(%r13)
andb $-0x41, 0x10(%r13)
jmp 0x4672e
cmpl $0x0, 0xe48(%r13)
jne 0x4672e
movl $0x1, 0xe48(%r13)
movq %rbx, %rdi
callq 0x19590
jmp 0x4672e
movq %rbx, %rdi
callq 0x19400
cmpl $0x0, 0xe04(%r13)
je 0x467ed
movl 0x1100(%r13), %eax
cmpl $-0x3, %eax
jne 0x46764
movl $0x1, %edi
movq %rbx, %rsi
callq 0x19720
testl %eax, %eax
je 0x46904
movl 0x1100(%r13), %eax
cmpl $-0x2, %eax
jne 0x46785
movl $0x2, %edi
movq %rbx, %rsi
callq 0x19720
testl %eax, %eax
je 0x46904
movl 0x1100(%r13), %eax
cmpl $-0x2, %eax
je 0x468e3
cmpl $-0x3, %eax
jne 0x467b4
movq 0xf30(%r13), %rax
testq %rax, %rax
je 0x46986
movq 0x58(%rax), %rax
cmpl $0x1, 0x1100(%rax)
jne 0x46904
cmpw $0xa, 0xc(%r14)
movb 0x10(%r13), %al
jl 0x46913
testb $0x2, %al
jne 0x46919
orb $0x2, %al
movb %al, 0x10(%r13)
cmpq $0x0, 0xf30(%r13)
je 0x469a0
movq %rbx, %rdi
callq 0x19570
jmp 0x46919
movq %rbx, %rdi
callq 0x18150
testq %rax, %rax
je 0x46919
movq %rax, %r14
movss 0x4(%rbx), %xmm0
movss %xmm0, 0x4(%rax)
movss 0x8(%rbx), %xmm0
movss %xmm0, 0x8(%rax)
movss 0xc(%rbx), %xmm0
movss %xmm0, 0xc(%rax)
leaq 0x10(%rbx), %rdi
leaq 0x14(%rsp), %r15
movq %r15, %rsi
callq 0x18950
movss 0xc6cc(%rip), %xmm0     # 0x52f04
movq %r15, %rdi
movq %r15, %rsi
callq 0x189d0
movss (%r15), %xmm0
movss 0x4(%r14), %xmm1
movss 0x8(%r14), %xmm2
subss %xmm0, %xmm1
movss %xmm1, 0x4(%r14)
movss 0x4(%r15), %xmm1
subss %xmm1, %xmm2
movss %xmm2, 0x8(%r14)
movss 0xc(%r14), %xmm2
movss 0x8(%r15), %xmm3
subss %xmm3, %xmm2
movss %xmm2, 0xc(%r14)
movss 0x1c0(%rbx), %xmm2
movss %xmm2, 0x1c0(%r14)
movss 0x1c4(%rbx), %xmm2
movss %xmm2, 0x1c4(%r14)
movd 0x1c8(%rbx), %xmm2
movd %xmm2, 0x1c8(%r14)
movss %xmm0, 0x19c(%r14)
movss %xmm1, 0x1a0(%r14)
movss %xmm3, 0x1a4(%r14)
addq $0x10, %r14
movq %r15, %rdi
movq %r14, %rsi
callq 0x190d0
jmp 0x46919
movq 0xf30(%r13), %rax
testq %rax, %rax
je 0x46986
movq 0x58(%rax), %rax
cmpl $0x2, 0x1100(%rax)
je 0x467b4
movq %rbx, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x19690
jmp 0x4698e
andb $-0x3, %al
movb %al, 0x10(%r13)
movq 0x21c10(%rip), %r14     # 0x68530
movq (%r14), %rax
movss 0x20(%rax), %xmm0
ucomiss 0xc5f9(%rip), %xmm0     # 0x52f28
jb 0x4698e
movq 0x21c20(%rip), %r15     # 0x68558
movq (%r15), %rdi
movl $0x4a8, %r12d           # imm = 0x4A8
movl $0x2, %ebp
cmpl $0x0, 0x60(%rdi,%r12)
je 0x4696a
movq 0x58(%rdi,%r12), %rcx
cmpq %rbx, 0xf30(%rcx)
jne 0x4696a
addq %r12, %rdi
callq 0x199c0
movq (%r15), %rdi
movq (%r14), %rax
xorps %xmm0, %xmm0
cvtsi2ss %ebp, %xmm0
movss 0x20(%rax), %xmm1
addq $0x4a8, %r12            # imm = 0x4A8
incl %ebp
ucomiss %xmm0, %xmm1
jae 0x46946
jmp 0x4698e
movq %rbx, %rdi
callq 0x19400
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x19400
jmp 0x46919