// File: /workspace/github_c_makefile_star2_O1/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, %r12
movq %rsi, %r14
movq %rdi, %r15
movl 0x34(%rsi), %eax
cmpl %edx, %eax
movq %rdi, -0x38(%rbp)
jge 0x1b89e
movl %edx, %r13d
leal -0x1(%r13), %ecx
cmpl $0x0, 0x3c(%r14)
jns 0x1ba25
addl 0x38(%r14), %eax
cmpl %eax, %ecx
jle 0x1ba25
movq (%r12), %rax
movq %rax, -0x48(%rbp)
movq %r15, %rdi
callq 0xae58
movq %rax, %r12
leaq 0x1c9e0(%rip), %rax     # 0x38298
movq %rax, (%r12)
movl $0x0, 0x14(%r12)
movq $0x0, 0x8(%r12)
cmpl $0x0, 0x30(%r14)
jle 0x1b9f5
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r14, -0x60(%rbp)
movq %r15, %rdi
movq %r12, %rsi
leaq 0x12c87(%rip), %rdx     # 0x2e576
movl $0x1, %ecx
callq 0x8653
movl 0x3c(%r14), %ecx
movq 0x48(%r14), %rax
cmpq %rcx, %rbx
jne 0x1b94f
cmpq $0x0, 0x8(%rax,%r13)
je 0x1b99c
movq %r15, %rdi
movq %r12, %rsi
leaq 0x10b4a(%rip), %rdx     # 0x2c469
movl $0x1, %ecx
callq 0x8653
movq 0x48(%r14), %rax
movq 0x8(%rax,%r13), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xafb0
movq %r15, %rdi
movq %r12, %rsi
leaq 0x128b8(%rip), %rdx     # 0x2e202
jmp 0x1b9d7
cmpq $0x0, 0x8(%rax,%r13)
je 0x1b9ab
movq %r15, %rdi
movq %r12, %rsi
leaq 0x10b05(%rip), %r14     # 0x2c469
movq %r14, %rdx
movl $0x1, %ecx
callq 0x8653
movq -0x60(%rbp), %rax
movq 0x48(%rax), %rax
movq (%rax,%r13), %rdx
movq %r15, %rdi
movq %r12, %rsi
callq 0xafb0
movq %r15, %rdi
movq %r12, %rsi
movq %r14, %rdx
movq -0x60(%rbp), %r14
movl $0x1, %ecx
jmp 0x1b9dc
movq %r15, %rdi
movq %r12, %rsi
leaq 0x11f2f(%rip), %rdx     # 0x2d8d8
jmp 0x1b9d7
movq (%rax,%r13), %r15
cmpq $0x0, (%r15)
jne 0x1b9bf
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 0x8653
incq %rbx
movslq 0x30(%r14), %rax
addq $0x10, %r13
cmpq %rax, %rbx
jl 0x1b8e2
leaq 0x11873(%rip), %rsi     # 0x2d26f
movq %r15, %rdi
movq -0x48(%rbp), %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x692d
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 0x1ba3d
movq 0x8(%r15), %rax
movq %r15, %rdi
movl %ecx, %ebx
callq *0x18(%rax)
movl %ebx, %ecx
cmpl $0x0, 0x14(%r15)
je 0x1ba8c
movq -0x38(%rbp), %rbx
movq 0x58(%rbx), %rsi
movl 0x8(%rsi), %eax
cmpl 0x1c(%rbx), %eax
jne 0x1ba91
leaq 0x117e9(%rip), %rsi     # 0x2d244
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
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 0x1ba87
movq %rbx, %rdi
callq 0x759a
movq %r14, (%rbx)
jmp 0x1ba0d
xorl %r14d, %r14d
jmp 0x1ba13
movl %ecx, -0x3c(%rbp)
movq 0x50(%r14), %rdx
movq %rbx, %rdi
callq 0xccca
movq %r12, -0x58(%rbp)
movq %r12, 0x50(%rax)
movq %r13, -0x68(%rbp)
movl %r13d, 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(%rbx)
movq 0x18(%r14), %rcx
incl 0x10(%rcx)
movq 0x20(%r14), %rcx
incl 0x10(%rcx)
movq %rax, -0x70(%rbp)
movq %rax, 0x58(%rbx)
cmpl $0x0, 0x30(%r14)
jle 0x1bcd1
movl -0x3c(%rbp), %eax
subl 0x34(%r14), %eax
movq %rax, -0x50(%rbp)
movl $0x1, %ebx
movl $0x8, %r15d
xorl %edx, %edx
movq 0x48(%r14), %rax
movq -0x8(%rax,%r15), %r13
movl 0x3c(%r14), %ecx
movq %rdx, -0x48(%rbp)
cmpq %rcx, %rdx
jne 0x1bb90
movl 0x38(%r14), %eax
addl 0x34(%r14), %eax
xorl %ecx, %ecx
movl -0x3c(%rbp), %r12d
subl %eax, %r12d
cmovlel %ecx, %r12d
movl %ebx, -0x2c(%rbp)
movslq %ebx, %rax
movq -0x58(%rbp), %rcx
leaq (%rcx,%rax,8), %rsi
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movl %r12d, %edx
callq 0x7640
movq 0x48(%r14), %rcx
movq (%rcx,%r15), %rcx
testq %rcx, %rcx
cmovneq %rcx, %r13
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x871b
movl %eax, %r13d
xorl %eax, %eax
testl %r13d, %r13d
sete %cl
je 0x1bb7c
xorl %r12d, %r12d
movb %cl, %al
xorl $0x7, %eax
movl -0x2c(%rbp), %ebx
addl %r12d, %ebx
movq -0x48(%rbp), %rdx
jmp 0x1bcb4
movq (%rax,%r15), %rdx
testq %rdx, %rdx
je 0x1bbb4
movl %ebx, %r12d
movq -0x50(%rbp), %rax
leal -0x1(%rax), %ebx
testl %eax, %eax
jle 0x1bc8b
movl %ebx, %eax
movq %rax, -0x50(%rbp)
movl %r12d, %ebx
movslq %ebx, %rax
movq -0x58(%rbp), %rcx
movq (%rcx,%rax,8), %rdx
cmpq $0x0, (%r13)
jne 0x1bbd6
movq 0x8(%r13), %rax
movq %r13, %rdi
movq %rdx, %r12
callq *0x18(%rax)
movq %r12, %rdx
incl %ebx
movq (%r13), %r12
cmpb $0x26, (%r12)
jne 0x1bc7a
movl %ebx, -0x2c(%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 0x98ef
movq -0x80(%rbp), %rcx
movq %rcx, 0x58(%rbx)
testq %rax, %rax
je 0x1bc75
incq %r12
movq %rbx, %rdi
movq %r12, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %rax, %r12
incl 0x10(%rax)
movq 0x58(%rbx), %rax
movq 0x48(%rax), %rcx
movq %rbx, %rdi
movq %r12, %rsi
movq -0x78(%rbp), %rdx
callq 0xc4e5
movl %eax, %r13d
movl 0x10(%r12), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r12)
cmpl $0x1, %eax
jg 0x1bc75
movq %rbx, %rdi
movq %r12, %rsi
callq 0x759a
movl -0x2c(%rbp), %ebx
jmp 0x1bca3
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x871b
movl %eax, %r13d
jmp 0x1bca3
movq -0x38(%rbp), %rdi
movq %r13, %rsi
callq 0x871b
movl %eax, %r13d
movl %ebx, %eax
movq %rax, -0x50(%rbp)
movl %r12d, %ebx
movl %r13d, %eax
testl %r13d, %r13d
movq -0x48(%rbp), %rdx
je 0x1bcb4
movl $0x7, %eax
testl %eax, %eax
je 0x1bcbd
cmpl $0x6, %eax
jne 0x1bd0e
incq %rdx
movslq 0x30(%r14), %rax
addq $0x10, %r15
cmpq %rax, %rdx
jl 0x1bb07
movq -0x38(%rbp), %rbx
cmpq $0x0, 0x1a8(%rbx)
je 0x1bcfd
leaq 0x12499(%rip), %rsi     # 0x2e17f
movq %rbx, %rdi
movq -0x68(%rbp), %rdx
movq -0x58(%rbp), %rcx
callq 0x1b6dd
movl %eax, %r13d
testl %eax, %eax
jne 0x1bd17
movq 0x20(%r14), %rsi
movq %rbx, %rdi
callq 0x9078
movl %eax, %r13d
jmp 0x1bd17
cmpl $0x7, %eax
jne 0x1bd73
movq -0x38(%rbp), %rbx
movq %rbx, %rdi
movl %r13d, %esi
callq 0xd081
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 0xd1df
cmpl $0x2, %r14d
jne 0x1bd68
movl 0x2c(%rbx), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x2c(%rbx)
movl $0x2, %r14d
cmpl $0x1, %eax
jg 0x1bd68
movl 0x28(%rbx), %r14d
movq $0x0, 0x28(%rbx)
decl 0x110(%rbx)
jmp 0x1ba13
jmp 0x1ba13