// File: /workspace/github_c_makefile_star2_O3/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, %r12
movl %ecx, %r14d
movq %rdx, -0x40(%rbp)
movq %rsi, %r15
movq %rdi, %rbx
movl $0x5, %edx
callq 0x98e7
movl $0x1, %ecx
testq %rax, %rax
je 0xeac7
movl 0x10(%rax), %ecx
movl %ecx, -0x44(%rbp)
cmpl $0x2, %ecx
movq %r15, -0x50(%rbp)
movq %r12, -0x58(%rbp)
jl 0xe90c
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8fc2
leal -0x1(%r14), %ecx
movl %ecx, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq %rax, %r15
cmpl $0x2, %r14d
jl 0xe9cd
movl -0x30(%rbp), %eax
movq %rax, -0x60(%rbp)
xorl %r13d, %r13d
movq -0x38(%rbp), %r14
movq -0x40(%rbp), %rax
movq (%rax,%r13,8), %rsi
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x80ce
testl %eax, %eax
jne 0xeab0
movl -0x2c(%rbp), %r12d
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0xe803
testq %rax, %rax
je 0xea97
movq %rax, %r15
cmpl $0x2, 0x10(%rax)
jl 0xe994
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8fc2
movq %rax, %r15
movq %rbx, %rdi
movq %r14, %rsi
movl %r12d, %edx
movq %rax, %rcx
xorl %r8d, %r8d
callq 0xead8
movq (%r14), %rdi
testq %rdi, %rdi
sete %al
leaq 0x288f4(%rip), %rcx     # 0x37298
cmpq %rcx, %rdi
sete %cl
orb %al, %cl
jne 0xe9b6
xorl %esi, %esi
callq *0x288d2(%rip)          # 0x37288
movq $0x0, (%r14)
incq %r13
movq %r15, %r14
cmpq %r13, -0x60(%rbp)
jne 0xe932
movslq -0x30(%rbp), %rax
movq -0x40(%rbp), %rcx
movq (%rcx,%rax,8), %rsi
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x80ce
testl %eax, %eax
jne 0xeab0
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
movq %r15, %rsi
movq -0x58(%rbp), %rcx
movl $0x1, %r8d
callq 0xead8
testl %eax, %eax
jne 0xeab0
movq (%r15), %rdi
testq %rdi, %rdi
sete %al
leaq 0x2887b(%rip), %r14     # 0x37298
cmpq %r14, %rdi
sete %cl
orb %al, %cl
jne 0xea2f
xorl %esi, %esi
callq *0x28859(%rip)          # 0x37288
movq $0x0, (%r15)
movq -0x38(%rbp), %r15
movq (%r15), %rdi
testq %rdi, %rdi
sete %al
cmpq %r14, %rdi
sete %cl
orb %al, %cl
jne 0xea55
xorl %esi, %esi
callq *0x28833(%rip)          # 0x37288
movq $0x0, (%r15)
movq %rbx, %rdi
movq -0x50(%rbp), %rsi
movq %r15, %rdx
callq 0x876e
testl %eax, %eax
jne 0xeab0
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 0xea90
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
xorl %ecx, %ecx
jmp 0xeac7
movq -0x40(%rbp), %rax
movq (%rax,%r13,8), %rdx
leaq 0x1c496(%rip), %rsi     # 0x2af3c
movq %rbx, %rdi
xorl %eax, %eax
callq 0x6923
cmpl $0x2, -0x44(%rbp)
jl 0xeac2
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x758c
movl $0x1, %ecx
movl %ecx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq