// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: SetExprFromAny
static int SetExprFromAny(Jim_Interp *interp, struct Jim_Obj *objPtr)
{
    int exprTextLen;
    const char *exprText;
    struct JimParserCtx parser;
    struct ExprTree *expr;
    ParseTokenList tokenlist;
    int line;
    Jim_Obj *fileNameObj;
    int rc = JIM_ERR;


    fileNameObj = Jim_GetSourceInfo(interp, objPtr, &line);
    Jim_IncrRefCount(fileNameObj);

    exprText = Jim_GetString(objPtr, &exprTextLen);


    ScriptTokenListInit(&tokenlist);

    JimParserInit(&parser, exprText, exprTextLen, line);
    while (!parser.eof) {
        if (JimParseExpression(&parser) != JIM_OK) {
            ScriptTokenListFree(&tokenlist);
            Jim_SetResultFormatted(interp, "syntax error in expression: \"%#s\"", objPtr);
            if (parser.errmsg) {
                Jim_AppendStrings(interp, Jim_GetResult(interp), ": ", parser.errmsg, NULL);
            }
            expr = NULL;
            goto err;
        }

        ScriptAddToken(&tokenlist, parser.tstart, parser.tend - parser.tstart + 1, parser.tt,
            parser.tline);
    }

#ifdef DEBUG_SHOW_EXPR_TOKENS
    {
        int i;
        printf("==== Expr Tokens (%s) ====\n", Jim_String(fileNameObj));
        for (i = 0; i < tokenlist.count; i++) {
            printf("[%2d]@%d %s '%.*s'\n", i, tokenlist.list[i].line, jim_tt_name(tokenlist.list[i].type),
                tokenlist.list[i].len, tokenlist.list[i].token);
        }
    }
#endif

    if (tokenlist.count <= 1) {
        Jim_SetResultString(interp, "empty expression", -1);
        rc = JIM_ERR;
    }
    else {
        rc = JimParseCheckMissing(interp, parser.missing.ch);
    }
    if (rc != JIM_OK) {
        ScriptTokenListFree(&tokenlist);
        Jim_DecrRefCount(interp, fileNameObj);
        return rc;
    }


    expr = ExprTreeCreateTree(interp, &tokenlist, objPtr, fileNameObj);


    ScriptTokenListFree(&tokenlist);

    if (!expr) {
        goto err;
    }

#ifdef DEBUG_SHOW_EXPR
    printf("==== Expr ====\n");
    JimShowExprNode(expr->expr, 0);
#endif

    rc = JIM_OK;

  err:

    Jim_DecrRefCount(interp, fileNameObj);
    Jim_FreeIntRep(interp, objPtr);
    Jim_SetIntRepPtr(objPtr, expr);
    objPtr->typePtr = &exprObjType;
    return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x290, %rsp            # imm = 0x290
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x1, -0x27c(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x26c(%rbp), %rdx
callq 0xd3f0
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x89b0
movq %rax, -0x28(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x1d7f0
movq -0x28(%rbp), %rsi
movl -0x1c(%rbp), %edx
movl -0x26c(%rbp), %ecx
leaq -0x70(%rbp), %rdi
callq 0x1d820
cmpl $0x0, -0x48(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x21a1d
jmp 0x21ab0
leaq -0x70(%rbp), %rdi
callq 0x21c50
cmpl $0x0, %eax
je 0x21a83
leaq -0x268(%rbp), %rdi
callq 0x1ded0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x1a786(%rip), %rsi     # 0x3c1cc
movb $0x0, %al
callq 0x6b40
cmpq $0x0, -0x30(%rbp)
je 0x21a76
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x30(%rbp), %rcx
leaq 0x197a7(%rip), %rdx     # 0x3b211
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0xca20
movq $0x0, -0x78(%rbp)
jmp 0x21bbe
movq -0x60(%rbp), %rsi
movq -0x58(%rbp), %rax
movq -0x60(%rbp), %rcx
subq %rcx, %rax
addq $0x1, %rax
movl %eax, %edx
movl -0x4c(%rbp), %ecx
movl -0x50(%rbp), %r8d
leaq -0x268(%rbp), %rdi
callq 0x1dae0
jmp 0x21a0b
cmpl $0x1, -0x25c(%rbp)
jg 0x21b26
jmp 0x21abb
movq -0x10(%rbp), %rdi
leaq 0x1a728(%rip), %rsi     # 0x3c1ee
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x288(%rbp)
movq -0x288(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x21b0c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x288(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x27c(%rbp)
jmp 0x21b38
movq -0x10(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x13160
movl %eax, -0x27c(%rbp)
cmpl $0x0, -0x27c(%rbp)
je 0x21b80
leaq -0x268(%rbp), %rdi
callq 0x1ded0
movq -0x278(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x21b72
movq -0x10(%rbp), %rdi
movq -0x278(%rbp), %rsi
callq 0x7a10
movl -0x27c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x21c37
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
movq -0x278(%rbp), %rcx
leaq -0x268(%rbp), %rsi
callq 0x21f00
movq %rax, -0x78(%rbp)
leaq -0x268(%rbp), %rdi
callq 0x1ded0
cmpq $0x0, -0x78(%rbp)
jne 0x21bb4
jmp 0x21bbe
movl $0x0, -0x27c(%rbp)
movq -0x278(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x21be3
movq -0x10(%rbp), %rdi
movq -0x278(%rbp), %rsi
callq 0x7a10
movq -0x18(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x21c13
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
cmpq $0x0, 0x8(%rax)
je 0x21c13
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq *%rax
movq -0x78(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
leaq 0x24926(%rip), %rcx     # 0x46550
movq %rcx, 0x8(%rax)
movl -0x27c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x290, %rsp            # imm = 0x290
popq %rbp
retq
nopw %cs:(%rax,%rax)