// File: /workspace/github_c_makefile_star2_O1/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, %r12
movl %esi, -0x30(%rbp)
movq %rdi, %rbx
movq (%rdx), %rsi
movl $0x1, %r15d
movl $0x1, %edx
callq 0x67d1
testq %rax, %rax
je 0x106c4
movq %rax, %r14
incl (%rax)
movl 0x24(%rbx), %eax
cmpl 0x20(%rbx), %eax
jne 0x1075a
leaq 0x1cb9e(%rip), %rsi     # 0x2d228
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
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 0x106b6
movq %rbx, %rdi
callq 0x759a
movq %r15, (%rbx)
movl $0x1, %r15d
jmp 0x108c2
cmpl $0x32, 0x1b0(%rbx)
jg 0x10929
movq 0x198(%rbx), %rsi
movq %rbx, %rdi
xorl %edx, %edx
callq 0x67d1
testq %rax, %rax
je 0x10929
incl 0x1b0(%rbx)
movq %r12, -0x38(%rbp)
movq 0x198(%rbx), %r12
movl -0x30(%rbp), %r13d
movslq %r13d, %r14
incl %r13d
leaq 0x8(,%r14,8), %rsi
xorl %edi, %edi
callq *0x27b72(%rip)          # 0x38288
movq %rax, %r15
movq %r12, (%rax)
leaq 0x8(%rax), %rdi
shlq $0x3, %r14
movq -0x38(%rbp), %rsi
movq %r14, %rdx
callq 0x6320
movq %rbx, %rdi
movl %r13d, %esi
movq %r15, %rdx
callq 0x10562
movl %eax, %r14d
movq %r15, %rdi
xorl %esi, %esi
callq *0x27b3c(%rip)          # 0x38288
decl 0x1b0(%rbx)
movl %r14d, %eax
jmp 0x1092c
incl %eax
movl %eax, 0x24(%rbx)
movq 0x1b8(%rbx), %rax
movq %rax, -0x38(%rbp)
xorl %r13d, %r13d
movl -0x30(%rbp), %edx
movq 0x108(%rbx), %rax
movl %edx, 0x28(%rax)
movq %r12, 0x20(%rax)
movq %r14, 0x10(%rax)
cmpq $0x0, 0x1a8(%rbx)
je 0x107af
movq %rbx, %rdi
leaq 0x1caaa(%rip), %rsi     # 0x2d240
movl %edx, %r15d
movq %r12, %rcx
callq 0x1b6dd
movl %r15d, %edx
movl %eax, %r15d
testl %eax, %eax
jne 0x10830
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 0x107e7
movq %rbx, %rdi
movq %r14, -0x30(%rbp)
movq %r12, %r14
movl %edx, %r12d
callq 0x759a
movl %r12d, %edx
movq %r14, %r12
movq -0x30(%rbp), %r14
movq %r15, (%rbx)
cmpl $0x0, 0x4(%r14)
je 0x10801
movq %rbx, %rdi
movq %r14, %rsi
movq %r12, %rcx
callq 0x1b85b
jmp 0x10818
movq 0x28(%r14), %rax
movq %rax, 0x1b8(%rbx)
movq %rbx, %rdi
movl %edx, %esi
movq %r12, %rdx
callq *0x18(%r14)
movl %eax, %r15d
cmpl $0x1, %eax
jne 0x10830
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10b0c
movl $0x1, %r15d
testq %r13, %r13
je 0x10850
movl 0x10(%r13), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r13)
cmpl $0x1, %eax
jg 0x10850
movq %rbx, %rdi
movq %r13, %rsi
callq 0x759a
movq 0x108(%rbx), %rax
movl $0x0, 0x28(%rax)
movq $0x0, 0x20(%rax)
cmpl $0x7, %r15d
jne 0x108b4
movq 0x58(%rbx), %rax
cmpq $0x0, 0x98(%rax)
je 0x108b4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18e6b
movq 0x58(%rbx), %rax
movq 0x98(%rax), %r13
movq 0xa0(%rax), %r14
xorl %ecx, %ecx
movq %rcx, 0xa0(%rax)
movq %rcx, 0x98(%rax)
movl 0x20(%r13), %edx
movq 0x18(%r13), %r12
jmp 0x10770
movq -0x38(%rbp), %rax
movq %rax, 0x1b8(%rbx)
decl 0x24(%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x18e6b
cmpl $0x1, %r15d
jne 0x108dd
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10b0c
movq 0x58(%rbx), %rax
cmpq $0x0, 0x98(%rax)
je 0x10929
movq 0xa0(%rax), %rsi
movq %rbx, %rdi
callq 0x18e6b
movq 0x58(%rbx), %rax
movq 0x98(%rax), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1091b
movq %rbx, %rdi
callq 0x759a
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