// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/pigateway.c
// Function: pigatewayInitConfig
int pigatewayInitConfig( void )
{
    cfsPtr cP;

    cP = cfsCreate( sissmGetConfigPath() );

    // read "pigateway.pluginstate" variable from the .cfg file
    //
    pigatewayConfig.pluginState = (int) cfsFetchNum( cP, "pigateway.pluginState", 0.0 );  // disabled by default

    pigatewayConfig.firstAdminSlotNo = (int) cfsFetchNum( cP, "pigateway.firstAdminSlotNo", 11 );
    strlcpy( pigatewayConfig.adminPortKickMsgFull, 
        cfsFetchStr( cP, "pigateway.adminPortKickMsgFull", "Server full." ), CFS_FETCH_MAX);
    strlcpy( pigatewayConfig.adminPortKickMsgLock, 
        cfsFetchStr( cP, "pigateway.adminPortKickMsgLock", "Server hosting a special event." ), CFS_FETCH_MAX);

    pigatewayConfig.lockServerOnIdle = (int) cfsFetchNum( cP, "pigateway.lockServerOnIdle", 0 );


    pigatewayConfig.enableBadNameFilter = (int) cfsFetchNum( cP, "pigateway.enableBadNameFilter", 1 );
    pigatewayConfig.gameChangeLockoutSec = (int) cfsFetchNum( cP, "pigateway.gameChangeLockoutSec", 120 );
    // strlcpy( pigatewayConfig.adminListFilePath,  
        // cfsFetchStr( cP, "pigateway.adminListFilePath",  "admins.txt" ), CFS_FETCH_MAX);
    pigatewayConfig.allowInWindowTimeSec = (unsigned long int) cfsFetchNum( cP, "pigateway.allowInWindowTimeSec", 180 );

    pigatewayConfig.minPlayerNameLength = (int) cfsFetchNum( cP, "pigateway.minPlayerNameLength", 0 );
    strlcpy( pigatewayConfig.minPlayerNameMsg,  
        cfsFetchStr( cP, "pigateway.minPlayerNameMsg", "Player name too short" ), CFS_FETCH_MAX);
    strlcpy( pigatewayConfig.chatTrollWords,  
        cfsFetchStr( cP, "pigateway.chatTrollWords", "admin: admins: admin;" ), CFS_FETCH_MAX);

    cfsDestroy( cP );

    // _priSlots_init( pigatewayConfig.adminListFilePath, 0 );

    // pigatewayConfig.adminPortDisable = 0;
    pigatewayConfig.aPtr = alarmCreate( pigatewayGameChangeAlarmCB );
    logPrintf( LOG_LEVEL_DEBUG, "pigateway", "Created lockout alarm" );

    return 0;
}

// Assembly:
pushq %rbx
callq 0x8970
movq %rax, %rdi
callq 0x8ffc
movq %rax, %rbx
leaq 0x6ab8(%rip), %rsi      # 0x20403
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x224f0f(%rip)    # 0x23e870
leaq 0x6ab1(%rip), %rsi      # 0x20419
movsd 0x6a58(%rip), %xmm0     # 0x203c8
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x224ef2(%rip)    # 0x23e874
leaq 0x6aab(%rip), %rsi      # 0x20434
leaq 0x6ac3(%rip), %rdx      # 0x20453
movq %rbx, %rdi
callq 0x9073
leaq 0x2252d9(%rip), %rdi    # 0x23ec78
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x6aad(%rip), %rsi      # 0x20460
leaq 0x6ac5(%rip), %rdx      # 0x2047f
movq %rbx, %rdi
callq 0x9073
leaq 0x224eaf(%rip), %rdi    # 0x23e878
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x6ac2(%rip), %rsi      # 0x2049f
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x225685(%rip)    # 0x23f078
leaq 0x6ac0(%rip), %rsi      # 0x204ba
movsd 0x1626(%rip), %xmm0     # 0x1b028
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x22566c(%rip)    # 0x23f080
leaq 0x6abd(%rip), %rsi      # 0x204d8
movsd 0x3e15(%rip), %xmm0     # 0x1d838
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x225647(%rip)    # 0x23f07c
leaq 0x6abb(%rip), %rsi      # 0x204f7
movsd 0x698c(%rip), %xmm0     # 0x203d0
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x697c(%rip), %xmm0     # 0x203d8
cvttsd2si %xmm0, %rdx
sarq $0x3f, %rcx
andl %ecx, %edx
orl %edx, %eax
movl %eax, 0x225e19(%rip)    # 0x23f888
leaq 0x6aa0(%rip), %rsi      # 0x20516
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x2255f8(%rip)    # 0x23f084
leaq 0x6aa1(%rip), %rsi      # 0x20534
leaq 0x6ab5(%rip), %rdx      # 0x2054f
movq %rbx, %rdi
callq 0x9073
leaq 0x2255df(%rip), %rdi    # 0x23f088
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x6aa8(%rip), %rsi      # 0x20565
leaq 0x6aba(%rip), %rdx      # 0x2057e
movq %rbx, %rdi
callq 0x9073
leaq 0x2259b5(%rip), %rdi    # 0x23f488
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
movq %rbx, %rdi
callq 0x9054
leaq -0x1db(%rip), %rdi      # 0x19914
callq 0xfc23
movq %rax, 0x225d95(%rip)    # 0x23f890
leaq 0x68de(%rip), %rsi      # 0x203e0
leaq 0x6a8b(%rip), %rdx      # 0x20594
movl $0x3, %edi
xorl %eax, %eax
callq 0x1a3e3
xorl %eax, %eax
popq %rbx
retq