// File: /workspace/github_c_makefile_star2_O2/msteveb[P]autosetup/./jimsh0.c
// Function: SetVariableFromAny
static int SetVariableFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr)
{
    const char *varName;
    Jim_CallFrame *framePtr;
    int global;
    int len;
    Jim_VarVal *vv;


    if (objPtr->typePtr == &variableObjType) {
        framePtr = objPtr->internalRep.varValue.global ? interp->topFramePtr : interp->framePtr;
        if (objPtr->internalRep.varValue.callFrameId == framePtr->id) {

            return JIM_OK;
        }

    }
    else if (objPtr->typePtr == &dictSubstObjType) {
        return JIM_DICT_SUGAR;
    }

    varName = Jim_GetString(objPtr, &len);


    if (len && varName[len - 1] == ')' && strchr(varName, '(') != NULL) {
        return JIM_DICT_SUGAR;
    }

    if (varName[0] == ':' && varName[1] == ':') {
        while (*varName == ':') {
            varName++;
            len--;
        }
        global = 1;
        framePtr = interp->topFramePtr;

        Jim_Obj *tempObj = Jim_NewStringObj(interp, varName, len);
        vv = JimFindVariable(&framePtr->vars, tempObj);
        Jim_FreeNewObj(interp, tempObj);
    }
    else {
        global = 0;
        framePtr = interp->framePtr;

        vv = JimFindVariable(&framePtr->vars, objPtr);
        if (vv == NULL && framePtr->staticVars) {

            vv = JimFindVariable(framePtr->staticVars, objPtr);
        }
    }

    if (vv == NULL) {
        return JIM_ERR;
    }


    Jim_FreeIntRep(interp, objPtr);
    objPtr->typePtr = &variableObjType;
    objPtr->internalRep.varValue.callFrameId = framePtr->id;
    objPtr->internalRep.varValue.vv = vv;
    objPtr->internalRep.varValue.global = global;
    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq 0x8(%rsi), %rax
leaq 0x26650(%rip), %rcx     # 0x31d58
pushq $0x64
popq %r14
cmpq %rcx, %rax
movq %rdi, -0x30(%rbp)
je 0xb729
leaq 0x26664(%rip), %rcx     # 0x31d80
cmpq %rcx, %rax
jne 0xb747
movl %r14d, %r15d
jmp 0xb85a
xorl %eax, %eax
cmpl $0x0, 0x28(%rbx)
setne %al
movq 0x58(%rdi,%rax,8), %rax
movq 0x20(%rbx), %rcx
xorl %r15d, %r15d
cmpq (%rax), %rcx
je 0xb85a
leaq -0x34(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7fc7
movq %rax, %r12
movslq (%r15), %r13
testq %r13, %r13
je 0xb780
cmpb $0x29, -0x1(%r12,%r13)
jne 0xb780
pushq $0x28
popq %rsi
movq %r12, %rdi
callq 0x61c0
movl %r14d, %r15d
testq %rax, %rax
jne 0xb85a
cmpb $0x3a, (%r12)
pushq $0x1
popq %r15
jne 0xb7aa
cmpb $0x3a, 0x1(%r12)
jne 0xb7aa
movb $0x3a, %al
cmpb $0x3a, %al
jne 0xb7e8
decl %r13d
movl %r13d, -0x34(%rbp)
movb 0x1(%r12), %al
incq %r12
jmp 0xb795
movq -0x30(%rbp), %rax
movq 0x58(%rax), %r14
leaq 0x10(%r14), %rdi
movq %rbx, %rsi
callq 0x1650a
testq %rax, %rax
je 0xb7cb
movq %rax, %r12
xorl %r13d, %r13d
jmp 0xb822
movq 0x40(%r14), %rdi
testq %rdi, %rdi
je 0xb85a
movq %rbx, %rsi
callq 0x1650a
movq %rax, %r12
xorl %r13d, %r13d
jmp 0xb81d
movq -0x30(%rbp), %rdi
movq 0x60(%rdi), %r14
movq %r12, %rsi
movl %r13d, %edx
callq 0x7363
movq %rax, %r13
leaq 0x10(%r14), %rdi
movq %rax, %rsi
callq 0x1650a
movq %rax, %r12
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x73bf
pushq $0x1
popq %r13
testq %r12, %r12
je 0xb85a
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0xb83d
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xb83d
movq -0x30(%rbp), %rdi
movq %rbx, %rsi
callq *%rax
leaq 0x26514(%rip), %rax     # 0x31d58
movq %rax, 0x8(%rbx)
movq (%r14), %rax
movq %rax, 0x20(%rbx)
movq %r12, 0x18(%rbx)
movl %r13d, 0x28(%rbx)
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq