// File: /workspace/github_c_makefile_star2_O2/schroeder-lvb[P]sissm/src/roster.c
// Function: rosterParsePlayerKill
int rosterParsePlayerKill(  char *strIn, int maxChars, char *killerName, char *killerID, char *killedName, char *killedID, char *weaponName )
{
    char tmpStr[ 1024 ], *v, *w;
    int errCode = 1;

    strclr( killerName ); strclr( killerID );
    strclr( killedName ); strclr( killedID );
    strclr( weaponName );

    strlcpy( tmpStr, strIn, 1024 );

    if ( NULL != ( w = strstr( tmpStr, ": Display: " ))) {

        // ----------------------
        // 1 of 3:  process killer name & ID
        //
        w += 11;  // points to start of player name
        if (*w != 0) {
            if ( NULL == ( v = strstr( w, ", team 0] killed " )))
                v = strstr( w, ", team 1] killed " );
            if ( v != NULL ) {
                *v = ']';
                *(v+1) = 0;
                errCode = _parseKillerKilled( w, maxChars, killerName, killerID );
            }
        }

        // ----------------------
        // 2 of 3:  process killed name & ID
        //
        if ( errCode == 0) {
            errCode = 1;
            strlcpy( tmpStr, strIn, 1024 );
            if ( NULL == ( w = strstr( tmpStr, ", team 0] killed " ))) {
                w = strstr( tmpStr, ", team 1] killed " );
            }

            if ( w != NULL ) {
                w += 17;  // points to start of player name
                if ( *w != 0 ) {
                    if ( NULL == ( v = strstr( w, ", team 0] with " )))
                        v = strstr( w, ", team 1] with " );
                    if ( v != NULL ) {
                        *v = ']';
                        *(v+1) = 0;
                        errCode = _parseKillerKilled( w, maxChars, killedName, killedID );
                    }
                }
            }
        }

        // ----------------------
        // 3 of 3:  process weaponName
        //
        if ( errCode == 0) {
            errCode = 1;
            if ( NULL == ( w = strstr( strIn, ", team 0] with " ))) {
                w = strstr( strIn, ", team 1] with " );
            }
            if ( w != NULL ) {
                w += 15;
                if ( *w != 0 ) {
                    strlcpy( weaponName, w, maxChars );
                    errCode = 0;
                }
            }
        }
    }
    return errCode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
movq %r9, %r13
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %rbx
movl %esi, 0xc(%rsp)
movq %rdi, %r12
movq 0x460(%rsp), %rbp
movq %rdx, %rdi
callq 0xed98
movq %r14, %rdi
callq 0xed98
movq %r15, 0x10(%rsp)
movq %r15, %rdi
callq 0xed98
movq %r13, 0x18(%rsp)
movq %r13, %rdi
callq 0xed98
movq %rbp, %rdi
callq 0xed98
leaq 0x20(%rsp), %rbp
movl $0x400, %edx            # imm = 0x400
movq %rbp, %rdi
movq %r12, %r13
movq %r12, %rsi
callq 0xe97a
leaq 0x9176(%rip), %rsi      # 0x1d9d1
movq %rbp, %rdi
callq 0x83c0
pushq $0x1
popq %rcx
testq %rax, %rax
je 0x148c0
movq %rax, %rbp
cmpb $0x0, 0xb(%rax)
je 0x148c0
addq $0xb, %rbp
leaq 0x915e(%rip), %rsi      # 0x1d9dd
movq %rbp, %rdi
callq 0x83c0
testq %rax, %rax
jne 0x148a0
leaq 0x915c(%rip), %rsi      # 0x1d9ef
movq %rbp, %rdi
callq 0x83c0
testq %rax, %rax
je 0x148bd
movw $0x5d, (%rax)
movq %rbp, %rdi
movl 0xc(%rsp), %ebp
movl %ebp, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x149c7
testl %eax, %eax
je 0x148d4
pushq $0x1
popq %rcx
movl %ecx, %eax
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20(%rsp), %rbx
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe97a
leaq 0x90ed(%rip), %rsi      # 0x1d9dd
movq %rbx, %rdi
callq 0x83c0
testq %rax, %rax
jne 0x14913
leaq 0x90eb(%rip), %rsi      # 0x1d9ef
leaq 0x20(%rsp), %rdi
callq 0x83c0
testq %rax, %rax
je 0x148bd
movq %rax, %rbx
pushq $0x1
popq %rcx
cmpb $0x0, 0x11(%rax)
je 0x148c0
addq $0x11, %rbx
leaq 0x90d7(%rip), %rsi      # 0x1da01
movq %rbx, %rdi
callq 0x83c0
testq %rax, %rax
jne 0x1494f
leaq 0x90d3(%rip), %rsi      # 0x1da11
movq %rbx, %rdi
callq 0x83c0
testq %rax, %rax
je 0x148bd
movw $0x5d, (%rax)
movq %rbx, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x149c7
testl %eax, %eax
jne 0x148bd
leaq 0x908a(%rip), %rsi      # 0x1da01
movq %r13, %rdi
callq 0x83c0
testq %rax, %rax
jne 0x1499c
leaq 0x9086(%rip), %rsi      # 0x1da11
movq %r13, %rdi
callq 0x83c0
testq %rax, %rax
je 0x148bd
pushq $0x1
popq %rcx
cmpb $0x0, 0xf(%rax)
je 0x148c0
addq $0xf, %rax
movslq %ebp, %rdx
movq 0x460(%rsp), %rdi
movq %rax, %rsi
callq 0xe97a
xorl %ecx, %ecx
jmp 0x148c0