// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_EvalObj
int Jim_EvalObj(Jim_Interp *interp, Jim_Obj *scriptObjPtr)
{
    int i;
    ScriptObj *script;
    ScriptToken *token;
    int retcode = JIM_OK;
    Jim_Obj *sargv[JIM_EVAL_SARGV_LEN], **argv = NULL;
    Jim_EvalFrame frame;

    if (Jim_IsList(scriptObjPtr) && scriptObjPtr->bytes == NULL) {
        return JimEvalObjList(interp, scriptObjPtr);
    }

    Jim_IncrRefCount(scriptObjPtr);
    script = JimGetScript(interp, scriptObjPtr);
    if (JimParseCheckMissing(interp, script->missing) == JIM_ERR) {
        JimSetErrorStack(interp, script);
        Jim_DecrRefCount(interp, scriptObjPtr);
        return JIM_ERR;
    }

    Jim_SetEmptyResult(interp);

    token = script->token;

#ifdef JIM_OPTIMIZATION
    if (script->len == 0) {
        Jim_DecrRefCount(interp, scriptObjPtr);
        return JIM_OK;
    }
    if (script->len == 3
        && token[1].objPtr->typePtr == &commandObjType
        && token[1].objPtr->internalRep.cmdValue.cmdPtr->isproc == 0
        && token[1].objPtr->internalRep.cmdValue.cmdPtr->u.native.cmdProc == Jim_IncrCoreCommand
        && token[2].objPtr->typePtr == &variableObjType) {

        Jim_Obj *objPtr = Jim_GetVariable(interp, token[2].objPtr, JIM_NONE);

        if (objPtr && !Jim_IsShared(objPtr) && objPtr->typePtr == &intObjType) {
            JimWideValue(objPtr)++;
            Jim_InvalidateStringRep(objPtr);
            Jim_DecrRefCount(interp, scriptObjPtr);
            Jim_SetResult(interp, objPtr);
            return JIM_OK;
        }
    }
#endif

    script->inUse++;

    JimPushEvalFrame(interp, &frame, scriptObjPtr);


    interp->errorFlag = 0;
    argv = sargv;

    for (i = 0; i < script->len && retcode == JIM_OK; ) {
        int argc;
        int j;


        argc = token[i].objPtr->internalRep.scriptLineValue.argc;
        script->linenr = token[i].objPtr->internalRep.scriptLineValue.line;


        if (argc > JIM_EVAL_SARGV_LEN)
            argv = Jim_Alloc(sizeof(Jim_Obj *) * argc);


        i++;

        for (j = 0; j < argc; j++) {
            long wordtokens = 1;
            int expand = 0;
            Jim_Obj *wordObjPtr = NULL;

            if (token[i].type == JIM_TT_WORD) {
                wordtokens = JimWideValue(token[i++].objPtr);
                if (wordtokens < 0) {
                    expand = 1;
                    wordtokens = -wordtokens;
                }
            }

            if (wordtokens == 1) {

                switch (token[i].type) {
                    case JIM_TT_ESC:
                    case JIM_TT_STR:
                        wordObjPtr = token[i].objPtr;
                        break;
                    case JIM_TT_VAR:
                        wordObjPtr = Jim_GetVariable(interp, token[i].objPtr, JIM_ERRMSG);
                        break;
                    case JIM_TT_EXPRSUGAR:
                        retcode = Jim_EvalExpression(interp, token[i].objPtr);
                        if (retcode == JIM_OK) {
                            wordObjPtr = Jim_GetResult(interp);
                        }
                        else {
                            wordObjPtr = NULL;
                        }
                        break;
                    case JIM_TT_DICTSUGAR:
                        wordObjPtr = JimExpandDictSugar(interp, token[i].objPtr);
                        break;
                    case JIM_TT_CMD:
                        retcode = Jim_EvalObj(interp, token[i].objPtr);
                        if (retcode == JIM_OK) {
                            wordObjPtr = Jim_GetResult(interp);
                        }
                        break;
                    default:
                        JimPanic((1, "default token type reached " "in Jim_EvalObj()."));
                }
            }
            else {
                wordObjPtr = JimInterpolateTokens(interp, token + i, wordtokens, JIM_NONE);
            }

            if (!wordObjPtr) {
                if (retcode == JIM_OK) {
                    retcode = JIM_ERR;
                }
                break;
            }

            Jim_IncrRefCount(wordObjPtr);
            i += wordtokens;

            if (!expand) {
                argv[j] = wordObjPtr;
            }
            else {

                int len = Jim_ListLength(interp, wordObjPtr);
                int newargc = argc + len - 1;
                int k;

                if (len > 1) {
                    if (argv == sargv) {
                        if (newargc > JIM_EVAL_SARGV_LEN) {
                            argv = Jim_Alloc(sizeof(*argv) * newargc);
                            memcpy(argv, sargv, sizeof(*argv) * j);
                        }
                    }
                    else {

                        argv = Jim_Realloc(argv, sizeof(*argv) * newargc);
                    }
                }


                for (k = 0; k < len; k++) {
                    argv[j++] = wordObjPtr->internalRep.listValue.ele[k];
                    Jim_IncrRefCount(wordObjPtr->internalRep.listValue.ele[k]);
                }

                Jim_DecrRefCount(interp, wordObjPtr);


                j--;
                argc += len - 1;
            }
        }

        if (retcode == JIM_OK && argc) {

            retcode = JimInvokeCommand(interp, argc, argv);

            if (Jim_CheckSignal(interp)) {
                retcode = JIM_SIGNAL;
            }
        }


        while (j-- > 0) {
            Jim_DecrRefCount(interp, argv[j]);
        }

        if (argv != sargv) {
            Jim_Free(argv);
            argv = sargv;
        }
    }


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

    JimPopEvalFrame(interp);

    Jim_FreeIntRep(interp, scriptObjPtr);
    scriptObjPtr->typePtr = &scriptObjType;
    Jim_SetIntRepPtr(scriptObjPtr, script);
    Jim_DecrRefCount(interp, scriptObjPtr);

    return retcode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
movq %rsi, %r14
movq %rdi, %r12
leaq 0x2c2bd(%rip), %rax     # 0x35368
cmpq %rax, 0x8(%rsi)
jne 0x90bb
cmpq $0x0, (%r14)
je 0x951e
incl 0x10(%r14)
movq %r12, %rdi
movq %r14, %rsi
callq 0xb679
movq %rax, %rbx
movl 0x24(%rax), %esi
movq %r12, %rdi
callq 0x10945
testl %eax, %eax
je 0x90fd
movq %r12, %rdi
movq %rbx, %rsi
callq 0x109ca
movl 0x10(%r14), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r14)
movl $0x1, %r15d
jmp 0x9585
movq %rbx, %r15
movq 0x128(%r12), %rbx
incl 0x10(%rbx)
movq (%r12), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x9125
movq %r12, %rdi
callq 0x758c
movq %rbx, (%r12)
movq %r15, %rbx
movq (%r15), %rdx
incl 0x18(%r15)
xorps %xmm0, %xmm0
leaq -0xd8(%rbp), %rax
movups %xmm0, 0x20(%rax)
movups %xmm0, 0x10(%rax)
movq 0x108(%r12), %rcx
movq %rcx, 0x18(%rax)
movl 0x8(%rcx), %ecx
incl %ecx
movl %ecx, 0x8(%rax)
movl 0x110(%r12), %ecx
movl %ecx, 0xc(%rax)
movq 0x58(%r12), %rcx
movq %rcx, (%rax)
movq %r14, 0x30(%rax)
movq %rax, 0x108(%r12)
movl $0x0, 0x1b4(%r12)
cmpl $0x0, 0x10(%r15)
jle 0x953a
movq %rdx, -0x48(%rbp)
movq %r14, -0x50(%rbp)
leaq -0xa0(%rbp), %r8
xorl %r14d, %r14d
movq %r12, -0x38(%rbp)
movq %rbx, -0x60(%rbp)
movslq %r14d, %rax
shlq $0x4, %rax
movq -0x48(%rbp), %r15
movq (%r15,%rax), %rax
movslq 0x1c(%rax), %rcx
movl 0x18(%rax), %eax
movl %eax, 0x20(%rbx)
cmpq $0x9, %rcx
jl 0x91e5
movq %rcx, %rsi
shlq $0x3, %rsi
xorl %edi, %edi
movq %rcx, %rbx
callq *0x2e0ae(%rip)          # 0x37288
movq %rbx, %rcx
movq %rax, %r8
incl %r14d
jmp 0x91f0
incl %r14d
testl %ecx, %ecx
jle 0x944c
xorl %ebx, %ebx
movq %rcx, -0x40(%rbp)
movslq %r14d, %rsi
movq %rsi, %rcx
shlq $0x4, %rcx
movl 0x8(%r15,%rcx), %eax
movb $0x1, %r13b
cmpl $0xa, %eax
jne 0x9245
addq %r15, %rcx
incl %r14d
movq (%rcx), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
setns %r13b
movq %r15, %rcx
movq %rax, %r15
negq %r15
cmovsq %rax, %r15
movslq %r14d, %rsi
cmpq $0x1, %r15
jne 0x926c
movq %rsi, %rax
shlq $0x4, %rax
movl 0x8(%rcx,%rax), %eax
movq %rcx, %r15
shlq $0x4, %rsi
addq %r15, %rsi
leal -0x1(%rax), %ecx
cmpl $0x4, %ecx
ja 0x9288
leaq 0x1de49(%rip), %rdx     # 0x270a4
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movq (%rsi), %r12
jmp 0x9310
shlq $0x4, %rsi
addq %rcx, %rsi
movq %r12, %rdi
movl %r15d, %edx
xorl %ecx, %ecx
movl %ebx, %r12d
movq %r8, %rbx
callq 0x10b65
jmp 0x92eb
cmpl $0x11, %eax
jne 0x9497
movl %ebx, -0x2c(%rbp)
movq %r8, %rbx
movq (%rsi), %rsi
movq %r12, %rdi
callq 0xd8ce
jmp 0x92b5
movl %ebx, -0x2c(%rbp)
movq %r8, %rbx
movq (%rsi), %rsi
movq %r12, %rdi
callq 0x908a
testl %eax, %eax
jne 0x948c
movq (%r12), %r12
movl $0x1, %r15d
movq %rbx, %r8
movl -0x2c(%rbp), %ebx
jmp 0x9316
movq (%rsi), %rsi
movl $0x1, %r15d
movq %r12, %rdi
movl $0x1, %edx
movl %ebx, %r12d
movq %r8, %rbx
callq 0x98e7
movq %rbx, %r8
movl %r12d, %ebx
movq %rax, %r12
jmp 0x9316
movq (%rsi), %rsi
movq %r12, %rdi
movl %ebx, %r15d
movq %r8, %rbx
callq 0x10add
movq %rbx, %r8
movl %r15d, %ebx
movq %rax, %r12
movl $0x1, %r15d
testq %r12, %r12
je 0x9443
incl 0x10(%r12)
testb %r13b, %r13b
je 0x933b
movslq %ebx, %rax
movq %r12, (%r8,%rax,8)
incl %ebx
movq -0x40(%rbp), %rcx
jmp 0x942e
movl %ebx, -0x2c(%rbp)
movq %r8, %rbx
movq -0x38(%rbp), %rdi
movq %r12, %rsi
callq 0xe2fe
movslq 0x20(%r12), %r13
cmpq $0x2, %r13
jl 0x9389
movq -0x40(%rbp), %rdx
leal (%rdx,%r13), %eax
decl %eax
leaq -0xa0(%rbp), %rcx
movq %rbx, %r8
cmpq %rcx, %rbx
je 0x9397
movslq %eax, %rsi
shlq $0x3, %rsi
movq %r8, %rdi
callq *0x2df07(%rip)          # 0x37288
movq %rax, %r8
movl -0x2c(%rbp), %ebx
jmp 0x93cf
cmpl $0x1, %r13d
movq %rbx, %r8
movl -0x2c(%rbp), %ebx
je 0x93cf
jmp 0x93fb
leal (%rdx,%r13), %ecx
cmpl $0xa, %ecx
movl -0x2c(%rbp), %ebx
jl 0x93cf
movl %eax, %esi
shlq $0x3, %rsi
xorl %edi, %edi
callq *0x2ded7(%rip)          # 0x37288
movq %rax, -0x58(%rbp)
movslq %ebx, %rdx
shlq $0x3, %rdx
movq %rax, %rdi
leaq -0xa0(%rbp), %rsi
callq 0x6320
movq -0x58(%rbp), %r8
movslq %ebx, %rax
leaq (%r8,%rax,8), %rcx
xorl %eax, %eax
movq 0x18(%r12), %rdx
movq (%rdx,%rax,8), %rdx
movq %rdx, (%rcx,%rax,8)
movq 0x18(%r12), %rdx
movq (%rdx,%rax,8), %rdx
incl 0x10(%rdx)
incq %rax
cmpq %rax, %r13
jne 0x93d8
addl %eax, %ebx
movl 0x10(%r12), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r12)
cmpl $0x1, %eax
jg 0x9425
movq -0x38(%rbp), %rdi
movq %r12, %rsi
movl %ebx, %r12d
movq %r8, %rbx
callq 0x758c
movq %rbx, %r8
movl %r12d, %ebx
movq -0x40(%rbp), %rcx
addl %r13d, %ecx
decl %ecx
addl %r15d, %r14d
cmpl %ecx, %ebx
movq -0x38(%rbp), %r12
movq -0x48(%rbp), %r15
jl 0x91f2
jmp 0x944e
xorl %r15d, %r15d
movq -0x38(%rbp), %r12
jmp 0x949a
xorl %ebx, %ebx
testl %ecx, %ecx
je 0x9487
movl %ebx, %r13d
movq %r12, %rdi
movl %ecx, %esi
movq %r8, %rbx
movq %r8, %rdx
callq 0x10504
movl %eax, %r15d
cmpl $0x0, 0x40(%r12)
je 0x947f
cmpq $0x0, 0x48(%r12)
movl $0x5, %eax
cmovnel %eax, %r15d
movq %rbx, %r8
movl %r13d, %ebx
jmp 0x94a2
xorl %r15d, %r15d
jmp 0x94a2
movl %eax, %r15d
movq %rbx, %r8
movl -0x2c(%rbp), %ebx
jmp 0x949a
xorl %r15d, %r15d
cmpl $0x1, %r15d
adcl $0x0, %r15d
testl %ebx, %ebx
jle 0x94d5
movl %ebx, %ebx
incq %rbx
movq -0x10(%r8,%rbx,8), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x94cc
movq %r12, %rdi
movq %r8, %r13
callq 0x758c
movq %r13, %r8
decq %rbx
cmpq $0x1, %rbx
ja 0x94ab
leaq -0xa0(%rbp), %rbx
cmpq %rbx, %r8
je 0x94ef
movq %r8, %rdi
xorl %esi, %esi
callq *0x2dd9c(%rip)          # 0x37288
movq %rbx, %r8
movq -0x60(%rbp), %rbx
cmpl 0x10(%rbx), %r14d
jge 0x9502
testl %r15d, %r15d
je 0x91a9
cmpl $0x1, %r15d
movq -0x50(%rbp), %r14
jne 0x953d
movq %r12, %rdi
xorl %esi, %esi
callq 0x109ca
movl $0x1, %r15d
jmp 0x953d
movq %r12, %rdi
movq %r14, %rsi
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10897
xorl %r15d, %r15d
movq 0x108(%r12), %rax
movq 0x18(%rax), %rax
movq %rax, 0x108(%r12)
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x956b
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x956b
movq %r12, %rdi
movq %r14, %rsi
callq *%rax
leaq 0x2bc9e(%rip), %rax     # 0x35210
movq %rax, 0x8(%r14)
movq %rbx, 0x18(%r14)
movl 0x10(%r14), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r14)
cmpl $0x1, %eax
jg 0x9595
movq %r12, %rdi
movq %r14, %rsi
callq 0x758c
movl %r15d, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq