// File: /workspace/github_c_makefile_star2_O0/heltilda[P]cicada/userfn.c
// Function: callSort
ccInt callSort(ccInt argc, char **argv)
{
    ccInt numIndices, cl, ci, idx, *linkList, numLists, firstIndex, rtrn = passed;
    arg_info *argInfo = (arg_info *) argv[argc];
    
    getArgs(argc, argv, &linkList, byValue(&firstIndex), endArgs);
    numIndices = argInfo[0].argIndices;
    numLists = (argc-2)/2;
    
    for (cl = 0; cl < numLists; cl++)  {
        if (argInfo[cl+2].argType != argInfo[cl+2+numLists].argType)  rtrn = 1;
        else if (argInfo[cl+2].argIndices != numIndices)  rtrn = 2;
        else if ((argInfo[cl+2].argType != int_type) && (argInfo[cl+2].argType != double_type))  rtrn = 3;
        if (rtrn != passed)  break;         }
    
    if (rtrn != passed)  {
    for (ci = 0; ci < numIndices; ci++)  {
        linkList[ci]++;        // convert to Cicada indexing
    }}
    
    else  {
    for (cl = 0; cl < numLists; cl++)  {
        idx = firstIndex;
        if (argInfo[cl+2].argType == int_type)  {
            ccInt *list = (ccInt *) (argv[cl+2]), *sortedList = (ccInt *) (argv[cl+2+numLists]);
            for (ci = 0; ci < numIndices; ci++)  {
                sortedList[ci] = list[idx];
                idx = linkList[idx];
        }   }
        else if (argInfo[cl+2].argType == double_type)  {
            ccFloat *list = (ccFloat *) (argv[cl+2]), *sortedList = (ccFloat *) (argv[cl+2+numLists]);
            for (ci = 0; ci < numIndices; ci++)  {
                sortedList[ci] = list[idx];
                idx = linkList[idx];
    }}  }   }
    
    return rtrn;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movslq -0x4(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x40(%rbp)
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq -0x28(%rbp), %rdx
xorl %eax, %eax
movl %eax, %r9d
leaq -0x30(%rbp), %r8
movq %r9, %rcx
movq $0x0, (%rsp)
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
movb $0x0, %al
callq 0x20800
movq -0x40(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x14(%rbp)
movl -0x4(%rbp), %eax
subl $0x2, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x2c(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x20688
movq -0x40(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,8), %eax
movq -0x40(%rbp), %rcx
movl -0x18(%rbp), %edx
addl $0x2, %edx
addl -0x2c(%rbp), %edx
movslq %edx, %rdx
cmpl (%rcx,%rdx,8), %eax
je 0x20620
movl $0x1, -0x34(%rbp)
jmp 0x20670
movq -0x40(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movl 0x4(%rax,%rcx,8), %eax
cmpl -0x14(%rbp), %eax
je 0x2063f
movl $0x2, -0x34(%rbp)
jmp 0x2066e
movq -0x40(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,8)
je 0x2066c
movq -0x40(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x3, (%rax,%rcx,8)
je 0x2066c
movl $0x3, -0x34(%rbp)
jmp 0x2066e
jmp 0x20670
cmpl $0x0, -0x34(%rbp)
je 0x20678
jmp 0x20688
jmp 0x2067a
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x205e6
cmpl $0x0, -0x34(%rbp)
je 0x206be
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x206b9
movq -0x28(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
movl %edx, (%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x20695
jmp 0x207f2
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x207f0
movl -0x30(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x40(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x2, (%rax,%rcx,8)
jne 0x2075a
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
addl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x20755
movq -0x48(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x50(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x28(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x2071e
jmp 0x207e0
movq -0x40(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
cmpl $0x3, (%rax,%rcx,8)
jne 0x207de
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
addl $0x2, %ecx
addl -0x2c(%rbp), %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x60(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x207dc
movq -0x58(%rbp), %rax
movslq -0x20(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x60(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x28(%rbp), %rax
movslq -0x20(%rbp), %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x207a1
jmp 0x207de
jmp 0x207e0
jmp 0x207e2
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x206c5
jmp 0x207f2
movl -0x34(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)