// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x8a90
movq %rax, %rdi
callq 0x9370
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x7657(%rip), %rsi      # 0x283fb
xorps %xmm0, %xmm0
movsd %xmm0, -0x10(%rbp)
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x225ab5(%rip)    # 0x246870
movq -0x8(%rbp), %rdi
leaq 0x764b(%rip), %rsi      # 0x28411
movsd 0x75f2(%rip), %xmm0     # 0x283c0
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x225a97(%rip)    # 0x246874
movq -0x8(%rbp), %rdi
leaq 0x7644(%rip), %rsi      # 0x2842c
leaq 0x765c(%rip), %rdx      # 0x2844b
callq 0x9430
movq %rax, %rsi
leaq 0x225e7a(%rip), %rdi    # 0x246c78
movl $0x400, %edx            # imm = 0x400
movq %rdx, -0x18(%rbp)
callq 0x11bc0
movq -0x8(%rbp), %rdi
leaq 0x7641(%rip), %rsi      # 0x28458
leaq 0x7659(%rip), %rdx      # 0x28477
callq 0x9430
movq -0x18(%rbp), %rdx
movq %rax, %rsi
leaq 0x225a47(%rip), %rdi    # 0x246878
callq 0x11bc0
movsd -0x10(%rbp), %xmm0
movq -0x8(%rbp), %rdi
leaq 0x7651(%rip), %rsi      # 0x28497
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x226223(%rip)    # 0x247078
movq -0x8(%rbp), %rdi
leaq 0x7652(%rip), %rsi      # 0x284b2
movsd 0x21a0(%rip), %xmm0     # 0x23008
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x226209(%rip)    # 0x247080
movq -0x8(%rbp), %rdi
leaq 0x764e(%rip), %rsi      # 0x284d0
movsd 0x49d6(%rip), %xmm0     # 0x25860
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x2261e3(%rip)    # 0x24707c
movq -0x8(%rbp), %rdi
leaq 0x764b(%rip), %rsi      # 0x284ef
movsd 0x751c(%rip), %xmm0     # 0x283c8
callq 0x97d0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x7508(%rip), %xmm1     # 0x283d0
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movl %eax, 0x2269ab(%rip)    # 0x247888
movq -0x8(%rbp), %rdi
leaq 0x7626(%rip), %rsi      # 0x2850e
xorps %xmm0, %xmm0
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x22618a(%rip)    # 0x247084
movq -0x8(%rbp), %rdi
leaq 0x7627(%rip), %rsi      # 0x2852c
leaq 0x763b(%rip), %rdx      # 0x28547
callq 0x9430
movq %rax, %rsi
leaq 0x225955(%rip), %rdi    # 0x246870
addq $0x818, %rdi            # imm = 0x818
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x8(%rbp), %rdi
leaq 0x7626(%rip), %rsi      # 0x2855d
leaq 0x7638(%rip), %rdx      # 0x28576
callq 0x9430
movq %rax, %rsi
leaq 0x225923(%rip), %rdi    # 0x246870
addq $0xc18, %rdi            # imm = 0xC18
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x8(%rbp), %rdi
callq 0x93f0
leaq -0x21e(%rip), %rdi      # 0x20d50
callq 0x12940
movq %rax, 0x226916(%rip)    # 0x247890
movl $0x3, %edi
leaq 0x7452(%rip), %rsi      # 0x283d8
leaq 0x75ff(%rip), %rdx      # 0x2858c
movb $0x0, %al
callq 0x21bf0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)