// File: /workspace/github_c_makefile_star2_O3/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 0xc7ee(%rip), %rsi      # 0x1de7f
leaq 0xc818(%rip), %rdx      # 0x1deb0
movl $0x4, %edi
xorl %eax, %eax
callq 0x1a3e3
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 0xc7dad(%rip), %rdi     # 0xd9488
leaq 0xc(%rsp), %r8
movl $0x2, %esi
movq %rbx, %rdx
movq %r14, %rcx
callq 0x972d
testl %eax, %eax
je 0x11717
callq 0x14c64
leaq 0xc77f(%rip), %rsi      # 0x1de7f
leaq 0xc7cd(%rip), %rdx      # 0x1ded4
movl $0x2, %edi
movl %eax, %ecx
xorl %eax, %eax
callq 0x1a3e3
jmp 0x11796
movl 0xc(%rsp), %esi
leaq 0x10(%rsp), %rdi
callq 0x1487a
xorl %edi, %edi
callq 0x82a0
movq %rax, 0xc7d4d(%rip)     # 0xd9480
leaq 0xd2f8(%rip), %rsi      # 0x1ea32
movl $0x4, %edi
callq 0x14f92
leaq 0xc7d45(%rip), %rbx     # 0xd9490
movl $0x4000, %edx           # imm = 0x4000
movq %rbx, %rdi
movq %rax, %rsi
callq 0xf384
leaq 0xcbd2e(%rip), %r14     # 0xdd490
leaq -0x2a7(%rip), %rdx      # 0x114c2
movq %r14, %rdi
movq %rbx, %rsi
callq 0x159f7
leaq -0x27c(%rip), %rdx      # 0x114ff
movq %rbx, %rdi
movq %r14, %rsi
callq 0x159f7
movl $0x4000, %edx           # imm = 0x4000
movq %r14, %rdi
movq %rbx, %rsi
callq 0xf384
callq 0x117c7
xorl %edi, %edi
callq 0x11870
movq 0xcfce7(%rip), %rdi     # 0xe1490
movl $0xa, %esi
callq 0xfc98
xorl %eax, %eax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r14
retq