// File: /workspace/github_c_makefile_star2_O3/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 0x18590
movq %r14, %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18ce0
testl %eax, %eax
je 0x43132
movq %rbx, %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18ce0
cmpq %r14, %rbx
je 0x43132
testl %eax, %eax
je 0x43132
cmpl $0x2, 0x260(%rbx)
je 0x43132
movq %r14, %rdi
movq %rbx, %rsi
callq 0x18700
testl %eax, %eax
je 0x433f4
movq %rbx, %rdi
callq 0x18150
testq %rax, %rax
je 0x43132
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
movq 0x58(%rbx), %rcx
cmpl 0x1100(%rcx), %eax
je 0x43132
movl $0x2c0, %r13d           # imm = 0x2C0
addq %r13, %rdx
leaq 0x1728a(%rip), %rsi     # 0x5a335
leaq 0x180(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x196f0
movl $0x2, %edi
movq %r12, %rsi
callq 0x19270
movq 0x58(%r14), %rax
addl $0x2, 0xdf4(%rax)
movl $0x2, %edx
movq %r14, %rdi
movl $0x3, %esi
callq 0x19330
movq 0x25cb2(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
movq 0x58(%r14), %rsi
movss %xmm0, 0x10f4(%rsi)
addq %r13, %rsi
movq 0x254f7(%rip), %rdi     # 0x68600
leaq 0x17248(%rip), %rcx     # 0x5a358
xorl %edx, %edx
xorl %r8d, %r8d
movl $0x2, %r9d
callq 0x18e90
movl $0x1, %edx
movq %r14, %rdi
movl $0xd, %esi
callq 0x19330
movq 0x58(%rbx), %rax
movq 0xf60(%rax), %rdi
testq %rdi, %rdi
je 0x43156
callq 0x19a50
movq 0x58(%rbx), %rax
movq $0x0, 0xf60(%rax)
movq 0xf68(%rax), %rax
testq %rax, %rax
je 0x43176
movq 0x330(%rax), %rsi
testq %rsi, %rsi
je 0x43176
movq %rbx, %rdi
callq 0x19940
movq $0x0, 0x40(%rbx)
movq %rbx, %rdi
callq 0x18150
testq %rax, %rax
je 0x4319a
movq 0x330(%rax), %rsi
movq %rbx, %rdi
callq 0x19820
xorl %ecx, %ecx
movl %ecx, 0x1d4(%rbx)
movq $0x0, 0x1cc(%rbx)
movl $0x1, 0x27c(%rbx)
movl $0x7, 0x118(%rbx)
movl %ecx, 0x2c(%rbx)
movl %ecx, 0x10(%rbx)
movl %ecx, 0x18(%rbx)
movl %ecx, 0x4c(%rbx)
movq 0x58(%rbx), %rax
movl %ecx, 0xf20(%rax)
movl $0xc1000000, 0xe0(%rbx) # imm = 0xC1000000
orb $0x2, 0xc8(%rbx)
cmpl %ecx, 0x260(%rbx)
jne 0x432ef
movq 0x25ba5(%rip), %r12     # 0x68da0
movss 0x4(%r12), %xmm0
addss 0xfd1e(%rip), %xmm0     # 0x52f28
movss %xmm0, 0xf28(%rax)
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x18fd0
movq 0x58(%rbx), %rax
movl $0x2, (%rax)
movq %rbx, %rdi
movq %r14, %rdx
callq 0x181b0
movl $0x2b, %ecx
movq %rsp, %rdi
movq %r12, %rsi
rep  movsq (%rsi), %es:(%rdi)
movq 0x253b6(%rip), %rdi     # 0x68600
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x184e0
movq %rbx, %rdi
callq 0x18eb0
movq 0x25c59(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x43279
jnp 0x43281
movq %rbx, %rdi
callq 0x186d0
movq 0x25ab8(%rip), %rcx     # 0x68d40
cmpl $0x0, 0x61c(%rcx)
movq 0x58(%rbx), %rax
jle 0x432ef
movq 0x25cc4(%rip), %rdx     # 0x68f60
movq (%rdx), %rsi
movq 0x25b9a(%rip), %rdx     # 0x68e40
addq $0x68, %rdx
movss 0x20(%rsi), %xmm0
xorl %esi, %esi
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x432bb
jnp 0x432ce
testb $0x10, (%rdx)
je 0x432ce
movl 0x318(%rax,%rsi,4), %edi
movl %edi, 0x9b0(%rax,%rsi,4)
movl $0x0, 0x318(%rax,%rsi,4)
incq %rsi
movslq 0x61c(%rcx), %rdi
addq $0x88, %rdx
cmpq %rdi, %rsi
jl 0x432b4
xorps %xmm0, %xmm0
movups %xmm0, 0xf04(%rax)
andb $-0x11, 0x11d(%rbx)
cmpl $-0x29, 0x254(%rbx)
jg 0x43373
movq 0x252f0(%rip), %rax     # 0x68600
movq 0x20(%rax), %r14
leaq 0x1443f(%rip), %rdi     # 0x5775a
callq *0x48(%rax)
movl $0x4, %r15d
movss 0xfbfc(%rip), %xmm0     # 0x52f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x4, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r14
leaq 0x14424(%rip), %r14     # 0x5776a
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
xorl %ecx, %ecx
callq 0x188e0
decl %r15d
jne 0x43346
movq %rbx, %rdi
movl %ebp, %esi
callq 0x18db0
movl $0x0, 0x27c(%rbx)
jmp 0x43577
cmpl $0x0, 0x260(%rbx)
jne 0x43577
movl 0x4dc1a(%rip), %ecx     # 0x90fa0
movl %ecx, %edx
incl %edx
movl $0xaaaaaaab, %esi       # imm = 0xAAAAAAAB
imulq %rdx, %rsi
shrq $0x21, %rsi
leal (%rsi,%rsi,2), %edx
negl %edx
addl %edx, %ecx
incl %ecx
movl %ecx, 0x4dbfa(%rip)     # 0x90fa0
movl $0x5, 0xef8(%rax)
testb $0x1, 0x10(%rax)
jne 0x433de
cmpl $0x2, %ecx
je 0x434fe
cmpl $0x1, %ecx
jne 0x43511
movl $0xb7, 0x38(%rbx)
movl $0xbd, 0xef4(%rax)
jmp 0x43522
movl $0xac, 0x38(%rbx)
movl $0xb1, 0xef4(%rax)
jmp 0x43522
movq 0x58(%r14), %rax
cmpl $0x1, 0x1100(%rax)
movq 0x2545a(%rip), %rax     # 0x68860
movq (%rax), %r13
movq 0x253e8(%rip), %rax     # 0x687f8
movq (%rax), %rax
movq %rax, %r12
cmoveq %r13, %r12
cmoveq %rax, %r13
testq %r13, %r13
je 0x43070
movq 0x110(%r13), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18ce0
testl %eax, %eax
jne 0x43070
movq %r12, 0x160(%rsp)
movq %r13, %rdi
callq 0x19420
movss 0x4(%r14), %xmm0
testl %eax, %eax
je 0x435a3
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 0x192e0
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 0x192e0
movss 0xfdd2(%rip), %xmm1     # 0x532a8
ucomiss 0x158(%rsp), %xmm1
ja 0x4364f
ucomiss %xmm0, %xmm1
ja 0x4364f
movq $0x0, 0x158(%rsp)
jmp 0x43884
movl $0xbd, 0x38(%rbx)
movl $0xc5, 0xef4(%rax)
jmp 0x43522
movl $0xb1, 0x38(%rbx)
movl $0xb7, 0xef4(%rax)
movq 0x250d7(%rip), %rax     # 0x68600
movq 0x20(%rax), %r14
movq 0x48(%rax), %r15
callq 0x19a10
leal 0x3(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
andl $-0x4, %ecx
negl %ecx
leal (%rax,%rcx), %esi
incl %esi
leaq 0x16e11(%rip), %rdi     # 0x5a360
xorl %eax, %eax
callq 0x19340
movq %rax, %rdi
callq *%r15
movss 0xf9c4(%rip), %xmm0     # 0x52f28
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl $0x2, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r14
movl $0x2, 0x260(%rbx)
movq 0x25078(%rip), %rax     # 0x68600
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 0x192e0
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 0x192e0
movss 0x13d0d(%rip), %xmm1    # 0x57334
ucomiss 0x158(%rsp), %xmm1
ja 0x43728
ucomiss %xmm0, %xmm1
ja 0x43728
movq $0x0, 0x158(%rsp)
jmp 0x437e8
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
leaq 0xfe64(%rip), %rsi      # 0x534c9
cmovneq %rcx, %rsi
cmpl $0x1, %eax
leaq 0xfe64(%rip), %rcx      # 0x534d7
cmovneq %rsi, %rcx
movl $0x2c0, %r13d           # imm = 0x2C0
addq %r13, %rdx
leaq 0x16c09(%rip), %rsi     # 0x5a290
leaq 0x180(%rsp), %r12
movq %r12, %rdi
movq %rcx, 0x158(%rsp)
xorl %eax, %eax
callq 0x196f0
movl $0x2, %edi
movq %r12, %rsi
callq 0x19270
movq 0x58(%r14), %rax
addl $0x2, 0xdf4(%rax)
movl $0x2, %edx
movq %r14, %rdi
movl $0x3, %esi
callq 0x19330
movq 0x256ce(%rip), %r12     # 0x68da0
movss 0x4(%r12), %xmm0
movq 0x58(%r14), %rax
movss %xmm0, 0x10ec(%rax)
movl $0x1, %edx
movq %r14, %rdi
movl $0x7, %esi
callq 0x19330
addq 0x58(%r14), %r13
movss 0x4(%r12), %xmm0
movq 0x24ef7(%rip), %rdi     # 0x68600
leaq 0x16b99(%rip), %rcx     # 0x5a2a9
movq %r13, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movl $0x2, %r9d
callq 0x18e90
jmp 0x43884
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
xorl %ecx, %ecx
cmpl $0x2, %eax
leaq 0xfd8b(%rip), %rsi      # 0x534c9
cmovneq %rcx, %rsi
cmpl $0x1, %eax
leaq 0xfd8b(%rip), %rcx      # 0x534d7
cmovneq %rsi, %rcx
movl $0x2c0, %r12d           # imm = 0x2C0
addq %r12, %rdx
leaq 0x16b4f(%rip), %rsi     # 0x5a2af
leaq 0x180(%rsp), %rdi
movq %rcx, 0x158(%rsp)
xorl %eax, %eax
callq 0x196f0
movl $0x2, %edi
leaq 0x180(%rsp), %rsi
callq 0x19270
movq 0x58(%r14), %rax
incl 0xdf4(%rax)
movl $0x1, %edx
movq %r14, %rdi
movl $0x3, %esi
callq 0x19330
movl $0x1, %edx
movq %r14, %rdi
movl $0x8, %esi
callq 0x19330
addq 0x58(%r14), %r12
movq 0x255de(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
movq 0x24e32(%rip), %rdi     # 0x68600
leaq 0x16af3(%rip), %rcx     # 0x5a2c8
movq %r12, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movl $0x1, %r9d
callq 0x18e90
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 0x192e0
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 0x192e0
movss 0x12767(%rip), %xmm1    # 0x55fc4
ucomiss 0x16c(%rsp), %xmm1
ja 0x4386c
ucomiss %xmm0, %xmm1
jbe 0x43884
movq 0x2552d(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
movq 0x58(%r14), %rax
movss %xmm0, 0x10ec(%rax)
movq 0x160(%rsp), %r12
movq 0x110(%r12), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18ce0
testl %eax, %eax
je 0x43070
movq 0x110(%r12), %rax
cmpq %r14, %rax
je 0x43070
movq 0x58(%rbx), %rcx
movss 0x10f8(%rcx), %xmm0
addss 0xfba1(%rip), %xmm0     # 0x5346c
movq 0x254ce(%rip), %rcx     # 0x68da0
ucomiss 0x4(%rcx), %xmm0
jbe 0x43908
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
cmpl $0x2, %eax
je 0x439c6
cmpl $0x1, %eax
movq 0x158(%rsp), %rcx
jne 0x439cd
leaq 0xfbd4(%rip), %rcx      # 0x534d7
jmp 0x439cd
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 0x192e0
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 0x192e0
movss 0x139ad(%rip), %xmm1    # 0x57330
ucomiss 0x160(%rsp), %xmm1
ja 0x43996
ucomiss %xmm0, %xmm1
jbe 0x43070
movq 0x58(%r14), %rdx
movl 0x1100(%rdx), %eax
cmpl $0x2, %eax
je 0x43a61
cmpl $0x1, %eax
movq 0x158(%rsp), %rcx
jne 0x43a68
leaq 0xfb16(%rip), %rcx      # 0x534d7
jmp 0x43a68
leaq 0xfafc(%rip), %rcx      # 0x534c9
movl $0x2c0, %r12d           # imm = 0x2C0
addq %r12, %rdx
leaq 0x168f6(%rip), %rsi     # 0x5a2d3
leaq 0x180(%rsp), %r13
movq %r13, %rdi
xorl %eax, %eax
callq 0x196f0
movl $0x2, %edi
movq %r13, %rsi
callq 0x19270
movq 0x58(%r14), %rax
addl $0x3, 0xdf4(%rax)
movl $0x3, %edx
movq %r14, %rdi
movl $0x3, %esi
callq 0x19330
addq 0x58(%r14), %r12
movq 0x2537c(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
movq 0x24bd0(%rip), %rdi     # 0x68600
leaq 0x168d6(%rip), %rcx     # 0x5a30d
movq %r12, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movl $0x3, %r9d
callq 0x18e90
movl $0x1, %edx
movq %r14, %rdi
movl $0x9, %esi
callq 0x19330
jmp 0x43070
leaq 0xfa61(%rip), %rcx      # 0x534c9
movl $0x2c0, %r13d           # imm = 0x2C0
addq %r13, %rdx
leaq 0x1689c(%rip), %rsi     # 0x5a314
leaq 0x180(%rsp), %r12
movq %r12, %rdi
xorl %eax, %eax
callq 0x196f0
movl $0x2, %edi
movq %r12, %rsi
callq 0x19270
movq 0x58(%r14), %rax
addl $0x2, 0xdf4(%rax)
movl $0x2, %edx
movq %r14, %rdi
movl $0x3, %esi
callq 0x19330
movl $0x1, %edx
movq %r14, %rdi
movl $0x9, %esi
callq 0x19330
addq 0x58(%r14), %r13
movq 0x252cf(%rip), %rax     # 0x68da0
movss 0x4(%rax), %xmm0
movq 0x24b23(%rip), %rdi     # 0x68600
leaq 0x16829(%rip), %rcx     # 0x5a30d
movq %r13, %rsi
xorl %edx, %edx
xorl %r8d, %r8d
movl $0x2, %r9d
callq 0x18e90
jmp 0x43070