// File: /workspace/github_c_makefile_star2_O2/schroeder-lvb[P]sissm/src/picladmin.c
// Function: cmdMapX
int _cmdMapX( char *arg, char *arg2, char *passThru ) 
{ 
    int errCode = 0;
    int isNight = 0, isIns = 0;
    char *w, gameMode[80];
    char mutatorsList[256];
    int i, j;

    strclr( mutatorsList );
    if ( 0 == strlen( arg ) ) {
        apiSaySys( "You must specify a map.  Type !maplist");
        errCode = 1;
    }
    else {
        // Look for "ins" (Insurgent) and "night" (Night lighting) modes.
        //
        if (NULL != strcasestr( passThru, " night" )) isNight = 1;
        if (NULL != strcasestr( passThru, " ins"   )) isIns   = 1;

        // Look for optional gamemode:  checkpoint, checkpointhardcore, etc.
        // Because new game mode may be added as a mod, this table must be 
        // maintained in the config file.
        //
        j = 2;
        strclr( gameMode );
        while ( 1 == 1 ) {
            w = getWord( passThru, j++, " " );
            if ( w == NULL )       break;
            if ( 0 == strlen( w )) break;
#if 0 
            if ( w[0] == '%' ) {
                strlcat( mutatorsList, &w[1], 256 );
                strlcat( mutatorsList, ",",  256 );
            };
#endif

            if ( apiIsSupportedGameMode( w ) ) {
                strlcpy( gameMode, w, 80 );
            }
        } 

        // clean up the mutatorsList (remove trailing comma)
        //
        if ( 0 != ( i = (int) strlen( mutatorsList ) )) {
            mutatorsList[ i-1 ] = 0;
        }

        // change map
        errCode = apiMapChange( arg, gameMode, isIns, isNight, mutatorsList, 0 );

        if ( errCode ) {
            apiSaySys( "Map/mode/side not found" );
        }
    }
    return errCode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x60(%rsp), %rdi
callq 0xed98
cmpb $0x0, (%rbx)
je 0xb2bd
movq %rbx, 0x8(%rsp)
leaq 0xfdd5(%rip), %rsi      # 0x1afc9
movq %r14, %rdi
callq 0x8360
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x4(%rsp)
leaq 0xfdc1(%rip), %rsi      # 0x1afd0
movq %r14, %rdi
callq 0x8360
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, (%rsp)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0xed98
pushq $0x2
popq %r13
leaq 0xff14(%rip), %rbx      # 0x1b14e
pushq $0x50
popq %rbp
movq %r14, %rdi
movl %r13d, %esi
movq %rbx, %rdx
callq 0xed9c
testq %rax, %rax
je 0xb277
movq %rax, %r15
cmpb $0x0, (%rax)
je 0xb277
movq %r15, %rdi
callq 0x13038
testl %eax, %eax
je 0xb272
movq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0xe97a
incl %r13d
jmp 0xb23d
leaq 0x60(%rsp), %rdi
callq 0x8120
testl %eax, %eax
je 0xb28e
decl %eax
cltq
movb $0x0, 0x60(%rsp,%rax)
leaq 0x10(%rsp), %rsi
leaq 0x60(%rsp), %r8
xorl %ebx, %ebx
movq 0x8(%rsp), %rdi
movl (%rsp), %edx
movl 0x4(%rsp), %ecx
xorl %r9d, %r9d
callq 0x13086
testl %eax, %eax
je 0xb2ce
leaq 0xfd1c(%rip), %rdi      # 0x1afd5
movl %eax, %ebx
jmp 0xb2c7
pushq $0x1
popq %rbx
leaq 0xfcdb(%rip), %rdi      # 0x1afa2
xorl %eax, %eax
callq 0x12753
movl %ebx, %eax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq