// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
callq 0x8969
movq %rax, %rdi
callq 0x9004
movq %rax, %rbx
leaq 0xf29c(%rip), %rsi      # 0x1ce48
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x6e526(%rip)     # 0x7c0e8
leaq 0xf295(%rip), %rsi      # 0x1ce5e
movsd 0xd43f(%rip), %xmm0     # 0x1b010
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x6e509(%rip)     # 0x7c0ec
leaq 0xf28d(%rip), %rsi      # 0x1ce77
movsd 0xf23e(%rip), %xmm0     # 0x1ce30
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x6e4ec(%rip)     # 0x7c0f0
leaq 0xf285(%rip), %rsi      # 0x1ce90
movsd 0xdacd(%rip), %xmm0     # 0x1b6e0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x6e4cf(%rip)     # 0x7c0f4
leaq 0xf289(%rip), %rsi      # 0x1ceb5
movsd 0xf204(%rip), %xmm0     # 0x1ce38
movq %rbx, %rdi
callq 0x9276
movsd %xmm0, 0x6e4bc(%rip)    # 0x7c100
leaq 0xf281(%rip), %rsi      # 0x1cecc
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x928a7(%rip)     # 0xa0508
leaq 0xf27b(%rip), %rsi      # 0x1cee3
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x9288e(%rip)     # 0xa050c
leaq 0xf279(%rip), %rsi      # 0x1cefe
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x92875(%rip)     # 0xa0510
leaq 0xf274(%rip), %rsi      # 0x1cf16
movsd 0xda46(%rip), %xmm0     # 0x1b6f0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x6e43c(%rip)     # 0x7c0f8
leaq 0xf271(%rip), %rsi      # 0x1cf34
leaq 0xda47(%rip), %r14      # 0x1b711
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x92838(%rip), %rdi     # 0xa0514
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x6e418(%rip), %r15     # 0x7c108
leaq 0xf252(%rip), %r12      # 0x1cf49
movq %rsp, %r13
xorl %ebp, %ebp
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
movq %r12, %rdx
movl %ebp, %ecx
xorl %eax, %eax
callq 0x8190
movq %rbx, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x907b
movl $0x400, %edx            # imm = 0x400
movq %r15, %rdi
movq %rax, %rsi
callq 0xf038
incq %rbp
addq $0x400, %r15            # imm = 0x400
cmpq $0x80, %rbp
jne 0xdcfc
leaq 0x8e3c0(%rip), %r14     # 0x9c108
movq %rsp, %r12
leaq 0xf227(%rip), %rbp      # 0x1cf79
leaq 0xf22a(%rip), %r15      # 0x1cf83
xorl %r13d, %r13d
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
leaq 0xf1f5(%rip), %rdx      # 0x1cf60
movl %r13d, %ecx
xorl %eax, %eax
callq 0x8190
movq %rbx, %rdi
movq %r12, %rsi
leaq 0xd98f(%rip), %rdx      # 0x1b711
callq 0x907b
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rax, %rsi
callq 0xf038
movl $0x2, %edi
movq %rbp, %rsi
movq %r15, %rdx
movl %r13d, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x1a227
incq %r13
addq $0x400, %r14            # imm = 0x400
cmpq $0x10, %r13
jne 0xdd5c
leaq 0xf1ea(%rip), %rsi      # 0x1cfb0
leaq 0xd944(%rip), %rdx      # 0x1b711
movq %rbx, %rdi
callq 0x907b
leaq 0x9232c(%rip), %rdi     # 0xa0108
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
movq %rbx, %rdi
callq 0x905c
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq