// File: /workspace/github_c_makefile_star2_O2/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, 0xbcdac(%rip)     # 0xccf60
je 0x10248
movl 0xc10b4(%rip), %eax     # 0xd1274
leal 0x1(%rax), %ecx
movl %ecx, 0xc10ab(%rip)     # 0xd1274
cmpl $0x3d, %eax
jb 0x10248
andl $0x0, 0xc109f(%rip)     # 0xd1274
leaq 0xbf16(%rip), %rdi      # 0x1c0f2
callq 0x12469
leaq 0xbcd88(%rip), %rdi     # 0xccf70
movl $0x100, %edx            # imm = 0x100
movq %rax, %rsi
callq 0xe97a
cmpb $0x0, 0xbcd74(%rip)     # 0xccf70
je 0x1021f
leaq 0xc8be(%rip), %rsi      # 0x1cac3
leaq 0xbef6(%rip), %rdx      # 0x1c102
leaq 0xbcd5d(%rip), %rcx     # 0xccf70
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x1920b
jmp 0x10248
movabsq $0x6e776f6e6b6e55, %rax # imm = 0x6E776F6E6B6E55
movq %rax, 0xbcd40(%rip)     # 0xccf70
leaq 0xc88c(%rip), %rsi      # 0x1cac3
leaq 0xbed7(%rip), %rdx      # 0x1c115
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1920b
cmpl $0x0, 0xbcd15(%rip)     # 0xccf64
je 0x10288
movl 0xc1021(%rip), %eax     # 0xd1278
leal 0x1(%rax), %ecx
movl %ecx, 0xc1018(%rip)     # 0xd1278
cmpl $0x3d, %eax
jb 0x10288
andl $0x0, 0xc100c(%rip)     # 0xd1278
pushq $0x1
popq %rdi
callq 0x132fc
leaq 0xbcdf5(%rip), %rdi     # 0xcd070
movl $0x100, %edx            # imm = 0x100
movq %rax, %rsi
callq 0xe97a
movl 0xbccc2(%rip), %edi     # 0xccf50
testl %edi, %edi
je 0x102b2
movl 0x1982c(%rip), %eax     # 0x29ac4
leal 0x1(%rax), %ecx
movl %ecx, 0x19823(%rip)     # 0x29ac4
cmpl $0x3d, %eax
jb 0x102b2
andl $0x0, 0x19817(%rip)     # 0x29ac4
callq 0x10c16
movl 0xbc400(%rip), %eax     # 0xcc6b8
testl %eax, %eax
je 0x102da
movl 0xc0fae(%rip), %ecx     # 0xd1270
incl %ecx
movl %ecx, 0xc0fa6(%rip)     # 0xd1270
cmpl %eax, %ecx
jbe 0x102da
callq 0xfceb
andl $0x0, 0xc0f96(%rip)     # 0xd1270
xorl %eax, %eax
popq %rcx
retq