LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x25e62(%rip), %rdi     # 0x30ccf
leaq 0x26013(%rip), %rdx     # 0x30e87
movl $0x71, %esi
callq 0x729c
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xae8c
callq 0xae55
leaq 0x44f85(%rip), %rax     # 0x4fe18
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_O3/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
leaq 0x443d2(%rip), %rax     # 0x4f2d8
movl 0x10(%rax), %ecx
movq 0x18(%rax), %rdx
xorl %eax, %eax
movq %rcx, %rsi
xorl %r8d, %r8d
leaq (%rsi,%r8), %r10
cmpq $-0x1, %r10
jl 0xaf6f
movq %r10, %r9
shrq $0x3f, %r9
addq %r10, %r9
sarq %r9
cmpq %rcx, %r9
jg 0xaf6f
movq %r9, %r10
shlq $0x4, %r10
cmpl %edi, (%rdx,%r10)
jbe 0xaf46
decq %r9
movq %r9, %rsi
jmp 0xaf4e
jae 0xaf55
incq %r9
movq %r9, %r8
cmpq %rsi, %r8
jle 0xaf15
jmp 0xaf6f
leaq (%rdx,%r10), %rcx
addq $0x10, %rcx
leaq -0x10(%rcx), %rax
cmpl $0x0, -0x18(%rcx)
je 0xaf6f
cmpl %edi, -0x20(%rcx)
movq %rax, %rcx
je 0xaf5d
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x44350(%rip), %r15     # 0x4f2d8
movl 0x10(%r15), %eax
xorl %ecx, %ecx
cmpl 0xc(%r15), %eax
setb %cl
leaq 0x25f13(%rip), %rdi     # 0x30eaf
leaq 0x25f2a(%rip), %rdx     # 0x30ecd
movl $0x18, %esi
callq 0x729c
movl 0x10(%r15), %ecx
movq %rcx, %rax
shlq $0x4, %rax
addq 0x18(%r15), %rax
testq %rcx, %rcx
je 0xafdc
cmpl %r14d, -0x10(%rax)
jbe 0xafdc
leaq -0x10(%rax), %rcx
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq %rcx, %rax
cmpq 0x18(%r15), %rcx
jne 0xafc1
jmp 0xafdf
movq %rax, %rcx
movq %r14, (%rcx)
movq %rbx, 0x8(%rcx)
incl 0x10(%r15)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x442d8(%rip), %rax     # 0x4f2d8
movl 0x8(%rax), %ecx
movq %rcx, %rdx
shlq $0x4, %rdx
xorl %esi, %esi
testl %ecx, %ecx
je 0xb027
movq 0x20(%rax,%rsi,8), %rdi
xorl %r8d, %r8d
andl $0x1, 0x8(%rdi,%r8)
addq $0x10, %r8
cmpq %r8, %rdx
jne 0xb018
incq %rsi
cmpq $0x4, %rsi
jne 0xb00c
xorps %xmm0, %xmm0
movups %xmm0, 0x7c(%rax)
movl $0x0, 0x8c(%rax)
andl $0x1, 0x68(%rax)
andl $0x1, 0x6c(%rax)
andl $0x1, 0x70(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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, -0x30(%rbp)
movl %edi, -0x2c(%rbp)
callq 0xaefb
testq %rax, %rax
je 0xb182
movq %rax, %r14
cmpl $0x0, 0x8(%rax)
je 0xb182
movl -0x2c(%rbp), %eax
cmpl %eax, (%r14)
jne 0xb182
xorps %xmm0, %xmm0
cmpneqss -0x30(%rbp), %xmm0
movd %xmm0, %eax
movl $0x2, %ecx
subl %eax, %ecx
movl %ecx, -0x34(%rbp)
addq $0x8, %r14
leaq 0x25acc(%rip), %rbx     # 0x30b7d
movq %rbx, %rdi
movl $0x76, %esi
leaq 0x2752f(%rip), %r12     # 0x325ef
movq %r12, %rdx
movl $0x1, %ecx
callq 0x729c
movl (%r14), %eax
movzbl 0x4(%r14), %ecx
leal (%rcx,%rax,4), %r15d
xorl %ecx, %ecx
leaq 0x441f6(%rip), %r13     # 0x4f2d8
cmpl 0x8(%r13), %r15d
setb %cl
leaq 0x25dbf(%rip), %r13     # 0x30eaf
movq %r13, %rdi
movl $0x55, %esi
leaq 0x25e5c(%rip), %rdx     # 0x30f5b
callq 0x729c
xorl %ecx, %ecx
cmpl $0x0, (%r14)
setne %cl
movq %rbx, %rdi
movl $0x7b, %esi
movq %r12, %rdx
callq 0x729c
movl -0x4(%r14), %edi
callq 0x9ec0
movl %eax, %ebx
movq %r13, %rdi
movl $0x57, %esi
leaq 0x25e74(%rip), %rdx     # 0x30fab
movl $0x1, %ecx
callq 0x729c
movl %ebx, %eax
leaq 0x4418e(%rip), %rcx     # 0x4f2d8
movq 0x20(%rcx,%rax,8), %rax
shlq $0x4, %r15
movss -0x30(%rbp), %xmm0
movss %xmm0, 0xc(%rax,%r15)
movl -0x34(%rbp), %ecx
movl %ecx, 0x8(%rax,%r15)
cmpl $0x0, 0x10(%r14)
je 0xb182
leaq 0x10(%r14), %rax
movl -0x2c(%rbp), %ecx
cmpl %ecx, 0x8(%r14)
movq %rax, %r14
je 0xb0aa
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
cmpb $0x0, (%rdi)
je 0xb20b
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x4412d(%rip), %r14     # 0x4f2d8
movl 0x44(%r14), %r15d
leal -0x20(%r15), %r12d
movq %rbx, %rdi
callq 0xaa4e
movzbl %al, %ecx
cmpl %ecx, %r12d
jb 0xb203
testb %al, %al
je 0xb1e3
movl %r15d, %eax
addq %r14, %rax
addq $0x48, %rax
xorl %edx, %edx
movb (%rbx,%rdx), %sil
movb %sil, (%rax,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0xb1d3
movq %rbx, %rdi
callq 0xaa4e
movzbl %al, %eax
movl 0x44(%r14), %r15d
addl %eax, %r15d
movl %r15d, 0x44(%r14)
cmpb $0x0, (%rbx,%rax)
leaq (%rbx,%rax), %rbx
jne 0xb1af
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x440c5(%rip), %rax     # 0x4f2d8
cmpl $0x0, 0x44(%rax)
je 0xb245
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
cmpb $0x0, (%rdi)
je 0xb248
movq %r14, %rax
leaq 0x1(%rax), %r13
decl %ebx
cmpb $0x0, 0x1(%rax)
movq %r13, %rax
jne 0xb234
jmp 0xb24b
xorl %eax, %eax
retq
movq %r14, %r13
leaq 0x44086(%rip), %rax     # 0x4f2d8
leaq 0x48(%rax), %r15
movq %r15, %rdi
callq 0xaa4e
movzbl %al, %r12d
cmpb $0x8, (%r15)
movl %r12d, %ecx
jne 0xb291
cmpq %r14, %r13
je 0xb2cd
decq %r13
movq %r13, %rax
incl %ebx
leaq -0x1(%rax), %r13
cmpq %r14, %rax
jbe 0xb28c
movb (%rax), %al
andb $-0x40, %al
negb %al
movq %r13, %rax
jo 0xb276
incq %r13
jmp 0xb2d0
movq %rcx, -0x30(%rbp)
movq %r15, %rdi
callq 0xaa4e
movzbl %al, %ecx
cmpl %ecx, %ebx
jae 0xb2aa
movq -0x30(%rbp), %rcx
jmp 0xb2d0
testb %al, %al
je 0xb2c1
xorl %eax, %eax
movb (%r15,%rax), %dl
movb %dl, (%r13,%rax)
incq %rax
cmpq %rax, %rcx
jne 0xb2b0
movq -0x30(%rbp), %rcx
addq %rcx, %r13
subl %r12d, %ebx
jmp 0xb2d0
movq %r14, %r13
addq %rcx, %r15
leaq 0x43ffe(%rip), %rcx     # 0x4f2d8
movl 0x44(%rcx), %eax
addq %rcx, %rax
addq $0x48, %rax
cmpq %rax, %r15
jb 0xb256
movb $0x0, (%r13)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
leaq 0x43faa(%rip), %rax     # 0x4f2d8
movb 0x40(%rax), %cl
movb %cl, -0x29(%rbp)
movb $0x0, 0x40(%rax)
movl %edi, %eax
xorl %ecx, %ecx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
movl %esi, -0x30(%rbp)
movq %rax, -0x38(%rbp)
movl $0x1, %r8d
shll %cl, %r8d
btl %ecx, %esi
jae 0xb3f7
movq %rcx, -0x40(%rbp)
shlq $0x20, %r8
andq %rdx, %r13
orq %rax, %r13
movl $0x4, %r14d
xorl %r15d, %r15d
movabsq $0x100000000, %rbx      # imm = 0x100000000
movq %r8, -0x48(%rbp)
movq %r13, %r12
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r12
leaq (%r15,%r12), %rdx
leaq 0x43f39(%rip), %rdi     # 0x4f2d8
movq %r8, %rsi
movq %rdx, %r13
callq 0x2d55e
testl %eax, %eax
sete %al
testb $0x2, %dl
sete %cl
orb %al, %cl
je 0xb406
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %rbx
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
decq %r14
movq -0x48(%rbp), %r8
jne 0xb384
subq %rbx, %r12
movq %r12, %r13
movl -0x30(%rbp), %esi
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movabsq $-0x10000000000, %rdx   # imm = 0xFFFFFF0000000000
incl %ecx
cmpl $0x4, %ecx
jne 0xb34d
xorl %eax, %eax
jmp 0xb408
movb $0x1, %al
leaq 0x43ec9(%rip), %rcx     # 0x4f2d8
movb -0x29(%rbp), %dl
movb %dl, 0x40(%rcx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
leaq 0x43e9c(%rip), %rax     # 0x4f2d8
xorl %ecx, %ecx
cmpb $0x0, 0x40(%rax)
movl $0x0, %eax
jne 0xb51c
movl %edi, %eax
movq %rax, -0x40(%rbp)
movb $0x1, %al
movl %esi, -0x2c(%rbp)
movl $0x1, %ebx
shll %cl, %ebx
btl %ecx, %esi
jae 0xb506
movq %rax, -0x48(%rbp)
movq %rcx, -0x38(%rbp)
shlq $0x20, %rbx
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r15
addq -0x40(%rbp), %r15
movl $0x4, %r14d
xorl %eax, %eax
movq %rax, %r13
movq %r15, %r12
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r12
leaq (%r12,%r13), %r15
leaq 0x43e2d(%rip), %rdi     # 0x4f2d8
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2d55e
shrl %edx
andl $0x1, %edx
testl %eax, %eax
movl %edx, %eax
movl $0x7, %ecx
cmovel %ecx, %eax
cmpl $0x7, %eax
je 0xb4d0
testl %eax, %eax
jne 0xb4f1
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r13, %rax
decq %r14
jne 0xb48d
addq %r12, %r13
movq %r13, %r15
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rcx
jmp 0xb506
testl %edx, %edx
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rax
jne 0xb51a
addq %r12, %r13
movq %r13, %r15
cmpl $0x3, %ecx
leal 0x1(%rcx), %edx
setb %al
movl %edx, %ecx
cmpl $0x4, %edx
jne 0xb458
andb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
leaq 0x43d95(%rip), %rax     # 0x4f2d8
xorl %ecx, %ecx
cmpb $0x0, 0x40(%rax)
movl $0x0, %eax
jne 0xb628
movl %edi, %eax
movq %rax, -0x40(%rbp)
movb $0x1, %al
movl %esi, -0x2c(%rbp)
movl $0x1, %ebx
shll %cl, %ebx
btl %ecx, %esi
jae 0xb612
movq %rax, -0x48(%rbp)
movq %rcx, -0x38(%rbp)
shlq $0x20, %rbx
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r12
addq -0x40(%rbp), %r12
movl $0x4, %r15d
xorl %eax, %eax
movq %rax, %r13
movq %r12, %r14
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r14
leaq (%r14,%r13), %r12
leaq 0x43d26(%rip), %rdi     # 0x4f2d8
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2d55e
movl %edx, %ecx
xorl %edx, %edx
cmpq $0x3, %rcx
sete %dl
testl %eax, %eax
movl $0x7, %eax
cmovel %eax, %edx
cmpl $0x7, %edx
je 0xb5db
testl %edx, %edx
jne 0xb5fc
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r13, %rax
decq %r15
jne 0xb594
addq %r14, %r13
movq %r13, %r12
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rcx
jmp 0xb612
cmpl $0x3, %ecx
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rax
je 0xb626
addq %r14, %r13
movq %r13, %r12
cmpl $0x3, %ecx
leal 0x1(%rcx), %edx
setb %al
movl %edx, %ecx
cmpl $0x4, %edx
jne 0xb55f
andb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
leaq 0x43c89(%rip), %rax     # 0x4f2d8
xorl %ecx, %ecx
cmpb $0x0, 0x40(%rax)
movl $0x0, %eax
jne 0xb734
movl %edi, %eax
movq %rax, -0x40(%rbp)
movb $0x1, %al
movl %esi, -0x2c(%rbp)
movl $0x1, %ebx
shll %cl, %ebx
btl %ecx, %esi
jae 0xb71e
movq %rax, -0x48(%rbp)
movq %rcx, -0x38(%rbp)
shlq $0x20, %rbx
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r12
addq -0x40(%rbp), %r12
movl $0x4, %r15d
xorl %eax, %eax
movq %rax, %r13
movq %r12, %r14
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r14
leaq (%r14,%r13), %r12
leaq 0x43c1a(%rip), %rdi     # 0x4f2d8
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2d55e
movl %edx, %ecx
xorl %edx, %edx
cmpq $0x2, %rcx
sete %dl
testl %eax, %eax
movl $0x7, %eax
cmovel %eax, %edx
cmpl $0x7, %edx
je 0xb6e7
testl %edx, %edx
jne 0xb708
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r13, %rax
decq %r15
jne 0xb6a0
addq %r14, %r13
movq %r13, %r12
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rcx
jmp 0xb71e
cmpl $0x2, %ecx
movl -0x2c(%rbp), %esi
movq -0x38(%rbp), %rcx
movq -0x48(%rbp), %rax
je 0xb732
addq %r14, %r13
movq %r13, %r12
cmpl $0x3, %ecx
leal 0x1(%rcx), %edx
setb %al
movl %edx, %ecx
cmpl $0x4, %edx
jne 0xb66b
andb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
leaq 0x43b7d(%rip), %rax     # 0x4f2d8
xorl %ecx, %ecx
cmpb $0x0, 0x40(%rax)
jne 0xb84a
movl %edi, %edx
movb $0x1, %r8b
movabsq $-0x10000000000, %rdi   # imm = 0xFFFFFF0000000000
movl %esi, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movl $0x1, %r9d
shll %cl, %r9d
btl %ecx, %esi
jae 0xb82a
movb %r8b, -0x29(%rbp)
movq %rcx, -0x40(%rbp)
shlq $0x20, %r9
andq %rdi, %r13
orq %rdx, %r13
movl $0x4, %ebx
xorl %r14d, %r14d
movabsq $0x100000000, %r15      # imm = 0x100000000
movq %r9, -0x48(%rbp)
movq %r13, %r12
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r12
leaq (%r14,%r12), %rdx
leaq 0x43b06(%rip), %rdi     # 0x4f2d8
movq %r9, %rsi
movq %rdx, %r13
callq 0x2d55e
testl %eax, %eax
sete %al
testb $0x1, %dl
sete %cl
orb %al, %cl
je 0xb843
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r15
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r14
decq %rbx
movq -0x48(%rbp), %r9
jne 0xb7b7
subq %r15, %r12
movq %r12, %r13
movl -0x30(%rbp), %esi
movq -0x40(%rbp), %rcx
movq -0x38(%rbp), %rdx
movabsq $-0x10000000000, %rdi   # imm = 0xFFFFFF0000000000
cmpl $0x3, %ecx
leal 0x1(%rcx), %eax
setb %r8b
movl %eax, %ecx
cmpl $0x4, %eax
jne 0xb77d
xorl %ecx, %ecx
jmp 0xb84a
movb -0x29(%rbp), %al
andb $0x1, %al
movl %eax, %ecx
movl %ecx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 $0x28, %rsp
leaq 0x43a65(%rip), %rax     # 0x4f2d8
xorps %xmm0, %xmm0
cmpb $0x0, 0x40(%rax)
jne 0xb989
movl %edi, %eax
movq %rax, -0x40(%rbp)
xorl %ebx, %ebx
xorl %ecx, %ecx
movl %esi, -0x30(%rbp)
movl $0x1, %r8d
shll %cl, %r8d
btl %ecx, %esi
jae 0xb967
movl %ecx, -0x34(%rbp)
shlq $0x20, %r8
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %rdx
addq -0x40(%rbp), %rdx
movl $0x4, %r15d
xorl %r13d, %r13d
movabsq $0x100000000, %r14      # imm = 0x100000000
movq %r8, -0x48(%rbp)
movss %xmm0, -0x2c(%rbp)
movq %rdx, %r12
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r12
leaq (%r12,%r13), %rdx
leaq 0x439ea(%rip), %rdi     # 0x4f2d8
movq %r8, %rsi
movq %rdx, -0x50(%rbp)
callq 0x2d55e
testl %eax, %eax
setne %sil
movl %edx, %ecx
andb %sil, %cl
jne 0xb90e
movss -0x2c(%rbp), %xmm0
jmp 0xb92b
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, %ebx
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r13
decq %r15
movq -0x50(%rbp), %rdx
movq -0x48(%rbp), %r8
jne 0xb8ce
subq %r14, %r12
movq %r12, %rdx
movl -0x30(%rbp), %esi
movl -0x34(%rbp), %ecx
incl %ecx
cmpl $0x4, %ecx
jne 0xb88d
testl %ebx, %ebx
je 0xb986
movl %ebx, %eax
xorps %xmm1, %xmm1
cvtsi2ss %rax, %xmm1
divss %xmm1, %xmm0
jmp 0xb989
xorps %xmm0, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
movaps %xmm0, -0x20(%rbp)
xorl %ecx, %ecx
cmpl $0x2, %edi
setb %cl
leaq 0x25b7d(%rip), %rdi     # 0x31533
leaq 0x25be5(%rip), %rdx     # 0x315a2
movl $0x52, %esi
callq 0x729c
movl %ebx, %eax
shlq $0x5, %rax
leaq 0x5f86c(%rip), %rcx     # 0x6b240
movss 0x24628(%rip), %xmm1    # 0x30004
movaps %xmm1, %xmm2
divss 0x5f899(%rip), %xmm2    # 0x6b280
divss 0x10(%rax,%rcx), %xmm1
movaps -0x20(%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,%rcx), %xmm1
mulss %xmm2, %xmm3
subss %xmm3, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4379b(%rip), %rax     # 0x4f2d8
cvtsi2ssl 0x74(%rax), %xmm0
movss 0x244ba(%rip), %xmm1    # 0x30004
cvtsi2ssl 0x78(%rax), %xmm2
divss 0x5f729(%rip), %xmm1    # 0x6b280
addss %xmm0, %xmm0
mulss %xmm1, %xmm0
addss %xmm2, %xmm2
mulss %xmm1, %xmm2
addss 0x246b9(%rip), %xmm0    # 0x30228
movss 0x5f711(%rip), %xmm1    # 0x6b288
subss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
pushq %rbx
subq $0x28, %rsp
leaq 0x4371a(%rip), %rax     # 0x4f2d8
cvtsi2ssl 0x7c(%rax), %xmm0
movaps %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
cvtsi2ssl 0x80(%rax), %xmm0
movaps %xmm0, -0x30(%rbp)
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x2, %edi
setb %cl
leaq 0x2594c(%rip), %rdi     # 0x31533
leaq 0x259b4(%rip), %rdx     # 0x315a2
movl $0x52, %esi
callq 0x729c
movl %ebx, %eax
leaq 0x5f63f(%rip), %rcx     # 0x6b240
movss 0x243fb(%rip), %xmm2    # 0x30004
movaps %xmm2, %xmm1
divss 0x5f66c(%rip), %xmm1    # 0x6b280
shlq $0x5, %rax
divss 0x10(%rax,%rcx), %xmm2
movaps -0x20(%rbp), %xmm0
addss %xmm0, %xmm0
mulss %xmm2, %xmm0
mulss %xmm1, %xmm0
movaps -0x30(%rbp), %xmm3
mulss 0x245de(%rip), %xmm3    # 0x30218
mulss %xmm2, %xmm3
mulss %xmm1, %xmm3
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
addq $0x28, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x435de(%rip), %r15     # 0x4f2d8
xorl %ecx, %ecx
cmpl $0x0, 0x90(%r15)
setne %cl
leaq 0x251a1(%rip), %r14     # 0x30eaf
leaq 0x252d6(%rip), %rdx     # 0x30feb
movq %r14, %rdi
movl $0x120, %esi            # imm = 0x120
callq 0x729c
xorl %ecx, %ecx
cmpl $0x0, 0xc(%r15)
sete %cl
leaq 0x252e7(%rip), %rdx     # 0x3101a
movq %r14, %rdi
movl $0x121, %esi            # imm = 0x121
callq 0x729c
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_O3/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 0x4356f(%rip), %rbx     # 0x4f2d8
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 0xacd1
movq %rax, (%rbx)
movq (%rbx), %rdi
movl 0x8(%rbx), %esi
callq 0x2d5f2
movq %rax, 0x20(%rbx,%r14,8)
incq %r14
cmpq $0x4, %r14
jne 0xbd8c
movq (%rbx), %rdi
movl 0xc(%rbx), %esi
callq 0x2d704
movq %rax, 0x18(%rbx)
movb $0x1, %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movb $0x1, %r14b
xorl %eax, %eax
leaq 0x24c5f(%rip), %r15     # 0x30a30
xorl %ebx, %ebx
movslq (%r15,%rax,4), %rdi
addq %r15, %rdi
movl $0x102, %esi            # imm = 0x102
callq 0x2410
movq %rax, 0x5f515(%rip)     # 0x6b300
testq %rax, %rax
jne 0xbe03
movl $0x1, %eax
testb $0x1, %r14b
movl $0x0, %r14d
jne 0xbdd3
jmp 0xbe4c
leaq 0x26824(%rip), %rsi     # 0x3262e
movq %rax, %rdi
callq 0x2150
movq %rax, 0x5f4ef(%rip)     # 0x6b308
testq %rax, %rax
je 0xbe4a
leaq 0x10a4e(%rip), %rdi     # 0x1c873
callq 0xbe59
movl %eax, %ebx
movq 0x5f4cd(%rip), %rdi     # 0x6b300
testq %rdi, %rdi
je 0xbe4c
callq 0x24b0
movq $0x0, 0x5f4b8(%rip) # 0x6b300
jmp 0xbe4c
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4ea7d(%rip), %rdi     # 0x6b300
testq %rdi, %rdi
je 0x1c8b3
movq 0x4ea79(%rip), %rax     # 0x6b308
testq %rax, %rax
je 0x1c8a5
movq %rbx, %rdi
callq *%rax
testq %rax, %rax
jne 0x1c8b5
movq 0x4ea5b(%rip), %rdi     # 0x6b300
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_O3/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 %rbx
pushq %rax
leaq 0x45221(%rip), %rbx     # 0x64e38
xorl %edi, %edi
callq *(%rbx)
movl $0x1, %edi
callq *(%rbx)
movl $0x2, %edi
callq *(%rbx)
movl $0x3, %edi
callq *(%rbx)
leaq 0x46211(%rip), %rbx     # 0x65e48
xorl %edi, %edi
movl $0x2, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x24, %r8d
xorl %r9d, %r9d
callq *(%rbx)
movl $0x8, %r9d
movl $0x1, %edi
movl $0x2, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x24, %r8d
callq *(%rbx)
movl $0x10, %r9d
movl $0x2, %edi
movl $0x1, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x24, %r8d
callq *(%rbx)
movq (%rbx), %rax
movl $0x14, %r9d
movl $0x3, %edi
movl $0x4, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x24, %r8d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
leaq 0x45175(%rip), %rbx     # 0x64e38
xorl %edi, %edi
callq *(%rbx)
movl $0x1, %edi
callq *(%rbx)
movl $0x2, %edi
callq *(%rbx)
movl $0x3, %edi
callq *(%rbx)
movl $0x4, %edi
callq *(%rbx)
movl $0x5, %edi
callq *(%rbx)
movl $0x6, %edi
callq *(%rbx)
leaq 0x46150(%rip), %rbx     # 0x65e48
xorl %edi, %edi
movl $0x2, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x30, %r8d
xorl %r9d, %r9d
callq *(%rbx)
movl $0x8, %r9d
movl $0x1, %edi
movl $0x2, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x30, %r8d
callq *(%rbx)
movl $0x10, %r9d
movl $0x2, %edi
movl $0x1, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x30, %r8d
callq *(%rbx)
movl $0x14, %r9d
movl $0x3, %edi
movl $0x4, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x30, %r8d
callq *(%rbx)
movl $0x24, %r9d
movl $0x4, %edi
movl $0x1, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x30, %r8d
callq *(%rbx)
movl $0x28, %r9d
movl $0x5, %edi
movl $0x1, %esi
movl $0x1406, %edx           # imm = 0x1406
xorl %ecx, %ecx
movl $0x30, %r8d
callq *(%rbx)
movq (%rbx), %rax
movl $0x2c, %r9d
movl $0x6, %edi
movl $0x1, %esi
movl $0x1404, %edx           # imm = 0x1404
xorl %ecx, %ecx
movl $0x30, %r8d
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/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 0x1feba
leaq 0x46065(%rip), %rax     # 0x65e58
xorl %r13d, %r13d
xorl %edi, %edi
xorl %esi, %esi
movl %r14d, %edx
movl %ebx, %ecx
callq *(%rax)
movb $0x1, %r12b
leaq 0x4b3f1(%rip), %rax     # 0x6b1fc
movl (%rax,%r13,4), %r15d
leaq 0x4b3ee(%rip), %rax     # 0x6b204
movl (%rax,%r13,4), %esi
movl $0xde1, %edi            # imm = 0xDE1
leaq 0x44c7a(%rip), %rax     # 0x64aa0
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 0x45bc4(%rip), %rax     # 0x65a18
callq *(%rax)
addq $0x20, %rsp
movl $0x8d41, %edi           # imm = 0x8D41
movl %r15d, %esi
leaq 0x44c2f(%rip), %rax     # 0x64a98
callq *(%rax)
movl $0x8d41, %edi           # imm = 0x8D41
movl $0x88f0, %esi           # imm = 0x88F0
movl %r14d, %edx
movl %ebx, %ecx
leaq 0x45917(%rip), %rax     # 0x65798
callq *(%rax)
movl $0x1, %r13d
testb $0x1, %r12b
movl $0x0, %r12d
jne 0x1fe04
leaq 0x44bf8(%rip), %rax     # 0x64a98
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_O3/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 %r14
pushq %rbx
subq $0x10, %rsp
cvtsi2ss %edi, %xmm0
cvtsi2ss %esi, %xmm1
movss %xmm0, 0x4b3ab(%rip)    # 0x6b280
movss %xmm1, 0x4b3a7(%rip)    # 0x6b284
divss %xmm0, %xmm1
movss %xmm1, -0x14(%rbp)
movss %xmm1, 0x4b39a(%rip)    # 0x6b288
leaq 0x1163e(%rip), %rbx     # 0x31533
leaq 0x116a6(%rip), %r14     # 0x315a2
movq %rbx, %rdi
movl $0x52, %esi
movq %r14, %rdx
movl $0x1, %ecx
callq 0x729c
movss -0x14(%rbp), %xmm0
movss %xmm0, 0x4b336(%rip)    # 0x6b254
movss 0x4b362(%rip), %xmm0    # 0x6b288
movss %xmm0, -0x14(%rbp)
movq %rbx, %rdi
movl $0x52, %esi
movq %r14, %rdx
movl $0x1, %ecx
callq 0x729c
movss -0x14(%rbp), %xmm0
movss %xmm0, 0x4b327(%rip)    # 0x6b274
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %rbx
pushq %rax
leaq 0x45941(%rip), %rax     # 0x65bb0
leaq 0x4ad4e(%rip), %rcx     # 0x6afc4
movl (%rcx), %edi
callq *(%rax)
leaq 0x4481f(%rip), %rbx     # 0x64aa0
leaq 0x4af7c(%rip), %r14     # 0x6b204
movl (%r14), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq *(%rbx)
leaq 0x44787(%rip), %r15     # 0x64a20
movl $0x84c1, %edi           # imm = 0x84C1
callq *(%r15)
movl 0x4(%r14), %esi
movl $0xde1, %edi            # imm = 0xDE1
callq *(%rbx)
movl $0x84c2, %edi           # imm = 0x84C2
callq *(%r15)
leaq 0x457f5(%rip), %rax     # 0x65ab0
leaq 0x4af52(%rip), %rcx     # 0x6b214
movl (%rcx), %edi
leaq 0x4af69(%rip), %rdx     # 0x6b234
movl $0x2, %esi
callq *(%rax)
leaq 0x457cf(%rip), %rax     # 0x65aa8
leaq 0x4af38(%rip), %rcx     # 0x6b218
movl (%rcx), %edi
leaq 0x30623(%rip), %rcx     # 0x5090c
movl (%rcx), %esi
callq *(%rax)
leaq 0x447b4(%rip), %r14     # 0x64aa8
leaq 0x4af11(%rip), %rax     # 0x6b20c
movl (%rax), %edi
callq *(%r14)
leaq 0x44ab1(%rip), %rax     # 0x64db8
movl $0x4, %edi
xorl %esi, %esi
movl $0x6, %edx
callq *(%rax)
xorl %edi, %edi
callq *(%r14)
movq (%rbx), %rax
movl $0xde1, %edi            # imm = 0xDE1
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/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 0x1086b(%rip), %rdi     # 0x31075
leaq 0x108e6(%rip), %rdx     # 0x310f7
movl $0x1b6, %esi            # imm = 0x1B6
callq 0x729c
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 0x2e6f5(%rip), %rdi     # 0x4efe0
movl $0x6, %esi
callq 0x2d8ee
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x106cc(%rip), %rdi     # 0x31075
leaq 0x10747(%rip), %rdx     # 0x310f7
movl $0x1cc, %esi            # imm = 0x1CC
callq 0x729c
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 0x2e5b5(%rip), %rdi     # 0x4efe0
movl $0x3, %esi
callq 0x2d8ee
addq $0xf8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x103df(%rip), %r15     # 0x31075
leaq 0x104b1(%rip), %rdx     # 0x3114e
movq %r15, %rdi
movl $0x1f3, %esi            # imm = 0x1F3
callq 0x729c
movb 0x10(%r14), %al
decb %al
xorl %ecx, %ecx
cmpb $0x4, %al
setb %cl
leaq 0x104bb(%rip), %rdx     # 0x31179
movq %r15, %rdi
movl $0x1f5, %esi            # imm = 0x1F5
callq 0x729c
movb 0x10(%r14), %al
decb %al
cmpb $0x4, %al
jae 0x20d3c
movzbl %al, %eax
leaq 0xf711(%rip), %rcx      # 0x303f0
movl (%rcx,%rax,4), %r15d
leaq 0x43db6(%rip), %rax     # 0x64aa0
leaq 0x4a4ff(%rip), %rcx     # 0x6b1f0
movl (%rcx), %esi
movl $0x8c1a, %edi           # imm = 0x8C1A
callq *(%rax)
leaq 0x44d77(%rip), %rax     # 0x65a78
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 0x2e28d(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xfe24(%rip), %rdi      # 0x30b71
leaq 0x10321(%rip), %rdx     # 0x31075
leaq 0x1046b(%rip), %r8      # 0x311c6
leaq 0xfe3c(%rip), %r9       # 0x30b9e
movl $0x205, %ecx            # imm = 0x205
xorl %eax, %eax
callq 0x718c
callq 0x7243
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2330