// File: /workspace/github_c_makefile_star2_O3/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, %r15d
movq %rdi, %rbx
movq $0x0, -0x48(%rbp)
movq $0x1, -0x60(%rbp)
leal -0x7(%r15), %eax
cmpl $-0x4, %eax
ja 0x1bf72
leaq 0x104db(%rip), %rcx     # 0x2c432
movl $0x1, %r13d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x7446
jmp 0x1c23b
movq 0x10(%r14), %rsi
leaq -0x50(%rbp), %rdx
movq %rbx, %rdi
callq 0xd7f8
movl %eax, %r13d
cmpl $0x5, %r15d
setae %al
testl %r13d, %r13d
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1bfac
movq 0x18(%r14), %rsi
leaq -0x48(%rbp), %rdx
movq %rbx, %rdi
callq 0xd7f8
movl %eax, %r13d
cmpl $0x6, %r15d
movq %r14, -0x38(%rbp)
jb 0x1bfe0
testl %r13d, %r13d
jne 0x1bfe0
movq 0x20(%r14), %rsi
leaq -0x60(%rbp), %r12
movq %rbx, %rdi
movq %r12, %rdx
callq 0xd7f8
movq -0x50(%rbp), %r14
movq (%r12), %rax
movq -0x38(%rbp), %rcx
movq %rax, -0x40(%rbp)
jmp 0x1c007
testl %r13d, %r13d
jne 0x1c23b
movl $0x1, %eax
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %r14
cmpl $0x4, %r15d
jne 0x1c003
movq %r14, -0x48(%rbp)
xorl %r14d, %r14d
movq -0x38(%rbp), %rcx
movl %r15d, %eax
movq -0x8(%rcx,%rax,8), %rax
movq %rax, -0x58(%rbp)
movq 0x8(%rcx), %r12
movq %rbx, %rdi
callq 0xae38
leaq 0x192ca(%rip), %rcx     # 0x352f0
movq %rcx, 0x8(%rax)
movq $0x0, (%rax)
movq %r14, 0x18(%rax)
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x876e
movl %eax, %r12d
movq -0x48(%rbp), %rdx
cmpq $0x0, -0x40(%rbp)
sets %al
setg %cl
movq %r14, -0x30(%rbp)
cmpq %rdx, %r14
setl %r13b
setg %r14b
andb %cl, %r13b
andb %al, %r14b
testb %r13b, %r13b
je 0x1c079
testl %r12d, %r12d
je 0x1c088
jmp 0x1c1f3
testl %r12d, %r12d
sete %al
testb %al, %r14b
je 0x1c1fe
movq %rdx, %r15
movq %rbx, %rdi
movq -0x58(%rbp), %rsi
callq 0x908a
movl %eax, %r12d
leal -0x3(%r12), %eax
cmpl $0x1, %eax
ja 0x1c0b6
movl 0x18(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x18(%rbx)
cmpl $0x1, %eax
jg 0x1c238
testl $0xfffffffb, %r12d      # imm = 0xFFFFFFFB
movq %r15, %rdx
jne 0x1c06a
movq -0x38(%rbp), %r12
movq 0x8(%r12), %rsi
movq %rbx, %rdi
movl $0x1, %edx
callq 0x98e7
movq %rax, %r13
movq -0x30(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
testq %r13, %r13
je 0x1c100
cmpl $0x1, 0x10(%r13)
jg 0x1c100
leaq 0x191f6(%rip), %rax     # 0x352f0
cmpq %rax, 0x8(%r13)
je 0x1c15d
movq %rbx, %rdi
callq 0xae38
movq %rax, %r13
leaq 0x191de(%rip), %rax     # 0x352f0
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
movq -0x30(%rbp), %r14
movq %r14, 0x18(%r13)
movq 0x8(%r12), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x876e
xorl %r12d, %r12d
testl %eax, %eax
movq %r15, %rdx
je 0x1c04a
movq %rbx, %rdi
movq %r13, %rsi
callq 0x758c
movq %r15, %rdx
movl $0x1, %r12d
jmp 0x1c04a
movq 0x8(%r12), %rsi
leaq 0x19bef(%rip), %rax     # 0x35d58
cmpq %rax, 0x8(%rsi)
je 0x1c182
movq %rbx, %rdi
movq %r13, %rdx
callq 0x876e
testl %eax, %eax
jne 0x1c24d
movq -0x30(%rbp), %rax
movq %rax, 0x18(%r13)
movq (%r13), %rdi
testq %rdi, %rdi
sete %al
leaq 0x1b0fd(%rip), %rcx     # 0x37298
cmpq %rcx, %rdi
sete %cl
orb %al, %cl
jne 0x1c1ad
xorl %esi, %esi
callq *0x1b0db(%rip)          # 0x37288
movq $0x0, (%r13)
movq 0x8(%r12), %rsi
xorl %r12d, %r12d
leaq 0x19b94(%rip), %rax     # 0x35d58
cmpq %rax, 0x8(%rsi)
movq -0x30(%rbp), %r14
movq %r15, %rdx
je 0x1c04a
movq %rbx, %rdi
movq %r13, %rdx
callq 0x876e
movq %r15, %rdx
movl $0x1, %r13d
testl %eax, %eax
je 0x1c04a
jmp 0x1c23b
movl %r12d, %r13d
cmpl $0x3, %r12d
je 0x1c20c
jmp 0x1c23b
cmpl $0x3, %r12d
je 0x1c20c
movl %r12d, %r13d
testl %r12d, %r12d
jne 0x1c23b
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 0x1c230
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
xorl %r13d, %r13d
jmp 0x1c23b
movl %r12d, %r13d
movl %r13d, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %r13d
jmp 0x1c23b