// File: /workspace/github_c_makefile_star2_O3/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, 0xbc220(%rip)     # 0xccf60
je 0x10ddf
movl 0xc0528(%rip), %eax     # 0xd1274
leal 0x1(%rax), %ecx
movl %ecx, 0xc051f(%rip)     # 0xd1274
cmpl $0x3d, %eax
jb 0x10ddf
movl $0x0, 0xc050c(%rip)     # 0xd1274
leaq 0xc37b(%rip), %rdi      # 0x1d0ea
callq 0x131f2
leaq 0xbc1f5(%rip), %rdi     # 0xccf70
movl $0x100, %edx            # imm = 0x100
movq %rax, %rsi
callq 0xf384
cmpb $0x0, 0xbc1e1(%rip)     # 0xccf70
je 0x10db4
leaq 0xcd23(%rip), %rsi      # 0x1dabb
leaq 0xc35b(%rip), %rdx      # 0x1d0fa
leaq 0xbc1ca(%rip), %rcx     # 0xccf70
movl $0x2, %edi
xorl %eax, %eax
callq 0x1a3e3
jmp 0x10ddf
movabsq $0x6e776f6e6b6e55, %rax # imm = 0x6E776F6E6B6E55
movq %rax, 0xbc1ab(%rip)     # 0xccf70
leaq 0xccef(%rip), %rsi      # 0x1dabb
leaq 0xc33a(%rip), %rdx      # 0x1d10d
movl $0x1, %edi
xorl %eax, %eax
callq 0x1a3e3
cmpl $0x0, 0xbc17e(%rip)     # 0xccf64
je 0x10e24
movl 0xc048a(%rip), %eax     # 0xd1278
leal 0x1(%rax), %ecx
movl %ecx, 0xc0481(%rip)     # 0xd1278
cmpl $0x3d, %eax
jb 0x10e24
movl $0x0, 0xc0472(%rip)     # 0xd1278
movl $0x1, %edi
callq 0x14183
leaq 0xbc259(%rip), %rdi     # 0xcd070
movl $0x100, %edx            # imm = 0x100
movq %rax, %rsi
callq 0xf384
movl 0xbc126(%rip), %edi     # 0xccf50
testl %edi, %edi
je 0x10e51
movl 0x18c90(%rip), %eax     # 0x29ac4
leal 0x1(%rax), %ecx
movl %ecx, 0x18c87(%rip)     # 0x29ac4
cmpl $0x3d, %eax
jb 0x10e51
movl $0x0, 0x18c78(%rip)     # 0x29ac4
callq 0x11870
movl 0xbb861(%rip), %eax     # 0xcc6b8
testl %eax, %eax
je 0x10e7c
movl 0xc040f(%rip), %ecx     # 0xd1270
incl %ecx
movl %ecx, 0xc0407(%rip)     # 0xd1270
cmpl %eax, %ecx
jbe 0x10e7c
callq 0x1082f
movl $0x0, 0xc03f4(%rip)     # 0xd1270
xorl %eax, %eax
popq %rcx
retq