// File: /workspace/github_c_makefile_star2_O2/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_SplitCoreCommand
static int Jim_SplitCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    const char *str, *splitChars, *noMatchStart;
    int splitLen, strLen;
    Jim_Obj *resObjPtr;
    int c;
    int len;

    if (argc != 2 && argc != 3) {
        Jim_WrongNumArgs(interp, 1, argv, "string ?splitChars?");
        return JIM_ERR;
    }

    str = Jim_GetString(argv[1], &len);
    if (len == 0) {
        return JIM_OK;
    }
    strLen = Jim_Utf8Length(interp, argv[1]);


    if (argc == 2) {
        splitChars = " \n\t\r";
        splitLen = 4;
    }
    else {
        splitChars = Jim_String(argv[2]);
        splitLen = Jim_Utf8Length(interp, argv[2]);
    }

    noMatchStart = str;
    resObjPtr = Jim_NewListObj(interp, NULL, 0);


    if (splitLen) {
        Jim_Obj *objPtr;
        while (strLen--) {
            const char *sc = splitChars;
            int scLen = splitLen;
            int sl = utf8_tounicode(str, &c);
            while (scLen--) {
                int pc;
                sc += utf8_tounicode(sc, &pc);
                if (c == pc) {
                    objPtr = Jim_NewStringObj(interp, noMatchStart, (str - noMatchStart));
                    Jim_ListAppendElement(interp, resObjPtr, objPtr);
                    noMatchStart = str + sl;
                    break;
                }
            }
            str += sl;
        }
        objPtr = Jim_NewStringObj(interp, noMatchStart, (str - noMatchStart));
        Jim_ListAppendElement(interp, resObjPtr, objPtr);
    }
    else {
        Jim_Obj **commonObj = NULL;
#define NUM_COMMON (128 - 9)
        while (strLen--) {
            int n = utf8_tounicode(str, &c);
#ifdef JIM_OPTIMIZATION
            if (c >= 9 && c < 128) {

                c -= 9;
                if (!commonObj) {
                    commonObj = Jim_Alloc(sizeof(*commonObj) * NUM_COMMON);
                    memset(commonObj, 0, sizeof(*commonObj) * NUM_COMMON);
                }
                if (!commonObj[c]) {
                    commonObj[c] = Jim_NewStringObj(interp, str, 1);
                }
                Jim_ListAppendElement(interp, resObjPtr, commonObj[c]);
                str++;
                continue;
            }
#endif
            Jim_ListAppendElement(interp, resObjPtr, Jim_NewStringObjUtf8(interp, str, 1));
            str += n;
        }
        Jim_Free(commonObj);
    }

    Jim_SetResult(interp, resObjPtr);
    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movl %esi, %r13d
movq %rdi, %rbx
leal -0x4(%r13), %eax
cmpl $-0x3, %eax
ja 0x1d883
leaq 0xb920(%rip), %rcx      # 0x2918c
pushq $0x1
popq %r14
movq %rbx, %rdi
movl %r14d, %esi
movq %r15, %rdx
callq 0x72a5
jmp 0x1d9d3
movq 0x8(%r15), %rdi
leaq -0x44(%rbp), %r12
movq %r12, %rsi
callq 0x7fc7
movq %rax, -0x30(%rbp)
cmpl $0x0, (%r12)
je 0x1d9d0
movq 0x8(%r15), %rdi
callq 0xa61a
movl %eax, %r12d
cmpl $0x2, %r13d
jne 0x1d8c1
leaq 0xb8e5(%rip), %r13      # 0x291a0
pushq $0x4
popq %r15
jmp 0x1d8d9
movq 0x10(%r15), %rdi
callq 0x7340
movq %rax, %r13
movq 0x10(%r15), %rdi
callq 0xa61a
movl %eax, %r15d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x745b
movq %rax, %r14
testl %r15d, %r15d
je 0x1d977
movq %rbx, -0x38(%rbp)
movl %r15d, %ebx
movq -0x30(%rbp), %r15
movq %r14, -0x40(%rbp)
subl $0x1, %r12d
jb 0x1d951
movb (%r15), %al
xorl %ecx, %ecx
cmpl %ecx, %ebx
je 0x1d94c
leaq 0x1(%rcx), %rdx
cmpb (%r13,%rcx), %al
movq %rdx, %rcx
jne 0x1d90b
movl %r15d, %edx
movq -0x30(%rbp), %rsi
subl %esi, %edx
movq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x7363
movq %r14, %rdi
movq -0x40(%rbp), %r14
movq %r14, %rsi
movq %rax, %rdx
callq 0x74ad
leaq 0x1(%r15), %rax
movq %rax, -0x30(%rbp)
incq %r15
jmp 0x1d900
movq -0x30(%rbp), %rsi
subl %esi, %r15d
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movl %r15d, %edx
callq 0x7363
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74ad
jmp 0x1d9b0
pushq $0x1
popq %r15
movq -0x30(%rbp), %r13
subl $0x1, %r12d
jb 0x1d9a6
movq %rbx, %rdi
movq %r13, %rsi
movl %r15d, %edx
callq 0x7363
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74ad
incq %r13
jmp 0x1d97f
xorl %edi, %edi
xorl %esi, %esi
callq *0x158d8(%rip)          # 0x33288
incl 0x10(%r14)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1d9cd
movq %rbx, %rdi
callq 0x73bf
movq %r14, (%rbx)
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq