// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: JimInvokeCommand
static int JimInvokeCommand(Jim_Interp *interp, int objc, Jim_Obj *const *objv)
{
    int retcode;
    Jim_Cmd *cmdPtr;
    void *prevPrivData;
    Jim_Obj *tailcallObj = NULL;

#if 0
    printf("invoke");
    int j;
    for (j = 0; j < objc; j++) {
        printf(" '%s'", Jim_String(objv[j]));
    }
    printf("\n");
#endif

    cmdPtr = Jim_GetCommand(interp, objv[0], JIM_ERRMSG);
    if (cmdPtr == NULL) {
        return JimUnknown(interp, objc, objv);
    }
    JimIncrCmdRefCount(cmdPtr);

    if (interp->evalDepth == interp->maxEvalDepth) {
        Jim_SetResultString(interp, "Infinite eval recursion", -1);
        retcode = JIM_ERR;
        goto out;
    }
    interp->evalDepth++;
    prevPrivData = interp->cmdPrivData;

tailcall:

    interp->evalFrame->argc = objc;
    interp->evalFrame->argv = objv;
    interp->evalFrame->cmd = cmdPtr;

    if (!interp->traceCmdObj ||
        (retcode = JimTraceCallback(interp, "cmd", objc, objv)) == JIM_OK) {

        Jim_SetEmptyResult(interp);
        if (cmdPtr->isproc) {
            retcode = JimCallProcedure(interp, cmdPtr, objc, objv);
        }
        else {
            interp->cmdPrivData = cmdPtr->u.native.privData;
            retcode = cmdPtr->u.native.cmdProc(interp, objc, objv);
        }
        if (retcode == JIM_ERR) {
            JimSetErrorStack(interp, NULL);
        }
    }

    if (tailcallObj) {

        Jim_DecrRefCount(interp, tailcallObj);
        tailcallObj = NULL;
    }


    interp->evalFrame->argc = 0;
    interp->evalFrame->argv = NULL;


    if (retcode == JIM_EVAL && interp->framePtr->tailcallObj) {
        JimDecrCmdRefCount(interp, cmdPtr);


        cmdPtr = interp->framePtr->tailcallCmd;
        interp->framePtr->tailcallCmd = NULL;
        tailcallObj = interp->framePtr->tailcallObj;
        interp->framePtr->tailcallObj = NULL;
        objc = tailcallObj->internalRep.listValue.len;
        objv = tailcallObj->internalRep.listValue.ele;
        goto tailcall;
    }

    interp->cmdPrivData = prevPrivData;
    interp->evalDepth--;

out:
    JimDecrCmdRefCount(interp, cmdPtr);

    if (retcode == JIM_ERR) {
        JimSetErrorStack(interp, NULL);
    }

    if (interp->framePtr->tailcallObj) {
        JimDecrCmdRefCount(interp, interp->framePtr->tailcallCmd);
        Jim_DecrRefCount(interp, interp->framePtr->tailcallObj);
        interp->framePtr->tailcallCmd = NULL;
        interp->framePtr->tailcallObj = NULL;
    }

    return retcode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r13
movl %esi, -0x2c(%rbp)
movq %rdi, %rbx
movq (%rdx), %rsi
movl $0x1, %r15d
movl $0x1, %edx
callq 0x67d1
testq %rax, %rax
je 0x1058d
movq %rax, %r14
incl (%rax)
movl 0x24(%rbx), %eax
cmpl 0x20(%rbx), %eax
jne 0x10623
leaq 0x1bc7c(%rip), %rsi     # 0x2c1ca
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r15
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1057a
movq %rbx, %rdi
callq 0x758c
movq %r15, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x189aa
jmp 0x10796
cmpl $0x32, 0x1b0(%rbx)
jg 0x107f2
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x67d1
testq %rax, %rax
je 0x107f2
incl 0x1b0(%rbx)
movq %r13, -0x38(%rbp)
movq 0x198(%rbx), %r13
movl -0x2c(%rbp), %r12d
movslq %r12d, %r14
incl %r12d
leaq 0x8(,%r14,8), %rsi
xorl %edi, %edi
callq *0x26ca9(%rip)          # 0x37288
movq %rax, %r15
movq %r13, (%rax)
leaq 0x8(%rax), %rdi
shlq $0x3, %r14
movq -0x38(%rbp), %rsi
movq %r14, %rdx
callq 0x6320
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
callq 0x10431
movl %eax, %r14d
movq %r15, %rdi
xorl %esi, %esi
callq *0x26c73(%rip)          # 0x37288
decl 0x1b0(%rbx)
movl %r14d, %eax
jmp 0x107f5
incl %eax
movl %eax, 0x24(%rbx)
movq 0x1b8(%rbx), %rax
movq %rax, -0x40(%rbp)
xorl %r12d, %r12d
movl -0x2c(%rbp), %edx
movq 0x108(%rbx), %rax
movl %edx, 0x28(%rax)
movq %r13, 0x20(%rax)
movq %r14, 0x10(%rax)
cmpq $0x0, 0x1a8(%rbx)
je 0x10674
movq %rbx, %rdi
leaq 0x1bb83(%rip), %rsi     # 0x2c1e2
movl %edx, %r15d
movq %r13, %rcx
callq 0x1b0de
movl %r15d, %edx
movl %eax, %r15d
testl %eax, %eax
jne 0x106ef
movq 0x128(%rbx), %r15
incl 0x10(%r15)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x106a6
movq %rbx, %rdi
movq %r13, -0x38(%rbp)
movl %edx, %r13d
callq 0x758c
movl %r13d, %edx
movq -0x38(%rbp), %r13
movq %r15, (%rbx)
cmpl $0x0, 0x4(%r14)
je 0x106c0
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rcx
callq 0x1b25c
jmp 0x106d7
movq 0x28(%r14), %rax
movq %rax, 0x1b8(%rbx)
movq %rbx, %rdi
movl %edx, %esi
movq %r13, %rdx
callq *0x18(%r14)
movl %eax, %r15d
cmpl $0x1, %eax
jne 0x106ef
movq %rbx, %rdi
xorl %esi, %esi
callq 0x109ca
movl $0x1, %r15d
testq %r12, %r12
je 0x10711
movl 0x10(%r12), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r12)
cmpl $0x1, %eax
jg 0x10711
movq %rbx, %rdi
movq %r12, %rsi
callq 0x758c
movq 0x108(%rbx), %rax
movl $0x0, 0x28(%rax)
movq $0x0, 0x20(%rax)
cmpl $0x7, %r15d
jne 0x10777
movq 0x58(%rbx), %rax
cmpq $0x0, 0x98(%rax)
je 0x10777
movq %rbx, %rdi
movq %r14, %rsi
callq 0x189aa
movq 0x58(%rbx), %rax
movq 0x98(%rax), %r12
movq 0xa0(%rax), %r14
xorl %ecx, %ecx
movq %rcx, 0xa0(%rax)
movq %rcx, 0x98(%rax)
movl 0x20(%r12), %edx
movq 0x18(%r12), %r13
jmp 0x10639
movq -0x40(%rbp), %rax
movq %rax, 0x1b8(%rbx)
decl 0x24(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x189aa
cmpl $0x1, %r15d
jne 0x107a6
movq %rbx, %rdi
xorl %esi, %esi
callq 0x109ca
movl $0x1, %r15d
movq 0x58(%rbx), %rax
cmpq $0x0, 0x98(%rax)
je 0x107f2
movq 0xa0(%rax), %rsi
movq %rbx, %rdi
callq 0x189aa
movq 0x58(%rbx), %rax
movq 0x98(%rax), %rsi
movl 0x10(%rsi), %ecx
leal -0x1(%rcx), %edx
movl %edx, 0x10(%rsi)
cmpl $0x1, %ecx
jg 0x107e8
movq %rbx, %rdi
callq 0x758c
movq 0x58(%rbx), %rax
xorps %xmm0, %xmm0
movups %xmm0, 0x98(%rax)
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq