LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::request_arena(unsigned char)
MemoryArena *request_arena(b8 only_one) {
    CHECK_ILLEGAL_ALLOC;
    ASSERT(global_memory.free_regions, "No more memory");
    ASSERT(global_memory.num_free_regions, "No more memory");
    MemoryArena *next = global_memory.free_regions;
    global_memory.free_regions = next->next;
    --global_memory.num_free_regions;
    next->only_one = only_one;
    next->next = 0;
    next->watermark = 0;
    return next;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movl 0x4094b(%rip), %eax     # 0x4a374
cmpl $0x2, %eax
je 0x9a42
cmpl $0x1, %eax
jne 0x9a38
callq 0x9919
movl $0x1, 0x40932(%rip)     # 0x4a374
leaq 0x413df(%rip), %r15     # 0x4ae28
xorl %ecx, %ecx
cmpq $0x0, 0x8(%r15)
setne %cl
leaq 0x2224d(%rip), %r14     # 0x2bca7
leaq 0x223a4(%rip), %rdx     # 0x2be05
pushq $0x65
popq %rsi
movq %r14, %rdi
callq 0x6903
xorl %ecx, %ecx
cmpq $0x0, (%r15)
setne %cl
leaq 0x223b4(%rip), %rdx     # 0x2be30
pushq $0x66
popq %rsi
movq %r14, %rdi
callq 0x6903
movq 0x8(%r15), %rax
movq 0x10(%rax), %rcx
movq %rcx, 0x8(%r15)
decq (%r15)
movb %bl, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::MemoryArena::clear()
void MemoryArena::clear() {
    while (next) {
        MemoryArena *old = next;
        next = next->next;
        return_arean(old);
    }
    watermark = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x9af1
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
callq 0x9b07
jmp 0x9ad9
andq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::return_arean(Util::MemoryArena*)
void return_arean(MemoryArena *arena) {
    ASSERT(arena, "nullptr is not a valid argument.");
    if (arena->next) return_arean(arena->next);
    ++global_memory.num_free_regions;
    arena->next = global_memory.free_regions;
    global_memory.free_regions = arena;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ecx, %ecx
testq %rdi, %rdi
setne %cl
leaq 0x22188(%rip), %rdi     # 0x2bca7
leaq 0x22339(%rip), %rdx     # 0x2be5f
pushq $0x71
popq %rsi
callq 0x6903
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x9b3c
callq 0x9b07
leaq 0x412e5(%rip), %rax     # 0x4ae28
incq (%rax)
movq 0x8(%rax), %rcx
movq %rcx, 0x10(%rbx)
movq %rbx, 0x8(%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::find_first_binding(unsigned int)
Binding *find_first_binding(InputCode code) {
    s64 low = 0;
    s64 high = global_mapping.used_bindings;
    while (low <= high) {
        s64 cur = (low + high) / 2;
        if (cur < 0 || global_mapping.used_bindings < cur)
            break;
        auto cur_code = global_mapping.bindings[cur].code;
        if (cur_code > code) {
            high = cur - 1;
        } else if (cur_code < code) {
            low = cur + 1;
        } else {
            while (global_mapping.bindings[(cur - 1)] == code) cur--;
            return global_mapping.bindings + cur;
        }
    }
    return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
leaq 0x40722(%rip), %rax     # 0x4a2d8
movl 0x10(%rax), %r8d
movq 0x18(%rax), %r9
xorl %ecx, %ecx
movabsq $0x2, %r10
xorl %ebx, %ebx
movq %r8, %r11
cmpq %r11, %rbx
jg 0x9c24
leaq (%r11,%rbx), %rsi
movq %rsi, %rax
cqto
idivq %r10
cmpq $-0x1, %rsi
jl 0x9c24
cmpq %r8, %rax
jg 0x9c24
movq %rax, %rdx
shlq $0x4, %rdx
cmpl %edi, (%r9,%rdx)
jbe 0x9c00
decq %rax
movq %rax, %r11
jmp 0x9bcf
jae 0x9c0a
incq %rax
movq %rax, %rbx
jmp 0x9bcf
leaq (%r9,%rdx), %rax
addq $0x10, %rax
leaq -0x10(%rax), %rcx
cmpl $0x0, -0x18(%rax)
je 0x9c24
cmpl %edi, -0x20(%rax)
movq %rcx, %rax
je 0x9c12
movq %rcx, %rax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::insert(Input::Binding)
void insert(Binding binding) {
    ASSERT(global_mapping.used_bindings < global_mapping.num_total_bindings, "Too many bindings");

    Binding *it = global_mapping.bindings + global_mapping.used_bindings;
    while (global_mapping.bindings != it && binding.code < (it - 1)->code) {
        *it = *(it - 1);
        it--;
    }
    *it = binding;
    global_mapping.used_bindings += 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40697(%rip), %r15     # 0x4a2d8
movl 0x10(%r15), %eax
xorl %ecx, %ecx
cmpl 0xc(%r15), %eax
setb %cl
leaq 0x22232(%rip), %rdi     # 0x2be87
leaq 0x22249(%rip), %rdx     # 0x2bea5
pushq $0x18
popq %rsi
callq 0x6903
movq 0x18(%r15), %rcx
movl 0x10(%r15), %eax
shlq $0x4, %rax
addq %rcx, %rax
cmpq %rcx, %rax
je 0x9c91
cmpl %r14d, -0x10(%rax)
jbe 0x9c91
leaq -0x10(%rax), %rdx
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq 0x18(%r15), %rcx
movq %rdx, %rax
jmp 0x9c73
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
incl 0x10(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::clear_input_for_frame()
void clear_input_for_frame() {
    for (u32 player = 0; player < (u32) Player::NUM; player++) {
        for (u32 button_id = 0; button_id < global_mapping.num_bindings_per_controller;
             button_id++) {
            auto *button = global_mapping.buttons[player] + button_id;
            button->state = clear_frame_flag(button->state);
        }
    }

    // Reset mouse frame
    global_mapping.mouse.depth = 0;
    global_mapping.mouse.move_x = 0;
    global_mapping.mouse.move_y = 0;
    global_mapping.mouse.wheel_x = 0;
    global_mapping.mouse.wheel_y = 0;
    global_mapping.mouse.state[0] = clear_frame_flag(global_mapping.mouse.state[0]);
    global_mapping.mouse.state[1] = clear_frame_flag(global_mapping.mouse.state[1]);
    global_mapping.mouse.state[2] = clear_frame_flag(global_mapping.mouse.state[2]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x40626(%rip), %rax     # 0x4a2d8
movl 0x8(%rax), %ecx
shlq $0x4, %rcx
xorl %edx, %edx
cmpq $0x4, %rdx
je 0x9cdd
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x9cd8
movq 0x20(%rax,%rdx,8), %rdi
andl $0x1, 0x8(%rdi,%rsi)
addq $0x10, %rsi
jmp 0x9cc3
incq %rdx
jmp 0x9cbb
xorps %xmm0, %xmm0
andl $0x0, 0x8c(%rax)
movups %xmm0, 0x7c(%rax)
andl $0x1, 0x68(%rax)
andl $0x1, 0x6c(%rax)
andl $0x1, 0x70(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::activate(unsigned int, float)
void activate(InputCode code, f32 value) {
    for (Binding *binding = find_first_binding(code);
         binding && (*binding) == code; binding++) {
        u32 index = binding->index();
        ASSERT(0 <= index && index < global_mapping.num_bindings_per_controller, "Invalid index");
        u32 player = binding->playerID();
        ASSERT(0 <= (u32) player && player < (u32) Player::NUM, "Invalid player");
        global_mapping.buttons[player][index].set(value);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movss %xmm0, -0x2c(%rbp)
movl %edi, -0x34(%rbp)
callq 0x9baa
movq %rax, %r14
xorps %xmm0, %xmm0
cmpneqss -0x2c(%rbp), %xmm0
movd %xmm0, %eax
pushq $0x2
popq %rcx
subl %eax, %ecx
movl %ecx, -0x30(%rbp)
testq %r14, %r14
je 0x9dd2
cmpl $0x0, 0x8(%r14)
je 0x9dd2
movl -0x34(%rbp), %eax
cmpl %eax, (%r14)
jne 0x9dd2
movq %r14, %rdi
callq 0x29374
movl %eax, %r12d
xorl %ecx, %ecx
leaq 0x40575(%rip), %r15     # 0x4a2d8
cmpl 0x8(%r15), %eax
setb %cl
leaq 0x22116(%rip), %rbx     # 0x2be87
movq %rbx, %rdi
pushq $0x55
popq %rsi
leaq 0x221b5(%rip), %rdx     # 0x2bf33
callq 0x6903
movq %r14, %rdi
callq 0x293ae
movl %eax, %r13d
xorl %ecx, %ecx
cmpl $0x4, %eax
setb %cl
movq %rbx, %rdi
pushq $0x57
popq %rsi
leaq 0x221e0(%rip), %rdx     # 0x2bf83
callq 0x6903
movl %r13d, %eax
movq 0x20(%r15,%rax,8), %rax
movl %r12d, %ecx
shlq $0x4, %rcx
movss -0x2c(%rbp), %xmm0
movss %xmm0, 0xc(%rax,%rcx)
movl -0x30(%rbp), %edx
movl %edx, 0x8(%rax,%rcx)
addq $0x10, %r14
jmp 0x9d2f
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::type_text(char const*)
void type_text(const char *string) {
    while (*string) {
        const u32 size_left = global_mapping.text_length - global_mapping.TEXT_LENGTH;
        if (Util::utf8_insert_glyph(global_mapping.text + global_mapping.text_length,
                              string, size_left)) {
            const u32 size = Util::utf8_size(string);
            global_mapping.text_length += size;
            string += size;
        } else {
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x404e6(%rip), %r14     # 0x4a2d8
cmpb $0x0, (%rbx)
je 0x9e26
movl 0x44(%r14), %eax
leal -0x20(%rax), %edx
leaq (%r14,%rax), %rdi
addq $0x48, %rdi
movq %rbx, %rsi
callq 0x9849
testb %al, %al
je 0x9e26
movq %rbx, %rdi
callq 0x97c6
movzbl %al, %eax
addl %eax, 0x44(%r14)
addq %rax, %rbx
jmp 0x9df2
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::edit_string(char*, unsigned int)
b8 edit_string(char *text, u32 max_length) {
    if (!global_mapping.text_length) return false;
    s32 text_left = max_length;
    char *cursor = text;
    while (*cursor) { cursor++; text_left--; }
    char *edits = global_mapping.text;
    while (edits < global_mapping.text + global_mapping.text_length) {
        const u32 glyph_size = Util::utf8_size(edits);
        if (*edits == '\b') {
            if (cursor != text) {
                do {
                    cursor--;
                    text_left++;
                } while (!Util::utf8_is_first_char(cursor) && text < cursor);
            }
        } else {
            if (Util::utf8_insert_glyph(cursor, edits, text_left)) {
                cursor += glyph_size;
                text_left -= glyph_size;
            }
        }
        edits += glyph_size;
    }
    *cursor = '\0';
    return true;
}

// Assembly:
leaq 0x404a6(%rip), %rcx     # 0x4a2d8
movl 0x44(%rcx), %eax
testl %eax, %eax
je 0x9f16
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
cmpb $0x0, (%r14,%r15)
je 0x9e5f
incq %r15
jmp 0x9e53
subl %r15d, %ebx
addq %r14, %r15
leaq 0x48(%rcx), %r12
movl %eax, %eax
addq %rcx, %rax
addq $0x48, %rax
cmpq %rax, %r12
jae 0x9f01
movq %r12, %rdi
callq 0x97c6
movzbl %al, %r13d
cmpb $0x8, (%r12)
movl %r13d, %edx
jne 0x9ebe
cmpq %r14, %r15
je 0x9edf
decq %r15
movq %r15, %rax
leaq 0x40435(%rip), %rcx     # 0x4a2d8
incl %ebx
leaq -0x1(%rax), %r15
cmpq %r14, %rax
jbe 0x9eb9
movb (%rax), %al
andb $-0x40, %al
negb %al
movq %r15, %rax
jo 0x9ea3
incq %r15
jmp 0x9ef6
movq %rdx, -0x30(%rbp)
movq %r15, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x9849
testb %al, %al
je 0x9eeb
movq -0x30(%rbp), %rdx
addq %rdx, %r15
subl %r13d, %ebx
jmp 0x9ee2
movq %r14, %r15
leaq 0x403ef(%rip), %rcx     # 0x4a2d8
jmp 0x9ef6
leaq 0x403e6(%rip), %rcx     # 0x4a2d8
movq -0x30(%rbp), %rdx
addq %rdx, %r12
movl 0x44(%rcx), %eax
jmp 0x9e69
movb $0x0, (%r15)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::super_pressed(unsigned int, Input::Player)
b8 super_pressed(Name name, Player player) {
    b8 remember = global_mapping.text_input;
    global_mapping.text_input = false;
    BEGIN_BINDINGS_BLOCK {
        if ((u32) button.state & (u32) ButtonState::TRIGGERED) {
            global_mapping.text_input = remember;
            return true;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x40394(%rip), %rax     # 0x4a2d8
movb 0x40(%rax), %cl
movb %cl, -0x29(%rbp)
movb $0x0, 0x40(%rax)
movl %edi, %eax
xorl %ecx, %ecx
pushq $0x1
popq %rdx
movabsq $-0x10000000000, %rdi   # imm = 0xFFFFFF0000000000
pushq $0x5
popq %rbx
movabsq $-0xff00000001, %r15    # imm = 0xFFFFFF00FFFFFFFF
movl %esi, -0x30(%rbp)
movq %rax, -0x38(%rbp)
cmpl $0x4, %ecx
je 0xa016
movl %edx, %r13d
shll %cl, %r13d
btl %ecx, %esi
jae 0x9ff1
movq %rcx, -0x40(%rbp)
shlq $0x20, %r13
andq %rdi, %r12
orq %rax, %r12
xorl %eax, %eax
decq %rbx
je 0x9fd6
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %r14
andq %r15, %r12
addq %rax, %r12
leaq 0x40321(%rip), %rdi     # 0x4a2d8
movq %r13, %rsi
movq %r12, %rdx
callq 0x293e4
testl %eax, %eax
sete %al
testb $0x2, %dl
sete %cl
orb %al, %cl
movq %r14, %rax
jne 0x9f97
jmp 0x9ff8
movl -0x30(%rbp), %esi
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
pushq $0x1
popq %rdx
movabsq $-0x10000000000, %rdi   # imm = 0xFFFFFF0000000000
pushq $0x5
popq %rbx
incl %ecx
jmp 0x9f73
movb $0x1, %al
leaq 0x402d7(%rip), %rcx     # 0x4a2d8
movb -0x29(%rbp), %dl
movb %dl, 0x40(%rcx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x9ffa
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::triggered(unsigned int, Input::Player)
b8 triggered(Name name, Player player) {
    BEGIN_BINDINGS_BLOCK {
        if ((u32) button.state & (u32) ButtonState::TRIGGERED) return true;
    }
    END_BINDINGS_BLOCK
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x402a6(%rip), %rax     # 0x4a2d8
xorl %ecx, %ecx
cmpb $0x0, 0x40(%rax)
jne 0xa0f8
movl %edi, %eax
movq %rax, -0x40(%rbp)
movl %esi, -0x2c(%rbp)
cmpl $0x4, %ecx
je 0xa0f2
pushq $0x1
popq %rax
movl %eax, %r12d
shll %cl, %r12d
btl %ecx, %esi
jae 0xa0eb
movq %rcx, -0x38(%rbp)
shlq $0x20, %r12
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r14
addq -0x40(%rbp), %r14
xorl %ebx, %ebx
pushq $0x4
popq %r15
subq $0x1, %r15
jb 0xa0d4
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r14
leaq (%rbx,%r14), %r13
leaq 0x40239(%rip), %rdi     # 0x4a2d8
movq %r12, %rsi
movq %r13, %rdx
callq 0x293e4
shrl %edx
andl $0x1, %edx
testl %eax, %eax
movl %edx, %eax
pushq $0x7
popq %rcx
cmovel %ecx, %eax
cmpl $0x7, %eax
je 0xa0c2
testl %eax, %eax
jne 0xa0dd
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
movq %r13, %r14
jmp 0xa081
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %esi
jmp 0xa0eb
testl %edx, %edx
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %esi
jne 0xa0f2
addq %rbx, %r14
incl %ecx
jmp 0xa047
cmpl $0x4, %ecx
setb %cl
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::pressed(unsigned int, Input::Player)
b8 pressed(Name name, Player player) {
    BEGIN_BINDINGS_BLOCK {
        if (button.state == ButtonState::PRESSED) return true;
    }
    END_BINDINGS_BLOCK
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x401b7(%rip), %rax     # 0x4a2d8
xorl %ecx, %ecx
cmpb $0x0, 0x40(%rax)
jne 0xa1ec
movl %edi, %eax
movq %rax, -0x40(%rbp)
movl %esi, -0x2c(%rbp)
cmpl $0x4, %ecx
je 0xa1e6
pushq $0x1
popq %rax
movl %eax, %r12d
shll %cl, %r12d
btl %ecx, %esi
jae 0xa1df
movq %rcx, -0x38(%rbp)
shlq $0x20, %r12
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r14
addq -0x40(%rbp), %r14
xorl %ebx, %ebx
pushq $0x4
popq %r15
subq $0x1, %r15
jb 0xa1c7
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r14
leaq (%rbx,%r14), %r13
leaq 0x4014a(%rip), %rdi     # 0x4a2d8
movq %r12, %rsi
movq %r13, %rdx
callq 0x293e4
movl %edx, %ecx
xorl %edx, %edx
cmpq $0x3, %rcx
sete %dl
testl %eax, %eax
pushq $0x7
popq %rax
cmovel %eax, %edx
cmpl $0x7, %edx
je 0xa1b5
testl %edx, %edx
jne 0xa1d0
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
movq %r13, %r14
jmp 0xa170
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %esi
jmp 0xa1df
cmpl $0x3, %ecx
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %esi
je 0xa1e6
addq %rbx, %r14
incl %ecx
jmp 0xa136
cmpl $0x4, %ecx
setb %cl
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::released(unsigned int, Input::Player)
b8 released(Name name, Player player) {
    BEGIN_BINDINGS_BLOCK {
        if (button.state == ButtonState::RELEASED) return true;
    }
    END_BINDINGS_BLOCK
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x400c3(%rip), %rax     # 0x4a2d8
xorl %ecx, %ecx
cmpb $0x0, 0x40(%rax)
jne 0xa2e0
movl %edi, %eax
movq %rax, -0x40(%rbp)
movl %esi, -0x2c(%rbp)
cmpl $0x4, %ecx
je 0xa2da
pushq $0x1
popq %rax
movl %eax, %r12d
shll %cl, %r12d
btl %ecx, %esi
jae 0xa2d3
movq %rcx, -0x38(%rbp)
shlq $0x20, %r12
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r14
addq -0x40(%rbp), %r14
xorl %ebx, %ebx
pushq $0x4
popq %r15
subq $0x1, %r15
jb 0xa2bb
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r14
leaq (%rbx,%r14), %r13
leaq 0x40056(%rip), %rdi     # 0x4a2d8
movq %r12, %rsi
movq %r13, %rdx
callq 0x293e4
movl %edx, %ecx
xorl %edx, %edx
cmpq $0x2, %rcx
sete %dl
testl %eax, %eax
pushq $0x7
popq %rax
cmovel %eax, %edx
cmpl $0x7, %edx
je 0xa2a9
testl %edx, %edx
jne 0xa2c4
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
movq %r13, %r14
jmp 0xa264
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %esi
jmp 0xa2d3
cmpl $0x2, %ecx
movq -0x38(%rbp), %rcx
movl -0x2c(%rbp), %esi
je 0xa2da
addq %rbx, %r14
incl %ecx
jmp 0xa22a
cmpl $0x4, %ecx
setb %cl
movl %ecx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::down(unsigned int, Input::Player)
b8 down(Name name, Player player) {
    BEGIN_BINDINGS_BLOCK {
        if (button.is_down()) return true;
    }
    END_BINDINGS_BLOCK
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x3ffcf(%rip), %rax     # 0x4a2d8
xorl %ebx, %ebx
cmpb $0x0, 0x40(%rax)
jne 0xa3a4
movl %esi, -0x2c(%rbp)
movl %edi, %eax
movq %rax, -0x38(%rbp)
cmpl $0x4, %ebx
je 0xa39e
pushq $0x1
popq %rax
movl %eax, %r13d
movl %ebx, %ecx
shll %cl, %r13d
movl -0x2c(%rbp), %eax
btl %ebx, %eax
jae 0xa39a
shlq $0x20, %r13
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r12
addq -0x38(%rbp), %r12
xorl %eax, %eax
pushq $0x5
popq %r14
decq %r14
je 0xa39a
movabsq $0x100000000, %rcx      # imm = 0x100000000
leaq (%rax,%rcx), %r15
movabsq $-0xff00000001, %rcx    # imm = 0xFFFFFF00FFFFFFFF
andq %rcx, %r12
addq %rax, %r12
leaq 0x3ff5d(%rip), %rdi     # 0x4a2d8
movq %r13, %rsi
movq %r12, %rdx
callq 0x293e4
testl %eax, %eax
sete %al
testb $0x1, %dl
sete %cl
orb %al, %cl
movq %r15, %rax
jne 0xa351
jmp 0xa39e
incl %ebx
jmp 0xa31e
cmpl $0x4, %ebx
setb %bl
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::value(unsigned int, Input::Player)
f32 value(Name name, Player player) {
    u32 num_down = 0;
    f32 value = 0;
    BEGIN_BINDINGS_BLOCK {
        if (!button.is_down()) continue;
        num_down++;
        value += button.value * button.modifier;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x3ff0b(%rip), %rax     # 0x4a2d8
xorps %xmm0, %xmm0
cmpb $0x0, 0x40(%rax)
jne 0xa4b9
movl %edi, %eax
movq %rax, -0x38(%rbp)
xorl %ecx, %ecx
xorl %r14d, %r14d
movl %esi, -0x30(%rbp)
cmpl $0x4, %ecx
je 0xa4a3
pushq $0x1
popq %rax
movl %eax, %r13d
shll %cl, %r13d
btl %ecx, %esi
jae 0xa49c
movq %rcx, -0x40(%rbp)
shlq $0x20, %r13
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r12
addq -0x38(%rbp), %r12
xorl %ebx, %ebx
pushq $0x4
popq %r15
subq $0x1, %r15
jb 0xa495
movss %xmm0, -0x2c(%rbp)
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r12
addq %rbx, %r12
leaq 0x3fe94(%rip), %rdi     # 0x4a2d8
movq %r13, %rsi
movq %r12, %rdx
callq 0x293e4
testl %eax, %eax
setne %sil
movl %edx, %ecx
andb %sil, %cl
jne 0xa463
movss -0x2c(%rbp), %xmm0
jmp 0xa480
shrq $0x20, %rax
movd %eax, %xmm0
shrq $0x20, %rdx
movd %edx, %xmm1
mulss %xmm0, %xmm1
movss -0x2c(%rbp), %xmm0
addss %xmm1, %xmm0
movzbl %cl, %eax
addl %eax, %r14d
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbx
jmp 0xa422
movl -0x30(%rbp), %esi
movq -0x40(%rbp), %rcx
incl %ecx
jmp 0xa3e8
testl %r14d, %r14d
je 0xa4b6
movl %r14d, %eax
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
jmp 0xa4b9
xorps %xmm0, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::scale_screen_to_world(Vec2, unsigned int)
Vec2 scale_screen_to_world(Vec2 p, u32 camera_id = 0) {
    Renderer::Camera *camera = Renderer::fetch_camera(camera_id);
    const f32 inv_width = 1.0 / Renderer::get_window_width();
    const f32 scale_factor = 1.0 / camera->zoom;
    Vec2 opengl = V2( p.x * 2 * scale_factor * inv_width,
                     -p.y * 2 * scale_factor * inv_width);
    Vec2 world = opengl + V2(-scale_factor, scale_factor * camera->aspect_ratio);
    return world;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movaps %xmm0, -0x10(%rbp)
callq 0x9156
movss 0x20b23(%rip), %xmm1    # 0x2b004
movaps %xmm1, %xmm2
divss 0x5bda0(%rip), %xmm2    # 0x6628c
divss 0x10(%rax), %xmm1
movaps -0x10(%rbp), %xmm3
movaps %xmm3, %xmm0
addss %xmm3, %xmm0
mulss %xmm1, %xmm0
mulss %xmm2, %xmm0
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
addss %xmm3, %xmm3
mulss %xmm1, %xmm3
subss %xmm1, %xmm0
mulss 0x14(%rax), %xmm1
mulss %xmm2, %xmm3
subss %xmm3, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::normalized_mouse_position()
Vec2 normalized_mouse_position() {
    const f32 inv_width = 1.0 / Renderer::get_window_width();
    Vec2 opengl = V2( mouse_position().x * 2 * inv_width,
                     -mouse_position().y * 2 * inv_width);
    Vec2 normalized = opengl + V2(-1, 1 * Renderer::get_window_aspect_ratio());
    return normalized;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x3fd36(%rip), %rax     # 0x4a2d8
cvtsi2ssl 0x74(%rax), %xmm0
movss 0x20a55(%rip), %xmm1    # 0x2b004
cvtsi2ssl 0x78(%rax), %xmm2
divss 0x5bcd0(%rip), %xmm1    # 0x6628c
addss %xmm0, %xmm0
mulss %xmm1, %xmm0
addss %xmm2, %xmm2
mulss %xmm1, %xmm2
addss 0x20c54(%rip), %xmm0    # 0x2b228
movss 0x5bcb8(%rip), %xmm1    # 0x66294
subss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::world_mouse_move(unsigned int)
Vec2 world_mouse_move(u32 camera_id) {
    Vec2 p = mouse_move();
    Renderer::Camera *camera = Renderer::fetch_camera(camera_id);
    const f32 inv_width = 1.0 / Renderer::get_window_width();
    const f32 scale_factor = 1.0 / camera->zoom;
    Vec2 opengl = V2( p.x * 2 * scale_factor * inv_width,
            -p.y * 2 * scale_factor * inv_width);
    return opengl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x3fcb6(%rip), %rax     # 0x4a2d8
cvtsi2ssl 0x7c(%rax), %xmm0
movaps %xmm0, -0x10(%rbp)
cvtsi2ssl 0x80(%rax), %xmm0
movaps %xmm0, -0x20(%rbp)
callq 0x9156
movss 0x209c0(%rip), %xmm2    # 0x2b004
movaps %xmm2, %xmm1
divss 0x5bc3d(%rip), %xmm1    # 0x6628c
divss 0x10(%rax), %xmm2
movaps -0x10(%rbp), %xmm0
addss %xmm0, %xmm0
mulss %xmm2, %xmm0
mulss %xmm1, %xmm0
movaps -0x20(%rbp), %xmm3
mulss 0x20ba8(%rip), %xmm3    # 0x2b218
mulss %xmm2, %xmm3
mulss %xmm1, %xmm3
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::request_name(unsigned int)
Name request_name(u32 num) {
    ASSERT(global_mapping.next_name, "Invalid mapping name");
    ASSERT(global_mapping.num_total_bindings == 0, "Cannot add mappings as game is running");
    Name name = global_mapping.next_name;
    global_mapping.next_name += num;
    return name;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x3fba9(%rip), %r15     # 0x4a2d8
xorl %ecx, %ecx
cmpl $0x0, 0x90(%r15)
setne %cl
leaq 0x21744(%rip), %r14     # 0x2be87
leaq 0x21879(%rip), %rdx     # 0x2bfc3
movq %r14, %rdi
movl $0x120, %esi            # imm = 0x120
callq 0x6903
xorl %ecx, %ecx
cmpl $0x0, 0xc(%r15)
sete %cl
leaq 0x2188a(%rip), %rdx     # 0x2bff2
movq %r14, %rdi
movl $0x121, %esi            # imm = 0x121
callq 0x6903
movl 0x90(%r15), %eax
addl %eax, %ebx
movl %ebx, 0x90(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::init()
b8 init() {
    u32 number_of_bindings = global_mapping.next_name;
    global_mapping.num_bindings_per_controller = number_of_bindings * NUM_ALTERNATIVE_BINDINGS;
    global_mapping.num_total_bindings = (u32) Player::NUM * global_mapping.num_bindings_per_controller;

    global_mapping.arena = Util::request_arena();
    for (u32 i = 0; i < (u32) Player::NUM; i++)
        global_mapping.buttons[i] = global_mapping.arena->push<Mapping::VirtualButton>(global_mapping.num_bindings_per_controller);
    global_mapping.bindings = global_mapping.arena->push<Binding>(global_mapping.num_total_bindings);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leaq 0x3fb3a(%rip), %rbx     # 0x4a2d8
movl 0x90(%rbx), %eax
leal (,%rax,4), %ecx
movl %ecx, 0x8(%rbx)
shll $0x4, %eax
movl %eax, 0xc(%rbx)
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x9a17
movq %rax, (%rbx)
movq (%rbx), %rdi
cmpq $0x4, %r14
je 0xa7dc
movl 0x8(%rbx), %esi
callq 0x2942c
movq %rax, 0x20(%rbx,%r14,8)
incq %r14
jmp 0xa7c1
movl 0xc(%rbx), %esi
callq 0x294f6
movq %rax, 0x18(%rbx)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/inc/glad/glad.c
// Function: gladLoadGL
int gladLoadGL(void) {
    int status = 0;

    if(open_gl()) {
        status = gladLoadGLLoader(&get_proc);
        close_gl();
    }

    return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x2120e(%rip), %r14     # 0x2ba10
xorl %r15d, %r15d
cmpq $0x8, %r15
je 0xa86e
movslq (%r15,%r14), %rdi
addq %r14, %rdi
movl $0x102, %esi            # imm = 0x102
callq 0x2410
movq %rax, 0x5bae5(%rip)     # 0x66308
addq $0x4, %r15
testq %rax, %rax
je 0xa805
leaq 0x22dd3(%rip), %rsi     # 0x2d606
movq %rax, %rdi
callq 0x2150
movq %rax, 0x5bace(%rip)     # 0x66310
testq %rax, %rax
je 0xa86e
leaq 0x10a41(%rip), %rdi     # 0x1b28f
callq 0xa87b
movl %eax, %ebx
movq 0x5baac(%rip), %rdi     # 0x66308
testq %rdi, %rdi
je 0xa86e
callq 0x24b0
andq $0x0, 0x5ba9a(%rip)     # 0x66308
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/inc/glad/glad.c
// Function: get_proc(char const*)
static
void* get_proc(const char *namez) {
    void* result = NULL;
    if(libGL == NULL) return NULL;

#if !defined(__APPLE__) && !defined(__HAIKU__)
    if(gladGetProcAddressPtr != NULL) {
        result = gladGetProcAddressPtr(namez);
    }
#endif
    if(result == NULL) {
#if defined(_WIN32) || defined(__CYGWIN__)
        result = (void*)GetProcAddress((HMODULE) libGL, namez);
#else
        result = dlsym(libGL, namez);
#endif
    }

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x4b069(%rip), %rdi     # 0x66308
testq %rdi, %rdi
je 0x1b2cf
movq 0x4b065(%rip), %rax     # 0x66310
testq %rax, %rax
je 0x1b2c1
movq %rbx, %rdi
callq *%rax
testq %rax, %rax
jne 0x1b2d1
movq 0x4b047(%rip), %rdi     # 0x66308
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2150
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::RenderQueue<Renderer::Impl::Vertex>::enable_attrib_pointer()
void RenderQueue<Vertex>::enable_attrib_pointer() {
    glEnableVertexAttribArray(0);
    glEnableVertexAttribArray(1);
    glEnableVertexAttribArray(2);
    glEnableVertexAttribArray(3);

    glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
                          (void *) offsetof(Vertex, position));
    glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex),
                          (void *) offsetof(Vertex, texture));
    glVertexAttribPointer(2, 1, GL_FLOAT, GL_FALSE, sizeof(Vertex),
                          (void *) offsetof(Vertex, sprite));
    glVertexAttribPointer(3, 4, GL_FLOAT, GL_FALSE, sizeof(Vertex),
                          (void *) offsetof(Vertex, color));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x41829(%rip), %r15     # 0x5fe48
xorl %edi, %edi
callq *(%r15)
pushq $0x1
popq %rbx
movl %ebx, %edi
callq *(%r15)
pushq $0x2
popq %r12
movl %r12d, %edi
callq *(%r15)
pushq $0x3
popq %r14
movl %r14d, %edi
callq *(%r15)
leaq 0x42811(%rip), %r13     # 0x60e58
pushq $0x24
popq %r15
xorl %edi, %edi
movl %r12d, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
xorl %r9d, %r9d
callq *(%r13)
pushq $0x8
popq %r9
movl %ebx, %edi
movl %r12d, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
callq *(%r13)
pushq $0x10
popq %r9
movl %r12d, %edi
movl %ebx, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
callq *(%r13)
movq (%r13), %rax
pushq $0x4
popq %rsi
pushq $0x14
popq %r9
movl %r14d, %edi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
nop
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::RenderQueue<Renderer::Impl::SdfVertex>::enable_attrib_pointer()
void RenderQueue<SdfVertex>::enable_attrib_pointer() {
    glEnableVertexAttribArray(0);
    glEnableVertexAttribArray(1);
    glEnableVertexAttribArray(2);
    glEnableVertexAttribArray(3);
    glEnableVertexAttribArray(4);
    glEnableVertexAttribArray(5);
    glEnableVertexAttribArray(6);

    glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(SdfVertex),
                          (void *) offsetof(SdfVertex, position));
    glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(SdfVertex),
                          (void *) offsetof(SdfVertex, texture));
    glVertexAttribPointer(2, 1, GL_FLOAT, GL_FALSE, sizeof(SdfVertex),
                          (void *) offsetof(SdfVertex, sprite));
    glVertexAttribPointer(3, 4, GL_FLOAT, GL_FALSE, sizeof(SdfVertex),
                          (void *) offsetof(SdfVertex, color));
    glVertexAttribPointer(4, 1, GL_FLOAT, GL_FALSE, sizeof(SdfVertex),
                          (void *) offsetof(SdfVertex, low));
    glVertexAttribPointer(5, 1, GL_FLOAT, GL_FALSE, sizeof(SdfVertex),
                          (void *) offsetof(SdfVertex, high));
    glVertexAttribPointer(6, 1, GL_INT, GL_FALSE, sizeof(SdfVertex),
                          (void *) offsetof(SdfVertex, border));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x4177b(%rip), %r14     # 0x5fe48
xorl %edi, %edi
callq *(%r14)
pushq $0x1
popq %rbx
movl %ebx, %edi
callq *(%r14)
pushq $0x2
popq %r12
movl %r12d, %edi
callq *(%r14)
pushq $0x3
popq %rdi
callq *(%r14)
pushq $0x4
popq %r13
movl %r13d, %edi
callq *(%r14)
pushq $0x5
popq %rdi
callq *(%r14)
pushq $0x6
popq %rdi
callq *(%r14)
leaq 0x42751(%rip), %r14     # 0x60e58
pushq $0x30
popq %r15
xorl %edi, %edi
movl %r12d, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
xorl %r9d, %r9d
callq *(%r14)
pushq $0x8
popq %r9
movl %ebx, %edi
movl %r12d, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
callq *(%r14)
pushq $0x10
popq %r9
movl %r12d, %edi
movl %ebx, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
callq *(%r14)
pushq $0x14
popq %r9
pushq $0x3
popq %rdi
movl %r13d, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
callq *(%r14)
pushq $0x24
popq %r9
movl %r13d, %edi
movl %ebx, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
callq *(%r14)
pushq $0x28
popq %r9
pushq $0x5
popq %rdi
movl %ebx, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl %r15d, %r8d
callq *(%r14)
movq (%r14), %rax
pushq $0x2c
popq %r9
pushq $0x6
popq %rdi
movl %ebx, %esi
movl $0x1404, %edx           # imm = 0x1404
xorl %ecx, %ecx
movl %r15d, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::resize_window(int, int)
void resize_window(int width, int height) {
    recalculate_global_aspect_ratio(width, height);
    glViewport(0, 0, width, height);

    for (u32 cam = 0; cam < OPENGL_NUM_CAMERAS; cam++) {
        GLuint rbo = screen_rbos[cam];
        GLuint texture = screen_textures[cam];
        glBindTexture(GL_TEXTURE_2D, texture);
        glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB,
                GL_UNSIGNED_BYTE, NULL);

        glBindRenderbuffer(GL_RENDERBUFFER, rbo);
        glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8,
                width, height);
    }
    glBindRenderbuffer(GL_RENDERBUFFER, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movl %edi, %r14d
callq 0x1e896
leaq 0x42694(%rip), %rax     # 0x60e68
xorl %r12d, %r12d
xorl %edi, %edi
xorl %esi, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq *(%rax)
leaq 0x41fbf(%rip), %r13     # 0x607a8
cmpq $0x2, %r12
je 0x1e875
leaq 0x47a12(%rip), %rax     # 0x6620c
movl (%rax,%r12,4), %r15d
leaq 0x47a0f(%rip), %rax     # 0x66214
movl (%rax,%r12,4), %esi
movl $0xde1, %edi            # imm = 0xDE1
leaq 0x4129b(%rip), %rax     # 0x5fab0
callq *(%rax)
subq $0x8, %rsp
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
movl $0x1907, %edx           # imm = 0x1907
movl %r14d, %ecx
movl %ebx, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x1401                 # imm = 0x1401
pushq $0x1907                 # imm = 0x1907
leaq 0x421e5(%rip), %rax     # 0x60a28
callq *(%rax)
addq $0x20, %rsp
movl $0x8d41, %edi           # imm = 0x8D41
movl %r15d, %esi
leaq 0x41250(%rip), %rax     # 0x5faa8
callq *(%rax)
movl $0x8d41, %edi           # imm = 0x8D41
movl $0x88f0, %esi           # imm = 0x88F0
movl %r14d, %edx
movl %ebx, %ecx
callq *(%r13)
incq %r12
jmp 0x1e7e9
leaq 0x4122c(%rip), %rax     # 0x5faa8
movq (%rax), %rax
movl $0x8d41, %edi           # imm = 0x8D41
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/camera.cpp
// Function: Renderer::recalculate_global_aspect_ratio(int, int)
void recalculate_global_aspect_ratio(int width, int height) {
    get_window()->width = width;
    get_window()->height = height;
    get_window()->aspect_ratio = (f32) height / (f32) width;

#if OPENGL_AUTO_APPLY_ASPECTRATIO_CHANGE
    for (u32 i = 0; i < OPENGL_NUM_CAMERAS; i++) {
        fetch_camera(i)->aspect_ratio = get_window()->aspect_ratio;
    }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
cvtsi2ss %edi, %xmm0
movss %xmm0, 0x479e4(%rip)    # 0x6628c
cvtsi2ss %esi, %xmm1
movss %xmm1, 0x479dc(%rip)    # 0x66290
divss %xmm0, %xmm1
movss %xmm1, 0x479d4(%rip)    # 0x66294
xorl %ebx, %ebx
cmpl $0x2, %ebx
je 0x1e8e9
movss 0x479c5(%rip), %xmm0    # 0x66294
movss %xmm0, -0xc(%rbp)
movl %ebx, %edi
callq 0x9156
movss -0xc(%rbp), %xmm0
movss %xmm0, 0x14(%rax)
incl %ebx
jmp 0x1e8c2
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::render_post_processing()
void render_post_processing() {
    post_process_shader_program.bind();

    // This needs to run every frame
    {
        for (u32 i = 0; i < OPENGL_NUM_CAMERAS; i++) {
            glBindTexture(GL_TEXTURE_2D, screen_textures[i]);
            glActiveTexture(GL_TEXTURE1 + i);
        }

        glUniform1iv(screen_texture_location, OPENGL_NUM_CAMERAS, &_fog_texture_indicies[0]);
        glUniform1i(num_screen_textures_location, _fog_num_active_cameras);
    }

    glBindVertexArray(screen_quad_vao);
    glDrawArrays(GL_TRIANGLES, 0, 6);
    glBindVertexArray(0);

    glBindTexture(GL_TEXTURE_2D, 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
leaq 0x41fb8(%rip), %rax     # 0x60bc0
leaq 0x473c5(%rip), %rcx     # 0x65fd4
movl (%rcx), %edi
callq *(%rax)
xorl %r14d, %r14d
leaq 0x40e93(%rip), %rbx     # 0x5fab0
leaq 0x475f0(%rip), %r15     # 0x66214
leaq 0x40e05(%rip), %r12     # 0x5fa30
cmpq $0x2, %r14
je 0x1ec4c
movl (%r15,%r14,4), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq *(%rbx)
leal 0x84c1(%r14), %edi
callq *(%r12)
incq %r14
jmp 0x1ec2b
leaq 0x41e6d(%rip), %rax     # 0x60ac0
leaq 0x475ca(%rip), %rcx     # 0x66224
movl (%rcx), %edi
leaq 0x475e1(%rip), %rdx     # 0x66244
pushq $0x2
popq %rsi
callq *(%rax)
leaq 0x41e49(%rip), %rax     # 0x60ab8
leaq 0x475b2(%rip), %rcx     # 0x66228
movl (%rcx), %edi
leaq 0x2cc9d(%rip), %rcx     # 0x4b91c
movl (%rcx), %esi
callq *(%rax)
leaq 0x40e2e(%rip), %r14     # 0x5fab8
leaq 0x4758b(%rip), %rax     # 0x6621c
movl (%rax), %edi
callq *(%r14)
leaq 0x4112b(%rip), %rax     # 0x5fdc8
pushq $0x4
popq %rdi
pushq $0x6
popq %rdx
xorl %esi, %esi
callq *(%rax)
xorl %edi, %edi
callq *(%r14)
movq (%rbx), %rax
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::push_quad(unsigned int, Vec2, Vec2, Vec2, Vec2, float, Vec4)
void push_quad(u32 layer, Vec2 min, Vec2 min_uv, Vec2 max, Vec2 max_uv,
                      f32 sprite, Vec4 color) {
    LAYER_CHECK(layer);
    Vertex verticies[] = {
        {V2(min.x, min.y), V2(min_uv.x, max_uv.y), sprite, color},
        {V2(max.x, min.y), V2(max_uv.x, max_uv.y), sprite, color},
        {V2(max.x, max.y), V2(max_uv.x, min_uv.y), sprite, color},

        {V2(min.x, min.y), V2(min_uv.x, max_uv.y), sprite, color},
        {V2(max.x, max.y), V2(max_uv.x, min_uv.y), sprite, color},
        {V2(min.x, max.y), V2(min_uv.x, min_uv.y), sprite, color},
    };
    sprite_render_queues[layer].push(LEN(verticies), verticies);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movaps %xmm6, -0x70(%rbp)
movaps %xmm5, -0x60(%rbp)
movss %xmm4, -0xc(%rbp)
movaps %xmm3, -0x40(%rbp)
movaps %xmm2, -0x50(%rbp)
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x20(%rbp)
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x10, %edi
setb %cl
leaq 0xceb3(%rip), %rdi      # 0x2c04d
leaq 0xcf2e(%rip), %rdx      # 0x2c0cf
movl $0x1b6, %esi            # imm = 0x1B6
callq 0x6903
movaps -0x40(%rbp), %xmm8
movaps %xmm8, %xmm0
movaps -0x30(%rbp), %xmm2
shufps $0x1, %xmm2, %xmm0      # xmm0 = xmm0[1,0],xmm2[0,0]
movaps -0x20(%rbp), %xmm4
movaps %xmm4, %xmm1
shufps $0x24, %xmm0, %xmm1     # xmm1 = xmm1[0,1],xmm0[2,0]
leaq -0x150(%rbp), %rdx
movaps %xmm1, (%rdx)
movss -0xc(%rbp), %xmm7
movss %xmm7, 0x10(%rdx)
movaps -0x60(%rbp), %xmm3
unpcklpd -0x70(%rbp), %xmm3      # xmm3 = xmm3[0],mem[0]
movups %xmm3, 0x14(%rdx)
movaps %xmm4, %xmm0
movaps %xmm4, %xmm6
movaps -0x50(%rbp), %xmm5
shufps $0x1, %xmm5, %xmm0      # xmm0 = xmm0[1,0],xmm5[0,0]
shufps $0x42, %xmm8, %xmm0     # xmm0 = xmm0[2,0],xmm8[0,1]
movups %xmm0, 0x24(%rdx)
movss %xmm7, 0x34(%rdx)
movups %xmm3, 0x38(%rdx)
movaps %xmm2, %xmm0
movaps %xmm2, %xmm4
shufps $0x1, %xmm8, %xmm0      # xmm0 = xmm0[1,0],xmm8[0,0]
movaps %xmm5, %xmm2
shufps $0x24, %xmm0, %xmm2     # xmm2 = xmm2[0,1],xmm0[2,0]
movups %xmm2, 0x48(%rdx)
movss %xmm7, 0x58(%rdx)
movups %xmm3, 0x5c(%rdx)
movups %xmm1, 0x6c(%rdx)
movss %xmm7, 0x7c(%rdx)
movaps %xmm3, 0x80(%rdx)
movaps %xmm2, 0x90(%rdx)
movss %xmm7, 0xa0(%rdx)
movups %xmm3, 0xa4(%rdx)
movaps %xmm5, %xmm1
shufps $0x1, %xmm6, %xmm1      # xmm1 = xmm1[1,0],xmm6[0,0]
shufps $0x42, %xmm4, %xmm1     # xmm1 = xmm1[2,0],xmm4[0,1]
movups %xmm1, 0xb4(%rdx)
movss %xmm7, 0xc4(%rdx)
movups %xmm3, 0xc8(%rdx)
movl %ebx, %edi
shlq $0x5, %rdi
addq 0x2ad65(%rip), %rdi     # 0x49fe0
pushq $0x6
popq %rsi
callq 0x2968c
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::push_triangle(unsigned int, Vec2, Vec2, Vec2, Vec2, Vec2, Vec2, Vec4, Vec4, Vec4, float)
void push_triangle(u32 layer, Vec2 p1, Vec2 p2, Vec2 p3,
                          Vec2 uv1, Vec2 uv2, Vec2 uv3,
                          Vec4 color1, Vec4 color2, Vec4 color3,
                          f32 sprite) {
    LAYER_CHECK(layer);
    Vertex verticies[] = {
        {p1, uv1, sprite, color1},
        {p2, uv2, sprite, color2},
        {p3, uv3, sprite, color3},
    };
    sprite_render_queues[layer].push(LEN(verticies), verticies);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xf8, %rsp
movaps %xmm7, -0x60(%rbp)
movaps %xmm6, -0x50(%rbp)
movaps %xmm5, -0x90(%rbp)
movaps %xmm4, -0x70(%rbp)
movaps %xmm3, -0x30(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm1, -0x40(%rbp)
movaps %xmm0, -0x20(%rbp)
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x10, %edi
setb %cl
leaq 0xcd16(%rip), %rdi      # 0x2c04d
leaq 0xcd91(%rip), %rdx      # 0x2c0cf
movl $0x1cc, %esi            # imm = 0x1CC
callq 0x6903
movaps -0x20(%rbp), %xmm0
unpcklpd -0x30(%rbp), %xmm0      # xmm0 = xmm0[0],mem[0]
leaq -0x100(%rbp), %rdx
movaps %xmm0, (%rdx)
movss 0x30(%rbp), %xmm0
movss %xmm0, 0x10(%rdx)
movaps -0x50(%rbp), %xmm1
unpcklpd -0x60(%rbp), %xmm1      # xmm1 = xmm1[0],mem[0]
movups %xmm1, 0x14(%rdx)
movaps -0x40(%rbp), %xmm1
unpcklpd -0x70(%rbp), %xmm1      # xmm1 = xmm1[0],mem[0]
movups %xmm1, 0x24(%rdx)
movss %xmm0, 0x34(%rdx)
movaps %xmm0, %xmm1
movaps 0x10(%rbp), %xmm0
movups %xmm0, 0x38(%rdx)
movaps -0x80(%rbp), %xmm0
unpcklpd -0x90(%rbp), %xmm0      # xmm0 = xmm0[0],mem[0]
movups %xmm0, 0x48(%rdx)
movss %xmm1, 0x58(%rdx)
movaps 0x20(%rbp), %xmm0
movups %xmm0, 0x5c(%rdx)
movl %ebx, %edi
shlq $0x5, %rdi
addq 0x2ac27(%rip), %rdi     # 0x49fe0
pushq $0x3
popq %rsi
callq 0x2968c
addq $0xf8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::upload_texture(Image*, int)
FOG_EXPORT
u32 upload_texture(Image *image, s32 index) {
    ASSERT(0 <= index && index <= OPENGL_TEXTURE_DEPTH, "Invalid index.");
    ASSERT(0 < image->components && image->components < 5,
           "Invalid number of components");
    u32 data_format;
    switch (image->components) {
        case (1):
            data_format = GL_RED;
            break;
        case (2):
            data_format = GL_RG;
            break;
        case (3):
            data_format = GL_RGB;
            break;
        case (4):
            data_format = GL_RGBA;
            break;
        default:
            UNREACHABLE;
            return 0;
    }
#if FOG_VERBOSE // A verbose warning, usually just noise.
    CHECK(image->width == OPENGL_TEXTURE_WIDTH &&
              image->height == OPENGL_TEXTURE_HEIGHT,
          "Not using the entire texture 'slice'.");
#endif
    glBindTexture(GL_TEXTURE_2D_ARRAY, sprite_texture_array);
    glTexSubImage3D(GL_TEXTURE_2D_ARRAY, 0, 0, 0, index, image->width,
                    image->height, 1, data_format, GL_UNSIGNED_BYTE, image->data);
    return index;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
cmpl $0x101, %esi            # imm = 0x101
setb %cl
leaq 0xca33(%rip), %r15      # 0x2c04d
leaq 0xcb05(%rip), %rdx      # 0x2c126
movq %r15, %rdi
movl $0x1f3, %esi            # imm = 0x1F3
callq 0x6903
movb 0x10(%r14), %al
decb %al
xorl %ecx, %ecx
cmpb $0x4, %al
setb %cl
leaq 0xcb0f(%rip), %rdx      # 0x2c151
movq %r15, %rdi
movl $0x1f5, %esi            # imm = 0x1F5
callq 0x6903
movb 0x10(%r14), %al
decb %al
cmpb $0x4, %al
jae 0x1f6c0
movzbl %al, %eax
leaq 0xbd7d(%rip), %rcx      # 0x2b3e0
movl (%rcx,%rax,4), %r15d
leaq 0x40442(%rip), %rax     # 0x5fab0
leaq 0x46b8b(%rip), %rcx     # 0x66200
movl (%rcx), %esi
movl $0x8c1a, %edi           # imm = 0x8C1A
callq *(%rax)
leaq 0x41403(%rip), %rax     # 0x60a88
movl 0x8(%r14), %r9d
movl 0xc(%r14), %r10d
subq $0x8, %rsp
movl $0x8c1a, %edi           # imm = 0x8C1A
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
movl %ebx, %r8d
pushq (%r14)
pushq $0x1401                 # imm = 0x1401
pushq %r15
pushq $0x1
pushq %r10
callq *(%rax)
addq $0x30, %rsp
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0x2a909(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
leaq 0xc478(%rip), %rdi      # 0x2bb49
leaq 0xc975(%rip), %rdx      # 0x2c04d
leaq 0xcabf(%rip), %r8       # 0x2c19e
leaq 0xc490(%rip), %r9       # 0x2bb76
movl $0x205, %ecx            # imm = 0x205
xorl %eax, %eax
callq 0x683a
callq 0x68ed
pushq $-0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/performance.cpp
// Function: Perf::_start_perf_clock(Perf::MarkerID, char const*)
void _start_perf_clock(MarkerID id, const char *name) {
    ASSERT(0 <= id && id < NUMBER_OF_MARKERS, "Invalid perf ID");
    volatile Clock *clock = clocks + id;
    clock->name = name;
    CHECK(!clock->active, "Starting allready started clock");
    clock->count++;
    if (!clock->active) {
        clock->active = true;
        clock->start = highp_now();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %r14d
xorl %ecx, %ecx
cmpl $0xa, %edi
setb %cl
leaq 0xc3b9(%rip), %r15      # 0x2c6b6
leaq 0xc3f3(%rip), %rdx      # 0x2c6f7
pushq $0x15
popq %rsi
movq %r15, %rdi
callq 0x6903
movslq %r14d, %rax
imulq $0x48, %rax, %r12
leaq 0x2b323(%rip), %r14     # 0x4b640
movq %rbx, (%r14,%r12)
xorl %ecx, %ecx
cmpb $0x0, 0x8(%r14,%r12)
sete %cl
leaq 0xc3f7(%rip), %rdx      # 0x2c72a
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0x693a
incq 0x10(%r14,%r12)
cmpb $0x0, 0x8(%r14,%r12)
jne 0x2035c
addq %r12, %r14
movb $0x1, 0x8(%r14)
callq 0x21914
movq %rax, 0x18(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq