// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r8, %r15
movl %ecx, %r12d
movq %rdx, -0x40(%rbp)
movq %rsi, %r14
movq %rdi, %rbx
pushq $0x5
popq %rdx
callq 0x9378
pushq $0x1
popq %rcx
testq %rax, %rax
je 0xdbaf
movl 0x10(%rax), %ecx
movl %ecx, -0x48(%rbp)
cmpl $0x2, %ecx
movq %r14, -0x50(%rbp)
movq %r15, -0x58(%rbp)
jl 0xda5f
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8a95
decl %r12d
xorl %r13d, %r13d
testl %r12d, %r12d
movl $0x0, %ecx
movl %r12d, -0x44(%rbp)
cmovgl %r12d, %ecx
movq %rcx, -0x60(%rbp)
movq %rax, -0x38(%rbp)
movq %rax, %r15
cmpq %r13, -0x60(%rbp)
je 0xdaf8
movq -0x40(%rbp), %rax
movq (%rax,%r13,8), %rsi
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x7d46
testl %eax, %eax
jne 0xdb9a
movl -0x2c(%rbp), %r12d
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
callq 0xd95e
testq %rax, %rax
je 0xdb81
movq %rax, %r14
cmpl $0x2, 0x10(%rax)
jl 0xdae8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x8a95
movq %rax, %r14
movq %rbx, %rdi
movq %r15, %rsi
movl %r12d, %edx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0xdbc0
movq %r15, %rdi
callq 0x94f7
incq %r13
movq %r14, %r15
jmp 0xda80
movslq -0x44(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rcx,%rax,8), %rsi
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x7d46
testl %eax, %eax
jne 0xdb9a
movl -0x2c(%rbp), %edx
pushq $0x1
popq %r8
movq %rbx, %rdi
movq %r15, %rsi
movq -0x58(%rbp), %rcx
callq 0xdbc0
testl %eax, %eax
jne 0xdb9a
movq %r15, %rdi
callq 0x94f7
movq -0x38(%rbp), %r14
movq %r14, %rdi
callq 0x94f7
movq %rbx, %rdi
movq -0x50(%rbp), %rsi
movq %r14, %rdx
callq 0x8306
testl %eax, %eax
jne 0xdb9a
movq -0x38(%rbp), %r14
incl 0x10(%r14)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0xdb7a
movq %rbx, %rdi
callq 0x73bf
movq %r14, (%rbx)
xorl %ecx, %ecx
jmp 0xdbaf
movq -0x40(%rbp), %rax
movq (%rax,%r13,8), %rdx
leaq 0x193fc(%rip), %rsi     # 0x26f8c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x68a7
cmpl $0x2, -0x48(%rbp)
jl 0xdbac
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x73bf
pushq $0x1
popq %rcx
movl %ecx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq