// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq %r8, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x60(%rbp)
movb $0x0, %al
callq 0x185f0
movq -0x18(%rbp), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18e40
cmpl $0x0, %eax
je 0x581c8
movq -0x8(%rbp), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18e40
cmpl $0x0, %eax
je 0x581c8
movq -0x8(%rbp), %rax
cmpq -0x18(%rbp), %rax
je 0x581c8
movq -0x8(%rbp), %rax
cmpl $0x2, 0x260(%rax)
je 0x581c8
movq -0x18(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x18770
cmpl $0x0, %eax
jne 0x580b2
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x1, 0x1100(%rax)
jne 0x5784f
movq 0x2afc0(%rip), %rax     # 0x827f8
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq 0x2b01a(%rip), %rax     # 0x82860
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x5786b
movq 0x2b00a(%rip), %rax     # 0x82860
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq 0x2af94(%rip), %rax     # 0x827f8
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x580b0
movq -0x38(%rbp), %rax
movq 0x110(%rax), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18e40
cmpl $0x0, %eax
jne 0x580b0
movq -0x38(%rbp), %rdi
callq 0x19650
cmpl $0x0, %eax
je 0x57a8d
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x54(%rbp)
movss 0x18950(%rip), %xmm0    # 0x702a4
ucomiss -0x50(%rbp), %xmm0
ja 0x5796c
movss 0x18942(%rip), %xmm0    # 0x702a4
ucomiss -0x54(%rbp), %xmm0
jbe 0x57a88
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1100(%rax), %eax
movl %eax, -0x264(%rbp)
subl $0x1, %eax
je 0x57994
jmp 0x57987
movl -0x264(%rbp), %eax
subl $0x2, %eax
je 0x579a1
jmp 0x579ac
leaq 0x18b14(%rip), %rax     # 0x704af
movq %rax, -0x60(%rbp)
jmp 0x579ac
leaq 0x18af9(%rip), %rax     # 0x704a1
movq %rax, -0x60(%rbp)
leaq -0x260(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
movq -0x60(%rbp), %rcx
leaq 0x1f584(%rip), %rsi     # 0x76f58
movb $0x0, %al
callq 0x19940
leaq -0x260(%rbp), %rsi
movl $0x2, %edi
callq 0x19470
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xdf4(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0xdf4(%rax)
movq -0x18(%rbp), %rdi
movl $0x3, %esi
movl $0x2, %edx
callq 0x19550
movq 0x2b383(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0x10ec(%rax)
movq -0x18(%rbp), %rdi
movl $0x7, %esi
movl $0x1, %edx
callq 0x19550
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
movq 0x2b33e(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq 0x2ab92(%rip), %rdi     # 0x82600
xorl %eax, %eax
movl %eax, %r8d
leaq 0x1f4f7(%rip), %rcx     # 0x76f71
movl $0x2, %r9d
movq %r8, %rdx
callq 0x19010
jmp 0x57d45
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x460(%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x464(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x468(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x460(%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x464(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x468(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x54(%rbp)
movss 0x1c6a7(%rip), %xmm0    # 0x741f4
ucomiss -0x50(%rbp), %xmm0
ja 0x57b65
movss 0x1c699(%rip), %xmm0    # 0x741f4
ucomiss -0x54(%rbp), %xmm0
jbe 0x57c65
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1100(%rax), %eax
movl %eax, -0x268(%rbp)
subl $0x1, %eax
je 0x57b8d
jmp 0x57b80
movl -0x268(%rbp), %eax
subl $0x2, %eax
je 0x57b9a
jmp 0x57ba5
leaq 0x1891b(%rip), %rax     # 0x704af
movq %rax, -0x60(%rbp)
jmp 0x57ba5
leaq 0x18900(%rip), %rax     # 0x704a1
movq %rax, -0x60(%rbp)
leaq -0x260(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
movq -0x60(%rbp), %rcx
leaq 0x1f3aa(%rip), %rsi     # 0x76f77
movb $0x0, %al
callq 0x19940
leaq -0x260(%rbp), %rsi
movl $0x2, %edi
callq 0x19470
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xdf4(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0xdf4(%rax)
movq -0x18(%rbp), %rdi
movl $0x3, %esi
movl $0x1, %edx
callq 0x19550
movq -0x18(%rbp), %rdi
movl $0x8, %esi
movl $0x1, %edx
callq 0x19550
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
movq 0x2b161(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq 0x2a9b5(%rip), %rdi     # 0x82600
xorl %eax, %eax
movl %eax, %r8d
leaq 0x1f339(%rip), %rcx     # 0x76f90
movl $0x1, %r9d
movq %r8, %rdx
callq 0x19010
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x38(%rbp), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x54(%rbp)
movss 0x1b141(%rip), %xmm0    # 0x72e54
ucomiss -0x50(%rbp), %xmm0
ja 0x57d27
movss 0x1b133(%rip), %xmm0    # 0x72e54
ucomiss -0x54(%rbp), %xmm0
jbe 0x57d43
movq 0x2b072(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0x10ec(%rax)
jmp 0x57d45
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rdi
movl $0xfffffffb, %esi       # imm = 0xFFFFFFFB
callq 0x18e40
cmpl $0x0, %eax
je 0x580ae
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rax
cmpq -0x18(%rbp), %rax
je 0x580ae
movq 0x2b021(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm1
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss 0x18154(%rip), %xmm0    # 0x6fee8
addss 0x10f8(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x57eaa
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1100(%rax), %eax
movl %eax, -0x26c(%rbp)
subl $0x1, %eax
je 0x57dcd
jmp 0x57dc0
movl -0x26c(%rbp), %eax
subl $0x2, %eax
je 0x57dda
jmp 0x57de5
leaq 0x186db(%rip), %rax     # 0x704af
movq %rax, -0x60(%rbp)
jmp 0x57de5
leaq 0x186c0(%rip), %rax     # 0x704a1
movq %rax, -0x60(%rbp)
leaq -0x260(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
movq -0x60(%rbp), %rcx
leaq 0x1f18e(%rip), %rsi     # 0x76f9b
movb $0x0, %al
callq 0x19940
leaq -0x260(%rbp), %rsi
movl $0x2, %edi
callq 0x19470
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xdf4(%rax), %ecx
addl $0x3, %ecx
movl %ecx, 0xdf4(%rax)
movq -0x18(%rbp), %rdi
movl $0x3, %esi
movl $0x3, %edx
callq 0x19550
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
movq 0x2af34(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq 0x2a788(%rip), %rdi     # 0x82600
xorl %eax, %eax
movl %eax, %r8d
leaq 0x1f151(%rip), %rcx     # 0x76fd5
movl $0x3, %r9d
movq %r8, %rdx
callq 0x19010
movq -0x18(%rbp), %rdi
movl $0x9, %esi
movl $0x1, %edx
callq 0x19550
jmp 0x580ac
xorps %xmm0, %xmm0
movss %xmm0, -0x50(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x54(%rbp)
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x18(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x18(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rax
subss 0x4(%rax), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rax
subss 0x8(%rax), %xmm0
movss %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
movq -0x40(%rbp), %rax
movq 0x110(%rax), %rax
subss 0xc(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
leaq -0x4c(%rbp), %rdi
callq 0x194e0
movss %xmm0, -0x54(%rbp)
movss 0x1c25e(%rip), %xmm0    # 0x741f0
ucomiss -0x50(%rbp), %xmm0
ja 0x57faa
movss 0x1c250(%rip), %xmm0    # 0x741f0
ucomiss -0x54(%rbp), %xmm0
jbe 0x580aa
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1100(%rax), %eax
movl %eax, -0x270(%rbp)
subl $0x1, %eax
je 0x57fd2
jmp 0x57fc5
movl -0x270(%rbp), %eax
subl $0x2, %eax
je 0x57fdf
jmp 0x57fea
leaq 0x184d6(%rip), %rax     # 0x704af
movq %rax, -0x60(%rbp)
jmp 0x57fea
leaq 0x184bb(%rip), %rax     # 0x704a1
movq %rax, -0x60(%rbp)
leaq -0x260(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
movq -0x60(%rbp), %rcx
leaq 0x1efca(%rip), %rsi     # 0x76fdc
movb $0x0, %al
callq 0x19940
leaq -0x260(%rbp), %rsi
movl $0x2, %edi
callq 0x19470
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xdf4(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0xdf4(%rax)
movq -0x18(%rbp), %rdi
movl $0x3, %esi
movl $0x2, %edx
callq 0x19550
movq -0x18(%rbp), %rdi
movl $0x9, %esi
movl $0x1, %edx
callq 0x19550
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
movq 0x2ad1c(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq 0x2a570(%rip), %rdi     # 0x82600
xorl %eax, %eax
movl %eax, %r8d
leaq 0x1ef39(%rip), %rcx     # 0x76fd5
movl $0x2, %r9d
movq %r8, %rdx
callq 0x19010
jmp 0x580ac
jmp 0x580ae
jmp 0x580b0
jmp 0x580b2
movq -0x8(%rbp), %rdi
callq 0x18150
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x581c6
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x1100(%rax), %eax
movq -0x8(%rbp), %rcx
movq 0x58(%rcx), %rcx
cmpl 0x1100(%rcx), %eax
je 0x581c4
leaq -0x260(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rdx
addq $0xc0, %rdx
addq $0x200, %rdx            # imm = 0x200
leaq 0x1eeed(%rip), %rsi     # 0x76ffd
movb $0x0, %al
callq 0x19940
leaq -0x260(%rbp), %rsi
movl $0x2, %edi
callq 0x19470
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movl 0xdf4(%rax), %ecx
addl $0x2, %ecx
movl %ecx, 0xdf4(%rax)
movq -0x18(%rbp), %rdi
movl $0x3, %esi
movl $0x2, %edx
callq 0x19550
movq 0x2ac47(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0x10f4(%rax)
movq -0x18(%rbp), %rax
movq 0x58(%rax), %rsi
addq $0xc0, %rsi
addq $0x200, %rsi            # imm = 0x200
movq 0x2ac15(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
movq 0x2a469(%rip), %rdi     # 0x82600
xorl %eax, %eax
movl %eax, %r8d
leaq 0x1ee7d(%rip), %rcx     # 0x77020
movl $0x2, %r9d
movq %r8, %rdx
callq 0x19010
movq -0x18(%rbp), %rdi
movl $0xd, %esi
movl $0x1, %edx
callq 0x19550
jmp 0x581c6
jmp 0x581c8
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0xf60(%rax)
je 0x58201
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf60(%rax), %rdi
callq 0x19cd0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq $0x0, 0xf60(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
cmpq $0x0, 0xf68(%rax)
je 0x5824b
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf68(%rax), %rax
cmpq $0x0, 0x330(%rax)
je 0x5824b
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movq 0xf68(%rax), %rax
movq 0x330(%rax), %rsi
callq 0x19bb0
movq -0x8(%rbp), %rax
movl $0x0, 0x44(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x40(%rax)
movq -0x8(%rbp), %rdi
callq 0x18150
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
je 0x58289
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rax
movq 0x330(%rax), %rsi
callq 0x19a90
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1d4(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1d0(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1cc(%rax)
movq -0x8(%rbp), %rax
movl $0x1, 0x27c(%rax)
movq -0x8(%rbp), %rax
movl $0x7, 0x118(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x2c(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x10(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x18(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x4c(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x0, 0xf20(%rax)
movq -0x8(%rbp), %rax
movss 0x190f2(%rip), %xmm0    # 0x71410
movss %xmm0, 0xe0(%rax)
movq -0x8(%rbp), %rax
movl 0xc8(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0xc8(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x260(%rax)
jne 0x584c2
movq 0x2aa4f(%rip), %rax     # 0x82da0
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x17bde(%rip), %xmm1    # 0x6ff40
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movss %xmm0, 0xf28(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x19170
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x2, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x181d0
movq -0x8(%rbp), %rax
movq %rax, -0x280(%rbp)
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rax
movq %rax, -0x278(%rbp)
movq 0x2a9d5(%rip), %rsi     # 0x82da0
movq %rsp, %rdi
movl $0x2b, %ecx
rep  movsq (%rsi), %es:(%rdi)
movq -0x280(%rbp), %rsi
movq -0x278(%rbp), %rcx
movq 0x2a215(%rip), %rdi     # 0x82600
callq 0x18520
movq -0x8(%rbp), %rdi
callq 0x19030
movq 0x2aac0(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x58414
jp 0x58414
jmp 0x5841d
movq -0x8(%rbp), %rdi
callq 0x18740
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq 0x2a912(%rip), %rcx     # 0x82d40
cmpl 0x61c(%rcx), %eax
jge 0x584c0
movq 0x2ab1f(%rip), %rax     # 0x82f60
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x58455
jp 0x58455
jmp 0x5849b
movslq -0x2c(%rbp), %rcx
movq 0x2a9e0(%rip), %rax     # 0x82e40
imulq $0x88, %rcx, %rcx
addq %rcx, %rax
movl 0x68(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
je 0x5849b
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x2c(%rbp), %rcx
movl 0x318(%rax,%rcx,4), %edx
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x2c(%rbp), %rcx
movl %edx, 0x9b0(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movslq -0x2c(%rbp), %rcx
movl $0x0, 0x318(%rax,%rcx,4)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x58424
jmp 0x584c2
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xf04(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xf08(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xf0c(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0xf10(%rax)
movq -0x8(%rbp), %rax
movl 0x11c(%rax), %ecx
andl $0xffffefff, %ecx       # imm = 0xFFFFEFFF
movl %ecx, 0x11c(%rax)
movq -0x8(%rbp), %rax
cmpl $-0x28, 0x254(%rax)
jge 0x585d4
movq 0x2a0c4(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x288(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x290(%rbp)
leaq 0x1beed(%rip), %rdi     # 0x74446
movq 0x2a0a0(%rip), %rax     # 0x82600
callq *0x48(%rax)
movq -0x290(%rbp), %rdi
movl %eax, %edx
movq -0x288(%rbp), %rax
movl $0x4, %esi
movss 0x1796c(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
movl $0x0, -0x2c(%rbp)
cmpl $0x4, -0x2c(%rbp)
jge 0x585b5
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %edx
leaq 0x1beb3(%rip), %rsi     # 0x74456
xorl %ecx, %ecx
callq 0x18960
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5858f
movq -0x8(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x18f30
movq -0x8(%rbp), %rax
movl $0x0, 0x27c(%rax)
jmp 0x5874f
movq -0x8(%rbp), %rax
cmpl $0x0, 0x260(%rax)
jne 0x5874d
movl 0x52b85(%rip), %eax     # 0xab170
addl $0x1, %eax
movl $0x3, %ecx
cltd
idivl %ecx
movl %edx, 0x52b74(%rip)     # 0xab170
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0x5, 0xef8(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movzbl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x58644
movq -0x8(%rbp), %rax
movl $0xac, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0xb1, 0xef4(%rax)
jmp 0x586cd
movl 0x52b26(%rip), %eax     # 0xab170
movl %eax, -0x294(%rbp)
testl %eax, %eax
je 0x58670
jmp 0x58656
movl -0x294(%rbp), %eax
subl $0x1, %eax
je 0x5868f
jmp 0x58663
movl -0x294(%rbp), %eax
subl $0x2, %eax
je 0x586ae
jmp 0x586cb
movq -0x8(%rbp), %rax
movl $0xb1, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0xb7, 0xef4(%rax)
jmp 0x586cb
movq -0x8(%rbp), %rax
movl $0xb7, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0xbd, 0xef4(%rax)
jmp 0x586cb
movq -0x8(%rbp), %rax
movl $0xbd, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x58(%rax), %rax
movl $0xc5, 0xef4(%rax)
jmp 0x586cd
movq 0x29f2c(%rip), %rax     # 0x82600
movq 0x20(%rax), %rax
movq %rax, -0x2a0(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq 0x29f0f(%rip), %rax     # 0x82600
movq 0x48(%rax), %rax
movq %rax, -0x2b0(%rbp)
callq 0x19c80
movl $0x4, %ecx
cltd
idivl %ecx
movl %edx, %esi
addl $0x1, %esi
leaq 0x1e913(%rip), %rdi     # 0x77028
movb $0x0, %al
callq 0x19560
movq %rax, %rdi
movq -0x2b0(%rbp), %rax
callq *%rax
movq -0x2a8(%rbp), %rdi
movl %eax, %edx
movq -0x2a0(%rbp), %rax
movl $0x2, %esi
movss 0x177a7(%rip), %xmm1    # 0x6feec
xorps %xmm2, %xmm2
movaps %xmm1, %xmm0
callq *%rax
jmp 0x5874f
movq -0x8(%rbp), %rax
movl $0x2, 0x260(%rax)
movq 0x29e9c(%rip), %rax     # 0x82600
movq 0x90(%rax), %rax
movq -0x8(%rbp), %rdi
callq *%rax
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
nopw (%rax,%rax)