LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/picladmin.c
// Function: cmdBotRespawn
int _cmdBotRespawn( char *arg, char *arg2, char *passThru ) 
{ 
    int errCode = 0;
    int resetType = 0;

    if ( 1 != sscanf( arg, "%d", &resetType ) ) {
        resetType = 0;
    }
    errCode = apiBotRespawn( resetType );

    apiSaySys( "Bots Respawned" );
    return errCode;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x10185(%rip), %rsi     # 0x1c0c5
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x82d0
cmpl $0x1, %eax
jne 0xbf54
movl 0xc(%rsp), %ebx
jmp 0xbf5c
movl $0x0, 0xc(%rsp)
movl %ebx, %edi
callq 0x1385d
movl %eax, %ebx
leaq 0x10193(%rip), %rdi     # 0x1c0ff
xorl %eax, %eax
callq 0x134e5
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/picladmin.c
// Function: cmdBotReset
int _cmdBotReset( char *arg, char *arg2, char *passThru ) 
{ 
    // signal pidynbots that picladmin (admins) reliquishes 
    // bot count and difficulty overrides.
    //
    p2pSetL( "picladmin.p2p.botAdminControlDifficulty", 0L );
    p2pSetL( "picladmin.p2p.botAdminControl", 0L );

    // signal pidynbots to force refresh bot configurations
    // if pidynbots plugin is not enabled, then ignore.
    //
    p2pSetL( "pidynbots.p2p.sigBotScaled", 1L );

    apiSaySys( "Bot Reset" );
    return 0;
}

// Assembly:
pushq %rax
leaq 0xfb28(%rip), %rdi      # 0x1baab
xorl %esi, %esi
callq 0x180a5
leaq 0xfad4(%rip), %rdi      # 0x1ba65
xorl %esi, %esi
callq 0x180a5
leaq 0xfae4(%rip), %rdi      # 0x1ba83
movl $0x1, %esi
callq 0x180a5
leaq 0x1015e(%rip), %rdi     # 0x1c10e
xorl %eax, %eax
callq 0x134e5
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/picladmin.c
// Function: picladminRoundEndCB
int picladminRoundEndCB( char *strIn )  
{
    if ( _queueReboot == REBOOT_EOR ) {
        _queueReboot = REBOOT_CANCEL;
        apiSaySys( "*Server is REBOOTING - please reconnect" );
        apiServerRestart( "Server Admin Reboot" );
    }
    return 0; 
}

// Assembly:
cmpl $0x1, 0x514fa(%rip)     # 0x5dd5c
jne 0xc88d
pushq %rax
movl $0x0, 0x514ed(%rip)     # 0x5dd5c
leaq 0xf2d4(%rip), %rdi      # 0x1bb4a
xorl %eax, %eax
callq 0x134e5
leaq 0xf2ee(%rip), %rdi      # 0x1bb72
callq 0x13062
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/picladmin.c
// Function: picladminGameEndCB
int picladminGameEndCB( char *strIn )  
{
    _resetP2PVars(); 
    if ( _queueReboot == REBOOT_EOG ) {
        _queueReboot = REBOOT_CANCEL;
        apiSaySys( "*Server is REBOOTING - please reconnect" );
        apiServerRestart( "Server Admin Reboot" );
    }
    return 0; 
}

// Assembly:
pushq %rax
callq 0xc8c7
cmpl $0x2, 0x514bf(%rip)     # 0x5dd5c
jne 0xc8c3
movl $0x0, 0x514b3(%rip)     # 0x5dd5c
leaq 0xf29a(%rip), %rdi      # 0x1bb4a
xorl %eax, %eax
callq 0x134e5
leaq 0xf2b4(%rip), %rdi      # 0x1bb72
callq 0x13062
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/picladmin.c
// Function: picladminPeriodicCB
int picladminPeriodicCB( char *strIn ) 
{ 
    if (( _rulesIndex != -1 ) && ( picladminConfig.rulesIntervalSec != 0) ) {
        if ( (++_rulesTickCount) >= picladminConfig.rulesIntervalSec ) {
            _rulesTickCount = 0;
            apiSaySys( picladminConfig.rulesInfo[ _rulesIndex++ ]);
            if ( _rulesIndex >= NUM_RULES ) _rulesIndex = -1;
        }
    }

    // Special condition when EOG/EOR reboot is queued but everybody logs off
    // before end of game/round.
    //
    if (( _queueReboot == REBOOT_EOG ) || ( _queueReboot == REBOOT_EOR )) {
       if ( 0 == apiPlayersGetCount() ) {
           _queueReboot = REBOOT_CANCEL;
           apiSaySys( "*Server is REBOOTING - please reconnect" );
           apiServerRestart( "Server Admin Reboot" );
       }
    }

    return 0; 
}

// Assembly:
pushq %rax
movslq 0x1cd9b(%rip), %rax     # 0x296b0
cmpq $-0x1, %rax
setne %dl
movl 0x5102e(%rip), %ecx     # 0x5d950
testl %ecx, %ecx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xc986
movl 0x51429(%rip), %edx     # 0x5dd60
incl %edx
movl %edx, 0x51421(%rip)     # 0x5dd60
cmpl %ecx, %edx
jl 0xc986
movl $0x0, 0x51413(%rip)     # 0x5dd60
leal 0x1(%rax), %ecx
movl %ecx, 0x1cd5a(%rip)     # 0x296b0
shlq $0xa, %rax
leaq 0x27fdf(%rip), %rcx     # 0x34940
leaq (%rax,%rcx), %rdi
addq $0x27c10, %rdi          # imm = 0x27C10
xorl %eax, %eax
callq 0x134e5
cmpl $0x5, 0x1cd36(%rip)     # 0x296b0
jl 0xc986
movl $0xffffffff, 0x1cd2a(%rip) # imm = 0xFFFFFFFF
movl 0x513d0(%rip), %eax     # 0x5dd5c
decl %eax
cmpl $0x1, %eax
ja 0xc9c0
callq 0x13853
testl %eax, %eax
jne 0xc9c0
movl $0x0, 0x513b6(%rip)     # 0x5dd5c
leaq 0xf19d(%rip), %rdi      # 0x1bb4a
xorl %eax, %eax
callq 0x134e5
leaq 0xf1b7(%rip), %rdi      # 0x1bb72
callq 0x13062
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/picladmin.c
// Function: commandParse
int _commandParse( char *strIn, int maxStringSize, char *clientGUID, char *cmdString  ) {
    char *w, *v;
    int guidType, parseError = 1;
    char prefixMatch[256];

    strclr( clientGUID );
    strclr( cmdString );

    // Look for start of chat text content 
    //
    strlcpy( prefixMatch, " Chat: ", 256 );       // build search pattern for start of msg
    strlcat( prefixMatch, picladminConfig.cmdPrefix, 256 );         // with command prefix
    w = strstr( strIn, prefixMatch );

    if ( w != NULL ) {
        if (0 != ( guidType = rosterFindFirstID( strIn, '(', ')', clientGUID, maxStringSize ))) {
            v = w + strlen( prefixMatch );
            strlcpy ( cmdString, v, maxStringSize );
            strTrimInPlace( cmdString );
            if (0 != strlen( cmdString )) parseError = 0;
        }
    }
    return parseError;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %ebp
movq %rdi, %r15
movq %rdx, %rdi
callq 0xf829
movq %rbx, %rdi
callq 0xf829
movabsq $0x203a7461684320, %rax # imm = 0x203A7461684320
movq %rsp, %r12
movq %rax, (%r12)
leaq 0x2b8b0(%rip), %rsi     # 0x38544
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
callq 0xf310
movq %r15, %rdi
movq %r12, %rsi
callq 0x83b0
movl $0x1, %r13d
testq %rax, %rax
je 0xcd01
movq %rax, %r12
movq %r15, %rdi
movl $0x28, %esi
movl $0x29, %edx
movq %r14, %rcx
movl %ebp, %r8d
callq 0x1441c
testl %eax, %eax
je 0xcd01
movq %rsp, %rdi
callq 0x8120
addq %rax, %r12
movslq %ebp, %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xf384
movq %rbx, %rdi
callq 0xf92f
xorl %r13d, %r13d
cmpb $0x0, (%rbx)
sete %r13b
movl %r13d, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/picladmin.c
// Function: commandParseFromRCON
int _commandParseFromRCON( char *strIn, int maxStringSize, char *clientGUID, char *cmdString  )
{
    int parseError = 1;
    char *u, *v, *w;

    strclr( clientGUID );
    strclr( cmdString );

    w = strstr( strIn, "<< " );
    if ( w != NULL ) {
        v = w + 3;
        if ( v[0] != 0 ) {
            if ( NULL != (u = strstr( v, picladminConfig.cmdPrefix ))) {
                if ( u == v ) {       // cmdPrefix is the first character of say string...
                    strlcpy( cmdString, u+strlen( picladminConfig.cmdPrefix ), maxStringSize );
                    strTrimInPlace( cmdString );
                    strlcpy( clientGUID, "00000000000000000", 1+RCONSTEAMIDSIZE );   // "root" ID
                    parseError = 0;
                    logPrintf( LOG_LEVEL_INFO, "picladmin", "RCON initiated command ::%s::[%s]::", strIn, cmdString );
                }
            }
        }
    }

    return parseError;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movl %esi, %ebp
movq %rdi, %r14
movq %rdx, %rdi
callq 0xf829
movq %rbx, %rdi
callq 0xf829
leaq 0xf97d(%rip), %rsi      # 0x1c6c0
movq %r14, %rdi
callq 0x83b0
movl $0x1, %r12d
testq %rax, %rax
je 0xcdde
movq %rax, %r13
cmpb $0x0, 0x3(%rax)
je 0xcdde
movl %ebp, 0x4(%rsp)
addq $0x3, %r13
leaq 0x2b7d2(%rip), %rsi     # 0x38544
movq %r13, %rdi
callq 0x83b0
cmpq %r13, %rax
jne 0xcdde
movq %rax, %rbp
leaq 0x2b7bb(%rip), %rdi     # 0x38544
callq 0x8120
addq %rax, %rbp
movslq 0x4(%rsp), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xf384
movq %rbx, %rdi
callq 0xf92f
movups 0xf914(%rip), %xmm0     # 0x1c6c4
movups %xmm0, (%r15)
movw $0x30, 0x10(%r15)
leaq 0xeebd(%rip), %rsi      # 0x1bc7f
leaq 0xf90d(%rip), %rdx      # 0x1c6d6
xorl %r12d, %r12d
movl $0x2, %edi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1a3e3
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/picladmin.c
// Function: picladminChatCB
int picladminChatCB( char *strIn )
{
    char clientGUID[1024], cmdString[1024];

    if ( 0 == _commandParse( strIn, 1024, clientGUID, cmdString )) {    // parse for valid format
        logPrintf( LOG_LEVEL_DEBUG, "picladmin-chatCB", "strin  ::%s::\n", strIn );
        logPrintf( LOG_LEVEL_DEBUG, "picladmin-chatCB", "parsed ::%s::%s::\n", clientGUID, cmdString );
        _commandExecute( cmdString, clientGUID ) ;                     // execute the command
    }

#if 0
    // pre-auth method using simple apiIsAdmin call - deprecated but left here for short term
    // just in case a revert is needed for test purposes.
    //
    if ( 0 == _commandParse( strIn, 1024, clientGUID, cmdString )) {    // parse for valid format
        if (apiIsAdmin( clientGUID )) {                                    // check if authorized
            _commandExecute( cmdString, clientGUID ) ;                     // execute the command
        }
        else  {
            _respSay( picladminConfig.msgInvalid );                       // unauthorized message
        }
    }
#endif

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x800, %rsp            # imm = 0x800
movq %rdi, %rbx
leaq 0x400(%rsp), %rdx
movq %rsp, %rcx
movl $0x400, %esi            # imm = 0x400
callq 0xcc50
testl %eax, %eax
jne 0xce6a
leaq 0xf8db(%rip), %r14      # 0x1c6fa
leaq 0xf8e5(%rip), %rdx      # 0x1c70b
movl $0x3, %edi
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1a3e3
leaq 0xf8db(%rip), %rdx      # 0x1c71a
leaq 0x400(%rsp), %rbx
movq %rsp, %r15
movl $0x3, %edi
movq %r14, %rsi
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x1a3e3
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc9f0
xorl %eax, %eax
addq $0x800, %rsp            # imm = 0x800
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pitacnomic.c
// Function: pitacnomicInitConfig
int pitacnomicInitConfig( void )
{
    cfsPtr cP;
    int i;
    char varArray[CFS_FETCH_MAX];

    cP = cfsCreate( sissmGetConfigPath() );

    // read "pitacnommic.pluginstate" variable from the .cfg file
    pitacnomicConfig.pluginState = (int) cfsFetchNum( cP, "pitacnomic.pluginState", 0.0 );  // disabled by default

    // Read the operator-specified "macro" (alias) sequence
    //
    for ( i=0; i<PITACNOMIC_MAXSHORTS; i++ ) {
        snprintf( varArray, 256, "pitacnomic.shorts[%d]", i );
        strlcpy( pitacnomicConfig.shorts[i],     cfsFetchStr( cP, varArray,  "" ),   CFS_FETCH_MAX);
        replaceDoubleColonWithBell( pitacnomicConfig.shorts[i] );
    }

    // Read the list string of two-letter-codes that only 'live' players can issue
    //
    strlcpy( pitacnomicConfig.livePlayersOnly, cfsFetchStr( cP, "pitacnomic.livePlayersOnly",  "" ),   CFS_FETCH_MAX);

    cfsDestroy( cP );
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
callq 0x8970
movq %rax, %rdi
callq 0x8ffc
movq %rax, %rbx
leaq 0xf74a(%rip), %rsi      # 0x1c77e
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x51026(%rip)     # 0x5e070
leaq 0x51023(%rip), %r14     # 0x5e074
leaq 0xf73d(%rip), %r15      # 0x1c795
movq %rsp, %r12
leaq 0xe6a7(%rip), %r13      # 0x1b709
xorl %ebp, %ebp
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
movq %r15, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x8190
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x9073
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0xf384
movq %r14, %rdi
callq 0xfb4a
incq %rbp
addq $0x400, %r14            # imm = 0x400
cmpq $0x64, %rbp
jne 0xd064
leaq 0xf6f6(%rip), %rsi      # 0x1c7ab
leaq 0xe64d(%rip), %rdx      # 0x1b709
movq %rbx, %rdi
callq 0x9073
leaq 0x69fa9(%rip), %rdi     # 0x77074
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
movq %rbx, %rdi
callq 0x9054
xorl %eax, %eax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/events.c
// Function: eventsRegister
int eventsRegister( int eventID, int (*callBack)( char * ))
{
    int i, j, callBackIndex = -1, errCode = 1;

    // Translate the eventID to callBackTable index
    // 
    for ( i=0; i<SISSM_MAXEVENTS; i++ ) {
        if ( 0 == strcmp( eventTable[ i ].eventString, "*" ))  {
            break;
        }
        if ( eventTable[ i ].eventID == eventID ) {
            callBackIndex = eventTable[ i ].callBacktableIndex;
            break;          
        }
    }

    // Insert callback function pointer to the first non-null slot
    // in the 'eventsCallbackFunctions' table
    //
    if ( callBackIndex != -1 ) {
        for ( j=0; j<SISSM_MAXPLUGINS ; j++ ) {
            if ( eventsCallbackFunctions[callBackIndex][j] == NULL) {
                eventsCallbackFunctions[callBackIndex][j] = callBack;
                errCode = 0;
                break;
            }
        }
    }
    return errCode;
}

// Assembly:
xorl %eax, %eax
leaq 0x1c2ab(%rip), %rcx     # 0x296c0
movq 0x8(%rax,%rcx), %rdx
cmpb $0x2a, (%rdx)
jne 0xd425
cmpb $0x0, 0x1(%rdx)
je 0xd436
cmpl %edi, (%rax,%rcx)
je 0xd43c
addq $0x10, %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0xd415
movl $0x1, %eax
retq
movslq 0x4(%rax,%rcx), %rcx
movl $0x1, %eax
cmpq $-0x1, %rcx
je 0xd46d
shlq $0x9, %rcx
xorl %edx, %edx
leaq 0x6a027(%rip), %rdi     # 0x77480
leaq (%rcx,%rdx,8), %r8
cmpq $0x0, (%rdi,%r8)
je 0xd46e
incq %rdx
cmpq $0x20, %rdx
jne 0xd459
retq
addq %rcx, %rdi
movq %rsi, (%rdi,%rdx,8)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/events.c
// Function: eventsUnRegister
int eventsUnRegister( int eventID, int (*callBack)( char * ))
{
    int i, j, callBackIndex = -1, errCode = 1;

    // Translate the eventID to callBackTable index
    // 
    for ( i=0; i<SISSM_MAXEVENTS; i++ ) {
        if ( 0 == strcmp( eventTable[ i ].eventString, "*" ))  {
            break;
        }
        if ( eventTable[ i ].eventID == eventID ) {
            callBackIndex = eventTable[ i ].callBacktableIndex;
            break;          
        }
    }

    // Remove active callBack vecotors from the events callback table. 
    // While this should not occur, this loop remove duplicate registration, 
    // if any, as a code safety. 
    //
    if ( callBackIndex != -1 ) {
        for ( j=0; j<SISSM_MAXPLUGINS ; j++ ) {
            if ( eventsCallbackFunctions[callBackIndex][j] == callBack) {
                eventsCallbackFunctions[callBackIndex][j] = NULL;
                errCode = 0;
            }
        }
    }

    return errCode;
}

// Assembly:
xorl %eax, %eax
leaq 0x1c23f(%rip), %rcx     # 0x296c0
movq 0x8(%rax,%rcx), %rdx
cmpb $0x2a, (%rdx)
jne 0xd491
cmpb $0x0, 0x1(%rdx)
je 0xd4ea
cmpl %edi, (%rax,%rcx)
je 0xd4a4
addq $0x10, %rax
cmpq $0x400, %rax            # imm = 0x400
jne 0xd481
jmp 0xd4ea
movslq 0x4(%rax,%rcx), %rcx
cmpq $-0x1, %rcx
je 0xd4ea
shlq $0x9, %rcx
movl $0x1, %eax
xorl %edx, %edx
leaq 0x69fbf(%rip), %rdi     # 0x77480
leaq (%rcx,%rdx,8), %r8
cmpq %rsi, (%rdi,%r8)
jne 0xd4e0
leaq (,%rdx,8), %rax
addq %rcx, %rax
movq $0x0, (%rdi,%rax)
xorl %eax, %eax
incq %rdx
cmpq $0x20, %rdx
jne 0xd4c1
retq
movl $0x1, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/events.c
// Function: eventsDispatch
int eventsDispatch( char *strBuffer )
{
    int i, j;
    int activeCallBackIndex = -1;

    for (i=0; i<SISSM_MAXEVENTS; i++) { 
     
        if ( 0 == strlen( eventTable[i].eventString )) 
            continue; 
        if ( 0 == strcmp( eventTable[i].eventString, "*" )) 
            break;

        if ( NULL != strstr( strBuffer, eventTable[i].eventString ) ) {
            activeCallBackIndex = eventTable[i].callBacktableIndex;
            if ( activeCallBackIndex >= 0 ) {
                for (j=0; j<SISSM_MAXPLUGINS; j++) {
                    if ( NULL != eventsCallbackFunctions[activeCallBackIndex][j] ) {
                         (*eventsCallbackFunctions[activeCallBackIndex][j])( strBuffer );
                    }
                }
            }
            break;
        }
        if (0==strcmp( "*", eventTable[i].eventString )) break;
    }
    return activeCallBackIndex;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
leaq 0x1c1c1(%rip), %r15     # 0x296c8
movq (%r15), %r14
movzbl (%r14), %r12d
testl %r12d, %r12d
je 0xd538
cmpl $0x2a, %r12d
jne 0xd53f
cmpb $0x0, 0x1(%r14)
je 0xd56f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x83b0
testq %rax, %rax
jne 0xd577
movb 0x1(%r14), %r12b
xorl %eax, %eax
jmp 0xd554
cmpl $0x3e, %ebp
jbe 0xd567
jmp 0xd56f
movq %rbx, %rdi
movq %r14, %rsi
callq 0x83b0
testq %rax, %rax
jne 0xd577
movl $0x2a, %eax
movzbl %r12b, %ecx
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpl %ecx, %eax
je 0xd5ad
cmpl $0x3f, %ebp
jae 0xd5ad
incl %ebp
addq $0x10, %r15
jmp 0xd507
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
jmp 0xd5ad
movslq -0x4(%r15), %r14
testq %r14, %r14
js 0xd5ad
movq %r14, %r15
shlq $0x9, %r15
xorl %r12d, %r12d
leaq 0x69eef(%rip), %r13     # 0x77480
leaq (%r15,%r12,8), %rax
movq (%r13,%rax), %rax
testq %rax, %rax
je 0xd5a4
movq %rbx, %rdi
callq *%rax
incq %r12
cmpq $0x20, %r12
jne 0xd591
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pirebooter.c
// Function: pirebooterInitCB
int pirebooterInitCB( char *strIn )
{
    pirebooterConfig.timeLastReboot = apiTimeGet();
    pirebooterConfig.timeLastProgress = apiTimeGet();
    pirebooterConfig.timeFirstIdle  = 0;

    return 0;
}

// Assembly:
pushq %rax
callq 0x117c0
movq %rax, 0x6e0e9(%rip)     # 0x7b8b0
callq 0x117c0
movq %rax, 0x6e0ed(%rip)     # 0x7b8c0
movq $0x0, 0x6e0da(%rip) # 0x7b8b8
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pirebooter.c
// Function: pirebooterGameStartCB
int pirebooterGameStartCB( char *strIn )
{
    pirebooterConfig.timeFirstIdle  = 0;
    pirebooterConfig.timeLastProgress = apiTimeGet();

    // Sometimes the server does not appear to generate the End of Game event.
    // This is a duplicate code (see pirebooterGameEndCB) as a 2nd trap
    // to make sure server gets rebooted.
    // 
    if (( pirebooterConfig.timeLastReboot + pirebooterConfig.rebootBusySec ) < apiTimeGet() ) {
        pirebooterConfig.timeLastReboot   = apiTimeGet();
        pirebooterConfig.timeFirstIdle    = 0L;
        pirebooterConfig.timeLastProgress = apiTimeGet();
        logPrintf( LOG_LEVEL_INFO, "pirebooter", "Reboot due to BUSY timer" );
        apiServerRestart( "Uptime Limit Reboot" );     // since the server is empty, reboot right away
    }
    return 0;
}

// Assembly:
pushq %rbx
movq $0x0, 0x6e0ab(%rip) # 0x7b8b8
callq 0x117c0
movq %rax, 0x6e0a7(%rip)     # 0x7b8c0
movq 0x6dc70(%rip), %rbx     # 0x7b490
addq 0x6e089(%rip), %rbx     # 0x7b8b0
callq 0x117c0
cmpq %rax, %rbx
jae 0xd87a
callq 0x117c0
movq %rax, 0x6e073(%rip)     # 0x7b8b0
movq $0x0, 0x6e070(%rip) # 0x7b8b8
callq 0x117c0
movq %rax, 0x6e06c(%rip)     # 0x7b8c0
leaq 0xf40e(%rip), %rsi      # 0x1cc69
leaq 0xf412(%rip), %rdx      # 0x1cc74
movl $0x2, %edi
xorl %eax, %eax
callq 0x1a3e3
leaq 0xf418(%rip), %rdi      # 0x1cc8d
callq 0x13062
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pirebooter.c
// Function: pirebooterGameEndCB
int pirebooterGameEndCB( char *strIn )
{
    pirebooterConfig.timeFirstIdle  = 0L;
    pirebooterConfig.timeLastProgress = apiTimeGet();

    // Check if the server has been running long, and reboot only at
    // end-of-game to be least intrusive.
    // 
    if (( !pirebooterConfig.rebootOnEOR )) {   // check if reboot is at end of round or end of game
        if (( pirebooterConfig.timeLastReboot + pirebooterConfig.rebootBusySec ) < apiTimeGet() ) {
            pirebooterConfig.timeLastReboot = apiTimeGet();
            pirebooterConfig.timeFirstIdle  = 0L;
            pirebooterConfig.timeLastProgress = apiTimeGet();
            logPrintf( LOG_LEVEL_INFO, "pirebooter", "Reboot due to BUSY timer" );
            apiServerRestart( "Uptime Limit Reboot" );     // since the server is empty, reboot right away
        }
    }

    return 0;
}

// Assembly:
pushq %rbx
movq $0x0, 0x6e02e(%rip) # 0x7b8b8
callq 0x117c0
movq %rax, 0x6e02a(%rip)     # 0x7b8c0
cmpq $0x0, 0x6e00a(%rip)     # 0x7b8a8
jne 0xd901
movq 0x6dbe9(%rip), %rbx     # 0x7b490
addq 0x6e002(%rip), %rbx     # 0x7b8b0
callq 0x117c0
cmpq %rax, %rbx
jae 0xd901
callq 0x117c0
movq %rax, 0x6dfec(%rip)     # 0x7b8b0
movq $0x0, 0x6dfe9(%rip) # 0x7b8b8
callq 0x117c0
movq %rax, 0x6dfe5(%rip)     # 0x7b8c0
leaq 0xf387(%rip), %rsi      # 0x1cc69
leaq 0xf38b(%rip), %rdx      # 0x1cc74
movl $0x2, %edi
xorl %eax, %eax
callq 0x1a3e3
leaq 0xf391(%rip), %rdi      # 0x1cc8d
callq 0x13062
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pirebooter.c
// Function: pirebooterRoundStartCB
int pirebooterRoundStartCB( char *strIn )
{
    pirebooterConfig.timeFirstIdle  = 0L;
    pirebooterConfig.timeLastProgress = apiTimeGet();

    if (( pirebooterConfig.timeLastReboot + pirebooterConfig.rebootBusySec ) < apiTimeGet() )
	apiSaySys( pirebooterConfig.rebootWarning );

    return 0;
}

// Assembly:
pushq %rbx
movq $0x0, 0x6dfa7(%rip) # 0x7b8b8
callq 0x117c0
movq %rax, 0x6dfa3(%rip)     # 0x7b8c0
movq 0x6db6c(%rip), %rbx     # 0x7b490
addq 0x6df85(%rip), %rbx     # 0x7b8b0
callq 0x117c0
cmpq %rax, %rbx
jae 0xd943
leaq 0x6df8c(%rip), %rdi     # 0x7b8c8
xorl %eax, %eax
callq 0x134e5
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pirebooter.c
// Function: pirebooterRoundEndCB
int pirebooterRoundEndCB( char *strIn )
{
    pirebooterConfig.timeLastProgress = apiTimeGet();
    pirebooterConfig.timeFirstIdle  = 0L;

    // If the option is enabled to reboot at end-of-round instead of end-of-game,
    // this block of code will execute.
    //
    if (( pirebooterConfig.rebootOnEOR )) {
        if (( pirebooterConfig.timeLastReboot + pirebooterConfig.rebootBusySec ) < apiTimeGet() ) {
            pirebooterConfig.timeLastReboot   = apiTimeGet();
            pirebooterConfig.timeFirstIdle    = 0L;
            pirebooterConfig.timeLastProgress = apiTimeGet();
            logPrintf( LOG_LEVEL_INFO, "pirebooter", "Reboot EOR due to BUSY timer" );
            apiServerRestart( "Uptime Limit Reboot" );     // since the server is empty, reboot right away
        }
    }
    return 0;
}

// Assembly:
pushq %rbx
callq 0x117c0
movq %rax, 0x6df6c(%rip)     # 0x7b8c0
movq $0x0, 0x6df59(%rip) # 0x7b8b8
cmpq $0x0, 0x6df41(%rip)     # 0x7b8a8
je 0xd9ca
movq 0x6db20(%rip), %rbx     # 0x7b490
addq 0x6df39(%rip), %rbx     # 0x7b8b0
callq 0x117c0
cmpq %rax, %rbx
jae 0xd9ca
callq 0x117c0
movq %rax, 0x6df23(%rip)     # 0x7b8b0
movq $0x0, 0x6df20(%rip) # 0x7b8b8
callq 0x117c0
movq %rax, 0x6df1c(%rip)     # 0x7b8c0
leaq 0xf2be(%rip), %rsi      # 0x1cc69
leaq 0xf2ef(%rip), %rdx      # 0x1cca1
movl $0x2, %edi
xorl %eax, %eax
callq 0x1a3e3
leaq 0xf2c8(%rip), %rdi      # 0x1cc8d
callq 0x13062
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pirebooter.c
// Function: pirebooterCapturedCB
int pirebooterCapturedCB( char *strIn )
{
    static unsigned long lastTime = 0L;

    pirebooterConfig.timeLastProgress = apiTimeGet();
    pirebooterConfig.timeFirstIdle  = 0L;
    
    if (( pirebooterConfig.timeLastReboot + pirebooterConfig.rebootBusySec ) < apiTimeGet() ) {
	if ( (lastTime + 10L) < apiTimeGet() ) {
	    lastTime = apiTimeGet();
	    apiSaySys( pirebooterConfig.rebootWarning );
	}
    }
    return 0;
}

// Assembly:
pushq %rbx
callq 0x117c0
movq %rax, 0x6dee5(%rip)     # 0x7b8c0
movq $0x0, 0x6ded2(%rip) # 0x7b8b8
movq 0x6daa3(%rip), %rbx     # 0x7b490
addq 0x6debc(%rip), %rbx     # 0x7b8b0
callq 0x117c0
cmpq %rax, %rbx
jae 0xda2d
movq 0x6e6c3(%rip), %rbx     # 0x7c0c8
addq $0xa, %rbx
callq 0x117c0
cmpq %rax, %rbx
jae 0xda2d
callq 0x117c0
movq %rax, 0x6e6a9(%rip)     # 0x7c0c8
leaq 0x6dea2(%rip), %rdi     # 0x7b8c8
xorl %eax, %eax
callq 0x134e5
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pirebooter.c
// Function: pirebooterActivityCB
int pirebooterActivityCB( char *strIn )
{
    if ( NULL != strstr( strIn, " killed " ) ) {
        if ( NULL != strstr( strIn, " with " ) ) {
            pirebooterConfig.timeLastProgress = apiTimeGet();
        }
    }
    return 0;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
leaq 0x10fba(%rip), %rsi     # 0x1e9f6
callq 0x83b0
testq %rax, %rax
je 0xda66
leaq 0x10fcd(%rip), %rsi     # 0x1ea1a
movq %rbx, %rdi
callq 0x83b0
testq %rax, %rax
je 0xda66
callq 0x117c0
movq %rax, 0x6de5a(%rip)     # 0x7b8c0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pirebooter.c
// Function: pirebooterInstallPlugin
int pirebooterInstallPlugin( void )
{
    // Read the plugin-specific variables from the .cfg file 
    // 
    pirebooterInitConfig();

    // if plugin is disabled in the .cfg file then do not activate
    //
    if ( pirebooterConfig.pluginState == 0 ) return 0;

    // Install Event-driven CallBack hooks so the plugin gets
    // notified for various happenings.  A complete list is here,
    // but comment out what is not needed for your plug-in.
    // 
    eventsRegister( SISSM_EV_CLIENT_ADD,           pirebooterClientAddCB );
    eventsRegister( SISSM_EV_CLIENT_DEL,           pirebooterClientDelCB );
    eventsRegister( SISSM_EV_INIT,                 pirebooterInitCB );
    eventsRegister( SISSM_EV_RESTART,              pirebooterRestartCB );
    eventsRegister( SISSM_EV_MAPCHANGE,            pirebooterMapChangeCB );
    eventsRegister( SISSM_EV_GAME_START,           pirebooterGameStartCB );
    eventsRegister( SISSM_EV_GAME_END,             pirebooterGameEndCB );
    eventsRegister( SISSM_EV_ROUND_START,          pirebooterRoundStartCB );
    eventsRegister( SISSM_EV_ROUND_END,            pirebooterRoundEndCB );
    eventsRegister( SISSM_EV_OBJECTIVE_CAPTURED,   pirebooterCapturedCB );
    eventsRegister( SISSM_EV_PERIODIC,             pirebooterPeriodicCB );
    eventsRegister( SISSM_EV_SHUTDOWN,             pirebooterShutdownCB );
    eventsRegister( SISSM_EV_ACTIVITY,             pirebooterActivityCB );

    return 0;
}

// Assembly:
pushq %rax
callq 0xd5c0
cmpl $0x0, 0x6d6a4(%rip)     # 0x7b480
je 0xdebf
leaq -0x64b(%rip), %rsi      # 0xd79e
movl $0x3, %edi
callq 0xd40c
leaq -0x64e(%rip), %rsi      # 0xd7ac
movl $0x4, %edi
callq 0xd40c
leaq -0x651(%rip), %rsi      # 0xd7ba
movl $0x1, %edi
callq 0xd40c
leaq -0x63a(%rip), %rsi      # 0xd7e2
movl $0x2, %edi
callq 0xd40c
leaq -0x648(%rip), %rsi      # 0xd7e5
movl $0x5, %edi
callq 0xd40c
leaq -0x63d(%rip), %rsi      # 0xd801
movl $0x6, %edi
callq 0xd40c
leaq -0x5d1(%rip), %rsi      # 0xd87e
movl $0x7, %edi
callq 0xd40c
leaq -0x55b(%rip), %rsi      # 0xd905
movl $0x8, %edi
callq 0xd40c
leaq -0x52a(%rip), %rsi      # 0xd947
movl $0x9, %edi
callq 0xd40c
leaq -0x4b4(%rip), %rsi      # 0xd9ce
movl $0xa, %edi
callq 0xd40c
leaq -0x40d(%rip), %rsi      # 0xda86
movl $0xb, %edi
callq 0xd40c
leaq -0x43a(%rip), %rsi      # 0xda6a
movl $0xe, %edi
callq 0xd40c
leaq -0x484(%rip), %rsi      # 0xda31
movl $0x1c, %edi
callq 0xd40c
xorl %eax, %eax
popq %rcx
retq
nop
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/piprotect.c
// Function: piprotectDetectedCB
int piprotectDetectedCB( char *strIn )
{
    if ( errPlayerCount < PIPROTECT_MAXNUMNAMES ) {
        if ( NULL != strstr( strIn, PIPROTECTERRMATCH1 )) {
            strlcpy( errPlayerName[ errPlayerCount ], &strIn[nameCharOffset1], PIPROTECT_MAXNAMESIZE );
            strClean( errPlayerName[ errPlayerCount ] );
            strTrimInPlace( errPlayerName[ errPlayerCount++ ] );
            logPrintf( LOG_LEVEL_WARN, "piprotect", "Connect DetectedCB#1 ::%s::%d::",  errPlayerName[ errPlayerCount-1 ], errPlayerCount-1 );
        }
        else if ( NULL != strstr( strIn, PIPROTECTERRMATCH2 ) ) {
            strlcpy( errPlayerName[ errPlayerCount ], &strIn[nameCharOffset2], PIPROTECT_MAXNAMESIZE );
            strClean( errPlayerName[ errPlayerCount ] );
            strTrimInPlace( errPlayerName[ errPlayerCount++ ] );
            logPrintf( LOG_LEVEL_WARN, "piprotect", "Connect DetectedCB#2 ::%s::%d::",  errPlayerName[ errPlayerCount-1 ], errPlayerCount-1 );
        }
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movslq 0xb3d5e(%rip), %r15     # 0xc2d34
cmpq $0x1f, %r15
jg 0xf0c1
movq %rdi, %r14
leaq 0xe39d(%rip), %rsi      # 0x1d387
callq 0x83b0
testq %rax, %rax
je 0xf009
leaq 0xe3a7(%rip), %rbx      # 0x1d3a2
movl $0x4f, %eax
leaq 0xb4739(%rip), %rcx     # 0xc3740
jmp 0xf034
leaq 0xe3b2(%rip), %rsi      # 0x1d3c2
movq %r14, %rdi
callq 0x83b0
testq %rax, %rax
je 0xf0c1
leaq 0xe3b3(%rip), %rbx      # 0x1d3db
movl $0x4d, %eax
leaq 0xb4710(%rip), %rcx     # 0xc3744
leaq (%r15,%r15,4), %rdi
shlq $0x4, %rdi
leaq 0xb3cfd(%rip), %r15     # 0xc2d40
addq %r15, %rdi
xorl %edx, %edx
cmpb $0x0, (%rcx)
cmoveq %rdx, %rax
addq %rax, %r14
movl $0x50, %edx
movq %r14, %rsi
callq 0xf384
movslq 0xb3cce(%rip), %rax     # 0xc2d34
leaq (%rax,%rax,4), %rdi
shlq $0x4, %rdi
addq %r15, %rdi
callq 0xf9a9
movslq 0xb3cb7(%rip), %rax     # 0xc2d34
leal 0x1(%rax), %ecx
movl %ecx, 0xb3cae(%rip)     # 0xc2d34
leaq (%rax,%rax,4), %rdi
shlq $0x4, %rdi
addq %r15, %rdi
callq 0xf92f
movslq 0xb3c97(%rip), %r8      # 0xc2d34
decq %r8
leaq (%r8,%r8,4), %rcx
shlq $0x4, %rcx
addq %r15, %rcx
leaq 0xe1b8(%rip), %rsi      # 0x1d26a
movl $0x1, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1a3e3
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/piprotect.c
// Function: piprotectPeriodicCB
int piprotectPeriodicCB( char *strIn )
{
    int i, j = 0;
    static char kickName[ PIPROTECT_MAXNAMESIZE ];

    // logPrintf( LOG_LEVEL_WARN, "piprotect", "PERIODIC in counterattack %d", apiIsCounterAttack() );

    // Step 0:  Init
    //
    strclr( kickName );

    // Step 1:  analyze the table 
    //
    if ( errPlayerCount > piprotectConfig.countThreshold ) {

        // get the first name from the list
        strlcpy( kickName, errPlayerName[0], PIPROTECT_MAXNAMESIZE );

        // loop through all stored names and count the matches
        for (i = 1; i<errPlayerCount; i++ ) {

            // match counter
            if (0 == strcmp( errPlayerName[i], kickName )) j++;
            // if crash is imminent, break for the next phase (kick)
            if (j > piprotectConfig.countThreshold)        break;
        }
    }

    // Step 2:  kick bad connectors, if any
    //
    if ( j > piprotectConfig.countThreshold ) {
        apiKick( kickName, piprotectConfig.kickReason );
        logPrintf( LOG_LEVEL_WARN, "piprotect", "**System internal error - protective kick by name ::%s::", kickName );
    }

    // Step 3:  reset the analysis table
    //
    errPlayerCount  = 0;

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0xb4678(%rip), %rdi     # 0xc3750
callq 0xf829
movl 0x95844(%rip), %r15d    # 0xa4928
xorl %ebp, %ebp
cmpl %r15d, 0xb3c47(%rip)    # 0xc2d34
jle 0xf154
leaq 0xb465a(%rip), %rdi     # 0xc3750
leaq 0xb3c43(%rip), %rsi     # 0xc2d40
movl $0x50, %edx
callq 0xf384
movslq 0xb3c26(%rip), %r12     # 0xc2d34
movl 0x95813(%rip), %r15d    # 0xa4928
cmpq $0x2, %r12
jl 0xf154
addq $-0x2, %r12
xorl %ebp, %ebp
leaq 0xb3c68(%rip), %rbx     # 0xc2d90
leaq 0xb4621(%rip), %r14     # 0xc3750
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8220
cmpl $0x1, %eax
adcl $0x0, %ebp
subq $0x1, %r12
setb %al
cmpl %r15d, %ebp
jg 0xf154
addq $0x50, %rbx
testb %al, %al
je 0xf12f
cmpl %r15d, %ebp
jle 0xf18c
leaq 0xb45f0(%rip), %rbx     # 0xc3750
leaq 0x957c9(%rip), %rsi     # 0xa4930
movq %rbx, %rdi
callq 0x13789
leaq 0xe0f4(%rip), %rsi      # 0x1d26a
leaq 0xe27e(%rip), %rdx      # 0x1d3fb
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1a3e3
movl $0x0, 0xb3b9e(%rip)     # 0xc2d34
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/piprotect.c
// Function: piprotect_fakeMain
void piprotect_fakeMain( void )
{
    int i;
    char strIn[255];

    // init sim
    nameCharOffset1 = (int) strlen( PIPROTECTERRMSG1 ) + 1;
    nameCharOffset2 = (int) strlen( PIPROTECTERRMSG2 ) + 1;

    blackOutCounter = 0;
    errPlayerCount  = 0;

    for ( i = 0; i<PIPROTECT_MAXNUMNAMES; i++ )
        strclr( errPlayerName[ i ] );

    piprotectConfig.pluginState = 1;
    piprotectConfig.countThreshold = 3;
    piprotectConfig.blackoutWindowSec = 3;

    strcpy(piprotectConfig.kickReason, "test" );

    // run

    for (i = 0; i<1000; i++ ) {
        strcpy( strIn, "[2022.05.28-02.26.24:185][ 38]LogGameMode: Verbose: RestartPlayerAtPlayerStart testPlayerName" );
        piprotectDetectedCB( strIn );
        strcpy( strIn, "[2022.06.04-20.54.13:643][ 48]LogGameMode: Verbose: RestartPlayerAtTransform testPlayerName" );
        piprotectDetectedCB( strIn );
    }
    piprotectPeriodicCB( strIn );
    piprotectPeriodicCB( strIn );
    piprotectPeriodicCB( strIn );
 
    return;

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movb $0x1, %al
movb %al, 0xb44f2(%rip)      # 0xc3740
movb %al, 0xb44f0(%rip)      # 0xc3744
movl $0x0, 0xb3ad6(%rip)     # 0xc2d34
xorl %ebx, %ebx
leaq 0xb3ad9(%rip), %r14     # 0xc2d40
leaq (%r14,%rbx), %rdi
callq 0xf829
addq $0x50, %rbx
cmpq $0xa00, %rbx            # imm = 0xA00
jne 0xf267
movl $0x1, 0x95699(%rip)     # 0xa4920
movabsq $0x300000003, %rax      # imm = 0x300000003
movq %rax, 0x95690(%rip)     # 0xa4928
movl $0x74736574, 0x9568e(%rip) # imm = 0x74736574
movb $0x0, 0x9568b(%rip)     # 0xa4934
movl $0x3e8, %ebp            # imm = 0x3E8
leaq 0xe184(%rip), %rbx      # 0x1d439
movq %rsp, %r14
leaq 0xe1d8(%rip), %r15      # 0x1d497
movl $0x5e, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8290
movq %r14, %rdi
callq 0xefca
movl $0x5c, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x8290
movq %r14, %rdi
callq 0xefca
decl %ebp
jne 0xf2bf
callq 0xf0c9
callq 0xf0c9
callq 0xf0c9
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/bsd.c
// Function: strlcat
size_t
strlcat(char *dst, const char *src, size_t siz)
{
        char *d = dst;
        const char *s = src;
        size_t n = siz;
        size_t dlen;

        /* Find the end of dst and adjust bytes left but don't go past end */
        while (n-- != 0 && *d != '\0')
                d++;
        dlen = d - dst;
        n = siz - dlen;

        if (n == 0)
                return(dlen + strlen(s));
        while (*s != '\0') {
                if (n != 1) {
                        *d++ = *s;
                        n--;
                }
                s++;
        }
        *d = '\0';

        return(dlen + (s - src));        /* count does not include NUL */
}

// Assembly:
pushq %rbx
movq %rdi, %rcx
testq %rdx, %rdx
je 0xf333
leaq (%rdi,%rdx), %rax
movq %rdx, %r8
movq %rdi, %rcx
cmpb $0x0, (%rcx)
je 0xf333
incq %rcx
decq %r8
jne 0xf323
movq %rax, %rcx
movq %rcx, %rbx
subq %rdi, %rbx
subq %rbx, %rdx
je 0xf377
movb (%rsi), %dil
movq %rsi, %rax
testb %dil, %dil
je 0xf36f
movl $0x1, %r8d
cmpq $0x1, %rdx
jne 0xf35a
movq %r8, %rdx
jmp 0xf363
movb %dil, (%rcx)
incq %rcx
decq %rdx
movb 0x1(%rax), %dil
incq %rax
testb %dil, %dil
jne 0xf34f
movb $0x0, (%rcx)
subq %rsi, %rax
jmp 0xf37f
movq %rsi, %rdi
callq 0x8120
addq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/ftrack.c
// Function: ftrackGetFilename
static int ftrackGetFilename( int fp, char *fileName )
{
    int     errCode = 1;
    char    proclnk[0x0fff];
    int     fNumber;
    ssize_t sizeName;

    strclr( fileName );
    // ssize_t r;
    if ( fp != -1 ) {
        errCode = 0;
        fNumber = fp;
        snprintf(proclnk, 0x0fff, "/proc/self/fd/%d", fNumber);
        sizeName = readlink(proclnk, fileName, 0x0fff);
        if ( sizeName > 0 ) {
            errCode = 0;
            fileName[ sizeName ] = 0;
        }
    }
    return( errCode );
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %rbx
movl %edi, %r14d
movq %rsi, %rdi
callq 0xf829
cmpl $-0x1, %r14d
je 0xf4c2
leaq 0xe14e(%rip), %rdx      # 0x1d5de
xorl %ebp, %ebp
movq %rsp, %r15
movl $0xfff, %esi            # imm = 0xFFF
movq %r15, %rdi
movl %r14d, %ecx
xorl %eax, %eax
callq 0x8190
movl $0xfff, %edx            # imm = 0xFFF
movq %r15, %rdi
movq %rbx, %rsi
callq 0x80e0
testq %rax, %rax
jle 0xf4c7
movb $0x0, (%rbx,%rax)
jmp 0xf4c7
movl $0x1, %ebp
movl %ebp, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/ftrack.c
// Function: _ftrack_main
int __ftrack_main()
{
    ftrackObj *ftp;
    int stat;
    char strBuffer[1024];

    logPrintfInit( LOG_LEVEL_RAWDUMP, "zzz_delme.log", 1 );


    // ftp = ftrackOpen( "zzz_test.txt" );
    ftp = ftrackOpen( "C:/Program Files (x86)/Steam/steamapps/common/sandstorm_server/Insurgency/Saved/Logs/Insurgency.log" );

    if ( ftp == NULL ) {
        printf("\nOpen error\n");
        exit( 1 );
    }

    while ( 1 == 1 ) {
        stat = ftrackTailOfFile( ftp, strBuffer, 1024, 0 );
        if ( stat == 0 ) {
            printf("\n::%ld::%s::\n", _ftrackGetFileSize(ftp), strBuffer );
        }
        else {
            ftrackResync( ftp );
            usleep( 100000 );
        }
        
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x490, %rsp            # imm = 0x490
leaq 0xde6f(%rip), %rsi      # 0x1d55e
movl $0x4, %edi
movl $0x1, %edx
callq 0x1a3b8
leaq 0xde67(%rip), %rdi      # 0x1d56c
callq 0xf3d0
testq %rax, %rax
je 0xf789
movq %rax, %rbx
leaq 0x90(%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
xorl %ecx, %ecx
callq 0xf630
movq %rbx, %r15
addq $0x404, %r15            # imm = 0x404
movq %rsp, %r12
leaq 0xde90(%rip), %r13      # 0x1d5d0
testl %eax, %eax
je 0xf758
movq %rbx, %rdi
callq 0xf4fe
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x83f0
jmp 0xf775
movq %r15, %rdi
movq %r12, %rsi
callq 0x8280
movq 0x30(%rsp), %rsi
movq %r13, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8180
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
xorl %ecx, %ecx
callq 0xf630
jmp 0xf740
leaq 0xde5f(%rip), %rdi      # 0x1d5ef
callq 0x8090
movl $0x1, %edi
callq 0x8370
nop
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/util.c
// Function: computeElapsedTime
char *computeElapsedTime( unsigned long timeMark, unsigned long timeNow )
{
    static char retElapsedString[256];
    unsigned long timeElapsed, timeHours, timeMinutes, timeSeconds;

    if ( timeMark >= timeNow ) {
        strclr( retElapsedString );
    }
    else {
        timeElapsed = timeNow - timeMark;
        timeHours   = timeElapsed / 3600L;
        timeMinutes = (timeElapsed - (timeHours * 3600L)) / 60L;
        timeSeconds = (timeElapsed - (timeHours * 3600L + timeMinutes * 60L)) % 60L;
        snprintf( retElapsedString, 256, "%ld:%02ld:%02ld", timeHours, timeMinutes, timeSeconds );
    }
    return( retElapsedString );
}

// Assembly:
subq %rdi, %rsi
jbe 0xf81a
pushq %rax
movq %rsi, %rax
shrq $0x4, %rax
movabsq $0x91a2b3c4d5e6f81, %rcx # imm = 0x91A2B3C4D5E6F81
mulq %rcx
movq %rdx, %rcx
shrq $0x3, %rcx
imulq $-0xe10, %rcx, %rdi     # imm = 0xF1F0
addq %rsi, %rdi
movabsq $-0x7777777777777777, %rsi # imm = 0x8888888888888889
movq %rdi, %rax
mulq %rsi
movq %rdx, %r8
shrq $0x5, %r8
imulq $-0x3c, %r8, %r9
addq %rdi, %r9
movq %r9, %rax
mulq %rsi
shrq $0x5, %rdx
imulq $0x3c, %rdx, %rax
subq %rax, %r9
leaq 0xb3f9f(%rip), %rdi     # 0xc37a0
leaq 0xddf3(%rip), %rdx      # 0x1d5fb
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x8190
addq $0x8, %rsp
jmp 0xf821
movb $0x0, 0xb3f7f(%rip)     # 0xc37a0
leaq 0xb3f78(%rip), %rax     # 0xc37a0
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/util.c
// Function: getWord
char *getWord( char *strIn, int wordIndex, char *delim )
{
    static char retStr[BUFSIZE];

    char  *pch = NULL;
    int   i = 0;

    retStr[BUFSIZE-1] = 0;
    strlcpy( retStr, strIn, BUFSIZE-2);
    pch = strtok( retStr, delim );
    while (pch != NULL) {
        if ( i++ == wordIndex ) {
            break;
        }
        pch = strtok( NULL, delim );
    }
    return pch;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %rsi
movb $0x0, 0xb805f(%rip)     # 0xc789f
leaq 0xb4059(%rip), %r14     # 0xc38a0
movl $0x3ffe, %edx           # imm = 0x3FFE
movq %r14, %rdi
callq 0xf384
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8340
testq %rax, %rax
sete %cl
testl %ebp, %ebp
sete %dl
orb %cl, %dl
jne 0xf889
decl %ebp
xorl %edi, %edi
movq %rbx, %rsi
callq 0x8340
subl $0x1, %ebp
setb %cl
testq %rax, %rax
je 0xf889
testb %cl, %cl
je 0xf870
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/util.c
// Function: foundMatch
int foundMatch( char *line, char *table[], int caseConvert )
{
    int foundMe = 0;
    int p;
    static char lineCopy[4096];

    strlcpy( lineCopy, line, 4096 );

    if ( caseConvert ) {
        for (p=0; p<4096; p++) {
           lineCopy[p] = tolower(line[p]);
           if (line[p] == 0) break;
        }
        lineCopy[4095] = 0;
    }

    p = 0;
    while (table[p][0] != '*') {
        if (NULL != strstr( lineCopy, table[p] )) {
            foundMe = 1;
            break;
        }
        p++;
    }
    return( foundMe );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xb7ffb(%rip), %r15     # 0xc78a0
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rsi
callq 0xf384
testl %ebp, %ebp
je 0xf8ef
xorl %r12d, %r12d
callq 0x83d0
movq (%rax), %rcx
movsbq (%r14,%r12), %rdx
movb (%rcx,%rdx,4), %cl
movb %cl, (%r12,%r15)
cmpb $0x0, (%r14,%r12)
je 0xf8e8
leaq 0x1(%r12), %rcx
cmpq $0xfff, %r12            # imm = 0xFFF
movq %rcx, %r12
jne 0xf8c1
movb $0x0, 0xb8fb0(%rip)     # 0xc889f
movq (%rbx), %rsi
xorl %ebp, %ebp
cmpb $0x2a, (%rsi)
je 0xf924
addq $0x8, %rbx
leaq 0xb7f9c(%rip), %r14     # 0xc78a0
movq %r14, %rdi
callq 0x83b0
testq %rax, %rax
jne 0xf91f
movq (%rbx), %rsi
addq $0x8, %rbx
cmpb $0x2a, (%rsi)
jne 0xf904
jmp 0xf924
movl $0x1, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/util.c
// Function: strTrimInPlace
void strTrimInPlace(char * s)
{
    char * p = s;
    int l = (int) strlen( p );

    while ( isspace(p[l - 1]) )  p[--l] = 0;
    while ( * p && isspace(*p) ) ++p, --l;

    memmove(s, p, l + 1);
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x8120
movq %rax, %r14
callq 0x83e0
movq (%rax), %rcx
movslq %r14d, %rdx
movsbq -0x1(%rbx,%rdx), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0xf975
movslq %r14d, %rdx
leaq -0x1(%rdx), %r14
movb $0x0, -0x1(%rbx,%rdx)
movq (%rax), %rcx
movsbq -0x2(%rbx,%rdx), %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
movq %r14, %rdx
jne 0xf959
movb (%rbx), %al
movq %rbx, %rsi
testb %al, %al
je 0xf994
movsbq %al, %rax
testb $0x20, 0x1(%rcx,%rax,2)
je 0xf994
decl %r14d
movb 0x1(%rsi), %al
incq %rsi
jmp 0xf97a
incl %r14d
movslq %r14d, %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8300
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/util.c
// Function: strToLowerInPlace
void strToLowerInPlace(char * s)
{
    register int i;
    int j;
    j = (int) strlen( s );
    for (i=0; i<j; i++) s[i] = tolower(s[i]);
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x8120
movq %rax, %r14
testl %r14d, %r14d
jle 0xfa55
callq 0x83d0
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
xorl %ecx, %ecx
movq (%rax), %rdx
movsbq (%rbx,%rcx), %rsi
movb (%rdx,%rsi,4), %dl
movb %dl, (%rbx,%rcx)
incq %rcx
cmpq %rcx, %r14
jne 0xfa3f
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/util.c
// Function: reformatIP
char *reformatIP( char *originalIP )
{
    static char expandedIP[256];
    unsigned int n1, n2, n3, n4;
    strlcpy( expandedIP,  "000.000.000.000", 256 );
    if ( 4 == sscanf( originalIP, "%d.%d.%d.%d", &n1, &n2, &n3, &n4 )) {
        if ((n1<256) && (n2<256) && (n3<256) && (n4<256)) {
            snprintf( expandedIP, 256, "%03d.%03d.%03d.%03d", n1, n2, n3, n4 );
        }
    }
    return( expandedIP );
}

// Assembly:
subq $0x18, %rsp
movups 0xb793(%rip), %xmm0     # 0x1b1fb
movaps %xmm0, 0xb8e31(%rip)    # 0xc88a0
leaq 0xdb95(%rip), %rsi      # 0x1d60b
leaq 0x14(%rsp), %rdx
leaq 0x10(%rsp), %rcx
leaq 0xc(%rsp), %r8
leaq 0x8(%rsp), %r9
xorl %eax, %eax
callq 0x82d0
cmpl $0x4, %eax
jne 0xfaf0
movl 0x14(%rsp), %ecx
movl $0x100, %edx            # imm = 0x100
cmpl %edx, %ecx
setb %al
movl 0x10(%rsp), %r8d
cmpl %edx, %r8d
setb %sil
andb %al, %sil
movl 0xc(%rsp), %r9d
cmpl %edx, %r9d
setb %dil
movl 0x8(%rsp), %eax
cmpl %edx, %eax
setb %dl
andb %dil, %dl
andb %sil, %dl
cmpb $0x1, %dl
jne 0xfaf0
movl %eax, (%rsp)
leaq 0xb8dc3(%rip), %rdi     # 0xc88a0
leaq 0xdb33(%rip), %rdx      # 0x1d617
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x8190
leaq 0xb8da9(%rip), %rax     # 0xc88a0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/util.c
// Function: isReadable
int isReadable( char *fileName )
{
    int fileReadOk = 0;
    FILE *fpr;
    char tmpBuffer[16];

    if ( NULL != (fpr = fopen( fileName, "rb" ))) {
        if ( 1 == fread( tmpBuffer, 1, 1, fpr ) ) 
            fileReadOk = 1;
        fclose( fpr );
    }
    return fileReadOk;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
leaq 0xdb22(%rip), %rsi      # 0x1d62b
callq 0x8320
testq %rax, %rax
je 0xfb3f
movq %rax, %rbx
movq %rsp, %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x80b0
xorl %ebp, %ebp
cmpq $0x1, %rax
sete %bpl
movq %rbx, %rdi
callq 0x8100
jmp 0xfb41
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/util.c
// Function: replaceDoubleColonWithBell
void  replaceDoubleColonWithBell( char *strInOut )
{
    int i;

    if ( strlen( strInOut ) > 1  ) {
        for (i=0; i< (int)strlen( strInOut )-1 ; i++) {
            if (( strInOut[i] == ':' ) && ( strInOut[i+1] == ':'))  {
                strInOut[i] = '\007';
                strInOut[i+1] = '\007';
            }
        }
    }
    return;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x8120
cmpq $0x2, %rax
setb %cl
cmpl $0x2, %eax
setl %al
orb %cl, %al
jne 0xfb94
xorl %r14d, %r14d
cmpb $0x3a, (%rbx,%r14)
jne 0xfb80
cmpb $0x3a, 0x1(%rbx,%r14)
jne 0xfb80
movw $0x707, (%rbx,%r14)     # imm = 0x707
incq %r14
movq %rbx, %rdi
callq 0x8120
decl %eax
cltq
cmpq %rax, %r14
jl 0xfb6a
addq $0x8, %rsp
popq %rbx
popq %r14
retq