// File: /workspace/github_c_makefile_star2_O2/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 0xc428(%rip), %rsi      # 0x1ce6f
leaq 0xc452(%rip), %rdx      # 0x1cea0
pushq $0x4
popq %rdi
xorl %eax, %eax
callq 0x1920b
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 0xc89f9(%rip), %rdi     # 0xd9488
pushq $0x2
popq %rsi
leaq 0xc(%rsp), %r8
movq %rbx, %rdx
movq %r14, %rcx
callq 0x961f
testl %eax, %eax
je 0x10ac7
callq 0x13d00
leaq 0xc3bd(%rip), %rsi      # 0x1ce6f
leaq 0xc40b(%rip), %rdx      # 0x1cec4
pushq $0x2
popq %rdi
movl %eax, %ecx
xorl %eax, %eax
callq 0x1920b
jmp 0x10b42
movl 0xc(%rsp), %esi
leaq 0x10(%rsp), %rdi
callq 0x13956
callq 0x10b6a
movq %rax, 0xc899f(%rip)     # 0xd9480
leaq 0xcf3a(%rip), %rsi      # 0x1da22
pushq $0x4
popq %rdi
callq 0x1402d
leaq 0xc8999(%rip), %rbx     # 0xd9490
movl $0x4000, %edx           # imm = 0x4000
movq %rbx, %rdi
movq %rax, %rsi
callq 0xe97a
leaq 0xcc982(%rip), %r14     # 0xdd490
leaq -0x299(%rip), %rdx      # 0x1087c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x14a5e
leaq -0x26e(%rip), %rdx      # 0x108b9
movq %rbx, %rdi
movq %r14, %rsi
callq 0x14a5e
movl $0x4000, %edx           # imm = 0x4000
movq %r14, %rdi
movq %rbx, %rsi
callq 0xe97a
callq 0x10b71
xorl %edi, %edi
callq 0x10c16
movq 0xd093b(%rip), %rdi     # 0xe1490
pushq $0xa
popq %rsi
callq 0xf1b1
xorl %eax, %eax
addq $0x2018, %rsp           # imm = 0x2018
popq %rbx
popq %r14
retq