LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/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 0xf2c1(%rip), %rdi      # 0x1aaab
xorl %esi, %esi
callq 0x17049
leaq 0xf26d(%rip), %rdi      # 0x1aa65
xorl %esi, %esi
callq 0x17049
leaq 0xf27d(%rip), %rdi      # 0x1aa83
pushq $0x1
popq %rsi
callq 0x17049
leaq 0xf8f9(%rip), %rdi      # 0x1b10e
xorl %eax, %eax
callq 0x12753
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0x51ced(%rip)     # 0x5dd5c
jne 0xc097
pushq %rax
andl $0x0, 0x51ce3(%rip)     # 0x5dd5c
leaq 0xeaca(%rip), %rdi      # 0x1ab4a
xorl %eax, %eax
callq 0x12753
leaq 0xeae4(%rip), %rdi      # 0x1ab72
callq 0x12304
addq $0x8, %rsp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xc0ce
cmpl $0x2, 0x51cb5(%rip)     # 0x5dd5c
jne 0xc0ca
andl $0x0, 0x51cac(%rip)     # 0x5dd5c
leaq 0xea93(%rip), %rdi      # 0x1ab4a
xorl %eax, %eax
callq 0x12753
leaq 0xeaad(%rip), %rdi      # 0x1ab72
callq 0x12304
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1d594(%rip), %rax     # 0x296b0
cmpq $-0x1, %rax
setne %dl
movl 0x51827(%rip), %ecx     # 0x5d950
testl %ecx, %ecx
setne %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0xc187
movl 0x51c22(%rip), %edx     # 0x5dd60
incl %edx
movl %edx, 0x51c1a(%rip)     # 0x5dd60
cmpl %ecx, %edx
jl 0xc187
andl $0x0, 0x51c0f(%rip)     # 0x5dd60
leal 0x1(%rax), %ecx
movl %ecx, 0x1d556(%rip)     # 0x296b0
shlq $0xa, %rax
leaq 0x287db(%rip), %rcx     # 0x34940
leaq (%rax,%rcx), %rdi
addq $0x27c10, %rdi          # imm = 0x27C10
xorl %eax, %eax
callq 0x12753
cmpl $0x5, 0x1d532(%rip)     # 0x296b0
jl 0xc187
orl $-0x1, 0x1d529(%rip)    # 0x296b0
movl 0x51bcf(%rip), %eax     # 0x5dd5c
decl %eax
cmpl $0x1, %eax
ja 0xc1be
callq 0x12ab4
testl %eax, %eax
jne 0xc1be
andl $0x0, 0x51bb8(%rip)     # 0x5dd5c
leaq 0xe99f(%rip), %rdi      # 0x1ab4a
xorl %eax, %eax
callq 0x12753
leaq 0xe9b9(%rip), %rdi      # 0x1ab72
callq 0x12304
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xed98
movq %rbx, %rdi
callq 0xed98
movabsq $0x203a7461684320, %rax # imm = 0x203A7461684320
movq %rsp, %r12
movq %rax, (%r12)
leaq 0x2c0e4(%rip), %rsi     # 0x38544
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
callq 0xe918
movq %r15, %rdi
movq %r12, %rsi
callq 0x83c0
pushq $0x1
popq %r13
testq %rax, %rax
je 0xc4c7
movq %rax, %r12
pushq $0x28
popq %rsi
pushq $0x29
popq %rdx
movq %r15, %rdi
movq %r14, %rcx
movl %ebp, %r8d
callq 0x1351b
testl %eax, %eax
je 0xc4c7
movq %rsp, %rdi
callq 0x8120
addq %rax, %r12
movslq %ebp, %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe97a
movq %rbx, %rdi
callq 0xee76
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_O2/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 0xed98
movq %rbx, %rdi
callq 0xed98
leaq 0xf1bf(%rip), %rsi      # 0x1b6c8
movq %r14, %rdi
callq 0x83c0
pushq $0x1
popq %r12
testq %rax, %rax
je 0xc5a0
movq %rax, %r13
cmpb $0x0, 0x3(%rax)
je 0xc5a0
movl %ebp, 0x4(%rsp)
addq $0x3, %r13
leaq 0x2c00e(%rip), %rsi     # 0x38544
movq %r13, %rdi
callq 0x83c0
cmpq %r13, %rax
jne 0xc5a0
movq %rax, %rbp
leaq 0x2bff7(%rip), %rdi     # 0x38544
callq 0x8120
addq %rax, %rbp
movslq 0x4(%rsp), %rdx
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xe97a
movq %rbx, %rdi
callq 0xee76
movups 0xf158(%rip), %xmm0     # 0x1b6cc
movups %xmm0, (%r15)
movw $0x30, 0x10(%r15)
leaq 0xe6f9(%rip), %rsi      # 0x1ac7f
leaq 0xf151(%rip), %rdx      # 0x1b6de
xorl %r12d, %r12d
pushq $0x2
popq %rdi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x1920b
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_O2/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 %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movq %rdi, %rbx
leaq 0x400(%rsp), %rdx
movq %rsp, %rcx
movl $0x400, %esi            # imm = 0x400
callq 0xc41c
testl %eax, %eax
jne 0xc62a
leaq 0xf120(%rip), %r14      # 0x1b702
leaq 0xf12a(%rip), %rdx      # 0x1b713
pushq $0x3
popq %rbp
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1920b
leaq 0xf120(%rip), %rdx      # 0x1b722
leaq 0x400(%rsp), %rbx
movq %rsp, %r15
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x1920b
movq %r15, %rdi
movq %rbx, %rsi
callq 0xc1ee
xorl %eax, %eax
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x8973
movq %rax, %rdi
callq 0x8f80
movq %rax, %rbx
leaq 0xefb6(%rip), %rsi      # 0x1b786
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x5188a(%rip)     # 0x5e070
leaq 0x51887(%rip), %r14     # 0x5e074
leaq 0xefa9(%rip), %r15      # 0x1b79d
movq %rsp, %r12
leaq 0xdf0b(%rip), %r13      # 0x1a709
xorl %ebp, %ebp
cmpq $0x64, %rbp
je 0xc84c
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 0x8ff5
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0xe97a
movq %r14, %rdi
callq 0xf070
incq %rbp
addq $0x400, %r14            # imm = 0x400
jmp 0xc800
leaq 0xef60(%rip), %rsi      # 0x1b7b3
leaq 0xdeaf(%rip), %rdx      # 0x1a709
movq %rbx, %rdi
callq 0x8ff5
leaq 0x6a80b(%rip), %rdi     # 0x77074
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
movq %rbx, %rdi
callq 0x8fd6
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_O2/schroeder-lvb[P]sissm/src/events.c
// Function: eventsInit
int eventsInit( void )
{
    int errCode = 0;
    int i, j;

    // zero out the callback functions
    //
    for ( i=0; i<SISSM_MAXPLUGINS; i++ )
        for ( j=0; j<SISSM_MAXEVENTS; j++ )
            eventsCallbackFunctions[i][j] = NULL;

    return errCode;
}

// Assembly:
leaq 0x6a901(%rip), %rax     # 0x77480
xorl %ecx, %ecx
cmpq $0x20, %rcx
je 0xcba4
xorl %edx, %edx
cmpq $0x40, %rdx
je 0xcb99
andq $0x0, (%rax,%rdx,8)
incq %rdx
jmp 0xcb89
incq %rcx
addq $0x200, %rax            # imm = 0x200
jmp 0xcb81
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq $0x8
popq %rdx
pushq $0x1
popq %rax
leaq 0x1cb0c(%rip), %rcx     # 0x296c0
leaq 0x10(%rdx), %r8
cmpq $0x418, %r8             # imm = 0x418
je 0xcc11
movq (%rdx,%rcx), %r9
cmpb $0x2a, (%r9)
jne 0xcbd2
cmpb $0x0, 0x1(%r9)
je 0xcc11
cmpl %edi, -0x8(%rdx,%rcx)
movq %r8, %rdx
jne 0xcbb4
movslq -0x14(%r8,%rcx), %rcx
cmpq $-0x1, %rcx
je 0xcc11
shlq $0x9, %rcx
xorl %edx, %edx
leaq 0x6a88d(%rip), %rdi     # 0x77480
cmpq $0x20, %rdx
je 0xcc11
leaq (%rcx,%rdx,8), %r8
incq %rdx
cmpq $0x0, (%rdi,%r8)
jne 0xcbf3
addq %rcx, %rdi
movq %rsi, -0x8(%rdi,%rdx,8)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/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:
pushq $0x8
popq %rdx
pushq $0x1
popq %rax
leaq 0x1caa1(%rip), %rcx     # 0x296c0
leaq 0x10(%rdx), %r8
cmpq $0x418, %r8             # imm = 0x418
je 0xcc88
movq (%rdx,%rcx), %r9
cmpb $0x2a, (%r9)
jne 0xcc3d
cmpb $0x0, 0x1(%r9)
je 0xcc88
cmpl %edi, -0x8(%rdx,%rcx)
movq %r8, %rdx
jne 0xcc1f
movslq -0x14(%r8,%rcx), %rcx
cmpq $-0x1, %rcx
je 0xcc88
shlq $0x9, %rcx
pushq $0x1
popq %rax
xorl %edx, %edx
leaq 0x6a81f(%rip), %rdi     # 0x77480
cmpq $0x20, %rdx
je 0xcc88
leaq (%rcx,%rdx,8), %r8
cmpq %rsi, (%rdi,%r8)
jne 0xcc83
leaq (,%rdx,8), %rax
addq %rcx, %rax
andq $0x0, (%rdi,%rax)
xorl %eax, %eax
incq %rdx
jmp 0xcc61
retq
// File: /workspace/github_c_makefile_star2_O2/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, %r14
xorl %r12d, %r12d
leaq 0x1ca1f(%rip), %r13     # 0x296c0
cmpq $0x400, %r12            # imm = 0x400
je 0xcceb
movq 0x8(%r12,%r13), %r15
movzbl (%r15), %ebx
testl %ebx, %ebx
je 0xcce5
movl %ebx, %ebp
subl $0x2a, %ebp
jne 0xccc5
cmpb $0x0, 0x1(%r15)
je 0xcceb
movq %r14, %rdi
movq %r15, %rsi
callq 0x83c0
testq %rax, %rax
jne 0xcd01
cmpl $0x2a, %ebx
jne 0xccdf
movzbl 0x1(%r15), %ebp
negl %ebp
testl %ebp, %ebp
je 0xcceb
addq $0x10, %r12
jmp 0xcca1
pushq $-0x1
popq %r13
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq 0x4(%r12,%r13), %r13
testq %r13, %r13
js 0xccef
movq %r13, %r15
shlq $0x9, %r15
xorl %r12d, %r12d
leaq 0x6a764(%rip), %rbx     # 0x77480
cmpq $0x20, %r12
je 0xccef
leaq (%r15,%r12,8), %rax
movq (%rbx,%rax), %rax
testq %rax, %rax
je 0xcd34
movq %r14, %rdi
callq *%rax
incq %r12
jmp 0xcd1c
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/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 0x10b6a
movq %rax, 0x6e976(%rip)     # 0x7b8b0
callq 0x10b6a
movq %rax, 0x6e97a(%rip)     # 0x7b8c0
andq $0x0, 0x6e96a(%rip)     # 0x7b8b8
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x6e941(%rip)     # 0x7b8b8
callq 0x10b6a
movq %rax, 0x6e93d(%rip)     # 0x7b8c0
movq 0x6e506(%rip), %rbx     # 0x7b490
addq 0x6e91f(%rip), %rbx     # 0x7b8b0
callq 0x10b6a
cmpq %rax, %rbx
jae 0xcfdf
callq 0x10b6a
movq %rax, 0x6e909(%rip)     # 0x7b8b0
andq $0x0, 0x6e909(%rip)     # 0x7b8b8
callq 0x10b6a
movq %rax, 0x6e905(%rip)     # 0x7b8c0
leaq 0xecaf(%rip), %rsi      # 0x1bc71
leaq 0xecb3(%rip), %rdx      # 0x1bc7c
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x1920b
leaq 0xecbb(%rip), %rdi      # 0x1bc95
callq 0x12304
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x6e8cc(%rip)     # 0x7b8b8
callq 0x10b6a
movq %rax, 0x6e8c8(%rip)     # 0x7b8c0
cmpq $0x0, 0x6e8a8(%rip)     # 0x7b8a8
jne 0xd05e
movq 0x6e487(%rip), %rbx     # 0x7b490
addq 0x6e8a0(%rip), %rbx     # 0x7b8b0
callq 0x10b6a
cmpq %rax, %rbx
jae 0xd05e
callq 0x10b6a
movq %rax, 0x6e88a(%rip)     # 0x7b8b0
andq $0x0, 0x6e88a(%rip)     # 0x7b8b8
callq 0x10b6a
movq %rax, 0x6e886(%rip)     # 0x7b8c0
leaq 0xec30(%rip), %rsi      # 0x1bc71
leaq 0xec34(%rip), %rdx      # 0x1bc7c
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x1920b
leaq 0xec3c(%rip), %rdi      # 0x1bc95
callq 0x12304
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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
andq $0x0, 0x6e84d(%rip)     # 0x7b8b8
callq 0x10b6a
movq %rax, 0x6e849(%rip)     # 0x7b8c0
movq 0x6e412(%rip), %rbx     # 0x7b490
addq 0x6e82b(%rip), %rbx     # 0x7b8b0
callq 0x10b6a
cmpq %rax, %rbx
jae 0xd09d
leaq 0x6e832(%rip), %rdi     # 0x7b8c8
xorl %eax, %eax
callq 0x12753
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x10b6a
movq %rax, 0x6e812(%rip)     # 0x7b8c0
andq $0x0, 0x6e802(%rip)     # 0x7b8b8
cmpq $0x0, 0x6e7ea(%rip)     # 0x7b8a8
je 0xd11c
movq 0x6e3c9(%rip), %rbx     # 0x7b490
addq 0x6e7e2(%rip), %rbx     # 0x7b8b0
callq 0x10b6a
cmpq %rax, %rbx
jae 0xd11c
callq 0x10b6a
movq %rax, 0x6e7cc(%rip)     # 0x7b8b0
andq $0x0, 0x6e7cc(%rip)     # 0x7b8b8
callq 0x10b6a
movq %rax, 0x6e7c8(%rip)     # 0x7b8c0
leaq 0xeb72(%rip), %rsi      # 0x1bc71
leaq 0xeba3(%rip), %rdx      # 0x1bca9
pushq $0x2
popq %rdi
xorl %eax, %eax
callq 0x1920b
leaq 0xeb7e(%rip), %rdi      # 0x1bc95
callq 0x12304
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x10b6a
movq %rax, 0x6e793(%rip)     # 0x7b8c0
andq $0x0, 0x6e783(%rip)     # 0x7b8b8
movq 0x6e354(%rip), %rbx     # 0x7b490
addq 0x6e76d(%rip), %rbx     # 0x7b8b0
callq 0x10b6a
cmpq %rax, %rbx
jae 0xd17c
movq 0x6ef74(%rip), %rbx     # 0x7c0c8
addq $0xa, %rbx
callq 0x10b6a
cmpq %rax, %rbx
jae 0xd17c
callq 0x10b6a
movq %rax, 0x6ef5a(%rip)     # 0x7c0c8
leaq 0x6e753(%rip), %rdi     # 0x7b8c8
xorl %eax, %eax
callq 0x12753
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x1085b(%rip), %rsi     # 0x1d9e6
callq 0x83c0
testq %rax, %rax
je 0xd1b5
leaq 0x1086e(%rip), %rsi     # 0x1da0a
movq %rbx, %rdi
callq 0x83c0
testq %rax, %rax
je 0xd1b5
callq 0x10b6a
movq %rax, 0x6e70b(%rip)     # 0x7b8c0
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xcd3c
cmpl $0x0, 0x6df7d(%rip)     # 0x7b480
je 0xd5cc
leaq -0x5f9(%rip), %rsi      # 0xcf17
pushq $0x3
popq %rdi
callq 0xcba7
leaq -0x5fd(%rip), %rsi      # 0xcf22
pushq $0x4
popq %rdi
callq 0xcba7
leaq -0x601(%rip), %rsi      # 0xcf2d
pushq $0x1
popq %rdi
callq 0xcba7
leaq -0x5eb(%rip), %rsi      # 0xcf52
pushq $0x2
popq %rdi
callq 0xcba7
leaq -0x5f7(%rip), %rsi      # 0xcf55
pushq $0x5
popq %rdi
callq 0xcba7
leaq -0x5ed(%rip), %rsi      # 0xcf6e
pushq $0x6
popq %rdi
callq 0xcba7
leaq -0x587(%rip), %rsi      # 0xcfe3
pushq $0x7
popq %rdi
callq 0xcba7
leaq -0x517(%rip), %rsi      # 0xd062
pushq $0x8
popq %rdi
callq 0xcba7
leaq -0x4e7(%rip), %rsi      # 0xd0a1
pushq $0x9
popq %rdi
callq 0xcba7
leaq -0x477(%rip), %rsi      # 0xd120
pushq $0xa
popq %rdi
callq 0xcba7
leaq -0x3d4(%rip), %rsi      # 0xd1d2
pushq $0xb
popq %rdi
callq 0xcba7
leaq -0x3fc(%rip), %rsi      # 0xd1b9
pushq $0xe
popq %rdi
callq 0xcba7
leaq -0x444(%rip), %rsi      # 0xd180
pushq $0x1c
popq %rdi
callq 0xcba7
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xb473a(%rip), %r15     # 0xc2d34
cmpq $0x1f, %r15
jg 0xe6cd
movq %rdi, %r14
leaq 0xdd81(%rip), %rsi      # 0x1c38f
callq 0x83c0
testq %rax, %rax
je 0xe62b
leaq 0xdd8b(%rip), %rbx      # 0x1c3aa
pushq $0x4f
popq %rax
leaq 0xb5117(%rip), %rcx     # 0xc3740
jmp 0xe654
leaq 0xdd98(%rip), %rsi      # 0x1c3ca
movq %r14, %rdi
callq 0x83c0
testq %rax, %rax
je 0xe6cd
leaq 0xdd99(%rip), %rbx      # 0x1c3e3
pushq $0x4d
popq %rax
leaq 0xb50f0(%rip), %rcx     # 0xc3744
imulq $0x50, %r15, %rdi
leaq 0xb46e1(%rip), %r15     # 0xc2d40
addq %r15, %rdi
xorl %edx, %edx
cmpb $0x0, (%rcx)
cmoveq %rdx, %rax
addq %rax, %r14
pushq $0x50
popq %rdx
movq %r14, %rsi
callq 0xe97a
movslq 0xb46b4(%rip), %rax     # 0xc2d34
imulq $0x50, %rax, %rdi
addq %r15, %rdi
callq 0xeedb
movslq 0xb46a1(%rip), %rax     # 0xc2d34
leal 0x1(%rax), %ecx
movl %ecx, 0xb4698(%rip)     # 0xc2d34
imulq $0x50, %rax, %rdi
addq %r15, %rdi
callq 0xee76
movslq 0xb4685(%rip), %r8      # 0xc2d34
decq %r8
imulq $0x50, %r8, %rcx
addq %r15, %rcx
leaq 0xdbb2(%rip), %rsi      # 0x1c272
pushq $0x1
popq %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1920b
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xb5069(%rip), %rdi     # 0xc3750
callq 0xed98
movl 0x96236(%rip), %ebp     # 0xa4928
xorl %r14d, %r14d
cmpl %ebp, 0xb4639(%rip)     # 0xc2d34
jle 0xe753
leaq 0xb504c(%rip), %rbx     # 0xc3750
leaq 0xb4635(%rip), %rsi     # 0xc2d40
pushq $0x50
popq %rdx
movq %rbx, %rdi
callq 0xe97a
movslq 0xb4617(%rip), %r15     # 0xc2d34
movl 0x96205(%rip), %ebp     # 0xa4928
xorl %r12d, %r12d
leaq 0xb4663(%rip), %rdi     # 0xc2d90
xorl %r14d, %r14d
incq %r12
cmpq %r15, %r12
jge 0xe753
leaq 0x50(%rdi), %r13
movq %rbx, %rsi
callq 0x8220
cmpl $0x1, %eax
adcl $0x0, %r14d
movq %r13, %rdi
cmpl %ebp, %r14d
jle 0xe730
cmpl %ebp, %r14d
jle 0xe789
leaq 0xb4ff1(%rip), %rbx     # 0xc3750
leaq 0x961ca(%rip), %rsi     # 0xa4930
movq %rbx, %rdi
callq 0x129f0
leaq 0xdafd(%rip), %rsi      # 0x1c272
leaq 0xdc87(%rip), %rdx      # 0x1c403
pushq $0x1
popq %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x1920b
andl $0x0, 0xb45a4(%rip)     # 0xc2d34
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movb $0x1, %al
andl $0x0, 0xb44e8(%rip)     # 0xc2d34
movb %al, 0xb4eee(%rip)      # 0xc3740
movb %al, 0xb4eec(%rip)      # 0xc3744
xorl %ebx, %ebx
leaq 0xb44df(%rip), %r14     # 0xc2d40
cmpq $0xa00, %rbx            # imm = 0xA00
je 0xe879
leaq (%r14,%rbx), %rdi
callq 0xed98
addq $0x50, %rbx
jmp 0xe861
movl $0x1, 0x9609d(%rip)     # 0xa4920
movabsq $0x300000003, %rax      # imm = 0x300000003
movq %rax, 0x96094(%rip)     # 0xa4928
movl $0x74736574, 0x96092(%rip) # imm = 0x74736574
movb $0x0, 0x9608f(%rip)     # 0xa4934
movl $0x3e8, %ebp            # imm = 0x3E8
leaq 0xdb90(%rip), %rbx      # 0x1c441
movq %rsp, %r14
pushq $0x5e
popq %r15
leaq 0xdbe0(%rip), %r12      # 0x1c49f
pushq $0x5c
popq %r13
subl $0x1, %ebp
jb 0xe8f6
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x8290
movq %r14, %rdi
callq 0xe5ee
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x8290
movq %r14, %rdi
callq 0xe5ee
jmp 0xe8c3
callq 0xe6d5
callq 0xe6d5
callq 0xe6d5
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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
leaq (%rdi,%rdx), %rcx
movq %rdi, %rax
movq %rdx, %r8
subq $0x1, %r8
jb 0xe936
cmpb $0x0, (%rax)
je 0xe933
incq %rax
jmp 0xe923
movq %rax, %rcx
movq %rcx, %rbx
subq %rdi, %rbx
subq %rbx, %rdx
je 0xe96d
xorl %eax, %eax
pushq $0x1
popq %rdi
movb (%rsi,%rax), %r8b
testb %r8b, %r8b
je 0xe968
cmpq $0x1, %rdx
jne 0xe95a
movq %rdi, %rdx
jmp 0xe963
movb %r8b, (%rcx)
incq %rcx
decq %rdx
incq %rax
jmp 0xe946
movb $0x0, (%rcx)
jmp 0xe975
movq %rsi, %rdi
callq 0x8120
addq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xed98
cmpl $-0x1, %r14d
je 0xeab5
leaq 0xdb63(%rip), %rdx      # 0x1c5e6
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 0xeab8
movb $0x0, (%rbx,%rax)
jmp 0xeab8
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
subq $0x400, %rsp            # imm = 0x400
leaq 0xd8b8(%rip), %rsi      # 0x1c566
pushq $0x4
popq %rdi
pushq $0x1
popq %rdx
callq 0x191e0
leaq 0xd8b4(%rip), %rdi      # 0x1c574
callq 0xe9c8
testq %rax, %rax
je 0xed18
movq %rax, %rbx
movq %rsp, %r14
leaq 0xd901(%rip), %r15      # 0x1c5d8
movq %rbx, %rdi
movq %r14, %rsi
movl $0x400, %edx            # imm = 0x400
xorl %ecx, %ecx
callq 0xec0d
movq %rbx, %rdi
testl %eax, %eax
je 0xed01
callq 0xeaef
movl $0x186a0, %edi          # imm = 0x186A0
callq 0x8400
jmp 0xecd7
callq 0xeac8
movq %r15, %rdi
movq %rax, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x8180
jmp 0xecd7
leaq 0xd8d8(%rip), %rdi      # 0x1c5f7
callq 0x8090
pushq $0x1
popq %rdi
callq 0x8380
// File: /workspace/github_c_makefile_star2_O2/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 0xed89
pushq %rax
movl $0xe10, %ecx            # imm = 0xE10
movq %rsi, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
imulq $-0xe10, %rax, %rdi     # imm = 0xF1F0
addq %rsi, %rdi
pushq $0x3c
popq %rsi
movq %rdi, %rax
xorl %edx, %edx
divq %rsi
movq %rax, %r8
imulq $-0x3c, %rax, %rax
addq %rdi, %rax
xorl %edx, %edx
divq %rsi
movq %rdx, %r9
leaq 0xb4a30(%rip), %rdi     # 0xc37a0
leaq 0xd88c(%rip), %rdx      # 0x1c603
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x8190
addq $0x8, %rsp
jmp 0xed90
movb $0x0, 0xb4a10(%rip)     # 0xc37a0
leaq 0xb4a09(%rip), %rax     # 0xc37a0
retq
// File: /workspace/github_c_makefile_star2_O2/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, 0xb8af0(%rip)     # 0xc789f
leaq 0xb4aea(%rip), %r14     # 0xc38a0
movl $0x3ffe, %edx           # imm = 0x3FFE
movq %r14, %rdi
callq 0xe97a
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8350
subl $0x1, %ebp
setb %cl
testq %rax, %rax
je 0xede1
testb %cl, %cl
jne 0xede1
xorl %edi, %edi
jmp 0xedc6
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xb8aa3(%rip), %r15     # 0xc78a0
movl $0x1000, %edx           # imm = 0x1000
movq %r15, %rdi
movq %r14, %rsi
callq 0xe97a
testl %ebp, %ebp
je 0xee44
xorl %r12d, %r12d
cmpq $0x1000, %r12           # imm = 0x1000
je 0xee3d
callq 0x83e0
movq (%rax), %rax
movsbq (%r14,%r12), %rcx
movb (%rax,%rcx,4), %al
movb %al, (%r12,%r15)
cmpb $0x0, (%r14,%r12)
leaq 0x1(%r12), %r12
jne 0xee14
movb $0x0, 0xb9a5b(%rip)     # 0xc889f
leaq 0xb8a55(%rip), %r14     # 0xc78a0
pushq $0x1
popq %rbp
movq (%rbx), %rsi
cmpb $0x2a, (%rsi)
je 0xee69
movq %r14, %rdi
callq 0x83c0
addq $0x8, %rbx
testq %rax, %rax
je 0xee4e
jmp 0xee6b
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x83f0
movslq %r14d, %rdx
leal 0x1(%rdx), %ecx
leaq (%rdx,%rbx), %rsi
decq %rsi
movq (%rax), %rdx
movsbq (%rsi), %rdi
testb $0x20, 0x1(%rdx,%rdi,2)
je 0xeeaf
movb $0x0, (%rsi)
decl %ecx
decq %rsi
jmp 0xee97
movq %rbx, %rsi
movsbq (%rsi), %rax
testq %rax, %rax
je 0xeec9
testb $0x20, 0x1(%rdx,%rax,2)
je 0xeec9
incq %rsi
decl %ecx
jmp 0xeeb2
movslq %ecx, %rdx
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8310
// File: /workspace/github_c_makefile_star2_O2/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 0xb269(%rip), %xmm0     # 0x1a1fb
movaps %xmm0, 0xb9907(%rip)    # 0xc88a0
leaq 0xd673(%rip), %rsi      # 0x1c613
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 0xf01a
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 0xf01a
movl %eax, (%rsp)
leaq 0xb9899(%rip), %rdi     # 0xc88a0
leaq 0xd611(%rip), %rdx      # 0x1c61f
movl $0x100, %esi            # imm = 0x100
xorl %eax, %eax
callq 0x8190
leaq 0xb987f(%rip), %rax     # 0xc88a0
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xd600(%rip), %rsi      # 0x1c633
callq 0x8330
testq %rax, %rax
je 0xf065
movq %rax, %rbx
movq %rsp, %rdi
pushq $0x1
popq %rdx
movq %rdx, %rsi
movq %rax, %rcx
callq 0x80b0
xorl %ebp, %ebp
cmpq $0x1, %rax
sete %bpl
movq %rbx, %rdi
callq 0x8100
jmp 0xf067
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
jb 0xf0b1
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x8120
decl %eax
cltq
cmpq %rax, %r14
jge 0xf0b1
cmpb $0x3a, (%rbx,%r14)
jne 0xf0ac
cmpb $0x3a, 0x1(%rbx,%r14)
jne 0xf0ac
movw $0x707, (%rbx,%r14)     # imm = 0x707
incq %r14
jmp 0xf085
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/schroeder-lvb[P]sissm/src/util.c
// Function: debugPoke
int debugPoke( char *fileName, int *valueOut )
{
    int errCode = 1;
    FILE *fpr;
    static char tmpBuf[256];

    if ( NULL != (fpr = fopen( fileName, "rt" )) ) {
        if ( NULL != fgets( tmpBuf, 256, fpr ) ) {
            if ( 1 == sscanf( tmpBuf, "%d", valueOut )) {
                errCode = 0;
            }
        }
        fclose( fpr );
    }
    return( errCode ); 
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
leaq 0xbdc4(%rip), %rsi      # 0x1ae8b
callq 0x8330
testq %rax, %rax
je 0xf110
movq %rax, %rbx
leaq 0xb98c5(%rip), %rdi     # 0xc89a0
movl $0x100, %esi            # imm = 0x100
movq %rax, %rdx
callq 0x8200
testq %rax, %rax
je 0xf115
leaq 0xb98ac(%rip), %rdi     # 0xc89a0
leaq 0xbfca(%rip), %rsi      # 0x1b0c5
movq %r14, %rdx
xorl %eax, %eax
callq 0x82d0
xorl %ebp, %ebp
cmpl $0x1, %eax
setne %bpl
jmp 0xf118
pushq $0x1
popq %rbp
jmp 0xf120
pushq $0x1
popq %rbp
movq %rbx, %rdi
callq 0x8100
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop