// File: /workspace/github_c_makefile_star2_O3/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 0xf829
movq %r14, %rdi
callq 0xf829
movq %r15, 0x10(%rsp)
movq %r15, %rdi
callq 0xf829
movq %r13, 0x18(%rsp)
movq %r13, %rdi
callq 0xf829
movq %rbp, %rdi
callq 0xf829
leaq 0x20(%rsp), %rbp
movl $0x400, %edx            # imm = 0x400
movq %rbp, %rdi
movq %r12, %r13
movq %r12, %rsi
callq 0xf384
leaq 0x9201(%rip), %rsi      # 0x1e9e1
movq %rbp, %rdi
callq 0x83b0
movl $0x1, %ecx
testq %rax, %rax
je 0x15849
movq %rax, %rbp
cmpb $0x0, 0xb(%rax)
je 0x15849
addq $0xb, %rbp
leaq 0x91e7(%rip), %rsi      # 0x1e9ed
movq %rbp, %rdi
callq 0x83b0
testq %rax, %rax
jne 0x15827
leaq 0x91e5(%rip), %rsi      # 0x1e9ff
movq %rbp, %rdi
callq 0x83b0
testq %rax, %rax
je 0x15844
movw $0x5d, (%rax)
movq %rbp, %rdi
movl 0xc(%rsp), %ebp
movl %ebp, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x15954
testl %eax, %eax
je 0x1585d
movl $0x1, %ecx
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 0xf384
leaq 0x9174(%rip), %rsi      # 0x1e9ed
movq %rbx, %rdi
callq 0x83b0
testq %rax, %rax
jne 0x1589c
leaq 0x9172(%rip), %rsi      # 0x1e9ff
leaq 0x20(%rsp), %rdi
callq 0x83b0
testq %rax, %rax
je 0x15844
movq %rax, %rbx
movl $0x1, %ecx
cmpb $0x0, 0x11(%rax)
je 0x15849
addq $0x11, %rbx
leaq 0x915c(%rip), %rsi      # 0x1ea11
movq %rbx, %rdi
callq 0x83b0
testq %rax, %rax
jne 0x158da
leaq 0x9158(%rip), %rsi      # 0x1ea21
movq %rbx, %rdi
callq 0x83b0
testq %rax, %rax
je 0x15844
movw $0x5d, (%rax)
movq %rbx, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x15954
testl %eax, %eax
jne 0x15844
leaq 0x910f(%rip), %rsi      # 0x1ea11
movq %r13, %rdi
callq 0x83b0
testq %rax, %rax
jne 0x15927
leaq 0x910b(%rip), %rsi      # 0x1ea21
movq %r13, %rdi
callq 0x83b0
testq %rax, %rax
je 0x15844
movl $0x1, %ecx
cmpb $0x0, 0xf(%rax)
je 0x15849
addq $0xf, %rax
movslq %ebp, %rdx
movq 0x460(%rsp), %rdi
movq %rax, %rsi
callq 0xf384
xorl %ecx, %ecx
jmp 0x15849