// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x180(%rbp), %rdi
callq 0x122b0
movq -0x8(%rbp), %rdi
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0xc935
leaq 0x17688(%rip), %rdi     # 0x23faa
movb $0x0, %al
callq 0x17af0
movl $0x1, -0x1c(%rbp)
jmp 0xca52
movq -0x18(%rbp), %rdi
leaq 0x17691(%rip), %rsi     # 0x23fd1
callq 0x8340
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0xc956
movl $0x1, -0x20(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x17677(%rip), %rsi     # 0x23fd8
callq 0x8340
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0xc977
movl $0x1, -0x24(%rbp)
movl $0x2, -0x188(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x122b0
movq -0x18(%rbp), %rdi
movl -0x188(%rbp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, -0x188(%rbp)
leaq 0x177b2(%rip), %rdx     # 0x24158
callq 0x122d0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xc9b8
jmp 0xc9ef
movq -0x30(%rbp), %rdi
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0xc9cd
jmp 0xc9ef
movq -0x30(%rbp), %rdi
callq 0x18920
cmpl $0x0, %eax
je 0xc9ed
leaq -0x80(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl $0x50, %edx
callq 0x11bc0
jmp 0xc98a
leaq -0x180(%rbp), %rdi
callq 0x8110
movl %eax, %ecx
movl %ecx, -0x184(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
je 0xca1c
movl -0x184(%rbp), %eax
subl $0x1, %eax
cltq
movb $0x0, -0x180(%rbp,%rax)
movq -0x8(%rbp), %rdi
leaq -0x80(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x20(%rbp), %ecx
leaq -0x180(%rbp), %r8
xorl %r9d, %r9d
callq 0x18990
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0xca50
leaq 0x17594(%rip), %rdi     # 0x23fdd
movb $0x0, %al
callq 0x17af0
jmp 0xca52
movl -0x1c(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nop