// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/pidynbots.c
// Function: modeBotCountOffset
static int _modeBotCountOffset( int *minimumOffset, int *maximumOffset )
{
    static char gameModeCurrent[ API_ROSTER_STRING_MAX ];
    char wMin[16], wMax[16], *w;
    int  iMin,     iMax;
    int  i, errCode = 1;

    *minimumOffset = 0;
    *maximumOffset = 0;

    // Get current game mode: "checkpoint", "hardcorecheckpoint"....
    //
    strlcpy( gameModeCurrent, apiGameModePropertyGet( "gamemodetagname" ), API_ROSTER_STRING_MAX );
    if ( 0 != strlen( gameModeCurrent ) ) 
        logPrintf( LOG_LEVEL_INFO, "pidynbots", "GameMode is ::%s::", gameModeCurrent ); 
    else 
        logPrintf( LOG_LEVEL_WARN, "pidynbots", "** Unable to read; current GameMode" );

    // Look for a match in gamemode vs. the supported offsets table
    //
    if ( 0 != strlen( gameModeCurrent ) )  {
        for ( i = 0; i < PIDYN_MAXMODES; i++ ) {
            w = getWord( pidynbotsConfig.modeAdjust[i], 0, " " );
            if ( w == NULL )        break;
            if ( strlen( w ) == 0 ) break;

            strclr( wMin ); strclr( wMax );
           
            if ( 0 == strcasecmp( w, gameModeCurrent ) ) {  // gamemode match
                w = getWord( pidynbotsConfig.modeAdjust[i], 1, " " );
                if ( w != NULL ) strlcpy( wMin, w, 16 );
                w = getWord( pidynbotsConfig.modeAdjust[i], 2, " " );
                if ( w != NULL ) strlcpy( wMax, w, 16 );
                
                if ( 1 == sscanf( wMin, "%d", &iMin )) {
                    if ( 1 == sscanf( wMax, "%d", &iMax )) {
                        *minimumOffset = iMin;
                        *maximumOffset = iMax;
                        logPrintf( LOG_LEVEL_INFO, "pidynbots", "GameMode ::%s:: BotCount Offset for Min/Max is %d and %d", gameModeCurrent, iMin, iMax );
                        errCode = 0;
                        break;
                    }
                }
            }
        } 
    }
    if ( errCode ) {
        logPrintf( LOG_LEVEL_WARN, "pidynbots", "Unable to parse GameMode BotCount Offset in sissm.cfg" );
    }

    return errCode;   
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, -0x48(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, (%rax)
movq -0x10(%rbp), %rax
movl $0x0, (%rax)
leaq 0x147c0(%rip), %rdi     # 0x25112
callq 0x17720
movq %rax, %rsi
leaq 0x97fbf(%rip), %rdi     # 0xa8920
movl $0x4000, %edx           # imm = 0x4000
callq 0x11bc0
leaq 0x97fae(%rip), %rdi     # 0xa8920
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x109a4
movl $0x2, %edi
leaq 0x145ec(%rip), %rsi     # 0x24f79
leaq 0x1478e(%rip), %rdx     # 0x25122
leaq 0x97f85(%rip), %rcx     # 0xa8920
movb $0x0, %al
callq 0x21bf0
jmp 0x109be
movl $0x1, %edi
leaq 0x145c9(%rip), %rsi     # 0x24f79
leaq 0x1477e(%rip), %rdx     # 0x25135
movb $0x0, %al
callq 0x21bf0
leaq 0x97f5b(%rip), %rdi     # 0xa8920
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x10b8c
movl $0x0, -0x44(%rbp)
cmpl $0x10, -0x44(%rbp)
jge 0x10b8a
movslq -0x44(%rbp), %rax
leaq 0x736f4(%rip), %rdi     # 0x840e8
addq $0x20020, %rdi          # imm = 0x20020
shlq $0xa, %rax
addq %rax, %rdi
xorl %esi, %esi
leaq 0x1374d(%rip), %rdx     # 0x24158
callq 0x122d0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x10a20
jmp 0x10b8a
movq -0x38(%rbp), %rdi
callq 0x8110
cmpq $0x0, %rax
jne 0x10a34
jmp 0x10b8a
leaq -0x20(%rbp), %rdi
callq 0x122b0
leaq -0x30(%rbp), %rdi
callq 0x122b0
movq -0x38(%rbp), %rdi
leaq 0x97ecf(%rip), %rsi     # 0xa8920
callq 0x8040
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x10b7a
movslq -0x44(%rbp), %rax
leaq 0x7367b(%rip), %rdi     # 0x840e8
addq $0x20020, %rdi          # imm = 0x20020
shlq $0xa, %rax
addq %rax, %rdi
movl $0x1, %esi
leaq 0x136d1(%rip), %rdx     # 0x24158
callq 0x122d0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x10aa9
leaq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x10, %edx
callq 0x11bc0
movslq -0x44(%rbp), %rax
leaq 0x73634(%rip), %rdi     # 0x840e8
addq $0x20020, %rdi          # imm = 0x20020
shlq $0xa, %rax
addq %rax, %rdi
movl $0x2, %esi
leaq 0x1368a(%rip), %rdx     # 0x24158
callq 0x122d0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x10af0
leaq -0x30(%rbp), %rdi
movq -0x38(%rbp), %rsi
movl $0x10, %edx
callq 0x11bc0
leaq -0x20(%rbp), %rdi
leaq 0x135d4(%rip), %rsi     # 0x240cf
leaq -0x3c(%rbp), %rdx
movb $0x0, %al
callq 0x82c0
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x10b78
leaq -0x30(%rbp), %rdi
leaq 0x135b3(%rip), %rsi     # 0x240cf
leaq -0x40(%rbp), %rdx
movb $0x0, %al
callq 0x82c0
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x10b76
movl -0x3c(%rbp), %ecx
movq -0x8(%rbp), %rax
movl %ecx, (%rax)
movl -0x40(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movl -0x3c(%rbp), %r8d
movl -0x40(%rbp), %r9d
movl $0x2, %edi
leaq 0x14421(%rip), %rsi     # 0x24f79
leaq 0x145fa(%rip), %rdx     # 0x25159
leaq 0x97dba(%rip), %rcx     # 0xa8920
movb $0x0, %al
callq 0x21bf0
movl $0x0, -0x48(%rbp)
jmp 0x10b8a
jmp 0x10b78
jmp 0x10b7a
jmp 0x10b7c
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x109df
jmp 0x10b8c
cmpl $0x0, -0x48(%rbp)
je 0x10bac
movl $0x1, %edi
leaq 0x143db(%rip), %rsi     # 0x24f79
leaq 0x145ed(%rip), %rdx     # 0x25192
movb $0x0, %al
callq 0x21bf0
movl -0x48(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)