// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/api.c
// Function: apiMutActive
char *apiMutActive( int fetchNow ) 
{
    static char mutatorsActive[ API_LINE_STRING_MAX ]; 
    static int  firstTime = 1;
    char        mutatorsGMP[ API_MUT_GMP_MAX ];
    char        *savedPointer[ API_MUT_MAXLIST ];
    int         i, j, skipThis;

    if ( firstTime || fetchNow ) {

        strlcpy( mutatorsGMP, apiGameModePropertyGetRaw( "mutators" ), API_MUT_GMP_MAX );
        logPrintf( LOG_LEVEL_DEBUG, "api", "RCON Mutators ::%s::", mutatorsGMP );

        strclr( mutatorsActive );
        j = 0;

        while (0 != strlen( mutAllowedListSorted[j] )) {

            if ( NULL != (savedPointer[j] = strcasestr( mutatorsGMP, mutAllowedListSorted[j] ) )) {

                // look for previously found duplicate at the same string position to 
                // eliminate erroneous reporting of mutator names that are subset string
                // e.g., "bob100" and "bob10" -- for this to work "sorted" list must be used
                // with descending string size (greatest to least string size)
                //
                skipThis = 0;
                if (j != 0) 
                    for (i = 0; i<j; i++ ) 
                        if ( savedPointer[j] == savedPointer[i] ) 
                            skipThis = 1;

                // if no duplicate found, append to list of active mutators
                //
                if ( !skipThis ) {
                    strlcat( mutatorsActive, mutAllowedListSorted[j], API_MUT_MAXCHAR );
                    strlcat( mutatorsActive, " ",                     API_MUT_MAXCHAR );
                }
            }

            if ( ++j > API_MUT_MAXLIST ) break;   // increment w/ memory overwrite safety stop
        }
    }

    // If no mutators found, return "none".  
    // then eliminate all leading/trailing spaces.
    //
    if ( 0 == strlen( mutatorsActive ) ) strlcpy( mutatorsActive, "none",  API_LINE_STRING_MAX );
    strTrimInPlace( mutatorsActive );

    firstTime = 0;

    return mutatorsActive;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1230, %rsp           # imm = 0x1230
movl %edi, -0x4(%rbp)
cmpl $0x0, 0x190db(%rip)     # 0x31ed0
jne 0x18e01
cmpl $0x0, -0x4(%rbp)
je 0x18f9c
leaq -0x1010(%rbp), %rax
movq %rax, -0x1228(%rbp)
leaq 0xd8ab(%rip), %rdi      # 0x266c1
callq 0x17810
movq -0x1228(%rbp), %rdi
movq %rax, %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x11bc0
leaq -0x1010(%rbp), %rcx
movl $0x3, %edi
leaq 0xd055(%rip), %rsi      # 0x25e97
leaq 0xd881(%rip), %rdx      # 0x266ca
movb $0x0, %al
callq 0x21bf0
leaq 0x1f3199(%rip), %rdi    # 0x20bff0
callq 0x122b0
movl $0x0, -0x1218(%rbp)
movslq -0x1218(%rbp), %rax
leaq 0x14555c(%rip), %rdi    # 0x15e3d0
imulq $0x50, %rax, %rax
addq %rax, %rdi
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x18f9a
leaq -0x1010(%rbp), %rdi
movslq -0x1218(%rbp), %rax
leaq 0x14552d(%rip), %rsi    # 0x15e3d0
imulq $0x50, %rax, %rax
addq %rax, %rsi
callq 0x8340
movq %rax, %rcx
movslq -0x1218(%rbp), %rax
movq %rcx, -0x1210(%rbp,%rax,8)
xorl %eax, %eax
cmpq %rcx, %rax
je 0x18f7f
movl $0x0, -0x121c(%rbp)
cmpl $0x0, -0x1218(%rbp)
je 0x18f36
movl $0x0, -0x1214(%rbp)
movl -0x1214(%rbp), %eax
cmpl -0x1218(%rbp), %eax
jge 0x18f34
movslq -0x1218(%rbp), %rax
movq -0x1210(%rbp,%rax,8), %rax
movslq -0x1214(%rbp), %rcx
cmpq -0x1210(%rbp,%rcx,8), %rax
jne 0x18f21
movl $0x1, -0x121c(%rbp)
jmp 0x18f23
movl -0x1214(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1214(%rbp)
jmp 0x18ee9
jmp 0x18f36
cmpl $0x0, -0x121c(%rbp)
jne 0x18f7d
movslq -0x1218(%rbp), %rax
leaq 0x145483(%rip), %rsi    # 0x15e3d0
imulq $0x50, %rax, %rax
addq %rax, %rsi
leaq 0x1f3095(%rip), %rdi    # 0x20bff0
movl $0x50, %edx
callq 0x11aa0
leaq 0x1f3084(%rip), %rdi    # 0x20bff0
leaq 0xb1e5(%rip), %rsi      # 0x24158
movl $0x50, %edx
callq 0x11aa0
jmp 0x18f7f
movl -0x1218(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1218(%rbp)
cmpl $0x40, %eax
jle 0x18f95
jmp 0x18f9a
jmp 0x18e66
jmp 0x18f9c
leaq 0x1f304d(%rip), %rdi    # 0x20bff0
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x18fca
leaq 0x1f3037(%rip), %rdi    # 0x20bff0
leaq 0xd6fc(%rip), %rsi      # 0x266bc
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
leaq 0x1f301f(%rip), %rdi    # 0x20bff0
callq 0x12450
movl $0x0, 0x18ef0(%rip)     # 0x31ed0
leaq 0x1f3009(%rip), %rax    # 0x20bff0
addq $0x1230, %rsp           # imm = 0x1230
popq %rbp
retq