LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeSizeRecompute
static int typeSizeRecompute(const Type *type)
{
    switch (type->kind)
    {
        case TYPE_VOID:     return 0;
        case TYPE_INT8:     return sizeof(int8_t);
        case TYPE_INT16:    return sizeof(int16_t);
        case TYPE_INT32:    return sizeof(int32_t);
        case TYPE_INT:      return sizeof(int64_t);
        case TYPE_UINT8:    return sizeof(uint8_t);
        case TYPE_UINT16:   return sizeof(uint16_t);
        case TYPE_UINT32:   return sizeof(uint32_t);
        case TYPE_UINT:     return sizeof(uint64_t);
        case TYPE_BOOL:     return sizeof(bool);
        case TYPE_CHAR:     return sizeof(unsigned char);
        case TYPE_REAL32:   return sizeof(float);
        case TYPE_REAL:     return sizeof(double);
        case TYPE_PTR:      return sizeof(void *);
        case TYPE_WEAKPTR:  return sizeof(uint64_t);
        case TYPE_STR:      return sizeof(void *);
        case TYPE_ARRAY:    return type->numItems > 0 ? (type->numItems * typeSizeRecompute(type->base)) : 0;
        case TYPE_DYNARRAY: return sizeof(DynArray);
        case TYPE_MAP:      return sizeof(Map);
        case TYPE_STRUCT:
        case TYPE_INTERFACE:
        case TYPE_CLOSURE:
        {
            int size = 0;
            for (int i = 0; i < type->numItems; i++)
            {
                const int fieldSize = typeSizeRecompute(type->field[i]->type);
                size = align(size + fieldSize, typeAlignmentRecompute(type->field[i]->type));
            }
            size = align(size, typeAlignmentRecompute(type));
            return size;
        }
        case TYPE_FIBER:    return sizeof(void *);
        case TYPE_FN:       return sizeof(int64_t);
        default:            return -1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x1
popq %rbp
pushq $0x18
popq %rcx
leaq 0x56a63(%rip), %rax     # 0x6b8a0
movl (%rbx), %edx
addl $-0x2, %edx
cmpl $0x18, %edx
ja 0x14efa
movslq (%rax,%rdx,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movl 0x10(%rbx), %edx
testl %edx, %edx
jle 0x14ef6
movq 0x8(%rbx), %rbx
imull %edx, %ebp
jmp 0x14e3d
pushq $0x8
jmp 0x14f00
pushq $0x1
jmp 0x14f00
pushq $0x4
jmp 0x14f00
movl 0x10(%rbx), %r12d
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
xorl %r14d, %r14d
cmpq %r13, %r12
je 0x14ed1
movq 0x28(%rbx), %rax
movq (%rax,%r13,8), %rax
movq 0x108(%rax), %r15
movq %r15, %rdi
callq 0x14e22
addl %r14d, %eax
movslq %eax, %r14
movq %r15, %rdi
callq 0x14f15
movslq %eax, %rcx
addq %rcx, %r14
decq %r14
movq %r14, %rax
cqto
idivq %rcx
subl %edx, %r14d
incq %r13
jmp 0x14e8e
movslq %r14d, %r14
movq %rbx, %rdi
callq 0x14f15
movslq %eax, %rsi
leaq (%r14,%rsi), %rcx
decq %rcx
movq %rcx, %rax
cqto
idivq %rsi
subl %edx, %ecx
jmp 0x14f01
pushq $0x2
jmp 0x14f00
xorl %ecx, %ecx
jmp 0x14f01
pushq $-0x1
jmp 0x14f00
pushq $0x10
popq %rcx
imull %ebp, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeAlignmentRecompute
static int typeAlignmentRecompute(const Type *type)
{
    switch (type->kind)
    {
        case TYPE_VOID:     return 1;
        case TYPE_INT8:
        case TYPE_INT16:
        case TYPE_INT32:
        case TYPE_INT:
        case TYPE_UINT8:
        case TYPE_UINT16:
        case TYPE_UINT32:
        case TYPE_UINT:
        case TYPE_BOOL:
        case TYPE_CHAR:
        case TYPE_REAL32:
        case TYPE_REAL:
        case TYPE_PTR:
        case TYPE_WEAKPTR:
        case TYPE_STR:      return typeSizeRecompute(type);
        case TYPE_ARRAY:    return type->numItems > 0 ? typeAlignmentRecompute(type->base) : 1;
        case TYPE_DYNARRAY:
        case TYPE_MAP:      return sizeof(int64_t);
        case TYPE_STRUCT:
        case TYPE_INTERFACE:
        case TYPE_CLOSURE:
        {
            int alignment = 1;
            for (int i = 0; i < type->numItems; i++)
            {
                const int fieldAlignment = typeAlignmentRecompute(type->field[i]->type);
                if (fieldAlignment > alignment)
                    alignment = fieldAlignment;
            }
            return alignment;
        }
        case TYPE_FIBER:    return typeSizeRecompute(type);
        case TYPE_FN:       return sizeof(int64_t);
        default:            return 0;
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rbx
leaq 0x569da(%rip), %rax     # 0x6b904
movl (%r14), %ecx
addl $-0x2, %ecx
cmpl $0x18, %ecx
ja 0x14f97
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpl $0x0, 0x10(%r14)
jle 0x14f99
movq 0x8(%r14), %r14
jmp 0x14f2a
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x14e22
pushq $0x8
popq %rbx
jmp 0x14f99
movl 0x10(%r14), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
pushq $0x1
popq %rbx
cmpq %r12, %r15
je 0x14f99
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rax
movq 0x108(%rax), %rdi
callq 0x14f15
cmpl %ebx, %eax
cmovgl %eax, %ebx
incq %r12
jmp 0x14f74
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeDeepCopy
void typeDeepCopy(Storage *storage, Type *dest, const Type *src)
{
    const Type *next = dest->next;
    *dest = *src;
    dest->next = next;

    if ((dest->kind == TYPE_STRUCT || dest->kind == TYPE_INTERFACE || dest->kind == TYPE_CLOSURE) && dest->numItems > 0)
    {
        dest->field = storageAdd(storage, dest->numItems * sizeof(Field *));
        for (int i = 0; i < dest->numItems; i++)
        {
            Field *field = storageAdd(storage, sizeof(Field));
            *field = *(src->field[i]);
            dest->field[i] = field;
        }
    }
    else if (typeEnum(dest) && dest->numItems > 0)
    {
        dest->enumConst = storageAdd(storage, dest->numItems * sizeof(EnumConst *));
        for (int i = 0; i < dest->numItems; i++)
        {
            EnumConst *enumConst = storageAdd(storage, sizeof(EnumConst));
            *enumConst = *(src->enumConst[i]);
            dest->enumConst[i] = enumConst;
        }
    }
    else if (dest->kind == TYPE_FN && dest->sig.numParams > 0)
    {
        for (int i = 0; i < dest->sig.numParams; i++)
        {
            Param *param = storageAdd(storage, sizeof(Param));
            *param = *(src->sig.param[i]);
            dest->sig.param[i] = param;
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0xc8(%rsi), %r12
movl $0xc8, %edx
movq %rsi, %rdi
movq %rbx, %rsi
callq 0x3260
movq %r12, 0xc8(%r14)
movl (%r14), %eax
leal -0x16(%rax), %ecx
cmpl $0x2, %ecx
ja 0x15041
movslq 0x10(%r14), %rsi
testq %rsi, %rsi
jle 0x150f6
shlq $0x3, %rsi
movq %r15, %rdi
callq 0x4144
movq %rax, 0x28(%r14)
xorl %r13d, %r13d
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jge 0x150f6
movl $0x118, %esi            # imm = 0x118
movq %r15, %rdi
callq 0x4144
movq %rax, %r12
movq 0x28(%rbx), %rax
movq (%rax,%r13,8), %rsi
movl $0x118, %edx            # imm = 0x118
movq %r12, %rdi
callq 0x3260
movq 0x28(%r14), %rax
movq %r12, (%rax,%r13,8)
incq %r13
jmp 0x15002
leal -0x4(%rax), %ecx
cmpl $0x7, %ecx
ja 0x150af
cmpb $0x1, 0x16(%r14)
jne 0x150f6
movslq 0x10(%r14), %rsi
testq %rsi, %rsi
jle 0x150f6
shlq $0x3, %rsi
movq %r15, %rdi
callq 0x4144
movq %rax, 0x28(%r14)
xorl %r13d, %r13d
movslq 0x10(%r14), %rax
cmpq %rax, %r13
jge 0x150f6
movl $0x110, %esi            # imm = 0x110
movq %r15, %rdi
callq 0x4144
movq %rax, %r12
movq 0x28(%rbx), %rax
movq (%rax,%r13,8), %rsi
movl $0x110, %edx            # imm = 0x110
movq %r12, %rdi
callq 0x3260
movq 0x28(%r14), %rax
movq %r12, (%rax,%r13,8)
incq %r13
jmp 0x15074
cmpl $0x1a, %eax
jne 0x150f6
movl 0x28(%r14), %eax
testl %eax, %eax
jle 0x150f6
xorl %r13d, %r13d
cltq
cmpq %rax, %r13
jge 0x150f6
movl $0x118, %esi            # imm = 0x118
movq %r15, %rdi
callq 0x4144
movq %rax, %r12
movq 0x38(%rbx,%r13,8), %rsi
movl $0x118, %edx            # imm = 0x118
movq %rax, %rdi
callq 0x3260
movq %r12, 0x38(%r14,%r13,8)
incq %r13
movl 0x28(%r14), %eax
jmp 0x150bf
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeSize
int typeSize(const Types *types, const Type *type)
{
    if (type->size < 0)
    {
        char buf[DEFAULT_STR_LEN + 1];
        types->error->handler(types->error->context, "Illegal type %s", typeSpelling(type, buf));
    }
    return type->size;
}

// Assembly:
movl 0xc0(%rsi), %eax
testl %eax, %eax
js 0x1512f
retq
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movq 0x18(%rdi), %rax
movq (%rax), %r12
movq 0x20(%rax), %r14
movq %rsp, %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x15180
leaq 0x56974(%rip), %rsi     # 0x6bad4
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq *%r12
movl 0xc0(%rbx), %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeAlignment
int typeAlignment(const Types *types, const Type *type)
{
    if (type->alignment <= 0)
    {
        char buf[DEFAULT_STR_LEN + 1];
        types->error->handler(types->error->context, "Illegal type %s", typeSpelling(type, buf));
    }
    return type->alignment;
}

// Assembly:
movl 0xc4(%rsi), %eax
testl %eax, %eax
jle 0x15193
retq
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %rbx
movq 0x18(%rdi), %rax
movq (%rax), %r12
movq 0x20(%rax), %r14
movq %rsp, %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x15180
leaq 0x56910(%rip), %rsi     # 0x6bad4
movq %r14, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq *%r12
movl 0xc4(%rbx), %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeHasPtr
bool typeHasPtr(const Type *type, bool alsoWeakPtr)
{
    if (type->kind == TYPE_PTR      || type->kind == TYPE_STR       || type->kind == TYPE_MAP     ||
        type->kind == TYPE_DYNARRAY || type->kind == TYPE_INTERFACE || type->kind == TYPE_CLOSURE || type->kind == TYPE_FIBER)
        return true;

    if (type->kind == TYPE_WEAKPTR && alsoWeakPtr)
        return true;

    if (type->kind == TYPE_ARRAY)
        return type->numItems > 0 && typeHasPtr(type->base, alsoWeakPtr);

    if (type->kind == TYPE_STRUCT)
        for (int i = 0; i < type->numItems; i++)
            if (typeHasPtr(type->field[i]->type, alsoWeakPtr))
                return true;

    return false;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
leaq 0x56770(%rip), %rax     # 0x6b968
movl (%r14), %ecx
addl $-0x10, %ecx
cmpl $0x9, %ecx
ja 0x1521d
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
cmpl $0x0, 0x10(%r14)
jle 0x1521d
movq 0x8(%r14), %r14
jmp 0x151f8
movb $0x1, %bl
jmp 0x1521f
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl 0x10(%r14), %r15d
xorl %r12d, %r12d
testl %r15d, %r15d
cmovlel %r12d, %r15d
movzbl %bl, %ebp
cmpq %r12, %r15
setne %bl
je 0x1521f
movq 0x28(%r14), %rax
movq (%rax,%r12,8), %rax
movq 0x108(%rax), %rdi
movl %ebp, %esi
callq 0x151e4
incq %r12
testb %al, %al
je 0x1523b
jmp 0x1521f
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeCompatible
bool typeCompatible(const Type *left, const Type *right)
{
    if (typeEquivalent(left, right))
        return true;

    if (typeInteger(left) && typeInteger(right))
        return true;

    if (typeReal(left) && typeReal(right))
        return true;

    return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x15262
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
jne 0x155f8
movl (%r14), %ecx
leal -0x4(%rcx), %edx
cmpl $0x7, %edx
ja 0x155e4
cmpb $0x0, 0x16(%r14)
jne 0x155e4
movl (%rbx), %edx
addl $-0x4, %edx
cmpl $0x7, %edx
ja 0x155e4
cmpb $0x1, 0x16(%rbx)
jne 0x155f8
andl $-0x2, %ecx
cmpl $0xe, %ecx
jne 0x155f6
movl (%rbx), %ecx
andl $-0x2, %ecx
cmpl $0xe, %ecx
je 0x155f8
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeValidOperator
bool typeValidOperator(const Type *type, TokenKind op)
{
    switch (op)
    {
        case TOK_PLUS:      return typeInteger(type) || typeReal(type) || type->kind == TYPE_STR;
        case TOK_MINUS:
        case TOK_MUL:
        case TOK_DIV:
        case TOK_MOD:       return typeInteger(type) || typeReal(type);
        case TOK_AND:
        case TOK_OR:
        case TOK_XOR:
        case TOK_SHL:
        case TOK_SHR:       return typeInteger(type);
        case TOK_PLUSEQ:    return typeInteger(type) || typeReal(type) || type->kind == TYPE_STR;
        case TOK_MINUSEQ:
        case TOK_MULEQ:
        case TOK_DIVEQ:
        case TOK_MODEQ:     return typeInteger(type) || typeReal(type);
        case TOK_ANDEQ:
        case TOK_OREQ:
        case TOK_XOREQ:
        case TOK_SHLEQ:
        case TOK_SHREQ:     return typeInteger(type);
        case TOK_ANDAND:
        case TOK_OROR:      return type->kind == TYPE_BOOL;
        case TOK_PLUSPLUS:
        case TOK_MINUSMINUS:return typeInteger(type);
        case TOK_EQEQ:
        case TOK_LESS:
        case TOK_GREATER:   return typeComparable(type);
        case TOK_EQ:        return true;
        case TOK_NOT:       return type->kind == TYPE_BOOL;
        case TOK_NOTEQ:
        case TOK_LESSEQ:
        case TOK_GREATEREQ: return typeComparable(type);
        default:            return false;
    }
}

// Assembly:
addl $-0x16, %esi
cmpl $0x20, %esi
ja 0x15795
movb $0x1, %al
leaq 0x56264(%rip), %rcx     # 0x6b9c8
movslq (%rcx,%rsi,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movl (%rdi), %eax
addl $-0x4, %eax
cmpl $0x7, %eax
ja 0x15795
movb 0x16(%rdi), %al
xorb $0x1, %al
retq
movl (%rdi), %ecx
leal -0x4(%rcx), %edx
cmpl $0x7, %edx
ja 0x1578d
cmpb $0x1, 0x16(%rdi)
jne 0x1577c
andl $-0x2, %ecx
cmpl $0xe, %ecx
jmp 0x157be
xorl %eax, %eax
retq
jmp 0x157c2
cmpl $0xc, (%rdi)
jmp 0x157be
movl (%rdi), %ecx
leal -0x4(%rcx), %edx
cmpl $0x7, %edx
ja 0x157b1
cmpb $0x0, 0x16(%rdi)
jne 0x157bb
jmp 0x1577c
movl %ecx, %edx
andl $-0x2, %edx
cmpl $0xe, %edx
je 0x1577c
cmpl $0x14, %ecx
sete %al
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeComparable
static bool typeComparable(const Type *type)
{
    if (typeOrdinal(type) || typeReal(type) || type->kind == TYPE_PTR || type->kind == TYPE_WEAKPTR || type->kind == TYPE_STR)
        return true;

    if (type->kind == TYPE_ARRAY)
        return typeComparable(type->base);

    if (type->kind == TYPE_STRUCT)
    {
        for (int i = 0; i < type->numItems; i++)
            if (!typeComparable(type->field[i]->type))
                return false;
        return true;
    }

    return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x56278(%rip), %rcx     # 0x6ba4c
movl (%rbx), %edx
leal -0x4(%rdx), %esi
movb $0x1, %al
cmpl $0xa, %esi
jb 0x1583f
movl %edx, %esi
andl $-0x2, %esi
cmpl $0xe, %esi
je 0x1583f
addl $-0x10, %edx
cmpl $0x6, %edx
ja 0x15835
movslq (%rcx,%rdx,4), %rdx
addq %rcx, %rdx
jmpq *%rdx
movq 0x8(%rbx), %rbx
jmp 0x157d4
movslq 0x10(%rbx), %r14
xorl %r15d, %r15d
testl %r14d, %r14d
movl $0x0, %r12d
cmovgl %r14d, %r12d
cmpq %r15, %r12
je 0x15839
movq 0x28(%rbx), %rax
movq (%rax,%r15,8), %rax
movq 0x108(%rax), %rdi
callq 0x157c2
incq %r15
testb %al, %al
jne 0x15815
xorl %eax, %eax
jmp 0x1583f
cmpq %r14, %r15
setge %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeEnableForward
void typeEnableForward(Types *types, bool enable)
{
    types->forwardTypesEnabled = enable;

    if (!enable)
        for (const Type *type = types->first; type; type = type->next)
            if (type->kind == TYPE_FORWARD)
                types->error->handler(types->error->context, "Unresolved forward declaration of %s", (Ident *)(type->typeIdent)->name);
}

// Assembly:
movb %sil, 0x8(%rdi)
testl %esi, %esi
jne 0x15909
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x56299(%rip), %r14     # 0x6bb6c
movq %rdi, %r15
movq (%r15), %r15
testq %r15, %r15
je 0x15904
cmpl $0x1, (%r15)
jne 0x158fb
movq 0x18(%rbx), %rcx
movq 0x20(%rcx), %rdi
movq 0x18(%r15), %rdx
addq $0x4, %rdx
movq %r14, %rsi
xorl %eax, %eax
callq *(%rcx)
addq $0xc8, %r15
jmp 0x158d6
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeFindField
const Field *typeFindField(const Type *structType, const char *name, int *index)
{
    if (structType->kind == TYPE_STRUCT || structType->kind == TYPE_INTERFACE || structType->kind == TYPE_CLOSURE)
    {
        unsigned int nameHash = hash(name);
        for (int i = 0; i < structType->numItems; i++)
            if (structType->field[i]->hash == nameHash && strcmp(structType->field[i]->name, name) == 0)
            {
                if (index)
                    *index = i;
                return structType->field[i];
            }
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %eax
addl $-0x16, %eax
xorl %r12d, %r12d
cmpl $0x2, %eax
ja 0x1596e
movq %rsi, %r15
movq %rdi, %r14
movq %rdx, (%rsp)
movq %rsi, %rdi
callq 0x15999
movl %eax, %ebp
movl 0x10(%r14), %ebx
testl %ebx, %ebx
cmovlel %r12d, %ebx
xorl %r13d, %r13d
cmpq %r13, %rbx
je 0x1596e
movq 0x28(%r14), %rax
movq (%rax,%r13,8), %r12
cmpl %ebp, 0x100(%r12)
jne 0x15969
movq %r12, %rdi
movq %r15, %rsi
callq 0x3210
testl %eax, %eax
je 0x15983
incq %r13
jmp 0x15943
xorl %r12d, %r12d
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%rsp), %rax
testq %rax, %rax
je 0x15971
movl %r13d, (%rax)
movq 0x28(%r14), %rax
movq (%rax,%r13,8), %r12
jmp 0x15971
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeAssertFindField
const Field *typeAssertFindField(const Types *types, const Type *structType, const char *name, int *index)
{
    const Field *res = typeFindField(structType, name, index);
    if (!res)
        types->error->handler(types->error->context, "Unknown field %s", name);
    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x1590a
movq %rax, %r14
testq %rax, %rax
jne 0x159e7
movq 0x18(%r15), %rcx
movq 0x20(%rcx), %rdi
leaq 0x561b1(%rip), %rsi     # 0x6bb91
movq %rbx, %rdx
xorl %eax, %eax
callq *(%rcx)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeFindEnumConst
const EnumConst *typeFindEnumConst(const Type *enumType, const char *name)
{
    if (typeEnum(enumType))
    {
        unsigned int nameHash = hash(name);
        for (int i = 0; i < enumType->numItems; i++)
            if (enumType->enumConst[i]->hash == nameHash && strcmp(enumType->enumConst[i]->name, name) == 0)
                return enumType->enumConst[i];
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %eax
addl $-0x4, %eax
cmpl $0x7, %eax
ja 0x15c44
movq %rdi, %r14
xorl %r15d, %r15d
cmpb $0x1, 0x16(%rdi)
jne 0x15c44
movq %rsi, %rbx
movq %rsi, %rdi
callq 0x15999
movl %eax, %ebp
movl 0x10(%r14), %r12d
testl %r12d, %r12d
cmovlel %r15d, %r12d
xorl %r13d, %r13d
cmpq %r13, %r12
je 0x15c44
movq 0x28(%r14), %rax
movq (%rax,%r13,8), %r15
cmpl %ebp, 0x100(%r15)
jne 0x15c3f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3210
testl %eax, %eax
je 0x15c47
incq %r13
jmp 0x15c1a
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeAssertFindEnumConst
const EnumConst *typeAssertFindEnumConst(const Types *types, const Type *enumType, const char *name)
{
    const EnumConst *res = typeFindEnumConst(enumType, name);
    if (!res)
        types->error->handler(types->error->context, "Unknown enumeration constant %s", name);
    return res;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x15bde
movq %rax, %r14
testq %rax, %rax
jne 0x15c8d
movq 0x18(%r15), %rcx
movq 0x20(%rcx), %rdi
leaq 0x55f88(%rip), %rsi     # 0x6bc0e
movq %rbx, %rdx
xorl %eax, %eax
callq *(%rcx)
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeAddEnumConst
const EnumConst *typeAddEnumConst(const Types *types, Type *enumType, const char *name, Const val)
{
    if (typeFindEnumConst(enumType, name))
        types->error->handler(types->error->context, "Duplicate enumeration constant %s", name);

    if (typeFindEnumConstByVal(enumType, val))
        types->error->handler(types->error->context, "Duplicate enumeration constant value %lld", val.intVal);

    EnumConst *enumConst = storageAdd(types->storage, sizeof(EnumConst));

    strncpy(enumConst->name, name, MAX_IDENT_LEN);
    enumConst->name[MAX_IDENT_LEN] = 0;

    enumConst->hash = hash(name);
    enumConst->val = val;

    if (enumType->numItems > 0)
        enumType->enumConst = storageRealloc(types->storage, enumType->enumConst, (enumType->numItems + 1) * sizeof(EnumConst *));
    else
        enumType->enumConst = storageAdd(types->storage, sizeof(EnumConst *));

    enumType->numItems++;
    enumType->enumConst[enumType->numItems - 1] = enumConst;

    return enumConst;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x15bde
testq %rax, %rax
je 0x15d0a
movq 0x18(%r14), %rcx
movq 0x20(%rcx), %rdi
leaq 0x55f2b(%rip), %rsi     # 0x6bc2e
movq %r12, %rdx
xorl %eax, %eax
callq *(%rcx)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15c96
testq %rax, %rax
je 0x15d30
movq 0x18(%r14), %rcx
movq 0x20(%rcx), %rdi
leaq 0x55f27(%rip), %rsi     # 0x6bc50
movq %r15, %rdx
xorl %eax, %eax
callq *(%rcx)
movq 0x10(%r14), %rdi
movl $0x110, %esi            # imm = 0x110
callq 0x4144
movq %rax, %r13
movl $0xff, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3080
movb $0x0, 0xff(%r13)
movq %r12, %rdi
callq 0x15999
movl %eax, 0x100(%r13)
movq %r15, 0x108(%r13)
movl 0x10(%rbx), %eax
movq 0x10(%r14), %rdi
testl %eax, %eax
jle 0x15d8d
movq 0x28(%rbx), %rsi
leaq 0x8(,%rax,8), %rdx
callq 0x42b1
jmp 0x15d95
pushq $0x8
popq %rsi
callq 0x4144
movq %rax, 0x28(%rbx)
movslq 0x10(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x10(%rbx)
movq %r13, (%rax,%rcx,8)
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeFindParam
const Param *typeFindParam(const Signature *sig, const char *name)
{
    const unsigned int nameHash = hash(name);
    for (int i = 0; i < sig->numParams; i++)
        if (sig->param[i]->hash == nameHash && strcmp(sig->param[i]->name, name) == 0)
            return sig->param[i];

    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x15999
movl %eax, %ebp
movslq (%r14), %r12
xorl %r13d, %r13d
cmpq %r12, %r13
jge 0x15dfc
movq 0x10(%r14,%r13,8), %r15
cmpl %ebp, 0x100(%r15)
jne 0x15df7
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3210
testl %eax, %eax
je 0x15dff
incq %r13
jmp 0x15dd5
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeAddParam
const Param *typeAddParam(const Types *types, Signature *sig, const Type *type, const char *name, Const defaultVal)
{
    if (typeFindParam(sig, name))
        types->error->handler(types->error->context, "Duplicate parameter %s", name);

    if (sig->numParams > MAX_PARAMS)
        types->error->handler(types->error->context, "Too many parameters");

    Param *param = storageAdd(types->storage, sizeof(Param));

    strncpy(param->name, name, MAX_IDENT_LEN);
    param->name[MAX_IDENT_LEN] = 0;

    param->hash = hash(name);
    param->type = type;
    param->defaultVal = defaultVal;

    sig->param[sig->numParams++] = param;
    return param;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %r8, %r14
movq %rcx, %r12
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r13
movq %rsi, %rdi
movq %rcx, %rsi
callq 0x15db4
testq %rax, %rax
je 0x15e4f
movq 0x18(%r13), %rcx
movq 0x20(%rcx), %rdi
leaq 0x55e32(%rip), %rsi     # 0x6bc7a
movq %r12, %rdx
xorl %eax, %eax
callq *(%rcx)
cmpl $0x11, (%rbx)
jl 0x15e67
movq 0x18(%r13), %rcx
movq 0x20(%rcx), %rdi
leaq 0x55e2e(%rip), %rsi     # 0x6bc91
xorl %eax, %eax
callq *(%rcx)
movq 0x10(%r13), %rdi
movl $0x118, %esi            # imm = 0x118
callq 0x4144
movq %rax, %r13
movl $0xff, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3080
movb $0x0, 0xff(%r13)
movq %r12, %rdi
callq 0x15999
movl %eax, 0x100(%r13)
movq %r15, 0x108(%r13)
movq %r14, 0x110(%r13)
movslq (%rbx), %rax
leal 0x1(%rax), %ecx
movl %ecx, (%rbx)
movq %r13, 0x10(%rbx,%rax,8)
movq %r13, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeParamSizeUpTo
int typeParamSizeUpTo(const Types *types, const Signature *sig, int index)
{
    // All parameters are slot-aligned
    int size = 0;
    for (int i = 0; i <= index; i++)
        size += align(typeSize(types, sig->param[i]->type), sizeof(Slot));
    return size;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movslq %edx, %r15
xorl %r12d, %r12d
pushq $0x8
popq %r13
xorl %ebp, %ebp
cmpq %r15, %r12
jg 0x15f15
movq 0x10(%rbx,%r12,8), %rax
movq 0x108(%rax), %rsi
movq %r14, %rdi
callq 0x15124
movslq %eax, %rcx
addq $0x7, %rcx
movq %rcx, %rax
cqto
idivq %r13
subl %edx, %ecx
addl %ecx, %ebp
incq %r12
jmp 0x15ee4
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeMakeParamLayout
const ParamLayout *typeMakeParamLayout(const Types *types, const Signature *sig)
{
    ParamLayout *layout = storageAdd(types->storage, sizeof(ParamLayout) + sig->numParams * sizeof(int64_t));

    layout->numParams = sig->numParams;
    layout->numResultParams = typeStructured(sig->resultType) ? 1 : 0;
    layout->numParamSlots = typeParamSizeTotal(types, sig) / sizeof(Slot);

    for (int i = 0; i < sig->numParams; i++)
        layout->firstSlotIndex[i] = typeParamOffset(types, sig, i) / sizeof(Slot) - 2;   // - 2 slots for old base pointer and return address

    return layout;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
movslq (%rsi), %rax
leaq 0x18(,%rax,8), %rsi
callq 0x4144
movq %rax, %r15
movslq (%rbx), %rax
movq %rax, (%r15)
movq 0x90(%rbx), %rax
movl (%rax), %eax
addl $-0x12, %eax
cmpl $0x6, %eax
ja 0x15fa0
movl %eax, %eax
leaq 0x55ae6(%rip), %rcx     # 0x6ba80
movq (%rcx,%rax,8), %rax
jmp 0x15fa2
xorl %eax, %eax
movq %rax, 0x8(%r15)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x15f26
cltq
shrq $0x3, %rax
movq %rax, 0x10(%r15)
xorl %r12d, %r12d
movslq (%rbx), %rax
cmpq %rax, %r12
jge 0x15fe8
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x15f2f
cltq
shrq $0x3, %rax
addq $-0x2, %rax
movq %rax, 0x18(%r15,%r12,8)
incq %r12
jmp 0x15fbe
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeMakeParamAndLocalVarLayout
const ParamAndLocalVarLayout *typeMakeParamAndLocalVarLayout(const Types *types, const ParamLayout *paramLayout, int localVarSlots)
{
    ParamAndLocalVarLayout *layout = storageAdd(types->storage, sizeof(ParamAndLocalVarLayout));
    layout->paramLayout = paramLayout;
    layout->localVarSlots = localVarSlots;
    return layout;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq 0x10(%rdi), %rdi
pushq $0x10
popq %rsi
callq 0x4144
movq %r14, (%rax)
movslq %ebx, %rcx
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_vm.c
// Function: qsortEx
void qsortEx(char *first, char *last, int itemSize, QSortCompareFn compare, void *context, void *temp)
{
    if (first >= last)
        return;

    char *partition = qsortPartition(first, last, itemSize, compare, context, temp);

    qsortEx(first, partition - itemSize, itemSize, compare, context, temp);
    qsortEx(partition + itemSize, last, itemSize, compare, context, temp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, (%rsp)
movq %r8, %r14
movq %rcx, %r15
movq %rsi, %r12
movq %rdi, %rbx
movslq %edx, %rax
movq %rax, 0x8(%rsp)
negq %rax
movq %rax, 0x10(%rsp)
cmpq %r12, %rbx
jae 0x165f9
movq %r12, %r13
movq %rbx, %rbp
cmpq %r12, %rbp
jae 0x1659d
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *%r15
cmpq %r13, %rbp
jae 0x1654f
testl %eax, %eax
jg 0x1654f
addq 0x8(%rsp), %rbp
jmp 0x1652e
addq 0x10(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *%r15
cmpq %rbx, %r12
jbe 0x16564
testl %eax, %eax
jg 0x1654a
cmpq %r12, %rbp
jae 0x16529
movq (%rsp), %rdi
movq %rbp, %rsi
movq 0x8(%rsp), %rdx
callq 0x3260
movq %rbp, %rdi
movq %r12, %rsi
movq 0x8(%rsp), %rdx
callq 0x3260
movq %r12, %rdi
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
callq 0x3260
jmp 0x16529
movq (%rsp), %rdi
movq %rbx, %rsi
movq 0x8(%rsp), %rbp
movq %rbp, %rdx
callq 0x3260
movq %rbx, %rdi
movq %r12, %rsi
movq %rbp, %rdx
callq 0x3260
movq %r12, %rdi
movq (%rsp), %rsi
movq %rbp, %rdx
callq 0x3260
movq 0x10(%rsp), %rax
leaq (%r12,%rax), %rsi
movq %rbx, %rdi
movl %ebp, %edx
movq %r15, %rcx
movq %r14, %r8
movq (%rsp), %r9
callq 0x164ec
addq %rbp, %r12
movq %r12, %rbx
movq %r13, %r12
jmp 0x1651a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_vm.c
// Function: vmGetMapNodeData
void *vmGetMapNodeData(VM *vm, Map *map, Slot key)
{
    if (!map || !map->root)
        return NULL;

    const MapNode *node = *doGetMapNode(map, key, false, NULL, vm->error);
    return node ? node->data : NULL;
}

// Assembly:
testq %rsi, %rsi
je 0x3b820
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq 0x8(%rsi), %rax
testq %rax, %rax
je 0x3b82e
movq %rdx, %r14
leaq 0x8(%r15), %rbp
movq 0x80(%rdi), %r12
leaq 0x317dd(%rip), %rbx     # 0x6cf1c
testq %rax, %rax
je 0x3b82e
movq 0x8(%rax), %r13
testq %r13, %r13
je 0x3b804
movq (%r15), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x108(%rax), %rax
movq 0x8(%rax), %rdx
movl (%rdx), %eax
addl $-0x4, %eax
cmpl $0x16, %eax
ja 0x3b7bd
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq (%r13), %r13
jmp 0x3b7ed
movzbl (%r13), %r13d
jmp 0x3b7ed
movslq (%r13), %r13
jmp 0x3b7ed
movzwl (%r13), %r13d
jmp 0x3b7ed
movl (%r13), %r13d
jmp 0x3b7ed
movsbq (%r13), %r13
jmp 0x3b7ed
movswq (%r13), %r13
jmp 0x3b7ed
cvtss2sd (%r13), %xmm0
movq %xmm0, %r13
jmp 0x3b7ed
movq 0x20(%r12), %rdi
pushq $-0x1
popq %rsi
leaq 0x2e844(%rip), %rdx     # 0x6a010
xorl %eax, %eax
callq *0x8(%r12)
movq (%r15), %rax
movq 0x8(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq 0x108(%rax), %rax
movq 0x8(%rax), %rdx
movq %r14, %rdi
movq %r13, %rsi
movq %r12, %rcx
callq 0x3d32c
testq %rax, %rax
jle 0x3b80d
movq (%rbp), %rax
addq $0x20, %rax
movq %rax, %rbp
jmp 0x3b817
movq (%rbp), %rbp
jns 0x3b823
addq $0x18, %rbp
movq (%rbp), %rax
jmp 0x3b73f
xorl %eax, %eax
retq
testq %rbp, %rbp
je 0x3b82e
movq 0x10(%rbp), %rax
jmp 0x3b830
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_vm.c
// Function: fsnprintf
static int fsnprintf(bool string, void *stream, int size, const char *format, ...)
{
    va_list args;
    va_start(args, format);

    int res = string ? vsnprintf((char *)stream, size, format, args) : vfprintf((FILE *)stream, format, args);

    va_end(args);
    return res;
}

// Assembly:
subq $0xd8, %rsp
movq %rsi, %r10
leaq 0x20(%rsp), %rsi
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x3ecea
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000020, %rax     # imm = 0x3000000020
movq %rax, (%rsp)
testl %edi, %edi
je 0x3ed24
movslq %edx, %rsi
movq %rsp, %rax
movq %r10, %rdi
movq %rcx, %rdx
movq %rax, %rcx
callq 0x30e0
jmp 0x3ed32
movq %rsp, %rdx
movq %r10, %rdi
movq %rcx, %rsi
callq 0x3340
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/vtereshkov[P]umka-lang/src/umka_vm.c
// Function: fsscanf
static int fsscanf(bool string, void *stream, const char *format, ...)
{
    va_list args;
    va_start(args, format);

    int res = string ? vsscanf((char *)stream, format, args) : vfscanf((FILE *)stream, format, args);

    va_end(args);
    return res;
}

// Assembly:
subq $0xd8, %rsp
leaq 0x20(%rsp), %r10
movq %rcx, 0x18(%r10)
movq %r8, 0x20(%r10)
movq %r9, 0x28(%r10)
testb %al, %al
je 0x3ed8d
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %r10, 0x10(%rsp)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, (%rsp)
movq %rsp, %rax
testl %edi, %edi
je 0x3edc4
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x3280
jmp 0x3edd2
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x3140
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O2/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;

    const Type *itemType = fastCompareContext->itemType;
    const int sign = fastCompareContext->ascending ? 1 : -1;
    Error *error = fastCompareContext->error;

    Slot lhsItem = {.ptrVal = (char *)a + fastCompareContext->offset};
    Slot rhsItem = {.ptrVal = (char *)b + fastCompareContext->offset};

    doDerefImpl(&lhsItem, itemType->kind, error);
    doDerefImpl(&rhsItem, itemType->kind, error);

    const int64_t itemDiff = doCompare(lhsItem, rhsItem, itemType, error); 
    return itemDiff == 0 ? 0 : itemDiff > 0 ? sign : -sign;   
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r12
movq (%rdx), %rbx
movq 0x8(%rdx), %r13
movb 0x10(%rdx), %r15b
movq 0x18(%rdx), %rcx
movl (%rbx), %ebp
testq %rdi, %rdi
je 0x65920
addq %r13, %r12
addl $-0x4, %ebp
cmpl $0x16, %ebp
ja 0x6585e
leaq 0x8ffe(%rip), %rax      # 0x6e818
movslq (%rax,%rbp,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movq (%r12), %r12
jmp 0x65877
movzbl (%r12), %r12d
jmp 0x65877
movslq (%r12), %r12
jmp 0x65877
movzwl (%r12), %r12d
jmp 0x65877
movl (%r12), %r12d
jmp 0x65877
movsbq (%r12), %r12
jmp 0x65877
movswq (%r12), %r12
jmp 0x65877
cvtss2sd (%r12), %xmm0
movq %xmm0, %r12
jmp 0x65877
movq 0x20(%rcx), %rdi
leaq 0x47a7(%rip), %rdx      # 0x6a010
pushq $-0x1
popq %rsi
xorl %eax, %eax
movq %rcx, %rbp
callq *0x8(%rcx)
movq %rbp, %rcx
movl (%rbx), %ebp
testq %r14, %r14
je 0x65944
addq %r13, %r14
addl $-0x4, %ebp
cmpl $0x16, %ebp
ja 0x658d0
leaq 0x8fe0(%rip), %rax      # 0x6e874
movslq (%rax,%rbp,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movq (%r14), %r14
jmp 0x658e9
movzbl (%r14), %r14d
jmp 0x658e9
movslq (%r14), %r14
jmp 0x658e9
movzwl (%r14), %r14d
jmp 0x658e9
movl (%r14), %r14d
jmp 0x658e9
movsbq (%r14), %r14
jmp 0x658e9
movswq (%r14), %r14
jmp 0x658e9
cvtss2sd (%r14), %xmm0
movq %xmm0, %r14
jmp 0x658e9
movq 0x20(%rcx), %rdi
leaq 0x4735(%rip), %rdx      # 0x6a010
pushq $-0x1
popq %rsi
xorl %eax, %eax
movq %rcx, %r13
callq *0x8(%rcx)
movq %r13, %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x3d32c
movzbl %r15b, %edx
decl %edx
orl $0x1, %edx
movl %edx, %ecx
negl %ecx
xorl %esi, %esi
testq %rax, %rax
cmovgl %edx, %ecx
cmovel %esi, %ecx
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x20(%rcx), %rdi
leaq 0x46d5(%rip), %rdx      # 0x6a000
pushq $-0x1
popq %rsi
xorl %eax, %eax
movq %rcx, (%rsp)
movq (%rsp), %rcx
callq *0x8(%rcx)
movq (%rsp), %rcx
jmp 0x65808
movq 0x20(%rcx), %rdi
leaq 0x46b1(%rip), %rdx      # 0x6a000
pushq $-0x1
popq %rsi
xorl %eax, %eax
movq %rcx, (%rsp)
movq (%rsp), %rcx
callq *0x8(%rcx)
movq (%rsp), %rcx
jmp 0x65882
// File: /workspace/github_c_makefile_star2_O2/lukexi[P]eglstreams-mini/acquire-thread-per-display.c
// Function: AcquireThreadMain
void* AcquireThreadMain(void* Arg) {
    egl_display* Display = Arg;

    while (1) {
        if (Display->PageFlipPending) {
            continue;
        }
        EGLint StreamState = EGLQueryStreamState(Display->DisplayDevice, Display->Stream);
        if (StreamState == EGL_STREAM_STATE_NEW_FRAME_AVAILABLE_KHR) {
            NEWTIME(StreamAcquire);
            EGLStreamAcquire(Display);
            ENDTIME(StreamAcquire);
        }

    }
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x2ae9(%rip), %r14      # 0x5028
leaq 0x2af5(%rip), %r15      # 0x503b
cmpb $0x0, 0x50(%rbx)
jne 0x2546
movq 0x30(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x356d
cmpl $0x3218, %eax           # imm = 0x3218
jne 0x2546
xorl %eax, %eax
callq 0x41c3
movss %xmm0, 0xc(%rsp)
movq %rbx, %rdi
callq 0x3026
xorl %eax, %eax
callq 0x41c3
subss 0xc(%rsp), %xmm0
mulss 0x2a7a(%rip), %xmm0     # 0x5004
cvtss2sd %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x2050
jmp 0x2546
// File: /workspace/github_c_makefile_star2_O2/lukexi[P]eglstreams-mini/src/edid.c
// Function: edid_parse_string
static char* edid_parse_string(const uint8_t *data) {
   char *text;
   int i;
   int replaced = 0;

   /* this is always 12 bytes, but we can't guarantee it's null
    * terminated or not junk. */
   text = strndup ((const char *) data, 12);

   /* remove insane chars */
   for (i = 0; text[i] != '\0'; i++) {
       if (text[i] == '\n' ||
           text[i] == '\r')
           text[i] = '\0';
   }

   /* nothing left? */
   if (text[0] == '\0') {
       free (text);
       text = NULL;
       goto out;
   }

   /* ensure string is printable */
   for (i = 0; text[i] != '\0'; i++) {
       if (!isprint (text[i])) {
           text[i] = '-';
           replaced++;
       }
   }

   /* if the string is random junk, ignore the string */
   if (replaced > 4) {
       free (text);
       text = NULL;
       goto out;
   }
out:
   return text;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0xc
popq %rsi
callq 0x2410
movq %rax, %rbx
movzbl (%rax), %ecx
cmpl $0xa, %ecx
je 0x2987
cmpl $0xd, %ecx
je 0x2987
testl %ecx, %ecx
jne 0x298a
jmp 0x298f
movb $0x0, (%rax)
incq %rax
jmp 0x2974
movb (%rbx), %bpl
testb %bpl, %bpl
je 0x29ca
callq 0x2250
movq (%rax), %rax
movq %rbx, %rcx
incq %rcx
xorl %edx, %edx
testb %bpl, %bpl
je 0x29c5
movsbq %bpl, %rsi
testb $0x40, 0x1(%rax,%rsi,2)
jne 0x29bd
movb $0x2d, -0x1(%rcx)
incl %edx
movb (%rcx), %bpl
incq %rcx
jmp 0x29a7
cmpl $0x5, %edx
jl 0x29d4
movq %rbx, %rdi
callq 0x2210
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/lukexi[P]eglstreams-mini/src/egl.c
// Function: ExtensionIsSupported
EGLBoolean ExtensionIsSupported(const char *extensionString,
                                const char *extension)
{
    const char *endOfExtensionString;
    const char *currentExtension = extensionString;
    size_t extensionLength;

    if ((extensionString == NULL) || (extension == NULL)) {
        return EGL_FALSE;
    }

    extensionLength = strlen(extension);

    endOfExtensionString = extensionString + strlen(extensionString);

    while (currentExtension < endOfExtensionString) {
        const size_t currentExtensionLength = strcspn(currentExtension, " ");
        if ((extensionLength == currentExtensionLength) &&
            (strncmp(extension, currentExtension,
                     extensionLength) == 0)) {
            return EGL_TRUE;
        }
        currentExtension += (currentExtensionLength + 1);
    }
    return EGL_FALSE;
}

// Assembly:
testq %rdi, %rdi
sete %dl
testq %rsi, %rsi
sete %cl
xorl %eax, %eax
orb %dl, %cl
jne 0x2a6a
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2230
movq %rax, %r12
movq %r15, %rdi
callq 0x2230
movq %rax, %r13
addq %r15, %r13
leaq 0x36db(%rip), %rbp      # 0x60fe
cmpq %r13, %r15
jae 0x2a55
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2390
movq %rax, %rbx
cmpq %rax, %r12
jne 0x2a4d
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2130
testl %eax, %eax
je 0x2a59
addq %rbx, %r15
incq %r15
jmp 0x2a23
xorl %eax, %eax
jmp 0x2a5c
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/lukexi[P]eglstreams-mini/src/egl.c
// Function: GetEglExtensionFunctionPointers
void GetEglExtensionFunctionPointers(void)
{
    pEglQueryDevicesEXT = (PFNEGLQUERYDEVICESEXTPROC)
        GetProcAddress("eglQueryDevicesEXT");

    pEglQueryDeviceStringEXT = (PFNEGLQUERYDEVICESTRINGEXTPROC)
        GetProcAddress("eglQueryDeviceStringEXT");

    pEglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)
        GetProcAddress("eglGetPlatformDisplayEXT");

    pEglGetOutputLayersEXT = (PFNEGLGETOUTPUTLAYERSEXTPROC)
        GetProcAddress("eglGetOutputLayersEXT");

    pEglCreateStreamKHR = (PFNEGLCREATESTREAMKHRPROC)
        GetProcAddress("eglCreateStreamKHR");

    pEglStreamConsumerOutputEXT = (PFNEGLSTREAMCONSUMEROUTPUTEXTPROC)
        GetProcAddress("eglStreamConsumerOutputEXT");

    pEglCreateStreamProducerSurfaceKHR = (PFNEGLCREATESTREAMPRODUCERSURFACEKHRPROC)
        GetProcAddress("eglCreateStreamProducerSurfaceKHR");

    pEglQueryStreamKHR = (PFNEGLQUERYSTREAMKHRPROC)
        GetProcAddress("eglQueryStreamKHR");

    pEglStreamConsumerAcquireAttribNV = (PFNEGLSTREAMCONSUMERACQUIREATTRIBNVPROC)
        GetProcAddress("eglStreamConsumerAcquireAttribNV");

    pEglStreamConsumerReleaseAttribNV = (PFNEGLSTREAMCONSUMERRELEASEATTRIBNVPROC)
        GetProcAddress("eglStreamConsumerReleaseAttribNV");

    pEglCreateStreamAttribNV = (PFNEGLCREATESTREAMATTRIBNVPROC)
        GetProcAddress("eglCreateStreamAttribNV");

    pEglOutputLayerAttribEXT = (PFNEGLOUTPUTLAYERATTRIBEXTPROC)
        GetProcAddress("eglOutputLayerAttribEXT");

    pEglQueryOutputLayerAttribEXT = (PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC)
        GetProcAddress("eglQueryOutputLayerAttribEXT");
}

// Assembly:
pushq %rax
leaq 0x2602(%rip), %rdi      # 0x5075
callq 0x2b65
movq %rax, 0x57b1(%rip)      # 0x8230
leaq 0x2602(%rip), %rdi      # 0x5088
callq 0x2b65
movq %rax, 0x57a6(%rip)      # 0x8238
leaq 0x2607(%rip), %rdi      # 0x50a0
callq 0x2b65
movq %rax, 0x579b(%rip)      # 0x8240
leaq 0x260d(%rip), %rdi      # 0x50b9
callq 0x2b65
movq %rax, 0x5790(%rip)      # 0x8248
leaq 0x2610(%rip), %rdi      # 0x50cf
callq 0x2b65
movq %rax, 0x5785(%rip)      # 0x8250
leaq 0x2610(%rip), %rdi      # 0x50e2
callq 0x2b65
movq %rax, 0x577a(%rip)      # 0x8258
leaq 0x2618(%rip), %rdi      # 0x50fd
callq 0x2b65
movq %rax, 0x576f(%rip)      # 0x8260
leaq 0x2627(%rip), %rdi      # 0x511f
callq 0x2b65
movq %rax, 0x5764(%rip)      # 0x8268
leaq 0x2626(%rip), %rdi      # 0x5131
callq 0x2b65
movq %rax, 0x5759(%rip)      # 0x8270
leaq 0x2634(%rip), %rdi      # 0x5152
callq 0x2b65
movq %rax, 0x574e(%rip)      # 0x8278
leaq 0x2642(%rip), %rdi      # 0x5173
callq 0x2b65
movq %rax, 0x5743(%rip)      # 0x8280
leaq 0x2647(%rip), %rdi      # 0x518b
callq 0x2b65
movq %rax, 0x5738(%rip)      # 0x8288
leaq 0x264c(%rip), %rdi      # 0x51a3
callq 0x2b65
movq %rax, 0x572d(%rip)      # 0x8290
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/lukexi[P]eglstreams-mini/src/egl.c
// Function: GetProcAddress
static void *GetProcAddress(const char *functionName)
{
    void *ptr = (void *) eglGetProcAddress(functionName);

    if (ptr == NULL) {
        Fatal("eglGetProcAddress(%s) failed.\n", functionName);
    }

    return ptr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x21d0
movq %rax, %rbx
testq %rax, %rax
jne 0x2b8a
leaq 0x2c66(%rip), %rdi      # 0x57e6
movq %r14, %rsi
xorl %eax, %eax
callq 0x40d8
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/lukexi[P]eglstreams-mini/src/egl.c
// Function: GetDrmFd
int GetDrmFd(EGLDeviceEXT device)
{
    const char *deviceExtensionString =
        pEglQueryDeviceStringEXT(device, EGL_EXTENSIONS);

    const char *drmDeviceFile;
    int fd;

    if (!ExtensionIsSupported(deviceExtensionString, "EGL_EXT_device_drm")) {
        Fatal("EGL_EXT_device_drm extension not found.\n");
    }

    drmDeviceFile = pEglQueryDeviceStringEXT(device, EGL_DRM_DEVICE_FILE_EXT);

    if (drmDeviceFile == NULL) {
        Fatal("No DRM device file found for EGL device.\n");
    }
    printf("Device file: %s\n", drmDeviceFile);

    // Open with nonblock so we can query for vsync events
    // using drmHandleEvent without blocking
    fd = open(drmDeviceFile, O_RDWR | O_NONBLOCK, 0);

    if (fd < 0) {
        Fatal("Unable to open DRM device file.\n");
    }

    return fd;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl $0x3055, %esi           # imm = 0x3055
callq *0x5547(%rip)           # 0x8238
leaq 0x2588(%rip), %rsi      # 0x5280
movq %rax, %rdi
callq 0x29e0
testl %eax, %eax
jne 0x2d12
leaq 0x25b9(%rip), %rdi      # 0x52c4
xorl %eax, %eax
callq 0x40d8
movq %rbx, %rdi
movl $0x3233, %esi           # imm = 0x3233
callq *0x5518(%rip)           # 0x8238
movq %rax, %rbx
testq %rax, %rax
jne 0x2d36
leaq 0x25be(%rip), %rdi      # 0x52ed
xorl %eax, %eax
callq 0x40d8
leaq 0x25da(%rip), %rdi      # 0x5317
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
movl $0x802, %esi            # imm = 0x802
xorl %edx, %edx
xorl %eax, %eax
callq 0x23e0
movl %eax, %ebx
testl %eax, %eax
jns 0x2d6c
leaq 0x25c3(%rip), %rdi      # 0x5328
xorl %eax, %eax
callq 0x40d8
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/lukexi[P]eglstreams-mini/src/egl.c
// Function: GetEglContext
EGLContext GetEglContext(EGLDisplay eglDpy, EGLConfig eglConfig) {
    /* Create an EGL context using the EGL config. */
    EGLint contextAttribs[] = { EGL_NONE };
    EGLContext eglContext =
        eglCreateContext(eglDpy, eglConfig, EGL_NO_CONTEXT, contextAttribs);

    if (eglContext == NULL) {
        Fatal("eglCreateContext() failed.\n");
    }
    return eglContext;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
leaq 0xc(%rsp), %rcx
movl $0x3038, (%rcx)         # imm = 0x3038
xorl %edx, %edx
callq 0x21a0
movq %rax, %rbx
testq %rax, %rax
jne 0x2fd2
leaq 0x25a8(%rip), %rdi      # 0x5573
xorl %eax, %eax
callq 0x40d8
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq