// File: /workspace/github_c_makefile_star2_O0/vtereshkov[P]umka-lang/src/umka_vm.c
// Function: qsortFastCompare
static int qsortFastCompare(const void *a, const void *b, void *context)
{
    FastCompareContext *fastCompareContext = (FastCompareContext *)context;

    int sign = fastCompareContext->ascending ? 1 : -1;
    const char *lhs = (const char *)a + fastCompareContext->offset;
    const char *rhs = (const char *)b + fastCompareContext->offset;
    Error *error = fastCompareContext->error;

    switch (fastCompareContext->comparedTypeKind)
    {
        case TYPE_INT8:     {int64_t diff = (int64_t)(*(int8_t        *)lhs) - (int64_t)(*(int8_t        *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_INT16:    {int64_t diff = (int64_t)(*(int16_t       *)lhs) - (int64_t)(*(int16_t       *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_INT32:    {int64_t diff = (int64_t)(*(int32_t       *)lhs) - (int64_t)(*(int32_t       *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_INT:      {int64_t diff =          (*(int64_t       *)lhs) -          (*(int64_t       *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_UINT8:    {int64_t diff = (int64_t)(*(uint8_t       *)lhs) - (int64_t)(*(uint8_t       *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_UINT16:   {int64_t diff = (int64_t)(*(uint16_t      *)lhs) - (int64_t)(*(uint16_t      *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_UINT32:   {int64_t diff = (int64_t)(*(uint32_t      *)lhs) - (int64_t)(*(uint32_t      *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_UINT:     {int64_t diff =          (*(uint64_t      *)lhs) -          (*(uint64_t      *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_BOOL:     {int64_t diff = (int64_t)(*(bool          *)lhs) - (int64_t)(*(bool          *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_CHAR:     {int64_t diff = (int64_t)(*(unsigned char *)lhs) - (int64_t)(*(unsigned char *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_REAL32:   {double  diff = (double )(*(float         *)lhs) - (double )(*(float         *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_REAL:     {double  diff =          (*(double        *)lhs) -          (*(double        *)rhs);    return diff == 0 ? 0 : diff > 0 ? sign : -sign;}
        case TYPE_STR:
        {
            const char *lhsStr = *(const char **)lhs;
            if (!lhsStr)
                lhsStr = doGetEmptyStr();

            const char *rhsStr = *(const char **)rhs;
            if (!rhsStr)
                rhsStr = doGetEmptyStr();

            doCheckStr(lhsStr, error);
            doCheckStr(rhsStr, error);

            return strcmp(lhsStr, rhsStr) * sign;
        }
        default:
        {
            error->runtimeHandler(error->context, ERR_RUNTIME, "Illegal type");
            return 0;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x60(%rbp)
movq %rsi, -0x68(%rbp)
movq %rdx, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rax
movzbl 0x10(%rax), %eax
andl $0x1, %eax
decl %eax
orl $0x1, %eax
movl %eax, -0x7c(%rbp)
movq -0x60(%rbp), %rax
movq -0x78(%rbp), %rcx
movq 0x8(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movq -0x68(%rbp), %rax
movq -0x78(%rbp), %rcx
movq 0x8(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x98(%rbp)
movq -0x78(%rbp), %rax
movl (%rax), %eax
addl $-0x4, %eax
movl %eax, %ecx
movq %rcx, -0x110(%rbp)
subl $0x10, %eax
ja 0x1d3688
movq -0x110(%rbp), %rax
leaq 0xabc6(%rip), %rcx      # 0x1ddbec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x88(%rbp), %rax
movsbq (%rax), %rax
movq -0x90(%rbp), %rcx
movsbq (%rcx), %rcx
subq %rcx, %rax
movq %rax, -0xa0(%rbp)
cmpq $0x0, -0xa0(%rbp)
jne 0x1d3063
xorl %eax, %eax
movl %eax, -0x114(%rbp)
jmp 0x1d308f
cmpq $0x0, -0xa0(%rbp)
jle 0x1d3078
movl -0x7c(%rbp), %eax
movl %eax, -0x118(%rbp)
jmp 0x1d3083
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x118(%rbp)
movl -0x118(%rbp), %eax
movl %eax, -0x114(%rbp)
movl -0x114(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movswq (%rax), %rax
movq -0x90(%rbp), %rcx
movswq (%rcx), %rcx
subq %rcx, %rax
movq %rax, -0xa8(%rbp)
cmpq $0x0, -0xa8(%rbp)
jne 0x1d30d1
xorl %eax, %eax
movl %eax, -0x11c(%rbp)
jmp 0x1d30fd
cmpq $0x0, -0xa8(%rbp)
jle 0x1d30e6
movl -0x7c(%rbp), %eax
movl %eax, -0x120(%rbp)
jmp 0x1d30f1
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x120(%rbp)
movl -0x120(%rbp), %eax
movl %eax, -0x11c(%rbp)
movl -0x11c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movslq (%rax), %rax
movq -0x90(%rbp), %rcx
movslq (%rcx), %rcx
subq %rcx, %rax
movq %rax, -0xb0(%rbp)
cmpq $0x0, -0xb0(%rbp)
jne 0x1d313d
xorl %eax, %eax
movl %eax, -0x124(%rbp)
jmp 0x1d3169
cmpq $0x0, -0xb0(%rbp)
jle 0x1d3152
movl -0x7c(%rbp), %eax
movl %eax, -0x128(%rbp)
jmp 0x1d315d
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x128(%rbp)
movl -0x128(%rbp), %eax
movl %eax, -0x124(%rbp)
movl -0x124(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq -0x90(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
jne 0x1d31a6
xorl %eax, %eax
movl %eax, -0x12c(%rbp)
jmp 0x1d31d2
cmpq $0x0, -0xb8(%rbp)
jle 0x1d31bb
movl -0x7c(%rbp), %eax
movl %eax, -0x130(%rbp)
jmp 0x1d31c6
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x130(%rbp)
movl -0x130(%rbp), %eax
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movzbl (%rax), %eax
movq -0x90(%rbp), %rcx
movzbl (%rcx), %ecx
subq %rcx, %rax
movq %rax, -0xc0(%rbp)
cmpq $0x0, -0xc0(%rbp)
jne 0x1d3212
xorl %eax, %eax
movl %eax, -0x134(%rbp)
jmp 0x1d323e
cmpq $0x0, -0xc0(%rbp)
jle 0x1d3227
movl -0x7c(%rbp), %eax
movl %eax, -0x138(%rbp)
jmp 0x1d3232
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x138(%rbp)
movl -0x138(%rbp), %eax
movl %eax, -0x134(%rbp)
movl -0x134(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movzwl (%rax), %eax
movq -0x90(%rbp), %rcx
movzwl (%rcx), %ecx
subq %rcx, %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, -0xc8(%rbp)
jne 0x1d327e
xorl %eax, %eax
movl %eax, -0x13c(%rbp)
jmp 0x1d32aa
cmpq $0x0, -0xc8(%rbp)
jle 0x1d3293
movl -0x7c(%rbp), %eax
movl %eax, -0x140(%rbp)
jmp 0x1d329e
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x140(%rbp)
movl -0x140(%rbp), %eax
movl %eax, -0x13c(%rbp)
movl -0x13c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movl (%rax), %eax
movq -0x90(%rbp), %rcx
movl (%rcx), %ecx
subq %rcx, %rax
movq %rax, -0xd0(%rbp)
cmpq $0x0, -0xd0(%rbp)
jne 0x1d32e8
xorl %eax, %eax
movl %eax, -0x144(%rbp)
jmp 0x1d3314
cmpq $0x0, -0xd0(%rbp)
jle 0x1d32fd
movl -0x7c(%rbp), %eax
movl %eax, -0x148(%rbp)
jmp 0x1d3308
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x148(%rbp)
movl -0x148(%rbp), %eax
movl %eax, -0x144(%rbp)
movl -0x144(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq -0x90(%rbp), %rcx
subq (%rcx), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0xd8(%rbp)
jne 0x1d3351
xorl %eax, %eax
movl %eax, -0x14c(%rbp)
jmp 0x1d337d
cmpq $0x0, -0xd8(%rbp)
jle 0x1d3366
movl -0x7c(%rbp), %eax
movl %eax, -0x150(%rbp)
jmp 0x1d3371
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x150(%rbp)
movl -0x150(%rbp), %eax
movl %eax, -0x14c(%rbp)
movl -0x14c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
movq -0x90(%rbp), %rcx
movb (%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
subq %rcx, %rax
movq %rax, -0xe0(%rbp)
cmpq $0x0, -0xe0(%rbp)
jne 0x1d33c6
xorl %eax, %eax
movl %eax, -0x154(%rbp)
jmp 0x1d33f2
cmpq $0x0, -0xe0(%rbp)
jle 0x1d33db
movl -0x7c(%rbp), %eax
movl %eax, -0x158(%rbp)
jmp 0x1d33e6
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x158(%rbp)
movl -0x158(%rbp), %eax
movl %eax, -0x154(%rbp)
movl -0x154(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movzbl (%rax), %eax
movq -0x90(%rbp), %rcx
movzbl (%rcx), %ecx
subq %rcx, %rax
movq %rax, -0xe8(%rbp)
cmpq $0x0, -0xe8(%rbp)
jne 0x1d3432
xorl %eax, %eax
movl %eax, -0x15c(%rbp)
jmp 0x1d345e
cmpq $0x0, -0xe8(%rbp)
jle 0x1d3447
movl -0x7c(%rbp), %eax
movl %eax, -0x160(%rbp)
jmp 0x1d3452
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x160(%rbp)
movl -0x160(%rbp), %eax
movl %eax, -0x15c(%rbp)
movl -0x15c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x90(%rbp), %rax
movss (%rax), %xmm1
cvtss2sd %xmm1, %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
movsd -0xf0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1d34b3
jp 0x1d34b3
xorl %eax, %eax
movl %eax, -0x164(%rbp)
jmp 0x1d34e6
movsd -0xf0(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1d34cf
movl -0x7c(%rbp), %eax
movl %eax, -0x168(%rbp)
jmp 0x1d34da
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x168(%rbp)
movl -0x168(%rbp), %eax
movl %eax, -0x164(%rbp)
movl -0x164(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movsd (%rax), %xmm0
movq -0x90(%rbp), %rax
subsd (%rax), %xmm0
movsd %xmm0, -0xf8(%rbp)
movsd -0xf8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1d352f
jp 0x1d352f
xorl %eax, %eax
movl %eax, -0x16c(%rbp)
jmp 0x1d3562
movsd -0xf8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x1d354b
movl -0x7c(%rbp), %eax
movl %eax, -0x170(%rbp)
jmp 0x1d3556
xorl %eax, %eax
subl -0x7c(%rbp), %eax
movl %eax, -0x170(%rbp)
movl -0x170(%rbp), %eax
movl %eax, -0x16c(%rbp)
movl -0x16c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x88(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x100(%rbp)
jne 0x1d35d8
movq 0x6a2e(%rip), %rax      # 0x1d9fc0
movq %rax, -0x10(%rbp)
movq 0x6a2b(%rip), %rax      # 0x1d9fc8
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0x133b4(%rip)     # 0x1e6960
movq -0x8(%rbp), %rax
movq %rax, 0x133b1(%rip)     # 0x1e6968
leaq 0x133a2(%rip), %rax     # 0x1e6960
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movb $0x0, (%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0x90(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x108(%rbp)
cmpq $0x0, -0x108(%rbp)
jne 0x1d3640
movq 0x69c6(%rip), %rax      # 0x1d9fc0
movq %rax, -0x28(%rbp)
movq 0x69c3(%rip), %rax      # 0x1d9fc8
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
movq %rax, 0x1334c(%rip)     # 0x1e6960
movq -0x20(%rbp), %rax
movq %rax, 0x13349(%rip)     # 0x1e6968
leaq 0x1333a(%rip), %rax     # 0x1e6960
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0x100(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x38(%rbp)
movq %rax, -0x40(%rbp)
movq -0x108(%rbp), %rcx
movq -0x98(%rbp), %rax
movq %rcx, -0x48(%rbp)
movq %rax, -0x50(%rbp)
movq -0x100(%rbp), %rdi
movq -0x108(%rbp), %rsi
callq 0x3220
imull -0x7c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x1d36b5
movq -0x98(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x98(%rbp), %rax
movq 0x20(%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x4936(%rip), %rdx      # 0x1d7fe0
movb $0x0, %al
callq *%rcx
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw %cs:(%rax,%rax)