// File: /workspace/github_c_makefile_star2_O1/schroeder-lvb[P]sissm/src/piwebgen.c
// Function: piwebgenPeriodicCB
int piwebgenPeriodicCB( char *strIn )
{
    static unsigned int intervalCount = 0;
    static unsigned int modePollingGameMode   = 0;
    static unsigned int modePollingMutators   = 0;
    static unsigned int modePollingHostName   = 15;

    // Game Mode polling/caching from RCON, once every 60 seconds
    //
    if ( piwebgenConfig.showGameMode ) {
        if ( modePollingGameMode++ > 60 ) {
            modePollingGameMode = 0;

            // Get current game mode: "checkpoint", "hardcorecheckpoint"....
            //
            strlcpy( gameMode, apiGameModePropertyGet( "gamemodetagname" ), API_LINE_STRING_MAX );
            if ( 0 != strlen( gameMode ) )
                logPrintf( LOG_LEVEL_INFO, "piwebgen", "GameMode is ::%s::", gameMode );
            else {
                strlcpy( gameMode, "Unknown", API_LINE_STRING_MAX );
                logPrintf( LOG_LEVEL_WARN, "piwebgen", "** Unable to read; current GameMode" );
            }

        }
    }

    // Mutator polling/caching from RCON, once every 60 seconds
    //
    if ( piwebgenConfig.showMutators ) {
        if ( modePollingMutators++ > 60 ) {
            modePollingMutators = 0;
            strlcpy( gameMutators, apiMutActive( 1 ), API_LINE_STRING_MAX );
        }
    }

    if ( piwebgenConfig.reReadHostName ) {
        if ( modePollingHostName++ > 60 ) {
            modePollingHostName = 0;
            apiGetServerNameRCON( piwebgenConfig.reReadHostName );
        }
    }

    if ( 0 != piwebgenConfig.updateIntervalSec ) {

        if ( (++intervalCount) > piwebgenConfig.updateIntervalSec ) {
            _genWebFile();
           intervalCount = 0;
        }
    }
    return 0;
}

// Assembly:
pushq %rax
cmpl $0x0, 0xbc547(%rip)     # 0xccf60
je 0x10ab8
movl 0xc084f(%rip), %eax     # 0xd1274
leal 0x1(%rax), %ecx
movl %ecx, 0xc0846(%rip)     # 0xd1274
cmpl $0x3d, %eax
jb 0x10ab8
movl $0x0, 0xc0833(%rip)     # 0xd1274
leaq 0xc6ca(%rip), %rdi      # 0x1d112
callq 0x12e75
leaq 0xbc51c(%rip), %rdi     # 0xccf70
movl $0x100, %edx            # imm = 0x100
movq %rax, %rsi
callq 0xf038
cmpb $0x0, 0xbc508(%rip)     # 0xccf70
je 0x10a8d
leaq 0xd072(%rip), %rsi      # 0x1dae3
leaq 0xc6aa(%rip), %rdx      # 0x1d122
leaq 0xbc4f1(%rip), %rcx     # 0xccf70
movl $0x2, %edi
xorl %eax, %eax
callq 0x1a227
jmp 0x10ab8
movabsq $0x6e776f6e6b6e55, %rax # imm = 0x6E776F6E6B6E55
movq %rax, 0xbc4d2(%rip)     # 0xccf70
leaq 0xd03e(%rip), %rsi      # 0x1dae3
leaq 0xc689(%rip), %rdx      # 0x1d135
movl $0x1, %edi
xorl %eax, %eax
callq 0x1a227
cmpl $0x0, 0xbc4a5(%rip)     # 0xccf64
je 0x10afd
movl 0xc07b1(%rip), %eax     # 0xd1278
leal 0x1(%rax), %ecx
movl %ecx, 0xc07a8(%rip)     # 0xd1278
cmpl $0x3d, %eax
jb 0x10afd
movl $0x0, 0xc0799(%rip)     # 0xd1278
movl $0x1, %edi
callq 0x13e47
leaq 0xbc580(%rip), %rdi     # 0xcd070
movl $0x100, %edx            # imm = 0x100
movq %rax, %rsi
callq 0xf038
movl 0xbc44d(%rip), %edi     # 0xccf50
testl %edi, %edi
je 0x10b2a
movl 0x18fb7(%rip), %eax     # 0x29ac4
leal 0x1(%rax), %ecx
movl %ecx, 0x18fae(%rip)     # 0x29ac4
cmpl $0x3d, %eax
jb 0x10b2a
movl $0x0, 0x18f9f(%rip)     # 0x29ac4
callq 0x11562
movl 0xbbb88(%rip), %eax     # 0xcc6b8
testl %eax, %eax
je 0x10b55
movl 0xc0736(%rip), %ecx     # 0xd1270
incl %ecx
movl %ecx, 0xc072e(%rip)     # 0xd1270
cmpl %eax, %ecx
jbe 0x10b55
callq 0x104f5
movl $0x0, 0xc071b(%rip)     # 0xd1270
xorl %eax, %eax
popq %rcx
retq