// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x8(%rsi), %rcx
leaq 0x2ab96(%rip), %rax     # 0x36d58
cmpq %rax, %rcx
je 0xc1dd
leaq 0x2abb2(%rip), %rax     # 0x36d80
cmpq %rax, %rcx
jne 0xc1fa
movl $0x64, %eax
jmp 0xc336
xorl %eax, %eax
cmpl $0x0, 0x28(%rbx)
setne %al
movq 0x58(%r14,%rax,8), %rdx
movq 0x20(%rbx), %rsi
xorl %eax, %eax
cmpq (%rdx), %rsi
je 0xc336
cmpq $0x0, (%rbx)
jne 0xc206
movq %rbx, %rdi
callq *0x18(%rcx)
movslq 0x14(%rbx), %r15
movq (%rbx), %r12
testq %r15, %r15
je 0xc238
cmpb $0x29, -0x1(%r12,%r15)
jne 0xc238
movq %r12, %rdi
movl $0x28, %esi
callq 0x61c0
movq %rax, %rcx
movl $0x64, %eax
testq %rcx, %rcx
jne 0xc336
cmpb $0x3a, (%r12)
jne 0xc263
cmpb $0x3a, 0x1(%r12)
jne 0xc263
cmpb $0x3a, (%r12)
jne 0xc2aa
leaq 0x1(%r12), %rsi
decl %r15d
cmpb $0x3a, 0x1(%r12)
movq %rsi, %r12
je 0xc24e
jmp 0xc2ad
movq 0x58(%r14), %r12
leaq 0x10(%r12), %rdi
movq %rbx, %rsi
callq 0xac8e
xorl %r15d, %r15d
testq %rax, %rax
je 0xc282
movq 0x8(%rax), %r13
jmp 0xc285
xorl %r13d, %r13d
testq %r13, %r13
jne 0xc2f3
movq 0x40(%r12), %rdi
testq %rdi, %rdi
je 0xc2d7
movq %rbx, %rsi
callq 0xac8e
xorl %r15d, %r15d
testq %rax, %rax
je 0xc2da
movq 0x8(%rax), %r13
jmp 0xc2f3
movq %r12, %rsi
movq 0x60(%r14), %r12
movq %r14, %rdi
movl %r15d, %edx
callq 0x7516
movq %rax, %r15
leaq 0x10(%r12), %rdi
movq %rax, %rsi
callq 0xac8e
testq %rax, %rax
je 0xc2df
movq 0x8(%rax), %r13
jmp 0xc2e2
xorl %r15d, %r15d
xorl %r13d, %r13d
jmp 0xc2f3
xorl %r13d, %r13d
movq %r14, %rdi
movq %r15, %rsi
callq 0x759a
movl $0x1, %r15d
testq %r13, %r13
je 0xc331
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0xc312
movq 0x8(%rax), %rax
testq %rax, %rax
je 0xc312
movq %r14, %rdi
movq %rbx, %rsi
callq *%rax
leaq 0x2aa3f(%rip), %rax     # 0x36d58
movq %rax, 0x8(%rbx)
movq (%r12), %rax
movq %rax, 0x20(%rbx)
movq %r13, 0x18(%rbx)
movl %r15d, 0x28(%rbx)
xorl %eax, %eax
jmp 0xc336
movl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq