// File: /workspace/github_c_makefile_star2_O3/QwazyWabbitWOS[P]lmctf60/p_client.c
// Function: ClientObituary
void ClientObituary (edict_t *self, edict_t *inflictor, edict_t *attacker)
{
	int			mod;
	char		*message;
	char		*message2;
	qboolean ff;
	char		msg[MAX_INFO_STRING];
	int Sex;

	int New_Death_Messages;

	if((int)ctfflags->value & CTF_RANDOM_DEATH_MSG)
		New_Death_Messages = true;
	else
		New_Death_Messages = false;


	if(IsFemale(self))
		Sex = FEMALE;
	else
		Sex = MALE;

	if (coop->value && attacker->client)
		meansOfDeath |= MOD_FRIENDLY_FIRE;

	if (deathmatch->value || coop->value)
	{
		ff = meansOfDeath & MOD_FRIENDLY_FIRE;
		mod = meansOfDeath & ~MOD_FRIENDLY_FIRE;
		message = NULL;
		message2 = "";

		switch (mod)
		{
		case MOD_SUICIDE:
			message = "suicides";
			break;
		case MOD_FALLING:
			message = "cratered";
			break;
		case MOD_CRUSH:
			message = "was squished";
			break;
		case MOD_WATER:
			message = "sank like a rock";
			break;
		case MOD_SLIME:
			message = "melted";
			break;
		case MOD_LAVA:
			message = "does a back flip into the lava";
			break;
		case MOD_EXPLOSIVE:
		case MOD_BARREL:
			message = "blew up";
			break;
		case MOD_EXIT:
			message = "found a way out";
			break;
		case MOD_TARGET_LASER:
			message = "saw the light";
			break;
		case MOD_TARGET_BLASTER:
			message = "got blasted";
			break;
		case MOD_BOMB:
		case MOD_SPLASH:
		case MOD_TRIGGER_HURT:
			message = "was in the wrong place";
			break;
		}
		if (attacker == self)
		{
			switch (mod)
			{
			case MOD_HELD_GRENADE:
				message = "tried to put the pin back in";
				break;
			case MOD_HG_SPLASH:
			case MOD_G_SPLASH:
				if (IsNeutral(self))
					message = "tripped on its own grenade";
				else if (Sex)
					message = "tripped on her own grenade";
				else
					message = "tripped on his own grenade";
				break;
			case MOD_R_SPLASH:
				if (IsNeutral(self))
					message = "blew itself up";
				else if (Sex)
					message = "blew herself up";
				else
					message = "blew himself up";
				break;
			case MOD_BFG_BLAST:
				message = "should have used a smaller gun";
				break;
// SKWiD MOD
#include "plasma.h"
 			case MOD_PLASMA:
 				message = "get's shocked";
 				break;
// END

			default:
				if (IsNeutral(self))
					message = "killed itself";
				else if (Sex)
					message = "killed herself";
				else
					message = "killed himself";
				break;
			}
		}
		if (message)
		{
			if(Match_CanScore())
			{
				sprintf(msg, "%s %s.\n", self->client->pers.netname, message);
				ctf_BSafePrint(PRINT_HIGH, msg);
				if (deathmatch->value)
				{
					self->client->resp.score--;
					stats_add(self, STATS_SCORE, -1);
					stats_add(self, STATS_DEATHS, 1);
				}
			}
			self->enemy = NULL;
			return;
		}

		self->enemy = attacker;
		if (attacker && attacker->client)
		{
			switch (mod)
			{
			case MOD_BLASTER:
				message = "was blasted by";
				if(New_Death_Messages)
					message2 = "'s blaster"; //bat
				break;

			case MOD_SHOTGUN:
				message = "was gunned down by";
				if(New_Death_Messages)
					message2 = "'s shotgun"; //bat
				break;

			case MOD_SSHOTGUN:
				message = "was blown away by";
				message2 = "'s super shotgun";
				break;

			case MOD_MACHINEGUN:
				message = "was machinegunned by";
				if(New_Death_Messages)
					message2 = "'s machinegun";	//bat
				break;

			case MOD_CHAINGUN:
				message = "was cut in half by";
				message2 = "'s chaingun";
				break;

			case MOD_GRENADE:
				message = "was popped by";
				message2 = "'s grenade";
				break;
			case MOD_G_SPLASH:
				message = "was shredded by";
				message2 = "'s shrapnel";
				break;

			case MOD_ROCKET:
				message = "ate";
				message2 = "'s rocket";
				break;
			case MOD_R_SPLASH:
				message = "almost dodged";
				message2 = "'s rocket";
				break;

			case MOD_HYPERBLASTER:
				message = "was melted by";
				message2 = "'s hyperblaster";
				break;
			case MOD_RAILGUN:
				message = "was railed by";
				if(New_Death_Messages)
					message2 = "'s railgun"; //bat
				break;

			case MOD_BFG_LASER:
				message = "saw the pretty lights from";
				message2 = "'s BFG";
				break;

			case MOD_BFG_BLAST:
				message = "was disintegrated by";
				message2 = "'s BFG blast";
				break;

			case MOD_BFG_EFFECT:
				message = "couldn't hide from";
				message2 = "'s BFG";
				break;

// SKWiD MOD
			case MOD_PLASMA:
				message = "got an infusion of plasma from";
				if(New_Death_Messages)
					message2 = "'s plasma rifle";
				break;
// END
			case MOD_HANDGRENADE:
				message = "caught";
				message2 = "'s handgrenade";
				break;

			case MOD_HG_SPLASH:
				message = "didn't see";
				message2 = "'s handgrenade";
				break;

			case MOD_HELD_GRENADE:
				message = "feels";
				if(New_Death_Messages)
					message2 = "'s paingrenade";
				else
					message2 = "'s pain";
				break;

			case MOD_TELEFRAG:
				message = "tried to invade";
				message2 = "'s personal space";
				break;

			case MOD_CTF_GRAPPLE:
				message = "was gored by";
				message2 = "'s grappling hook";
				break;
			}

			if (message)
			{
				if((int)ctfflags->value & CTF_RANDOM_DEATH_MSG)
				{
					Gimme_Any_Death_Message();
					message = &Death_Msg_String[0];
				}
				
				
				sprintf(msg, "%s %s %s%s\n", self->client->pers.netname, message, attacker->client->pers.netname, message2);

				ctf_BSafePrint(PRINT_HIGH, msg);
				if (deathmatch->value)
				{
					if (ff && matchstate == MATCH_RAILGUN_INPLAY)
					{
						stats_add(attacker, STATS_SCORE, -1);
						stats_add(attacker, STATS_DEATHS, 1);
						attacker->client->resp.score--;
					}
					else
					{
						stats_add(attacker, STATS_SCORE, 1);
						stats_add(attacker, STATS_FRAGS, 1);
						attacker->client->resp.score++;
					}
				}
				return;
			}
		}
	 }
	 

	 sprintf(msg, "%s died.\n", self->client->pers.netname);
	 ctf_BSafePrint(PRINT_HIGH, msg);
	 if (deathmatch->value)
	 {
		 self->client->resp.score--;
		 stats_add(self, STATS_SCORE, -1);
		 stats_add(self, STATS_DEATHS, 1);
	 }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq 0x26432(%rip), %r13     # 0x68b58
movq (%r13), %rax
cvttss2si 0x20(%rax), %r12d
movq %rdx, %r14
movq %rdi, %rbx
movq 0x58(%rdi), %rdi
testq %rdi, %rdi
je 0x4275e
addq $0xc0, %rdi
leaq 0x1720d(%rip), %rsi     # 0x5995a
callq 0x18bb0
movb (%rax), %al
addb $-0x46, %al
testb $-0x21, %al
setne %r15b
jmp 0x42761
movb $0x1, %r15b
movq 0x267f8(%rip), %rax     # 0x68f60
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x4277a
jnp 0x4278e
cmpq $0x0, 0x58(%r14)
je 0x427a8
movq 0x263a0(%rip), %rax     # 0x68b28
orb $0x8, 0x3(%rax)
jmp 0x427a8
movq 0x2672b(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x427a8
jnp 0x42a2f
movq 0x26379(%rip), %rax     # 0x68b28
movl (%rax), %ebp
movl %ebp, %eax
andl $0xf7ffffff, %eax       # imm = 0xF7FFFFFF
leal -0x11(%rax), %ecx
cmpl $0x10, %ecx
ja 0x427e4
movl $0x17f6f, %edx          # imm = 0x17F6F
btl %ecx, %edx
jae 0x427e4
cmpq %rbx, %r14
je 0x42845
movl %ecx, %eax
leaq 0x170ec(%rip), %rcx     # 0x598c4
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x4297a
cmpq %rbx, %r14
je 0x42845
movq %r14, 0x2a0(%rbx)
testq %r14, %r14
je 0x42a2f
movq 0x58(%r14), %r8
testq %r8, %r8
je 0x42a2f
leal -0x1(%rax), %ecx
cmpl $0x21, %ecx
ja 0x42a17
leaq 0x16fd7(%rip), %rax     # 0x597f0
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
btl $0xe, %r12d
leaq 0x11717(%rip), %rax     # 0x53f45
leaq 0x1782e(%rip), %r15     # 0x5a063
cmovaeq %rax, %r15
leaq 0x17814(%rip), %r12     # 0x5a054
jmp 0x42c28
leal -0x7(%rax), %ecx
cmpl $0x9, %ecx
ja 0x428b6
leaq 0x17024(%rip), %rax     # 0x59878
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x428a3
addq $0xc0, %rdi
leaq 0x170e6(%rip), %rsi     # 0x5995a
callq 0x18bb0
movzbl (%rax), %eax
leaq 0x176f0(%rip), %r14     # 0x59f73
addl $-0x46, %eax
cmpl $0x27, %eax
ja 0x4297a
movabsq $0x8100000081, %rcx     # imm = 0x8100000081
btq %rax, %rcx
jae 0x4297a
leaq 0x176ff(%rip), %rax     # 0x59fa9
leaq 0x176dd(%rip), %r14     # 0x59f8e
jmp 0x42973
cmpl $0x18, %eax
je 0x42a0b
cmpl $0x22, %eax
jne 0x428d0
leaq 0x17747(%rip), %r14     # 0x5a012
jmp 0x4297a
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x4290e
addq $0xc0, %rdi
leaq 0x17073(%rip), %rsi     # 0x5995a
callq 0x18bb0
movzbl (%rax), %eax
leaq 0x1772a(%rip), %r14     # 0x5a020
addl $-0x46, %eax
cmpl $0x27, %eax
ja 0x4297a
movabsq $0x8100000081, %rcx     # imm = 0x8100000081
btq %rax, %rcx
jae 0x4297a
leaq 0x17728(%rip), %rax     # 0x5a03d
leaq 0x17712(%rip), %r14     # 0x5a02e
jmp 0x42973
leaq 0x176ce(%rip), %r14     # 0x59ff3
jmp 0x4297a
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x42965
addq $0xc0, %rdi
leaq 0x1701c(%rip), %rsi     # 0x5995a
callq 0x18bb0
movzbl (%rax), %eax
leaq 0x17677(%rip), %r14     # 0x59fc4
addl $-0x46, %eax
cmpl $0x27, %eax
ja 0x4297a
movabsq $0x8100000081, %rcx     # imm = 0x8100000081
btq %rax, %rcx
jae 0x4297a
leaq 0x17677(%rip), %rax     # 0x59fe3
leaq 0x17660(%rip), %r14     # 0x59fd3
testb %r15b, %r15b
cmovneq %rax, %r14
xorl %eax, %eax
callq 0x19000
testl %eax, %eax
je 0x429fb
movl $0x2c0, %edx            # imm = 0x2C0
addq 0x58(%rbx), %rdx
leaq 0x176b7(%rip), %rsi     # 0x5a04c
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x196f0
movl $0x2, %edi
movq %r15, %rsi
callq 0x19270
movq 0x26507(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x429cb
jnp 0x429fb
movq 0x58(%rbx), %rax
decl 0xdf4(%rax)
movq %rbx, %rdi
movl $0x3, %esi
movq $-0x1, %rdx
callq 0x19330
movl $0x1, %edx
movq %rbx, %rdi
movl $0x6, %esi
callq 0x19330
movq $0x0, 0x2a0(%rbx)
jmp 0x42aa2
leaq 0x17544(%rip), %r14     # 0x59f56
jmp 0x4297a
cmpl $0x3c, %eax
jne 0x42a2f
leaq 0x17838(%rip), %r12     # 0x5a25b
leaq 0x1783e(%rip), %r15     # 0x5a268
jmp 0x42c28
movl $0x2c0, %edx            # imm = 0x2C0
addq 0x58(%rbx), %rdx
leaq 0x17847(%rip), %rsi     # 0x5a286
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x196f0
movl $0x2, %edi
movq %r14, %rsi
callq 0x19270
movq 0x26460(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x42a72
jnp 0x42aa2
movq 0x58(%rbx), %rax
decl 0xdf4(%rax)
movq %rbx, %rdi
movl $0x3, %esi
movq $-0x1, %rdx
callq 0x19330
movl $0x1, %edx
movq %rbx, %rdi
movl $0x6, %esi
callq 0x19330
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
btl $0xe, %r12d
leaq 0x11485(%rip), %rax     # 0x53f45
leaq 0x17724(%rip), %r15     # 0x5a1eb
cmovaeq %rax, %r15
leaq 0x176fa(%rip), %r12     # 0x5a1cc
jmp 0x42c28
leaq 0x1775b(%rip), %r12     # 0x5a239
leaq 0x17764(%rip), %r15     # 0x5a249
jmp 0x42c28
leaq 0x17619(%rip), %r12     # 0x5a10a
leaq 0x17622(%rip), %r15     # 0x5a11a
jmp 0x42c28
leaq 0x175ed(%rip), %r12     # 0x5a0f1
leaq 0x175f4(%rip), %r15     # 0x5a0ff
jmp 0x42c28
leaq 0x176e4(%rip), %r12     # 0x5a1fb
jmp 0x42b33
leaq 0x175b2(%rip), %r12     # 0x5a0d2
leaq 0x175be(%rip), %r15     # 0x5a0e5
jmp 0x42c28
leaq 0x176de(%rip), %r12     # 0x5a211
leaq 0x176c8(%rip), %r15     # 0x5a202
jmp 0x42c28
leaq 0x17673(%rip), %r12     # 0x5a1b9
jmp 0x42b4f
leaq 0x17626(%rip), %r12     # 0x5a175
leaq 0x1763a(%rip), %r15     # 0x5a190
jmp 0x42c28
btl $0xe, %r12d
leaq 0x113de(%rip), %rax     # 0x53f45
leaq 0x17513(%rip), %r15     # 0x5a081
cmovaeq %rax, %r15
leaq 0x174f5(%rip), %r12     # 0x5a06e
jmp 0x42c28
btl $0xe, %r12d
leaq 0x113bb(%rip), %rax     # 0x53f45
leaq 0x17533(%rip), %r15     # 0x5a0c4
cmovaeq %rax, %r15
leaq 0x17513(%rip), %r12     # 0x5a0af
jmp 0x42c28
leaq 0x174e4(%rip), %r12     # 0x5a08c
leaq 0x174ef(%rip), %r15     # 0x5a09e
jmp 0x42c28
btl $0xe, %r12d
leaq 0x17674(%rip), %rax     # 0x5a231
leaq 0x1765e(%rip), %r15     # 0x5a222
cmovaeq %rax, %r15
leaq 0x1764d(%rip), %r12     # 0x5a21c
jmp 0x42c28
btl $0xe, %r12d
leaq 0x11368(%rip), %rax     # 0x53f45
leaq 0x17586(%rip), %r15     # 0x5a16a
cmovaeq %rax, %r15
leaq 0x1756d(%rip), %r12     # 0x5a15c
jmp 0x42c28
leaq 0x15243(%rip), %r12     # 0x57e3b
jmp 0x42c01
leaq 0x1752f(%rip), %r12     # 0x5a130
leaq 0x1751e(%rip), %r15     # 0x5a126
jmp 0x42c28
leaq 0x17586(%rip), %r12     # 0x5a197
leaq 0x17594(%rip), %r15     # 0x5a1ac
jmp 0x42c28
leaq 0x1751d(%rip), %r12     # 0x5a13e
leaq 0x17524(%rip), %r15     # 0x5a14c
movq (%r13), %rax
cvttss2si 0x20(%rax), %eax
btl $0xe, %eax
jae 0x42c77
callq 0x19a10
cltq
imulq $0x2e8ba2e9, %rax, %rcx # imm = 0x2E8BA2E9
movq %rcx, %rdx
shrq $0x3f, %rdx
sarq $0x23, %rcx
addl %edx, %ecx
imull $0x2c, %ecx, %ecx
subl %ecx, %eax
cltq
movq 0x25b38(%rip), %rcx     # 0x68798
movq (%rcx,%rax,8), %rsi
movq 0x25c6d(%rip), %r12     # 0x688d8
movq %r12, %rdi
callq 0x182a0
movq 0x58(%r14), %r8
movl $0x2c0, %edx            # imm = 0x2C0
addq %rdx, %r8
addq 0x58(%rbx), %rdx
leaq 0x175f0(%rip), %rsi     # 0x5a27a
movq %rsp, %rbx
movq %rbx, %rdi
movq %r12, %rcx
movq %r15, %r9
xorl %eax, %eax
callq 0x196f0
movl $0x2, %edi
movq %rbx, %rsi
callq 0x19270
movq 0x2620f(%rip), %rax     # 0x68ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x42cc7
jnp 0x42aa2
btl $0x1b, %ebp
jae 0x42d0e
movq 0x25b04(%rip), %rax     # 0x687d8
cmpl $0x6, (%rax)
jne 0x42d0e
movq %r14, %rdi
movl $0x3, %esi
movq $-0x1, %rdx
callq 0x19330
movl $0x1, %edx
movq %r14, %rdi
movl $0x6, %esi
callq 0x19330
movq 0x58(%r14), %rax
decl 0xdf4(%rax)
jmp 0x42aa2
movl $0x1, %edx
movq %r14, %rdi
movl $0x3, %esi
callq 0x19330
movl $0x1, %edx
movq %r14, %rdi
movl $0x5, %esi
callq 0x19330
movq 0x58(%r14), %rax
incl 0xdf4(%rax)
jmp 0x42aa2