// File: /workspace/github_c_makefile_star2_O1/schroeder-lvb[P]sissm/src/api.c
// Function: apiPollAlarmCB
int _apiPollAlarmCB( char *strIn )
{
    char rconCmd[API_T_BUFSIZE], rconResp[API_R_BUFSIZE];
    int  bytesRead, errCode = 0;

    logPrintf( LOG_LEVEL_RAWDUMP, "api", "Roster update alarm callback ::%s::", strIn );

    // Fetch the roster
    //
    snprintf( rconCmd, API_T_BUFSIZE, "listplayers" );
    memset( rconResp, 0, API_R_BUFSIZE );
    errCode = rdrvCommand( _rPtr, 2, rconCmd, rconResp, &bytesRead );
    if ( !errCode ) {
        rosterParse( rconResp, bytesRead );
        // logPrintf( LOG_LEVEL_DEBUG, "api", "Listplayer success, player count is %d", rosterCount());
        lastRosterSuccessTime = apiTimeGet();             // record this to check for dead servers
	strlcpy( rosterCurrent, rosterPlayerList( 4, "\011" ), API_ROSTER_STRING_MAX );
	rosterSyntheticChangeEvent( rosterPrevious, rosterCurrent, _apiSyntheticDelDispatch ); 
	rosterSyntheticChangeEvent( rosterCurrent, rosterPrevious, _apiSyntheticAddDispatch ); 
	strlcpy( rosterPrevious, rosterCurrent, API_ROSTER_STRING_MAX );

    }
    else {
        logPrintf( LOG_LEVEL_INFO, "api", 
            "Listplayer retrieve failure on apiPollAlarmCB, playercount is %d", rosterCount() );
    }

    // Fetch the GameState using activeobjective gamemodeproperties  
    //   
    _apiFetchGameState();

    // do a cached-read of server name from RCON.  Once successful, it will read
    // from the cache (not RCON) thereafter
    //
    apiGetServerNameRCON( 0 );

    // reset the alarm for the next iteration
    //
    alarmReset( _apiPollAlarmPtr, API_LISTPLAYERS_PERIOD );

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x2018, %rsp           # imm = 0x2018
movq %rdi, %rcx
leaq 0xcb0c(%rip), %rsi      # 0x1de8f
leaq 0xcb36(%rip), %rdx      # 0x1dec0
movl $0x4, %edi
xorl %eax, %eax
callq 0x1a227
movabsq $0x79616c707473696c, %rax # imm = 0x79616C707473696C
leaq 0x1010(%rsp), %rbx
movq %rax, (%rbx)
movl $0x737265, 0x8(%rbx)    # imm = 0x737265
leaq 0x10(%rsp), %r14
movl $0x1000, %edx           # imm = 0x1000
movq %r14, %rdi
xorl %esi, %esi
callq 0x81b0
movq 0xc80bb(%rip), %rdi     # 0xd9488
leaq 0xc(%rsp), %r8
movl $0x2, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x9748
testl %eax, %eax
je 0x11409
callq 0x149a0
leaq 0xca9d(%rip), %rsi      # 0x1de8f
leaq 0xcaeb(%rip), %rdx      # 0x1dee4
movl $0x2, %edi
movl %eax, %ecx
xorl %eax, %eax
callq 0x1a227
jmp 0x11488
movl 0xc(%rsp), %esi
leaq 0x10(%rsp), %rdi
callq 0x14561
xorl %edi, %edi
callq 0x82a0
movq %rax, 0xc805b(%rip)     # 0xd9480
leaq 0xd616(%rip), %rsi      # 0x1ea42
movl $0x4, %edi
callq 0x14cce
leaq 0xc8053(%rip), %rbx     # 0xd9490
movl $0x4000, %edx           # imm = 0x4000
movq %rbx, %rdi
movq %rax, %rsi
callq 0xf038
leaq 0xcc03c(%rip), %r14     # 0xdd490
leaq -0x2a7(%rip), %rdx      # 0x111b4
movq %r14, %rdi
movq %rbx, %rsi
callq 0x15782
leaq -0x27c(%rip), %rdx      # 0x111f1
movq %rbx, %rdi
movq %r14, %rsi
callq 0x15782
movl $0x4000, %edx           # imm = 0x4000
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf038
callq 0x114b9
xorl %edi, %edi
callq 0x11562
movq 0xcfff5(%rip), %rdi     # 0xe1490
movl $0xa, %esi
callq 0xf953
xorl %eax, %eax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r14
retq