// File: /workspace/github_c_makefile_star2_O0/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
subq $0x1c0, %rsp            # imm = 0x1C0
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq $0x1, -0x40(%rbp)
cmpl $0x2, -0x14(%rbp)
jge 0x285fb
jmp 0x285d6
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x1, %esi
leaq 0x14588(%rip), %rcx     # 0x3cb72
callq 0x7880
movl $0x1, -0x4(%rbp)
jmp 0x28cda
movl $0x0, -0x70(%rbp)
movl $0x1, -0x6c(%rbp)
movl $0x0, -0x60(%rbp)
movl $0x0, -0x5c(%rbp)
movq $0x0, -0x80(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x1, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x28943
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x1ecfa(%rip), %rdx     # 0x47350
leaq -0x14c(%rbp), %rcx
xorl %eax, %eax
movl %eax, %r8d
movl $0x3, %r9d
callq 0x8590
cmpl $0x0, %eax
je 0x2867e
movl $0x1, -0x4(%rbp)
jmp 0x28cda
movl -0x14c(%rbp), %eax
movq %rax, -0x1a0(%rbp)
subq $0xa, %rax
ja 0x28933
movq -0x1a0(%rbp), %rax
leaq 0xebe1(%rip), %rcx      # 0x37284
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x0, -0x70(%rbp)
jmp 0x28933
movl $0x5, -0x70(%rbp)
jmp 0x28933
movl $0x1, -0x70(%rbp)
jmp 0x28933
movl $0x2, -0x70(%rbp)
jmp 0x28933
movl $0x3, -0x70(%rbp)
jmp 0x28933
movl $0x1, -0x6c(%rbp)
jmp 0x28933
movl $0xffffffff, -0x6c(%rbp) # imm = 0xFFFFFFFF
jmp 0x28933
movl $0x1, -0x5c(%rbp)
jmp 0x28933
movl -0x2c(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jl 0x28786
jmp 0x2871b
movq -0x10(%rbp), %rdi
leaq 0x1445b(%rip), %rsi     # 0x3cb81
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x158(%rbp)
movq -0x158(%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 0x2876c
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x158(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x28cda
movl $0x4, -0x70(%rbp)
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x80(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28933
movl -0x2c(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jl 0x287c2
jmp 0x285d6
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x2c(%rbp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x40(%rbp), %rdx
callq 0xf4d0
cmpl $0x0, %eax
je 0x287f4
movl $0x1, -0x4(%rbp)
jmp 0x28cda
cmpq $0x2, -0x40(%rbp)
jge 0x28868
jmp 0x287fd
movq -0x10(%rbp), %rdi
leaq 0x143b2(%rip), %rsi     # 0x3cbba
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x160(%rbp)
movq -0x160(%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 0x2884e
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x160(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x28cda
jmp 0x28933
movl -0x2c(%rbp), %eax
movl -0x14(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jl 0x288e9
jmp 0x2887c
jmp 0x2887e
movq -0x10(%rbp), %rdi
leaq 0x14352(%rip), %rsi     # 0x3cbdb
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x168(%rbp)
movq -0x168(%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 0x288cf
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x168(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x28cda
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x148(%rbp), %rdx
addq $0xe8, %rdx
leaq -0x148(%rbp), %rcx
addq $0xe0, %rcx
callq 0x115c0
cmpl $0x0, -0x60(%rbp)
jne 0x2892a
jmp 0x2887c
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x28935
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x2862e
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x4c(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0x115c0
cmpl $0x1, -0x4c(%rbp)
jg 0x289cf
jmp 0x28975
movq -0x28(%rbp), %rax
movq %rax, -0x170(%rbp)
movq -0x170(%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 0x289b5
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x170(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x28cda
cmpq $0x1, -0x40(%rbp)
jle 0x28c21
movslq -0x4c(%rbp), %rax
cqto
idivq -0x40(%rbp)
cmpq $0x0, %rdx
je 0x28a57
jmp 0x289ec
movq -0x10(%rbp), %rdi
leaq 0x140b6(%rip), %rsi     # 0x3caad
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x188(%rbp)
movq -0x188(%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 0x28a3d
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x188(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x28cda
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x7b50
movq %rax, -0x178(%rbp)
movq -0x178(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movl $0x0, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x28af8
movq -0x10(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x1a8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movslq -0x17c(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
movq -0x40(%rbp), %rax
movl %eax, %edx
callq 0x7b50
movq -0x1b0(%rbp), %rdi
movq -0x1a8(%rbp), %rsi
movq %rax, %rdx
callq 0x7bd0
movq -0x40(%rbp), %rcx
movslq -0x17c(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x17c(%rbp)
jmp 0x28a87
movq -0x10(%rbp), %rdi
movq -0x178(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0x2f590
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x28bf7
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x7b50
movq %rax, -0x28(%rbp)
movl $0x0, -0x17c(%rbp)
movl -0x17c(%rbp), %eax
cmpl -0x4c(%rbp), %eax
jge 0x28ba5
movq -0x10(%rbp), %rax
movq %rax, -0x1c0(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x10(%rbp), %rdi
movq -0x178(%rbp), %rsi
movslq -0x17c(%rbp), %rax
cqto
idivq -0x40(%rbp)
movl %eax, %edx
callq 0x101d0
movq -0x1c0(%rbp), %rdi
movq -0x1b8(%rbp), %rsi
movq %rax, %rdx
callq 0x100c0
movq -0x40(%rbp), %rcx
movslq -0x17c(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x17c(%rbp)
jmp 0x28b39
jmp 0x28ba7
movq -0x28(%rbp), %rax
movq %rax, -0x190(%rbp)
movq -0x190(%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 0x28be7
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x190(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x28bf7
movq -0x178(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x28c1c
movq -0x10(%rbp), %rdi
movq -0x178(%rbp), %rsi
callq 0x7a10
jmp 0x28cd4
movq -0x28(%rbp), %rax
cmpl $0x1, 0x10(%rax)
setg %al
movb %al, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movl %ecx, -0x34(%rbp)
testb $0x1, %al
jne 0x28c3d
jmp 0x28c4e
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x9a00
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
leaq -0x148(%rbp), %rdx
callq 0x2f590
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
jne 0x28cbd
jmp 0x28c6d
movq -0x28(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x198(%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 0x28cad
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x198(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x28cd2
cmpl $0x0, -0x34(%rbp)
je 0x28cd0
movq -0x10(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x7a10
jmp 0x28cd2
jmp 0x28cd4
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1c0, %rsp            # imm = 0x1C0
popq %rbp
retq
nopw %cs:(%rax,%rax)