// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/picladmin.c
// Function: cmdBotScaled
int _cmdBotScaled( char *arg, char *arg2, char *passThru ) 
{ 
    int errCode = 1, botCount, botCountMin, botCountMax;

    if (1 == sscanf( arg, "%d", &botCountMax )) {    // assume single param case
        if ( (botCountMax <= picladminConfig.botMaxAllowed) && (botCountMax >= 2) ) {
            botCountMin = picladminConfig.botMinDefault;
            errCode = 0;
            if ( 1 == sscanf( arg2, "%d", &botCount )) {  // check for 2nd param
                botCountMin = botCountMax;
                botCountMax = botCount;
                if ( picladminConfig.botUpperMin != 0 ) {
                    if ( botCountMin > picladminConfig.botUpperMin )
                        botCountMin = picladminConfig.botUpperMin;   // limit min
                }
                if ( botCountMin > botCountMax )                   errCode = 1;
                if ( botCountMax > picladminConfig.botMaxAllowed ) errCode = 1;
                if ( botCountMax <  2 )                            errCode = 1;
            }
        }
    }
    if ( 0 == errCode ) {
        apiGameModePropertySet( "minimumenemies", _int2str( botCountMin / 2 ) );
        apiGameModePropertySet( "maximumenemies", _int2str( botCountMax / 2 ) );
        // apiGameModePropertySet( "soloenemies", _int2str( botCountMax ) );  
        p2pSetL( "picladmin.p2p.botAdminControl", 1L );  // flag as admin control
        p2pSetL( "pidynbots.p2p.sigBotScaled", 1L );  // signal to pidynbots (if running)
    }
    _stddResp( errCode );   // ok or error message to game

    return errCode; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x19019(%rip), %rsi     # 0x240cf
leaq -0x28(%rbp), %rdx
movb $0x0, %al
callq 0x82c0
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0xb179
movl -0x28(%rbp), %eax
cmpl 0x5586b(%rip), %eax     # 0x60944
jg 0xb177
cmpl $0x2, -0x28(%rbp)
jl 0xb177
movl 0x55859(%rip), %eax     # 0x60948
movl %eax, -0x24(%rbp)
movl $0x0, -0x1c(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x18fcb(%rip), %rsi     # 0x240cf
leaq -0x20(%rbp), %rdx
movb $0x0, %al
callq 0x82c0
movl %eax, %ecx
movl $0x1, %eax
cmpl %ecx, %eax
jne 0xb175
movl -0x28(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x28(%rbp)
cmpl $0x0, 0x5581f(%rip)     # 0x6094c
je 0xb145
movl -0x24(%rbp), %eax
cmpl 0x55814(%rip), %eax     # 0x6094c
jle 0xb143
movl 0x5580c(%rip), %eax     # 0x6094c
movl %eax, -0x24(%rbp)
jmp 0xb145
movl -0x24(%rbp), %eax
cmpl -0x28(%rbp), %eax
jle 0xb154
movl $0x1, -0x1c(%rbp)
movl -0x28(%rbp), %eax
cmpl 0x557e7(%rip), %eax     # 0x60944
jle 0xb166
movl $0x1, -0x1c(%rbp)
cmpl $0x2, -0x28(%rbp)
jge 0xb173
movl $0x1, -0x1c(%rbp)
jmp 0xb175
jmp 0xb177
jmp 0xb179
xorl %eax, %eax
cmpl -0x1c(%rbp), %eax
jne 0xb1e4
movl -0x24(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0xb050
movq %rax, %rsi
leaq 0x188a7(%rip), %rdi     # 0x23a43
callq 0x176f0
movl -0x28(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edi
callq 0xb050
movq %rax, %rsi
leaq 0x18895(%rip), %rdi     # 0x23a52
callq 0x176f0
leaq 0x188a4(%rip), %rdi     # 0x23a6d
movl $0x1, %esi
callq 0x1ebf0
leaq 0x188b1(%rip), %rdi     # 0x23a8b
movl $0x1, %esi
callq 0x1ebf0
movl -0x1c(%rbp), %edi
callq 0xa4d0
movl -0x1c(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)