// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rsi
leaq 0x296c9(%rip), %rdi     # 0x31f10
addq $0x140c, %rdi           # imm = 0x140C
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x8(%rbp), %rdi
callq 0x9370
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x1a832(%rip), %rsi     # 0x230a2
leaq 0x1a839(%rip), %rdx     # 0x230b0
callq 0x9430
movq %rax, %rsi
leaq 0x2968a(%rip), %rdi     # 0x31f10
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x10(%rbp), %rdi
leaq 0x1a81f(%rip), %rsi     # 0x230ba
leaq 0x1a829(%rip), %rdx     # 0x230cb
callq 0x9430
movq %rax, %rsi
leaq 0x2965f(%rip), %rdi     # 0x31f10
addq $0x408, %rdi            # imm = 0x408
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x10(%rbp), %rdi
leaq 0x1a80d(%rip), %rsi     # 0x230da
movsd 0x1a753(%rip), %xmm0    # 0x23028
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x29a2c(%rip)     # 0x32310
movq -0x10(%rbp), %rdi
leaq 0x1a7fa(%rip), %rsi     # 0x230e9
movsd 0x1a729(%rip), %xmm0    # 0x23020
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x29a0e(%rip)     # 0x32314
movl 0x29a04(%rip), %edi     # 0x32310
movl 0x29a02(%rip), %edx     # 0x32314
leaq 0x295f7(%rip), %rsi     # 0x31f10
callq 0x21bb0
movq -0x10(%rbp), %rdi
leaq 0x1a7d6(%rip), %rsi     # 0x230ff
leaq 0x1a7dc(%rip), %rdx     # 0x2310c
callq 0x9430
movq %rax, %rsi
leaq 0x295d1(%rip), %rdi     # 0x31f10
addq $0xc0c, %rdi            # imm = 0xC0C
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x10(%rbp), %rdi
leaq 0x1a7bb(%rip), %rsi     # 0x23116
leaq 0x1adaf(%rip), %rdx     # 0x23711
callq 0x9430
movq %rax, %rsi
leaq 0x2959f(%rip), %rdi     # 0x31f10
addq $0x80c, %rdi            # imm = 0x80C
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x10(%rbp), %rdi
leaq 0x1a79c(%rip), %rsi     # 0x23129
movsd 0x1a683(%rip), %xmm0    # 0x23018
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x29d74(%rip)     # 0x32718
movq -0x10(%rbp), %rdi
leaq 0x1a789(%rip), %rsi     # 0x23138
leaq 0x1cc33(%rip), %rdx     # 0x255e9
callq 0x9430
movq %rax, %rsi
leaq 0x2954b(%rip), %rdi     # 0x31f10
addq $0x100c, %rdi           # imm = 0x100C
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x10(%rbp), %rdi
leaq 0x1a769(%rip), %rsi     # 0x2314a
leaq 0x1ad29(%rip), %rdx     # 0x23711
callq 0x9430
movq %rax, %rsi
leaq 0x29519(%rip), %rdi     # 0x31f10
addq $0x180c, %rdi           # imm = 0x180C
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x10(%rbp), %rdi
leaq 0x1a74b(%rip), %rsi     # 0x2315e
movsd 0x1a5f5(%rip), %xmm0    # 0x23010
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x2b0f2(%rip)     # 0x33b1c
movq -0x10(%rbp), %rdi
leaq 0x1a73c(%rip), %rsi     # 0x23171
movsd 0x1a5cb(%rip), %xmm0    # 0x23008
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x2b0d4(%rip)     # 0x33b20
movq -0x10(%rbp), %rdi
callq 0x93f0
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)