// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/piantirush.c
// Function: piantirushActivityCB
int piantirushActivityCB( char *strIn )
{
    int killDetected = 0;
    int errCode = 0, match = 0, i;
    char *s;
    static char killerName[256], killerID[256], killedName[256], killedID[256], weaponName[256];

    // check kill activity for area-clear status before breach/destruct
    // 
    if ( NULL != strstr( strIn, " killed " ) ) {
        if ( NULL != strstr( strIn, " with " ) ) {
            killDetected = 1;
            _lastKillTime = apiTimeGet();    
            strclr( killerName );
        }
    }

    // due to high rate of message, this will help to optimize
    // looking for 'kill' message
    //
    if ( killDetected ) {

        // if this feature is enabled by p2pvars
        //
        if ( 0L != p2pGetL( "piantirush.p2p.genevaKick", 0L ) ) {
            errCode = rosterParsePlayerKill(strIn, 256, killerName, killerID, killedName, killedID, weaponName );

            // looking for some weapons possibilities, such as
            // BP_Projectile_Molotov_C_2146811897 BP_Projectile_RocketAT4_C_2146858628 
            // BP_Projectile_ANM14_C_2146829547 BP_Projectile_RocketRPG7_C_2147463592 
            //
            for (match = 0, i = 0;; i++ ) {
                if ( NULL == (s = getWord( piantirushConfig.genevaWeapons, i, " " )) ) 
                    break;
                if ( NULL != strcasestr( weaponName, s ) ) {
                    match = 1;
                    break;
                }
            }
        }
 
        if ( match ) {
            // if the killer is a human, then kick
            //
            if ( NULL == strcasestr( killerID, "INVALID" ) ) {
                if ( 0 != strlen( killerName ) ) {
                    apiKick( killerName, piantirushConfig.genevaKickReason );
                    apiSay( "'%s' kicked - illegal use of '%s'", killerName, weaponName );
                    logPrintf( LOG_LEVEL_INFO, "piantirush", "Auto-Kicked restricted weapon ::%s::%s::%s", killerName, killerID, weaponName );
                }
            }
        }
    }

    // Experimental "spawn kill detection" algorithm - WIP for logging only
    //
    // Check kill activity for possible bot spawn kill
    // For CPU optimization process this only inside the check time window 'aPtr'
    // 
    if ( killDetected ) {

        if ( alarmStatus( sPtr ) > 0L ) {                  // if inside the detection window then
            if ( 0 == strlen( killerName ) )
                errCode = rosterParsePlayerKill(strIn, 256, killerName, killerID, killedName, killedID, weaponName );
            logPrintf( LOG_LEVEL_INFO, "piantirush", "Bot-spawnkill kill :%s:%s:%s:%s:%s", killerName, killerID, killedName, killedID, weaponName );
        }

    }

    return errCode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xad6e(%rip), %rsi      # 0x26a1a
callq 0x8390
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1bcf6
movq -0x8(%rbp), %rdi
leaq 0xad78(%rip), %rsi      # 0x26a3e
callq 0x8390
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1bcf4
movl $0x1, -0xc(%rbp)
callq 0x150c0
movq %rax, 0x20c148(%rip)    # 0x227e30
leaq 0x20bc41(%rip), %rdi    # 0x227930
callq 0x122b0
jmp 0x1bcf6
cmpl $0x0, -0xc(%rbp)
je 0x1be6b
leaq 0x7b66(%rip), %rdi      # 0x2386d
xorl %eax, %eax
movl %eax, %esi
callq 0x1eda0
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1bdc3
movq -0x8(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
leaq 0x20bc02(%rip), %rdx    # 0x227930
leaq 0x20bcfb(%rip), %rcx    # 0x227a30
leaq 0x20bdf4(%rip), %r8     # 0x227b30
leaq 0x20beed(%rip), %r9     # 0x227c30
leaq 0x20bfe6(%rip), %rax    # 0x227d30
movq %rax, (%rsp)
callq 0x1b1e0
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %esi
leaq 0x203b32(%rip), %rdi    # 0x21f8a0
addq $0x747c, %rdi           # imm = 0x747C
leaq 0x83dc(%rip), %rdx      # 0x24158
callq 0x122d0
movq %rax, %rcx
movq %rcx, -0x20(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1bd91
jmp 0x1bdc1
movq -0x20(%rbp), %rsi
leaq 0x20bf94(%rip), %rdi    # 0x227d30
callq 0x8340
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1bdb4
movl $0x1, -0x14(%rbp)
jmp 0x1bdc1
jmp 0x1bdb6
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1bd64
jmp 0x1bdc3
cmpl $0x0, -0x14(%rbp)
je 0x1be69
leaq 0x20bc5c(%rip), %rdi    # 0x227a30
leaq 0x890d(%rip), %rsi      # 0x246e8
callq 0x8340
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1be67
leaq 0x20bb3f(%rip), %rdi    # 0x227930
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1be65
leaq 0x20bb29(%rip), %rdi    # 0x227930
leaq 0x203a92(%rip), %rsi    # 0x21f8a0
addq $0x7c7c, %rsi           # imm = 0x7C7C
callq 0x17ee0
leaq 0xacaf(%rip), %rdi      # 0x26ad0
leaq 0x20bb08(%rip), %rsi    # 0x227930
leaq 0x20bf01(%rip), %rdx    # 0x227d30
movb $0x0, %al
callq 0x178d0
movl $0x2, %edi
leaq 0xacb0(%rip), %rsi      # 0x26af2
leaq 0xacb4(%rip), %rdx      # 0x26afd
leaq 0x20bae0(%rip), %rcx    # 0x227930
leaq 0x20bbd9(%rip), %r8     # 0x227a30
leaq 0x20bed2(%rip), %r9     # 0x227d30
movb $0x0, %al
callq 0x21bf0
jmp 0x1be67
jmp 0x1be69
jmp 0x1be6b
cmpl $0x0, -0xc(%rbp)
je 0x1bf21
movq 0x20bfbc(%rip), %rdi    # 0x227e38
callq 0x12aa0
cmpq $0x0, %rax
jle 0x1bf1f
leaq 0x20ba9e(%rip), %rdi    # 0x227930
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1bed9
movq -0x8(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
leaq 0x20ba7f(%rip), %rdx    # 0x227930
leaq 0x20bb78(%rip), %rcx    # 0x227a30
leaq 0x20bc71(%rip), %r8     # 0x227b30
leaq 0x20bd6a(%rip), %r9     # 0x227c30
leaq 0x20be63(%rip), %rax    # 0x227d30
movq %rax, (%rsp)
callq 0x1b1e0
movl %eax, -0x10(%rbp)
movl $0x2, %edi
leaq 0xac0d(%rip), %rsi      # 0x26af2
leaq 0xac3c(%rip), %rdx      # 0x26b28
leaq 0x20ba3d(%rip), %rcx    # 0x227930
leaq 0x20bb36(%rip), %r8     # 0x227a30
leaq 0x20bc2f(%rip), %r9     # 0x227b30
leaq 0x20bd28(%rip), %r10    # 0x227c30
leaq 0x20be21(%rip), %rax    # 0x227d30
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x21bf0
jmp 0x1bf21
movl -0x10(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)