// File: /workspace/github_c_makefile_star2_O3/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_LsortCoreCommand
static int Jim_LsortCoreCommand(Jim_Interp *interp, int argc, Jim_Obj *const argv[])
{
    static const char * const options[] = {
        "-ascii", "-nocase", "-increasing", "-decreasing", "-command", "-integer", "-real", "-index", "-unique",
        "-stride", "-dictionary", NULL
    };
    enum {
        OPT_ASCII, OPT_NOCASE, OPT_INCREASING, OPT_DECREASING, OPT_COMMAND, OPT_INTEGER, OPT_REAL, OPT_INDEX, OPT_UNIQUE,
        OPT_STRIDE, OPT_DICT
    };
    Jim_Obj *resObj;
    int i;
    int retCode;
    int shared;
    long stride = 1;
    Jim_Obj **elements;
    int listlen;

    struct lsort_info info;

    if (argc < 2) {
wrongargs:
        Jim_WrongNumArgs(interp, 1, argv, "?options? list");
        return JIM_ERR;
    }

    info.type = JIM_LSORT_ASCII;
    info.order = 1;
    info.indexc = 0;
    info.unique = 0;
    info.command = NULL;
    info.interp = interp;

    for (i = 1; i < (argc - 1); i++) {
        int option;

        if (Jim_GetEnum(interp, argv[i], options, &option, NULL, JIM_ENUM_ABBREV | JIM_ERRMSG)
            != JIM_OK)
            return JIM_ERR;
        switch (option) {
            case OPT_ASCII:
                info.type = JIM_LSORT_ASCII;
                break;
            case OPT_DICT:
                info.type = JIM_LSORT_DICT;
                break;
            case OPT_NOCASE:
                info.type = JIM_LSORT_NOCASE;
                break;
            case OPT_INTEGER:
                info.type = JIM_LSORT_INTEGER;
                break;
            case OPT_REAL:
                info.type = JIM_LSORT_REAL;
                break;
            case OPT_INCREASING:
                info.order = 1;
                break;
            case OPT_DECREASING:
                info.order = -1;
                break;
            case OPT_UNIQUE:
                info.unique = 1;
                break;
            case OPT_COMMAND:
                if (i >= (argc - 2)) {
                    Jim_SetResultString(interp, "\"-command\" option must be followed by comparison command", -1);
                    return JIM_ERR;
                }
                info.type = JIM_LSORT_COMMAND;
                info.command = argv[i + 1];
                i++;
                break;
            case OPT_STRIDE:
                if (i >= argc - 2) {
                    goto wrongargs;
                }
                if (Jim_GetLong(interp, argv[++i], &stride) != JIM_OK) {
                    return JIM_ERR;
                }
                if (stride < 2) {
                    Jim_SetResultString(interp, "stride length must be at least 2", -1);
                    return JIM_ERR;
                }
                break;
            case OPT_INDEX:
                if (i >= (argc - 2)) {
badindex:
                    Jim_SetResultString(interp, "\"-index\" option must be followed by list index", -1);
                    return JIM_ERR;
                }
                JimListGetElements(interp, argv[i + 1], &info.indexc, &info.indexv);
                if (info.indexc == 0) {
                    goto badindex;
                }
                i++;
                break;
        }
    }
    resObj = argv[argc - 1];
    JimListGetElements(interp, resObj, &listlen, &elements);
    if (listlen <= 1) {

        Jim_SetResult(interp, resObj);
        return JIM_OK;
    }

    if (stride > 1) {
        Jim_Obj *tmpListObj;
        int i;

        if (listlen % stride) {
            Jim_SetResultString(interp, "list size must be a multiple of the stride length", -1);
            return JIM_ERR;
        }

        tmpListObj = Jim_NewListObj(interp, NULL, 0);
        Jim_IncrRefCount(tmpListObj);
        for (i = 0; i < listlen; i += stride) {
            Jim_ListAppendElement(interp, tmpListObj, Jim_NewListObj(interp, elements + i, stride));
        }
        retCode = ListSortElements(interp, tmpListObj, &info);
        if (retCode == JIM_OK) {
            resObj = Jim_NewListObj(interp, NULL, 0);

            for (i = 0; i < listlen; i += stride) {
                Jim_ListAppendList(interp, resObj, Jim_ListGetIndex(interp, tmpListObj, i / stride));
            }
            Jim_SetResult(interp, resObj);
        }
        Jim_DecrRefCount(interp, tmpListObj);
    }
    else {
        if ((shared = Jim_IsShared(resObj))) {
            resObj = Jim_DuplicateObj(interp, resObj);
        }
        retCode = ListSortElements(interp, resObj, &info);
        if (retCode == JIM_OK) {
            Jim_SetResult(interp, resObj);
        }
        else if (shared) {
            Jim_FreeNewObj(interp, resObj);
        }
    }
    return retCode;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdx, %r15
cmpl $0x1, %esi
jg 0x1d75d
leaq 0xf06b(%rip), %rcx      # 0x2c7b0
movl $0x1, %r12d
movl $0x1, %esi
movq %r15, %rdx
callq 0x7446
jmp 0x1d970
movl %esi, %r12d
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, -0x70(%rbp)
xorl %eax, %eax
movq %rax, -0x60(%rbp)
movq %rax, -0x80(%rbp)
movq %rdi, -0x30(%rbp)
movq %rdi, -0x78(%rbp)
leal -0x1(%r12), %eax
movl %eax, -0x38(%rbp)
movl $0x1, %r14d
cmpl $0x2, %esi
je 0x1d8d5
addl $-0x2, %r12d
movl $0x1, %ebx
movslq %ebx, %r13
movq (%r15,%r13,8), %rsi
movq -0x30(%rbp), %rdi
leaq 0x18b1e(%rip), %rdx     # 0x362d0
leaq -0x3c(%rbp), %rcx
xorl %r8d, %r8d
movl $0x3, %r9d
callq 0x7eac
testl %eax, %eax
jne 0x1d96a
movl -0x3c(%rbp), %eax
cmpq $0xa, %rax
ja 0x1d8ca
leaq 0x9cac(%rip), %rcx      # 0x2748c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x70(%rbp)
jmp 0x1d8ca
cmpl %r12d, %ebx
jge 0x1db28
movl $0x4, -0x70(%rbp)
incl %ebx
movq 0x8(%r15,%r13,8), %rax
movq %rax, -0x80(%rbp)
jmp 0x1d8ca
cmpl %r12d, %ebx
jge 0x1db1f
movq 0x8(%r15,%r13,8), %r14
leaq 0x17ac6(%rip), %rax     # 0x352f0
cmpq %rax, 0x8(%r14)
je 0x1d849
movq -0x30(%rbp), %rdi
movq %r14, %rsi
movl $0x1, %edx
callq 0xd6c3
testl %eax, %eax
jne 0x1d96a
movq 0x18(%r14), %r14
cmpq $0x1, %r14
jg 0x1d89b
jmp 0x1db31
movl $0x1, -0x6c(%rbp)
jmp 0x1d8ca
movl $0xffffffff, -0x6c(%rbp) # imm = 0xFFFFFFFF
jmp 0x1d8ca
cmpl %r12d, %ebx
jge 0x1db16
movq 0x8(%r15,%r13,8), %r13
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0xe2fe
movl 0x20(%r13), %eax
movl %eax, -0x60(%rbp)
movq 0x18(%r13), %rcx
movq %rcx, -0x68(%rbp)
testl %eax, %eax
je 0x1db16
incl %ebx
jmp 0x1d8ca
movl $0x1, -0x70(%rbp)
jmp 0x1d8ca
movl $0x2, -0x70(%rbp)
jmp 0x1d8ca
movl $0x3, -0x70(%rbp)
jmp 0x1d8ca
movl $0x5, -0x70(%rbp)
jmp 0x1d8ca
movl $0x1, -0x5c(%rbp)
incl %ebx
cmpl -0x38(%rbp), %ebx
jl 0x1d7a0
movl -0x38(%rbp), %eax
movq (%r15,%rax,8), %r15
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xe2fe
movslq 0x20(%r15), %rcx
cmpq $0x1, %rcx
jg 0x1d91a
incl 0x10(%r15)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1d912
movq %rbx, %rdi
callq 0x758c
movq %r15, (%rbx)
xorl %r12d, %r12d
jmp 0x1d970
cmpq $0x2, %r14
jl 0x1d985
xorl %r12d, %r12d
movq %rcx, %rax
xorl %edx, %edx
divq %r14
testq %rdx, %rdx
je 0x1d9e0
leaq 0xedb0(%rip), %rsi      # 0x2c6eb
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1d967
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
movl $0x1, %r12d
movl %r12d, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x2, 0x10(%r15)
jl 0x1d9c2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8fc2
movq %rax, %r15
leaq -0x148(%rbp), %rdx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x226f2
testl %eax, %eax
je 0x1d8f5
movl %eax, %r12d
movq %rbx, %rdi
movq %r15, %rsi
jmp 0x1db0c
leaq -0x148(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x226f2
movl %eax, %r12d
testl %eax, %eax
jne 0x1d970
jmp 0x1d8f5
movq 0x18(%r15), %rax
movq %rax, -0x38(%rbp)
movq %rbx, %rdi
movq %rcx, %r15
callq 0xae38
movq %rax, %r13
leaq 0x1796b(%rip), %rax     # 0x35368
movq %rax, 0x8(%r13)
movq $0x0, (%r13)
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%r13)
incl 0x10(%r13)
movslq %r12d, %r12
movq -0x38(%rbp), %rax
leaq (%rax,%r12,8), %rsi
movq %rbx, %rdi
movl %r14d, %edx
callq 0x762e
movq %rbx, %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x7683
addl %r14d, %r12d
cmpl %r15d, %r12d
jl 0x1da15
movq %r15, -0x50(%rbp)
leaq -0x148(%rbp), %rdx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x226f2
movl %eax, %r12d
testl %eax, %eax
jne 0x1daf1
movq %r13, -0x48(%rbp)
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0xae38
movq %rax, %rcx
leaq 0x178ec(%rip), %rax     # 0x35368
movq %rax, 0x8(%rcx)
movq $0x0, (%rcx)
xorps %xmm0, %xmm0
movq %rcx, -0x38(%rbp)
movups %xmm0, 0x18(%rcx)
xorl %r15d, %r15d
movq -0x50(%rbp), %r13
movslq %r15d, %r15
movq %r15, %rax
cqto
idivq %r14
movq %rbx, %rdi
movq -0x48(%rbp), %rsi
movl %eax, %edx
callq 0xe803
movq %rbx, %rdi
movq -0x38(%rbp), %rsi
movq %rax, %rdx
callq 0xe719
addl %r14d, %r15d
cmpl %r13d, %r15d
jl 0x1da99
movq -0x48(%rbp), %r13
movq -0x38(%rbp), %r14
incl 0x10(%r14)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1daee
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
movl 0x10(%r13), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%r13)
cmpl $0x1, %eax
jg 0x1d970
movq -0x30(%rbp), %rdi
movq %r13, %rsi
callq 0x758c
jmp 0x1d970
leaq 0xecfc(%rip), %rsi      # 0x2c819
jmp 0x1db38
movq -0x30(%rbp), %rdi
jmp 0x1d73e
leaq 0xec90(%rip), %rsi      # 0x2c7bf
jmp 0x1db38
leaq 0xecc0(%rip), %rsi      # 0x2c7f8
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x2, %eax
jl 0x1d95f
jmp 0x1d967