// File: /workspace/github_c_makefile_star2_O1/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 $0x38, %rsp
movl %esi, %r12d
movq %rdi, %r13
leal -0x4(%r12), %eax
cmpl $-0x3, %eax
ja 0x20a89
leaq 0xd72c(%rip), %rcx      # 0x2e19e
movl $0x1, %ebx
movq %r13, %rdi
movl $0x1, %esi
callq 0x7454
jmp 0x20c8d
movq 0x8(%rdx), %r15
cmpq $0x0, (%r15)
jne 0x20aa3
movq 0x8(%r15), %rax
movq %r15, %rdi
movq %rdx, %rbx
callq *0x18(%rax)
movq %rbx, %rdx
cmpl $0x0, 0x14(%r15)
je 0x20ae7
movq (%r15), %rbx
movq 0x8(%rdx), %r14
cmpq $0x0, (%r14)
jne 0x20ac7
movq 0x8(%r14), %rax
movq %r14, %rdi
movq %rdx, %r15
callq *0x18(%rax)
movq %r15, %rdx
movl 0x14(%r14), %r15d
cmpl $0x2, %r12d
movq %rbx, -0x30(%rbp)
jne 0x20aee
leaq 0xd6d6(%rip), %rax      # 0x2e1b2
movq %rax, -0x48(%rbp)
movl $0x4, %ebx
jmp 0x20b2a
xorl %ebx, %ebx
jmp 0x20c8d
movq 0x10(%rdx), %r14
cmpq $0x0, (%r14)
jne 0x20b08
movq 0x8(%r14), %rax
movq %r14, %rdi
movq %rdx, %r12
callq *0x18(%rax)
movq %r12, %rdx
movq (%r14), %rax
movq %rax, -0x48(%rbp)
movq 0x10(%rdx), %r12
cmpq $0x0, (%r12)
jne 0x20b25
movq 0x8(%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movl 0x14(%r12), %ebx
movq %r13, %rdi
callq 0xae58
leaq 0x1581f(%rip), %rcx     # 0x36358
movq %rcx, 0x8(%rax)
movq $0x0, (%rax)
xorps %xmm0, %xmm0
movq %rax, -0x38(%rbp)
movups %xmm0, 0x18(%rax)
testl %ebx, %ebx
je 0x20bd9
movq %r13, -0x40(%rbp)
testl %r15d, %r15d
je 0x20c40
movl %ebx, %r12d
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
decl %r15d
movq %r15, -0x50(%rbp)
movb (%rbx), %dl
leaq 0x1(%rbx), %rax
movq %rax, -0x58(%rbp)
xorl %r15d, %r15d
movb %dl, -0x30(%rbp)
cmpl %r15d, %r12d
je 0x20bcb
movq -0x48(%rbp), %rax
movb (%rax,%r15), %r14b
cmpb %r14b, %dl
jne 0x20bc3
movl %ebx, %edx
subl %esi, %edx
movq %rbx, %r13
movq -0x40(%rbp), %rbx
movq %rbx, %rdi
callq 0x7516
movq %rbx, %rdi
movq %r13, %rbx
movq -0x38(%rbp), %rsi
movq %rax, %rdx
callq 0x7695
movb -0x30(%rbp), %dl
movq -0x58(%rbp), %rsi
incq %r15
cmpb %r14b, %dl
jne 0x20b85
incq %rbx
movq -0x50(%rbp), %r15
testl %r15d, %r15d
jne 0x20b6e
jmp 0x20c47
testl %r15d, %r15d
movq -0x30(%rbp), %r12
je 0x20c30
xorl %ebx, %ebx
movq %r13, %rdi
callq 0xae58
movq %rax, %r14
movl $0x2, %esi
xorl %edi, %edi
callq *0x1768c(%rip)          # 0x38288
movb (%r12,%rbx), %cl
movb %cl, (%rax)
movb $0x0, 0x1(%rax)
movq %rax, (%r14)
movl $0x1, 0x14(%r14)
movq $0x0, 0x8(%r14)
movq %r13, %rdi
movq -0x38(%rbp), %rsi
movq %r14, %rdx
callq 0x7695
incq %rbx
cmpl %ebx, %r15d
jne 0x20be4
xorl %edi, %edi
xorl %esi, %esi
callq *0x1764e(%rip)          # 0x38288
movq -0x38(%rbp), %r15
jmp 0x20c69
movq -0x30(%rbp), %rbx
movq %rbx, %rsi
subl %esi, %ebx
movq -0x40(%rbp), %r13
movq %r13, %rdi
movl %ebx, %edx
callq 0x7516
movq %r13, %rdi
movq -0x38(%rbp), %r15
movq %r15, %rsi
movq %rax, %rdx
callq 0x7695
xorl %ebx, %ebx
incl 0x10(%r15)
movq (%r13), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x20c89
movq %r13, %rdi
callq 0x759a
movq %r15, (%r13)
movl %ebx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq