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

    cP = cfsCreate( sissmGetConfigPath() );

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

    pidynbotsConfig.MinimumEnemies  = (int) cfsFetchNum( cP, "pidynbots.MinimumEnemies",  3.0 );  // minimumenemies
    pidynbotsConfig.MaximumEnemies  = (int) cfsFetchNum( cP, "pidynbots.MaximumEnemies", 18.0 );  // maximumenemies
    pidynbotsConfig.MaxPlayersToScaleEnemyCount = (int) cfsFetchNum( cP, "pidynbots.MaxPlayerToScaleEnemyCount", 10.0);
    pidynbotsConfig.AIDifficulty = (double) cfsFetchNum( cP, "pidynbots.AIDifficulty",    0.5 );  // AIDifficulty

    pidynbotsConfig.enableObjAdj         = (int) cfsFetchNum( cP, "pidynbots.enableObjAdj", 0.0 );  
    pidynbotsConfig.enableDisconnAdj     = (int) cfsFetchNum( cP, "pidynbots.enableDisconnAdj", 0.0 );  
    pidynbotsConfig.enableConnAdj        = (int) cfsFetchNum( cP, "pidynbots.enableConnAdj", 0.0 );  
    pidynbotsConfig.MaxBotsCrashProtect  = (int) cfsFetchNum( cP, "pidynbots.MaxBotsCrashProtect", 200.0 ); 

    strlcpy( pidynbotsConfig.showInGame, cfsFetchStr( cP, "pidynbots.showInGame", "" ), CFS_FETCH_MAX );  

    // Read the adjustment table
    //
    for ( i=0; i<PIDYN_MAXADJUSTERS; i++ ) {
        snprintf( varArray, 256, "pidynbots.Adjuster[%d]", i );
        strlcpy( pidynbotsConfig.Adjuster[i], cfsFetchStr( cP, varArray,  "" ), CFS_FETCH_MAX);
    }

    // Read the game mode adjustment offset table
    //
    for ( i=0; i<PIDYN_MAXMODES; i++ ) {
        snprintf( varArray, 256, "pidynbots.modeAdjust[%d]", i );
        strlcpy( pidynbotsConfig.modeAdjust[i], cfsFetchStr( cP, varArray,  "" ), CFS_FETCH_MAX);
        logPrintf( LOG_LEVEL_INFO, "pidynbots", "Reading GameMode BotOffset Table: ::%d::%s::", i, pidynbotsConfig.modeAdjust[i] ); 
    }

    // Read the botbias table
    //
    strlcpy( pidynbotsConfig.BotBias, cfsFetchStr( cP, "pidynbots.botbias",  "" ), 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 0x150e1(%rip), %rsi     # 0x24e48
xorps %xmm0, %xmm0
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x7436f(%rip)     # 0x840e8
movq -0x8(%rbp), %rdi
leaq 0x150da(%rip), %rsi     # 0x24e5e
movsd 0x13294(%rip), %xmm0    # 0x23020
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x74351(%rip)     # 0x840ec
movq -0x8(%rbp), %rdi
leaq 0x150d1(%rip), %rsi     # 0x24e77
movsd 0x15092(%rip), %xmm0    # 0x24e40
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x74333(%rip)     # 0x840f0
movq -0x8(%rbp), %rdi
leaq 0x150c8(%rip), %rsi     # 0x24e90
movsd 0x13918(%rip), %xmm0    # 0x236e8
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x74315(%rip)     # 0x840f4
movq -0x8(%rbp), %rdi
leaq 0x150cb(%rip), %rsi     # 0x24eb5
movsd 0x15046(%rip), %xmm0    # 0x24e38
callq 0x97d0
movsd %xmm0, 0x74301(%rip)    # 0x84100
movq -0x8(%rbp), %rdi
leaq 0x150c2(%rip), %rsi     # 0x24ecc
xorps %xmm0, %xmm0
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x986ec(%rip)     # 0xa8508
movq -0x8(%rbp), %rdi
leaq 0x150bc(%rip), %rsi     # 0x24ee3
xorps %xmm0, %xmm0
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x986d3(%rip)     # 0xa850c
movq -0x8(%rbp), %rdi
leaq 0x150ba(%rip), %rsi     # 0x24efe
xorps %xmm0, %xmm0
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x986ba(%rip)     # 0xa8510
movq -0x8(%rbp), %rdi
leaq 0x150b5(%rip), %rsi     # 0x24f16
movsd 0x1388f(%rip), %xmm0    # 0x236f8
callq 0x97d0
cvttsd2si %xmm0, %eax
movl %eax, 0x74280(%rip)     # 0x840f8
movq -0x8(%rbp), %rdi
leaq 0x150b1(%rip), %rsi     # 0x24f34
leaq 0x13887(%rip), %rdx     # 0x23711
callq 0x9430
movq %rax, %rsi
leaq 0x7424f(%rip), %rdi     # 0x840e8
addq $0x2442c, %rdi          # imm = 0x2442C
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movl $0x0, -0xc(%rbp)
cmpl $0x80, -0xc(%rbp)
jge 0xff2a
leaq -0x110(%rbp), %rdi
movl -0xc(%rbp), %ecx
movl $0x100, %esi            # imm = 0x100
leaq 0x15079(%rip), %rdx     # 0x24f49
movb $0x0, %al
callq 0x8180
movslq -0xc(%rbp), %rcx
leaq 0x74206(%rip), %rax     # 0x840e8
addq $0x20, %rax
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, -0x118(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq 0x1380b(%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 0xfeb1
movl $0x0, -0xc(%rbp)
cmpl $0x10, -0xc(%rbp)
jge 0xffe6
leaq -0x110(%rbp), %rdi
movl -0xc(%rbp), %ecx
movl $0x100, %esi            # imm = 0x100
leaq 0x1500f(%rip), %rdx     # 0x24f60
movb $0x0, %al
callq 0x8180
movslq -0xc(%rbp), %rcx
leaq 0x74185(%rip), %rax     # 0x840e8
addq $0x20020, %rax          # imm = 0x20020
shlq $0xa, %rcx
addq %rcx, %rax
movq %rax, -0x120(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
leaq 0x13788(%rip), %rdx     # 0x23711
callq 0x9430
movq -0x120(%rbp), %rdi
movq %rax, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movl -0xc(%rbp), %ecx
movslq -0xc(%rbp), %rax
leaq 0x74138(%rip), %r8      # 0x840e8
addq $0x20020, %r8           # imm = 0x20020
shlq $0xa, %rax
addq %rax, %r8
movl $0x2, %edi
leaq 0x14faf(%rip), %rsi     # 0x24f79
leaq 0x14fb2(%rip), %rdx     # 0x24f83
movb $0x0, %al
callq 0x21bf0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xff31
movq -0x8(%rbp), %rdi
leaq 0x14fbf(%rip), %rsi     # 0x24fb0
leaq 0x13719(%rip), %rdx     # 0x23711
callq 0x9430
movq %rax, %rsi
leaq 0x740e1(%rip), %rdi     # 0x840e8
addq $0x24020, %rdi          # imm = 0x24020
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movq -0x8(%rbp), %rdi
callq 0x93f0
xorl %eax, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopl (%rax)