// File: /workspace/github_c_makefile_star2_O1/schroeder-lvb[P]sissm/src/sissm.c
// Function: sissmInitLogAndConfig
int sissmInitLogAndConfig( char *configPath )
{
    cfsPtr cP;

    strlcpy( sissmConfig.configFile, configPath, CFS_FETCH_MAX );      // store it for the plugins

    cP = cfsCreate( configPath );

    // read the log info first, so that log module can be used to report
    // status of remaining configuration reads.
    //
    strlcpy( sissmConfig.logFile, cfsFetchStr( cP, "sissm.logfile", "sissm.log" ), CFS_FETCH_MAX );
    strlcpy( sissmConfig.serverName, cfsFetchStr( cP, "sissm.serverName", "Unknown Server" ), CFS_FETCH_MAX );
    sissmConfig.loglevel = (int) cfsFetchNum( cP, "sissm.loglevel", 2.0 );
    sissmConfig.logEchoToScreen = (int) cfsFetchNum( cP, "sissm.logechotoscreen", LOG_LEVEL_DEBUG );

    // Initialize the log system based on parameters read above
    // Options for loglevel: _DEBUG _INFO _WARN _CRITICAL 
    // 
    logPrintfInit( sissmConfig.loglevel, sissmConfig.logFile, sissmConfig.logEchoToScreen ); 

    // read the RCON parameters
    //
    strlcpy( sissmConfig.rconIP, cfsFetchStr( cP, "sissm.rconip", "127.0.0.1" ), CFS_FETCH_MAX );
    strlcpy( sissmConfig.rconPassword, cfsFetchStr( cP, "sissm.rconpassword", "" ), CFS_FETCH_MAX );
    sissmConfig.rconPort = (int) cfsFetchNum( cP, "sissm.rconport", 27015 );

    // read the game log file path
    //
    strlcpy( sissmConfig.gameLogFile, cfsFetchStr( cP, "sissm.gamelogfile", "Insurgency.log" ), CFS_FETCH_MAX );

    // read the server restart script
    //
#if SISSM_RESTRICTED
    strclr( sissmConfig.restartScript );
#else
    strlcpy( sissmConfig.restartScript, cfsFetchStr( cP, "sissm.restartscript", "" ), CFS_FETCH_MAX );
#endif
    sissmConfig.restartDelay = (int) cfsFetchNum( cP, "sissm.restartdelay", 30.0 );

    // graceful exit - when enabled, SISSM will install a signal handler for terminating itself to 
    // generate a SIGTERM event to the plugins.
    //
    sissmConfig.gracefulExit = (int) cfsFetchNum( cP, "sissm.gracefulExit", 1.0 );

    cfsDestroy( cP );

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x22bb2(%rip), %rdi     # 0x2b31c
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0xf038
leaq 0x21792(%rip), %r14     # 0x29f10
movq %rbx, %rdi
callq 0x9004
movq %rax, %rbx
leaq 0x12912(%rip), %rsi     # 0x1b0a2
leaq 0x12919(%rip), %rdx     # 0x1b0b0
movq %rax, %rdi
callq 0x907b
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0xf038
leaq 0x12904(%rip), %rsi     # 0x1b0ba
leaq 0x1290e(%rip), %rdx     # 0x1b0cb
movq %rbx, %rdi
callq 0x907b
leaq 0x21b4c(%rip), %rdi     # 0x2a318
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x128fa(%rip), %rsi     # 0x1b0da
movsd 0x12820(%rip), %xmm0    # 0x1b008
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21b16(%rip)     # 0x2a310
leaq 0x128e8(%rip), %rsi     # 0x1b0e9
movsd 0x12807(%rip), %xmm0    # 0x1b010
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %edx
movl %edx, 0x21af9(%rip)     # 0x2a314
movl 0x21aef(%rip), %edi     # 0x2a310
movq %r14, %rsi
callq 0x1a1fc
leaq 0x128cf(%rip), %rsi     # 0x1b0ff
leaq 0x128d5(%rip), %rdx     # 0x1b10c
movq %rbx, %rdi
callq 0x907b
leaq 0x222d6(%rip), %rdi     # 0x2ab1c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x128bc(%rip), %rsi     # 0x1b116
leaq 0x12eb0(%rip), %r14     # 0x1b711
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21ea9(%rip), %rdi     # 0x2a71c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x128a2(%rip), %rsi     # 0x1b129
movsd 0x12789(%rip), %xmm0    # 0x1b018
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21e77(%rip)     # 0x2a718
leaq 0x12890(%rip), %rsi     # 0x1b138
leaq 0x14d3a(%rip), %rdx     # 0x1d5e9
movq %rbx, %rdi
callq 0x907b
leaq 0x2265e(%rip), %rdi     # 0x2af1c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x12878(%rip), %rsi     # 0x1b14a
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x22e38(%rip), %rdi     # 0x2b71c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x12866(%rip), %rsi     # 0x1b15e
movsd 0x12720(%rip), %xmm0    # 0x1b020
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x2320a(%rip)     # 0x2bb1c
leaq 0x12858(%rip), %rsi     # 0x1b171
movsd 0x12707(%rip), %xmm0    # 0x1b028
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x231ed(%rip)     # 0x2bb20
movq %rbx, %rdi
callq 0x905c
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq