LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/renderer/camera.cpp
// Function: Renderer::turn_off_camera(unsigned int)
void turn_off_camera(u32 camera_id) {
    ASSERT(camera_id < OPENGL_NUM_CAMERAS, "Invalid camera id");
    u32 bit = (camera_id == 0) ? 1 : (1 << camera_id);
    if (bit & _fog_active_cameras) {
        _fog_active_cameras &= ~(1 << camera_id);
        _fog_num_active_cameras--;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x2, %edi
setb %cl
leaq 0xe540(%rip), %rdi      # 0x31543
leaq 0xe558(%rip), %rdx      # 0x31562
movl $0x18, %esi
callq 0x722f
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
leaq 0x2d8f4(%rip), %rcx     # 0x50918
movl (%rcx), %edx
btl %ebx, %edx
jae 0x2303a
notl %eax
andl %eax, %edx
movl %edx, (%rcx)
leaq 0x2d8e4(%rip), %rax     # 0x5091c
decl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/renderer/camera.cpp
// Function: Renderer::camera_fit(unsigned int, Vec2*, float)
Camera camera_fit(u32 num_points, Vec2 *points, f32 border) {
    ASSERT(num_points, "No points given for camera to fit!");
    Camera camera = {};
    camera.zoom = 1.0;
    camera.aspect_ratio = fetch_camera()->aspect_ratio;
    camera_fit_inplace(&camera, num_points, points, border);
    return camera;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movss %xmm0, -0x1c(%rbp)
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
xorl %ecx, %ecx
testl %esi, %esi
setne %cl
leaq 0xe4dc(%rip), %rdi      # 0x31543
leaq 0xe515(%rip), %rdx      # 0x31583
movl $0x21, %esi
callq 0x722f
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movl $0x3f800000, 0x10(%rbx) # imm = 0x3F800000
movss 0x481d3(%rip), %xmm0    # 0x6b264
movss %xmm0, 0x14(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
movss -0x1c(%rbp), %xmm0
callq 0x230b7
movq %rbx, %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/renderer/camera.cpp
// Function: Renderer::camera_fit_inplace(Renderer::Camera*, unsigned int, Vec2*, float)
void camera_fit_inplace(Camera *camera, u32 num_points, Vec2 *points, f32 border) {
    ASSERT(num_points, "No points given for camera to fit!");
    Vec2 min = *points;
    Vec2 max = *points;

    for (u32 i = 0; i < num_points; i++) {
        min.x = MIN(min.x, points[i].x);
        min.y = MIN(min.y, points[i].y);
        max.x = MAX(max.x, points[i].x);
        max.y = MAX(max.y, points[i].y);
    }
    camera->position = -(min + max) / 2.0;
    Vec2 radie = max + camera->position + V2(border, border);
    if (radie.x == 0.0 && radie.y == 0.0) {
        camera->zoom = 1.0;
    } else {
        f32 x = radie.x;
        f32 y = radie.y * camera->aspect_ratio;
        camera->zoom = 1.0 / MAX(x, y);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movss %xmm0, -0x1c(%rbp)
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
xorl %ecx, %ecx
testl %esi, %esi
setne %cl
leaq 0xe466(%rip), %rdi      # 0x31543
leaq 0xe49f(%rip), %rdx      # 0x31583
movl $0x37, %esi
callq 0x722f
movss (%r14), %xmm2
movss 0x4(%r14), %xmm0
movsd (%r14), %xmm3
testl %r15d, %r15d
je 0x2313c
movl %r15d, %eax
xorl %ecx, %ecx
movaps %xmm3, %xmm1
movss (%r14,%rcx,8), %xmm4
movss 0x4(%r14,%rcx,8), %xmm5
minss %xmm4, %xmm2
minss %xmm5, %xmm0
maxss %xmm4, %xmm1
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
maxss %xmm5, %xmm3
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
incq %rcx
movaps %xmm1, %xmm3
cmpq %rcx, %rax
jne 0x2310b
jmp 0x2313f
movaps %xmm3, %xmm1
addss %xmm1, %xmm2
movaps %xmm1, %xmm3
shufps $0x55, %xmm1, %xmm3     # xmm3 = xmm3[1,1],xmm1[1,1]
addss %xmm3, %xmm0
movss 0xd0ee(%rip), %xmm4     # 0x30244
mulss %xmm4, %xmm2
mulss %xmm4, %xmm0
addss %xmm2, %xmm1
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movlps %xmm2, (%rbx)
addss %xmm3, %xmm0
movss -0x1c(%rbp), %xmm2
addss %xmm2, %xmm1
addss %xmm2, %xmm0
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm1
jne 0x23194
jp 0x23194
ucomiss %xmm2, %xmm0
jne 0x23194
jp 0x23194
movss 0xce72(%rip), %xmm0     # 0x30004
jmp 0x231a9
mulss 0x14(%rbx), %xmm0
maxss %xmm0, %xmm1
movss 0xce5f(%rip), %xmm0     # 0x30004
divss %xmm1, %xmm0
movss %xmm0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/renderer/camera.cpp
// Function: Renderer::camera_lerp(Renderer::Camera, Renderer::Camera, float)
Camera camera_lerp(Camera camera_a, Camera camera_b, f32 lerp) {
    return {
        LERP(camera_a.position    , camera_b.position, lerp),
        LERP(camera_a.offset      , camera_b.offset, lerp),
        (f32) LERP(camera_a.zoom  , camera_b.zoom, lerp),
        LERP(camera_a.aspect_ratio, camera_b.aspect_ratio, lerp),
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movss 0xce3c(%rip), %xmm1     # 0x30004
subss %xmm0, %xmm1
movss 0x10(%rbp), %xmm2
mulss %xmm1, %xmm2
movss 0x14(%rbp), %xmm3
mulss %xmm1, %xmm3
movss 0x30(%rbp), %xmm4
mulss %xmm0, %xmm4
movss 0x34(%rbp), %xmm5
mulss %xmm0, %xmm5
addss %xmm2, %xmm4
addss %xmm3, %xmm5
unpcklps %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
movlps %xmm4, (%rdi)
movss 0x18(%rbp), %xmm2
mulss %xmm1, %xmm2
movss 0x1c(%rbp), %xmm3
mulss %xmm1, %xmm3
movss 0x38(%rbp), %xmm4
mulss %xmm0, %xmm4
movss 0x3c(%rbp), %xmm5
mulss %xmm0, %xmm5
addss %xmm2, %xmm4
addss %xmm3, %xmm5
unpcklps %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
movlps %xmm4, 0x8(%rdi)
movss 0x40(%rbp), %xmm2
mulss %xmm0, %xmm2
movss 0x20(%rbp), %xmm3
mulss %xmm1, %xmm3
addss %xmm2, %xmm3
movss %xmm3, 0x10(%rdi)
mulss 0x44(%rbp), %xmm0
mulss 0x24(%rbp), %xmm1
addss %xmm0, %xmm1
movss %xmm1, 0x14(%rdi)
movq $0x0, 0x18(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/renderer/camera.cpp
// Function: Renderer::debug_camera(unsigned int)
void debug_camera(u32 camera_id) {
    const f32 ZOOM_SCALE_MOVE = 1.0 / 50.0;
    const f32 ZOOM_SCALE_WHEEL = 1.0 / 5.0;
    ASSERT(0 <= camera_id && camera_id < OPENGL_NUM_CAMERAS, "Not a valid camera");

    Camera *camera = fetch_camera(camera_id);
    if (Input::mouse_down(0))
        camera->position += Input::world_mouse_move(camera_id);

    f32 zoom_strength = 1.0;
    if (Input::mouse_down(2))
        zoom_strength = (1.0 - Input::mouse_move().y * ZOOM_SCALE_MOVE);
    if (Input::mouse_scroll().y != 0)
        zoom_strength = 1.0 + Input::mouse_scroll().y * ZOOM_SCALE_WHEEL;

    // TODO(ed): Figure out how those cool cameras that you can move
    // by zooming work...
    camera->zoom *= zoom_strength;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
xorl %r14d, %r14d
cmpl $0x2, %edi
setb %r14b
leaq 0xe148(%rip), %r15      # 0x31543
leaq 0xe1b0(%rip), %r12      # 0x315b2
movq %r15, %rdi
movl $0x59, %esi
movq %r12, %rdx
movl %r14d, %ecx
callq 0x722f
movq %r15, %rdi
movl $0x52, %esi
movq %r12, %rdx
movl %r14d, %ecx
callq 0x722f
movl %ebx, %eax
shlq $0x5, %rax
leaq 0x47e1b(%rip), %r14     # 0x6b250
addq %rax, %r14
leaq 0x2be99(%rip), %r15     # 0x4f2d8
testb $0x1, 0x68(%r15)
je 0x2346b
movl %ebx, %edi
callq 0xbead
movss (%r14), %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%r14)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss 0x4(%r14), %xmm0
movss %xmm0, 0x4(%r14)
testb $0x1, 0x70(%r15)
movss 0xcb8c(%rip), %xmm1     # 0x30004
movaps %xmm1, %xmm0
je 0x23495
xorps %xmm0, %xmm0
cvtsi2ssl 0x80(%r15), %xmm0
mulss 0xcdbb(%rip), %xmm0     # 0x3024c
addss %xmm1, %xmm0
movl 0x88(%r15), %eax
testl %eax, %eax
je 0x234b3
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0xcb5d(%rip), %xmm0     # 0x3000c
addss %xmm1, %xmm0
mulss 0x10(%r14), %xmm0
movss %xmm0, 0x10(%r14)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/asset/asset.cpp
// Function: Asset::raw_fetch(unsigned long long, Asset::Type)
Data *raw_fetch(AssetID id, Type type) {
    if (system.file_header.number_of_assets < id) {
        ERR("Invalid asset id (%d)", id);
        HALT_AND_CATCH_FIRE;
        return nullptr;
    }
    if (type == Type::NONE || system.headers[id].type == type) {
        return &system.assets[id];
    } else {
        ERR("Not the expected type (%d)", id);
        HALT_AND_CATCH_FIRE;
        return nullptr;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x47dc3(%rip), %rcx     # 0x6b2a8
cmpq %rdi, (%rcx)
jb 0x2350d
testl %esi, %esi
je 0x234fb
movq 0x28(%rcx), %rax
imulq $0x38, %rdi, %rdx
cmpl %esi, (%rax,%rdx)
jne 0x2353e
leaq (%rdi,%rdi,2), %rax
shlq $0x4, %rax
addq 0x30(%rcx), %rax
addq $0x10, %rsp
popq %rbp
retq
movq 0x2babc(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
movq %rdi, (%rsp)
leaq 0xd78d(%rip), %rdi      # 0x30caf
leaq 0xe0bd(%rip), %rdx      # 0x315e6
leaq 0xe0d1(%rip), %r8       # 0x31601
leaq 0xe0d4(%rip), %r9       # 0x3160b
movl $0xf, %ecx
jmp 0x2356d
movq 0x2ba8b(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
movq %rdi, (%rsp)
leaq 0xd75c(%rip), %rdi      # 0x30caf
leaq 0xe08c(%rip), %rdx      # 0x315e6
leaq 0xe0a0(%rip), %r8       # 0x31601
leaq 0xe0b9(%rip), %r9       # 0x31621
movl $0x16, %ecx
xorl %eax, %eax
callq 0x711f
callq 0x71d6
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2330
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/performance.cpp
// Function: Perf::clear()
void clear() {
    for (u64 i = 0; i < NUMBER_OF_MARKERS; i++) {
        volatile Clock *clock = clocks + i;
        if (clock->other_thread) continue;
        if (clock->active) {
            ERR("Never resetting clock \"%s\"", clock->name);
        }
        f64 time = clock->time / 1000.0f;
        clock->total_time += time;
        clock->last_time = time;
        clock->time = 0;
        clock->total_count += clock->count;
        clock->last_count = clock->count;
        clock->count = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0x40, %r13d
leaq 0x2ccd3(%rip), %rbx     # 0x50640
xorl %r14d, %r14d
leaq 0xdd97(%rip), %r15      # 0x3170e
leaq 0xdd96(%rip), %r12      # 0x31714
cmpb $0x0, -0x37(%rbx,%r13)
jne 0x23a0a
cmpb $0x0, -0x38(%rbx,%r13)
je 0x239c5
movq 0x2b637(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
movq -0x40(%rbx,%r13), %rax
movq %rax, (%rsp)
leaq 0xd303(%rip), %rdi      # 0x30caf
leaq 0xdd3b(%rip), %rdx      # 0x316ee
movl $0x8, %ecx
movq %r15, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x711f
movsd -0x20(%rbx,%r13), %xmm0
divsd 0xd0ac(%rip), %xmm0     # 0x30a80
movsd -0x8(%rbx,%r13), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x8(%rbx,%r13)
movsd %xmm0, -0x18(%rbx,%r13)
movq %r14, -0x20(%rbx,%r13)
movq -0x30(%rbx,%r13), %rax
addq %rax, (%rbx,%r13)
movq -0x30(%rbx,%r13), %rax
movq %rax, -0x10(%rbx,%r13)
movq %r14, -0x30(%rbx,%r13)
addq $0x48, %r13
cmpq $0x310, %r13            # imm = 0x310
jne 0x2397e
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/util/tweak_values.cpp
// Function: Util::clear_tweak_values()
void clear_tweak_values() {
    global_tweak.yoffset = debug_top_of_screen();
    global_tweak.indentation = 0;

    if (Input::mouse_pressed(0)) {
        if (global_tweak.active) global_tweak.hot = global_tweak.active;
        else global_tweak.active = "NO-DEBUG-VALUE";
    }

    if (!Input::mouse_down(0)) {
        global_tweak.hot = nullptr;
        global_tweak.active = nullptr;
    }

    if (global_tweak.active && Input::mouse_pressed(0))
        global_tweak.click_pos = Input::mouse_position();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cvtss2sd 0x4740d(%rip), %xmm0    # 0x6b264
movsd %xmm0, -0x8(%rbp)
movss 0xc3cc(%rip), %xmm0     # 0x30230
divss 0x47424(%rip), %xmm0    # 0x6b290
leaq 0x40b1d(%rip), %rax     # 0x64990
movq (%rax), %rsi
leaq 0x1359b(%rip), %rdi     # 0x37418
callq 0xa46d
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
cvtss2sd %xmm0, %xmm0
mulsd 0xcbd6(%rip), %xmm0     # 0x30a68
addsd -0x8(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
leaq 0x2bf56(%rip), %rax     # 0x4fdf8
movss %xmm0, 0xc(%rax)
movl $0x0, 0x10(%rax)
leaq 0x2b423(%rip), %rcx     # 0x4f2d8
movl 0x68(%rcx), %edx
cmpl $0x3, %edx
jne 0x23ed7
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x23ecc
movq %rsi, 0x20(%rax)
jmp 0x23ed7
leaq 0xd9c0(%rip), %rsi      # 0x31893
movq %rsi, 0x18(%rax)
testb $0x1, %dl
jne 0x23ee3
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
cmpl $0x3, %edx
jne 0x23f03
cmpq $0x0, 0x18(%rax)
je 0x23f03
xorps %xmm0, %xmm0
cvtsi2ssl 0x74(%rcx), %xmm0
cvtsi2ssl 0x78(%rcx), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, 0x28(%rax)
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::mouse_in_range(float, float)
b8 mouse_in_range(f32 height, f32 offset) {
    const f32 BASE_OFFSET = 1.2;
    f32 min = offset - height * (1.0 + BASE_OFFSET);
    f32 max = offset - height * (0.0 + BASE_OFFSET);
    f32 y = Input::normalized_mouse_position().y;
    return min < y && y < max;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
movsd 0xcb73(%rip), %xmm2     # 0x30a90
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
mulsd 0xcb67(%rip), %xmm0     # 0x30a98
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss 0xc2e7(%rip), %xmm1     # 0x30228
leaq 0x2b390(%rip), %rax     # 0x4f2d8
cvtsi2ssl 0x78(%rax), %xmm3
divss 0x4733b(%rip), %xmm1    # 0x6b290
addss %xmm3, %xmm3
mulss %xmm1, %xmm3
addss 0x47333(%rip), %xmm3    # 0x6b298
cmpltps %xmm3, %xmm2
cmpltps %xmm0, %xmm3
andps %xmm2, %xmm3
movd %xmm3, %eax
andb $0x1, %al
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::debug_value_logic(char const*, char const*)
void debug_value_logic(const char *name, const char *buffer) {
    f32 height = debug_line_height();
    b8 in_range = mouse_in_range(height, global_tweak.yoffset);

    if (global_tweak.active == nullptr && in_range)
        global_tweak.active = name;

    u32 color;
    if (global_tweak.hot == name)
        color = 2;
    else if (global_tweak.active == name)
        color = 1;
    else
        color = 0;

    if (color)
        Input::eat_mouse();

    debug_text(buffer, -1 + global_tweak.indentation * height, global_tweak.yoffset -= height, color);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movss 0xc2a3(%rip), %xmm0     # 0x30230
divss 0x472fb(%rip), %xmm0    # 0x6b290
leaq 0x409f4(%rip), %rax     # 0x64990
movq (%rax), %rsi
leaq 0x13472(%rip), %rdi     # 0x37418
callq 0xa46d
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
leaq 0x2be42(%rip), %rax     # 0x4fdf8
movss 0xc(%rax), %xmm1
leaq 0x2b316(%rip), %rcx     # 0x4f2d8
cmpq $0x0, 0x18(%rax)
jne 0x2402b
cvtss2sd %xmm1, %xmm2
cvtss2sd %xmm0, %xmm3
movsd 0xcab7(%rip), %xmm4     # 0x30a90
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
cvtsd2ss %xmm4, %xmm5
movss 0xc23b(%rip), %xmm6     # 0x30228
xorps %xmm4, %xmm4
cvtsi2ssl 0x78(%rcx), %xmm4
divss 0x47293(%rip), %xmm6    # 0x6b290
addss %xmm4, %xmm4
mulss %xmm6, %xmm4
addss 0x4728b(%rip), %xmm4    # 0x6b298
ucomiss %xmm5, %xmm4
jbe 0x2402b
mulsd 0xca7e(%rip), %xmm3     # 0x30a98
addsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
ucomiss %xmm4, %xmm2
jbe 0x2402b
movq %r14, 0x18(%rax)
movq 0x18(%rax), %rsi
movq 0x20(%rax), %rdx
cmpq %r14, %rdx
setne %dil
cmpq %r14, %rsi
setne %r8b
testb %r8b, %dil
jne 0x2404c
incl 0x8c(%rcx)
xorl %ecx, %ecx
cmpq %r14, %rsi
sete %cl
cmpq %r14, %rdx
movl $0x2, %esi
cmovnel %ecx, %esi
movl 0x10(%rax), %ecx
xorps %xmm2, %xmm2
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
addss 0xc1b2(%rip), %xmm2     # 0x30228
subss %xmm0, %xmm1
movss %xmm1, 0xc(%rax)
movq %rbx, %rdi
movaps %xmm2, %xmm0
popq %rbx
popq %r14
popq %rbp
jmp 0xa5e6
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::moved_over_boundry()
Vec2i moved_over_boundry() {
    const Vec2 mpos = Input::mouse_position();
    const Vec2 mmov = Input::mouse_move();
    const Vec2 cpos = global_tweak.click_pos;
    const f32 scale = global_tweak.snapping_pixels_to_unit;
    s32 upper_x = (mpos.x - cpos.x) * scale;
    s32 upper_y = (mpos.y - cpos.y) * scale;
    s32 lower_x = (mpos.x - mmov.x - cpos.x) * scale;
    s32 lower_y = (mpos.y - mmov.y - cpos.y) * scale;
    return {upper_x - lower_x, lower_y - upper_y};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x2b1a9(%rip), %rax     # 0x4f2d8
cvtsi2ssl 0x74(%rax), %xmm0
cvtsi2ssl 0x78(%rax), %xmm1
cvtsi2ssl 0x7c(%rax), %xmm2
cvtsi2ssl 0x80(%rax), %xmm3
leaq 0x2bcab(%rip), %rax     # 0x4fdf8
movss 0x8(%rax), %xmm4
movss 0x28(%rax), %xmm5
movss 0x2c(%rax), %xmm6
movaps %xmm0, %xmm7
subss %xmm5, %xmm7
mulss %xmm4, %xmm7
cvttss2si %xmm7, %eax
movaps %xmm1, %xmm7
subss %xmm6, %xmm7
mulss %xmm4, %xmm7
cvttss2si %xmm7, %ecx
subss %xmm2, %xmm0
subss %xmm5, %xmm0
mulss %xmm4, %xmm0
cvttss2si %xmm0, %edx
subl %edx, %eax
subss %xmm3, %xmm1
subss %xmm6, %xmm1
mulss %xmm4, %xmm1
cvttss2si %xmm1, %edx
subl %ecx, %edx
shlq $0x20, %rdx
orq %rdx, %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/util/tweak_values.cpp
// Function: Util::begin_tweak_section(char const*, unsigned char*)
b8 begin_tweak_section(const char *name, b8 *active) {
    if (!debug_values_are_on()) return false;
    const char *buffer = Util::format_int(" - %s -", name);
    debug_value_logic(name, buffer);

    if (name == global_tweak.active && Input::mouse_pressed(0))
        *active = !*active;

    global_tweak.indentation += *active;

    return *active;
}

// Assembly:
cmpb $0x0, 0x2b156(%rip)     # 0x4f370
je 0x24272
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd672(%rip), %rdi      # 0x318a2
movq %r14, %rsi
xorl %eax, %eax
callq 0xaafe
movq %r14, %rdi
movq %rax, %rsi
callq 0x23f78
leaq 0x2bbac(%rip), %rax     # 0x4fdf8
cmpq %r14, 0x18(%rax)
jne 0x24265
leaq 0x2b07f(%rip), %rcx     # 0x4f2d8
cmpl $0x3, 0x68(%rcx)
jne 0x24265
cmpb $0x0, (%rbx)
sete (%rbx)
movzbl (%rbx), %ecx
addl %ecx, 0x10(%rax)
movb (%rbx), %al
popq %rbx
popq %r14
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/logic.cpp
// Function: Logic::init()
b8 init() {
    logic_system.arena = Util::request_arena();
    for (s32 i = 0; i < At::COUNT; i++) {
        TimerBucket *bucket = logic_system.buckets + i;
        bucket->active = TimerBucket::NONE;
        bucket->free = 0;
        for (s32 j = 0; j < TimerBucket::NUM_TIMERS - 1; j++) {
            bucket->timers[j].forward = j + 1;
        }
        bucket->timers[TimerBucket::NUM_TIMERS - 1].forward = TimerBucket::NONE;
    }
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
xorl %edi, %edi
callq 0xaf5a
leaq 0x2c5cc(%rip), %rcx     # 0x50920
movq %rax, (%rcx)
movq %rcx, %rax
imulq $0x5008, %rbx, %rdx     # imm = 0x5008
addq %rcx, %rdx
addq $0x8, %rdx
movl $0xffff, 0x5000(%rdx)   # imm = 0xFFFF
movl $0x8, %esi
movw $0x1, %di
movw %di, (%rax,%rsi)
addq $0x28, %rsi
incl %edi
cmpq $0x4fe0, %rsi           # imm = 0x4FE0
jne 0x2437b
movw $0xffff, 0x4fd8(%rdx)   # imm = 0xFFFF
incq %rbx
addq $0x5008, %rax           # imm = 0x5008
cmpq $0x4, %rbx
jne 0x2435a
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/logic.cpp
// Function: Logic::TimerBucket::update(float, float)
void TimerBucket::update(f32 time, f32 delta) {
    s16 *slot = &active;
    while (*slot != TimerBucket::NONE) {
        Timer *timer = timers + *slot;
        if (timer->next != FOREVER) timer->call(time, delta);
        if (timer->done(time)) {
            s16 forward = timer->forward;
            timer->forward = free;
            free = *slot;
            *slot = forward;
        } else {
            slot = &timer->forward;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movss %xmm1, -0x20(%rbp)
movzwl 0x5000(%rdi), %eax
cmpw $-0x1, %ax
je 0x244c0
movq %rdi, %rbx
leaq 0x5000(%rdi), %r15
movss 0xbde6(%rip), %xmm2     # 0x30228
movss %xmm0, -0x1c(%rbp)
movswq %ax, %rax
leaq (%rax,%rax,4), %rax
leaq (%rbx,%rax,8), %r14
movss 0x8(%r14), %xmm1
ucomiss %xmm2, %xmm1
jne 0x24460
jnp 0x2447a
movq %r14, %rdi
movss -0x20(%rbp), %xmm1
callq 0x2f280
movss 0xbdb3(%rip), %xmm2     # 0x30228
movss -0x1c(%rbp), %xmm0
ucomiss 0x4(%r14), %xmm0
jae 0x24486
movq %r14, %r15
jmp 0x244b6
movss 0xc(%r14), %xmm1
ucomiss %xmm1, %xmm0
jb 0x24481
ucomiss %xmm2, %xmm1
jne 0x24498
jnp 0x24481
movzwl (%r14), %eax
movzwl 0x5002(%rbx), %ecx
movw %cx, (%r14)
movzwl (%r15), %ecx
movw %cx, 0x5002(%rbx)
movw %ax, (%r15)
movzwl (%r15), %eax
cmpw $-0x1, %ax
jne 0x24447
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/logic.cpp
// Function: Logic::TimerBucket::add_timer(Logic::Timer*)
LogicID TimerBucket::add_timer(Timer *timer) {
    ASSERT(free != NONE, "Using too many callbacks");
    s16 slot = free;
    Timer *to = timers + slot;
    free = to->forward;
    to->forward = active;
    active = slot;

    // This is kinda messy, if we were to reimplement
    // std::function<>() we could do a simple struct copy
    // here, alternatively we bite the bullet and actually
    // implement an assignment operator.
    to->gen++;
    to->end = timer->end;
    to->start = timer->start;
    to->next = timer->next;
    to->spacing = timer->spacing;
    to->callback = timer->callback;
    return {At::COUNT, slot, to->gen};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorl %ecx, %ecx
cmpw $-0x1, 0x5002(%rdi)
setne %cl
leaq 0xd3fa(%rip), %rdi      # 0x318e7
leaq 0xd40e(%rip), %rdx      # 0x31902
movl $0x34, %esi
callq 0x722f
movzwl 0x5002(%rbx), %eax
movswq %ax, %rcx
leaq (%rcx,%rcx,4), %rdx
movzwl (%rbx,%rdx,8), %esi
movw %si, 0x5002(%rbx)
movzwl 0x5000(%rbx), %esi
movw %si, (%rbx,%rdx,8)
movw %cx, 0x5000(%rbx)
movb 0x2(%rbx,%rdx,8), %cl
incb %cl
movb %cl, 0x2(%rbx,%rdx,8)
movss 0xc(%r14), %xmm0
movss %xmm0, 0xc(%rbx,%rdx,8)
movss 0x4(%r14), %xmm0
movss %xmm0, 0x4(%rbx,%rdx,8)
movss 0x8(%r14), %xmm0
movss %xmm0, 0x8(%rbx,%rdx,8)
movss 0x10(%r14), %xmm0
movss %xmm0, 0x10(%rbx,%rdx,8)
movq 0x18(%r14), %rsi
movq %rsi, 0x18(%rbx,%rdx,8)
movzbl %cl, %ecx
shlq $0x30, %rcx
shlq $0x20, %rax
addq %rcx, %rax
addq $0x4, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/logic.cpp
// Function: Logic::TimerBucket::remove_timer(Logic::LogicID)
void TimerBucket::remove_timer(LogicID id) {
    Timer *timer = get_timer(id);
    CHECK(timer, "Trying to delete unkown callback");
    timer->next = -1.0;
    timer->end = -1.0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
callq 0x245de
movq %rax, %rbx
testq %rax, %rax
jne 0x245c9
movq 0x2aa32(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xc5cb(%rip), %rdi      # 0x30b73
leaq 0xd338(%rip), %rdx      # 0x318e7
leaq 0xc5c5(%rip), %r8       # 0x30b7b
leaq 0xd36c(%rip), %r9       # 0x31929
movl $0x4a, %ecx
xorl %eax, %eax
callq 0x711f
movabsq $-0x407fffff40800000, %rax # imm = 0xBF800000BF800000
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/logic.cpp
// Function: Logic::TimerBucket::get_timer(Logic::LogicID)
Timer *TimerBucket::get_timer(LogicID id) {
    ASSERT(0 <= id.slot && id.slot < NUM_TIMERS, "Invalid LogicID");
    Timer *timer = timers + id.slot;
    if (timer->gen == id.gen)
        return timer;
    ERR("Failed to get timer");
    return nullptr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %r15
shrq $0x30, %r15
shrq $0x10, %r14
sarl $0x10, %r14d
xorl %ecx, %ecx
cmpl $0x200, %r14d           # imm = 0x200
setb %cl
leaq 0xd2d7(%rip), %rdi      # 0x318e7
leaq 0xd33c(%rip), %rdx      # 0x31953
movl $0x50, %esi
callq 0x722f
movslq %r14d, %rax
leaq (%rax,%rax,4), %rax
cmpb %r15b, 0x2(%rbx,%rax,8)
jne 0x24635
leaq (%rbx,%rax,8), %rbx
jmp 0x24669
movq 0x2a994(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xc669(%rip), %rdi      # 0x30caf
leaq 0xd29a(%rip), %rdx      # 0x318e7
leaq 0xd335(%rip), %r8       # 0x31989
leaq 0xd338(%rip), %r9       # 0x31993
xorl %ebx, %ebx
movl $0x54, %ecx
xorl %eax, %eax
callq 0x711f
movq %rbx, %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/logic/logic.cpp
// Function: Logic::add_callback(Logic::At, void (*)(float, float, float, void*), float, float, float, void*)
LogicID add_callback(At at, Callback callback, f32 start, f32 end,
                            f32 spacing, void *aux) {
    ASSERT(start != FOREVER, "I'm sorry Dave, I can't let you do that, I have to start some time!");
    Timer t = {0, 0, start, start, end, spacing, callback, aux};
    LogicID id = logic_system.buckets[at].add_timer(&t);
    id.at = at;
    return id;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rdx, %rbx
movss %xmm2, -0x24(%rbp)
movss %xmm1, -0x20(%rbp)
movss %xmm0, -0x1c(%rbp)
movq %rsi, %r14
movl %edi, %r15d
movss 0xbb84(%rip), %xmm1     # 0x30228
cmpneqss %xmm0, %xmm1
movd %xmm1, %ecx
andl $0x1, %ecx
leaq 0xd230(%rip), %rdi      # 0x318e7
leaq 0xd2e9(%rip), %rdx      # 0x319a7
movl $0x5a, %esi
callq 0x722f
leaq -0x50(%rbp), %rsi
movw $0x0, (%rsi)
movb $0x0, 0x2(%rsi)
movss -0x1c(%rbp), %xmm0
movss %xmm0, 0x4(%rsi)
movss %xmm0, 0x8(%rsi)
movss -0x20(%rbp), %xmm0
movss %xmm0, 0xc(%rsi)
movss -0x24(%rbp), %xmm0
movss %xmm0, 0x10(%rsi)
movq %r14, 0x18(%rsi)
movq %rbx, 0x20(%rsi)
movl %r15d, %ebx
imulq $0x5008, %rbx, %rax     # imm = 0x5008
leaq 0x2c20f(%rip), %rcx     # 0x50920
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
callq 0x244cc
movabsq $0xffffff00000000, %rcx # imm = 0xFFFFFF00000000
andq %rcx, %rax
orq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/logic.cpp
// Function: Logic::update_callback(Logic::LogicID, void (*)(float, float, float, void*), float, float, float, void*)
void update_callback(LogicID id, Callback callback,
                            f32 start, f32 end, f32 spacing, void *aux) {
    ASSERT(start != FOREVER, "I'm sorry Dave, I can't let you do that, I have to start some time!");
    Timer *timer = logic_system.buckets[id.at].get_timer(id);
    CHECK(timer, "Failed to find timer");
    timer->start = start;
    timer->next = start;
    timer->end = end;
    timer->spacing = spacing;
    timer->callback = callback;
    if (aux)
        timer->aux = aux;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movss %xmm2, -0x24(%rbp)
movss %xmm1, -0x20(%rbp)
movq %rsi, %r14
movq %rdi, %r15
movss 0xbaa2(%rip), %xmm1     # 0x30228
movss %xmm0, -0x1c(%rbp)
cmpneqss %xmm0, %xmm1
movd %xmm1, %ecx
andl $0x1, %ecx
leaq 0xd149(%rip), %rdi      # 0x318e7
leaq 0xd202(%rip), %rdx      # 0x319a7
movl $0x67, %esi
callq 0x722f
movl %r15d, %eax
imulq $0x5008, %rax, %rax     # imm = 0x5008
leaq 0x2c160(%rip), %rcx     # 0x50920
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x245de
movq %rax, %r15
testq %rax, %rax
jne 0x2480a
movq 0x2a7f1(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xc38a(%rip), %rdi      # 0x30b73
leaq 0xd0f7(%rip), %rdx      # 0x318e7
leaq 0xc384(%rip), %r8       # 0x30b7b
leaq 0xd1ff(%rip), %r9       # 0x319fd
movl $0x69, %ecx
xorl %eax, %eax
callq 0x711f
movss -0x1c(%rbp), %xmm0
movss %xmm0, 0x4(%r15)
movss %xmm0, 0x8(%r15)
movss -0x20(%rbp), %xmm0
movss %xmm0, 0xc(%r15)
movss -0x24(%rbp), %xmm0
movss %xmm0, 0x10(%r15)
movq %r14, 0x18(%r15)
testq %rbx, %rbx
je 0x2483e
movq %rbx, 0x20(%r15)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::add_shape_from_sprite(unsigned long long)
ShapeID add_shape_from_sprite(Asset::AssetID sprite_id) {
    Sprite *sprite = Asset::fetch_sprite(sprite_id);
    Vec2 *points = Util::request_temporary_memory<Vec2>(sprite->num_points);
    for (u32 i = 0; i < sprite->num_points; i++)
        points[i] = V2(sprite->points[i]);
    return add_shape(sprite->num_points, points);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movl $0x3, %esi
callq 0x234d6
movq %rax, %rbx
movl 0x8(%rax), %esi
cmpl $0x1, 0x2a5b3(%rip)     # 0x4f374
jne 0x24dcd
movl $0x0, 0x2a5a7(%rip)     # 0x4f374
movl 0x3fc1d(%rip), %eax     # 0x649f0
leaq 0x3fc06(%rip), %rcx     # 0x649e0
movq (%rcx,%rax,8), %rdi
callq 0x2fc4a
movl 0x8(%rbx), %edi
testl %edi, %edi
je 0x24e0b
xorl %ecx, %ecx
xorl %edx, %edx
movq 0x10(%rbx), %rsi
movsd (%rsi,%rcx), %xmm0
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
movl 0x8(%rbx), %edi
addq $0x10, %rcx
cmpq %rdi, %rdx
jb 0x24dee
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x248b8
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::find_shape(unsigned int)
Shape find_shape(ShapeID id) {
    ASSERT(id < (u32) global_shape_list.length, "Invalid id, shape does not exist.");
    Shape shape = global_shape_list[id];
    ASSERT(id == shape.id, "You have passed in a stale shape ID, this shape doesn't exist.");
    return shape;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x3fb1f(%rip), %r12     # 0x64950
xorl %ecx, %ecx
cmpl %esi, 0x4(%r12)
seta %cl
leaq 0xcbd9(%rip), %r15      # 0x31a1b
leaq 0xcc85(%rip), %rdx      # 0x31ace
movq %r15, %rdi
movl $0x6e, %esi
callq 0x722f
xorl %ecx, %ecx
cmpb $0x0, 0x10(%r12)
setne %cl
leaq 0x20b36(%rip), %rdi     # 0x4599e
leaq 0x20b4c(%rip), %rdx     # 0x459bb
movl $0x21, %esi
callq 0x722f
movq 0x8(%r12), %rax
movl %r14d, %ecx
shlq $0x6, %rcx
movups (%rax,%rcx), %xmm0
movups 0x10(%rax,%rcx), %xmm1
movups 0x20(%rax,%rcx), %xmm2
movups 0x30(%rax,%rcx), %xmm3
movups %xmm0, (%rbx)
movups %xmm3, 0x30(%rbx)
movups %xmm2, 0x20(%rbx)
movups %xmm1, 0x10(%rbx)
xorl %ecx, %ecx
cmpl %r14d, (%rbx)
sete %cl
leaq 0xcc5f(%rip), %rdx      # 0x31b15
movq %r15, %rdi
movl $0x70, %esi
callq 0x722f
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::project_shape(Physics::Shape, Vec2, Vec2, Vec2)
Limit project_shape(Shape shape, Vec2 axis,
        Vec2 scale=V2(1, 1), Vec2 offset=V2(0, 0))
{
    Limit limit = {};
    f32 delta = dot(offset, axis);
    for (u32 i = 0; i < shape.points.length; i++)
    {
        f32 projection = dot(hadamard(shape.points.data[i], scale), axis);
        limit.upper = MAX(limit.upper, projection + delta);
        limit.lower = MIN(limit.lower, projection + delta);
    }
    return limit;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x3c(%rbp), %eax
testq %rax, %rax
je 0x24faa
leaq 0x10(%rbp), %rcx
movaps %xmm0, %xmm3
mulps %xmm2, %xmm3
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
movq 0x30(%rcx), %rcx
xorps %xmm3, %xmm3
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm4
mulps %xmm1, %xmm4
movaps %xmm4, %xmm5
mulps %xmm0, %xmm5
shufps $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
mulss %xmm0, %xmm4
addss %xmm5, %xmm4
addss %xmm2, %xmm4
movaps %xmm3, %xmm5
shufps $0x55, %xmm3, %xmm5     # xmm5 = xmm5[1,1],xmm3[1,1]
maxss %xmm4, %xmm5
minss %xmm4, %xmm3
unpcklps %xmm5, %xmm3            # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
incq %rdx
cmpq %rdx, %rax
jne 0x24f70
jmp 0x24fad
xorps %xmm3, %xmm3
movaps %xmm3, %xmm0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::create_body(unsigned int, float, float, float)
Body create_body(ShapeID shape_id, f32 mass, f32 bounce, f32 damping) {
    ASSERT(shape_id >= 0, "Invalid shape ID");
    ASSERT(shape_id < global_shape_list.length, "Invalid shape ID");

    Body body = {};
    body.scale = V2(1, 1);
    body.layer = 0xFFFFFFFF;
    body.damping = damping;
    body.shape = shape_id;
    body.bounce = bounce;
    if (mass == 0.0)
        body.inverse_mass = 0.0f;
    else
        body.inverse_mass = 1.0f / mass;

    return body;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movss %xmm2, -0x14(%rbp)
movss %xmm1, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x3f977(%rip), %rax     # 0x64950
xorl %ecx, %ecx
cmpl %esi, 0x4(%rax)
seta %cl
leaq 0xca33(%rip), %rdi      # 0x31a1b
leaq 0xcb75(%rip), %rdx      # 0x31b64
movl $0x8e, %esi
callq 0x722f
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rbx)
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movups %xmm0, 0x30(%rbx)
movq $0x0, 0x40(%rbx)
movsd 0xb285(%rip), %xmm0     # 0x302a0
movsd %xmm0, 0x1c(%rbx)
movl $0xffffffff, 0x4(%rbx)  # imm = 0xFFFFFFFF
movss -0x14(%rbp), %xmm0
movss %xmm0, 0x40(%rbx)
movl %r14d, (%rbx)
movss -0x18(%rbp), %xmm0
movss %xmm0, 0x44(%rbx)
movss 0xafbe(%rip), %xmm0     # 0x30004
movss -0x1c(%rbp), %xmm2
divss %xmm2, %xmm0
xorps %xmm1, %xmm1
cmpeqss %xmm2, %xmm1
andnps %xmm0, %xmm1
movss %xmm1, 0x3c(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::point_in_box(Vec2, Vec2, Vec2, float)
b8 point_in_box(Vec2 p, Vec2 center, Vec2 dim, f32 rotation) {
    p = rotate(p, -rotation);
    center = rotate(center, -rotation);
    Vec2 delta = p - center;
    return ABS(delta.x) < ABS(dim.x * 0.5) && ABS(delta.y) < ABS(dim.y * 0.5);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movaps %xmm2, -0x70(%rbp)
movaps %xmm1, -0x60(%rbp)
movaps %xmm0, -0x30(%rbp)
movaps %xmm3, %xmm0
xorps 0xab48(%rip), %xmm0     # 0x30040
movaps %xmm0, -0x20(%rbp)
callq 0x2050
movss %xmm0, -0x4(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x2350
movaps -0x30(%rbp), %xmm3
movaps %xmm3, %xmm1
shufps $0x55, %xmm3, %xmm1     # xmm1 = xmm1[1,1],xmm3[1,1]
movss -0x4(%rbp), %xmm2
movaps %xmm1, -0x40(%rbp)
mulss %xmm1, %xmm2
movaps %xmm3, %xmm1
movss %xmm0, -0x8(%rbp)
mulss %xmm0, %xmm1
subss %xmm2, %xmm1
movaps %xmm1, -0x50(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x2050
movss %xmm0, -0xc(%rbp)
movaps -0x20(%rbp), %xmm0
callq 0x2350
movss -0xc(%rbp), %xmm7
movaps -0x60(%rbp), %xmm6
movaps -0x70(%rbp), %xmm5
movaps %xmm6, %xmm1
shufps $0x55, %xmm6, %xmm1     # xmm1 = xmm1[1,1],xmm6[1,1]
movaps %xmm7, %xmm2
mulss %xmm1, %xmm2
movaps %xmm6, %xmm3
mulss %xmm0, %xmm3
subss %xmm2, %xmm3
movaps -0x50(%rbp), %xmm4
subss %xmm3, %xmm4
movaps 0xaab9(%rip), %xmm2     # 0x30040
xorps %xmm4, %xmm2
maxss %xmm4, %xmm2
cvtss2sd %xmm2, %xmm2
xorps %xmm3, %xmm3
cvtss2sd %xmm5, %xmm3
mulsd 0xb4c7(%rip), %xmm3     # 0x30a68
movapd 0xadc7(%rip), %xmm4     # 0x30370
xorpd %xmm3, %xmm4
maxsd %xmm3, %xmm4
ucomisd %xmm2, %xmm4
jbe 0x2561b
movaps -0x40(%rbp), %xmm3
mulss -0x8(%rbp), %xmm3
movaps -0x30(%rbp), %xmm2
mulss -0x4(%rbp), %xmm2
addss %xmm3, %xmm2
mulss %xmm0, %xmm1
mulss %xmm7, %xmm6
addss %xmm1, %xmm6
subss %xmm6, %xmm2
movaps 0xaa5c(%rip), %xmm0     # 0x30040
xorps %xmm2, %xmm0
maxss %xmm2, %xmm0
shufps $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
xorps %xmm1, %xmm1
cvtss2sd %xmm5, %xmm1
mulsd 0xb46a(%rip), %xmm1     # 0x30a68
cvtss2sd %xmm0, %xmm0
movapd 0xad66(%rip), %xmm2     # 0x30370
xorpd %xmm1, %xmm2
maxsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
seta %al
jmp 0x2561d
xorl %eax, %eax
addq $0x70, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::integrate(Physics::Body*, float)
void integrate(Body *body, f32 delta) {
    body->acceleration += body->force * body->inverse_mass;
    body->velocity += body->acceleration * delta;
    body->position += body->velocity * delta;

#if 1
    f32 damping = CLAMP(0.0f, 1.0f, 1 - body->damping);
    if (damping != 0.0f)
        body->velocity = body->velocity * pow(damping, delta);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movaps %xmm0, %xmm1
movq %rdi, %rbx
movss 0x3c(%rdi), %xmm0
movss 0x34(%rdi), %xmm2
mulss %xmm0, %xmm2
mulss 0x38(%rdi), %xmm0
addss 0x2c(%rdi), %xmm2
movss %xmm2, 0x2c(%rdi)
addss 0x30(%rdi), %xmm0
movss %xmm0, 0x30(%rdi)
mulss %xmm1, %xmm2
mulss %xmm1, %xmm0
addss 0x24(%rdi), %xmm2
movss %xmm2, 0x24(%rdi)
addss 0x28(%rdi), %xmm0
movss %xmm0, 0x28(%rdi)
mulss %xmm1, %xmm2
mulss %xmm1, %xmm0
addss 0x14(%rdi), %xmm2
movss %xmm2, 0x14(%rdi)
addss 0x18(%rdi), %xmm0
movss %xmm0, 0x18(%rdi)
movss 0xa96e(%rip), %xmm4     # 0x30004
movaps %xmm4, %xmm3
subss 0x40(%rdi), %xmm3
xorps %xmm2, %xmm2
ucomiss %xmm3, %xmm2
xorps %xmm0, %xmm0
ja 0x256b4
ucomiss %xmm4, %xmm3
movaps %xmm4, %xmm0
ja 0x256b4
movaps %xmm3, %xmm0
ucomiss %xmm2, %xmm0
jne 0x256bb
jnp 0x256d5
callq 0x23f0
movss 0x24(%rbx), %xmm1
mulss %xmm0, %xmm1
mulss 0x28(%rbx), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movlps %xmm1, 0x24(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/logic/block_physics.cpp
// Function: Physics::reversed(Physics::Overlap)
Overlap reversed(Overlap overlap)
{
    return {
        overlap.b,
        overlap.a,
        overlap.depth,
        -overlap.normal,
        overlap.is_valid
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, %rax
movq 0x18(%rbp), %rcx
movq %rcx, (%rdi)
movq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rdi)
movss 0x20(%rbp), %xmm0
movss %xmm0, 0x10(%rdi)
movsd 0x24(%rbp), %xmm0
xorps 0x9e92(%rip), %xmm0     # 0x30040
movlps %xmm0, 0x14(%rdi)
movb 0x2c(%rbp), %cl
movb %cl, 0x1c(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::add(float*, float, float)
void add(f32 *value, f32 target, f32 delta) {
    if (delta > 0 && *value < target) {
        *value = MIN(*value + delta, target);
    } else if (delta < 0 && *value > target) {
        *value = MAX(*value + delta, target);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm1
jbe 0x261d9
movss (%rdi), %xmm2
ucomiss %xmm2, %xmm0
jbe 0x261d9
addss %xmm1, %xmm2
minss %xmm0, %xmm2
jmp 0x261ef
ucomiss %xmm1, %xmm3
jbe 0x261f3
movss (%rdi), %xmm2
ucomiss %xmm0, %xmm2
jbe 0x261f3
addss %xmm1, %xmm2
maxss %xmm0, %xmm2
movss %xmm2, (%rdi)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::Channel::set_delay(float, float, float)
void Channel::set_delay(f32 feedback, f32 len_seconds, f32 in_seconds) {
    if (feedback >= 0) delay.feedback_target = feedback;
    if (len_seconds >= 0) delay.len_seconds_target = len_seconds;
    delay.feedback_delta = (delay.feedback_target - delay.feedback) / (in_seconds * AUDIO_SAMPLE_RATE / (AUDIO_SAMPLES_WANT * 2));
    delay.len_seconds_delta = (delay.len_seconds_target - delay.len_seconds) / (in_seconds * AUDIO_SAMPLE_RATE / (AUDIO_SAMPLES_WANT * 2));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
xorps %xmm3, %xmm3
ucomiss %xmm3, %xmm0
jb 0x2665d
movss %xmm0, 0xc(%rdi)
ucomiss %xmm3, %xmm1
jb 0x26667
movss %xmm1, 0x1c(%rdi)
movss 0xc(%rdi), %xmm0
movss 0x1c(%rdi), %xmm1
subss 0x8(%rdi), %xmm0
mulss 0x9be6(%rip), %xmm2     # 0x30264
mulss 0x9be2(%rip), %xmm2     # 0x30268
divss %xmm2, %xmm0
movss %xmm0, 0x10(%rdi)
subss 0x18(%rdi), %xmm1
divss %xmm2, %xmm1
movss %xmm1, 0x20(%rdi)
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::push_sound(Mixer::SoundSource)
AudioID push_sound(SoundSource source) {
    lock_audio();
    if (audio_struct.num_free_sources) {
        u16 source_id =
            audio_struct.free_sources[--audio_struct.num_free_sources];
        source.gen = audio_struct.sources[source_id].gen + 1;
        audio_struct.sources[source_id] = source;
        unlock_audio();
        return {source.gen, source_id};
    } else {
        ERR("Not enough free sources, skipping playing of sound");
    }
    unlock_audio();
    return {0, NUM_SOURCES};
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x287eb(%rip), %rbx     # 0x4f378
movl 0x9cc(%rbx), %edi
callq 0x2230
movzwl 0x600(%rbx), %eax
testw %ax, %ax
je 0x26c01
leaq 0x10(%rbp), %rcx
decl %eax
movw %ax, 0x600(%rbx)
movzwl %ax, %eax
movzwl 0x602(%rbx,%rax,2), %r14d
leaq (%r14,%r14,2), %rax
shll $0x4, %eax
movb 0x26(%rbx,%rax), %r15b
incb %r15b
movb %r15b, 0x26(%rcx)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movups %xmm1, 0x10(%rbx,%rax)
movups %xmm0, (%rbx,%rax)
movups 0x20(%rcx), %xmm0
movups %xmm0, 0x20(%rbx,%rax)
movl 0x9cc(%rbx), %edi
callq 0x2070
shll $0x10, %r14d
movzbl %r15b, %eax
orl %r14d, %eax
jmp 0x26c43
movq 0x283c8(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xa09d(%rip), %rdi      # 0x30caf
leaq 0xaf81(%rip), %rdx      # 0x31b9a
leaq 0xb003(%rip), %r8       # 0x31c23
leaq 0xb007(%rip), %r9       # 0x31c2e
movl $0x7e, %ecx
xorl %eax, %eax
callq 0x711f
movl 0x9cc(%rbx), %edi
callq 0x2070
movl $0x200000, %eax         # imm = 0x200000
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/mixer.cpp
// Function: Mixer::play_sound_at(unsigned int, unsigned long long, Vec2, float, float, float, float, unsigned char)
AudioID play_sound_at(u32 channel_id, AssetID asset_id, Vec2 position, f32 pitch, f32 gain,
                      f32 pitch_variance, f32 gain_variance, b8 loop) {
    ASSERT(channel_id < NUM_CHANNELS, "Invalid channel");
    return push_sound({0, asset_id, channel_id, pitch + random_real(-1, 1) * pitch_variance,
                       gain + random_real(-1, 1) * gain_variance, loop, true,
                       position});
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %edx, %ebx
movss %xmm4, -0x24(%rbp)
movss %xmm3, -0x1c(%rbp)
movss %xmm2, -0x28(%rbp)
movss %xmm1, -0x20(%rbp)
movaps %xmm0, -0x70(%rbp)
movq %rsi, %r14
movl %edi, %r15d
xorl %ecx, %ecx
cmpl $0xa, %edi
setb %cl
leaq 0xad31(%rip), %rdi      # 0x31b9a
leaq 0xad88(%rip), %rdx      # 0x31bf8
movl $0x93, %esi
callq 0x722f
movl $0x0, -0x58(%rbp)
movq %r14, -0x50(%rbp)
movl %r15d, -0x48(%rbp)
leaq 0x28f54(%rip), %rax     # 0x4fde4
movl 0xc(%rax), %edx
movl (%rax), %esi
movl %edx, %ecx
shrl $0x2, %ecx
xorl %edx, %ecx
movl %esi, %edx
shll $0x4, %edx
xorl %esi, %edx
xorl %ecx, %edx
addl %ecx, %ecx
xorl %edx, %ecx
movl 0x10(%rax), %edx
leal (%rdx,%rcx), %edi
addl $0x587c5, %edi          # imm = 0x587C5
xorps %xmm2, %xmm2
cvtsi2ss %rdi, %xmm2
movl 0x8(%rax), %edi
movl 0x4(%rax), %r8d
movss 0x9358(%rip), %xmm0     # 0x30224
mulss %xmm0, %xmm2
addss %xmm2, %xmm2
movss 0x934c(%rip), %xmm1     # 0x30228
addss %xmm1, %xmm2
mulss -0x1c(%rbp), %xmm2
addss -0x20(%rbp), %xmm2
movss %xmm2, -0x44(%rbp)
movl %r8d, 0xc(%rax)
movl %esi, 0x8(%rax)
movl %ecx, 0x4(%rax)
movl %edi, %esi
shrl $0x2, %esi
xorl %edi, %esi
leal (%rsi,%rsi), %edi
xorl %esi, %edi
xorl %ecx, %edi
shll $0x4, %ecx
xorl %edi, %ecx
movl %ecx, (%rax)
addl %edx, %ecx
addl $0xb0f8a, %ecx          # imm = 0xB0F8A
addl $0xb0f8a, %edx          # imm = 0xB0F8A
xorps %xmm2, %xmm2
cvtsi2ss %rcx, %xmm2
movl %edx, 0x10(%rax)
mulss %xmm0, %xmm2
addss %xmm2, %xmm2
addss %xmm1, %xmm2
mulss -0x24(%rbp), %xmm2
addss -0x28(%rbp), %xmm2
movss %xmm2, -0x40(%rbp)
movb %bl, -0x3c(%rbp)
movb $0x1, -0x3b(%rbp)
movaps -0x70(%rbp), %xmm0
movlps %xmm0, -0x3a(%rbp)
movb $0x0, -0x32(%rbp)
movq $0x0, -0x30(%rbp)
movups -0x58(%rbp), %xmm0
movups -0x48(%rbp), %xmm1
movups -0x38(%rbp), %xmm2
movups %xmm2, 0x20(%rsp)
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
callq 0x26b7c
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::stop_sound(Mixer::AudioID)
void stop_sound(AudioID id) {
    ASSERT(id.slot < NUM_SOURCES, "Invalid index in ID");
    lock_audio();
    SoundSource *source = fetch_source(id);
    if (source->gen == id.gen) {
        audio_struct.free_sources[audio_struct.num_free_sources++] = id.slot;
        source->gain = 0.0;
    } else {
        ERR("Invalid removal of AudioID that does not exist");
    }
    unlock_audio();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x200000, %edi         # imm = 0x200000
setb %cl
leaq 0xabf5(%rip), %rdi      # 0x31b9a
leaq 0xacf6(%rip), %rdx      # 0x31ca2
movl $0x9a, %esi
callq 0x722f
leaq 0x283bb(%rip), %r14     # 0x4f378
movl 0x9cc(%r14), %edi
callq 0x2230
movl %ebx, %edi
callq 0x26c7c
cmpb %bl, 0x26(%rax)
jne 0x26ffd
shrl $0x10, %ebx
movzwl 0x600(%r14), %ecx
leal 0x1(%rcx), %edx
movw %dx, 0x600(%r14)
movw %bx, 0x602(%r14,%rcx,2)
movl $0x0, 0x18(%rax)
jmp 0x2702f
movq 0x27fcc(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0x9ca1(%rip), %rdi      # 0x30caf
leaq 0xab85(%rip), %rdx      # 0x31b9a
leaq 0xacb1(%rip), %r8       # 0x31ccd
leaq 0xacb5(%rip), %r9       # 0x31cd8
movl $0xa1, %ecx
xorl %eax, %eax
callq 0x711f
movl 0x9cc(%r14), %edi
popq %rbx
popq %r14
popq %rbp
jmp 0x2070
// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/platform/mixer.cpp
// Function: Mixer::post_sound_hook(Mixer::AudioID, void (*)())
void post_sound_hook(AudioID id, FogCallback post_hook) {
    ASSERT(id.slot < NUM_SOURCES, "Invalid index in ID");
    lock_audio();
    SoundSource *source = fetch_source(id);
    if (source->gen == id.gen) {
        source->post_hook = post_hook;
    } else {
        ERR("Tried to attach a post hook to an AudioID that does not exist");
    }
    unlock_audio();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
xorl %ecx, %ecx
cmpl $0x200000, %edi         # imm = 0x200000
setb %cl
leaq 0xab39(%rip), %rdi      # 0x31b9a
leaq 0xac3a(%rip), %rdx      # 0x31ca2
movl $0xa7, %esi
callq 0x722f
leaq 0x282ff(%rip), %r15     # 0x4f378
movl 0x9cc(%r15), %edi
callq 0x2230
movl %r14d, %edi
callq 0x26c7c
cmpb %r14b, 0x26(%rax)
jne 0x27099
movq %rbx, 0x28(%rax)
jmp 0x270cb
movq 0x27f30(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0x9c05(%rip), %rdi      # 0x30caf
leaq 0xaae9(%rip), %rdx      # 0x31b9a
leaq 0xac4f(%rip), %r8       # 0x31d07
leaq 0xac58(%rip), %r9       # 0x31d17
movl $0xad, %ecx
xorl %eax, %eax
callq 0x711f
movl 0x9cc(%r15), %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x2070