// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_SwitchCoreCommand
static int Jim_SwitchCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    enum { SWITCH_EXACT, SWITCH_GLOB, SWITCH_RE, SWITCH_CMD };
    int matchOpt = SWITCH_EXACT, opt = 1, patCount, i;
    int match_flags = 0;
    Jim_Obj *command = NULL, *scriptObj = NULL, *strObj;
    Jim_Obj **caseList;

    if (argc < 3) {
      wrongnumargs:
        Jim_WrongNumArgs(interp, 1, argv, "?options? string "
            "pattern body ... ?default body?   or   " "{pattern body ?pattern body ...?}");
        return JIM_ERR;
    }
    for (opt = 1; opt < argc; ++opt) {
        const char *option = Jim_String(argv[opt]);

        if (*option != '-')
            break;
        else if (strncmp(option, "--", 2) == 0) {
            ++opt;
            break;
        }
        else if (strncmp(option, "-exact", 2) == 0)
            matchOpt = SWITCH_EXACT;
        else if (strncmp(option, "-glob", 2) == 0)
            matchOpt = SWITCH_GLOB;
        else if (strncmp(option, "-regexp", 2) == 0) {
            matchOpt = SWITCH_RE;
            match_flags |= JIM_OPT_END;
        }
        else if (strncmp(option, "-command", 2) == 0) {
            matchOpt = SWITCH_CMD;
            if ((argc - opt) < 2)
                goto wrongnumargs;
            command = argv[++opt];
        }
        else {
            Jim_SetResultFormatted(interp,
                "bad option \"%#s\": must be -exact, -glob, -regexp, -command procname or --",
                argv[opt]);
            return JIM_ERR;
        }
        if ((argc - opt) < 2)
            goto wrongnumargs;
    }
    strObj = argv[opt++];
    patCount = argc - opt;
    if (patCount == 1) {
        JimListGetElements(interp, argv[opt], &patCount, &caseList);
    }
    else
        caseList = (Jim_Obj **)&argv[opt];
    if (patCount == 0 || patCount % 2 != 0)
        goto wrongnumargs;
    for (i = 0; scriptObj == NULL && i < patCount; i += 2) {
        Jim_Obj *patObj = caseList[i];

        if (!Jim_CompareStringImmediate(interp, patObj, "default")
            || i < (patCount - 2)) {
            switch (matchOpt) {
                case SWITCH_EXACT:
                    if (Jim_StringEqObj(strObj, patObj))
                        scriptObj = caseList[i + 1];
                    break;
                case SWITCH_GLOB:
                    if (Jim_StringMatchObj(interp, patObj, strObj, 0))
                        scriptObj = caseList[i + 1];
                    break;
                case SWITCH_RE:
                    command = Jim_NewStringObj(interp, "regexp", -1);

                case SWITCH_CMD:{
                        int rc = Jim_CommandMatchObj(interp, command, patObj, strObj, match_flags);

                        if (argc - opt == 1) {
                            JimListGetElements(interp, argv[opt], &patCount, &caseList);
                        }

                        if (rc < 0) {
                            return -rc;
                        }
                        if (rc)
                            scriptObj = caseList[i + 1];
                        break;
                    }
            }
        }
        else {
            scriptObj = caseList[i + 1];
        }
    }
    for (; i < patCount && Jim_CompareStringImmediate(interp, scriptObj, "-"); i += 2)
        scriptObj = caseList[i + 1];
    if (scriptObj && Jim_CompareStringImmediate(interp, scriptObj, "-")) {
        Jim_SetResultFormatted(interp, "no body specified for pattern \"%#s\"", caseList[i - 2]);
        return JIM_ERR;
    }
    Jim_SetEmptyResult(interp);
    if (scriptObj) {
        return Jim_EvalObj(interp, scriptObj);
    }
    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdx, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
cmpl $0x3, %esi
jl 0x1c906
movl %esi, %r15d
movl $0x1, %ebx
xorl %r13d, %r13d
movl $0x0, -0x3c(%rbp)
movq $0x0, -0x50(%rbp)
movslq %ebx, %r14
movq -0x38(%rbp), %rax
movq (%rax,%r14,8), %r12
movq (%r12), %rax
testq %rax, %rax
jne 0x1c6ff
movq 0x8(%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movq (%r12), %rax
cmpb $0x2d, (%rax)
jne 0x1c77b
cmpb $0x2d, 0x1(%rax)
je 0x1c779
xorl %r13d, %r13d
cmpb $0x65, 0x1(%rax)
je 0x1c75e
movl $0x1, %r13d
cmpb $0x67, 0x1(%rax)
je 0x1c75e
cmpb $0x72, 0x1(%rax)
jne 0x1c731
orl $0x2, -0x3c(%rbp)
movl $0x2, %r13d
jmp 0x1c75e
cmpb $0x63, 0x1(%rax)
jne 0x1ca19
movl %r15d, %eax
subl %ebx, %eax
cmpl $0x2, %eax
jl 0x1c906
incl %ebx
movq -0x38(%rbp), %rax
movq 0x8(%rax,%r14,8), %rax
movq %rax, -0x50(%rbp)
movl $0x3, %r13d
movl %r15d, %eax
subl %ebx, %eax
cmpl $0x2, %eax
jl 0x1c906
incl %ebx
cmpl %r15d, %ebx
jl 0x1c6dc
jmp 0x1c77b
incl %ebx
movslq %ebx, %rax
incl %ebx
movq -0x38(%rbp), %rcx
leaq (%rcx,%rax,8), %rdx
addq $0x8, %rdx
movq -0x8(%rdx), %rax
movq %rax, -0x48(%rbp)
subl %ebx, %r15d
cmpl $0x1, %r15d
jne 0x1c7b8
movq (%rdx), %r12
movq -0x30(%rbp), %rdi
movq %r12, %rsi
callq 0xe2fe
movl 0x20(%r12), %esi
movq 0x18(%r12), %rdx
jmp 0x1c7bb
movl %r15d, %esi
testl %esi, %esi
sete %al
movl %esi, %ecx
orb %al, %cl
testb $0x1, %cl
jne 0x1c906
movq %rsi, %rcx
testl %esi, %esi
jle 0x1c937
movslq %ebx, %rax
movq %rax, -0x68(%rbp)
xorl %ebx, %ebx
movl %r13d, %eax
movq %rax, -0x70(%rbp)
movq -0x30(%rbp), %rdi
movl %r15d, -0x54(%rbp)
movq %rcx, %r15
movq %rdx, %r13
movq (%rdx,%rbx,8), %r12
movq %rdi, %r14
movq %r12, %rsi
leaq 0x10678(%rip), %rdx     # 0x2ce7f
callq 0x73c6
testl %eax, %eax
je 0x1c81f
leal -0x2(%r15), %eax
cltq
cmpq %rax, %rbx
jge 0x1c8dc
movq -0x70(%rbp), %rax
leaq 0xac0e(%rip), %rcx      # 0x27438
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0xb096
jmp 0x1c8d8
movq %r15, -0x60(%rbp)
movq %r14, %r15
movq %r14, %rdi
leaq 0xfd1c(%rip), %rsi      # 0x2c571
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %rsi
jmp 0x1c86f
movq %r15, -0x60(%rbp)
movq -0x50(%rbp), %rsi
movq %r14, %r15
movq %r15, %rdi
movq %rsi, -0x50(%rbp)
movq %r12, %rdx
movq -0x48(%rbp), %rcx
movl -0x3c(%rbp), %r8d
callq 0x11468
movl %eax, %r12d
cmpl $0x1, -0x54(%rbp)
movq %r13, %rdx
movq -0x60(%rbp), %r15
jne 0x1c8ba
movq -0x38(%rbp), %rax
movq -0x68(%rbp), %rcx
movq (%rax,%rcx,8), %r13
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0xe2fe
movl 0x20(%r13), %r15d
movq 0x18(%r13), %rdx
movq -0x30(%rbp), %r14
testl %r12d, %r12d
js 0x1ca11
jne 0x1c8df
xorl %r12d, %r12d
jmp 0x1c901
movq %r12, %rsi
movq -0x48(%rbp), %rdx
xorl %ecx, %ecx
callq 0xb104
testl %eax, %eax
je 0x1c8fb
movq %r13, %rdx
movq %r14, %rdi
movq 0x8(%rdx,%rbx,8), %r12
addq $0x2, %rbx
testq %r12, %r12
jne 0x1c93f
cmpl %ebx, %r15d
jg 0x1c7f3
jmp 0x1c93f
xorl %r12d, %r12d
movq %r13, %rdx
movq %r14, %rdi
jmp 0x1c8e7
leaq 0xfbfc(%rip), %rcx      # 0x2c509
movl $0x1, %r12d
movq -0x30(%rbp), %rdi
movl $0x1, %esi
movq -0x38(%rbp), %rdx
callq 0x7446
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
xorl %ebx, %ebx
movq %rcx, %r15
cmpl %r15d, %ebx
movq %rdx, -0x38(%rbp)
jge 0x1c97f
movq %r15, %r14
movl %ebx, %eax
leaq (%rdx,%rax,8), %r13
addq $0x8, %r13
leaq 0xf552(%rip), %r15      # 0x2beae
movq -0x30(%rbp), %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x73c6
testl %eax, %eax
je 0x1c97f
movq (%r13), %r12
addl $0x2, %ebx
addq $0x10, %r13
cmpl %ebx, %r14d
jg 0x1c95c
testq %r12, %r12
movq -0x30(%rbp), %r14
je 0x1c9c5
leaq 0xf51f(%rip), %rdx      # 0x2beae
movq %r14, %rdi
movq %r12, %rsi
callq 0x73c6
testl %eax, %eax
je 0x1c9c5
movl %ebx, %eax
movq -0x38(%rbp), %rcx
movq -0x10(%rcx,%rax,8), %rdx
leaq 0xfc12(%rip), %rsi      # 0x2c5c2
movq %r14, %rdi
xorl %eax, %eax
callq 0x6923
movl $0x1, %r12d
jmp 0x1c925
movq 0x128(%r14), %rbx
incl 0x10(%rbx)
movq (%r14), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1c9e8
movq %r14, %rdi
callq 0x758c
movq %rbx, (%r14)
testq %r12, %r12
je 0x1ca09
movq %r14, %rdi
movq %r12, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x908a
xorl %r12d, %r12d
jmp 0x1c925
negl %r12d
jmp 0x1c925
movq -0x38(%rbp), %rax
movq (%rax,%r14,8), %rdx
leaq 0xfb50(%rip), %rsi      # 0x2c578
movq -0x30(%rbp), %rdi
jmp 0x1c9b3