// File: /workspace/github_c_makefile_star2_O2/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 0x19fe9
pushq $0x1
popq %rbx
movq $0x0, -0x50(%rbp)
movl $0x0, -0x3c(%rbp)
xorl %r12d, %r12d
movl %esi, %r13d
subl %ebx, %r13d
jle 0x19e8e
movl %esi, %r14d
movslq %ebx, %r15
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %rdi
callq 0x7340
cmpb $0x2d, (%rax)
jne 0x19e87
cmpb $0x2d, 0x1(%rax)
movl %r14d, %esi
je 0x19e8c
xorl %r12d, %r12d
cmpb $0x65, 0x1(%rax)
je 0x19e77
cmpb $0x67, 0x1(%rax)
jne 0x19e42
pushq $0x1
jmp 0x19e75
cmpb $0x72, 0x1(%rax)
jne 0x19e50
orl $0x2, -0x3c(%rbp)
pushq $0x2
jmp 0x19e75
cmpb $0x63, 0x1(%rax)
jne 0x1a0d0
cmpl $0x2, %r13d
jl 0x19fe9
incl %ebx
movq -0x38(%rbp), %rax
movq 0x8(%rax,%r15,8), %rax
movq %rax, -0x50(%rbp)
pushq $0x3
popq %r12
movl %esi, %eax
subl %ebx, %eax
incl %ebx
cmpl $0x2, %eax
jge 0x19e02
jmp 0x19fe9
movl %r14d, %esi
jmp 0x19e8e
incl %ebx
movslq %ebx, %rax
incl %ebx
movq -0x38(%rbp), %rcx
leaq (%rcx,%rax,8), %r14
addq $0x8, %r14
movq -0x8(%r14), %rax
movq %rax, -0x48(%rbp)
subl %ebx, %esi
cmpl $0x1, %esi
movl %esi, -0x54(%rbp)
jne 0x19ec9
movq (%r14), %r14
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x8b3c
movl %eax, %r13d
movq 0x18(%r14), %r14
jmp 0x19ecc
movl %esi, %r13d
testl %r13d, %r13d
sete %al
movl %r13d, %ecx
orb %al, %cl
testb $0x1, %cl
jne 0x19fe9
movslq %ebx, %rax
movq %rax, -0x60(%rbp)
xorl %ebx, %ebx
movl %r12d, %eax
movq %rax, -0x68(%rbp)
xorl %r12d, %r12d
movslq %r13d, %r15
testq %r12, %r12
jne 0x1a016
cmpq %r15, %rbx
jge 0x1a016
movq (%r14,%rbx,8), %r12
movq -0x30(%rbp), %rdi
movq %r12, %rsi
leaq 0xefb5(%rip), %rdx      # 0x28ecf
callq 0x7223
testl %eax, %eax
je 0x19f32
leal -0x2(%r13), %eax
cltq
cmpq %rax, %rbx
jge 0x19fdb
movq -0x68(%rbp), %rax
leaq 0x949b(%rip), %rcx      # 0x233d8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x48(%rbp), %rdi
movq %r12, %rsi
callq 0xa7f8
jmp 0x19fd7
movq -0x30(%rbp), %r15
movq %r15, %rdi
leaq 0xe65c(%rip), %rsi      # 0x285c1
pushq $-0x1
popq %rdx
callq 0x7363
jmp 0x19f77
movq -0x30(%rbp), %r15
movq -0x50(%rbp), %rax
movq %r15, %rdi
movq %rax, -0x50(%rbp)
movq %rax, %rsi
movq %r12, %rdx
movq -0x48(%rbp), %rcx
movl -0x3c(%rbp), %r8d
callq 0x101bd
movl %eax, %r12d
cmpl $0x1, -0x54(%rbp)
jne 0x19fb9
movq -0x38(%rbp), %rax
movq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %r14
movq -0x30(%rbp), %rdi
movq %r14, %rsi
callq 0x8b3c
movl %eax, %r13d
movq 0x18(%r14), %r14
testl %r12d, %r12d
js 0x1a0c0
jne 0x19fdb
xorl %r12d, %r12d
jmp 0x19fe0
movq %r12, %rsi
movq -0x48(%rbp), %rdx
xorl %ecx, %ecx
callq 0xa85d
testl %eax, %eax
je 0x19fc4
movq 0x8(%r14,%rbx,8), %r12
addq $0x2, %rbx
jmp 0x19ef3
leaq 0xe569(%rip), %rcx      # 0x28559
pushq $0x1
popq %r12
movq -0x30(%rbp), %rdi
movl %r12d, %esi
movq -0x38(%rbp), %rdx
callq 0x72a5
movl %r12d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x30(%rbp), %r13
cmpq %r15, %rbx
jge 0x1a040
leaq 0xded8(%rip), %rdx      # 0x27efe
movq %r13, %rdi
movq %r12, %rsi
callq 0x7223
testl %eax, %eax
je 0x1a040
movq 0x8(%r14,%rbx,8), %r12
addq $0x2, %rbx
jmp 0x1a01a
testq %r12, %r12
je 0x1a07a
leaq 0xdeb2(%rip), %rdx      # 0x27efe
movq %r13, %rdi
movq %r12, %rsi
callq 0x7223
testl %eax, %eax
je 0x1a07a
andl $-0x2, %ebx
movq -0x10(%r14,%rbx,8), %rdx
leaq 0xe5a8(%rip), %rsi      # 0x28612
movq %r13, %rdi
xorl %eax, %eax
callq 0x68a7
pushq $0x1
popq %r12
jmp 0x1a004
movq 0x128(%r13), %rbx
incl 0x10(%rbx)
movq (%r13), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1a09e
movq %r13, %rdi
callq 0x73bf
movq %rbx, (%r13)
testq %r12, %r12
je 0x1a0c8
movq %r13, %rdi
movq %r12, %rsi
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b54
negl %r12d
jmp 0x1a004
xorl %r12d, %r12d
jmp 0x1a004
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %rdx
leaq 0xe4e9(%rip), %rsi      # 0x285c8
movq -0x30(%rbp), %rdi
jmp 0x1a06d