// File: /workspace/github_c_makefile_star2_O1/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 0x1dd52
leaq 0xfa77(%rip), %rcx      # 0x2d7ae
movl $0x1, %r12d
movq %rbx, %rdi
movl $0x1, %esi
movq %r14, %rdx
callq 0x7454
jmp 0x1de9a
movl %esi, %r15d
movq 0x10(%r14), %rsi
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
callq 0x80b2
movl $0x1, %r12d
testl %eax, %eax
jne 0x1de9a
movq 0x18(%r14), %rsi
leaq -0x30(%rbp), %rdx
movq %rbx, %rdi
callq 0x80b2
testl %eax, %eax
jne 0x1de9a
movq 0x8(%r14), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0xe338
movl 0x20(%r12), %edi
movl -0x2c(%rbp), %eax
xorl %r8d, %r8d
movl $0x80000002, %ecx       # imm = 0x80000002
cmpl %ecx, %eax
movl $0x0, %edx
cmovael %edi, %edx
addl %eax, %edx
movl %edx, -0x2c(%rbp)
movl -0x30(%rbp), %esi
cmpl %ecx, %esi
movl $0x0, %eax
cmovael %edi, %eax
addl %esi, %eax
movl %eax, -0x30(%rbp)
movl %eax, %ecx
movl $0x0, %esi
subl %edx, %ecx
jl 0x1ddfa
incl %ecx
je 0x1ddfa
testl %edx, %edx
jns 0x1dde8
leal 0x1(%rax), %ecx
movl $0x0, -0x2c(%rbp)
cmpl %edi, %eax
jge 0x1ddf0
movl %ecx, %esi
jmp 0x1ddfa
leal -0x1(%rdi), %esi
movl %esi, -0x30(%rbp)
subl %eax, %esi
addl %ecx, %esi
testl %esi, %esi
cmovgl %esi, %r8d
movq %r8, -0x38(%rbp)
movl -0x2c(%rbp), %r13d
cmpl %edi, %r13d
cmovgel %edi, %r13d
movl %r13d, -0x2c(%rbp)
movq 0x18(%r12), %rsi
movq %rdi, -0x40(%rbp)
movq %rbx, %rdi
movl %r13d, %edx
callq 0x7640
movq %r12, -0x48(%rbp)
movq %rax, %r12
addl $-0x4, %r15d
addq $0x20, %r14
movq %rax, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl %r15d, %edx
movq %r14, %rcx
callq 0xe29d
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %rdx
subl %ecx, %edx
subl %r13d, %edx
movslq %r13d, %rax
shlq $0x3, %rax
movq -0x48(%rbp), %rsi
addq 0x18(%rsi), %rax
leaq (%rax,%rcx,8), %rcx
movq %r12, %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xe29d
incl 0x10(%r12)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1de94
movq %rbx, %rdi
callq 0x759a
movq %r12, (%rbx)
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq