LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::tweak(char const*, unsigned char*)
b8 tweak(const char *name, b8 *value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %s", name, *value ? "true" : "false");
    debug_value_logic(name, buffer);

    if (name == global_tweak.active && Input::mouse_pressed(0)) {
        *value = !*value;
        return true;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x45d86(%rip)     # 0x4f370
je 0x964b
movq %rsi, %rbx
movq %rdi, %r15
cmpb $0x0, (%rsi)
leaq 0x282bb(%rip), %rax     # 0x318b7
leaq 0x282af(%rip), %rdx     # 0x318b2
cmoveq %rax, %rdx
leaq 0x2829c(%rip), %rdi     # 0x318aa
xorl %r14d, %r14d
movq %r15, %rsi
xorl %eax, %eax
callq 0xaafe
movq %r15, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x467cb(%rip), %rax     # 0x4fdf8
cmpq %r15, 0x18(%rax)
jne 0x964e
leaq 0x45c9e(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
jne 0x964e
cmpb $0x0, (%rbx)
sete (%rbx)
movb $0x1, %r14b
jmp 0x964e
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::tweak(char const*, int*)
b8 tweak(const char *name, s32 *value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %d", name, *value);
    debug_value_logic(name, buffer);

    if (name == global_tweak.hot) {
        s32 delta = moved_over_boundry().x;
        *value += delta;
        return delta != 0;
    }
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x45cf9(%rip)     # 0x4f370
je 0x96bc
movq %rsi, %rbx
movq %rdi, %r15
movl (%rsi), %edx
leaq 0x2823f(%rip), %rdi     # 0x318c7
xorl %r14d, %r14d
movq %r15, %rsi
xorl %eax, %eax
callq 0xaafe
movq %r15, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x46751(%rip), %rax     # 0x4fdf8
cmpq %r15, 0x20(%rax)
jne 0x96bf
callq 0x24124
addl %eax, (%rbx)
testl %eax, %eax
setne %r14b
jmp 0x96bf
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::tweak(char const*, unsigned int*)
b8 tweak(const char *name, u32 *value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %u", name, *value);
    debug_value_logic(name, buffer);

    if (name == global_tweak.hot) {
        s32 delta = moved_over_boundry().x;
        if ((s32) *value < -delta) {
            *value = 0;
        } else {
            *value += delta;
        }
        return delta != 0;
    }
    return true;
}

// Assembly:
cmpb $0x0, 0x45c92(%rip)     # 0x4f370
je 0x9746
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %edx
leaq 0x281d6(%rip), %rdi     # 0x318cf
xorl %r15d, %r15d
movq %r14, %rsi
xorl %eax, %eax
callq 0xaafe
movq %r14, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x466e0(%rip), %rcx     # 0x4fdf8
movb $0x1, %al
cmpq %r14, 0x20(%rcx)
jne 0x973b
callq 0x24124
movq %rax, %rcx
movl (%rbx), %edx
movl %ecx, %esi
negl %esi
setb %al
addl %edx, %ecx
cmpl %esi, %edx
cmovll %r15d, %ecx
movl %ecx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::tweak(char const*, float*, float)
b8 tweak(const char *name, f32 *value, f32 modifier) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %.4f", name, *value);
    debug_value_logic(name, buffer);

    if (name == global_tweak.hot) {
        f32 delta;
        if (Input::down(TWEAK_STEP)) {
            delta = moved_over_boundry().x;

            if (Input::down(TWEAK_SMOOTH))
                delta *= 0.1;

            if (delta) {
                *value += delta;
                precise_snap(value);
            }
        } else {
            delta = scaled_mouse_movements().x;
            *value += delta * modifier;
        }
        return delta != 0;
    }
    return false;
}

// Assembly:
cmpb $0x0, 0x45c16(%rip)     # 0x4f370
je 0x97a8
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movss %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
cvtss2sd (%rsi), %xmm0
leaq 0x2813e(%rip), %rdi     # 0x318bd
movq %r14, %rsi
movb $0x1, %al
callq 0xaafe
movq %r14, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x4665d(%rip), %r15     # 0x4fdf8
cmpq %r14, 0x20(%r15)
je 0x97ab
xorl %eax, %eax
jmp 0x98d3
xorl %eax, %eax
retq
leaq 0x5b1ce(%rip), %rax     # 0x64980
movl (%rax), %edi
movl $0xf, %esi
callq 0xba48
testb %al, %al
je 0x9801
callq 0x24124
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
movss %xmm0, -0x1c(%rbp)
leaq 0x5b1a2(%rip), %r14     # 0x6497c
movl (%r14), %edi
movl $0xf, %esi
callq 0xba48
testb %al, %al
je 0x984a
xorps %xmm0, %xmm0
cvtss2sd -0x1c(%rbp), %xmm0
mulsd 0x2686d(%rip), %xmm0    # 0x30068
cvtsd2ss %xmm0, %xmm1
jmp 0x984f
leaq 0x45ad0(%rip), %rax     # 0x4f2d8
xorps %xmm0, %xmm0
cvtsi2ssl 0x7c(%rax), %xmm0
movss %xmm0, -0x1c(%rbp)
leaq 0x5b160(%rip), %rax     # 0x6497c
movl (%rax), %edi
movl $0xf, %esi
callq 0xba48
movss -0x1c(%rbp), %xmm1
leaq 0x4(%r15), %rcx
testb %al, %al
cmoveq %r15, %rcx
mulss (%rcx), %xmm1
movss -0x20(%rbp), %xmm0
mulss %xmm1, %xmm0
addss (%rbx), %xmm0
jmp 0x98c0
movss -0x1c(%rbp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
jne 0x9859
jnp 0x98c4
movss (%rbx), %xmm0
addss %xmm1, %xmm0
movss %xmm0, (%rbx)
movl (%r14), %edi
movl $0xf, %esi
movss %xmm1, -0x1c(%rbp)
callq 0xba48
xorl %ecx, %ecx
testb %al, %al
sete %cl
leaq 0x271db(%rip), %rax     # 0x30a60
movss (%rax,%rcx,4), %xmm1
movss %xmm1, -0x20(%rbp)
movss (%rbx), %xmm0
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
addsd 0x271c5(%rip), %xmm0    # 0x30a68
callq 0x2100
xorps %xmm1, %xmm1
cvtss2sd -0x20(%rbp), %xmm1
mulsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsd2ss %xmm1, %xmm0
movss -0x1c(%rbp), %xmm1
movss %xmm0, (%rbx)
xorps %xmm0, %xmm0
cmpneqss %xmm1, %xmm0
movd %xmm0, %eax
andl $0x1, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, unsigned char)
b8 show(const char *name, b8 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %s", name, value ? "true" : "false");
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x45599(%rip)     # 0x4f370
je 0x9e2e
movq %rdi, %rbx
testb %sil, %sil
leaq 0x27ad1(%rip), %rax     # 0x318b7
leaq 0x27ac5(%rip), %rdx     # 0x318b2
cmoveq %rax, %rdx
leaq 0x27ab2(%rip), %rdi     # 0x318aa
xorl %r14d, %r14d
movq %rbx, %rsi
xorl %eax, %eax
callq 0xaafe
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x45fe1(%rip), %rax     # 0x4fdf8
cmpq %rbx, 0x18(%rax)
jne 0x9e31
leaq 0x454b4(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %r14b
jmp 0x9e31
xorl %r14d, %r14d
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, int)
b8 show(const char *name, s32 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %d", name, value);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x4551f(%rip)     # 0x4f370
je 0x9e93
movl %esi, %edx
movq %rdi, %r14
leaq 0x27a68(%rip), %rdi     # 0x318c7
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0xaafe
movq %r14, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x45f7b(%rip), %rax     # 0x4fdf8
cmpq %r14, 0x18(%rax)
jne 0x9e95
leaq 0x4544e(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %bl
jmp 0x9e95
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, unsigned int)
b8 show(const char *name, u32 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %u", name, value);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x454bc(%rip)     # 0x4f370
je 0x9ef6
movl %esi, %edx
movq %rdi, %r14
leaq 0x27a0d(%rip), %rdi     # 0x318cf
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0xaafe
movq %r14, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x45f18(%rip), %rax     # 0x4fdf8
cmpq %r14, 0x18(%rax)
jne 0x9ef8
leaq 0x453eb(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %bl
jmp 0x9ef8
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, float)
b8 show(const char *name, f32 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %.4f", name, value);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
cmpb $0x0, 0x45460(%rip)     # 0x4f370
je 0x9f4c
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm0
leaq 0x27997(%rip), %rdi     # 0x318bd
movq %rbx, %rsi
movb $0x1, %al
callq 0xaafe
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x45eb6(%rip), %rax     # 0x4fdf8
cmpq %rbx, 0x18(%rax)
je 0x9f4f
xorl %eax, %eax
jmp 0x9f5d
xorl %eax, %eax
retq
leaq 0x45382(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, Vec2)
b8 show(const char *name, Vec2 value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %.4f, %.4f", name, value.x, value.y);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
cmpb $0x0, 0x453fb(%rip)     # 0x4f370
je 0x9fbc
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
cvtss2sd %xmm0, %xmm1
leaq 0x27944(%rip), %rdi     # 0x318d7
movq %rbx, %rsi
movaps %xmm2, %xmm0
movb $0x2, %al
callq 0xaafe
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x45e46(%rip), %rax     # 0x4fdf8
cmpq %rbx, 0x18(%rax)
je 0x9fbf
xorl %eax, %eax
jmp 0x9fcd
xorl %eax, %eax
retq
leaq 0x45312(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::show(char const*, Span)
b8 show(const char *name, Span value) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" %s: %.4f, %.4f", name, value.min, value.max);
    debug_value_logic(name, buffer);
    return name == global_tweak.active && Input::mouse_pressed(0);
}

// Assembly:
cmpb $0x0, 0x4538b(%rip)     # 0x4f370
je 0xa02c
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cvtss2sd %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
cvtss2sd %xmm0, %xmm1
leaq 0x278d4(%rip), %rdi     # 0x318d7
movq %rbx, %rsi
movaps %xmm2, %xmm0
movb $0x2, %al
callq 0xaafe
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x45dd6(%rip), %rax     # 0x4fdf8
cmpq %rbx, 0x18(%rax)
je 0xa02f
xorl %eax, %eax
jmp 0xa03d
xorl %eax, %eax
retq
leaq 0x452a2(%rip), %rax     # 0x4f2d8
cmpl $0x3, 0x68(%rax)
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/platform/input.cpp
// Function: Input::add_mod(unsigned int, unsigned int, Input::Player, float)
b8 add_mod(InputCode code, Name name, Player player, f32 modifier) {
    Binding binding = {code, player, name, 0};

    // Check if there is a free binding.
    ASSERT(is_valid_player(player), "");
    auto buttons = global_mapping.buttons[toID(player)];
    u32 index = binding.index();
    b8 valid = false;
    for (u32 i = 0; i < NUM_ALTERNATIVE_BINDINGS; i++) {
        if (buttons[index + i].is_used()) continue;
        binding.binding_id = i;
        buttons[index + i].reset(name, modifier);
        valid = true;
        break;
    }

    CHECK(valid, "Cannot add new mapping");
    if (!valid) return false;

    insert(binding);
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movss %xmm0, -0x24(%rbp)
movl %edx, %r12d
movl %esi, %ebx
movl %edi, %eax
movq %r12, %r14
shlq $0x20, %r14
movl %esi, %r15d
cmpl $0x4, %edx
ja 0xa1b6
movb $0x1, %cl
movl $0x16, %edx
btl %r12d, %edx
jb 0xa1bd
cmpl $0x8, %r12d
sete %cl
orq %rax, %r14
movzbl %cl, %ecx
leaq 0x26cf5(%rip), %rdi     # 0x30ebf
leaq 0x26d60(%rip), %rdx     # 0x30f31
movl $0x27, %esi
callq 0x722f
movl %r12d, %edi
callq 0xa0eb
movl %eax, %eax
leaq 0x450ec(%rip), %rdx     # 0x4f2d8
xorl %ecx, %ecx
testl %ebx, %ebx
setne %cl
leal (,%rbx,4), %r12d
shlq $0x4, %r12
addq 0x20(%rdx,%rax,8), %r12
leaq 0x26982(%rip), %rdi     # 0x30b8d
leaq 0x283ed(%rip), %rdx     # 0x325ff
movl $0x76, %esi
callq 0x722f
xorl %eax, %eax
movabsq $0x100000000, %rcx      # imm = 0x100000000
cmpl $0x0, (%r12,%rax)
je 0xa272
addq %rcx, %r15
addq $0x10, %rax
cmpq $0x40, %rax
jne 0xa228
movq 0x44d8d(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0x26926(%rip), %rdi     # 0x30b73
leaq 0x26c6b(%rip), %rdx     # 0x30ebf
leaq 0x26920(%rip), %r8      # 0x30b7b
leaq 0x26ce9(%rip), %r9      # 0x30f4b
xorl %ebx, %ebx
movl $0x33, %ecx
xorl %eax, %eax
callq 0x711f
jmp 0xa298
movl %ebx, (%r12,%rax)
movss -0x24(%rbp), %xmm0
movss %xmm0, 0x4(%r12,%rax)
movq $0x0, 0x8(%r12,%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0xb21e
movb $0x1, %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/font_settings.h
// Function: Util::init()
b8 init() {
        DEBUG_FONT = Asset::fetch_id("MONACO_FONT");
        if (DEBUG_FONT != Asset::ASSET_ID_NO_ASSET)
            return true;
        LOG("Failed to load the default font.");
        return false;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x268fb(%rip), %rdi     # 0x30bc7
callq 0xa324
leaq 0x5a6b8(%rip), %rcx     # 0x64990
movq %rax, (%rcx)
movb $0x1, %bl
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq %rcx, %rax
jne 0xa31b
movq 0x44cda(%rip), %rax     # 0x4efc8
movq (%rax), %rsi
leaq 0x268db(%rip), %rdi     # 0x30bd3
leaq 0x268d8(%rip), %rdx     # 0x30bd7
leaq 0x268f1(%rip), %r8      # 0x30bf7
leaq 0x268ef(%rip), %r9      # 0x30bfc
xorl %ebx, %ebx
movl $0xe, %ecx
xorl %eax, %eax
callq 0x711f
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/asset/asset.cpp
// Function: Asset::fetch_id(char const*)
AssetID fetch_id(const char *str) {
    u64 hash = asset_hash(str);
    for (u64 i = 0; i < system.num_assets; i++) {
        Header *headers = system.headers;
        if (headers[i].hash == hash) return i;
    }
    LOG("Failed to load asset: '%s', check that the correct .fog file is loaded.", str);
    return ASSET_ID_NO_ASSET;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb (%rdi), %dl
testb %dl, %dl
je 0xa37e
leaq 0x1(%rdi), %rax
movl $0x14e7, %ecx           # imm = 0x14E7
movsbq %dl, %rdx
incq %rcx
imulq %rdx, %rcx
movb (%rax), %dl
incq %rax
testb %dl, %dl
jne 0xa33b
movabsq $0x1000000101, %rdx     # imm = 0x1000000101
movq %rcx, %rax
mulq %rdx
movq %rcx, %rsi
subq %rdx, %rsi
shrq %rsi
addq %rdx, %rsi
shrq $0x1b, %rsi
movq %rsi, %rax
shlq $0x1c, %rax
subq %rax, %rsi
addq %rcx, %rsi
jmp 0xa383
movl $0x14e7, %esi           # imm = 0x14E7
leaq 0x60f1e(%rip), %rax     # 0x6b2a8
movq 0x38(%rax), %rcx
testq %rcx, %rcx
setne %r8b
je 0xa3a5
movq 0x28(%rax), %rdx
cmpq %rsi, 0x28(%rdx)
jne 0xa3a7
xorl %eax, %eax
jmp 0xa3d3
jmp 0xa3d3
addq $0x60, %rdx
movl $0x1, %r9d
xorl %eax, %eax
movq %r9, %r8
cmpq %r9, %rcx
je 0xa3cc
leaq 0x1(%r8), %r9
cmpq %rsi, (%rdx)
leaq 0x38(%rdx), %rdx
cmoveq %r8, %rax
jne 0xa3b3
cmpq %rcx, %r8
setb %r8b
testb %r8b, %r8b
jne 0xa413
movq 0x44be9(%rip), %rax     # 0x4efc8
movq (%rax), %rsi
movq %rdi, (%rsp)
leaq 0x267e6(%rip), %rdi     # 0x30bd3
leaq 0x271f2(%rip), %rdx     # 0x315e6
leaq 0x2726a(%rip), %r8      # 0x31665
leaq 0x2726c(%rip), %r9      # 0x3166e
movl $0x40, %ecx
xorl %eax, %eax
callq 0x711f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/renderer/text.cpp
// Function: Renderer::messure_text(char const*, float, unsigned long long)
Vec2 messure_text(const char *string, f32 size, AssetID font_id) {
    Asset::Font *font = Asset::fetch_font(font_id);
    ASSERT(font, "Cannot find font");
    f32 length = 0;
    if (!font->num_kernings) {
        while (*(string++)) length += font->glyphs[(u8) 'A'].advance;
    } else {
        u8 prev = '\0';
        while (*string) {
            u8 curr = *(string++);
            length += font->find_kerning(prev, curr);
            length += font->glyphs[curr].advance + font->glyphs[curr].x_offset;
        }
    }
    return V2(length * size, size * font->height);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movaps %xmm0, -0x30(%rbp)
movq %rdi, %r14
movq %rsi, %rdi
movl $0x2, %esi
callq 0x234d6
movq %rax, %rbx
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leaq 0x26f09(%rip), %rdi     # 0x313a9
leaq 0x26f1f(%rip), %rdx     # 0x313c6
movl $0x5, %esi
callq 0x722f
cmpq $0x0, 0x18(%rbx)
movb (%r14), %al
je 0xa506
testb %al, %al
je 0xa52c
incq %r14
xorps %xmm1, %xmm1
movaps %xmm1, -0x40(%rbp)
movsbl %al, %r15d
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x2e42e
addss -0x40(%rbp), %xmm0
movq 0x20(%rbx), %rax
movzbl %r15b, %ecx
shll $0x5, %ecx
movss 0x1c(%rax,%rcx), %xmm1
addss 0x14(%rax,%rcx), %xmm1
addss %xmm0, %xmm1
movb (%r14), %al
incq %r14
testb %al, %al
jne 0xa4c5
jmp 0xa52f
testb %al, %al
je 0xa52c
movq 0x20(%rbx), %rax
movss 0x83c(%rax), %xmm0
incq %r14
xorps %xmm1, %xmm1
addss %xmm0, %xmm1
cmpb $0x0, (%r14)
leaq 0x1(%r14), %r14
jne 0xa51c
jmp 0xa52f
xorps %xmm1, %xmm1
movaps -0x30(%rbp), %xmm0
mulss %xmm0, %xmm1
mulss 0x8(%rbx), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps %xmm1, %xmm0
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::format(char const*, __va_list_tag*)
char *format(const char *fmt, va_list args) {
    // TODO(ed): Test this function.
    char c;
    int size = vsnprintf(&c, 1, fmt, args);
    ASSERT(size > 0, "Failed to print format string");
    char *buffer = request_temporary_memory<char>(++size);
    vsnprintf(buffer, size, fmt, args);
    va_end(args);
    return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq -0x21(%rbp), %rdi
movl $0x1, %esi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2340
movl %eax, %r15d
xorl %ecx, %ecx
testl %eax, %eax
setg %cl
leaq 0x261d9(%rip), %rdi     # 0x30c70
leaq 0x261e9(%rip), %rdx     # 0x30c87
movl $0x3c, %esi
callq 0x722f
cmpl $0x1, 0x448c5(%rip)     # 0x4f374
jne 0xaabb
movl $0x0, 0x448b9(%rip)     # 0x4f374
incl %r15d
movslq %r15d, %r15
movl 0x59f29(%rip), %eax     # 0x649f0
leaq 0x59f12(%rip), %rcx     # 0x649e0
movq (%rcx,%rax,8), %rdi
movq %r15, %rsi
callq 0x2e822
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x2340
movq %r12, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::format_int(char const*, ...)
char *format_int(const char *fmt, ...) {
    va_list args;
    va_start(args, fmt);
    char c;
    int size = vsnprintf_(&c, 1, fmt, args);
    ASSERT(size > 0, "Failed to print format string");
    va_end(args);
    char *buffer = request_temporary_memory<char>(++size);
    va_start(args, fmt);
    vsnprintf_(buffer, size, fmt, args);
    va_end(args);
    return buffer;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq -0x100(%rbp), %r12
movq %rsi, 0x8(%r12)
movq %rdx, 0x10(%r12)
movq %rcx, 0x18(%r12)
movq %r8, 0x20(%r12)
movq %r9, 0x28(%r12)
testb %al, %al
je 0xab68
movaps %xmm0, -0xd0(%rbp)
movaps %xmm1, -0xc0(%rbp)
movaps %xmm2, -0xb0(%rbp)
movaps %xmm3, -0xa0(%rbp)
movaps %xmm4, -0x90(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
leaq -0x50(%rbp), %r8
movq %r12, 0x10(%r8)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%r8)
movabsq $0x3000000008, %r13     # imm = 0x3000000008
movq %r13, (%r8)
leaq -0x3bfb(%rip), %rdi     # 0x6f91
leaq -0x29(%rbp), %rsi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x6586
movl %eax, %r14d
xorl %ecx, %ecx
testl %eax, %eax
setg %cl
leaq 0x260c2(%rip), %rdi     # 0x30c70
leaq 0x260d2(%rip), %rdx     # 0x30c87
movl $0x4a, %esi
callq 0x722f
cmpl $0x1, 0x447ae(%rip)     # 0x4f374
jne 0xabd2
movl $0x0, 0x447a2(%rip)     # 0x4f374
incl %r14d
movslq %r14d, %r14
movl 0x59e12(%rip), %eax     # 0x649f0
leaq 0x59dfb(%rip), %rcx     # 0x649e0
movq (%rcx,%rax,8), %rdi
movq %r14, %rsi
callq 0x2e822
movq %rax, %r15
leaq -0x50(%rbp), %r8
movq %r13, (%r8)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%r8)
movq %r12, 0x10(%r8)
leaq -0x3c7d(%rip), %rdi     # 0x6f91
movq %r15, %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x6586
movq %r15, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::format_inplace(char*, char const*, ...)
u32 format_inplace(char *out, const char *fmt, ...) {
    // TODO(ed): This needs some error checking..
    va_list args;
    va_start(args, fmt);
    u32 written = vsnprintf(out, 100, fmt, args);
    va_end(args);
    return written;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rsi, %r10
leaq -0xd0(%rbp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xac80
movaps %xmm0, -0xa0(%rbp)
movaps %xmm1, -0x90(%rbp)
movaps %xmm2, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm5, -0x50(%rbp)
movaps %xmm6, -0x40(%rbp)
movaps %xmm7, -0x30(%rbp)
leaq -0x20(%rbp), %rcx
movq %rsi, 0x10(%rcx)
leaq 0x10(%rbp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
movl $0x64, %esi
movq %r10, %rdx
callq 0x2340
addq $0xd0, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::utf8_size(char const*)
u8 utf8_size(const char *c) {
    if ((*c & 0b10000000) == 0) return 1;
    if ((*c & 0b11100000) == 0b11000000) return 2;
    if ((*c & 0b11110000) == 0b11100000) return 3;
    if ((*c & 0b11111000) == 0b11110000) return 4;
    ERR("Invalid codepoint");
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movzbl (%rdi), %eax
movb $0x1, %bl
testb %al, %al
jns 0xad20
movl %eax, %ecx
andl $-0x20, %ecx
movb $0x2, %bl
cmpl $0xc0, %ecx
je 0xad20
movl %eax, %ecx
andl $-0x10, %ecx
movb $0x3, %bl
cmpl $0xe0, %ecx
je 0xad20
andl $-0x8, %eax
movb $0x4, %bl
cmpl $0xf0, %eax
je 0xad20
movq 0x442dd(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0x25fb2(%rip), %rdi     # 0x30caf
leaq 0x25f6c(%rip), %rdx     # 0x30c70
leaq 0x25fa8(%rip), %r8      # 0x30cb3
leaq 0x25fab(%rip), %r9      # 0x30cbd
xorl %ebx, %ebx
movl $0x6e, %ecx
xorl %eax, %eax
callq 0x711f
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::utf8_insert_glyph(char*, char const*, unsigned int)
b8 utf8_insert_glyph(char *to, const char *from, u32 length) {
    const u32 glyph_size = utf8_size(from);
    if (glyph_size > length) return false;
    for (u32 i = 0; i < glyph_size; i++)
        to[i] = from[i];
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0xacb3
movzbl %al, %edx
cmpl %r15d, %edx
jbe 0xad5f
xorl %eax, %eax
jmp 0xad79
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
je 0xad79
xorl %ecx, %ecx
movb (%rbx,%rcx), %sil
movb %sil, (%r14,%rcx)
incq %rcx
cmpq %rcx, %rdx
jne 0xad69
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/io.cpp
// Function: Util::contains_substr(char const*, char const*)
b8 contains_substr(const char *str, const char *substr) {
    for (; *str; str++) {
        for (u32 i = 0; str[i] == substr[i]; i++) {
            if (substr[i+1] == '\0')
                return true;
        }
    }
    return false;
}

// Assembly:
cmpb $0x0, (%rdi)
je 0xadd8
pushq %rbp
movq %rsp, %rbp
movl $0x1, %eax
leal -0x1(%rax), %edx
movb (%rdi,%rdx), %cl
movb (%rsi,%rdx), %dl
cmpb %dl, %cl
jne 0xadca
movl %eax, %r8d
incl %eax
cmpb $0x0, (%rsi,%r8)
jne 0xadad
cmpb %dl, %cl
je 0xaddb
cmpb $0x0, 0x1(%rdi)
leaq 0x1(%rdi), %rdi
jne 0xada8
xorl %eax, %eax
jmp 0xaddd
xorl %eax, %eax
retq
movb $0x1, %al
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::do_all_allocations()
void do_all_allocations() {
    static_assert(TOTAL_MEMORY_BUDGET % ARENA_SIZE_IN_BYTES == 0);

    // Setup regions.
    global_memory.free_regions = global_memory.all_regions + 0;
    global_memory.num_free_regions = NUM_ARENAS;
    for (u64 i = 0; i < NUM_ARENAS - 1; i++) {
        global_memory.all_regions[i].next = global_memory.all_regions + i + 1;
        global_memory.all_regions[i].memory = malloc(ARENA_SIZE_IN_BYTES);
    }
    global_memory.all_regions[NUM_ARENAS - 1].next = 0;

    // Frame memory
    for (u32 i = 0; i < FRAME_LAG_FOR_MEMORY; i++)
        FRAME_MEMORY[i] = request_arena();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x44f36(%rip), %rbx     # 0x4fe28
leaq 0x10(%rbx), %rax
movq %rax, 0x8(%rbx)
movq $0x40, (%rbx)
leaq 0x30(%rbx), %r14
movl $0x3f, %r15d
movq %r14, -0x10(%r14)
movl $0x200000, %edi         # imm = 0x200000
callq 0x2450
movq %rax, -0x8(%r14)
addq $0x20, %r14
decq %r15
jne 0xaf0b
movq $0x0, 0x800(%rbx)
xorl %ebx, %ebx
leaq 0x59aa6(%rip), %r14     # 0x649e0
xorl %edi, %edi
callq 0xaf5a
movq %rax, (%rbx,%r14)
addq $0x8, %rbx
cmpq $0x8, %rbx
je 0xaf3a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x44408(%rip), %eax     # 0x4f374
cmpl $0x2, %eax
je 0xafc3
cmpl $0x1, %eax
jne 0xafb9
movl 0x59a54(%rip), %eax     # 0x649d0
incl %eax
movl %eax, 0x59a4c(%rip)     # 0x649d0
movq 0x44045(%rip), %rcx     # 0x4efd0
movq (%rcx), %rsi
movl %eax, (%rsp)
leaq 0x25d17(%rip), %rdi     # 0x30caf
leaq 0x25d40(%rip), %rdx     # 0x30cdf
leaq 0x25d54(%rip), %r8      # 0x30cfa
leaq 0x25d65(%rip), %r9      # 0x30d12
movl $0x2a, %ecx
xorl %eax, %eax
callq 0x711f
movl $0x1, 0x443b1(%rip)     # 0x4f374
leaq 0x44e5e(%rip), %r15     # 0x4fe28
xorl %ecx, %ecx
cmpq $0x0, 0x8(%r15)
setne %cl
leaq 0x25d04(%rip), %r14     # 0x30cdf
leaq 0x25e5b(%rip), %rdx     # 0x30e3d
movq %r14, %rdi
movl $0x65, %esi
callq 0x722f
xorl %ecx, %ecx
cmpq $0x0, (%r15)
setne %cl
leaq 0x25e69(%rip), %rdx     # 0x30e68
movq %r14, %rdi
movl $0x66, %esi
callq 0x722f
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_O1/FredTheDino[P]Fog/src/engine/util/memory.cpp
// Function: Util::swap_frame_memory()
void swap_frame_memory() {
    CURRENT_MEMORY = (CURRENT_MEMORY + 1) % FRAME_LAG_FOR_MEMORY;
    // Clear when it is swapped to so the old ones
    // still can be used.
    FRAME_MEMORY[CURRENT_MEMORY]->clear();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl 0x599b5(%rip), %eax     # 0x649f0
notl %eax
andl $0x1, %eax
movl %eax, 0x599aa(%rip)     # 0x649f0
leaq 0x59993(%rip), %rcx     # 0x649e0
movq (%rcx,%rax,8), %rbx
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xb069
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
callq 0xb0dd
jmp 0xb051
movq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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(%rdi), %rdi
testq %rdi, %rdi
je 0xb09d
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rbx)
callq 0xb0dd
movq 0x10(%rbx), %rdi
jmp 0xb085
movq $0x0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x25bea(%rip), %rdi     # 0x30cdf
leaq 0x25d9b(%rip), %rdx     # 0x30e97
movl $0x71, %esi
callq 0x722f
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0xb114
callq 0xb0dd
leaq 0x44d0d(%rip), %rax     # 0x4fe28
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_O1/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 0x44149(%rip), %rax     # 0x4f2d8
movl 0x10(%rax), %ecx
movq 0x18(%rax), %rdx
leaq 0x10(%rdx), %rsi
xorl %r8d, %r8d
movq %rcx, %r9
cmpq %r9, %r8
jg 0xb219
leaq (%r9,%r8), %r10
movq %r10, %r11
shrq $0x3f, %r11
addq %r10, %r11
sarq %r11
cmpq $-0x1, %r10
setl %r10b
cmpq %rcx, %r11
setg %bl
orb %r10b, %bl
movl $0x3, %r10d
jne 0xb20e
movq %r11, %rbx
shlq $0x4, %rbx
cmpl %edi, (%rdx,%rbx)
jbe 0xb1e6
decq %r11
xorl %r10d, %r10d
movq %r11, %r9
jmp 0xb20e
jae 0xb1f3
incq %r11
xorl %r10d, %r10d
movq %r11, %r8
jmp 0xb20e
addq %rsi, %rbx
leaq -0x10(%rbx), %rax
cmpl $0x0, -0x18(%rbx)
movl $0x1, %r10d
je 0xb20e
cmpl %edi, -0x20(%rbx)
movq %rax, %rbx
je 0xb1f6
testl %r10d, %r10d
je 0xb1a0
cmpl $0x3, %r10d
jne 0xb21b
xorl %eax, %eax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x440a3(%rip), %r15     # 0x4f2d8
movl 0x10(%r15), %eax
xorl %ecx, %ecx
cmpl 0xc(%r15), %eax
setb %cl
leaq 0x25c76(%rip), %rdi     # 0x30ebf
leaq 0x25c8d(%rip), %rdx     # 0x30edd
movl $0x18, %esi
callq 0x722f
movl 0x10(%r15), %ecx
movq %rcx, %rax
shlq $0x4, %rax
addq 0x18(%r15), %rax
testq %rcx, %rcx
je 0xb289
cmpl %r14d, -0x10(%rax)
jbe 0xb289
leaq -0x10(%rax), %rcx
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq %rcx, %rax
cmpq 0x18(%r15), %rcx
jne 0xb26e
jmp 0xb28c
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_O1/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 0x4402b(%rip), %rax     # 0x4f2d8
movl 0x8(%rax), %ecx
movq %rcx, %rdx
shlq $0x4, %rdx
xorl %esi, %esi
testl %ecx, %ecx
je 0xb2d4
movq 0x20(%rax,%rsi,8), %rdi
xorl %r8d, %r8d
andl $0x1, 0x8(%rdi,%r8)
addq $0x10, %r8
cmpq %r8, %rdx
jne 0xb2c5
incq %rsi
cmpq $0x4, %rsi
jne 0xb2b9
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_O1/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 0xb183
testq %rax, %rax
je 0xb436
movq %rax, %r14
cmpl $0x0, 0x8(%rax)
setne %al
je 0xb436
movl -0x2c(%rbp), %ecx
cmpl %ecx, (%r14)
jne 0xb436
xorps %xmm0, %xmm0
cmpneqss -0x30(%rbp), %xmm0
movd %xmm0, %ecx
movl $0x2, %edx
subl %ecx, %edx
movl %edx, -0x34(%rbp)
addq $0x8, %r14
movzbl %al, %ecx
andl $0x1, %ecx
leaq 0x25826(%rip), %rbx     # 0x30b8d
movq %rbx, %rdi
movl $0x76, %esi
leaq 0x27289(%rip), %r15     # 0x325ff
movq %r15, %rdx
callq 0x722f
movl (%r14), %eax
movzbl 0x4(%r14), %ecx
leal (%rcx,%rax,4), %r12d
xorl %ecx, %ecx
leaq 0x43f45(%rip), %r13     # 0x4f2d8
cmpl 0x8(%r13), %r12d
setb %cl
leaq 0x25b1e(%rip), %r13     # 0x30ebf
movq %r13, %rdi
movl $0x55, %esi
leaq 0x25bbb(%rip), %rdx     # 0x30f6b
callq 0x722f
xorl %ecx, %ecx
cmpl $0x0, (%r14)
setne %cl
movq %rbx, %rdi
movl $0x7b, %esi
movq %r15, %rdx
callq 0x722f
movl -0x4(%r14), %edi
callq 0xa0eb
movl %eax, %ebx
movq %r13, %rdi
movl $0x57, %esi
leaq 0x25bd3(%rip), %rdx     # 0x30fbb
movl $0x1, %ecx
callq 0x722f
movl %ebx, %eax
leaq 0x43edd(%rip), %rcx     # 0x4f2d8
movq 0x20(%rcx,%rax,8), %rax
shlq $0x4, %r12
movss -0x30(%rbp), %xmm0
movss %xmm0, 0xc(%rax,%r12)
movl -0x34(%rbp), %ecx
movl %ecx, 0x8(%rax,%r12)
cmpl $0x0, 0x10(%r14)
setne %al
je 0xb436
leaq 0x10(%r14), %rcx
movl -0x2c(%rbp), %edx
cmpl %edx, 0x8(%r14)
movq %rcx, %r14
je 0xb35a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x43e7b(%rip), %r14     # 0x4f2d8
cmpb $0x0, (%rbx)
je 0xb4bf
movl 0x44(%r14), %r13d
leal -0x20(%r13), %r15d
movq %rbx, %rdi
callq 0xacb3
movzbl %al, %r12d
cmpl %r12d, %r15d
setb %al
testb %r12b, %r12b
sete %cl
orb %al, %cl
jne 0xb4a3
movl %r12d, %eax
leaq (%r14,%r13), %rcx
addq $0x48, %rcx
xorl %edx, %edx
movb (%rbx,%rdx), %sil
movb %sil, (%rcx,%rdx)
incq %rdx
cmpq %rdx, %rax
jne 0xb493
cmpl %r12d, %r15d
jb 0xb4ba
movq %rbx, %rdi
callq 0xacb3
movzbl %al, %eax
addl %eax, 0x44(%r14)
addq %rax, %rbx
cmpl %r12d, %r15d
jae 0xb45d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x43e03(%rip), %rcx     # 0x4f2d8
cmpl $0x0, 0x44(%rcx)
je 0xb507
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 0xb50a
movq %r14, %rax
leaq 0x1(%rax), %r13
decl %ebx
cmpb $0x0, 0x1(%rax)
movq %r13, %rax
jne 0xb4f6
jmp 0xb50d
xorl %eax, %eax
retq
movq %r14, %r13
cmpl $0x0, 0x44(%rcx)
je 0xb5b4
leaq 0x48(%rcx), %r15
movq %r15, %rdi
callq 0xacb3
movzbl %al, %r12d
cmpb $0x8, (%r15)
movl %r12d, %edx
jne 0xb55d
cmpq %r14, %r13
je 0xb597
decq %r13
movq %r13, %rax
leaq 0x43d96(%rip), %rcx     # 0x4f2d8
incl %ebx
leaq -0x1(%rax), %r13
cmpq %r14, %rax
jbe 0xb558
movb (%rax), %al
andb $-0x40, %al
negb %al
movq %r13, %rax
jo 0xb542
incq %r13
jmp 0xb59e
movq %rdx, -0x30(%rbp)
movq %r15, %rdi
callq 0xacb3
movzbl %al, %eax
testb %al, %al
je 0xb589
cmpl %eax, %ebx
jb 0xb589
movl %eax, %ecx
xorl %edx, %edx
movb (%r15,%rdx), %sil
movb %sil, (%r13,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0xb578
cmpl %eax, %ebx
movq -0x30(%rbp), %rdx
jb 0xb597
addq %rdx, %r13
subl %r12d, %ebx
leaq 0x43d3a(%rip), %rcx     # 0x4f2d8
addq %rdx, %r15
movl 0x44(%rcx), %eax
addq %rcx, %rax
addq $0x48, %rax
cmpq %rax, %r15
jb 0xb51b
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_O1/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
movl %esi, -0x30(%rbp)
leaq 0x43ce0(%rip), %rax     # 0x4f2d8
movb 0x40(%rax), %cl
movb %cl, -0x29(%rbp)
movb $0x0, 0x40(%rax)
movl %edi, %eax
movq %rax, -0x40(%rbp)
xorl %ecx, %ecx
movl $0x1, %r12d
shll %cl, %r12d
movl -0x30(%rbp), %eax
btl %ecx, %eax
jae 0xb6c2
movl %ecx, -0x34(%rbp)
shlq $0x20, %r12
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %rbx
addq -0x40(%rbp), %rbx
movl $0x4, %r15d
xorl %eax, %eax
movq %rbx, %r14
movq %rax, %rbx
movq %r14, %r13
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %r13
leaq (%rbx,%r13), %r14
leaq 0x43c78(%rip), %rdi     # 0x4f2d8
movq %r12, %rsi
movq %r14, %rdx
callq 0x2dcf6
testl %eax, %eax
je 0xb68a
xorl %esi, %esi
testb $0x2, %dl
je 0xb68f
leaq 0x43c5b(%rip), %rax     # 0x4f2d8
movb -0x29(%rbp), %cl
movb %cl, 0x40(%rax)
movl $0x1, %esi
jmp 0xb68f
movl $0x7, %esi
cmpl $0x7, %esi
je 0xb698
testl %esi, %esi
jne 0xb6af
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rbx, %rax
decq %r15
jne 0xb642
movl $0x5, %esi
cmpl $0x5, %esi
movl $0x0, %eax
cmovel %eax, %esi
addq %r13, %rbx
movl -0x34(%rbp), %ecx
jmp 0xb6c7
movl $0x4, %esi
testb $0x3, %sil
jne 0xb6dd
incl %ecx
cmpl $0x4, %ecx
jne 0xb60a
movl $0x2, %esi
movb $0x1, %al
cmpl $0x2, %esi
jne 0xb6f3
leaq 0x43bed(%rip), %rax     # 0x4f2d8
movb -0x29(%rbp), %cl
movb %cl, 0x40(%rax)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x43bbe(%rip), %rax     # 0x4f2d8
cmpb $0x0, 0x40(%rax)
movl $0x0, %eax
jne 0xb807
movl %edi, %eax
movq %rax, -0x40(%rbp)
movb $0x1, %al
movq %rax, -0x38(%rbp)
xorl %ecx, %ecx
movl %esi, -0x2c(%rbp)
movl $0x1, %r13d
shll %cl, %r13d
btl %ecx, %esi
jae 0xb7df
movq %rcx, -0x48(%rbp)
shlq $0x20, %r13
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r15
addq -0x40(%rbp), %r15
movl $0x4, %r12d
xorl %eax, %eax
movq %r15, %r14
movq %rax, %r15
movq %r14, %rbx
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %rbx
leaq (%r15,%rbx), %r14
leaq 0x43b4a(%rip), %rdi     # 0x4f2d8
movq %r13, %rsi
movq %r14, %rdx
callq 0x2dcf6
shrl %edx
andl $0x1, %edx
testl %eax, %eax
movl $0x7, %eax
cmovel %eax, %edx
cmpl $0x7, %edx
je 0xb7b1
testl %edx, %edx
jne 0xb7c8
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r15, %rax
decq %r12
jne 0xb770
movl $0x5, %edx
cmpl $0x5, %edx
movl $0x0, %eax
cmovel %eax, %edx
addq %rbx, %r15
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rcx
jmp 0xb7e4
movl $0x4, %edx
testb $0x3, %dl
jne 0xb801
cmpl $0x3, %ecx
leal 0x1(%rcx), %eax
setb %cl
movq %rcx, -0x38(%rbp)
movl %eax, %ecx
cmpl $0x4, %eax
jne 0xb73a
movq -0x38(%rbp), %rax
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_O1/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 0x43aaa(%rip), %rax     # 0x4f2d8
cmpb $0x0, 0x40(%rax)
movl $0x0, %eax
jne 0xb920
movl %edi, %eax
movq %rax, -0x40(%rbp)
movb $0x1, %al
movq %rax, -0x38(%rbp)
xorl %ecx, %ecx
movl %esi, -0x2c(%rbp)
movl $0x1, %r13d
shll %cl, %r13d
btl %ecx, %esi
jae 0xb8f7
movq %rcx, -0x48(%rbp)
shlq $0x20, %r13
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r15
addq -0x40(%rbp), %r15
movl $0x4, %r12d
xorl %eax, %eax
movq %r15, %r14
movq %rax, %r15
movq %r14, %rbx
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %rbx
leaq (%r15,%rbx), %r14
leaq 0x43a36(%rip), %rdi     # 0x4f2d8
movq %r13, %rsi
movq %r14, %rdx
callq 0x2dcf6
xorl %edi, %edi
cmpl $0x3, %edx
sete %dil
testl %eax, %eax
movl $0x7, %eax
cmovel %eax, %edi
cmpl $0x7, %edi
je 0xb8c9
testl %edi, %edi
jne 0xb8e0
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r15, %rax
decq %r12
jne 0xb884
movl $0x5, %edi
cmpl $0x5, %edi
movl $0x0, %eax
cmovel %eax, %edi
addq %rbx, %r15
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rcx
jmp 0xb8fc
movl $0x4, %edi
testb $0x3, %dil
jne 0xb91a
cmpl $0x3, %ecx
leal 0x1(%rcx), %eax
setb %cl
movq %rcx, -0x38(%rbp)
movl %eax, %ecx
cmpl $0x4, %eax
jne 0xb84e
movq -0x38(%rbp), %rax
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_O1/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 0x43991(%rip), %rax     # 0x4f2d8
cmpb $0x0, 0x40(%rax)
movl $0x0, %eax
jne 0xba39
movl %edi, %eax
movq %rax, -0x40(%rbp)
movb $0x1, %al
movq %rax, -0x38(%rbp)
xorl %ecx, %ecx
movl %esi, -0x2c(%rbp)
movl $0x1, %r13d
shll %cl, %r13d
btl %ecx, %esi
jae 0xba10
movq %rcx, -0x48(%rbp)
shlq $0x20, %r13
movabsq $-0x10000000000, %rax   # imm = 0xFFFFFF0000000000
andq %rax, %r15
addq -0x40(%rbp), %r15
movl $0x4, %r12d
xorl %eax, %eax
movq %r15, %r14
movq %rax, %r15
movq %r14, %rbx
movabsq $-0xff00000001, %rax    # imm = 0xFFFFFF00FFFFFFFF
andq %rax, %rbx
leaq (%r15,%rbx), %r14
leaq 0x4391d(%rip), %rdi     # 0x4f2d8
movq %r13, %rsi
movq %r14, %rdx
callq 0x2dcf6
xorl %edi, %edi
cmpl $0x2, %edx
sete %dil
testl %eax, %eax
movl $0x7, %eax
cmovel %eax, %edi
cmpl $0x7, %edi
je 0xb9e2
testl %edi, %edi
jne 0xb9f9
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %r15, %rax
decq %r12
jne 0xb99d
movl $0x5, %edi
cmpl $0x5, %edi
movl $0x0, %eax
cmovel %eax, %edi
addq %rbx, %r15
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rcx
jmp 0xba15
movl $0x4, %edi
testb $0x3, %dil
jne 0xba33
cmpl $0x3, %ecx
leal 0x1(%rcx), %eax
setb %cl
movq %rcx, -0x38(%rbp)
movl %eax, %ecx
cmpl $0x4, %eax
jne 0xb967
movq -0x38(%rbp), %rax
andb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq