// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_LreplaceCoreCommand
static int Jim_LreplaceCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    int first, last, len, rangeLen;
    Jim_Obj *listObj;
    Jim_Obj *newListObj;

    if (argc < 4) {
        Jim_WrongNumArgs(interp, 1, argv, "list first last ?element ...?");
        return JIM_ERR;
    }
    if (Jim_GetIndex(interp, argv[2], &first) != JIM_OK ||
        Jim_GetIndex(interp, argv[3], &last) != JIM_OK) {
        return JIM_ERR;
    }

    listObj = argv[1];
    len = Jim_ListLength(interp, listObj);

    first = JimRelToAbsIndex(len, first);
    last = JimRelToAbsIndex(len, last);
    JimRelToAbsRange(len, &first, &last, &rangeLen);


    if (first > len) {
        first = len;
    }


    newListObj = Jim_NewListObj(interp, listObj->internalRep.listValue.ele, first);


    ListInsertElements(newListObj, -1, argc - 4, argv + 4);


    ListInsertElements(newListObj, -1, len - first - rangeLen, listObj->internalRep.listValue.ele + first + rangeLen);

    Jim_SetResult(interp, newListObj);
    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, %rbx
cmpl $0x3, %esi
jg 0x1d5d5
leaq 0xf196(%rip), %rcx      # 0x2c750
movl $0x1, %r12d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x7446
jmp 0x1d6ec
movl %esi, %r15d
movq 0x10(%r14), %rsi
leaq -0x34(%rbp), %rdx
movq %rbx, %rdi
callq 0x80ce
movl $0x1, %r12d
testl %eax, %eax
jne 0x1d6ec
movq 0x18(%r14), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0x80ce
testl %eax, %eax
jne 0x1d6ec
movq 0x8(%r14), %r13
movq %rbx, %rdi
movq %r13, %rsi
callq 0xe2fe
movl 0x20(%r13), %esi
movl -0x34(%rbp), %eax
xorl %edi, %edi
movl $0x80000002, %ecx       # imm = 0x80000002
cmpl %ecx, %eax
movl $0x0, %edx
cmovael %esi, %edx
addl %eax, %edx
movl -0x30(%rbp), %eax
cmpl %ecx, %eax
movl $0x0, %ecx
cmovael %esi, %ecx
addl %eax, %ecx
movl %ecx, %eax
subl %edx, %eax
jl 0x1d654
incl %eax
jne 0x1d6fe
movl %edx, %r12d
xorl %eax, %eax
testl %eax, %eax
cmovgl %eax, %edi
movq %rdi, -0x40(%rbp)
cmpl %esi, %r12d
cmovgel %esi, %r12d
movl %esi, -0x2c(%rbp)
movq 0x18(%r13), %rsi
movq %rbx, %rdi
movl %r12d, %edx
callq 0x762e
movq %r13, -0x48(%rbp)
movq %rax, %r13
addl $-0x4, %r15d
addq $0x20, %r14
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %r15d, %edx
movq %r14, %rcx
callq 0xe263
movq -0x40(%rbp), %rcx
movl -0x2c(%rbp), %edx
subl %ecx, %edx
subl %r12d, %edx
movslq %r12d, %rax
shlq $0x3, %rax
movq -0x48(%rbp), %rsi
addq 0x18(%rsi), %rax
leaq (%rax,%rcx,8), %rcx
movq %r13, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe263
incl 0x10(%r13)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1d6e6
movq %rbx, %rdi
callq 0x758c
movq %r13, (%rbx)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r12d, %r12d
testl %edx, %edx
cmovgl %edx, %r12d
leal 0x1(%rcx), %edx
cmovsl %edx, %eax
cmpl %esi, %ecx
jl 0x1d659
notl %ecx
addl %esi, %ecx
addl %eax, %ecx
movl %ecx, %eax
jmp 0x1d659