// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/g_combat.c
// Function: T_Damage
void T_Damage (edict_t *targ, edict_t *inflictor, edict_t *attacker, vec3_t dir, vec3_t point, vec3_t normal, int damage, int knockback, int dflags, int mod)
{
	gclient_t	*client;
	int			take;
	int			vampdrain;
	int			save;
	int			asave;
	int			psave;
	int			te_sparks;

	if (Match_InCountdown())
		return;
	
	if (!targ->takedamage)
		return;

	// friendly fire avoidance
	// if enabled you can't hurt teammates (but you can hurt yourself)
	// knockback still occurs
	if ((targ != attacker) && (deathmatch->value || coop->value))
	{
		if (OnSameTeam (targ, attacker))
		{
			if (	
					(   ((int)(dmflags->value)) & DF_NO_FRIENDLY_FIRE   )  && 
					!(dflags & DAMAGE_NO_PROTECTION) &&
					!(mod & MOD_TELEFRAG)   
				)
			{
				damage = 0;
			}
			else
				mod |= MOD_FRIENDLY_FIRE;
		}
	}
	meansOfDeath = mod;

	// easy mode takes half damage
	if (skill->value == 0 && deathmatch->value == 0 && targ->client)
	{
		damage *= 0.5;
		if (!damage)
			damage = 1;
	}

	client = targ->client;

	if (dflags & DAMAGE_BULLET)
		te_sparks = TE_BULLET_SPARKS;
	else
		te_sparks = TE_SPARKS;

	VectorNormalize(dir);

// bonus damage for suprising a monster
	if (!(dflags & DAMAGE_RADIUS) && (targ->svflags & SVF_MONSTER) && (attacker->client) && (!targ->enemy) && (targ->health > 0))
		damage *= 2;

	if (targ->flags & FL_NO_KNOCKBACK)
		knockback = 0;

	// apply Damage rune
	damage = DamageRuneHook(targ, inflictor, attacker, damage, knockback, dflags);

// figure momentum add
	if (!(dflags & DAMAGE_NO_KNOCKBACK))
	{
		if ((knockback) && (targ->movetype != MOVETYPE_NONE) && (targ->movetype != MOVETYPE_BOUNCE) && (targ->movetype != MOVETYPE_PUSH) && (targ->movetype != MOVETYPE_STOP))
		{
			vec3_t	kvel;
			float	mass;

			if (targ->mass < 50)
				mass = 50;
			else
				mass = targ->mass;

			if (targ->client  && attacker == targ)
				VectorScale (dir, 1600.0 * (float)knockback / mass, kvel);	// the rocket jump hack...
			else
				VectorScale (dir, 500.0 * (float)knockback / mass, kvel);
			
#ifdef WEAP_BALANCE_OK	
			if ((int)ctfflags->value & CTF_WEAP_BALANCE) //a little extra umph to knockback
			{
				if (targ->client  && attacker == targ)
					VectorScale (dir, 1800.0 * (float)knockback / mass, kvel);	// the rocket jump hack...
				else
					VectorScale (dir, 800.0 * (float)knockback / mass, kvel);
			}
#endif
			if (targ->groundentity)
			{
				if (kvel[2] < 0)
					kvel[2] = 0;
			}
			VectorAdd (targ->velocity, kvel, targ->velocity);
		}
	}

	take = damage;
	save = 0;

	// check for godmode
	if ( (targ->flags & FL_GODMODE) && !(dflags & DAMAGE_NO_PROTECTION) )
	{
		take = 0;
		save = damage;
		SpawnDamage (te_sparks, point, normal, save);
	}

	// check for invincibility
	if ((client && client->invincible_framenum > level.framenum ) && !(dflags & DAMAGE_NO_PROTECTION))
	{
		if (targ->pain_debounce_time < level.time)
		{
			gi.sound(targ, CHAN_ITEM, gi.soundindex("items/protect4.wav"), 1, ATTN_NORM, 0);
			targ->pain_debounce_time = level.time + 2;
		}
		take = 0;
		save = damage;
	}

	psave = CheckPowerArmor (targ, point, normal, take, dflags);
	take -= psave;

	// apply Resist rune
	take = ResistRuneHook(targ, inflictor, attacker, take, knockback, dflags);

	// armor protect from teammates...only protect normal armor
	if (((int) ctfflags->value & CTF_TEAM_ARMOR_PROTECT) &&
	    (OnSameTeam (targ, attacker)) &&
	    (targ != attacker))
	  asave = 0;
	else
	{
	  asave = CheckArmor (targ, point, normal, take, te_sparks, dflags);
	  take -= asave;
	}

	//treat cheat/powerup savings the same as armor
	asave += save;

	// team damage avoidance
	if (!(dflags & DAMAGE_NO_PROTECTION) && CheckTeamDamage (targ, attacker))
		return;

// do the damage
	if (take)
	{
		if ((targ->svflags & SVF_MONSTER) || (client))
			SpawnDamage (TE_BLOOD, point, normal, take);
		else
			SpawnDamage (te_sparks, point, normal, take);


		targ->health = targ->health - take;

		if (attacker && attacker->client && attacker->client->rune)   //added by Vampire - if the attacker is this client
		{                                                             // and the client has a rune
			if ((attacker->client->rune->runetype == RUNE_VAMP)&&(attacker!=targ))   // if the rune is the VAMPIRE rune and the target is not himself
			{
				if (Q_stricmp(targ->classname,"player") == 0)                     // if the target is a player,
                {
					vampdrain = attacker->health + (take >> 1); // take half of the health removed from the player
					if (vampdrain < 250)
						attacker->health = vampdrain;        // and add it to the attackers health
					else
						attacker->health = 250;              // to a maximum of 250 health
					gi.sound(attacker, CHAN_ITEM, gi.soundindex("brain/brnatck3.wav"), 1, ATTN_NORM, 0); //make the vampiric sound
					//gi.bprintf(PRINT_MEDIUM,"sucking the life from %s\n",targ->classname);   //for debugging purposes
				}
				else if (Q_stricmp(targ->classname, "bodyque") == 0)      // if the target is a dead body.  NOTE: the grapple classname = 'noclass'
				{
					vampdrain = attacker->health + (take >> 2); // take quarter of the health removed from the corpse
					if (vampdrain < 250)
						attacker->health = vampdrain;        // and add it to the attackers health
					else
						attacker->health = 250;              // to a maximum of 250 health
					gi.sound(attacker, CHAN_ITEM, gi.soundindex("brain/brnatck3.wav"), 1, ATTN_NORM, 0); //make the vampiric sound
					//gi.bprintf(PRINT_MEDIUM,"sucking the life from %s\n",targ->classname);   //for debugging purposes
				}
			}
		}




		// LM_JORM -- CTF Track those who hit the flag carrier
		if ((redflag  &&  redflag->owner == targ)	||
			(blueflag && blueflag->owner == targ))
		{
			if (attacker && attacker->client)
				attacker->client->hit_carrier_time = level.time;
		}
		// END LM_JORM
			
		if (targ->health <= 0)
		{
			if ((targ->svflags & SVF_MONSTER) || (client))
				targ->flags |= FL_NO_KNOCKBACK;
			Killed (targ, inflictor, attacker, take, point);
			return;
		}
	}

	//no monsters
	//bat
#ifdef MONSTERS_OK
	if (targ->svflags & SVF_MONSTER)
	{
		M_ReactToDamage (targ, attacker);
		if (!(targ->monsterinfo.aiflags & AI_DUCKED) && (take))
		{
			targ->pain (targ, attacker, knockback, take);
			// nightmare mode monsters don't go into pain frames often
			if (skill->value == 3)
				targ->pain_debounce_time = level.time + 5;
		}
	}
	else if (client)
#else	
	if (client)
#endif
	{
		if (!(targ->flags & FL_GODMODE) && (take))
			targ->pain (targ, attacker, knockback, take);
	}
	else if (take)
	{
		if (targ->pain)
			targ->pain (targ, attacker, knockback, take);
	}

	// add to the damage inflicted on a player this frame
	// the total will be turned into screen blends and view angle kicks
	// at the end of the frame
	if (client)
	{
		client->damage_parmor += psave;
		client->damage_armor += asave;
		client->damage_blood += take;
		client->damage_knockback += knockback;
		VectorCopy (point, client->damage_from);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %r9, 0x38(%rsp)
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, 0x48(%rsp)
movq %rdi, %r14
xorl %eax, %eax
callq 0x19370
testl %eax, %eax
je 0x2b53a
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x27c(%r14)
je 0x2b52b
movq %rbx, 0x18(%rsp)
movl 0xb8(%rsp), %r13d
movl 0xa0(%rsp), %ebp
cmpq %r15, %r14
je 0x2b5d9
movq 0x3d95c(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x2b58c
jp 0x2b58c
movq 0x3d9e3(%rip), %rax     # 0x68f60
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2b58c
jnp 0x2b5d9
movq %r14, %rdi
movq %r15, %rsi
callq 0x18700
testl %eax, %eax
je 0x2b5d9
movq 0x3d076(%rip), %rax     # 0x68618
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
shrl $0x8, %eax
andl $0x1, %eax
movl 0xb0(%rsp), %ecx
andl $0x20, %ecx
movl %r13d, %edx
andl $0x15, %edx
orl %ecx, %edx
sete %cl
movl %r13d, %edx
orl $0x8000000, %edx        # imm = 0x8000000
xorl %esi, %esi
testb %al, %cl
cmovel %edx, %r13d
cmovnel %esi, %ebp
movq 0x3d548(%rip), %rax     # 0x68b28
movl %r13d, (%rax)
movq 0x3d14e(%rip), %rax     # 0x68738
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
movq %r15, 0x10(%rsp)
jne 0x2b637
jp 0x2b637
movq 0x3d8b8(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x2b637
jp 0x2b637
cmpq $0x0, 0x58(%r14)
je 0x2b637
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
mulsd 0x2a5c3(%rip), %xmm0    # 0x55bf0
cvttsd2si %xmm0, %ebp
cmpl $0x1, %ebp
adcl $0x0, %ebp
movl 0xa8(%rsp), %ebx
movq 0x58(%r14), %rax
movq %rax, 0x28(%rsp)
movl 0xb0(%rsp), %r15d
movl %r15d, %r13d
andl $0x10, %r13d
shrl $0x4, %r13d
movq %r12, %rdi
callq 0x18390
testb $0x1, %r15b
jne 0x2b697
testb $0x4, 0xc8(%r14)
movq 0x10(%rsp), %rdx
je 0x2b69c
cmpq $0x0, 0x58(%rdx)
je 0x2b69c
cmpq $0x0, 0x2a0(%r14)
jne 0x2b69c
cmpl $0x0, 0x254(%r14)
setg %cl
shll %cl, %ebp
jmp 0x2b69c
movq 0x10(%rsp), %rdx
xorl %eax, %eax
btl $0xb, 0x11c(%r14)
movl $0x0, 0x24(%rsp)
cmovbl %eax, %ebx
movq %r14, %rdi
movq 0x48(%rsp), %rsi
movl %ebp, %ecx
movl %ebx, %r8d
movl 0xb0(%rsp), %r15d
movl %r15d, %r9d
callq 0x180a0
movl %eax, %ebp
testb $0x8, %r15b
jne 0x2b6f9
testl %ebx, %ebx
je 0x2b6f9
movl 0x118(%r14), %eax
cmpl $0x9, %eax
ja 0x2ba8e
movl $0x20d, %ecx            # imm = 0x20D
btl %eax, %ecx
jae 0x2ba8e
movl %ebx, 0xc(%rsp)
leal 0x9(%r13,%r13,4), %eax
movl %eax, 0x34(%rsp)
movl 0xb0(%rsp), %eax
testb $0x20, %al
jne 0x2b771
movl 0x11c(%r14), %eax
movl %ebp, %r13d
andl $0x10, %eax
movq 0x10(%rsp), %r15
je 0x2b779
movq 0x3ced4(%rip), %rbx     # 0x68600
movl $0x3, %edi
callq *0xc8(%rbx)
movl 0x34(%rsp), %edi
callq *0xc8(%rbx)
movq 0x18(%rsp), %r12
movq %r12, %rdi
callq *0xf0(%rbx)
movq 0x38(%rsp), %rdi
callq *0xf8(%rbx)
movq %r12, %rdi
movl $0x2, %esi
callq *0xb0(%rbx)
xorl %r13d, %r13d
movl %ebp, 0x24(%rsp)
jmp 0x2b779
movl %ebp, %r13d
movq 0x10(%rsp), %r15
cmpq $0x0, 0x28(%rsp)
je 0x2b817
movl 0xb0(%rsp), %eax
testb $0x20, %al
jne 0x2b817
movq 0x3d605(%rip), %rbx     # 0x68da0
xorps %xmm0, %xmm0
cvtsi2ssl (%rbx), %xmm0
movq 0x28(%rsp), %rax
movss 0xf08(%rax), %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2b817
movss 0x4(%rbx), %xmm0
xorl %r13d, %r13d
ucomiss 0x244(%r14), %xmm0
jbe 0x2b80c
movq 0x3ce33(%rip), %rax     # 0x68600
movq 0x20(%rax), %r12
leaq 0x2b452(%rip), %rdi     # 0x56c2a
callq *0x48(%rax)
movss 0x27745(%rip), %xmm0    # 0x52f28
xorps %xmm2, %xmm2
movq %r14, %rdi
movl $0x3, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%r12
movss 0x4(%rbx), %xmm0
addss 0x27c69(%rip), %xmm0    # 0x5346c
movss %xmm0, 0x244(%r14)
movl %ebp, 0x24(%rsp)
xorl %edx, %edx
jmp 0x2b935
xorl %edx, %edx
testl %r13d, %r13d
je 0x2b932
movq 0x58(%r14), %r12
movl 0xb0(%rsp), %eax
andl $0x2, %eax
shrl %eax
testq %r12, %r12
sete %cl
orb %al, %cl
movl 0xc(%rsp), %ebx
jne 0x2b939
movq %r14, %rdi
callq 0x18ab0
testl %eax, %eax
je 0x2ba87
movl %eax, %ebp
leaq 0x2a3de(%rip), %rdi     # 0x55c3b
callq 0x189e0
subq 0x3d5d7(%rip), %rax     # 0x68e40
shrq $0x3, %rax
imull $0xf0f0f0f1, %eax, %eax # imm = 0xF0F0F0F1
cltq
movl 0x318(%r12,%rax,4), %edx
testl %edx, %edx
je 0x2ba87
movq %rax, 0x40(%rsp)
cmpl $0x1, %ebp
jne 0x2bca2
movl %edx, 0x10(%rsp)
leaq 0x10(%r14), %rdi
leaq 0x5c(%rsp), %rsi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x183a0
movq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd 0x4(%r14), %xmm1
subps %xmm1, %xmm0
leaq 0x50(%rsp), %rbp
movlps %xmm0, (%rbp)
movss 0x8(%rax), %xmm0
subss 0xc(%r14), %xmm0
movss %xmm0, 0x8(%rbp)
movq %rbp, %rdi
callq 0x18390
movss 0x4(%rbp), %xmm0
leaq 0x5c(%rsp), %rax
mulss 0x4(%rax), %xmm0
movss (%rbp), %xmm1
mulss (%rax), %xmm1
addss %xmm0, %xmm1
movss 0x8(%rbp), %xmm0
mulss 0x8(%rax), %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x2a2f6(%rip), %xmm1    # 0x55c08
ucomisd %xmm0, %xmm1
jae 0x2ba87
movl $0xc, %ebp
movl $0x1, %esi
movl %r13d, %eax
movl 0x10(%rsp), %edx
jmp 0x2bcc7
xorl %r13d, %r13d
movl 0xc(%rsp), %ebx
movq %rdx, 0x40(%rsp)
subl %edx, %r13d
movq %r14, %rdi
movq 0x48(%rsp), %rsi
movq %r15, %rdx
movl %r13d, %ecx
movl %ebx, %r8d
movl 0xb0(%rsp), %r9d
callq 0x18780
movl %eax, %r13d
movq 0x3d1ef(%rip), %rax     # 0x68b58
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
btl $0xa, %eax
jb 0x2ba5c
movl $0x0, 0x10(%rsp)
testl %r13d, %r13d
movq 0x18(%rsp), %rbp
je 0x2bab3
movq 0x58(%r14), %rbx
testq %rbx, %rbx
sete %al
movl 0xb0(%rsp), %ecx
andl $0x2, %ecx
shrl %ecx
orb %al, %cl
jne 0x2bab3
movq %r14, %rdi
callq 0x18750
testl %eax, %eax
je 0x2baae
movl %eax, %ebp
movl %eax, %edi
callq 0x18c30
movl 0xb0(%rsp), %ecx
xorps %xmm0, %xmm0
cvtsi2ss %r13d, %xmm0
andl $0x4, %ecx
movq 0x70(%rax), %rax
mulss 0x8(%rax,%rcx), %xmm0
callq 0x18a30
cvttss2si %xmm0, %r12d
movslq %ebp, %rax
movl 0x318(%rbx,%rax,4), %ecx
cmpl %r12d, %ecx
cmovll %ecx, %r12d
testl %r12d, %r12d
movq 0x18(%rsp), %rbp
je 0x2bab3
subl %r12d, %ecx
movl %ecx, 0x318(%rbx,%rax,4)
movq 0x3cbe2(%rip), %rbx     # 0x68600
movl $0x3, %edi
callq *0xc8(%rbx)
movl 0x34(%rsp), %edi
callq *0xc8(%rbx)
movq %rbp, %rdi
callq *0xf0(%rbx)
movq 0x38(%rsp), %rdi
callq *0xf8(%rbx)
movq %rbp, %rdi
movl $0x2, %esi
callq *0xb0(%rbx)
movl %r12d, 0x10(%rsp)
jmp 0x2bab3
movq %r14, %rdi
movq %r15, %rsi
callq 0x18700
cmpq %r15, %r14
je 0x2b97b
testl %eax, %eax
je 0x2b97b
movl $0x0, 0x10(%rsp)
movq 0x18(%rsp), %rbp
jmp 0x2babc
xorl %edx, %edx
jmp 0x2b939
movl 0x1d8(%r14), %eax
cmpl $0x32, %eax
jl 0x2bbf0
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
cvtss2sd %xmm0, %xmm0
jmp 0x2bbf8
movq 0x18(%rsp), %rbp
subl 0x10(%rsp), %r13d
movl 0xc(%rsp), %ebx
movl 0xb0(%rsp), %eax
testb $0x20, %al
jne 0x2bada
movq %r14, %rdi
movq %r15, %rsi
callq 0x185b0
testl %eax, %eax
jne 0x2b52b
testl %r13d, %r13d
je 0x2bbdf
testb $0x4, 0xc8(%r14)
movq %rbp, %r12
movl %r13d, 0x30(%rsp)
movq 0x3cb06(%rip), %r13     # 0x68600
movl $0x1, %ebx
movq %r15, %rbp
movl 0x34(%rsp), %r15d
cmovnel %ebx, %r15d
movl $0x3, %edi
callq *0xc8(%r13)
cmpq $0x0, 0x28(%rsp)
cmovnel %ebx, %r15d
movl %r15d, %edi
movq %rbp, %r15
callq *0xc8(%r13)
movq %r12, %rdi
callq *0xf0(%r13)
movq 0x38(%rsp), %rdi
callq *0xf8(%r13)
movq %r12, %rdi
movq %r13, %r12
movl 0x30(%rsp), %r13d
movl $0x2, %esi
callq *0xb0(%r12)
subl %r13d, 0x254(%r14)
testq %rbp, %rbp
je 0x2bdbe
movq 0x58(%r15), %rax
testq %rax, %rax
je 0x2bdbe
movq 0xf68(%rax), %rax
testq %rax, %rax
je 0x2bdbe
cmpq %r15, %r14
je 0x2bdbe
cmpl $0x10, 0x478(%rax)
jne 0x2bdbe
movq 0x138(%r14), %rdi
leaq 0x287e2(%rip), %rsi     # 0x5438f
callq 0x18690
testl %eax, %eax
je 0x2bd71
movq 0x138(%r14), %rdi
leaq 0x2a06b(%rip), %rsi     # 0x55c33
callq 0x18690
testl %eax, %eax
jne 0x2bdbe
movl $0x2, %ecx
jmp 0x2bd76
cmpq $0x0, 0x28(%rsp)
jne 0x2be65
jmp 0x2b52b
movsd 0x2a000(%rip), %xmm0    # 0x55bf8
movq 0x10(%rsp), %rdx
xorl %eax, %eax
cmpq $0x0, 0x58(%r14)
xorps %xmm1, %xmm1
cvtsi2ss %ebx, %xmm1
setne %cl
cvtss2sd %xmm1, %xmm1
cmpq %rdx, %r14
je 0x2bc21
movsd 0x29fe1(%rip), %xmm2    # 0x55c00
jmp 0x2bc2f
movb %cl, %al
leaq 0x29fb6(%rip), %rcx     # 0x55be0
movsd (%rcx,%rax,8), %xmm2
mulsd %xmm1, %xmm2
divsd %xmm0, %xmm2
xorps %xmm0, %xmm0
cvtsd2ss %xmm2, %xmm0
leaq 0x50(%rsp), %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x189d0
cmpq $0x0, 0x2b8(%r14)
movss 0x8(%r15), %xmm0
je 0x2bc71
xorps %xmm1, %xmm1
ucomiss %xmm0, %xmm1
jbe 0x2bc71
movl $0x0, 0x58(%rsp)
xorps %xmm0, %xmm0
movsd 0x1c0(%r14), %xmm1
movsd 0x50(%rsp), %xmm2
addps %xmm1, %xmm2
movlps %xmm2, 0x1c0(%r14)
addss 0x1c8(%r14), %xmm0
movss %xmm0, 0x1c8(%r14)
jmp 0x2b6f9
movq 0x3ceaf(%rip), %rax     # 0x68b58
movq (%rax), %rax
cvttss2si 0x20(%rax), %eax
xorl %esi, %esi
btl $0xb, %eax
adcl $0x1, %esi
leal (,%r13,2), %eax
movl $0xd, %ebp
movl %esi, 0x30(%rsp)
cltq
imulq $0x55555556, %rax, %rax # imm = 0x55555556
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
addl %ecx, %eax
imull %esi, %edx
cmpl %eax, %edx
cmovgel %eax, %edx
movl %edx, 0x10(%rsp)
movq 0x3c90c(%rip), %rbx     # 0x68600
movl $0x3, %edi
callq *0xc8(%rbx)
movl %ebp, %edi
callq *0xc8(%rbx)
movq 0x18(%rsp), %rbp
movq %rbp, %rdi
callq *0xf0(%rbx)
movq 0x38(%rsp), %rdi
callq *0xf8(%rbx)
movq %rbp, %rdi
movl $0x2, %esi
callq *0xb0(%rbx)
movq 0x3d06b(%rip), %rax     # 0x68da0
xorps %xmm0, %xmm0
cvtss2sd 0x4(%rax), %xmm0
addsd 0x29ecb(%rip), %xmm0    # 0x55c10
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x268(%r14)
movl 0x10(%rsp), %esi
movl %esi, %eax
cltd
idivl 0x30(%rsp)
movq 0x40(%rsp), %rcx
subl %eax, 0x318(%r12,%rcx,4)
movl %esi, %edx
jmp 0x2b935
movl $0x1, %ecx
movl %r13d, %eax
sarl %cl, %eax
addl 0x254(%r15), %eax
movl $0xfa, %ecx
cmpl %ecx, %eax
cmovgel %ecx, %eax
movl %eax, 0x254(%r15)
movq 0x20(%r12), %rbx
leaq 0x29e81(%rip), %rdi     # 0x55c20
callq *0x48(%r12)
movss 0x2717c(%rip), %xmm0    # 0x52f28
xorps %xmm2, %xmm2
movq %r15, %rdi
movl $0x3, %esi
movl %eax, %edx
movaps %xmm0, %xmm1
callq *%rbx
movq 0x3ca33(%rip), %rax     # 0x687f8
movq (%rax), %rax
testq %rax, %rax
je 0x2bdd6
cmpq %r14, 0x110(%rax)
je 0x2bdfe
movq 0x3ca83(%rip), %rax     # 0x68860
movq (%rax), %rax
testq %rax, %rax
movq 0x18(%rsp), %rbp
movl 0xc(%rsp), %ebx
je 0x2be29
testq %r15, %r15
je 0x2be29
cmpq %r14, 0x110(%rax)
je 0x2be0c
jmp 0x2be29
testq %r15, %r15
movq 0x18(%rsp), %rbp
movl 0xc(%rsp), %ebx
je 0x2be29
movq 0x58(%r15), %rax
testq %rax, %rax
je 0x2be29
movq 0x3cf84(%rip), %rcx     # 0x68da0
movss 0x4(%rcx), %xmm0
movss %xmm0, 0x10f8(%rax)
movl 0x254(%r14), %eax
testl %eax, %eax
jle 0x2bed1
cmpq $0x0, 0x28(%rsp)
je 0x2bf23
testb $0x10, 0x11c(%r14)
jne 0x2be65
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq *0x230(%r14)
movl 0x10(%rsp), %ecx
addl 0x24(%rsp), %ecx
movq 0x28(%rsp), %rax
movdqu 0xe58(%rax), %xmm0
movd %ebx, %xmm1
movd %r13d, %xmm2
punpckldq %xmm1, %xmm2    # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movd 0x40(%rsp), %xmm1
movd %ecx, %xmm3
punpckldq %xmm1, %xmm3    # xmm3 = xmm3[0],xmm1[0],xmm3[1],xmm1[1]
punpcklqdq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0]
paddd %xmm0, %xmm3
movdqu %xmm3, 0xe58(%rax)
movss (%rbp), %xmm0
movss %xmm0, 0xe68(%rax)
movss 0x4(%rbp), %xmm0
movss %xmm0, 0xe6c(%rax)
movss 0x8(%rbp), %xmm0
movss %xmm0, 0xe70(%rax)
jmp 0x2b52b
cmpq $0x0, 0x28(%rsp)
jne 0x2bee5
movl 0xc8(%r14), %ecx
andl $0x4, %ecx
je 0x2beed
orb $0x8, 0x11d(%r14)
cmpl $0xfffffc18, %eax       # imm = 0xFFFFFC18
jg 0x2beff
movl $0xfffffc19, 0x254(%r14) # imm = 0xFFFFFC19
movq %r15, 0x2a0(%r14)
movq %r14, %rdi
movq 0x48(%rsp), %rsi
movq %r15, %rdx
movl %r13d, %ecx
movq %rbp, %r8
callq *0x238(%r14)
jmp 0x2b52b
movq 0x230(%r14), %rax
testq %rax, %rax
je 0x2b52b
xorps %xmm0, %xmm0
cvtsi2ss %ebx, %xmm0
movq %r14, %rdi
movq %r15, %rsi
movl %r13d, %edx
callq *%rax
jmp 0x2b52b