// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: player_die
void player_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
	int		n;
	edict_t	*attacker_flag=NULL, *defender_flag=NULL;  // CTF CODE -- LM_JORM
	// int		teamnum;// CTF CODE -- LM_JORM
	vec3_t	dir;	// CTF CODE -- LM_JORM
	vec_t dist1, dist2;	// CTF CODE -- LM_JORM
	char	*flagcolor = NULL;	// CTF CODE -- LM_JORM
	char message[MAX_INFO_STRING];
	// MJD Uninitialized - Caught but Fixed
	
	
	// CTF CODE -- LM_JORM
	
	// CTF bonuses for kills
	
	//self has just died.  was self interesting in some way?
	ctf_validateflags();
	
	//stats_add(self, STATS_DEATHS, 1); // STATS - LM_Hati
	
	//first, make sure self and attacker were valid players
	if (ctf_validateplayer(attacker, CTF_TEAM_ANYTEAM) &&
		ctf_validateplayer(self,CTF_TEAM_ANYTEAM) &&
		self != attacker &&				// Can't get bonus on suicides
		(self->deadflag != DEAD_DEAD) ) //and victim not already dead
	{
		if (! OnSameTeam(attacker, self)) //must be different teams
		{
			// Find attacker's flag
			if (attacker->client->ctf.teamnum == CTF_TEAM_RED)  // Red
			{
				attacker_flag = redflag;
				defender_flag = blueflag;
			}
			else //must be blue
			{
				attacker_flag = blueflag;
				defender_flag = redflag;
			}
			
			if ( attacker_flag && !(ctf_validateplayer(attacker_flag->owner, CTF_TEAM_ANYTEAM)) ) //attacker's flag was not in anyone's posession
			{
				//so it's either at home, or lying around
				// 			if (FlagCompare (attacker_flag->homeposition, attacker_flag->s.origin))
				if (ctf_flagathome(attacker_flag))
				{
					// Flag at home
					
					VectorSubtract (attacker->s.origin, attacker_flag->s.origin, dir);
					dist1 = VectorLength(dir); //if this is small, i'm close to my flag
					
					VectorSubtract (self->s.origin, attacker_flag->s.origin, dir);
					dist2 = VectorLength(dir); //if this is small, deadguy was near my flag
					
					//surt duh, this was using | not ||
					if ((dist1 < CTF_DEFEND_FLAG_RADIUS) || (dist2 < CTF_DEFEND_FLAG_RADIUS)) // was 512  MJD Added parens
					{
						switch (attacker->client->ctf.teamnum)
						{
						case CTF_TEAM_RED: flagcolor = "red"; break;
						case CTF_TEAM_BLUE: flagcolor = "blue"; break;
						}
						sprintf(message, "%s defends the %s flag.\n",
								attacker->client->pers.netname,
								flagcolor );
						ctf_BSafePrint(PRINT_HIGH, message);
						attacker->client->resp.score += 2;
						stats_add(attacker, STATS_SCORE, 2);
						attacker->client->defend_flag_time = level.time;
						
						stats_add(attacker, STATS_DEFENSE_FLAG, 1); // STATS - LM_Hati
						// STDLog Flag Defense - Surt
						sl_LogScore( &gi,
									 attacker->client->pers.netname,
									 NULL,
									 "F Def",
									 NULL,
									 2, //surt fixme symbolic
									 level.time );
					}
				}
				else // Flag is lying around, do we get credit for defending the base?
				{
					// Defend the Base
					VectorSubtract (attacker->s.origin, attacker_flag->homeposition, dir);
					dist1 = VectorLength(dir); //attacker was near his pedastal
					
					VectorSubtract (self->s.origin, attacker_flag->homeposition, dir);
					dist2 = VectorLength(dir); //dead guy was in attacker's base
					
					//surt duh, this was using | not ||
					if ((dist1 < CTF_DEFEND_BASE_RADIUS) || (dist2 < CTF_DEFEND_BASE_RADIUS)) // was 512  MJD Added Parens
					{
						switch (attacker->client->ctf.teamnum)
						{
						case CTF_TEAM_RED: flagcolor = "red"; break;
						case CTF_TEAM_BLUE: flagcolor = "blue"; break;
						}
						sprintf(message, "%s defends the %s base.\n",
								attacker->client->pers.netname,
								flagcolor );
						ctf_BSafePrint(PRINT_HIGH, message);
						attacker->client->resp.score += 1;
						stats_add(attacker, STATS_SCORE, 1);
						
						stats_add(attacker, STATS_DEFENSE_BASE, 1); // STATS - LM_Hati
						// Log Flag Defense - MarkDavies
						sl_LogScore( &gi,
									 attacker->client->pers.netname,
									 NULL,
									 "F Base Def",
									 NULL,
									 1, //surt fixme symbolic
									 level.time );
					}
					
					// Defend the Away Flag
					VectorSubtract (attacker->s.origin, attacker_flag->s.origin, dir);
					dist1 = VectorLength(dir); //i was standing near my flag, which was not at base
					
					VectorSubtract (self->s.origin, attacker_flag->s.origin, dir);
					dist2 = VectorLength(dir); //deadguy was standing near my flag, which was not at base
					
					//surt duh, this was using | not ||
					if ((dist1 < CTF_DEFEND_REMOTE_RADIUS) || (dist2 < CTF_DEFEND_REMOTE_RADIUS)) // was 512	MJD Added Parens
					{
						attacker->client->defend_flag_time = level.time;
					}
					
				}
				
				//is the dead guy's flag in someone's posession?
				//if so, then potentially attacker was defending his flag carrier
				//but not if the dead guy's flag owner is us.
				if ( (ctf_validateplayer(defender_flag->owner, CTF_TEAM_ANYTEAM) ) &&
					 (defender_flag->owner != attacker) ) // We can't defend ourselves
				{
					
					if (level.time < self->client->hit_carrier_time + 2) //dead guy recently hit carrier
					{
						switch (attacker->client->ctf.teamnum)
						{
						case CTF_TEAM_RED: flagcolor = "red"; break;
						case CTF_TEAM_BLUE: flagcolor = "blue"; break;
						}
						sprintf(message, "%s defends the %s flag carrier from an aggressive enemy.\n",
								attacker->client->pers.netname,
								flagcolor );
						ctf_BSafePrint(PRINT_HIGH, message);
						attacker->client->resp.score += 3;
						stats_add(attacker, STATS_SCORE, 3);
						
						// STDLog Flag Danger Carrier Protect Frag - Surt
						sl_LogScore( &gi,
									 attacker->client->pers.netname,
									 NULL,
									 "FC Def",
									 NULL,
									 3, //value of this event FIXME symbolic surt
									 level.time );
						
						
						stats_add(attacker, STATS_DEFENSE_CARRIER, 1); // STATS - LM_Hati
					}
					else
					{
						dist1 = 0;
						dist2 = 0;
						
						VectorSubtract (attacker->s.origin, defender_flag->owner->s.origin, dir); //i'm standing near the carrier of the dead guy's flag
						dist1 = VectorLength(dir);
						
						VectorSubtract (self->s.origin, defender_flag->owner->s.origin, dir); //dead guy near my flag carrier
						dist2 = VectorLength(dir);
						
						if ((dist1 < CTF_DEFEND_CARRIER_RADIUS) || (dist2 < CTF_DEFEND_CARRIER_RADIUS)) //MJD Added Parens
						{
							switch (attacker->client->ctf.teamnum)
							{
							case CTF_TEAM_RED: flagcolor = "red"; break;
							case CTF_TEAM_BLUE: flagcolor = "blue"; break;
							}
							sprintf(message, "%s defends the %s flag carrier.\n",
									attacker->client->pers.netname,
									flagcolor );
							ctf_BSafePrint(PRINT_HIGH, message);
							attacker->client->resp.score += 2;
							stats_add(attacker, STATS_SCORE, 2);
							
							stats_add(attacker, STATS_DEFENSE_CARRIER, 1); // STATS - LM_Hati
							// STDLog Flag Carrier Protect Frag - Surt
							sl_LogScore( &gi,
										 attacker->client->pers.netname,
										 NULL,
										 "FC Def",
										 NULL,
										 2,
										 level.time );
						}
					}
				}
			}
		}
		
		// was the dead player the flag carrier?
		defender_flag = ClientHasFlag(self);
		if (defender_flag) //surt to avoid compiler warns on linux/solaris (assignment in conditional)
		{
			if (attacker->client->ctf.teamnum != self->client->ctf.teamnum) //implicit attacker != self
			{
				sprintf(message, "%s killed the enemy flag carrier.\n", attacker->client->pers.netname);
				ctf_BSafePrint(PRINT_HIGH, message);
				attacker->client->resp.score += 2;
				stats_add(attacker, STATS_SCORE, 2);
				attacker->client->kill_carrier_time = level.time;
				
				// STDLog Flag Carrier Frag - Surt
				sl_LogScore( &gi,
							 attacker->client->pers.netname,
							 NULL,
							 "FC Frag",
							 NULL,
							 2, //value of this event FIXME we need to make these symbolic surt
							 level.time );
				
				stats_add(attacker, STATS_OFFENSE_CARRIER, 1); // STATS - LM_Hati
			}
		}
		
		
	}
	 
	if (self->client->hook)
	{
		G_FreeEdict (self->client->hook);
		self->client->hook = NULL;
	}
	if (self->client->rune && self->client->rune->item)
	{
		Drop_Rune(self, self->client->rune->item);
	}
	 
	self->s.renderfx = 0;
	self->s.effects = 0;
	 
	 
	//surt regardless of whether everybody was valid players, if self had the flag, better drop it!
	defender_flag = ClientHasFlag(self);
	if (defender_flag) //surt to avoid compiler warns on linux/solaris (assignment in conditional)
	{
		ctf_playerdropflag(self, defender_flag->item);
	}
	 
	// END CTF CODE -- LM_JORM
	 
	 

	VectorClear (self->avelocity);

	self->takedamage = DAMAGE_YES;
	self->movetype = MOVETYPE_TOSS;

	self->s.modelindex2 = 0;	// remove linked weapon model

	self->s.angles[0] = 0;
	self->s.angles[2] = 0;

	self->s.sound = 0;
	self->client->weapon_sound = 0;

	self->maxs[2] = -8;

//	self->solid = SOLID_NOT;
	self->svflags |= SVF_DEADMONSTER;

	if (!self->deadflag)
	{
		self->client->respawn_time = level.time + 1.0;
		LookAtKiller (self, inflictor, attacker);
		self->client->ps.pmove.pm_type = PM_DEAD;
		ClientObituary (self, inflictor, attacker);
		
		//-bat added this for stdlogging.
		sl_WriteStdLogDeath( &gi, level, self, inflictor, attacker);
		
		TossClientWeapon (self);
		if (deathmatch->value)
			Cmd_Help_f (self);		// show scores

		// clear inventory
		// this is kind of ugly, but it's how we want to handle keys in coop
		for (n = 0; n < game.num_items; n++)
		{
			if (coop->value && itemlist[n].flags & IT_KEY)
				self->client->resp.coop_respawn.inventory[n] = self->client->pers.inventory[n];
			self->client->pers.inventory[n] = 0;
		}
	}

	// remove powerups
	self->client->quad_framenum = 0;
	self->client->invincible_framenum = 0;
	self->client->breather_framenum = 0;
	self->client->enviro_framenum = 0;
	self->flags &= ~FL_POWER_ARMOR;

	if (self->health < -40)
	{	// gib
		gi.sound (self, CHAN_BODY, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
		for (n= 0; n < 4; n++)
			ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
		ThrowClientHead (self, damage);

		self->takedamage = DAMAGE_NO;
	}
	else
	{	// normal death
		if (!self->deadflag)
		{
			static int i;

			i = (i+1)%3;
			// start a death animation
			self->client->anim_priority = ANIM_DEATH;
			if (self->client->ps.pmove.pm_flags & PMF_DUCKED)
			{
				self->s.frame = FRAME_crdeath1-1;
				self->client->anim_end = FRAME_crdeath5;
			}
			else switch (i)
			{
			case 0:
				self->s.frame = FRAME_death101-1;
				self->client->anim_end = FRAME_death106;
				break;
			case 1:
				self->s.frame = FRAME_death201-1;
				self->client->anim_end = FRAME_death206;
				break;
			case 2:
				self->s.frame = FRAME_death301-1;
				self->client->anim_end = FRAME_death308;
				break;
			}
			gi.sound (self, CHAN_VOICE, gi.soundindex(va("*death%i.wav", (rand()%4)+1)), 1, ATTN_NORM, 0);
		}
	}

	self->deadflag = DEAD_DEAD;

	gi.linkentity (self);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x388, %rsp            # imm = 0x388
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorl %eax, %eax
callq 0x185d0
pushq $-0x5
popq %rsi
movq %r14, %rdi
callq 0x18de0
testl %eax, %eax
je 0x3f927
pushq $-0x5
popq %rsi
movq %rbx, %rdi
callq 0x18de0
cmpq %r14, %rbx
je 0x3f927
testl %eax, %eax
je 0x3f927
cmpl $0x2, 0x260(%rbx)
je 0x3f927
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18750
testl %eax, %eax
je 0x3fbcd
movq %rbx, %rdi
callq 0x18150
testq %rax, %rax
je 0x3f927
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
movq 0x58(%rbx), %rcx
cmpl 0x1100(%rcx), %eax
je 0x3f927
movl $0x2c0, %eax            # imm = 0x2C0
addq %rax, %rdx
leaq 0x16a82(%rip), %rsi     # 0x56325
leaq 0x180(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x193f0
movq 0x58(%r14), %rax
addl $0x2, 0xdf4(%rax)
pushq $0x3
popq %rsi
movq %r14, %rdi
movq %r13, %rdx
callq 0x194d0
movq 0x274bc(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x58(%r14), %rsi
movss %xmm0, 0x10f4(%rsi)
movl $0x2c0, %eax            # imm = 0x2C0
addq %rax, %rsi
movq 0x26cfc(%rip), %rdi     # 0x66600
leaq 0x16a3d(%rip), %rcx     # 0x56348
pushq $0x2
popq %r9
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x18fb0
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x194d0
movq 0x58(%rbx), %rax
movq 0xf60(%rax), %rdi
testq %rdi, %rdi
je 0x3f948
callq 0x19c50
movq 0x58(%rbx), %rax
andq $0x0, 0xf60(%rax)
movq 0xf68(%rax), %rax
testq %rax, %rax
je 0x3f968
movq 0x330(%rax), %rsi
testq %rsi, %rsi
je 0x3f968
movq %rbx, %rdi
callq 0x19b20
andq $0x0, 0x40(%rbx)
movq %rbx, %rdi
callq 0x18150
testq %rax, %rax
je 0x3f989
movq 0x330(%rax), %rsi
movq %rbx, %rdi
callq 0x19a00
andl $0x0, 0x1d4(%rbx)
andq $0x0, 0x1cc(%rbx)
movl $0x1, 0x27c(%rbx)
movl $0x7, 0x118(%rbx)
andl $0x0, 0x2c(%rbx)
andl $0x0, 0x10(%rbx)
andl $0x0, 0x18(%rbx)
andl $0x0, 0x4c(%rbx)
movq 0x58(%rbx), %rcx
andl $0x0, 0xf20(%rcx)
movl $0xc1000000, 0xe0(%rbx) # imm = 0xC1000000
orb $0x2, 0xc8(%rbx)
xorl %eax, %eax
cmpl %eax, 0x260(%rbx)
jne 0x3fae0
movq 0x273b3(%rip), %r12     # 0x66da0
movss 0x4(%r12), %xmm0
addss 0xf52c(%rip), %xmm0     # 0x4ef28
movss %xmm0, 0xf28(%rcx)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x19100
movq 0x58(%rbx), %rax
movl $0x2, (%rax)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x181d0
pushq $0x2b
popq %rcx
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x26bc6(%rip), %rdi     # 0x66600
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x18510
movq %rbx, %rdi
callq 0x18fd0
movq 0x27469(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3fa69
jnp 0x3fa74
movq %rbx, %rdi
callq 0x18720
xorps %xmm1, %xmm1
movq 0x273c5(%rip), %rax     # 0x66e40
addq $0x68, %rax
movq 0x274da(%rip), %rcx     # 0x66f60
movq (%rcx), %rcx
xorl %edx, %edx
movq 0x272ae(%rip), %rsi     # 0x66d40
movslq 0x61c(%rsi), %rdi
cmpq %rdi, %rdx
jge 0x3fadc
movss 0x20(%rcx), %xmm0
ucomiss %xmm1, %xmm0
jne 0x3faaa
jnp 0x3fac5
testb $0x10, (%rax)
movq 0x58(%rbx), %rdi
je 0x3fac9
movl 0x318(%rdi,%rdx,4), %r8d
movl %r8d, 0x9b0(%rdi,%rdx,4)
jmp 0x3fac9
movq 0x58(%rbx), %rdi
andl $0x0, 0x318(%rdi,%rdx,4)
incq %rdx
addq $0x88, %rax
jmp 0x3fa92
movq 0x58(%rbx), %rcx
xorps %xmm0, %xmm0
movups %xmm0, 0xf04(%rcx)
andb $-0x11, 0x11d(%rbx)
cmpl $-0x29, 0x254(%rbx)
jg 0x3fb4a
movq 0x26aff(%rip), %rax     # 0x66600
movq 0x20(%rax), %r15
leaq 0x13c2e(%rip), %rdi     # 0x5373a
callq *0x48(%rax)
pushq $0x4
popq %r14
movss 0xf40d(%rip), %xmm0     # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %r14d, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r15
leaq 0x13c17(%rip), %r15     # 0x5374a
movq %rbx, %rdi
subl $0x1, %r14d
jb 0x3fba4
movq %r15, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x18940
jmp 0x3fb33
cmpl $0x0, 0x260(%rbx)
jne 0x3fd43
pushq $0x3
popq %rsi
movl 0x4f540(%rip), %eax     # 0x8f0a0
incl %eax
xorl %edx, %edx
divl %esi
movl %edx, 0x4f534(%rip)     # 0x8f0a0
movl $0x5, 0xef8(%rcx)
testb $0x1, 0x10(%rcx)
jne 0x3fbb7
cmpl $0x2, %edx
je 0x3fcd5
cmpl $0x1, %edx
jne 0x3fce8
movl $0xb7, 0x38(%rbx)
movl $0xbd, 0xef4(%rcx)
jmp 0x3fcf9
movl %ebp, %esi
callq 0x18ed0
andl $0x0, 0x27c(%rbx)
jmp 0x3fd43
movl $0xac, 0x38(%rbx)
movl $0xb1, 0xef4(%rcx)
jmp 0x3fcf9
movq 0x58(%r14), %rax
cmpl $0x1, 0x1100(%rax)
movq 0x26c81(%rip), %rax     # 0x66860
movq (%rax), %r13
movq 0x26c0f(%rip), %rax     # 0x667f8
movq (%rax), %rax
movq %rax, %r12
cmoveq %r13, %r12
cmoveq %rax, %r13
testq %r13, %r13
je 0x3f869
movq 0x110(%r13), %rdi
pushq $-0x5
popq %rsi
callq 0x18de0
testl %eax, %eax
jne 0x3f869
movq %r12, 0x160(%rsp)
movq %r13, %rdi
callq 0x195d0
movss 0x4(%r14), %xmm0
testl %eax, %eax
je 0x3fd6f
movsd 0x4(%r13), %xmm1
movss 0x8(%r14), %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subps %xmm1, %xmm0
leaq 0x170(%rsp), %r12
movlps %xmm0, (%r12)
movss 0xc(%r14), %xmm0
subss 0xc(%r13), %xmm0
movss %xmm0, 0x8(%r12)
movq %r12, %rdi
callq 0x19460
movss %xmm0, 0x158(%rsp)
movsd 0x4(%rbx), %xmm0
movsd 0x4(%r13), %xmm1
subps %xmm1, %xmm0
movlps %xmm0, (%r12)
movss 0xc(%rbx), %xmm0
subss 0xc(%r13), %xmm0
movss %xmm0, 0x8(%r12)
movq %r12, %rdi
callq 0x19460
movss 0xf5fb(%rip), %xmm1     # 0x4f2a8
ucomiss 0x158(%rsp), %xmm1
ja 0x3fe1b
ucomiss %xmm0, %xmm1
ja 0x3fe1b
movq $0x0, 0x158(%rsp)
jmp 0x40038
movl $0xbd, 0x38(%rbx)
movl $0xc5, 0xef4(%rcx)
jmp 0x3fcf9
movl $0xb1, 0x38(%rbx)
movl $0xb7, 0xef4(%rcx)
movq 0x26900(%rip), %rax     # 0x66600
movq 0x20(%rax), %r14
movq 0x48(%rax), %r15
callq 0x19bf0
pushq $0x4
popq %rcx
cltd
idivl %ecx
leal 0x1(%rdx), %esi
leaq 0x16633(%rip), %rdi     # 0x56350
xorl %eax, %eax
callq 0x194e0
movq %rax, %rdi
callq *%r15
pushq $0x2
popq %rsi
movss 0xf1f3(%rip), %xmm0     # 0x4ef28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r14
movl $0x2, 0x260(%rbx)
movq 0x268ac(%rip), %rax     # 0x66600
movq %rbx, %rdi
callq *0x90(%rax)
addq $0x388, %rsp            # imm = 0x388
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movsd 0x460(%r13), %xmm1
movss 0x8(%r14), %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subps %xmm1, %xmm0
leaq 0x170(%rsp), %r12
movlps %xmm0, (%r12)
movss 0xc(%r14), %xmm0
subss 0x468(%r13), %xmm0
movss %xmm0, 0x8(%r12)
movq %r12, %rdi
callq 0x19460
movss %xmm0, 0x158(%rsp)
movsd 0x4(%rbx), %xmm0
movsd 0x460(%r13), %xmm1
subps %xmm1, %xmm0
movlps %xmm0, (%r12)
movss 0xc(%rbx), %xmm0
subss 0x468(%r13), %xmm0
movss %xmm0, 0x8(%r12)
movq %r12, %rdi
callq 0x19460
movss 0x13521(%rip), %xmm1    # 0x53314
ucomiss 0x158(%rsp), %xmm1
ja 0x3fee8
ucomiss %xmm0, %xmm1
ja 0x3fee8
movq $0x0, 0x158(%rsp)
jmp 0x3ff9c
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
leaq 0xf698(%rip), %rsi      # 0x4f4c9
cmovneq %rcx, %rsi
cmpl $0x1, %eax
leaq 0xf698(%rip), %rcx      # 0x4f4d7
cmovneq %rsi, %rcx
movl $0x2c0, %r13d           # imm = 0x2C0
addq %r13, %rdx
leaq 0x1642d(%rip), %rsi     # 0x56280
leaq 0x180(%rsp), %r12
movq %r12, %rdi
movq %rcx, 0x158(%rsp)
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %rdi
movq %r12, %rsi
callq 0x193f0
movq 0x58(%r14), %rax
addl $0x2, 0xdf4(%rax)
pushq $0x3
popq %rsi
movq %r14, %rdi
pushq $0x2
popq %rdx
callq 0x194d0
movq 0x26f08(%rip), %r12     # 0x66da0
movss 0x4(%r12), %xmm0
movq 0x58(%r14), %rax
movss %xmm0, 0x10ec(%rax)
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x194d0
addq 0x58(%r14), %r13
movss 0x4(%r12), %xmm0
movq 0x26735(%rip), %rdi     # 0x66600
leaq 0x163c7(%rip), %rcx     # 0x56299
pushq $0x2
popq %r9
movq %r13, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x18fb0
jmp 0x40038
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
leaq 0xf5cb(%rip), %rsi      # 0x4f4c9
cmovneq %rcx, %rsi
cmpl $0x1, %eax
leaq 0xf5cb(%rip), %rcx      # 0x4f4d7
cmovneq %rsi, %rcx
movl $0x2c0, %r12d           # imm = 0x2C0
addq %r12, %rdx
leaq 0x1637f(%rip), %rsi     # 0x5629f
leaq 0x180(%rsp), %rdi
movq %rcx, 0x158(%rsp)
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %rdi
leaq 0x180(%rsp), %rsi
callq 0x193f0
movq 0x58(%r14), %rax
incl 0xdf4(%rax)
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x194d0
pushq $0x8
popq %rsi
movq %r14, %rdi
pushq $0x1
popq %rdx
callq 0x194d0
addq 0x58(%r14), %r12
movq 0x26e28(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x2667c(%rip), %rdi     # 0x66600
leaq 0x1632d(%rip), %rcx     # 0x562b8
pushq $0x1
popq %r9
movq %r12, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x18fb0
movsd 0x4(%r14), %xmm0
movsd 0x4(%r13), %xmm1
subps %xmm1, %xmm0
leaq 0x170(%rsp), %r12
movlps %xmm0, (%r12)
movss 0xc(%r14), %xmm0
subss 0xc(%r13), %xmm0
movss %xmm0, 0x8(%r12)
movq %r12, %rdi
callq 0x19460
movss %xmm0, 0x16c(%rsp)
movsd 0x4(%rbx), %xmm0
movsd 0x4(%r13), %xmm1
subps %xmm1, %xmm0
movlps %xmm0, (%r12)
movss 0xc(%rbx), %xmm0
subss 0xc(%r13), %xmm0
movss %xmm0, 0x8(%r12)
movq %r12, %rdi
callq 0x19460
movss 0x11f93(%rip), %xmm1    # 0x51fa4
ucomiss 0x16c(%rsp), %xmm1
ja 0x40020
ucomiss %xmm0, %xmm1
jbe 0x40038
movq 0x26d79(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x58(%r14), %rax
movss %xmm0, 0x10ec(%rax)
movq 0x160(%rsp), %r12
movq 0x110(%r12), %rdi
pushq $-0x5
popq %rsi
callq 0x18de0
testl %eax, %eax
je 0x3f869
movq 0x110(%r12), %rax
cmpq %r14, %rax
je 0x3f869
movq 0x58(%rbx), %rcx
movss 0x10f8(%rcx), %xmm0
addss 0xf3ef(%rip), %xmm0     # 0x4f46c
movq 0x26d1c(%rip), %rcx     # 0x66da0
ucomiss 0x4(%rcx), %xmm0
jbe 0x400ba
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
cmpl $0x2, %eax
je 0x40178
cmpl $0x1, %eax
movq 0x158(%rsp), %rcx
jne 0x4017f
leaq 0xf422(%rip), %rcx      # 0x4f4d7
jmp 0x4017f
movsd 0x4(%r14), %xmm0
movsd 0x4(%rax), %xmm1
subps %xmm1, %xmm0
movq %r12, %r13
leaq 0x170(%rsp), %r12
movlps %xmm0, (%r12)
movss 0xc(%r14), %xmm0
subss 0xc(%rax), %xmm0
movss %xmm0, 0x8(%r12)
movq %r12, %rdi
callq 0x19460
movss %xmm0, 0x160(%rsp)
movq 0x110(%r13), %rax
movsd 0x4(%rbx), %xmm0
movsd 0x4(%rax), %xmm1
subps %xmm1, %xmm0
movlps %xmm0, (%r12)
movss 0xc(%rbx), %xmm0
subss 0xc(%rax), %xmm0
movss %xmm0, 0x8(%r12)
movq %r12, %rdi
callq 0x19460
movss 0x131db(%rip), %xmm1    # 0x53310
ucomiss 0x160(%rsp), %xmm1
ja 0x40148
ucomiss %xmm0, %xmm1
jbe 0x3f869
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
cmpl $0x2, %eax
je 0x4020a
cmpl $0x1, %eax
movq 0x158(%rsp), %rcx
jne 0x40211
leaq 0xf364(%rip), %rcx      # 0x4f4d7
jmp 0x40211
leaq 0xf34a(%rip), %rcx      # 0x4f4c9
movl $0x2c0, %r12d           # imm = 0x2C0
addq %r12, %rdx
leaq 0x16134(%rip), %rsi     # 0x562c3
leaq 0x180(%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %rdi
movq %r13, %rsi
callq 0x193f0
movq 0x58(%r14), %rax
addl $0x3, 0xdf4(%rax)
pushq $0x3
popq %r13
pushq $0x3
popq %rdx
movq %r14, %rdi
movl %r13d, %esi
callq 0x194d0
addq 0x58(%r14), %r12
movq 0x26bcc(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x26420(%rip), %rdi     # 0x66600
leaq 0x16116(%rip), %rcx     # 0x562fd
movq %r12, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movl %r13d, %r9d
callq 0x18fb0
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x194d0
jmp 0x3f869
leaq 0xf2b8(%rip), %rcx      # 0x4f4c9
movl $0x2c0, %r13d           # imm = 0x2C0
addq %r13, %rdx
leaq 0x160e3(%rip), %rsi     # 0x56304
leaq 0x180(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %rdi
movq %r12, %rsi
callq 0x193f0
movq 0x58(%r14), %rax
addl $0x2, 0xdf4(%rax)
pushq $0x3
popq %rsi
movq %r14, %rdi
pushq $0x2
popq %rdx
callq 0x194d0
pushq $0x9
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x194d0
addq 0x58(%r14), %r13
movq 0x26b30(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x26384(%rip), %rdi     # 0x66600
leaq 0x1607a(%rip), %rcx     # 0x562fd
pushq $0x2
popq %r9
movq %r13, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
callq 0x18fb0
jmp 0x3f869