// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/sissm.c
// Function: sissm_main
int sissm_main( int argc, char *argv[] )
{
    int errCode = 0;
    char configFileName[ 256 ];

    // Check the arguments
    //
    switch ( argc ) {
    case 1:              // no parameter, check if default exists, else show help  
       if ( isReadable( SISSM_DEFAULT_CONFIG_NAME ) )  {
           strlcpy( configFileName, SISSM_DEFAULT_CONFIG_NAME, 256 );
           printf("\n%s. Using %s\n\n", VERSION, SISSM_DEFAULT_CONFIG_NAME);
       }
       else
           errCode = 1;
       break;
    case 2:              // single parameter, assume operator specified  sissm.cfg
        strlcpy( configFileName, argv[1], 256 );
        break;
    default:             // all other cases show help and do not run
        errCode = 1;
    }
    if ( errCode )
        printf("\n%s\nSyntax: sissm config-file / sissm -t hostname rconport rconpass\n%s\n", VERSION, COPYRIGHT);

#ifndef _WIN32 
#if SISSM_CRASHREPORT
    // Initialize Linux-only segfault trap with built-in backtrace dump.
    // This will create a "sissm.cfg.crashereporter" file.
    //
    if ( !errCode ) errCode = sissmSegfaultInstall( configFileName );
#endif
#endif

    // Initialize the Config reader, ^C handler, Log Systems, then the Plugins
    //
    if ( !errCode ) errCode = sissmInitLogAndConfig( configFileName );  
    if ( !errCode ) sissmSplash();
    if ( !errCode ) errCode = sissmInitInternal();
    if ( !errCode ) errCode = sissmInitPlugins(); 
 
    // Run quick diagnostics for minimal parameters required to run
    //
    if ( !errCode ) sissmDiagnostics();

    // Optinoally install a SIGTERM handler to intercept ^C user
    // input - this allows individual plugins to take action to leave the server in
    // a playable state in the absense of SISSM.
    //
    if ( sissmConfig.gracefulExit ) sissmSigInstall();

    // Initialize the system, plugins, then spin the main loop
    //
    if ( !errCode ) errCode = sissmMainLoop();

    return( errCode );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x124(%rbp)
subl $0x1, %eax
je 0x9156
jmp 0x9149
movl -0x124(%rbp), %eax
subl $0x2, %eax
je 0x91a6
jmp 0x91c1
leaq 0x1a351(%rip), %rdi     # 0x234ae
callq 0x12750
cmpl $0x0, %eax
je 0x919d
leaq -0x120(%rbp), %rdi
leaq 0x1a339(%rip), %rsi     # 0x234ae
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
leaq 0x1a33a(%rip), %rdi     # 0x234c0
leaq 0x19ff7(%rip), %rsi     # 0x23184
leaq 0x1a31a(%rip), %rdx     # 0x234ae
movb $0x0, %al
callq 0x8170
jmp 0x91a4
movl $0x1, -0x14(%rbp)
jmp 0x91c8
leaq -0x120(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
jmp 0x91c8
movl $0x1, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x91ea
leaq 0x1a2fb(%rip), %rdi     # 0x234d0
leaq 0x19fa8(%rip), %rsi     # 0x23184
leaq 0x19fc7(%rip), %rdx     # 0x231aa
movb $0x0, %al
callq 0x8170
cmpl $0x0, -0x14(%rbp)
jne 0x91ff
leaq -0x120(%rbp), %rdi
callq 0x86d0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x9214
leaq -0x120(%rbp), %rdi
callq 0x8830
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x921f
callq 0x8c30
cmpl $0x0, -0x14(%rbp)
jne 0x922d
callq 0x8b70
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x923b
callq 0x8ac0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x9246
callq 0x8ca0
cmpl $0x0, 0x2a8d3(%rip)     # 0x33b20
je 0x9254
callq 0x8500
cmpl $0x0, -0x14(%rbp)
jne 0x9262
callq 0x8e00
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
nop