// File: /workspace/github_c_makefile_star2_O2/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_LoopCoreCommand
static int Jim_LoopCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    int retval;
    jim_wide i;
    jim_wide limit = 0;
    jim_wide incr = 1;
    Jim_Obj *bodyObjPtr;

    if (argc < 4 || argc > 6) {
        Jim_WrongNumArgs(interp, 1, argv, "var ?first? limit ?incr? body");
        return JIM_ERR;
    }

    retval = Jim_GetWideExpr(interp, argv[2], &i);
    if (argc > 4 && retval == JIM_OK) {
        retval = Jim_GetWideExpr(interp, argv[3], &limit);
    }
    if (argc > 5 && retval == JIM_OK) {
        Jim_GetWideExpr(interp, argv[4], &incr);
    }
    if (retval != JIM_OK) {
        return retval;
    }
    if (argc == 4) {
        limit = i;
        i = 0;
    }
    bodyObjPtr = argv[argc - 1];

    retval = Jim_SetVariable(interp, argv[1], Jim_NewIntObj(interp, i));

    while (((i < limit && incr > 0) || (i > limit && incr < 0)) && retval == JIM_OK) {
        retval = Jim_EvalObj(interp, bodyObjPtr);
        if (JimCheckLoopRetcode(interp, retval)) {
            return retval;
        }
        if (retval == JIM_OK || retval == JIM_CONTINUE) {
            Jim_Obj *objPtr = Jim_GetVariable(interp, argv[1], JIM_ERRMSG);

            retval = JIM_OK;


            i += incr;

            if (objPtr && !Jim_IsShared(objPtr) && objPtr->typePtr == &intObjType) {
                if (argv[1]->typePtr != &variableObjType) {
                    if (Jim_SetVariable(interp, argv[1], objPtr) != JIM_OK) {
                        return JIM_ERR;
                    }
                }
                JimWideValue(objPtr) = i;
                Jim_InvalidateStringRep(objPtr);

                if (argv[1]->typePtr != &variableObjType) {
                    if (Jim_SetVariable(interp, argv[1], objPtr) != JIM_OK) {
                        retval = JIM_ERR;
                        break;
                    }
                }
            }
            else {
                objPtr = Jim_NewIntObj(interp, i);
                retval = Jim_SetVariable(interp, argv[1], objPtr);
                if (retval != JIM_OK) {
                    Jim_FreeNewObj(interp, objPtr);
                }
            }
        }
    }

    if (retval == JIM_OK || retval == JIM_CONTINUE || retval == JIM_BREAK) {
        Jim_SetEmptyResult(interp);
        return JIM_OK;
    }
    return retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movl %esi, %r12d
andq $0x0, -0x40(%rbp)
movq %rdi, %rbx
movq $0x1, -0x60(%rbp)
leal -0x7(%r12), %eax
cmpl $-0x4, %eax
ja 0x197ad
leaq 0xecec(%rip), %rcx      # 0x28482
pushq $0x1
popq %r13
movq %rbx, %rdi
movl %r13d, %esi
movq %r14, %rdx
callq 0x72a5
jmp 0x19a10
movq 0x10(%r14), %rsi
leaq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0xcace
movl %eax, %r13d
cmpl $0x5, %r12d
setae %al
testl %r13d, %r13d
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x197e7
movq 0x18(%r14), %rsi
leaq -0x40(%rbp), %rdx
movq %rbx, %rdi
callq 0xcace
movl %eax, %r13d
cmpl $0x6, %r12d
jb 0x199ad
testl %r13d, %r13d
jne 0x199ad
movq 0x20(%r14), %rsi
leaq -0x60(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0xcace
movq -0x48(%rbp), %r13
movq (%r15), %rax
movq %rax, -0x38(%rbp)
movl %r12d, %eax
movq -0x8(%r14,%rax,8), %rax
movq %rax, -0x58(%rbp)
movq 0x8(%r14), %r15
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8212
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
callq 0x8306
movq %r13, %r15
movl %eax, %r13d
movq -0x40(%rbp), %rdi
movq %r14, -0x50(%rbp)
cmpq $0x0, -0x38(%rbp)
sets %al
setg %cl
movq %r15, -0x30(%rbp)
cmpq %rdi, %r15
setl %r15b
setg %r14b
andb %cl, %r15b
andb %al, %r14b
testb %r15b, %r15b
je 0x1987e
testl %r13d, %r13d
je 0x1988d
jmp 0x199d3
testl %r13d, %r13d
sete %al
testb %al, %r14b
je 0x199db
movq %rdi, %r12
movq %rbx, %rdi
movq -0x58(%rbp), %rsi
callq 0x8b54
movl %eax, %r13d
leal -0x3(%r13), %eax
cmpl $0x1, %eax
ja 0x198ba
movl 0x18(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x18(%rbx)
cmpl $0x1, %eax
jg 0x19a10
testl $0xfffffffb, %r13d      # imm = 0xFFFFFFFB
movq %r12, %rdi
jne 0x1986f
movq -0x50(%rbp), %r14
movq 0x8(%r14), %rsi
movq %rbx, %rdi
pushq $0x1
popq %rdx
callq 0x9378
movq -0x30(%rbp), %r13
addq -0x38(%rbp), %r13
testq %rax, %rax
je 0x198fc
movq %rax, %r15
cmpl $0x1, 0x10(%rax)
jg 0x198fc
leaq 0x17a9a(%rip), %rax     # 0x31390
cmpq %rax, 0x8(%r15)
je 0x19945
movq %rbx, %rdi
movq %r13, %rsi
callq 0x8212
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movq %rax, -0x30(%rbp)
movq %rax, %rdx
callq 0x8306
movq %r13, %r15
xorl %r13d, %r13d
testl %eax, %eax
movq %r12, %rdi
je 0x1984f
movq %rbx, %rdi
movq -0x30(%rbp), %rsi
callq 0x73bf
movq %r12, %rdi
pushq $0x1
popq %rax
movl %eax, %r13d
jmp 0x1984f
movq 0x8(%r14), %rsi
leaq 0x18408(%rip), %rax     # 0x31d58
cmpq %rax, 0x8(%rsi)
je 0x19965
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8306
testl %eax, %eax
jne 0x199a5
movq %r13, 0x18(%r15)
movq %r15, %rdi
callq 0x94f7
movq 0x8(%r14), %rsi
movq %r15, %rdx
movq %r13, %r15
xorl %r13d, %r13d
leaq 0x183d3(%rip), %rax     # 0x31d58
cmpq %rax, 0x8(%rsi)
movq %r12, %rdi
je 0x1984f
movq %rbx, %rdi
callq 0x8306
movq %r12, %rdi
testl %eax, %eax
je 0x1984f
pushq $0x1
popq %rax
movl %eax, %r13d
jmp 0x19a10
testl %r13d, %r13d
jne 0x19a10
pushq $0x1
popq %rax
movq %rax, -0x38(%rbp)
movq -0x48(%rbp), %r13
cmpl $0x4, %r12d
jne 0x19818
movq %r13, -0x40(%rbp)
xorl %r13d, %r13d
jmp 0x19818
cmpl $0x3, %r13d
je 0x199e6
jmp 0x19a10
cmpl $0x3, %r13d
je 0x199e6
testl %r13d, %r13d
jne 0x19a10
movq 0x128(%rbx), %r14
incl 0x10(%r14)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x19a0a
movq %rbx, %rdi
callq 0x73bf
movq %r14, (%rbx)
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq