// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rsi, %r15
movq %rdi, %rbx
movl $0x5, %edx
callq 0x98ef
movl $0x1, %ecx
testq %rax, %rax
je 0xeb29
movl 0x10(%rax), %ecx
movl %ecx, -0x3c(%rbp)
cmpl $0x2, %ecx
movq %r15, -0x48(%rbp)
movq %r12, -0x50(%rbp)
jl 0xe97b
movq %rbx, %rdi
movq %rax, %rsi
callq 0x8fa8
leal -0x1(%r14), %ecx
movl %ecx, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movq %rax, %r15
cmpl $0x2, %r14d
jl 0xea35
movl -0x30(%rbp), %eax
movq %rax, -0x58(%rbp)
xorl %r12d, %r12d
movq -0x38(%rbp), %r14
movq (%r13,%r12,8), %rsi
movq %rbx, %rdi
leaq -0x2c(%rbp), %rdx
callq 0x80b2
testl %eax, %eax
jne 0xeb12
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xe871
testq %rax, %rax
je 0xeafc
movq %rax, %r15
cmpl $0x2, 0x10(%rax)
jl 0xe9fc
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8fa8
movq %rax, %r15
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rcx
xorl %r8d, %r8d
callq 0xeb3a
movq (%r14), %rdi
testq %rdi, %rdi
sete %al
leaq 0x2988c(%rip), %rcx     # 0x38298
cmpq %rcx, %rdi
sete %cl
orb %al, %cl
jne 0xea1e
xorl %esi, %esi
callq *0x2986a(%rip)          # 0x38288
movq $0x0, (%r14)
incq %r12
movq %r15, %r14
cmpq %r12, -0x58(%rbp)
jne 0xe9a1
movslq -0x30(%rbp), %rax
movq (%r13,%rax,8), %rsi
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x80b2
testl %eax, %eax
jne 0xeb12
movl -0x2c(%rbp), %edx
movq %rbx, %rdi
movq %r15, %rsi
movq -0x50(%rbp), %rcx
movl $0x1, %r8d
callq 0xeb3a
testl %eax, %eax
jne 0xeb12
movq (%r15), %rdi
testq %rdi, %rdi
sete %al
leaq 0x29816(%rip), %r14     # 0x38298
cmpq %r14, %rdi
sete %cl
orb %al, %cl
jne 0xea94
xorl %esi, %esi
callq *0x297f4(%rip)          # 0x38288
movq $0x0, (%r15)
movq -0x38(%rbp), %r15
movq (%r15), %rdi
testq %rdi, %rdi
sete %al
cmpq %r14, %rdi
sete %cl
orb %al, %cl
jne 0xeaba
xorl %esi, %esi
callq *0x297ce(%rip)          # 0x38288
movq $0x0, (%r15)
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
movq %r15, %rdx
callq 0x871b
testl %eax, %eax
jne 0xeb12
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 0xeaf5
movq %rbx, %rdi
callq 0x759a
movq %r14, (%rbx)
xorl %ecx, %ecx
jmp 0xeb29
movq (%r13,%r12,8), %rdx
leaq 0x1d48c(%rip), %rsi     # 0x2bf94
movq %rbx, %rdi
xorl %eax, %eax
callq 0x692d
cmpl $0x2, -0x3c(%rbp)
jl 0xeb24
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
callq 0x759a
movl $0x1, %ecx
movl %ecx, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq