// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_ParseSubCmd
const jim_subcmd_type *Jim_ParseSubCmd(Jim_Interp *interp, const jim_subcmd_type * command_table,
    int argc, Jim_Obj *const *argv)
{
    const jim_subcmd_type *ct;
    const jim_subcmd_type *partial = 0;
    int cmdlen;
    Jim_Obj *cmd;
    const char *cmdstr;
    int help = 0;
    int argsok = 1;

    if (argc < 2) {
        Jim_SetResultFormatted(interp, "wrong # args: should be \"%#s command ...\"\n"
            "Use \"%#s -help ?command?\" for help", argv[0], argv[0]);
        return 0;
    }

    cmd = argv[1];


    if (cmd->typePtr == &subcmdLookupObjType) {
        if (cmd->internalRep.ptrIntValue.ptr == command_table) {
            ct = command_table + cmd->internalRep.ptrIntValue.int1;
            goto found;
        }
    }


    if (Jim_CompareStringImmediate(interp, cmd, "-help")) {
        if (argc == 2) {

            show_cmd_usage(interp, command_table, argc, argv);
            return &dummy_subcmd;
        }
        help = 1;


        cmd = argv[2];
    }


    if (Jim_CompareStringImmediate(interp, cmd, "-commands")) {
        Jim_SetResult(interp, subcmd_cmd_list(interp, command_table, " "));
        return &dummy_subcmd;
    }

    cmdstr = Jim_GetString(cmd, &cmdlen);

    for (ct = command_table; ct->cmd; ct++) {
        if (Jim_CompareStringImmediate(interp, cmd, ct->cmd)) {

            break;
        }
        if (strncmp(cmdstr, ct->cmd, cmdlen) == 0) {
            if (partial) {

                if (help) {

                    show_cmd_usage(interp, command_table, argc, argv);
                    return &dummy_subcmd;
                }
                bad_subcmd(interp, command_table, "ambiguous", argv[0], argv[1 + help]);
                return 0;
            }
            partial = ct;
        }
        continue;
    }


    if (partial && !ct->cmd) {
        ct = partial;
    }

    if (!ct->cmd) {

        if (help) {

            show_cmd_usage(interp, command_table, argc, argv);
            return &dummy_subcmd;
        }
        bad_subcmd(interp, command_table, "unknown", argv[0], argv[1 + help]);
        return 0;
    }

    if (help) {
        Jim_SetResultString(interp, "Usage: ", -1);

        add_cmd_usage(interp, ct, argv[0]);
        return &dummy_subcmd;
    }


    Jim_FreeIntRep(interp, cmd);
    cmd->typePtr = &subcmdLookupObjType;
    cmd->internalRep.ptrIntValue.ptr = (void *)command_table;
    cmd->internalRep.ptrIntValue.int1 = ct - command_table;

found:


    if (argc - 2 < ct->minargs) {
        argsok = 0;
    }
    else if (ct->maxargs >= 0 && argc - 2 > ct->maxargs) {
        argsok = 0;
    }
    else if (ct->maxargs < -1 && (argc - 2) % -ct->maxargs != 0) {

        argsok = 0;
    }
    if (!argsok) {
        Jim_SetResultString(interp, "wrong # args: should be \"", -1);

        add_cmd_usage(interp, ct, argv[0]);
        Jim_AppendStrings(interp, Jim_GetResult(interp), "\"", NULL);

        return 0;
    }


    return ct;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r13
movq %rdi, %rbx
cmpl $0x1, %edx
jg 0x11acb
movq (%r13), %rcx
leaq 0x19552(%rip), %rsi     # 0x2b008
xorl %r15d, %r15d
movq %rbx, %rdi
movq %rcx, %rdx
xorl %eax, %eax
callq 0x6923
jmp 0x11d40
movl %edx, %r12d
movq %rsi, %r15
movq 0x8(%r13), %r14
leaq 0x23dfc(%rip), %rax     # 0x358d8
cmpq %rax, 0x8(%r14)
jne 0x11aec
cmpq %r15, 0x18(%r14)
je 0x11c5d
leaq 0x19868(%rip), %rdx     # 0x2b35b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x73c6
testl %eax, %eax
je 0x11b22
cmpl $0x2, %r12d
jne 0x11b1e
movq (%r13), %r14
leaq 0x1ba00(%rip), %rdx     # 0x2d513
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x11d1d
movq 0x10(%r13), %r14
movl %eax, -0x2c(%rbp)
leaq 0x19493(%rip), %rdx     # 0x2afbf
movq %rbx, %rdi
movq %r14, %rsi
callq 0x73c6
testl %eax, %eax
je 0x11b74
leaq 0x1b9d2(%rip), %rdx     # 0x2d514
movq %rbx, %rdi
movq %r15, %rsi
callq 0x11e23
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x11b6c
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
jmp 0x11d39
movl %r12d, -0x4c(%rbp)
movq (%r14), %r12
testq %r12, %r12
jne 0x11b8d
movq 0x8(%r14), %rax
movq %r14, %rdi
callq *0x18(%rax)
movq (%r14), %r12
movq %r15, -0x38(%rbp)
movq (%r15), %rdx
testq %rdx, %rdx
je 0x11d05
movq %r13, -0x48(%rbp)
movq %rbx, -0x40(%rbp)
movslq 0x14(%r14), %r13
xorl %ebx, %ebx
movq -0x38(%rbp), %r15
movq -0x40(%rbp), %rdi
movq %r14, %rsi
callq 0x73c6
testl %eax, %eax
jne 0x11bea
movq (%r15), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x60b0
testl %eax, %eax
jne 0x11bdd
testq %rbx, %rbx
movq %r15, %rbx
jne 0x11db5
movq 0x20(%r15), %rdx
addq $0x20, %r15
testq %rdx, %rdx
jne 0x11baf
testq %rbx, %rbx
je 0x11bf7
cmpq $0x0, (%r15)
cmoveq %rbx, %r15
movq -0x40(%rbp), %rbx
movq -0x48(%rbp), %r13
cmpq $0x0, (%r15)
je 0x11d05
cmpl $0x0, -0x2c(%rbp)
je 0x11d71
leaq 0x19445(%rip), %rsi     # 0x2b05f
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x11c46
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
movq (%r13), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x119fd
jmp 0x11d39
movslq 0x20(%r14), %rax
shlq $0x5, %rax
addq %rax, %r15
addl $-0x2, %r12d
movswl 0x18(%r15), %eax
cmpl %eax, %r12d
jl 0x11ca5
movswl 0x1a(%r15), %ecx
testl %ecx, %ecx
setns %al
cmpl %ecx, %r12d
setg %dl
testb %dl, %al
jne 0x11ca5
cmpw $-0x2, %cx
jg 0x11d40
negl %ecx
movl %r12d, %eax
xorl %edx, %edx
divl %ecx
testl %edx, %edx
je 0x11d40
leaq 0x19342(%rip), %rsi     # 0x2afee
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x11cd8
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
movq (%r13), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x119fd
movq (%rbx), %rsi
leaq 0x19c8c(%rip), %rdx     # 0x2b980
xorl %r15d, %r15d
movq %rbx, %rdi
xorl %ecx, %ecx
xorl %eax, %eax
callq 0xafd1
jmp 0x11d40
movq (%r13), %r14
cmpl $0x0, -0x2c(%rbp)
je 0x11d52
leaq 0x1b7fd(%rip), %rdx     # 0x2d513
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x11e23
leaq 0x1b7fb(%rip), %rsi     # 0x2d524
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x6923
leaq 0x23bc0(%rip), %r15     # 0x35900
movq %r15, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%r13), %r8
leaq 0x19060(%rip), %rdx     # 0x2adbd
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %r14, %rcx
callq 0x11ef8
xorl %r15d, %r15d
jmp 0x11d40
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x11d8b
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x11d8b
movq %rbx, %rdi
movq %r14, %rsi
callq *%rax
leaq 0x23b46(%rip), %rax     # 0x358d8
movq %rax, 0x8(%r14)
movq -0x38(%rbp), %rcx
movq %rcx, 0x18(%r14)
movq %r15, %rax
subq %rcx, %rax
shrq $0x5, %rax
movl %eax, 0x20(%r14)
movl -0x4c(%rbp), %r12d
jmp 0x11c68
movq -0x48(%rbp), %rax
movq (%rax), %rcx
cmpl $0x0, -0x2c(%rbp)
je 0x11dd7
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq %rcx, %rdx
callq 0x11def
jmp 0x11d39
movq 0x8(%rax), %r8
leaq 0x19273(%rip), %rdx     # 0x2b055
movq -0x40(%rbp), %rdi
movq -0x38(%rbp), %rsi
jmp 0x11d67