// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_RenameCommand
int Jim_RenameCommand(Jim_Interp *interp, Jim_Obj *oldNameObj, Jim_Obj *newNameObj)
{
    int ret = JIM_ERR;
    Jim_HashEntry *he;
    Jim_Cmd *cmdPtr;

    if (Jim_Length(newNameObj) == 0) {
        return Jim_DeleteCommand(interp, oldNameObj);
    }



    oldNameObj = JimQualifyName(interp, oldNameObj);
    newNameObj = JimQualifyName(interp, newNameObj);


    he = Jim_FindHashEntry(&interp->commands, oldNameObj);
    if (he == NULL) {
        Jim_SetResultFormatted(interp, "can't rename \"%#s\": command doesn't exist", oldNameObj);
    }
    else if (Jim_FindHashEntry(&interp->commands, newNameObj)) {
        Jim_SetResultFormatted(interp, "can't rename to \"%#s\": command already exists", newNameObj);
    }
    else {
        cmdPtr = Jim_GetHashEntryVal(he);
        if (cmdPtr->prevCmd) {
            Jim_SetResultFormatted(interp, "can't rename local command \"%#s\"", oldNameObj);
        }
        else {

            JimIncrCmdRefCount(cmdPtr);
            JimUpdateProcNamespace(interp, cmdPtr, newNameObj);
            Jim_AddHashEntry(&interp->commands, newNameObj, cmdPtr);


            Jim_DeleteHashEntry(&interp->commands, oldNameObj);


            Jim_InterpIncrProcEpoch(interp);

            ret = JIM_OK;
        }
    }

    Jim_DecrRefCount(interp, oldNameObj);
    Jim_DecrRefCount(interp, newNameObj);

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x1, -0x24(%rbp)
movq -0x20(%rbp), %rdi
callq 0xc700
cmpl $0x0, %eax
jne 0xd82e
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xd740
movl %eax, -0x4(%rbp)
jmp 0xd980
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xd7d0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xd7d0
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
movq -0x18(%rbp), %rsi
callq 0xc250
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xd887
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x2d508(%rip), %rsi     # 0x3ad83
movb $0x0, %al
callq 0x6b40
jmp 0xd93c
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
movq -0x20(%rbp), %rsi
callq 0xc250
cmpq $0x0, %rax
je 0xd8b9
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x2d500(%rip), %rsi     # 0x3adad
movb $0x0, %al
callq 0x6b40
jmp 0xd93a
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xd8e8
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rdx
leaq 0x2d4fc(%rip), %rsi     # 0x3addb
movb $0x0, %al
callq 0x6b40
jmp 0xd938
movq -0x38(%rbp), %rdi
callq 0xd990
movq -0x10(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0xd9b0
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
movq -0x20(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0xbbb0
movq -0x10(%rbp), %rdi
addq $0x68, %rdi
movq -0x18(%rbp), %rsi
callq 0xbf80
movq -0x10(%rbp), %rdi
callq 0xd520
movl $0x0, -0x24(%rbp)
jmp 0xd93a
jmp 0xd93c
movq -0x18(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0xd95b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x7a10
movq -0x20(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0xd97a
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x7a10
movl -0x24(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)