// File: /workspace/github_c_makefile_star2_O1/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 0xf4dd
movq %r14, %rdi
callq 0xf4dd
movq %r15, 0x10(%rsp)
movq %r15, %rdi
callq 0xf4dd
movq %r13, 0x18(%rsp)
movq %r13, %rdi
callq 0xf4dd
movq %rbp, %rdi
callq 0xf4dd
leaq 0x20(%rsp), %rbp
movl $0x400, %edx            # imm = 0x400
movq %rbp, %rdi
movq %r12, %r13
movq %r12, %rsi
callq 0xf038
leaq 0x94aa(%rip), %rsi      # 0x1e9f1
movq %rbp, %rdi
callq 0x83b0
movl $0x1, %ecx
testq %rax, %rax
je 0x155b0
movq %rax, %rbp
cmpb $0x0, 0xb(%rax)
je 0x155b0
addq $0xb, %rbp
leaq 0x9490(%rip), %rsi      # 0x1e9fd
movq %rbp, %rdi
callq 0x83b0
testq %rax, %rax
jne 0x15589
leaq 0x948e(%rip), %rsi      # 0x1ea0f
movq %rbp, %rdi
callq 0x83b0
testq %rax, %rax
je 0x155ab
movw $0x5d, (%rax)
movq %rbp, %rdi
movl 0xc(%rsp), %ebp
movl %ebp, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x156be
testl %eax, %eax
je 0x155c4
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 0xf038
leaq 0x941d(%rip), %rsi      # 0x1e9fd
movq %rbx, %rdi
callq 0x83b0
movq %rax, %rbx
testq %rax, %rax
jne 0x15604
leaq 0x9418(%rip), %rsi      # 0x1ea0f
leaq 0x20(%rsp), %rdi
callq 0x83b0
movq %rax, %rbx
testq %rbx, %rbx
movl $0x1, %ecx
je 0x155b0
cmpb $0x0, 0x11(%rbx)
je 0x155b0
addq $0x11, %rbx
leaq 0x9402(%rip), %rsi      # 0x1ea21
movq %rbx, %rdi
callq 0x83b0
testq %rax, %rax
jne 0x1563b
leaq 0x93fe(%rip), %rsi      # 0x1ea31
movq %rbx, %rdi
callq 0x83b0
testq %rax, %rax
je 0x155ab
movw $0x5d, (%rax)
movq %rbx, %rdi
movl %ebp, %esi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x156be
testl %eax, %eax
jne 0x155ab
leaq 0x93b5(%rip), %rsi      # 0x1ea21
movq %r13, %rdi
callq 0x83b0
testq %rax, %rax
jne 0x15688
leaq 0x93b1(%rip), %rsi      # 0x1ea31
movq %r13, %rdi
callq 0x83b0
testq %rax, %rax
movl $0x1, %ecx
je 0x155b0
cmpb $0x0, 0xf(%rax)
je 0x155b0
addq $0xf, %rax
movslq %ebp, %rdx
movq 0x460(%rsp), %rdi
movq %rax, %rsi
callq 0xf038
xorl %ecx, %ecx
jmp 0x155b0