// File: /workspace/github_c_makefile_star2_O3/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 $0x58, %rsp
movq %rcx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movl 0x34(%rsi), %eax
cmpl %edx, %eax
movq %rdi, -0x38(%rbp)
jge 0x1b2a1
movl %edx, %r12d
leal -0x1(%r12), %r13d
cmpl $0x0, 0x3c(%r14)
jns 0x1b429
addl 0x38(%r14), %eax
cmpl %eax, %r13d
jle 0x1b429
movq (%rbx), %rax
movq %rax, -0x48(%rbp)
movq %r15, %rdi
callq 0xae38
movq %rax, %r12
leaq 0x1bfde(%rip), %rax     # 0x37298
movq %rax, (%r12)
movl $0x0, 0x14(%r12)
movq $0x0, 0x8(%r12)
cmpl $0x0, 0x30(%r14)
jle 0x1b3f9
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r14, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
leaq 0x12223(%rip), %rdx     # 0x2d514
movl $0x1, %ecx
callq 0x86a0
movl 0x3c(%r14), %ecx
movq 0x48(%r14), %rax
cmpq %rcx, %rbx
jne 0x1b351
cmpq $0x0, 0x8(%rax,%r13)
je 0x1b39e
movq %r15, %rdi
movq %r12, %rsi
leaq 0x100ed(%rip), %rdx     # 0x2b40e
movl $0x1, %ecx
callq 0x86a0
movq 0x48(%r14), %rax
movq 0x8(%rax,%r13), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xaf90
movq %r15, %rdi
movq %r12, %rsi
leaq 0x11e54(%rip), %rdx     # 0x2d1a0
jmp 0x1b3db
cmpq $0x0, 0x8(%rax,%r13)
je 0x1b3ad
movq %r15, %rdi
movq %r12, %rsi
leaq 0x100a8(%rip), %r14     # 0x2b40e
movq %r14, %rdx
movl $0x1, %ecx
callq 0x86a0
movq -0x60(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax,%r13), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xaf90
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq -0x60(%rbp), %r14
movl $0x1, %ecx
jmp 0x1b3e0
movq %r15, %rdi
movq %r12, %rsi
leaq 0x114cf(%rip), %rdx     # 0x2c87a
jmp 0x1b3db
movq (%rax,%r13), %r15
movq (%r15), %rax
testq %rax, %rax
jne 0x1b3c6
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
movq (%r15), %rax
xorl %edx, %edx
cmpb $0x26, (%rax)
sete %dl
addq %rax, %rdx
movq -0x38(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x86a0
incq %rbx
movslq 0x30(%r14), %rax
addq $0x10, %r13
cmpq %rax, %rbx
jl 0x1b2e4
leaq 0x10e11(%rip), %rsi     # 0x2c211
movq %r15, %rdi
movq -0x48(%rbp), %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x6923
movl $0x1, %r14d
movl %r14d, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%r14), %r15
cmpq $0x0, (%r15)
jne 0x1b43d
movq 0x8(%r15), %rax
movq %r15, %rdi
callq *0x18(%rax)
cmpl $0x0, 0x14(%r15)
je 0x1b48d
movq -0x38(%rbp), %r15
movq 0x58(%r15), %rsi
movl 0x8(%rsi), %eax
cmpl 0x1c(%r15), %eax
jne 0x1b492
leaq 0x10d8a(%rip), %rsi     # 0x2c1e6
movq %r15, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r14
incl 0x10(%rax)
movq (%r15), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1b488
movq %r15, %rdi
callq 0x758c
movq %r14, (%r15)
jmp 0x1b411
xorl %r14d, %r14d
jmp 0x1b417
movl %r13d, -0x4c(%rbp)
movq 0x50(%r14), %rdx
movq %r15, %rdi
callq 0xccef
movq %rbx, -0x48(%rbp)
movq %rbx, 0x50(%rax)
movq %r12, -0x68(%rbp)
movl %r12d, 0x58(%rax)
movq 0x18(%r14), %rcx
movq %rcx, 0x60(%rax)
movq 0x20(%r14), %rcx
movq %rcx, 0x68(%rax)
movq 0x28(%r14), %rcx
movq %rcx, 0x40(%rax)
incl 0x110(%r15)
movq 0x18(%r14), %rcx
incl 0x10(%rcx)
movq 0x20(%r14), %rcx
incl 0x10(%rcx)
movq %rax, -0x70(%rbp)
movq %rax, 0x58(%r15)
cmpl $0x0, 0x30(%r14)
jle 0x1b6eb
movl -0x4c(%rbp), %eax
movl %eax, %edi
subl 0x34(%r14), %edi
movl $0x1, %r8d
movl $0x8, %ebx
xorl %r12d, %r12d
movq 0x48(%r14), %rax
movq -0x8(%rax,%rbx), %r13
movl 0x3c(%r14), %ecx
cmpq %rcx, %r12
jne 0x1b597
movq %rdi, -0x40(%rbp)
movq %r12, -0x30(%rbp)
movl 0x38(%r14), %eax
addl 0x34(%r14), %eax
movq %r15, %rdi
movl -0x4c(%rbp), %r15d
subl %eax, %r15d
movl $0x0, %eax
cmovlel %eax, %r15d
movslq %r8d, %rax
movq -0x48(%rbp), %rcx
movq %rbx, %r12
movl %r8d, %ebx
leaq (%rcx,%rax,8), %rsi
movl %r15d, %edx
callq 0x762e
movq 0x48(%r14), %rcx
movq (%rcx,%r12), %rcx
testq %rcx, %rcx
cmovneq %rcx, %r13
movq -0x38(%rbp), %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x876e
testl %eax, %eax
jne 0x1b727
addl %r15d, %ebx
movq -0x38(%rbp), %r15
movl %ebx, %r8d
movq %r12, %rbx
movq -0x30(%rbp), %r12
movq -0x40(%rbp), %rdi
jmp 0x1b6d7
movq (%rax,%rbx), %rdx
testq %rdx, %rdx
je 0x1b5cf
leal -0x1(%rdi), %eax
testl %edi, %edi
movl %eax, -0x30(%rbp)
jg 0x1b5d2
movq %r15, %rdi
movq %r13, %rsi
movq %r12, %r13
movq %rbx, %r12
movl %r8d, %ebx
callq 0x876e
movl %ebx, %r8d
movq %r12, %rbx
movq %r13, %r12
movl %eax, %r13d
jmp 0x1b6cd
movl %edi, -0x30(%rbp)
movslq %r8d, %rax
movq -0x48(%rbp), %rcx
movq (%rcx,%rax,8), %rdx
movq (%r13), %r15
testq %r15, %r15
jne 0x1b608
movq 0x8(%r13), %rax
movq %r13, %rdi
movq %rbx, -0x58(%rbp)
movl %r8d, %ebx
movq %rdx, %r15
callq *0x18(%rax)
movq %r15, %rdx
movl %ebx, %r8d
movq -0x58(%rbp), %rbx
movq (%r13), %r15
incl %r8d
movl %r8d, -0x40(%rbp)
cmpb $0x26, (%r15)
jne 0x1b6b7
movq %rbx, -0x58(%rbp)
movq -0x38(%rbp), %rbx
movq 0x58(%rbx), %rax
movq %rax, -0x80(%rbp)
movq 0x48(%rax), %rax
movq %rax, 0x58(%rbx)
movl $0x1, %r13d
movq %rbx, %rdi
movq %rdx, %rsi
movq %rdx, -0x78(%rbp)
movl $0x1, %edx
callq 0x98e7
movq -0x80(%rbp), %rcx
movq %rcx, 0x58(%rbx)
testq %rax, %rax
je 0x1b736
incq %r15
movq %rbx, %rdi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r15
incl 0x10(%rax)
movq 0x58(%rbx), %rax
movq 0x48(%rax), %rcx
movq %rbx, %rdi
movq %r15, %rsi
movq -0x78(%rbp), %rdx
callq 0xc500
movl %eax, %r13d
movl 0x10(%r15), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r15)
cmpl $0x1, %eax
jg 0x1b6aa
movq %rbx, %rdi
movq %r15, %rsi
callq 0x758c
movq %rbx, %r15
movl -0x40(%rbp), %r8d
movq -0x58(%rbp), %rbx
jmp 0x1b6cd
movq -0x38(%rbp), %r15
movq %r15, %rdi
movq %r13, %rsi
callq 0x876e
movl %eax, %r13d
movl -0x40(%rbp), %r8d
movl -0x30(%rbp), %eax
movl %eax, %edi
testl %r13d, %r13d
jne 0x1b733
incq %r12
movslq 0x30(%r14), %rax
addq $0x10, %rbx
cmpq %rax, %r12
jl 0x1b509
cmpq $0x0, 0x1a8(%r15)
movq %r15, %rbx
je 0x1b716
leaq 0x11a1e(%rip), %rsi     # 0x2d11d
movq %rbx, %rdi
movq -0x68(%rbp), %rdx
movq -0x48(%rbp), %rcx
callq 0x1b0de
movl %eax, %r13d
testl %eax, %eax
jne 0x1b736
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x908a
movl %eax, %r13d
jmp 0x1b736
movl $0x1, %r13d
movq -0x38(%rbp), %rbx
jmp 0x1b736
movq %r15, %rbx
movq %rbx, %rdi
movl %r13d, %esi
callq 0xd0a6
movl %eax, %r14d
movq 0x58(%rbx), %rax
movq 0x48(%rax), %rax
movq %rax, 0x58(%rbx)
movq %rbx, %rdi
movq -0x70(%rbp), %rsi
movl $0x1, %edx
callq 0xd1e6
cmpl $0x2, %r14d
jne 0x1b787
movl 0x2c(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x2c(%rbx)
movl $0x2, %r14d
cmpl $0x1, %eax
jg 0x1b787
movl 0x28(%rbx), %r14d
movq $0x0, 0x28(%rbx)
decl 0x110(%rbx)
jmp 0x1b417