// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpl $0x0, 0xc0d3d(%rip)     # 0xd4f70
je 0x142ec
movl 0xc5045(%rip), %eax     # 0xd9284
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xc503a(%rip)     # 0xd9284
cmpl $0x3c, %eax
jbe 0x142ea
movl $0x0, 0xc5027(%rip)     # 0xd9284
leaq 0x10eae(%rip), %rdi     # 0x25112
callq 0x17720
movq %rax, %rsi
leaq 0xc0d0d(%rip), %rdi     # 0xd4f80
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
leaq 0xc0cfc(%rip), %rdi     # 0xd4f80
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x142b6
movl $0x2, %edi
leaq 0x1184c(%rip), %rsi     # 0x25aeb
leaq 0x10e7c(%rip), %rdx     # 0x25122
leaq 0xc0cd3(%rip), %rcx     # 0xd4f80
movb $0x0, %al
callq 0x21bf0
jmp 0x142e8
leaq 0xc0cc3(%rip), %rdi     # 0xd4f80
leaq 0x11747(%rip), %rsi     # 0x25a0b
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
movl $0x1, %edi
leaq 0x11811(%rip), %rsi     # 0x25aeb
leaq 0x10e54(%rip), %rdx     # 0x25135
movb $0x0, %al
callq 0x21bf0
jmp 0x142ea
jmp 0x142ec
cmpl $0x0, 0xc0c81(%rip)     # 0xd4f74
je 0x14335
movl 0xc4f8d(%rip), %eax     # 0xd9288
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0xc4f82(%rip)     # 0xd9288
cmpl $0x3c, %eax
jbe 0x14333
movl $0x0, 0xc4f73(%rip)     # 0xd9288
movl $0x1, %edi
callq 0x18de0
movq %rax, %rsi
leaq 0xc0d57(%rip), %rdi     # 0xd5080
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
jmp 0x14335
cmpl $0x0, 0xc0c24(%rip)     # 0xd4f60
je 0x1436b
movl 0x1d770(%rip), %eax     # 0x31ab4
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x1d765(%rip)     # 0x31ab4
cmpl $0x3c, %eax
jbe 0x14369
movl $0x0, 0x1d756(%rip)     # 0x31ab4
movl 0xc0bfc(%rip), %edi     # 0xd4f60
callq 0x151a0
jmp 0x1436b
xorl %eax, %eax
cmpl 0xc0355(%rip), %eax     # 0xd46c8
je 0x1439d
movl 0xc4f05(%rip), %eax     # 0xd9280
addl $0x1, %eax
movl %eax, 0xc4efc(%rip)     # 0xd9280
cmpl 0xc033e(%rip), %eax     # 0xd46c8
jbe 0x1439b
callq 0x13b30
movl $0x0, 0xc4ee5(%rip)     # 0xd9280
jmp 0x1439d
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)