// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_ListSetIndex
int Jim_ListSetIndex(Jim_Interp *interp, Jim_Obj *varNamePtr,
    Jim_Obj *const *indexv, int indexc, Jim_Obj *newObjPtr)
{
    Jim_Obj *varObjPtr, *objPtr, *listObjPtr;
    int shared, i, idx;

    varObjPtr = objPtr = Jim_GetVariable(interp, varNamePtr, JIM_ERRMSG | JIM_UNSHARED);
    if (objPtr == NULL)
        return JIM_ERR;
    if ((shared = Jim_IsShared(objPtr)))
        varObjPtr = objPtr = Jim_DuplicateObj(interp, objPtr);
    for (i = 0; i < indexc - 1; i++) {
        listObjPtr = objPtr;
        if (Jim_GetIndex(interp, indexv[i], &idx) != JIM_OK)
            goto err;

        objPtr = Jim_ListGetIndex(interp, listObjPtr, idx);
        if (objPtr == NULL) {
            Jim_SetResultFormatted(interp, "index \"%#s\" out of range", indexv[i]);
            goto err;
        }
        if (Jim_IsShared(objPtr)) {
            objPtr = Jim_DuplicateObj(interp, objPtr);
            ListSetIndex(interp, listObjPtr, idx, objPtr, JIM_NONE);
        }
        Jim_InvalidateStringRep(listObjPtr);
    }
    if (Jim_GetIndex(interp, indexv[indexc - 1], &idx) != JIM_OK)
        goto err;
    if (ListSetIndex(interp, objPtr, idx, newObjPtr, JIM_ERRMSG) == JIM_ERR)
        goto err;
    Jim_InvalidateStringRep(objPtr);
    Jim_InvalidateStringRep(varObjPtr);
    if (Jim_SetVariable(interp, varNamePtr, varObjPtr) != JIM_OK)
        goto err;
    Jim_SetResult(interp, varObjPtr);
    return JIM_OK;
  err:
    if (shared) {
        Jim_FreeNewObj(interp, varObjPtr);
    }
    return JIM_ERR;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x5, %edx
callq 0xa7b0
movq %rax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x10368
movl $0x1, -0x4(%rbp)
jmp 0x10540
movq -0x40(%rbp), %rax
cmpl $0x1, 0x10(%rax)
setg %al
movb %al, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, -0x4c(%rbp)
testb $0x1, %al
jne 0x10384
jmp 0x10399
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x9a00
movq %rax, -0x40(%rbp)
movq %rax, -0x38(%rbp)
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x10463
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x54(%rbp), %rdx
callq 0x87a0
cmpl $0x0, %eax
je 0x103dc
jmp 0x10526
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x54(%rbp), %edx
callq 0x101d0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1041a
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x50(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x2acdb(%rip), %rsi     # 0x3b0e9
movb $0x0, %al
callq 0x6b40
jmp 0x10526
movq -0x40(%rbp), %rax
cmpl $0x1, 0x10(%rax)
jle 0x1044c
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0x9a00
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movl -0x54(%rbp), %edx
movq -0x40(%rbp), %rcx
xorl %r8d, %r8d
callq 0x10550
movq -0x48(%rbp), %rdi
callq 0xa9b0
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x103a0
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl -0x24(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x54(%rbp), %rdx
callq 0x87a0
cmpl $0x0, %eax
je 0x1048b
jmp 0x10526
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movl -0x54(%rbp), %edx
movq -0x30(%rbp), %rcx
movl $0x1, %r8d
callq 0x10550
cmpl $0x1, %eax
jne 0x104ac
jmp 0x10526
movq -0x40(%rbp), %rdi
callq 0xa9b0
movq -0x38(%rbp), %rdi
callq 0xa9b0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x8df0
cmpl $0x0, %eax
je 0x104d6
jmp 0x10526
jmp 0x104d8
movq -0x38(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%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 0x10512
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x60(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x10540
cmpl $0x0, -0x4c(%rbp)
je 0x10539
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x7a10
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)