// File: /workspace/github_c_makefile_star2_O0/QwazyWabbitWOS[P]lmctf60/gslog.c
// Function: sl_WriteStdLogDeath
void sl_WriteStdLogDeath( game_import_t     *gi,
                          level_locals_t     level,
                          edict_t           *self,
                          edict_t           *inflictor,
                          edict_t           *attacker )
{
    /* StdLogging for Deathmatch only */
    if( deathmatch->value )
    {
        if( sl_Logging( gi, pPatch ) )
        {
            int			mod = meansOfDeath & ~MOD_FRIENDLY_FIRE;
            char       *pKillerName =   NULL;
            char       *pTargetName =   NULL;
            char       *pScoreType  =   NULL; /* Kill, Suicide */
            char       *pWeaponName =   NULL;
            int        iScore       =   0;    /* 1,    -1 */


            if( attacker == self )
            {
                /* Suicide - weapon */
                pKillerName = self->client->pers.netname;
                pScoreType  = "Suicide";
                iScore      = -1;

                /* Get weapon name, being very careful - mdavies */
                /* This weapon may not have been the weapon used if the weapon was changed before the death */
                pWeaponName = (NULL != attacker->client->pers.weapon)?(attacker->client->pers.weapon->pickup_name):(NULL);

            }
            else
            {
                int fSuicide = 0;
                
                /* Suicide - no weapon */
                switch (mod)
                {
                    case MOD_FALLING:
                    {
                        pWeaponName = "Fell";
                        fSuicide = 1;
                        break;
                    }
                    case MOD_CRUSH:
                    {
                        pWeaponName = "Crushed";
                        fSuicide = 1;
                        break;
                    }
                    case MOD_WATER:
                    {
                        pWeaponName = "Drowned";
                        fSuicide = 1;
                        break;
                    }
                    case MOD_SLIME:
                    {
                        pWeaponName = "Melted";
                        fSuicide = 1;
                        break;
                    }
                    case MOD_LAVA:
                    {
                        pWeaponName = "Lava";
                        fSuicide = 1;
                        break;
                    }
                    case MOD_BOMB:
                    case MOD_EXPLOSIVE:
                    case MOD_BARREL:
                    {
                        pWeaponName = "Explosion";
                        fSuicide = 1;
                        break;
                    }
                    case MOD_TARGET_LASER:
                    {
                        pWeaponName = "Lasered";
                        fSuicide = 1;
                        break;
                    }
                    case MOD_TARGET_BLASTER:
                    {
                        pWeaponName = "Blasted";
                        fSuicide = 1;
                        break;
                    }
                    case MOD_SPLASH:
                    case MOD_TRIGGER_HURT:
                    case MOD_EXIT:
                    case MOD_SUICIDE:
                    {
                        fSuicide = 1;
                        break;
                    }
                }

                if( fSuicide )
                {
                    pKillerName = self->client->pers.netname;
                    pScoreType = "Suicide";
                    iScore     = -1;
                }
                    
            }

            if( (NULL == pKillerName) || (NULL == pScoreType) )
            {
                /* Kills */

                // self->enemy = attacker;
                if( attacker && attacker->client )
                {
                    switch (mod)
                    {
                        case MOD_BLASTER:
                        case MOD_SHOTGUN:
                        case MOD_SSHOTGUN:
                        case MOD_MACHINEGUN:
                        case MOD_CHAINGUN:
                        case MOD_GRENADE:
                        case MOD_G_SPLASH:
                        case MOD_ROCKET:
                        case MOD_R_SPLASH:
                        case MOD_HYPERBLASTER:
                        case MOD_RAILGUN:
                        case MOD_BFG_LASER:
                        case MOD_BFG_BLAST:
                        case MOD_BFG_EFFECT:
                        case MOD_HANDGRENADE:
                        case MOD_HG_SPLASH:
                        case MOD_HELD_GRENADE:
                        default:
                        {
                            /* Kill - weapon */
                            pTargetName = self->client->pers.netname;
                            pKillerName = attacker->client->pers.netname;
                            pScoreType  = "Kill";
                            iScore      = 1;

                            /* Get weapon name, being very careful - mdavies */
                            /* This weapon may not have been the weapon used if the weapon was changed before the death */
                            pWeaponName = (NULL != attacker->client->pers.weapon)?(attacker->client->pers.weapon->pickup_name):(NULL);
                            break;
                        }

                        case MOD_TELEFRAG:
                        {
                            /* Kill - weapon */
                            pTargetName = self->client->pers.netname;
                            pKillerName = attacker->client->pers.netname;
                            pScoreType  = "Kill";
                            iScore      = 1;

                            /* Set weapon name - mdavies */
                            pWeaponName = "Telefrag";
                            break;
                        }                            
                    }
                }
            }

            /* Log a score */
            sl_LogScore( gi,
                         pKillerName,
                         pTargetName,
                         pScoreType,
                         pWeaponName,
                         iScore,
                         level.time );

            return;
        }
    }

    /* default - not multplayer */
    /* Death - Not Logged */
    sl_LogScore( gi,
                 "",
                 "",
                 "ERROR",
                 "",
                 0,
                 level.time );
    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
leaq 0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq 0x58586(%rip), %rax     # 0x82ec0
movq (%rax), %rax
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x2a951
jp 0x2a951
jmp 0x2ac75
movq -0x8(%rbp), %rdi
movq 0x62114(%rip), %rsi     # 0x8ca70
callq 0x197c0
cmpl $0x0, %eax
je 0x2ac73
movq 0x581b7(%rip), %rax     # 0x82b28
movl (%rax), %eax
andl $0xf7ffffff, %eax       # imm = 0xF7FFFFFF
movl %eax, -0x24(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movl $0x0, -0x4c(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x2aa17
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
addq $0xc0, %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x30(%rbp)
leaq 0x466d1(%rip), %rax     # 0x7109c
movq %rax, -0x40(%rbp)
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rcx
xorl %eax, %eax
cmpq 0x730(%rcx), %rax
je 0x2aa02
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x730(%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x2aa0a
xorl %eax, %eax
movq %rax, -0x60(%rbp)
jmp 0x2aa0a
movq -0x60(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x2ab23
movl $0x0, -0x50(%rbp)
movl -0x24(%rbp), %eax
addl $-0x11, %eax
movl %eax, %ecx
movq %rcx, -0x68(%rbp)
subl $0x10, %eax
ja 0x2aaf1
movq -0x68(%rbp), %rax
leaq 0x4661a(%rip), %rcx     # 0x71058
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x46656(%rip), %rax     # 0x710a4
movq %rax, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x2aaf1
leaq 0x46644(%rip), %rax     # 0x710a9
movq %rax, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x2aaf1
leaq 0x46638(%rip), %rax     # 0x710b1
movq %rax, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x2aaf1
leaq 0x4662c(%rip), %rax     # 0x710b9
movq %rax, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x2aaf1
leaq 0x4661f(%rip), %rax     # 0x710c0
movq %rax, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x2aaf1
leaq 0x46610(%rip), %rax     # 0x710c5
movq %rax, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x2aaf1
leaq 0x46606(%rip), %rax     # 0x710cf
movq %rax, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x2aaf1
leaq 0x465fa(%rip), %rax     # 0x710d7
movq %rax, -0x48(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x2aaf1
movl $0x1, -0x50(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x2ab21
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
addq $0xc0, %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x30(%rbp)
leaq 0x46586(%rip), %rax     # 0x7109c
movq %rax, -0x40(%rbp)
movl $0xffffffff, -0x4c(%rbp) # imm = 0xFFFFFFFF
jmp 0x2ab23
xorl %eax, %eax
cmpq -0x30(%rbp), %rax
je 0x2ab37
xorl %eax, %eax
cmpq -0x40(%rbp), %rax
jne 0x2ac4b
cmpq $0x0, -0x20(%rbp)
je 0x2ac49
movq -0x20(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x2ac49
movl -0x24(%rbp), %eax
movl %eax, -0x6c(%rbp)
decl %eax
subl $0x10, %eax
jb 0x2ab78
jmp 0x2ab60
movl -0x6c(%rbp), %eax
subl $0x15, %eax
je 0x2abfa
jmp 0x2ab6e
movl -0x6c(%rbp), %eax
subl $0x18, %eax
jne 0x2ab7a
jmp 0x2ab78
jmp 0x2ab7a
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
addq $0xc0, %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
addq $0xc0, %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x30(%rbp)
leaq 0x4652e(%rip), %rax     # 0x710df
movq %rax, -0x40(%rbp)
movl $0x1, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rcx
xorl %eax, %eax
cmpq 0x730(%rcx), %rax
je 0x2abe8
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movq 0x730(%rax), %rax
movq 0x50(%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x2abf0
xorl %eax, %eax
movq %rax, -0x78(%rbp)
jmp 0x2abf0
movq -0x78(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x2ac47
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
addq $0xc0, %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
addq $0xc0, %rax
addq $0x200, %rax            # imm = 0x200
movq %rax, -0x30(%rbp)
leaq 0x464ae(%rip), %rax     # 0x710df
movq %rax, -0x40(%rbp)
movl $0x1, -0x4c(%rbp)
leaq 0x464a1(%rip), %rax     # 0x710e4
movq %rax, -0x48(%rbp)
jmp 0x2ac49
jmp 0x2ac4b
movq -0x58(%rbp), %rax
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %r8
movl -0x4c(%rbp), %r9d
movss 0x4(%rax), %xmm0
callq 0x19010
jmp 0x2ac9e
jmp 0x2ac75
movq -0x58(%rbp), %rax
movq -0x8(%rbp), %rdi
movss 0x4(%rax), %xmm0
leaq 0x462f7(%rip), %r8      # 0x70f80
leaq 0x4645d(%rip), %rcx     # 0x710ed
xorl %r9d, %r9d
movq %r8, %rsi
movq %r8, %rdx
callq 0x19010
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)