// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/api.c
// Function: apiBPCharPlayerCB
int _apiBPCharPlayerCB( char *strIn )
{
    char *w, *n = NULL;
    int i;

    if ( NULL != (w = strstr( strIn, SS_SUBSTR_BP_CHARNAME ) )) {
        _charTrackingActive = 1;      // indicate character tracking is enalbed for Insurgency.log
        w = strstr( strIn, "BP_Character_Player" );
        if ( w != NULL ) {
            if ( NULL != (n = getWord( w, 0, " .'" )) ) {
                ;;
                // printf("\nConnect ::%s::%s\n", n, _cachedName );
            }
        }
    }

    if (( 0 != strlen( _cachedName )) && ( n != NULL ) ) {

        // First pass, remove preexisting or duplicate characterID and playerName
        //
        for ( i = 0; i<API_MAXENTITIES; i++ )  {
            if ( 0 == strcmp( n, soldierTranslate[ i ].charID )) {
                strclr( soldierTranslate[ i ].charID );
                strclr( soldierTranslate[ i ].playerName );
            }
            if ( 0 == strcmp( _cachedName, soldierTranslate[ i ].playerName )) {
                strclr( soldierTranslate[ i ].charID );
                strclr( soldierTranslate[ i ].playerName );
            }
        }

        // insert into the translation table
        //
        for ( i = 0; i<API_MAXENTITIES; i++ )  {
            if ( 0 == strlen( soldierTranslate[ i ].charID ) ) {
                strlcpy( soldierTranslate[ i ].playerName, _cachedName, 256 );
                strlcpy( soldierTranslate[ i ].charID,               n, 256 );
                logPrintf( LOG_LEVEL_INFO, "api", "BPChar %s bound to '%s'", n, _cachedName );
                break;
            }
        }
    }

    strclr( _cachedName );
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq 0xf42b(%rip), %rsi      # 0x24a4a
callq 0x8390
movq %rax, %rcx
movq %rcx, -0x10(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1567d
movl $0x1, 0xdbf74(%rip)     # 0xf15b0
movq -0x8(%rbp), %rdi
leaq 0x1099b(%rip), %rsi     # 0x25fe2
callq 0x8390
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1567b
movq -0x10(%rbp), %rdi
xorl %esi, %esi
leaq 0x10992(%rip), %rdx     # 0x25ff6
callq 0x122d0
movq %rax, %rcx
movq %rcx, -0x18(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0x15679
jmp 0x15679
jmp 0x1567b
jmp 0x1567d
leaq 0xd3e2c(%rip), %rdi     # 0xe94b0
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x15832
cmpq $0x0, -0x18(%rbp)
je 0x15832
movl $0x0, -0x1c(%rbp)
cmpl $0x40, -0x1c(%rbp)
jge 0x1577d
movq -0x18(%rbp), %rdi
movslq -0x1c(%rbp), %rax
leaq 0xd3eee(%rip), %rsi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rsi
callq 0x8200
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1570b
movslq -0x1c(%rbp), %rax
leaq 0xd3ecf(%rip), %rdi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rdi
callq 0x122b0
movslq -0x1c(%rbp), %rax
leaq 0xd3eb8(%rip), %rdi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x122b0
movslq -0x1c(%rbp), %rax
leaq 0xd3e9a(%rip), %rsi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rsi
addq $0x100, %rsi            # imm = 0x100
leaq 0xd3d85(%rip), %rdi     # 0xe94b0
callq 0x8200
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x1576d
movslq -0x1c(%rbp), %rax
leaq 0xd3e6d(%rip), %rdi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rdi
callq 0x122b0
movslq -0x1c(%rbp), %rax
leaq 0xd3e56(%rip), %rdi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
callq 0x122b0
jmp 0x1576f
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x156a9
movl $0x0, -0x1c(%rbp)
cmpl $0x40, -0x1c(%rbp)
jge 0x15830
movslq -0x1c(%rbp), %rax
leaq 0xd3e17(%rip), %rdi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rdi
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x15820
movslq -0x1c(%rbp), %rax
leaq 0xd3df6(%rip), %rdi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rdi
addq $0x100, %rdi            # imm = 0x100
leaq 0xd3ce1(%rip), %rsi     # 0xe94b0
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
movslq -0x1c(%rbp), %rax
leaq 0xd3dcc(%rip), %rdi     # 0xe95b0
shlq $0x9, %rax
addq %rax, %rdi
movq -0x18(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
movq -0x18(%rbp), %rcx
movl $0x2, %edi
leaq 0x1068e(%rip), %rsi     # 0x25e97
leaq 0x107ea(%rip), %rdx     # 0x25ffa
leaq 0xd3c99(%rip), %r8      # 0xe94b0
movb $0x0, %al
callq 0x21bf0
jmp 0x15830
jmp 0x15822
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x15784
jmp 0x15832
leaq 0xd3c77(%rip), %rdi     # 0xe94b0
callq 0x122b0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)