// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: JimCreateProcedureCmd
static Jim_Cmd *JimCreateProcedureCmd(Jim_Interp *interp, Jim_Obj *argListObjPtr,
    Jim_Obj *staticsListObjPtr, Jim_Obj *bodyObjPtr, Jim_Obj *nsObj)
{
    Jim_Cmd *cmdPtr;
    int argListLen;
    int i;

    argListLen = Jim_ListLength(interp, argListObjPtr);


    cmdPtr = Jim_Alloc(sizeof(*cmdPtr) + sizeof(struct Jim_ProcArg) * argListLen);
    assert(cmdPtr);
    memset(cmdPtr, 0, sizeof(*cmdPtr));
    cmdPtr->inUse = 1;
    cmdPtr->isproc = 1;
    cmdPtr->u.proc.argListObjPtr = argListObjPtr;
    cmdPtr->u.proc.argListLen = argListLen;
    cmdPtr->u.proc.bodyObjPtr = bodyObjPtr;
    cmdPtr->u.proc.argsPos = -1;
    cmdPtr->u.proc.arglist = (struct Jim_ProcArg *)(cmdPtr + 1);
    cmdPtr->u.proc.nsObj = nsObj ? nsObj : interp->emptyObj;
    Jim_IncrRefCount(argListObjPtr);
    Jim_IncrRefCount(bodyObjPtr);
    Jim_IncrRefCount(cmdPtr->u.proc.nsObj);


    if (staticsListObjPtr && JimCreateProcedureStatics(interp, cmdPtr, staticsListObjPtr) != JIM_OK) {
        goto err;
    }



    for (i = 0; i < argListLen; i++) {
        Jim_Obj *argPtr;
        Jim_Obj *nameObjPtr;
        Jim_Obj *defaultObjPtr;
        int len;


        argPtr = Jim_ListGetIndex(interp, argListObjPtr, i);
        len = Jim_ListLength(interp, argPtr);
        if (len == 0) {
            Jim_SetResultString(interp, "argument with no name", -1);
err:
            JimDecrCmdRefCount(interp, cmdPtr);
            return NULL;
        }
        if (len > 2) {
            Jim_SetResultFormatted(interp, "too many fields in argument specifier \"%#s\"", argPtr);
            goto err;
        }

        if (len == 2) {

            nameObjPtr = Jim_ListGetIndex(interp, argPtr, 0);
            defaultObjPtr = Jim_ListGetIndex(interp, argPtr, 1);
        }
        else {

            nameObjPtr = argPtr;
            defaultObjPtr = NULL;
        }


        if (Jim_CompareStringImmediate(interp, nameObjPtr, "args")) {
            if (cmdPtr->u.proc.argsPos >= 0) {
                Jim_SetResultString(interp, "'args' specified more than once", -1);
                goto err;
            }
            cmdPtr->u.proc.argsPos = i;
        }
        else {
            if (len == 2) {
                cmdPtr->u.proc.optArity++;
            }
            else {
                cmdPtr->u.proc.reqArity++;
            }
        }

        cmdPtr->u.proc.arglist[i].nameObjPtr = nameObjPtr;
        cmdPtr->u.proc.arglist[i].defaultObjPtr = defaultObjPtr;
    }

    return cmdPtr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x9b50
movl %eax, -0x3c(%rbp)
movq 0x183ea(%rip), %rax     # 0x48290
movslq -0x3c(%rbp), %rsi
shlq $0x4, %rsi
addq $0x58, %rsi
xorl %ecx, %ecx
movl %ecx, %edi
callq *%rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x2fec5
jmp 0x2fee4
leaq 0xcdaf(%rip), %rdi      # 0x3cc7b
leaq 0xae43(%rip), %rsi      # 0x3ad16
movl $0x28ff, %edx           # imm = 0x28FF
leaq 0xcda3(%rip), %rcx      # 0x3cc82
callq 0x6230
movq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x58, %edx
callq 0x6250
movq -0x38(%rbp), %rax
movl $0x1, (%rax)
movq -0x38(%rbp), %rax
movl $0x1, 0x4(%rax)
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x18(%rax)
movl -0x3c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x30(%rax)
movq -0x28(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rax
movl $0xffffffff, 0x3c(%rax) # imm = 0xFFFFFFFF
movq -0x38(%rbp), %rcx
addq $0x58, %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x48(%rax)
cmpq $0x0, -0x30(%rbp)
je 0x2ff57
movq -0x30(%rbp), %rax
movq %rax, -0x78(%rbp)
jmp 0x2ff66
movq -0x10(%rbp), %rax
movq 0x128(%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x28(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x38(%rbp), %rax
movq 0x50(%rax), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x2ffbf
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x301e0
cmpl $0x0, %eax
je 0x2ffbf
jmp 0x30056
movl $0x0, -0x40(%rbp)
movl -0x40(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jge 0x301c2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x40(%rbp), %edx
callq 0x101d0
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
callq 0x9b50
movl %eax, -0x5c(%rbp)
cmpl $0x0, -0x5c(%rbp)
jne 0x30070
jmp 0x2fffe
movq -0x10(%rbp), %rdi
leaq 0xccd2(%rip), %rsi      # 0x3ccdb
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x30049
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x68(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x30056
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x1fd20
movq $0x0, -0x8(%rbp)
jmp 0x301ca
cmpl $0x2, -0x5c(%rbp)
jle 0x3008e
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rdx
leaq 0xcc6c(%rip), %rsi      # 0x3ccf1
movb $0x0, %al
callq 0x6b40
jmp 0x30056
cmpl $0x2, -0x5c(%rbp)
jne 0x300bf
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
xorl %edx, %edx
callq 0x101d0
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl $0x1, %edx
callq 0x101d0
movq %rax, -0x58(%rbp)
jmp 0x300cf
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rsi
leaq 0xcc3f(%rip), %rdx      # 0x3cd1d
callq 0x77a0
cmpl $0x0, %eax
je 0x3015b
movq -0x38(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
jl 0x3014f
jmp 0x300f4
movq -0x10(%rbp), %rdi
leaq 0xcc23(%rip), %rsi      # 0x3cd22
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x3013f
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x70(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x30056
movl -0x40(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x3c(%rax)
jmp 0x3017f
cmpl $0x2, -0x5c(%rbp)
jne 0x30170
movq -0x38(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
jmp 0x3017d
movq -0x38(%rbp), %rax
movl 0x34(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x34(%rax)
jmp 0x3017f
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x40(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x58(%rbp), %rcx
movq -0x38(%rbp), %rax
movq 0x48(%rax), %rax
movslq -0x40(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x2ffc6
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)