// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: ListSortElements
static int ListSortElements(Jim_Interp *interp, Jim_Obj *listObjPtr, struct lsort_info *info)
{
    struct lsort_info *prev_info;

    typedef int (qsort_comparator) (const void *, const void *);
    int (*fn) (Jim_Obj **, Jim_Obj **);
    Jim_Obj **vector;
    int len;
    int rc;

    JimPanic((Jim_IsShared(listObjPtr), "ListSortElements called with shared object"));
    SetListFromAny(interp, listObjPtr);


    prev_info = sort_info;
    sort_info = info;

    vector = listObjPtr->internalRep.listValue.ele;
    len = listObjPtr->internalRep.listValue.len;
    switch (info->type) {
        case JIM_LSORT_ASCII:
            fn = ListSortString;
            break;
        case JIM_LSORT_NOCASE:
            fn = ListSortStringNoCase;
            break;
        case JIM_LSORT_INTEGER:
            fn = ListSortInteger;
            break;
        case JIM_LSORT_REAL:
            fn = ListSortReal;
            break;
        case JIM_LSORT_COMMAND:
            fn = ListSortCommand;
            break;
        case JIM_LSORT_DICT:
            fn = ListSortDict;
            break;
        default:
            fn = NULL;
            JimPanic((1, "ListSort called with invalid sort type"));
            return -1;
    }

    if (info->indexc) {

        info->subfn = fn;
        fn = ListSortIndexHelper;
    }

    if ((rc = setjmp(info->jmpbuf)) == 0) {
        qsort(vector, len, sizeof(Jim_Obj *), (qsort_comparator *) fn);

        if (info->unique && len > 1) {
            ListRemoveDuplicates(listObjPtr, fn);
        }

        Jim_InvalidateStringRep(listObjPtr);
    }
    sort_info = prev_info;

    return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xfe70
movq 0x18e28(%rip), %rax     # 0x483e0
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
movq %rax, 0x18e19(%rip)     # 0x483e0
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rax
movl 0x20(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x20(%rbp), %rax
movl 0xd8(%rax), %eax
movq %rax, -0x48(%rbp)
subq $0x5, %rax
ja 0x2f653
movq -0x48(%rbp), %rax
leaq 0x7db8(%rip), %rcx      # 0x373b4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xf4(%rip), %rax        # 0x2f700
movq %rax, -0x30(%rbp)
jmp 0x2f667
leaq 0x137(%rip), %rax       # 0x2f750
movq %rax, -0x30(%rbp)
jmp 0x2f667
leaq 0x17a(%rip), %rax       # 0x2f7a0
movq %rax, -0x30(%rbp)
jmp 0x2f667
leaq 0x20d(%rip), %rax       # 0x2f840
movq %rax, -0x30(%rbp)
jmp 0x2f667
leaq 0x2d0(%rip), %rax       # 0x2f910
movq %rax, -0x30(%rbp)
jmp 0x2f667
leaq 0x3c3(%rip), %rax       # 0x2fa10
movq %rax, -0x30(%rbp)
jmp 0x2f667
movq $0x0, -0x30(%rbp)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2f6ef
movq -0x20(%rbp), %rax
cmpl $0x0, 0xe8(%rax)
je 0x2f68e
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0xf0(%rax)
leaq 0x576(%rip), %rax       # 0x2fc00
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x62f0
movl %eax, -0x40(%rbp)
cmpl $0x0, %eax
jne 0x2f6de
movq -0x38(%rbp), %rdi
movslq -0x3c(%rbp), %rsi
movq -0x30(%rbp), %rcx
movl $0x8, %edx
callq 0x6110
movq -0x20(%rbp), %rax
cmpl $0x0, 0xec(%rax)
je 0x2f6d5
cmpl $0x1, -0x3c(%rbp)
jle 0x2f6d5
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x2fcd0
movq -0x18(%rbp), %rdi
callq 0xa9b0
movq -0x28(%rbp), %rax
movq %rax, 0x18cf7(%rip)     # 0x483e0
movl -0x40(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)