// File: /workspace/github_c_makefile_star2_O2/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 0x8973
movq %rax, %rdi
callq 0x8f80
movq %rax, %rbx
leaq 0x6bb6(%rip), %rsi      # 0x1f3c3
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x22604d(%rip)    # 0x23e870
leaq 0x6baf(%rip), %rsi      # 0x1f3d9
movsd 0x6b56(%rip), %xmm0     # 0x1f388
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x226030(%rip)    # 0x23e874
leaq 0x6ba9(%rip), %rsi      # 0x1f3f4
leaq 0x6bc1(%rip), %rdx      # 0x1f413
movq %rbx, %rdi
callq 0x8ff5
leaq 0x226417(%rip), %rdi    # 0x23ec78
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x6bab(%rip), %rsi      # 0x1f420
leaq 0x6bc3(%rip), %rdx      # 0x1f43f
movq %rbx, %rdi
callq 0x8ff5
leaq 0x225fed(%rip), %rdi    # 0x23e878
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x6bc0(%rip), %rsi      # 0x1f45f
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x2267c3(%rip)    # 0x23f078
leaq 0x6bbe(%rip), %rsi      # 0x1f47a
movsd 0x1764(%rip), %xmm0     # 0x1a028
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x2267aa(%rip)    # 0x23f080
leaq 0x6bbb(%rip), %rsi      # 0x1f498
movsd 0x3f5b(%rip), %xmm0     # 0x1c840
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x226785(%rip)    # 0x23f07c
leaq 0x6bb9(%rip), %rsi      # 0x1f4b7
movsd 0x6a8a(%rip), %xmm0     # 0x1f390
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %rax
movq %rax, %rcx
subsd 0x6a7a(%rip), %xmm0     # 0x1f398
cvttsd2si %xmm0, %rdx
sarq $0x3f, %rcx
andl %ecx, %edx
orl %edx, %eax
movl %eax, 0x226f57(%rip)    # 0x23f888
leaq 0x6b9e(%rip), %rsi      # 0x1f4d6
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x226736(%rip)    # 0x23f084
leaq 0x6b9f(%rip), %rsi      # 0x1f4f4
leaq 0x6bb3(%rip), %rdx      # 0x1f50f
movq %rbx, %rdi
callq 0x8ff5
leaq 0x22671d(%rip), %rdi    # 0x23f088
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x6ba6(%rip), %rsi      # 0x1f525
leaq 0x6bb8(%rip), %rdx      # 0x1f53e
movq %rbx, %rdi
callq 0x8ff5
leaq 0x226af3(%rip), %rdi    # 0x23f488
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
movq %rbx, %rdi
callq 0x8fd6
leaq -0x1d9(%rip), %rdi      # 0x187d8
callq 0xf145
movq %rax, 0x226ed3(%rip)    # 0x23f890
leaq 0x69dc(%rip), %rsi      # 0x1f3a0
leaq 0x6b89(%rip), %rdx      # 0x1f554
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x1920b
xorl %eax, %eax
popq %rbx
retq