// File: /workspace/github_c_makefile_star2_O3/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 0x22bab(%rip), %rdi     # 0x2b31c
movl $0x400, %edx            # imm = 0x400
movq %rbx, %rsi
callq 0xf384
leaq 0x2178b(%rip), %r14     # 0x29f10
movq %rbx, %rdi
callq 0x8ffc
movq %rax, %rbx
leaq 0x1290b(%rip), %rsi     # 0x1b0a2
leaq 0x12912(%rip), %rdx     # 0x1b0b0
movq %rax, %rdi
callq 0x9073
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0xf384
leaq 0x128fd(%rip), %rsi     # 0x1b0ba
leaq 0x12907(%rip), %rdx     # 0x1b0cb
movq %rbx, %rdi
callq 0x9073
leaq 0x21b45(%rip), %rdi     # 0x2a318
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x128f3(%rip), %rsi     # 0x1b0da
movsd 0x12819(%rip), %xmm0    # 0x1b008
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21b0f(%rip)     # 0x2a310
leaq 0x128e1(%rip), %rsi     # 0x1b0e9
movsd 0x12800(%rip), %xmm0    # 0x1b010
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %edx
movl %edx, 0x21af2(%rip)     # 0x2a314
movl 0x21ae8(%rip), %edi     # 0x2a310
movq %r14, %rsi
callq 0x1a3b8
leaq 0x128c8(%rip), %rsi     # 0x1b0ff
leaq 0x128ce(%rip), %rdx     # 0x1b10c
movq %rbx, %rdi
callq 0x9073
leaq 0x222cf(%rip), %rdi     # 0x2ab1c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x128b5(%rip), %rsi     # 0x1b116
leaq 0x12ea1(%rip), %r14     # 0x1b709
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21ea2(%rip), %rdi     # 0x2a71c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x1289b(%rip), %rsi     # 0x1b129
movsd 0x12782(%rip), %xmm0    # 0x1b018
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21e70(%rip)     # 0x2a718
leaq 0x12889(%rip), %rsi     # 0x1b138
leaq 0x14d0b(%rip), %rdx     # 0x1d5c1
movq %rbx, %rdi
callq 0x9073
leaq 0x22657(%rip), %rdi     # 0x2af1c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x12871(%rip), %rsi     # 0x1b14a
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x22e31(%rip), %rdi     # 0x2b71c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x1285f(%rip), %rsi     # 0x1b15e
movsd 0x12719(%rip), %xmm0    # 0x1b020
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x23203(%rip)     # 0x2bb1c
leaq 0x12851(%rip), %rsi     # 0x1b171
movsd 0x12700(%rip), %xmm0    # 0x1b028
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x231e6(%rip)     # 0x2bb20
movq %rbx, %rdi
callq 0x9054
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq