// File: /workspace/github_c_makefile_star2_O2/msteveb[P]autosetup/./jimsh0.c
// Function: JimCallProcedure
static int JimCallProcedure(Jim_Interp *interp, Jim_Cmd *cmd, int argc, Jim_Obj *const *argv)
{
    Jim_CallFrame *callFramePtr;
    int i, d, retcode, optargs;


    if (argc - 1 < cmd->u.proc.reqArity ||
        (cmd->u.proc.argsPos < 0 && argc - 1 > cmd->u.proc.reqArity + cmd->u.proc.optArity)) {
        JimSetProcWrongArgs(interp, argv[0], cmd);
        return JIM_ERR;
    }

    if (Jim_Length(cmd->u.proc.bodyObjPtr) == 0) {

        return JIM_OK;
    }


    if (interp->framePtr->level == interp->maxCallFrameDepth) {
        Jim_SetResultString(interp, "Too many nested calls. Infinite recursion?", -1);
        return JIM_ERR;
    }


    callFramePtr = JimCreateCallFrame(interp, interp->framePtr, cmd->u.proc.nsObj);
    callFramePtr->argv = argv;
    callFramePtr->argc = argc;
    callFramePtr->procArgsObjPtr = cmd->u.proc.argListObjPtr;
    callFramePtr->procBodyObjPtr = cmd->u.proc.bodyObjPtr;
    callFramePtr->staticVars = cmd->u.proc.staticVars;

    interp->procLevel++;

    Jim_IncrRefCount(cmd->u.proc.argListObjPtr);
    Jim_IncrRefCount(cmd->u.proc.bodyObjPtr);
    interp->framePtr = callFramePtr;


    optargs = (argc - 1 - cmd->u.proc.reqArity);


    i = 1;
    for (d = 0; d < cmd->u.proc.argListLen; d++) {
        Jim_Obj *nameObjPtr = cmd->u.proc.arglist[d].nameObjPtr;
        if (d == cmd->u.proc.argsPos) {

            Jim_Obj *listObjPtr;
            int argsLen = 0;
            if (cmd->u.proc.reqArity + cmd->u.proc.optArity < argc - 1) {
                argsLen = argc - 1 - (cmd->u.proc.reqArity + cmd->u.proc.optArity);
            }
            listObjPtr = Jim_NewListObj(interp, &argv[i], argsLen);


            if (cmd->u.proc.arglist[d].defaultObjPtr) {
                nameObjPtr =cmd->u.proc.arglist[d].defaultObjPtr;
            }
            retcode = Jim_SetVariable(interp, nameObjPtr, listObjPtr);
            if (retcode != JIM_OK) {
                goto badargset;
            }

            i += argsLen;
            continue;
        }


        if (cmd->u.proc.arglist[d].defaultObjPtr == NULL || optargs-- > 0) {
            retcode = JimSetProcArg(interp, nameObjPtr, argv[i++]);
        }
        else {

            retcode = Jim_SetVariable(interp, nameObjPtr, cmd->u.proc.arglist[d].defaultObjPtr);
        }
        if (retcode != JIM_OK) {
            goto badargset;
        }
    }

    if (interp->traceCmdObj == NULL ||
        (retcode = JimTraceCallback(interp, "proc", argc, argv)) == JIM_OK) {

        retcode = Jim_EvalObj(interp, cmd->u.proc.bodyObjPtr);
    }

badargset:


    retcode = JimInvokeDefer(interp, retcode);
    interp->framePtr = interp->framePtr->parent;
    JimFreeCallFrame(interp, callFramePtr, JIM_FCF_REUSE);


    if (retcode == JIM_RETURN) {
        if (--interp->returnLevel <= 0) {
            retcode = interp->returnCode;
            interp->returnCode = JIM_OK;
            interp->returnLevel = 0;
        }
    }
    interp->procLevel--;

    return retcode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, -0x50(%rbp)
movq %rsi, %r14
movq %rdi, %rbx
movl 0x34(%rsi), %eax
cmpl %edx, %eax
movq %rdi, -0x38(%rbp)
movq %rsi, -0x60(%rbp)
jge 0x18c21
movl %edx, %r15d
leal -0x1(%r15), %r13d
cmpl $0x0, 0x3c(%r14)
jns 0x18d77
addl 0x38(%r14), %eax
cmpl %eax, %r13d
jle 0x18d77
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
leaq 0x10a0e(%rip), %rsi     # 0x29641
xorl %r12d, %r12d
movq %rbx, %rdi
xorl %edx, %edx
callq 0x7363
movq %rax, %r13
pushq $0x1
popq %r15
xorl %ebx, %ebx
movslq 0x30(%r14), %rax
cmpq %rax, %rbx
jge 0x18d59
movq -0x38(%rbp), %rdi
movq %r13, %rsi
leaq 0x10900(%rip), %rdx     # 0x29564
movl %r15d, %ecx
callq 0x823a
movl 0x3c(%r14), %ecx
movq 0x48(%r14), %rax
cmpq %rcx, %rbx
jne 0x18cc9
cmpq $0x0, 0x8(%rax,%r12)
je 0x18d1a
movq -0x38(%rbp), %r14
movq %r14, %rdi
movq %r13, %rsi
leaq 0xe7c8(%rip), %rdx      # 0x2745e
movl %r15d, %ecx
callq 0x823a
movq -0x60(%rbp), %rax
movq 0x48(%rax), %rax
movq 0x8(%rax,%r12), %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0xa6f6
movq %r14, %rdi
movq -0x60(%rbp), %r14
movq %r13, %rsi
leaq 0x10529(%rip), %rdx     # 0x291f0
jmp 0x18d45
cmpq $0x0, 0x8(%rax,%r12)
je 0x18d2a
movq -0x38(%rbp), %r14
movq %r14, %rdi
movq %r13, %rsi
leaq 0xe77c(%rip), %r15      # 0x2745e
movq %r15, %rdx
pushq $0x1
popq %rcx
callq 0x823a
movq -0x60(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax,%r12), %rdx
movq %r14, %rdi
movq %r13, %rsi
callq 0xa6f6
movq %r14, %rdi
movq -0x60(%rbp), %r14
movq %r13, %rsi
movq %r15, %rdx
pushq $0x1
popq %r15
movl %r15d, %ecx
jmp 0x18d48
movq -0x38(%rbp), %rdi
movq %r13, %rsi
leaq 0xfba2(%rip), %rdx      # 0x288ca
jmp 0x18d45
movq (%rax,%r12), %rdi
callq 0x7340
xorl %edx, %edx
cmpb $0x26, (%rax)
sete %dl
addq %rax, %rdx
movq -0x38(%rbp), %rdi
movq %r13, %rsi
pushq $-0x1
popq %rcx
callq 0x823a
incq %rbx
addq $0x10, %r12
jmp 0x18c49
leaq 0xf501(%rip), %rsi      # 0x28261
movq -0x38(%rbp), %rdi
movq -0x50(%rbp), %rdx
movq %r13, %rcx
xorl %eax, %eax
callq 0x68a7
jmp 0x19095
movq 0x20(%r14), %rdi
callq 0xa61a
testl %eax, %eax
je 0x18dcd
movq 0x58(%rbx), %rsi
movl 0x8(%rsi), %eax
cmpl 0x1c(%rbx), %eax
jne 0x18dd5
leaq 0xf49f(%rip), %rsi      # 0x28236
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x7363
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x18dc1
movq %rbx, %rdi
callq 0x73bf
movq %r14, (%rbx)
pushq $0x1
popq %r15
jmp 0x19095
xorl %r15d, %r15d
jmp 0x19095
movq 0x50(%r14), %rdx
movq %rbx, %rdi
callq 0xc142
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rax, 0x50(%rcx)
movq %r15, -0x68(%rbp)
movl %r15d, 0x58(%rcx)
movq 0x18(%r14), %rax
movq %rax, 0x60(%rcx)
movq 0x20(%r14), %rax
movq %rax, 0x68(%rcx)
movq 0x28(%r14), %rax
movq %rax, 0x40(%rcx)
incl 0x110(%rbx)
movq 0x18(%r14), %rax
incl 0x10(%rax)
movq 0x20(%r14), %rax
incl 0x10(%rax)
movq %rcx, -0x70(%rbp)
movq %rcx, 0x58(%rbx)
movl %r13d, %r8d
subl 0x34(%r14), %r8d
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
xorl %r15d, %r15d
movl %r13d, -0x3c(%rbp)
movslq 0x30(%r14), %rax
cmpq %rax, %r15
jge 0x18fff
movq 0x48(%r14), %rcx
movq -0x8(%rcx,%rsi), %r12
movl 0x3c(%r14), %edx
movslq %edi, %rax
cmpq %rdx, %r15
jne 0x18edb
movq %r8, -0x58(%rbp)
movl %edi, -0x2c(%rbp)
movq %r15, -0x48(%rbp)
movl 0x38(%r14), %ecx
addl 0x34(%r14), %ecx
subl %ecx, %r13d
movl $0x0, %ecx
cmovlel %ecx, %r13d
movq -0x50(%rbp), %rcx
movq %rsi, %r15
leaq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
movl %r13d, %edx
callq 0x745b
movq 0x48(%r14), %rcx
movq %rbx, %rdi
movq %r15, %rbx
movq (%rcx,%r15), %rcx
testq %rcx, %rcx
cmovneq %rcx, %r12
movq %rdi, %r15
movq %r12, %rsi
movq %rax, %rdx
callq 0x8306
testl %eax, %eax
jne 0x19036
movl -0x2c(%rbp), %edi
addl %r13d, %edi
movl -0x3c(%rbp), %r13d
movq %rbx, %rsi
movq %r15, %rbx
movq -0x48(%rbp), %r15
movq -0x58(%rbp), %r8
jmp 0x18ff3
movq (%rcx,%rsi), %rdx
testq %rdx, %rdx
je 0x18efb
leal -0x1(%r8), %r14d
testl %r8d, %r8d
jle 0x18fc0
movq %r15, -0x48(%rbp)
movq %rsi, -0x58(%rbp)
jmp 0x18f06
movq %r15, -0x48(%rbp)
movq %rsi, -0x58(%rbp)
movl %r8d, %r14d
leal 0x1(%rax), %ecx
movl %ecx, -0x2c(%rbp)
movq -0x50(%rbp), %rcx
movq (%rcx,%rax,8), %r13
movq %r12, %rdi
callq 0x7340
cmpb $0x26, (%rax)
jne 0x18f9d
movq %rax, %r15
movq -0x38(%rbp), %rbx
movq 0x58(%rbx), %r12
movq 0x48(%r12), %rax
movq %rax, 0x58(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
pushq $0x1
popq %rdx
callq 0x9378
movq %r12, 0x58(%rbx)
testq %rax, %rax
je 0x19043
incq %r15
movq %rbx, %rdi
movq %r15, %rsi
pushq $-0x1
popq %rdx
callq 0x7363
movq %rax, %r15
incl 0x10(%rax)
movq 0x58(%rbx), %rax
movq 0x48(%rax), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
callq 0xba06
movl %eax, %r12d
movl 0x10(%r15), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r15)
cmpl $0x1, %eax
jg 0x18faf
movq %rbx, %rdi
movq %r15, %rsi
callq 0x73bf
jmp 0x18faf
movq -0x38(%rbp), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x8306
movl %eax, %r12d
movl -0x3c(%rbp), %r13d
movq -0x58(%rbp), %rsi
movq -0x48(%rbp), %r15
movl -0x2c(%rbp), %edi
jmp 0x18fe3
movl %r14d, -0x48(%rbp)
movl %edi, %r14d
movq -0x38(%rbp), %rdi
movq %rsi, %rbx
movq %r12, %rsi
callq 0x8306
movl %r14d, %edi
movl -0x48(%rbp), %r14d
movq %rbx, %rsi
movl %eax, %r12d
movl %r14d, %r8d
testl %r12d, %r12d
movq -0x38(%rbp), %rbx
movq -0x60(%rbp), %r14
jne 0x1903e
incq %r15
addq $0x10, %rsi
jmp 0x18e3c
cmpq $0x0, 0x1a8(%rbx)
je 0x19026
leaq 0x1015d(%rip), %rsi     # 0x2916d
movq %rbx, %rdi
movq -0x68(%rbp), %rdx
movq -0x50(%rbp), %rcx
callq 0x18a75
movl %eax, %esi
testl %eax, %eax
jne 0x19046
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x8b54
movl %eax, %esi
jmp 0x19046
pushq $0x1
popq %rsi
movq %r15, %rbx
jmp 0x19046
movl %r12d, %esi
jmp 0x19046
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0xc425
movl %eax, %r15d
movq 0x58(%rbx), %rax
movq 0x48(%rax), %rax
movq %rax, 0x58(%rbx)
pushq $0x1
popq %rdx
movq %rbx, %rdi
movq -0x70(%rbp), %rsi
callq 0xc559
cmpl $0x2, %r15d
jne 0x1908f
movl 0x2c(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x2c(%rbx)
cmpl $0x1, %eax
jg 0x1908b
movl 0x28(%rbx), %r15d
andq $0x0, 0x28(%rbx)
jmp 0x1908f
pushq $0x2
popq %r15
decl 0x110(%rbx)
movl %r15d, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq