// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/piprotect.c
// Function: piprotectInitConfig
int piprotectInitConfig( void )
{
    cfsPtr cP;
    int i;
    char varArray[256];

    cP = cfsCreate( sissmGetConfigPath() );

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

    // algorithm #1 - detected repeated false starts and kick
    //
    piprotectConfig.enableStartFail = 
        (int) cfsFetchNum( cP, "piprotect.enableStartFail",     1.0 );  // 0=disable 1=enable
    piprotectConfig.countThreshold = 
        (int) cfsFetchNum( cP, "piprotect.countThreshold",     16.0 );  // 10 pkt/sec = 40ms/msg
    piprotectConfig.blackoutWindowSec = 
        (int) cfsFetchNum( cP, "piprotect.blackoutWindowSec",  10.0 );  // 10sec blackout after kick 


    // algorithm #2 - block join on high risk objectives/counterattacks
    //
    piprotectConfig.enableBlockJoin = 
        (int) cfsFetchNum( cP, "piprotect.enableBlockJoin",     1.0 );  // 0=disable 1=enable
    for ( i=0; i<PIPROT_MAXLASTOBJTABLE; i++ ) {
        // Read the join limit table
        //
        snprintf( varArray, 256, "piprotect.joinLimit[%d]", i );
        strlcpy( piprotectConfig.joinLimit[i], cfsFetchStr( cP, varArray,  "" ), CFS_FETCH_MAX);
    }

    strlcpy( piprotectConfig.kickReason, cfsFetchStr( cP, "piprotect.kickReason", "Server Internal Error" ), CFS_FETCH_MAX);

    cfsDestroy( cP );

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
callq 0x8a90
movq %rax, %rdi
callq 0x9370
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x14239(%rip), %rsi     # 0x251d0
xorps %xmm0, %xmm0
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x9b977(%rip)     # 0xac920
movq -0x8(%rbp), %rdi
leaq 0x14232(%rip), %rsi     # 0x251e6
movsd 0x1204c(%rip), %xmm0    # 0x23008
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x9b959(%rip)     # 0xac924
movq -0x8(%rbp), %rdi
leaq 0x1422a(%rip), %rsi     # 0x25200
movsd 0x141ea(%rip), %xmm0    # 0x251c8
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x9b93b(%rip)     # 0xac928
movq -0x8(%rbp), %rdi
leaq 0x14221(%rip), %rsi     # 0x25219
movsd 0x126e8(%rip), %xmm0    # 0x236e8
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x9b91d(%rip)     # 0xac92c
movq -0x8(%rbp), %rdi
leaq 0x1421b(%rip), %rsi     # 0x25235
movsd 0x11fe6(%rip), %xmm0    # 0x23008
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x9bcff(%rip)     # 0xacd30
movl $0x0, -0xc(%rbp)
cmpl $0x78, -0xc(%rbp)
jge 0x110b0
leaq -0x110(%rbp), %rdi
movl -0xc(%rbp), %ecx
movl $0x100, %esi            # imm = 0x100
leaq 0x141fb(%rip), %rdx     # 0x2524f
movb $0x0, %al
callq 0x8180
movslq -0xc(%rbp), %rcx
leaq 0x9b8ba(%rip), %rax     # 0xac920
addq $0x414, %rax            # imm = 0x414
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq 0x12685(%rip), %rdx     # 0x23711
callq 0x9430
movq -0x118(%rbp), %rdi
movq %rax, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x11038
movq -0x8(%rbp), %rdi
leaq 0x141ac(%rip), %rsi     # 0x25267
leaq 0x141ba(%rip), %rdx     # 0x2527c
callq 0x9430
movq %rax, %rsi
leaq 0x9b84f(%rip), %rdi     # 0xac920
addq $0x10, %rdi
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x8(%rbp), %rdi
callq 0x93f0
xorl %eax, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)