// File: /workspace/github_c_makefile_star2_O1/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 0x8969
movq %rax, %rdi
callq 0x9004
movq %rax, %rbx
leaq 0x6c7c(%rip), %rsi      # 0x20413
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x2250c3(%rip)    # 0x23e870
leaq 0x6c75(%rip), %rsi      # 0x20429
movsd 0x6c1c(%rip), %xmm0     # 0x203d8
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x2250a6(%rip)    # 0x23e874
leaq 0x6c6f(%rip), %rsi      # 0x20444
leaq 0x6c87(%rip), %rdx      # 0x20463
movq %rbx, %rdi
callq 0x907b
leaq 0x22548d(%rip), %rdi    # 0x23ec78
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x6c71(%rip), %rsi      # 0x20470
leaq 0x6c89(%rip), %rdx      # 0x2048f
movq %rbx, %rdi
callq 0x907b
leaq 0x225063(%rip), %rdi    # 0x23e878
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x6c86(%rip), %rsi      # 0x204af
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x225839(%rip)    # 0x23f078
leaq 0x6c84(%rip), %rsi      # 0x204ca
movsd 0x17da(%rip), %xmm0     # 0x1b028
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x225820(%rip)    # 0x23f080
leaq 0x6c81(%rip), %rsi      # 0x204e8
movsd 0x3ff1(%rip), %xmm0     # 0x1d860
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x2257fb(%rip)    # 0x23f07c
leaq 0x6c7f(%rip), %rsi      # 0x20507
movsd 0x6b50(%rip), %xmm0     # 0x203e0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x6b40(%rip), %xmm0     # 0x203e8
cvttsd2si %xmm0, %rdx
sarq $0x3f, %rcx
andl %ecx, %edx
orl %edx, %eax
movl %eax, 0x225fcd(%rip)    # 0x23f888
leaq 0x6c64(%rip), %rsi      # 0x20526
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x2257ac(%rip)    # 0x23f084
leaq 0x6c65(%rip), %rsi      # 0x20544
leaq 0x6c79(%rip), %rdx      # 0x2055f
movq %rbx, %rdi
callq 0x907b
leaq 0x225793(%rip), %rdi    # 0x23f088
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x6c6c(%rip), %rsi      # 0x20575
leaq 0x6c7e(%rip), %rdx      # 0x2058e
movq %rbx, %rdi
callq 0x907b
leaq 0x225b69(%rip), %rdi    # 0x23f488
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
movq %rbx, %rdi
callq 0x905c
leaq -0x1db(%rip), %rdi      # 0x19760
callq 0xf8d7
movq %rax, 0x225f49(%rip)    # 0x23f890
leaq 0x6aa2(%rip), %rsi      # 0x203f0
leaq 0x6c4f(%rip), %rdx      # 0x205a4
movl $0x3, %edi
xorl %eax, %eax
callq 0x1a227
xorl %eax, %eax
popq %rbx
retq