LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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
movb (%rsi), %al
testb %al, %al
je 0x1ab1d
leaq 0x1(%rbx), %rcx
movl $0x1505, %ebp           # imm = 0x1505
movl %ebp, %edx
shll $0x5, %edx
addl %ebp, %edx
movsbl %al, %ebp
addl %edx, %ebp
movb (%rcx), %al
incq %rcx
testb %al, %al
jne 0x1ab06
jmp 0x1ab22
movl $0x1505, %ebp           # imm = 0x1505
movslq (%r14), %r12
testq %r12, %r12
jle 0x1ab52
xorl %r13d, %r13d
movq 0x10(%r14,%r13,8), %r15
cmpl %ebp, 0x100(%r15)
jne 0x1ab4a
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3210
testl %eax, %eax
je 0x1ab55
incq %r13
cmpq %r13, %r12
jne 0x1ab2d
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_O3/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 0x1aae6
testq %rax, %rax
je 0x1aba5
movq 0x18(%r13), %rcx
movq 0x20(%rcx), %rdi
leaq 0x5d0fc(%rip), %rsi     # 0x77c9a
movq %r12, %rdx
xorl %eax, %eax
callq *(%rcx)
cmpl $0x11, (%rbx)
jl 0x1abbd
movq 0x18(%r13), %rcx
movq 0x20(%rcx), %rdi
leaq 0x5d0f8(%rip), %rsi     # 0x77cb1
xorl %eax, %eax
callq *(%rcx)
movq 0x10(%r13), %rdi
movl $0x118, %esi            # imm = 0x118
callq 0x7a70
movq %rax, %r13
movl $0xff, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x3080
movb $0x0, 0xff(%r13)
movb (%r12), %cl
testb %cl, %cl
je 0x1ac0f
incq %r12
movl $0x1505, %eax           # imm = 0x1505
movl %eax, %edx
shll $0x5, %edx
addl %eax, %edx
movsbl %cl, %eax
addl %edx, %eax
movb (%r12), %cl
incq %r12
testb %cl, %cl
jne 0x1abf6
jmp 0x1ac14
movl $0x1505, %eax           # imm = 0x1505
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_O3/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 %r12
pushq %rbx
testl %edx, %edx
js 0x1ac90
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
incl %ebx
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x10(%r14,%r12,8), %rax
movq 0x108(%rax), %rsi
movq %r15, %rdi
callq 0x19e29
cltq
addq $0x7, %rax
leal 0x7(%rax), %ecx
testq %rax, %rax
cmovnsl %eax, %ecx
andl $-0x8, %ecx
addl %ecx, %ebp
incq %r12
cmpq %r12, %rbx
jne 0x1ac5e
jmp 0x1ac92
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
movslq (%rsi), %rax
leaq 0x18(,%rax,8), %rsi
callq 0x7a70
movq %rax, %r15
movslq (%rbx), %rax
movq %rax, (%r15)
movq 0x90(%rbx), %rcx
movl (%rcx), %ecx
addl $-0x12, %ecx
cmpl $0x6, %ecx
ja 0x1ad1b
movl %ecx, %ecx
leaq 0x5cd8b(%rip), %rdx     # 0x77aa0
movq (%rdx,%rcx,8), %rcx
jmp 0x1ad1d
xorl %ecx, %ecx
movq %rcx, 0x8(%r15)
leal -0x1(%rax), %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ac43
cltq
shrq $0x3, %rax
movq %rax, 0x10(%r15)
cmpl $0x0, (%rbx)
jle 0x1ad7f
xorl %r12d, %r12d
movq %r14, %rdi
movq %rbx, %rsi
movl %r12d, %edx
callq 0x1ac43
movl %eax, %ebp
movl (%rbx), %edx
decl %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1ac43
subl %ebp, %eax
addl $0x10, %eax
cltq
shrq $0x3, %rax
addq $-0x2, %rax
movq %rax, 0x18(%r15,%r12,8)
incq %r12
movslq (%rbx), %rax
cmpq %rax, %r12
jl 0x1ad41
movq %r15, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0x10, %esi
callq 0x7a70
movq %r14, (%rax)
movslq %ebx, %rcx
movq %rcx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/vtereshkov[P]umka-lang/src/umka_types.c
// Function: typeDefaultParamEqual
static bool typeDefaultParamEqual(const Const *left, const Const *right, const Type *type)
{
    if (typeOrdinal(type) || type->kind == TYPE_FN)
        return left->intVal == right->intVal;

    if (typeReal(type))
        return left->realVal == right->realVal;

    if (type->kind == TYPE_WEAKPTR)
        return left->weakPtrVal == right->weakPtrVal;

    if (!left->ptrVal || !right->ptrVal)
        return left->ptrVal == right->ptrVal;

    if (type->kind == TYPE_PTR)
        return left->ptrVal == right->ptrVal;

    if (type->kind == TYPE_STR)
        return strcmp((char *)left->ptrVal, (char *)right->ptrVal) == 0;

    if (type->kind == TYPE_ARRAY || type->kind == TYPE_STRUCT || type->kind == TYPE_CLOSURE)
        return memcmp(left->ptrVal, right->ptrVal, type->size) == 0;

    return false;
}

// Assembly:
pushq %rax
movl (%rdx), %ecx
leal -0x4(%rcx), %eax
cmpl $0xa, %eax
setae %al
cmpl $0x1a, %ecx
setne %r8b
testb %al, %r8b
jne 0x1b294
movq (%rdi), %rax
cmpq (%rsi), %rax
sete %al
jmp 0x1b2af
movl %ecx, %eax
andl $-0x2, %eax
cmpl $0xe, %eax
jne 0x1b2b1
movsd (%rsi), %xmm0
cmpeqsd (%rdi), %xmm0
movq %xmm0, %rax
andl $0x1, %eax
popq %rcx
retq
cmpl $0x11, %ecx
je 0x1b289
movq (%rdi), %rdi
testq %rdi, %rdi
sete %al
movq (%rsi), %rsi
testq %rsi, %rsi
sete %r8b
orb %al, %r8b
cmpb $0x1, %r8b
jne 0x1b2d7
cmpq %rsi, %rdi
jmp 0x1b28f
xorl %eax, %eax
addl $-0x10, %ecx
cmpl $0x8, %ecx
ja 0x1b2af
leaq 0x5c790(%rip), %r8      # 0x77a78
movslq (%r8,%rcx,4), %rcx
addq %r8, %rcx
jmpq *%rcx
movslq 0xc0(%rdx), %rdx
callq 0x32c0
jmp 0x1b304
callq 0x3210
testl %eax, %eax
jmp 0x1b28f
// File: /workspace/github_c_makefile_star2_O3/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)
cmpq %rsi, %rdi
jae 0x1b40d
movq %r8, %r14
movq %rcx, %r15
movq %rdi, %rbx
movslq %edx, %r13
movq %r13, %rax
negq %rax
movq %rax, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq %rbx, %rbp
movq %rsi, %r12
movq %rbp, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *%r15
cmpq 0x8(%rsp), %rbp
jae 0x1b366
testl %eax, %eax
jg 0x1b366
addq %r13, %rbp
jmp 0x1b345
addq 0x10(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq *%r15
cmpq %rbx, %r12
jbe 0x1b37b
testl %eax, %eax
jg 0x1b361
cmpq %r12, %rbp
jae 0x1b3ae
movq (%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3260
movq %rbp, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3260
movq %r12, %rdi
movq (%rsp), %rsi
movq %r13, %rdx
callq 0x3260
jmp 0x1b345
movq (%rsp), %rbp
movq %rbp, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x3260
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x3260
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x3260
movq 0x10(%rsp), %rax
leaq (%r12,%rax), %rsi
movq %rbx, %rdi
movl %r13d, %edx
movq %r15, %rcx
movq %r14, %r8
movq %rbp, %r9
callq 0x1b308
addq %r13, %r12
movq %r12, %rbx
movq 0x8(%rsp), %rsi
cmpq %rsi, %r12
jb 0x1b33f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x44108
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 0x440f7
movq %rdx, %r14
leaq 0x8(%r15), %r13
movq 0x80(%rdi), %r12
leaq 0x3523a(%rip), %rbx     # 0x79254
movq 0x8(%rax), %rbp
testq %rbp, %rbp
je 0x440d7
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 0x4408e
movslq (%rbx,%rax,4), %rax
addq %rbx, %rax
jmpq *%rax
movq (%rbp), %rbp
jmp 0x440c0
movzbl (%rbp), %ebp
jmp 0x440c0
movslq (%rbp), %rbp
jmp 0x440c0
movzwl (%rbp), %ebp
jmp 0x440c0
movl (%rbp), %ebp
jmp 0x440c0
movsbq (%rbp), %rbp
jmp 0x440c0
movswq (%rbp), %rbp
jmp 0x440c0
xorps %xmm0, %xmm0
cvtss2sd (%rbp), %xmm0
movq %xmm0, %rbp
jmp 0x440c0
movq 0x20(%r12), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
leaq 0x31f71(%rip), %rdx     # 0x76010
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 %rbp, %rsi
movq %r12, %rcx
callq 0x45be0
testq %rax, %rax
jle 0x440e0
movq (%r13), %rax
addq $0x20, %rax
movq %rax, %r13
jmp 0x440ea
movq (%r13), %r13
jns 0x4410b
addq $0x18, %r13
movq (%r13), %rax
testq %rax, %rax
jne 0x4401a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
testq %r13, %r13
je 0x440f7
movq 0x10(%r13), %rax
jmp 0x440f9
// File: /workspace/github_c_makefile_star2_O3/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 0x47687
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 0x476c1
movslq %edx, %rsi
movq %rsp, %rax
movq %r10, %rdi
movq %rcx, %rdx
movq %rax, %rcx
callq 0x30e0
jmp 0x476cf
movq %rsp, %rdx
movq %r10, %rdi
movq %rcx, %rsi
callq 0x3340
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4772a
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 0x47761
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x3280
jmp 0x4776f
movq %rsi, %rdi
movq %rdx, %rsi
movq %rax, %rdx
callq 0x3140
addq $0xd8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x71a06
addq %r13, %r12
addl $-0x4, %ebp
cmpl $0x16, %ebp
ja 0x7193d
leaq 0x9627(%rip), %rax      # 0x7af20
movslq (%rax,%rbp,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movq (%r12), %r12
jmp 0x71958
movzbl (%r12), %r12d
jmp 0x71958
movslq (%r12), %r12
jmp 0x71958
movzwl (%r12), %r12d
jmp 0x71958
movl (%r12), %r12d
jmp 0x71958
movsbq (%r12), %r12
jmp 0x71958
movswq (%r12), %r12
jmp 0x71958
cvtss2sd (%r12), %xmm0
movq %xmm0, %r12
jmp 0x71958
movq 0x20(%rcx), %rdi
leaq 0x46c8(%rip), %rdx      # 0x76010
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movq %rcx, %rbp
callq *0x8(%rcx)
movq %rbp, %rcx
movl (%rbx), %ebp
testq %r14, %r14
je 0x71a1b
addq %r13, %r14
addl $-0x4, %ebp
cmpl $0x16, %ebp
ja 0x719b4
leaq 0x9607(%rip), %rax      # 0x7af7c
movslq (%rax,%rbp,4), %rdx
addq %rax, %rdx
jmpq *%rdx
movq (%r14), %r14
jmp 0x719cf
movzbl (%r14), %r14d
jmp 0x719cf
movslq (%r14), %r14
jmp 0x719cf
movzwl (%r14), %r14d
jmp 0x719cf
movl (%r14), %r14d
jmp 0x719cf
movsbq (%r14), %r14
jmp 0x719cf
movswq (%r14), %r14
jmp 0x719cf
xorps %xmm0, %xmm0
cvtss2sd (%r14), %xmm0
movq %xmm0, %r14
jmp 0x719cf
movq 0x20(%rcx), %rdi
leaq 0x4651(%rip), %rdx      # 0x76010
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
xorl %eax, %eax
movq %rcx, %r13
callq *0x8(%rcx)
movq %r13, %rcx
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x45be0
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 %rcx, %rdi
movq %rcx, (%rsp)
callq 0x6d77
movq (%rsp), %rcx
jmp 0x718e7
movq %rcx, %rdi
movq %rcx, (%rsp)
callq 0x6d8d
movq (%rsp), %rcx
jmp 0x71963
// File: /workspace/github_c_makefile_star2_O3/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 0x2ac9(%rip), %r14      # 0x5028
leaq 0x2ad5(%rip), %r15      # 0x503b
cmpb $0x0, 0x50(%rbx)
jne 0x2566
movq 0x30(%rbx), %rdi
movq 0x40(%rbx), %rsi
callq 0x35fe
cmpl $0x3218, %eax           # imm = 0x3218
jne 0x2566
xorl %eax, %eax
callq 0x4271
movss %xmm0, 0xc(%rsp)
movq %rbx, %rdi
callq 0x3082
xorl %eax, %eax
callq 0x4271
subss 0xc(%rsp), %xmm0
mulss 0x2a5a(%rip), %xmm0     # 0x5004
cvtss2sd %xmm0, %xmm0
movq %r14, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x2050
jmp 0x2566
// File: /workspace/github_c_makefile_star2_O3/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
movl $0xc, %esi
callq 0x2410
movq %rax, %rbx
movzbl (%rax), %ecx
cmpl $0xa, %ecx
je 0x29c5
cmpl $0xd, %ecx
je 0x29c5
testl %ecx, %ecx
jne 0x29c8
jmp 0x29cd
movb $0x0, (%rax)
incq %rax
jmp 0x29b2
movb (%rbx), %bpl
testb %bpl, %bpl
je 0x2a06
callq 0x2250
movq (%rax), %rax
movq %rbx, %rcx
incq %rcx
xorl %edx, %edx
movsbq %bpl, %rsi
testb $0x40, 0x1(%rax,%rsi,2)
jne 0x29f6
movb $0x2d, -0x1(%rcx)
incl %edx
movb (%rcx), %bpl
incq %rcx
testb %bpl, %bpl
jne 0x29e5
cmpl $0x5, %edx
jl 0x2a10
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_O3/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
xorl %ebx, %ebx
orb %al, %cl
jne 0x2a9d
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x2230
movq %rax, %r12
movq %r15, %rdi
callq 0x2230
testq %rax, %rax
jle 0x2a9d
movq %rax, %r13
addq %r15, %r13
leaq 0x369a(%rip), %rbp      # 0x60fe
movq %r15, %rdi
movq %rbp, %rsi
callq 0x2390
movq %rax, %rbx
cmpq %rax, %r12
jne 0x2a89
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2130
testl %eax, %eax
je 0x2a98
addq %rbx, %r15
incq %r15
cmpq %r13, %r15
jb 0x2a64
xorl %ebx, %ebx
jmp 0x2a9d
movl $0x1, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x25bf(%rip), %rdi      # 0x5075
callq 0x2ba8
movq %rax, 0x576e(%rip)      # 0x8230
leaq 0x25bf(%rip), %rdi      # 0x5088
callq 0x2ba8
movq %rax, 0x5763(%rip)      # 0x8238
leaq 0x25c4(%rip), %rdi      # 0x50a0
callq 0x2ba8
movq %rax, 0x5758(%rip)      # 0x8240
leaq 0x25ca(%rip), %rdi      # 0x50b9
callq 0x2ba8
movq %rax, 0x574d(%rip)      # 0x8248
leaq 0x25cd(%rip), %rdi      # 0x50cf
callq 0x2ba8
movq %rax, 0x5742(%rip)      # 0x8250
leaq 0x25cd(%rip), %rdi      # 0x50e2
callq 0x2ba8
movq %rax, 0x5737(%rip)      # 0x8258
leaq 0x25d5(%rip), %rdi      # 0x50fd
callq 0x2ba8
movq %rax, 0x572c(%rip)      # 0x8260
leaq 0x25e4(%rip), %rdi      # 0x511f
callq 0x2ba8
movq %rax, 0x5721(%rip)      # 0x8268
leaq 0x25e3(%rip), %rdi      # 0x5131
callq 0x2ba8
movq %rax, 0x5716(%rip)      # 0x8270
leaq 0x25f1(%rip), %rdi      # 0x5152
callq 0x2ba8
movq %rax, 0x570b(%rip)      # 0x8278
leaq 0x25ff(%rip), %rdi      # 0x5173
callq 0x2ba8
movq %rax, 0x5700(%rip)      # 0x8280
leaq 0x2604(%rip), %rdi      # 0x518b
callq 0x2ba8
movq %rax, 0x56f5(%rip)      # 0x8288
leaq 0x2609(%rip), %rdi      # 0x51a3
callq 0x2ba8
movq %rax, 0x56ea(%rip)      # 0x8290
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2bcd
leaq 0x2c23(%rip), %rdi      # 0x57e6
movq %r14, %rsi
xorl %eax, %eax
callq 0x4184
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 *0x54f0(%rip)           # 0x8238
leaq 0x2531(%rip), %rsi      # 0x5280
movq %rax, %rdi
callq 0x2a1c
testl %eax, %eax
jne 0x2d69
leaq 0x2562(%rip), %rdi      # 0x52c4
xorl %eax, %eax
callq 0x4184
movq %rbx, %rdi
movl $0x3233, %esi           # imm = 0x3233
callq *0x54c1(%rip)           # 0x8238
movq %rax, %rbx
testq %rax, %rax
jne 0x2d8d
leaq 0x2567(%rip), %rdi      # 0x52ed
xorl %eax, %eax
callq 0x4184
leaq 0x2583(%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 0x2dc3
leaq 0x256c(%rip), %rdi      # 0x5328
xorl %eax, %eax
callq 0x4184
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x302e
leaq 0x254c(%rip), %rdi      # 0x5573
xorl %eax, %eax
callq 0x4184
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/egl.c
// Function: EGLStreamAcquire
void EGLStreamAcquire(egl_display* Display) {
    // Ask the Display's EGLStream to acquire the new frame,
    // and pass a data pointer to pass along to drmHandleEvent
    EGLAttrib AcquireAttribs[] = {
        EGL_DRM_FLIP_EVENT_DATA_NV, (EGLAttrib)Display,
        EGL_NONE
    };

    EGLBoolean Result = pEglStreamConsumerAcquireAttribNV(
        Display->DisplayDevice,
        Display->Stream,
        AcquireAttribs);
    if (Result == EGL_FALSE) {
        EGLCheck("eglStreamConsumerAcquireAttribNV");
    }
    Display->PageFlipPending = true;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movq %rsp, %rdx
movq $0x333e, (%rdx)         # imm = 0x333E
movq %rdi, 0x8(%rdx)
movq $0x3038, 0x10(%rdx)     # imm = 0x3038
movq 0x30(%rdi), %rdi
movq 0x40(%rbx), %rsi
callq *0x51c2(%rip)           # 0x8270
testl %eax, %eax
jne 0x30be
leaq 0x2078(%rip), %rdi      # 0x5131
callq 0x30c8
movb $0x1, 0x50(%rbx)
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/egl.c
// Function: EGLSwapDisplay
void EGLSwapDisplay(egl_display* Display) {

    NEWTIME(eglSwapBuffers);
    eglSwapBuffers(Display->DisplayDevice, Display->Surface);
    ENDTIME(eglSwapBuffers);

    NEWTIME(StreamAcquire);
    EGLStreamAcquire(Display);
    ENDTIME(StreamAcquire);


}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
callq 0x4271
movss %xmm0, 0x4(%rsp)
movq 0x20(%rbx), %rsi
movq 0x30(%rbx), %rdi
callq 0x2270
xorl %eax, %eax
callq 0x4271
subss 0x4(%rsp), %xmm0
mulss 0x1eae(%rip), %xmm0     # 0x5004
cvtss2sd %xmm0, %xmm0
leaq 0x1ec7(%rip), %r14      # 0x5028
leaq 0x1eeb(%rip), %rsi      # 0x5053
movq %r14, %rdi
movb $0x1, %al
callq 0x2050
xorl %eax, %eax
callq 0x4271
movss %xmm0, 0x4(%rsp)
movq %rbx, %rdi
callq 0x3082
xorl %eax, %eax
callq 0x4271
subss 0x4(%rsp), %xmm0
mulss 0x1e68(%rip), %xmm0     # 0x5004
cvtss2sd %xmm0, %xmm0
leaq 0x1e94(%rip), %rsi      # 0x503b
movq %r14, %rdi
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x2050
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/egl.c
// Function: InitGLEW
void InitGLEW() {
    // Initialize GLEW
    glewExperimental = GL_TRUE;
    if(glewInit() != GLEW_OK) {
        Fatal("Could not init glew.\n");
    }
    GLenum GLEWError = glGetError();
    if (GLEWError) {
        printf("GLEW returned error: %i\n", GLEWError);
    }
}

// Assembly:
pushq %rax
movq 0x4b7c(%rip), %rax      # 0x7fc8
movb $0x1, (%rax)
callq 0x2290
testl %eax, %eax
je 0x3466
leaq 0x2238(%rip), %rdi      # 0x5697
xorl %eax, %eax
callq 0x4184
callq 0x2110
testl %eax, %eax
je 0x3480
leaq 0x2237(%rip), %rdi      # 0x56ad
movl %eax, %esi
xorl %eax, %eax
popq %rcx
jmp 0x2050
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/egl.c
// Function: SetupEGL
egl_state* SetupEGL() {
    egl_state* EGL = calloc(1, sizeof(egl_state));

    // Setup global EGL state
    GetEglExtensionFunctionPointers();

    EGL->Device = GetEglDevice();

    int drmFd = GetDrmFd(EGL->Device);
    // Set up EGL state for each connected display
    kms_plane* Planes = SetDisplayModes(drmFd, &EGL->DisplaysCount);

    EGL->DRMFD         = drmFd;
    EGL->DisplayDevice = GetEglDisplay(EGL->Device, drmFd);
    EGL->Config        = GetEglConfig(EGL->DisplayDevice);
    EGL->RootContext   = GetEglContext(EGL->DisplayDevice, EGL->Config);


    EGL->Displays     = SetupEGLDisplays(EGL->DisplayDevice,
        EGL->Config, EGL->RootContext, Planes, EGL->DisplaysCount);

    EGLBoolean ret = eglMakeCurrent(EGL->DisplayDevice,
        EGL->Displays->Surface, EGL->Displays->Surface,
        EGL->RootContext);
    if (!ret) Fatal("Couldn't make main context current\n");

    InitGLEW();

    // Disable EGL VSync
    // (seems to have no effect)
    for (int DisplayIndex = 0; DisplayIndex < EGL->DisplaysCount; DisplayIndex++) {
        egl_display* Display = &EGL->Displays[DisplayIndex];
        eglMakeCurrent(Display->DisplayDevice,
            Display->Surface, Display->Surface,
            Display->Context);
        eglSwapInterval(Display->DisplayDevice, 0);
    }

    // Create a drmEventContext configured to
    // call our PageFlipEventHandler function
    // when a page flip occurs
    EGL->DRMEventContext.page_flip_handler = PageFlipEventHandler;
    // EGL->DRMEventContext.vblank_handler    = VBlankEventHandler;
    EGL->DRMEventContext.version           = 2;

    return EGL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl $0x1, %edi
movl $0x60, %esi
callq 0x2370
movq %rax, %rbx
callq 0x2aae
callq 0x2bd8
movq %rax, 0x20(%rbx)
movq %rax, %rdi
callq 0x2d39
movl %eax, %ebp
leaq 0x8(%rbx), %r14
movl %eax, %edi
movq %r14, %rsi
callq 0x364c
movq %rax, %r15
movl %ebp, 0x30(%rbx)
movq 0x20(%rbx), %rdi
movl %ebp, %esi
callq 0x2dc7
movq %rax, 0x18(%rbx)
movq %rax, %rdi
callq 0x2ec2
movq %rax, 0x28(%rbx)
movq 0x18(%rbx), %rdi
movq %rax, %rsi
callq 0x3001
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rdi
movq 0x28(%rbx), %rsi
movl 0x8(%rbx), %r8d
movq %rax, %rdx
movq %r15, %rcx
callq 0x31b8
movq %rax, (%rbx)
movq 0x10(%rbx), %rcx
movq 0x18(%rbx), %rdi
movq 0x20(%rax), %rdx
movq %rdx, %rsi
callq 0x21b0
testl %eax, %eax
jne 0x3533
leaq 0x219a(%rip), %rdi      # 0x56c6
xorl %eax, %eax
callq 0x4184
callq 0x3444
cmpl $0x0, (%r14)
jle 0x357b
movl $0x30, %r14d
xorl %r15d, %r15d
movq (%rbx), %r12
movq (%r12,%r14), %rdi
movq -0x10(%r12,%r14), %rdx
movq -0x8(%r12,%r14), %rcx
movq %rdx, %rsi
callq 0x21b0
movq (%r12,%r14), %rdi
xorl %esi, %esi
callq 0x22e0
incq %r15
movslq 0x8(%rbx), %rax
addq $0x58, %r14
cmpq %rax, %r15
jl 0x3547
leaq 0x17(%rip), %rax        # 0x3599
movq %rax, 0x48(%rbx)
movl $0x2, 0x38(%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/egl.c
// Function: PageFlipEventHandler
static void PageFlipEventHandler(int fd, unsigned int frame,
                    unsigned int sec, unsigned int usec,
                    void *data)
{
    egl_display* Display = (egl_display*)data;
    (void)fd; (void)frame; (void)sec; (void)usec; (void)data;
    Display->PageFlipPending = false;

    float Now = GetTime();
    if (Display->LastPageFlip > 0) {
        printf("%20s page flip interval: %.2fms\n",
            Display->EDID->MonitorName,
            (Now - Display->LastPageFlip) * 1000);
    }

    Display->LastPageFlip = Now;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movb $0x0, 0x50(%r8)
xorl %eax, %eax
callq 0x4271
movaps %xmm0, %xmm2
movss 0x54(%rbx), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x35f3
movq (%rbx), %rax
movq (%rax), %rsi
movaps %xmm2, %xmm1
subss %xmm0, %xmm1
mulss 0x1a32(%rip), %xmm1     # 0x5004
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
leaq 0x2225(%rip), %rdi      # 0x5805
movb $0x1, %al
movss %xmm2, 0xc(%rsp)
callq 0x2050
movss 0xc(%rsp), %xmm2
movss %xmm2, 0x54(%rbx)
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/egl.c
// Function: EGLQueryStreamState
EGLint EGLQueryStreamState(EGLDisplay eglDpy, EGLStreamKHR eglStream) {
     EGLint streamState;
     EGLBoolean r = pEglQueryStreamKHR(eglDpy, eglStream, EGL_STREAM_STATE_KHR, &streamState);
     if (r == EGL_FALSE) {
         EGLCheck("Query Stream");
     }

     return streamState;
 }

// Assembly:
pushq %rax
leaq 0x4(%rsp), %rcx
movl $0x3214, %edx           # imm = 0x3214
callq *0x4c59(%rip)           # 0x8268
testl %eax, %eax
jne 0x361f
leaq 0x20d0(%rip), %rdi      # 0x56ea
callq 0x30c8
movl 0x4(%rsp), %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/kms.c
// Function: AssignPropertyIDsOneType
static void AssignPropertyIDsOneType(int drmFd,
                                     uint32_t objectID,
                                     uint32_t objectType,
                                     struct PropertyIDAddresses *table,
                                     size_t tableLen)
{
    uint32_t i;
    drmModeObjectPropertiesPtr pModeObjectProperties =
        drmModeObjectGetProperties(drmFd, objectID, objectType);

    if (pModeObjectProperties == NULL) {
        Fatal("Unable to query mode object properties.\n");
    }

    for (i = 0; i < pModeObjectProperties->count_props; i++) {

        uint32_t j;
        drmModePropertyPtr pProperty =
            drmModeGetProperty(drmFd, pModeObjectProperties->props[i]);

        if (pProperty == NULL) {
            Fatal("Unable to query property.\n");
        }
        for (j = 0; j < tableLen; j++) {
            if (strcmp(table[j].name, pProperty->name) == 0) {
                *(table[j].ptr) = pProperty->prop_id;
                break;
            }
        }

        drmModeFreeProperty(pProperty);
    }

    drmModeFreeObjectProperties(pModeObjectProperties);

    for (i = 0; i < tableLen; i++) {
        if (*(table[i].ptr) == 0) {
            Fatal("Unable to find property ID for \'%s\'.\n", table[i].name);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %edi, 0xc(%rsp)
callq 0x2190
movq %rax, %r15
testq %rax, %rax
jne 0x4095
leaq 0x200c(%rip), %rdi      # 0x609a
xorl %eax, %eax
callq 0x4184
cmpl $0x0, (%r15)
je 0x4131
xorl %ebp, %ebp
movq %r15, 0x10(%rsp)
movq 0x8(%r15), %rax
movl (%rax,%rbp,4), %esi
movl 0xc(%rsp), %edi
callq 0x2170
movq %rax, (%rsp)
testq %rax, %rax
jne 0x40cd
leaq 0x1e39(%rip), %rdi      # 0x5eff
xorl %eax, %eax
callq 0x4184
testq %rbx, %rbx
je 0x4114
movq (%rsp), %r13
addq $0x8, %r13
movl $0x1, %r15d
xorl %r12d, %r12d
shlq $0x4, %r12
movq (%r14,%r12), %rdi
movq %r13, %rsi
callq 0x2350
testl %eax, %eax
je 0x4104
movl %r15d, %r12d
incl %r15d
cmpq %rbx, %r12
jb 0x40e3
jmp 0x4114
addq %r14, %r12
movq (%rsp), %rax
movl (%rax), %eax
movq 0x8(%r12), %rcx
movl %eax, (%rcx)
movq (%rsp), %rdi
callq 0x2260
incq %rbp
movq 0x10(%rsp), %r15
movl (%r15), %eax
cmpq %rax, %rbp
jb 0x40a6
movq %r15, %rdi
callq 0x2150
testq %rbx, %rbx
je 0x4173
movl $0x1, %ebp
leaq 0x1f79(%rip), %r15      # 0x60c3
xorl %eax, %eax
shlq $0x4, %rax
movq 0x8(%r14,%rax), %rcx
cmpl $0x0, (%rcx)
jne 0x416a
addq %r14, %rax
movq (%rax), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x4184
movl %ebp, %eax
incl %ebp
cmpq %rbx, %rax
jb 0x414c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/utils.c
// Function: Fatal
void Fatal(const char *format, ...)
{
    va_list ap;

    fprintf(stderr, "ERROR: ");

    va_start(ap, format);
    vfprintf(stderr, format, ap);
    va_end(ap);

    exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq %rsi, 0x8(%r14)
movq %rdx, 0x10(%r14)
movq %rcx, 0x18(%r14)
movq %r8, 0x20(%r14)
movq %r9, 0x28(%r14)
testb %al, %al
je 0x41e7
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 0x3e02(%rip), %r15      # 0x7ff0
movq (%r15), %rcx
leaq 0x1f00(%rip), %rdi      # 0x60f8
movl $0x7, %esi
movl $0x1, %edx
callq 0x23c0
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
movq %r14, 0x10(%rdx)
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x21c0
movl $0x1, %edi
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/utils.c
// Function: GetTime
float GetTime()
{
    static struct timeval InitialTime = {0, 0};
    if (InitialTime.tv_sec == 0)
    {
        gettimeofday(&InitialTime, NULL);
    }
    struct timeval Now;
    gettimeofday(&Now, NULL);

    struct timeval TimeSinceStart = { Now.tv_sec - InitialTime.tv_sec, Now.tv_usec - InitialTime.tv_usec };

    return (TimeSinceStart.tv_sec + (TimeSinceStart.tv_usec / 1000000.0));
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
cmpq $0x0, 0x401a(%rip)      # 0x8298
jne 0x428e
leaq 0x4011(%rip), %rdi      # 0x8298
xorl %esi, %esi
callq 0x20f0
movq %rsp, %rbx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x20f0
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
subq 0x3fef(%rip), %rax      # 0x8298
subq 0x3ff0(%rip), %rcx      # 0x82a0
cvtsi2sd %rax, %xmm0
cvtsi2sd %rcx, %xmm1
divsd 0x1e2e(%rip), %xmm1     # 0x60f0
addsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/utils.c
// Function: TickFPS
void TickFPS(fps* FPS) {
    struct timeval Now;
    gettimeofday(&Now, NULL);

    FPS->Frames++;

    int NowSecond = Now.tv_sec;
    if (NowSecond > FPS->CurrentSecond) {
        printf("%40s: %i FPS\n", FPS->Name, FPS->Frames);
        FPS->Frames = 0;
        FPS->CurrentSecond = NowSecond;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x20f0
movl (%rbx), %edx
movl 0x4(%rbx), %eax
incl %edx
movl %edx, (%rbx)
movl (%r14), %ebp
cmpl %ebp, %eax
jge 0x4341
movq 0x8(%rbx), %rsi
leaq 0x1dd2(%rip), %rdi      # 0x6103
xorl %eax, %eax
callq 0x2050
movl $0x0, (%rbx)
movl %ebp, 0x4(%rbx)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/utils.c
// Function: GLCheck
void GLCheck(const char* name) {
    GLenum err = glGetError();
    if (err != GL_NO_ERROR) {
        printf("%s: ", name);
        switch (err) {
            case GL_INVALID_ENUM: printf("Invalid enum\n");
                break;
            case GL_INVALID_VALUE: printf("Invalid value\n");
                break;
            case GL_INVALID_OPERATION: printf("Invalid operation\n");
                break;
            case GL_INVALID_FRAMEBUFFER_OPERATION: printf("Invalid framebuffer op\n");
                break;
            case GL_OUT_OF_MEMORY: printf("GL Out of memory\n");
                break;
        }
        exit(1);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x2110
testl %eax, %eax
jne 0x4362
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movl %eax, %ebx
leaq 0x1476(%rip), %rdi      # 0x57e1
movq %r14, %rsi
xorl %eax, %eax
callq 0x2050
leal -0x500(%rbx), %eax
cmpl $0x6, %eax
ja 0x439f
movl $0x67, %ecx
btl %ebx, %ecx
jae 0x439f
movl %eax, %eax
leaq 0x1ded(%rip), %rcx      # 0x6180
movslq (%rcx,%rax,4), %rdi
addq %rcx, %rdi
callq 0x20b0
movl $0x1, %edi
callq 0x20e0
// File: /workspace/github_c_makefile_star2_O3/lukexi[P]eglstreams-mini/src/utils.c
// Function: EnableGLDebug
void EnableGLDebug() {
    glDebugMessageCallback(DebugCallback, NULL);
    glDebugMessageControl(GL_DONT_CARE,
        GL_DONT_CARE, GL_DONT_CARE, 0, 0, GL_TRUE);
    glEnable(GL_DEBUG_OUTPUT);
}

// Assembly:
pushq %rax
movq 0x3c24(%rip), %rax      # 0x7fe8
leaq -0x22(%rip), %rdi       # 0x43a9
xorl %esi, %esi
callq *(%rax)
movq 0x3bea(%rip), %rax      # 0x7fc0
movl $0x1100, %edi           # imm = 0x1100
movl $0x1100, %esi           # imm = 0x1100
movl $0x1100, %edx           # imm = 0x1100
xorl %ecx, %ecx
xorl %r8d, %r8d
movl $0x1, %r9d
callq *(%rax)
movl $0x92e0, %edi           # imm = 0x92E0
popq %rax
jmp 0x2040
// File: /workspace/github_c_makefile_star2_O3/endeav0r[P]hvm/src/hvm.c
// Function: main
int main (int argc, char * argv [])
{
    struct _vm * vm;
    int error;

    if (argc != 2) {
        fprintf(stderr, "Usage: %s <hvm program>\n", argv[0]);
        return 0;
    }

    signal(SIGINT, int_handler);

    vm = vm_load(argv[1]);
    main_loop = 1;

    while (main_loop) {
        //printf("%s\n", vm_ins_str(vm));
        error = vm_step(vm);
        if (error) {
            switch (error) {
            case VM_HALTED :
                break;
            case VM_BAD_INSTRUCTION :
                printf("VM Encountered Bad Instruction\n");
                printf("%s\n", vm_registers_str(vm));
                break;
            }
            break;
        }
    }

    core_dump(vm);
    vm_destroy(vm);

    return 0;
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
cmpl $0x2, %edi
jne 0x14a1
leaq -0x1b(%rip), %rsi       # 0x141a
movl $0x2, %edi
callq 0x11b0
movq 0x8(%rbx), %rdi
callq 0x3831
movq %rax, %rbx
movl $0x1, 0x6d1f(%rip)      # 0x8174
movq %rbx, %rdi
callq 0x3b04
testl %eax, %eax
jne 0x146c
cmpl $0x0, 0x6d0c(%rip)      # 0x8174
jne 0x1455
jmp 0x148d
cmpl $0x2, %eax
jne 0x148d
leaq 0x3bad(%rip), %rdi      # 0x5025
callq 0x10b0
movq %rbx, %rdi
callq 0x3a0e
movq %rax, %rdi
callq 0x10b0
movq %rbx, %rdi
callq 0x13cc
movq %rbx, %rdi
callq 0x390d
xorl %eax, %eax
popq %rbx
retq
movq %rbx, %rdi
callq 0x12c0
jmp 0x149d
nop
// File: /workspace/github_c_makefile_star2_O3/iciamyplant[P]Cub3d-Linux/src/parsing.c
// Function: ft_parsing_map
int		ft_parsing_map(char *fichier, t_recup *recup)
{
	int			fd;
	int			ret;
	char		*str;

	ret = 1;
	str = NULL;
	fd = open(fichier, O_RDONLY);
	if (!(recup->map = malloc(sizeof(char*) * recup->nblines)))
		return (0);
	while (ret != 0)
	{
		ret = get_next_line(fd, &str, recup);
		if (recup->insidemap == 1 && ft_lignevide(str) == 0 &&
				recup->count < recup->nblines)
			recup->lignevide = 1;
		if ((recup->insidemap = ft_is_map(str, recup)) == 1)
		{
			recup->count++;
			ft_copy_map(str, recup);
		}
		free(str);
	}
	close(fd);
	ft_init_sprite(recup);
	return (0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq $0x0, (%rsp)
xorl %esi, %esi
xorl %eax, %eax
callq 0x7400
movl %eax, %ebp
movslq 0x40(%rbx), %rdi
shlq $0x3, %rdi
callq 0x7100
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x7614
movq %rsp, %r14
movl %ebp, %edi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x9c90
movl %eax, %r15d
cmpl $0x1, 0x80(%rbx)
jne 0x75ce
movq (%rsp), %rdi
callq 0xa11d
testl %eax, %eax
jne 0x75ce
movl 0x84(%rbx), %eax
cmpl 0x40(%rbx), %eax
jge 0x75ce
movl $0x1, 0x7c(%rbx)
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x7d9c
movl %eax, 0x80(%rbx)
cmpl $0x1, %eax
jne 0x75f7
incl 0x84(%rbx)
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x7caf
movq (%rsp), %rdi
callq 0x7190
testl %r15d, %r15d
jne 0x7596
movl %ebp, %edi
callq 0x7040
movq %rbx, %rdi
callq 0x8499
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/iciamyplant[P]Cub3d-Linux/src/parsing.c
// Function: ft_parsing
void	ft_parsing(char *fichier, t_recup *recup)
{
	int			fd;
	int			ret;
	char		*str;

	ret = 1;
	str = NULL;
	if ((fd = open(fichier, O_DIRECTORY)) != -1)
		ft_error(recup, "Invalide : is a directory\n");
	if ((fd = open(fichier, O_RDONLY)) == -1)
		ft_error(recup, "Fichier .cub invalide\n");
	recup->erreur = 0;
	while (ret != 0)
	{
		ret = get_next_line(fd, &str, recup);
		if (recup->erreur == 2)
			ft_error(recup, "La partie parsing detecte une erreur\n");
		ft_color_resolution(&str, recup);
		ft_texture(str, recup);
		ft_map(str, recup);
		free(str);
	}
	close(fd);
	if (recup->sizeline == 0 || recup->nblines == 0)
		ft_error(recup, "Map absente\n");
	ft_parsing_map(fichier, recup);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq $0x0, (%rsp)
movl $0x10000, %esi          # imm = 0x10000
xorl %eax, %eax
callq 0x7400
cmpl $-0x1, %eax
je 0x765a
leaq 0x59b2(%rip), %rsi      # 0xd004
movq %rbx, %rdi
callq 0x970c
movq %r14, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x7400
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x767c
leaq 0x59ab(%rip), %rsi      # 0xd01f
movq %rbx, %rdi
callq 0x970c
movl $0x0, 0x74(%rbx)
movq %rsp, %r15
leaq 0x59a9(%rip), %r12      # 0xd036
movl %ebp, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x9c90
movl %eax, %r13d
cmpl $0x2, 0x74(%rbx)
jne 0x76ae
movq %rbx, %rdi
movq %r12, %rsi
callq 0x970c
movq %r15, %rdi
movq %rbx, %rsi
callq 0x7b32
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x7aa3
movq (%rsp), %rdi
movq %rbx, %rsi
callq 0x7e29
movq (%rsp), %rdi
callq 0x7190
testl %r13d, %r13d
jne 0x768d
movl %ebp, %edi
callq 0x7040
cmpl $0x0, 0x44(%rbx)
je 0x76f2
cmpl $0x0, 0x40(%rbx)
jne 0x7701
leaq 0x5963(%rip), %rsi      # 0xd05c
movq %rbx, %rdi
callq 0x970c
movq %r14, %rdi
movq %rbx, %rsi
callq 0x755c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/iciamyplant[P]Cub3d-Linux/src/parsing.c
// Function: ft_cub
int		ft_cub(char *str, t_recup *recup)
{
	int			i;

	i = 0;
	while (str[i] != '\0')
		i++;
	while (str[i] != '.')
	{
		i--;
		if (i == 0)
		{
			ft_error(recup, "Nom de la map invalide\n");
			return (0);
		}
	}
	if (str[i + 1] == 'c' && str[i + 2] == 'u' && str[i + 3] == 'b')
		ft_parsing(str, recup);
	else
		ft_error(recup, "Nom de la map invalide\n");
	return (0);
}

// Assembly:
xorl %eax, %eax
cmpb $0x0, (%rdi,%rax)
leaq 0x1(%rax), %rax
jne 0x771d
pushq %rax
cmpb $0x2e, -0x1(%rdi,%rax)
je 0x773a
decq %rax
cmpq $0x1, %rax
jne 0x7728
jmp 0x7755
cmpb $0x63, (%rdi,%rax)
jne 0x7755
cmpb $0x75, 0x1(%rdi,%rax)
jne 0x7755
cmpb $0x62, 0x2(%rdi,%rax)
jne 0x7755
callq 0x7621
jmp 0x7767
leaq 0x590d(%rip), %rax      # 0xd069
movq %rsi, %rdi
movq %rax, %rsi
callq 0x970c
xorl %eax, %eax
popq %rcx
retq