// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x2844e
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x1, %esi
leaq 0x146d5(%rip), %rcx     # 0x3cb12
callq 0x7880
movl $0x1, -0x4(%rbp)
jmp 0x2859d
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x24(%rbp), %rdx
callq 0x87a0
cmpl $0x0, %eax
jne 0x28482
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x28(%rbp), %rdx
callq 0x87a0
cmpl $0x0, %eax
je 0x2848e
movl $0x1, -0x4(%rbp)
jmp 0x2859d
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x9b50
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %edi
movl -0x24(%rbp), %esi
callq 0x10ae0
movl %eax, -0x24(%rbp)
movl -0x2c(%rbp), %edi
movl -0x28(%rbp), %esi
callq 0x10ae0
movl %eax, -0x28(%rbp)
movl -0x2c(%rbp), %edi
leaq -0x24(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x10b10
movl -0x24(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jle 0x284e8
movl -0x2c(%rbp), %eax
movl %eax, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rsi
movl -0x24(%rbp), %edx
callq 0x7b50
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
movl -0x14(%rbp), %edx
subl $0x4, %edx
movq -0x20(%rbp), %rcx
addq $0x20, %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xfd70
movq -0x40(%rbp), %rdi
movl -0x2c(%rbp), %edx
subl -0x24(%rbp), %edx
subl -0x30(%rbp), %edx
movq -0x38(%rbp), %rax
movq 0x18(%rax), %rcx
movslq -0x24(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rcx
movslq -0x30(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rcx
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xfd70
movq -0x40(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x2858b
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x48(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)