// File: /workspace/github_c_makefile_star2_O2/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 %rdx, %r14
movq %rdi, %rbx
movq 0x27b20(%rip), %r13     # 0x66b58
movq (%r13), %rax
cvttss2si 0x20(%rax), %r15d
callq 0x18c00
movl %eax, %ebp
movq 0x27f10(%rip), %rax     # 0x66f60
movq (%rax), %rax
movss 0x20(%rax), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x3f062
jnp 0x3f076
cmpq $0x0, 0x58(%r14)
je 0x3f090
movq 0x27ab8(%rip), %rax     # 0x66b28
orb $0x8, 0x3(%rax)
jmp 0x3f090
movq 0x27e43(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm1
ucomiss %xmm0, %xmm1
jne 0x3f090
jnp 0x3f284
movq 0x27a91(%rip), %rax     # 0x66b28
movl (%rax), %r12d
movl %r12d, %eax
andl $0xf7ffffff, %eax       # imm = 0xF7FFFFFF
leal -0x11(%rax), %ecx
cmpl $0x10, %ecx
ja 0x3f0ce
movl $0x17f6f, %edx          # imm = 0x17F6F
btl %ecx, %edx
jae 0x3f0ce
cmpq %rbx, %r14
je 0x3f12f
movl %ecx, %eax
leaq 0x167f2(%rip), %rcx     # 0x558b4
movslq (%rcx,%rax,4), %r14
addq %rcx, %r14
jmp 0x3f1de
cmpq %rbx, %r14
je 0x3f12f
movq %r14, 0x2a0(%rbx)
testq %r14, %r14
je 0x3f284
movq 0x58(%r14), %r8
testq %r8, %r8
je 0x3f284
leal -0x1(%rax), %ecx
cmpl $0x21, %ecx
ja 0x3f26c
leaq 0x166dd(%rip), %rax     # 0x557e0
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
btl $0xe, %r15d
leaq 0x10e2d(%rip), %rax     # 0x4ff45
leaq 0x16f34(%rip), %r15     # 0x56053
cmovaeq %rax, %r15
leaq 0x16f1a(%rip), %rcx     # 0x56044
jmp 0x3f471
leal -0x7(%rax), %ecx
cmpl $0x9, %ecx
ja 0x3f16e
leaq 0x1672a(%rip), %rax     # 0x55868
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq %rbx, %rdi
callq 0x18190
testl %ebp, %ebp
leaq 0x16e41(%rip), %rcx     # 0x55f99
leaq 0x16e1f(%rip), %rdx     # 0x55f7e
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x16df7(%rip), %r14     # 0x55f63
jmp 0x3f1da
cmpl $0x18, %eax
je 0x3f260
cmpl $0x22, %eax
jne 0x3f185
leaq 0x16e7f(%rip), %r14     # 0x56002
jmp 0x3f1de
movq %rbx, %rdi
callq 0x18190
testl %ebp, %ebp
leaq 0x16e97(%rip), %rcx     # 0x5602d
leaq 0x16e81(%rip), %rdx     # 0x5601e
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x16e66(%rip), %r14     # 0x56010
jmp 0x3f1da
leaq 0x16e30(%rip), %r14     # 0x55fe3
jmp 0x3f1de
movq %rbx, %rdi
callq 0x18190
testl %ebp, %ebp
leaq 0x16e0d(%rip), %rcx     # 0x55fd3
leaq 0x16df6(%rip), %rdx     # 0x55fc3
cmoveq %rcx, %rdx
testl %eax, %eax
leaq 0x16dda(%rip), %r14     # 0x55fb4
cmoveq %rdx, %r14
xorl %eax, %eax
callq 0x19130
testl %eax, %eax
je 0x3f253
movl $0x2c0, %edx            # imm = 0x2C0
addq 0x58(%rbx), %rdx
leaq 0x16e43(%rip), %rsi     # 0x5603c
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %rdi
movq %r15, %rsi
callq 0x193f0
movq 0x27ca5(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3f22d
jnp 0x3f253
movq 0x58(%rbx), %rax
decl 0xdf4(%rax)
pushq $0x3
popq %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x194d0
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x194d0
andq $0x0, 0x2a0(%rbx)
jmp 0x3f2eb
leaq 0x16cdf(%rip), %r14     # 0x55f46
jmp 0x3f1de
cmpl $0x3c, %eax
jne 0x3f284
leaq 0x16fd3(%rip), %rcx     # 0x5624b
leaq 0x16fd9(%rip), %r15     # 0x56258
jmp 0x3f471
movl $0x2c0, %edx            # imm = 0x2C0
addq 0x58(%rbx), %rdx
leaq 0x16fe2(%rip), %rsi     # 0x56276
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %rdi
movq %r14, %rsi
callq 0x193f0
movq 0x27c0d(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3f2c5
jnp 0x3f2eb
movq 0x58(%rbx), %rax
decl 0xdf4(%rax)
pushq $0x3
popq %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x194d0
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x194d0
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
btl $0xe, %r15d
leaq 0x10c3c(%rip), %rax     # 0x4ff45
leaq 0x16ecb(%rip), %r15     # 0x561db
cmovaeq %rax, %r15
leaq 0x16ea1(%rip), %rcx     # 0x561bc
jmp 0x3f471
leaq 0x16f02(%rip), %rcx     # 0x56229
leaq 0x16f0b(%rip), %r15     # 0x56239
jmp 0x3f471
leaq 0x16dc0(%rip), %rcx     # 0x560fa
leaq 0x16dc9(%rip), %r15     # 0x5610a
jmp 0x3f471
leaq 0x16d94(%rip), %rcx     # 0x560e1
leaq 0x16d9b(%rip), %r15     # 0x560ef
jmp 0x3f471
leaq 0x16e8b(%rip), %rcx     # 0x561eb
jmp 0x3f37c
leaq 0x16d59(%rip), %rcx     # 0x560c2
leaq 0x16d65(%rip), %r15     # 0x560d5
jmp 0x3f471
leaq 0x16e85(%rip), %rcx     # 0x56201
leaq 0x16e6f(%rip), %r15     # 0x561f2
jmp 0x3f471
leaq 0x16e1a(%rip), %rcx     # 0x561a9
jmp 0x3f398
leaq 0x16dcd(%rip), %rcx     # 0x56165
leaq 0x16de1(%rip), %r15     # 0x56180
jmp 0x3f471
btl $0xe, %r15d
leaq 0x10b95(%rip), %rax     # 0x4ff45
leaq 0x16cba(%rip), %r15     # 0x56071
cmovaeq %rax, %r15
leaq 0x16c9c(%rip), %rcx     # 0x5605e
jmp 0x3f471
btl $0xe, %r15d
leaq 0x10b72(%rip), %rax     # 0x4ff45
leaq 0x16cda(%rip), %r15     # 0x560b4
cmovaeq %rax, %r15
leaq 0x16cba(%rip), %rcx     # 0x5609f
jmp 0x3f471
leaq 0x16c8b(%rip), %rcx     # 0x5607c
leaq 0x16c96(%rip), %r15     # 0x5608e
jmp 0x3f471
btl $0xe, %r15d
leaq 0x16e1b(%rip), %rax     # 0x56221
leaq 0x16e05(%rip), %r15     # 0x56212
cmovaeq %rax, %r15
leaq 0x16df4(%rip), %rcx     # 0x5620c
jmp 0x3f471
btl $0xe, %r15d
leaq 0x10b1f(%rip), %rax     # 0x4ff45
leaq 0x16d2d(%rip), %r15     # 0x5615a
cmovaeq %rax, %r15
leaq 0x16d14(%rip), %rcx     # 0x5614c
jmp 0x3f471
leaq 0x149da(%rip), %rcx     # 0x53e1b
jmp 0x3f44a
leaq 0x16cd6(%rip), %rcx     # 0x56120
leaq 0x16cc5(%rip), %r15     # 0x56116
jmp 0x3f471
leaq 0x16d2d(%rip), %rcx     # 0x56187
leaq 0x16d3b(%rip), %r15     # 0x5619c
jmp 0x3f471
leaq 0x16cc4(%rip), %rcx     # 0x5612e
leaq 0x16ccb(%rip), %r15     # 0x5613c
movq (%r13), %rax
cvttss2si 0x20(%rax), %eax
btl $0xe, %eax
jae 0x3f490
callq 0x18710
movq 0x58(%r14), %r8
movq 0x27448(%rip), %rcx     # 0x668d8
movl $0x2c0, %edx            # imm = 0x2C0
addq %rdx, %r8
addq 0x58(%rbx), %rdx
leaq 0x16dc7(%rip), %rsi     # 0x5626a
movq %rsp, %rbx
movq %rbx, %rdi
movq %r15, %r9
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %rdi
movq %rbx, %rsi
callq 0x193f0
movq 0x279fb(%rip), %rax     # 0x66ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x3f4db
jnp 0x3f2eb
btl $0x1b, %r12d
jae 0x3f519
movq 0x272ef(%rip), %rax     # 0x667d8
cmpl $0x6, (%rax)
jne 0x3f519
pushq $0x3
popq %rsi
pushq $-0x1
popq %rdx
movq %r14, %rdi
callq 0x194d0
pushq $0x6
popq %rsi
pushq $0x1
popq %rdx
movq %r14, %rdi
callq 0x194d0
movq 0x58(%r14), %rax
decl 0xdf4(%rax)
jmp 0x3f2eb
pushq $0x3
popq %rsi
pushq $0x1
popq %rbx
movq %r14, %rdi
movq %rbx, %rdx
callq 0x194d0
pushq $0x5
popq %rsi
movq %r14, %rdi
movq %rbx, %rdx
callq 0x194d0
movq 0x58(%r14), %rax
incl 0xdf4(%rax)
jmp 0x3f2eb