// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/roster.c
// Function: rosterSyntheticChangeEvent
int rosterSyntheticChangeEvent( char *prevRoster, char *currRoster, int (*callback)( char *, char *, char *) )
{
    char *w, *q, lineBuf[1024];
    static char playerGUID[256], playerIP[256], playerName[256];
    int  startOfName,  i = 0;

    while (1 == 1) {
        if ( NULL == (w = getWord( prevRoster, i++, "\011" )) )    // tab deliminated
            break;
        strlcpy( lineBuf, w, 1024 );
        if ( 0 == strlen( lineBuf ) ) break;

        if ( NULL == strstr( currRoster, lineBuf ) ) {  // if missing

            // parse the record into fields -- is follows 
            // rosterPlayerList( type=4, delim="tab" ) format.
            // 76561100000000000 001.002.003.004 Player Name<tab>
            //
            if ( NULL != (q = getWord( lineBuf, 0, " \011" ))) 
                strlcpy( playerGUID, q, 255 );
            else  
                strclr( playerGUID );
            
            if ( NULL != (q = getWord( lineBuf, 1, " \011" ))) 
                strlcpy( playerIP, q, 255 );   // <---- fails
            else 
                strclr( playerIP );

            startOfName = (int) strlen( playerGUID ) + (int) strlen( playerIP ) + 2;
            strlcpy( playerName, &lineBuf[ startOfName ], 255 );

            logPrintf( LOG_LEVEL_DEBUG, "roster", "Change Line    ::%s::\n", lineBuf ) ;
            logPrintf( LOG_LEVEL_DEBUG, "roster", "Change Parsed  ::%s::%s::%s::\n", playerName, playerGUID, playerIP );

            (*callback)( playerName, playerIP, playerGUID );
        }
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x438(%rbp)
movq -0x8(%rbp), %rdi
movl -0x438(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0x438(%rbp)
leaq 0xb3e9(%rip), %rdx      # 0x26a56
callq 0x122d0
movq %rax, %rcx
movq %rcx, -0x20(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1b685
jmp 0x1b823
leaq -0x430(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
leaq -0x430(%rbp), %rdi
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1b6b5
jmp 0x1b823
movq -0x10(%rbp), %rdi
leaq -0x430(%rbp), %rsi
callq 0x8390
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x1b81e
leaq -0x430(%rbp), %rdi
xorl %esi, %esi
leaq 0xb372(%rip), %rdx      # 0x26a55
callq 0x122d0
movq %rax, %rcx
movq %rcx, -0x28(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1b70d
movq -0x28(%rbp), %rsi
leaq 0x203e9f(%rip), %rdi    # 0x21f5a0
movl $0xff, %edx
callq 0x11bc0
jmp 0x1b719
leaq 0x203e8c(%rip), %rdi    # 0x21f5a0
callq 0x122b0
leaq -0x430(%rbp), %rdi
movl $0x1, %esi
leaq 0xb329(%rip), %rdx      # 0x26a55
callq 0x122d0
movq %rax, %rcx
movq %rcx, -0x28(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0x1b756
movq -0x28(%rbp), %rsi
leaq 0x203f56(%rip), %rdi    # 0x21f6a0
movl $0xff, %edx
callq 0x11bc0
jmp 0x1b762
leaq 0x203f43(%rip), %rdi    # 0x21f6a0
callq 0x122b0
leaq 0x203e37(%rip), %rdi    # 0x21f5a0
callq 0x8110
movl %eax, -0x43c(%rbp)
leaq 0x203f25(%rip), %rdi    # 0x21f6a0
callq 0x8110
movq %rax, %rcx
movl -0x43c(%rbp), %eax
addl %ecx, %eax
addl $0x2, %eax
movl %eax, -0x434(%rbp)
movslq -0x434(%rbp), %rax
leaq -0x430(%rbp), %rsi
addq %rax, %rsi
leaq 0x203ff4(%rip), %rdi    # 0x21f7a0
movl $0xff, %edx
callq 0x11bc0
leaq -0x430(%rbp), %rcx
movl $0x3, %edi
leaq 0xafab(%rip), %rsi      # 0x26774
leaq 0xb288(%rip), %rdx      # 0x26a58
movb $0x0, %al
callq 0x21bf0
movl $0x3, %edi
leaq 0xaf91(%rip), %rsi      # 0x26774
leaq 0xb285(%rip), %rdx      # 0x26a6f
leaq 0x203faf(%rip), %rcx    # 0x21f7a0
leaq 0x203da8(%rip), %r8     # 0x21f5a0
leaq 0x203ea1(%rip), %r9     # 0x21f6a0
movb $0x0, %al
callq 0x21bf0
leaq 0x203f93(%rip), %rdi    # 0x21f7a0
leaq 0x203e8c(%rip), %rsi    # 0x21f6a0
leaq 0x203d85(%rip), %rdx    # 0x21f5a0
callq *-0x18(%rbp)
jmp 0x1b651
xorl %eax, %eax
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq
nop