LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/performance.cpp
// Function: Perf::_stop_perf_clock(Perf::MarkerID)
void _stop_perf_clock(MarkerID id) {
    ASSERT(0 <= id && id < NUMBER_OF_MARKERS, "Invalid perf ID");
    volatile Clock *clock = clocks + id;
    CHECK(clock->active, "Stopping allready stopped clock");
    if (!clock->active) return;
    clock->active = false;
    u64 now = highp_now();
    if (now < clock->start) {
        ERR("Performance clock error, invalid times for %s", clock->name);
        return;
    }
    clock->time += now - clock->start;

    if (clock->other_thread) {
        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 %rbx
pushq %rax
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0xa, %edi
setb %cl
leaq 0xc336(%rip), %r14      # 0x2c6b6
leaq 0xc370(%rip), %rdx      # 0x2c6f7
pushq $0x21
popq %rsi
movq %r14, %rdi
callq 0x6903
movslq %ebx, %rax
imulq $0x48, %rax, %r15
leaq 0x2b2a0(%rip), %rbx     # 0x4b640
xorl %ecx, %ecx
cmpb $0x0, 0x8(%rbx,%r15)
setne %cl
leaq 0xc3aa(%rip), %rdx      # 0x2c75c
pushq $0x23
popq %rsi
movq %r14, %rdi
callq 0x693a
cmpb $0x0, 0x8(%rbx,%r15)
je 0x20483
addq %r15, %rbx
movb $0x0, 0x8(%rbx)
callq 0x21914
cmpq 0x18(%rbx), %rax
jae 0x20414
movq 0x29bee(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
movq (%rbx), %rax
movq %rax, (%rsp)
leaq 0xb884(%rip), %rdi      # 0x2bc77
leaq 0xc2bc(%rip), %rdx      # 0x2c6b6
leaq 0xc38c(%rip), %r8       # 0x2c78d
leaq 0xc396(%rip), %r9       # 0x2c79e
pushq $0x28
popq %rcx
xorl %eax, %eax
callq 0x683a
jmp 0x20483
subq 0x18(%rbx), %rax
movq %rax, %xmm0
punpckldq 0xae8b(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xae93(%rip), %xmm0     # 0x2b2c0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x20(%rbx), %xmm1
movsd %xmm1, 0x20(%rbx)
cmpb $0x0, 0x9(%rbx)
je 0x20483
movsd 0x20(%rbx), %xmm0
divsd 0xb5f2(%rip), %xmm0     # 0x2ba48
movsd 0x38(%rbx), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rbx)
movsd %xmm0, 0x28(%rbx)
xorl %eax, %eax
movq %rax, 0x20(%rbx)
movq 0x10(%rbx), %rcx
addq %rcx, 0x40(%rbx)
movq 0x10(%rbx), %rcx
movq %rcx, 0x30(%rbx)
movq %rax, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/particle_system.cpp
// Function: Renderer::ParticleSystemInt::spawn(unsigned int)
void ParticleSystemInt::spawn(u32 num_particles) {
    ASSERT(particles, "Trying to use uninitalized/destroyed particle system");
    for (u32 i = 0; i < num_particles; i++) {
        if (head == tail) {
            if (!drop_oldest)
                return;
            head = (head + 1) % max_num_particles;
        }
        Particle new_particle = generate();
        particles[tail] = new_particle;
        tail = (tail + 1) % max_num_particles;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x88, %rsp
movl %esi, %ebx
movq %rdi, %r14
xorl %ecx, %ecx
cmpq $0x0, 0x118(%rdi)
setne %cl
leaq 0xbf2a(%rip), %rdi      # 0x2c3eb
leaq 0xbf4b(%rip), %rdx      # 0x2c413
pushq $0x76
popq %rsi
callq 0x6903
leaq -0xa0(%rbp), %r15
subl $0x1, %ebx
jb 0x20550
movl 0x108(%r14), %eax
cmpl 0x10c(%r14), %eax
jne 0x20508
cmpb $0x0, 0x12d(%r14)
je 0x20550
incl %eax
xorl %edx, %edx
divl 0x110(%r14)
movl %edx, 0x108(%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x209ee
movl 0x10c(%r14), %eax
imulq $0x88, %rax, %rdi
addq 0x118(%r14), %rdi
movl $0x88, %edx
movq %r15, %rsi
callq 0x2090
movl 0x10c(%r14), %eax
incl %eax
xorl %edx, %edx
divl 0x110(%r14)
movl %edx, 0x10c(%r14)
jmp 0x204d7
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/particle_system.cpp
// Function: Renderer::ParticleSystemInt::update(float)
void ParticleSystemInt::update(f32 delta) {
    ASSERT(particles, "Trying to use uninitalized/destroyed particle system");
    u32 i = head;
    b8 move = true;
    do {
        particles[i].update(delta);
        if (move && !particles[i].alive) {
            u32 new_head = (head + 1) % max_num_particles;
            if (new_head != tail) {
                head = new_head;
            }
        } else {
            move = false;
        }
    } while ((i = (i + 1) % max_num_particles) != tail);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movss %xmm0, -0x24(%rbp)
movq %rdi, %rbx
xorl %ecx, %ecx
cmpq $0x0, 0x118(%rdi)
setne %cl
leaq 0xbe58(%rip), %rdi      # 0x2c3eb
leaq 0xbe79(%rip), %rdx      # 0x2c413
movl $0x84, %esi
callq 0x6903
movl 0x108(%rbx), %edx
movb $0x1, %r15b
movl %edx, %r14d
imulq $0x88, %r14, %r12
movq 0x118(%rbx), %rdi
addq %r12, %rdi
movss -0x24(%rbp), %xmm0
callq 0x207ea
testb %r15b, %r15b
jne 0x205de
movl 0x10c(%rbx), %ecx
movl 0x110(%rbx), %esi
jmp 0x205f9
movq 0x118(%rbx), %rax
cmpb $0x0, 0x9(%rax,%r12)
movl 0x10c(%rbx), %ecx
movl 0x110(%rbx), %esi
je 0x2060c
xorl %r15d, %r15d
incl %r14d
movl %r14d, %eax
xorl %edx, %edx
divl %esi
cmpl %ecx, %edx
jne 0x205ad
jmp 0x20627
movl 0x108(%rbx), %eax
incl %eax
xorl %edx, %edx
divl %esi
movb $0x1, %r15b
cmpl %ecx, %edx
je 0x205fc
movl %edx, 0x108(%rbx)
jmp 0x205fc
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/particle_system.cpp
// Function: Renderer::ParticleSystemInt::draw()
void ParticleSystemInt::draw() {
    ASSERT(particles, "Trying to use uninitalized/destroyed particle system");
    u32 i = head;
    Vec2 p = relative ? position : V2(0, 0);
    do {
        i %= max_num_particles;
        if (num_sprites) {
            AssetID sprite = sprites[particles[i].sprite];
            particles[i].render(layer, p, sprite);
        } else {
            particles[i].render(layer, p, Asset::ASSET_ID_NO_ASSET);
        }
    } while ((i = (i + 1) % max_num_particles) != tail);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %ecx, %ecx
cmpq $0x0, 0x118(%rdi)
setne %cl
leaq 0xbd8b(%rip), %rdi      # 0x2c3eb
leaq 0xbdac(%rip), %rdx      # 0x2c413
movl $0x95, %esi
callq 0x6903
cmpb $0x0, 0x128(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
je 0x2068d
movsd 0x130(%rbx), %xmm0
movaps %xmm0, -0x20(%rbp)
movl 0x108(%rbx), %edx
movl 0x110(%rbx), %ecx
movl %edx, %eax
xorl %edx, %edx
divl %ecx
movl %edx, %r14d
imulq $0x88, %r14, %rdi
addq 0x118(%rbx), %rdi
cmpl $0x0, (%rbx)
je 0x206c4
movswq 0x80(%rdi), %rax
movq 0x8(%rbx,%rax,8), %rdx
jmp 0x206c9
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl 0x4(%rbx), %esi
movaps -0x20(%rbp), %xmm0
callq 0x208be
incl %r14d
movl 0x110(%rbx), %ecx
movl %r14d, %eax
xorl %edx, %edx
divl %ecx
cmpl 0x10c(%rbx), %edx
jne 0x20699
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/particle_system.cpp
// Function: Renderer::ParticleSystemInt::clear()
void ParticleSystemInt::clear() {
    for (u32 i = 0; i < max_num_particles; i++) {
        particles[i].alive = false;
    }
    tail = 0;
    head = 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl 0x110(%rdi), %eax
movq 0x118(%rdi), %rcx
addq $0x9, %rcx
xorl %edx, %edx
cmpq %rax, %rdx
jae 0x2072b
movb $0x0, (%rcx)
incq %rdx
addq $0x88, %rcx
jmp 0x20717
movq $0x1, 0x108(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/particle_system.cpp
// Function: Renderer::ParticleSystemInt::add_sprite(unsigned long long)
void ParticleSystemInt::add_sprite(AssetID sprite){
    ASSERT(particles, "Trying to use uninitalized/destroyed particle system");
    ASSERT(Asset::is(sprite, Asset::Type::SPRITE), "Invalid sprite given to particle system.");
    ASSERT(num_sprites != MAX_NUM_SUB_SPRITES,
            "Too manu subsprites in particle system");
    sprites[num_sprites++] = sprite;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %ecx, %ecx
cmpq $0x0, 0x118(%rdi)
setne %cl
leaq 0xbc85(%rip), %rdi      # 0x2c3eb
leaq 0xbca6(%rip), %rdx      # 0x2c413
movl $0xac, %esi
callq 0x6903
leaq 0x45b22(%rip), %rax     # 0x662a0
cmpq %rbx, (%rax)
jae 0x20787
xorl %eax, %eax
jmp 0x20796
movq 0x28(%rax), %rax
imulq $0x38, %rbx, %rcx
cmpl $0x3, (%rax,%rcx)
sete %al
movzbl %al, %ecx
leaq 0xbc4b(%rip), %r15      # 0x2c3eb
leaq 0xbcac(%rip), %rdx      # 0x2c453
movq %r15, %rdi
movl $0xad, %esi
callq 0x6903
xorl %ecx, %ecx
cmpl $0x20, (%r14)
setne %cl
leaq 0xbce0(%rip), %rdx      # 0x2c4a4
movq %r15, %rdi
movl $0xaf, %esi
callq 0x6903
movl (%r14), %eax
leal 0x1(%rax), %ecx
movl %ecx, (%r14)
movq %rbx, 0x8(%r14,%rax,8)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/particle_system.cpp
// Function: Renderer::Particle::update(float)
void Particle::update(f32 delta) {
    alive = alive && (keep_alive || progress < 1.0);
    if (!alive) return;
    progress += inv_alive_time * delta;
    velocity += acceleration * delta;
    position += velocity * delta;
    velocity *= pow(damping, delta);
    rotation += angular_velocity * delta;
}

// Assembly:
cmpb $0x0, 0x9(%rdi)
je 0x208bd
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movaps %xmm0, %xmm2
movq %rdi, %rbx
cmpb $0x0, 0x8(%rdi)
je 0x20810
movb $0x1, 0x9(%rbx)
movss (%rbx), %xmm0
jmp 0x20829
movss (%rbx), %xmm0
movss 0xa7e8(%rip), %xmm1     # 0x2b004
ucomiss %xmm0, %xmm1
seta 0x9(%rbx)
jbe 0x208b7
movss 0x4(%rbx), %xmm1
mulss %xmm2, %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rbx)
movss 0x24(%rbx), %xmm0
mulss %xmm2, %xmm0
movss 0x28(%rbx), %xmm1
mulss %xmm2, %xmm1
addss 0x1c(%rbx), %xmm0
movss %xmm0, 0x1c(%rbx)
addss 0x20(%rbx), %xmm1
movss %xmm1, 0x20(%rbx)
mulss %xmm2, %xmm0
mulss %xmm2, %xmm1
addss 0x14(%rbx), %xmm0
movss %xmm0, 0x14(%rbx)
addss 0x18(%rbx), %xmm1
movss %xmm1, 0x18(%rbx)
movss 0x2c(%rbx), %xmm0
movaps %xmm2, %xmm1
movss %xmm2, -0xc(%rbp)
callq 0x23f0
movss 0x1c(%rbx), %xmm1
mulss %xmm0, %xmm1
mulss 0x20(%rbx), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movlps %xmm1, 0x1c(%rbx)
movss -0xc(%rbp), %xmm0
mulss 0x10(%rbx), %xmm0
addss 0xc(%rbx), %xmm0
movss %xmm0, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/particle_system.cpp
// Function: Renderer::Particle::render(unsigned int, Vec2, unsigned long long)
void Particle::render(u32 layer, Vec2 origin, AssetID sprite) {
    if (!alive) return;
    f32 progress_mod;
    if (keep_alive) progress_mod = MOD(progress, 1.0);
    else progress_mod = MIN(progress, 1.0);
    Vec2 render_dim = dim * (*progress_func_size)(spawn_size, spawn_size_deriv, die_size, die_size_deriv, progress_mod);
    Vec4 color = (*progress_func_color)(spawn_color, spawn_color_deriv, die_color, die_color_deriv, progress_mod);
    if (sprite == Asset::ASSET_ID_NO_ASSET) {
        Renderer::push_sprite_rect(
                layer,
                -1,
                position + origin,
                render_dim,
                rotation,
                V2(0, 0), V2(0, 0),
                color);
    } else {
        Renderer::push_sprite(
                layer,
                sprite,
                position + origin,
                render_dim,
                rotation,
                color);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
cmpb $0x0, 0x9(%rdi)
je 0x20904
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
movaps %xmm0, -0x40(%rbp)
cmpb $0x0, 0x8(%rdi)
movss (%rdi), %xmm4
je 0x2090f
cvtss2sd %xmm4, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x2100
movsd -0x30(%rbp), %xmm1
subsd %xmm0, %xmm1
cvtsd2ss %xmm1, %xmm4
jmp 0x20917
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
minss 0xa6ed(%rip), %xmm4     # 0x2b004
movq 0x40(%r15), %rax
movss 0x30(%r15), %xmm0
movss 0x34(%r15), %xmm1
movss 0x38(%r15), %xmm2
movss 0x3c(%r15), %xmm3
movss %xmm4, -0x1c(%rbp)
callq *(%rax)
movss 0x48(%r15), %xmm1
mulss %xmm0, %xmm1
mulss 0x4c(%r15), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps %xmm1, -0x30(%rbp)
movq 0x78(%r15), %rax
movsd 0x50(%r15), %xmm0
movsd 0x58(%r15), %xmm1
movss 0x60(%r15), %xmm2
movsd 0x64(%r15), %xmm3
movsd 0x6c(%r15), %xmm4
movss 0x74(%r15), %xmm5
movss -0x1c(%rbp), %xmm6
callq *(%rax)
movaps %xmm0, %xmm5
movaps %xmm1, %xmm6
movss 0x14(%r15), %xmm0
movaps -0x40(%rbp), %xmm1
addss %xmm1, %xmm0
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
addss 0x18(%r15), %xmm1
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movss 0xc(%r15), %xmm2
cmpq %rax, %r14
jne 0x209cf
pushq $-0x1
popq %rsi
xorps %xmm3, %xmm3
xorps %xmm4, %xmm4
movl %ebx, %edi
movaps -0x30(%rbp), %xmm1
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1ff11
movl %ebx, %edi
movq %r14, %rsi
movaps -0x30(%rbp), %xmm1
movaps %xmm5, %xmm3
movaps %xmm6, %xmm4
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1fd43
nop
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/renderer/camera.cpp
// Function: Renderer::turn_on_camera(unsigned int)
void turn_on_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) return;
    _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 0xb5aa(%rip), %rdi      # 0x2c50b
leaq 0xb5c2(%rip), %rdx      # 0x2c52a
pushq $0x10
popq %rsi
callq 0x6903
pushq $0x1
popq %rax
movl %ebx, %ecx
shll %cl, %eax
leaq 0x2a99a(%rip), %rcx     # 0x4b918
movl (%rcx), %edx
btl %ebx, %edx
jb 0x20f92
orl %eax, %edx
movl %edx, (%rcx)
leaq 0x2a98c(%rip), %rax     # 0x4b91c
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xb55b(%rip), %rdi      # 0x2c50b
leaq 0xb573(%rip), %rdx      # 0x2c52a
pushq $0x18
popq %rsi
callq 0x6903
pushq $0x1
popq %rax
movl %ebx, %ecx
shll %cl, %eax
leaq 0x2a94b(%rip), %rcx     # 0x4b918
movl (%rcx), %edx
btl %ebx, %edx
jae 0x20fe3
notl %eax
andl %eax, %edx
movl %edx, (%rcx)
leaq 0x2a93b(%rip), %rax     # 0x4b91c
decl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xb4fb(%rip), %rdi      # 0x2c50b
leaq 0xb534(%rip), %rdx      # 0x2c54b
pushq $0x21
popq %rsi
callq 0x6903
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movl $0x3f800000, 0x10(%rbx) # imm = 0x3F800000
xorl %edi, %edi
callq 0x9156
movss 0x14(%rax), %xmm0
movss %xmm0, 0x14(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
movss -0x1c(%rbp), %xmm0
callq 0x21062
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/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 0xb483(%rip), %rdi      # 0x2c50b
leaq 0xb4bc(%rip), %rdx      # 0x2c54b
pushq $0x37
popq %rsi
callq 0x6903
movss (%r14), %xmm2
movss 0x4(%r14), %xmm1
movsd (%r14), %xmm0
movl %r15d, %eax
xorl %ecx, %ecx
movaps %xmm0, %xmm3
shufps $0x55, %xmm0, %xmm3     # xmm3 = xmm3[1,1],xmm0[1,1]
cmpq %rcx, %rax
je 0x210dd
movss (%r14,%rcx,8), %xmm4
movss 0x4(%r14,%rcx,8), %xmm5
minss %xmm4, %xmm2
minss %xmm5, %xmm1
maxss %xmm4, %xmm0
maxss %xmm5, %xmm3
unpcklps %xmm3, %xmm0            # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
incq %rcx
jmp 0x210ac
addss %xmm0, %xmm2
addss %xmm3, %xmm1
movss 0xa157(%rip), %xmm4     # 0x2b244
mulss %xmm4, %xmm2
mulss %xmm4, %xmm1
addss %xmm2, %xmm0
unpcklps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
movlps %xmm2, (%rbx)
addss %xmm3, %xmm1
movss -0x1c(%rbp), %xmm2
addss %xmm2, %xmm0
addss %xmm2, %xmm1
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm0
jne 0x2112b
jp 0x2112b
ucomiss %xmm2, %xmm1
jne 0x2112b
jp 0x2112b
movss 0x9edb(%rip), %xmm1     # 0x2b004
jmp 0x21140
mulss 0x14(%rbx), %xmm1
maxss %xmm1, %xmm0
movss 0x9ec8(%rip), %xmm1     # 0x2b004
divss %xmm0, %xmm1
movss %xmm1, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x9ea5(%rip), %xmm1     # 0x2b004
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)
andq $0x0, 0x18(%rdi)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %rbx
pushq %rax
movl %edi, %r14d
xorl %ecx, %ecx
cmpl $0x2, %edi
setb %cl
leaq 0xb1d1(%rip), %rdi      # 0x2c50b
leaq 0xb239(%rip), %rdx      # 0x2c57a
pushq $0x59
popq %rsi
callq 0x6903
movl %r14d, %edi
callq 0x9156
movq %rax, %rbx
leaq 0x28f7d(%rip), %r15     # 0x4a2d8
testb $0x1, 0x68(%r15)
je 0x21384
movl %r14d, %edi
callq 0xa613
movss (%rbx), %xmm1
addss %xmm0, %xmm1
movss %xmm1, (%rbx)
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss 0x4(%rbx), %xmm0
movss %xmm0, 0x4(%rbx)
testb $0x1, 0x70(%r15)
movss 0x9c73(%rip), %xmm1     # 0x2b004
movaps %xmm1, %xmm0
je 0x213ab
cvtsi2ssl 0x80(%r15), %xmm0
mulss 0x9ea1(%rip), %xmm0     # 0x2b248
addss %xmm1, %xmm0
movl 0x88(%r15), %eax
testl %eax, %eax
je 0x213c6
cvtsi2ss %eax, %xmm0
mulss 0x9c4a(%rip), %xmm0     # 0x2b00c
addss %xmm1, %xmm0
mulss 0x10(%rbx), %xmm0
movss %xmm0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x44ea8(%rip), %rcx     # 0x662a0
cmpq %rdi, (%rcx)
jb 0x2141c
testl %esi, %esi
je 0x2140e
movq 0x28(%rcx), %rax
imulq $0x38, %rdi, %rdx
cmpl %esi, (%rax,%rdx)
jne 0x2144a
imulq $0x30, %rdi, %rax
addq 0x30(%rcx), %rax
addq $0x10, %rsp
popq %rbp
retq
movq 0x28bad(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
movq %rdi, (%rsp)
leaq 0xa846(%rip), %rdi      # 0x2bc77
leaq 0xb176(%rip), %rdx      # 0x2c5ae
leaq 0xb18a(%rip), %r8       # 0x2c5c9
leaq 0xb18d(%rip), %r9       # 0x2c5d3
pushq $0xf
jmp 0x21476
movq 0x28b7f(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
movq %rdi, (%rsp)
leaq 0xa818(%rip), %rdi      # 0x2bc77
leaq 0xb148(%rip), %rdx      # 0x2c5ae
leaq 0xb15c(%rip), %r8       # 0x2c5c9
leaq 0xb175(%rip), %r9       # 0x2c5e9
pushq $0x16
popq %rcx
xorl %eax, %eax
callq 0x683a
callq 0x68ed
pushq $-0x1
popq %rdi
callq 0x2330
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/util/performance.cpp
// Function: Perf::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
pushq $0x40
popq %rbx
leaq 0x29ded(%rip), %r14     # 0x4b640
xorl %r15d, %r15d
leaq 0xae7f(%rip), %r12      # 0x2c6dc
pushq $0x8
popq %r13
cmpq $0x310, %rbx            # imm = 0x310
je 0x21905
cmpb $0x0, -0x37(%r14,%rbx)
jne 0x218fc
cmpb $0x0, -0x38(%r14,%rbx)
je 0x218b7
movq 0x28747(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
movq -0x40(%r14,%rbx), %rax
movq %rax, (%rsp)
leaq 0xa3db(%rip), %rdi      # 0x2bc77
leaq 0xae13(%rip), %rdx      # 0x2c6b6
movl %r13d, %ecx
leaq 0xae29(%rip), %r8       # 0x2c6d6
movq %r12, %r9
xorl %eax, %eax
callq 0x683a
movsd -0x20(%r14,%rbx), %xmm0
divsd 0xa182(%rip), %xmm0     # 0x2ba48
movsd -0x8(%r14,%rbx), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, -0x8(%r14,%rbx)
movsd %xmm0, -0x18(%r14,%rbx)
movq %r15, -0x20(%r14,%rbx)
movq -0x30(%r14,%rbx), %rax
addq %rax, (%r14,%rbx)
movq -0x30(%r14,%rbx), %rax
movq %rax, -0x10(%r14,%rbx)
movq %r15, -0x30(%r14,%rbx)
addq $0x48, %rbx
jmp 0x21861
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/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
callq 0x911d
leaq 0x29253(%rip), %rax     # 0x4adf8
movss %xmm0, 0xc(%rax)
andl $0x0, 0x10(%rax)
leaq 0x28723(%rip), %rcx     # 0x4a2d8
movl 0x68(%rcx), %edx
cmpl $0x3, %edx
je 0x21bcb
testb $0x1, %dl
jne 0x21c02
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
jmp 0x21c02
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x21bda
movq %rsi, 0x20(%rax)
jmp 0x21be5
leaq 0xac7a(%rip), %rsi      # 0x2c85b
movq %rsi, 0x18(%rax)
cmpl $0x3, %edx
jne 0x21c02
cmpq $0x0, 0x18(%rax)
je 0x21c02
cvtsi2ssl 0x74(%rcx), %xmm0
cvtsi2ssl 0x78(%rcx), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, 0x28(%rax)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
subq $0x20, %rsp
cvtss2sd %xmm1, %xmm1
cvtss2sd %xmm0, %xmm0
movsd 0x9e3c(%rip), %xmm2     # 0x2ba58
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
movaps %xmm2, -0x20(%rbp)
mulsd 0x9e2c(%rip), %xmm0     # 0x2ba60
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movaps %xmm0, -0x10(%rbp)
callq 0xa597
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps -0x20(%rbp), %xmm1
cmpltps %xmm0, %xmm1
cmpltps -0x10(%rbp), %xmm0
andps %xmm1, %xmm0
movd %xmm0, %eax
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x902c
leaq 0x29177(%rip), %r15     # 0x4adf8
movss 0xc(%r15), %xmm1
movss %xmm0, -0x1c(%rbp)
movss %xmm1, -0x20(%rbp)
callq 0x21c04
movq 0x18(%r15), %rcx
testq %rcx, %rcx
setne %dl
testb %al, %al
sete %al
orb %dl, %al
jne 0x21cb0
movq %r14, 0x18(%r15)
movq %r14, %rcx
cmpq %r14, 0x20(%r15)
je 0x21cc1
xorl %esi, %esi
cmpq %r14, %rcx
jne 0x21cd1
pushq $0x1
jmp 0x21cc3
pushq $0x2
popq %rsi
leaq 0x2860d(%rip), %rax     # 0x4a2d8
incl 0x8c(%rax)
movl 0x10(%r15), %eax
cvtsi2ss %rax, %xmm0
movss -0x1c(%rbp), %xmm2
mulss %xmm2, %xmm0
addss 0x953d(%rip), %xmm0     # 0x2b228
movss -0x20(%rbp), %xmm1
subss %xmm2, %xmm1
movss %xmm1, 0xc(%r15)
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x9193
// File: /workspace/github_c_makefile_star2_O2/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 0x28550(%rip), %rax     # 0x4a2d8
cvtsi2ssl 0x74(%rax), %xmm0
cvtsi2ssl 0x78(%rax), %xmm1
cvtsi2ssl 0x7c(%rax), %xmm2
cvtsi2ssl 0x80(%rax), %xmm3
leaq 0x29052(%rip), %rax     # 0x4adf8
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_O2/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, 0x28505(%rip)     # 0x4a370
je 0x21ec7
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xa9e9(%rip), %rdi      # 0x2c86a
movq %r14, %rsi
xorl %eax, %eax
callq 0x9642
movq %r14, %rdi
movq %rax, %rsi
callq 0x21c65
leaq 0x28f5b(%rip), %rax     # 0x4adf8
movb (%rbx), %cl
cmpq %r14, 0x18(%rax)
jne 0x21eba
leaq 0x2842c(%rip), %rdx     # 0x4a2d8
cmpl $0x3, 0x68(%rdx)
jne 0x21eba
testb %cl, %cl
sete %cl
sete (%rbx)
movzbl %cl, %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_O2/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 0x9a17
leaq 0x299d0(%rip), %rcx     # 0x4b920
movq %rax, (%rcx)
pushq $0x8
popq %rax
movq %rcx, %rdx
cmpq $0x4, %rbx
je 0x21fa8
imulq $0x5008, %rbx, %rsi     # imm = 0x5008
addq %rcx, %rsi
addq $0x8, %rsi
movl $0xffff, 0x5000(%rsi)   # imm = 0xFFFF
movw $0x1, %di
movq %rax, %r8
cmpq $0x4fe0, %r8            # imm = 0x4FE0
je 0x21f94
movw %di, (%rdx,%r8)
addq $0x28, %r8
incl %edi
jmp 0x21f7e
orw $-0x1, 0x4fd8(%rsi)
incq %rbx
addq $0x5008, %rdx           # imm = 0x5008
jmp 0x21f59
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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)
movq %rdi, %rbx
leaq 0x5000(%rdi), %r15
movss 0x91f5(%rip), %xmm2     # 0x2b228
movss %xmm0, -0x1c(%rbp)
movswq (%r15), %rax
cmpq $-0x1, %rax
je 0x220af
imulq $0x28, %rax, %rax
leaq (%rbx,%rax), %r14
movss 0x8(%rbx,%rax), %xmm1
ucomiss %xmm2, %xmm1
jne 0x22057
jnp 0x22071
movq %r14, %rdi
movss -0x20(%rbp), %xmm1
callq 0x2a604
movss 0x91bc(%rip), %xmm2     # 0x2b228
movss -0x1c(%rbp), %xmm0
ucomiss 0x4(%r14), %xmm0
jb 0x220aa
movss 0xc(%r14), %xmm1
ucomiss %xmm1, %xmm0
jb 0x220aa
ucomiss %xmm2, %xmm1
jne 0x2208a
jnp 0x220aa
movzwl (%r14), %eax
movzwl 0x5002(%rbx), %ecx
movw %cx, (%r14)
movzwl (%r15), %ecx
movw %cx, 0x5002(%rbx)
movw %ax, (%r15)
jmp 0x22038
movq %r14, %r15
jmp 0x22038
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0xa7d4(%rip), %rdi      # 0x2c8af
leaq 0xa7e8(%rip), %rdx      # 0x2c8ca
pushq $0x34
popq %rsi
callq 0x6903
movzwl 0x5002(%rbx), %eax
movswq %ax, %rcx
imulq $0x28, %rcx, %rdx
movzwl (%rbx,%rdx), %esi
movw %si, 0x5002(%rbx)
movzwl 0x5000(%rbx), %esi
movw %si, (%rbx,%rdx)
movw %cx, 0x5000(%rbx)
movb 0x2(%rbx,%rdx), %cl
incb %cl
movb %cl, 0x2(%rbx,%rdx)
movss 0xc(%r14), %xmm0
movss %xmm0, 0xc(%rbx,%rdx)
movss 0x4(%r14), %xmm0
movss %xmm0, 0x4(%rbx,%rdx)
movss 0x8(%r14), %xmm0
movss %xmm0, 0x8(%rbx,%rdx)
movss 0x10(%r14), %xmm0
movss %xmm0, 0x10(%rbx,%rdx)
movq 0x18(%r14), %rsi
movq %rsi, 0x18(%rbx,%rdx)
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_O2/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 0x221b2
movq %rax, %rbx
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leaq 0xa722(%rip), %rdi      # 0x2c8af
leaq 0xa75d(%rip), %rdx      # 0x2c8f1
pushq $0x4a
popq %rsi
callq 0x693a
movabsq $-0x407fffff40800000, %rax # imm = 0xBF800000BF800000
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/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 0xa6cb(%rip), %rdi      # 0x2c8af
leaq 0xa730(%rip), %rdx      # 0x2c91b
pushq $0x50
popq %rsi
callq 0x6903
movslq %r14d, %rax
imulq $0x28, %rax, %rax
cmpb %r15b, 0x2(%rbx,%rax)
jne 0x22206
addq %rax, %rbx
jmp 0x22238
movq 0x27dc3(%rip), %rax     # 0x49fd0
movq (%rax), %rsi
leaq 0x9a60(%rip), %rdi      # 0x2bc77
leaq 0xa691(%rip), %rdx      # 0x2c8af
leaq 0xa72c(%rip), %r8       # 0x2c951
leaq 0xa72f(%rip), %r9       # 0x2c95b
xorl %ebx, %ebx
pushq $0x54
popq %rcx
xorl %eax, %eax
callq 0x683a
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/FredTheDino[P]Fog/src/engine/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 0x8fb5(%rip), %xmm1     # 0x2b228
cmpneqss %xmm0, %xmm1
movd %xmm1, %ecx
andl $0x1, %ecx
leaq 0xa629(%rip), %rdi      # 0x2c8af
leaq 0xa6e2(%rip), %rdx      # 0x2c96f
pushq $0x5a
popq %rsi
callq 0x6903
leaq -0x50(%rbp), %rsi
andw $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 0x29643(%rip), %rcx     # 0x4b920
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
callq 0x220ba
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_O2/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movss %xmm2, -0x2c(%rbp)
movss %xmm1, -0x28(%rbp)
movss %xmm0, -0x24(%rbp)
movq %rsi, %r14
movq %rdi, %r12
movss 0x8ecf(%rip), %xmm1     # 0x2b228
cmpneqss %xmm0, %xmm1
movd %xmm1, %ecx
andl $0x1, %ecx
leaq 0xa543(%rip), %r15      # 0x2c8af
leaq 0xa5fc(%rip), %rdx      # 0x2c96f
pushq $0x67
popq %rsi
movq %r15, %rdi
callq 0x6903
movl %r12d, %eax
imulq $0x5008, %rax, %rax     # imm = 0x5008
leaq 0x29591(%rip), %rcx     # 0x4b920
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
movq %r12, %rsi
callq 0x221b2
movq %rax, %r12
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
leaq 0xa614(%rip), %rdx      # 0x2c9c5
pushq $0x69
popq %rsi
movq %r15, %rdi
callq 0x693a
movss -0x24(%rbp), %xmm0
movss %xmm0, 0x4(%r12)
movss %xmm0, 0x8(%r12)
movss -0x28(%rbp), %xmm0
movss %xmm0, 0xc(%r12)
movss -0x2c(%rbp), %xmm0
movss %xmm0, 0x10(%r12)
movq %r14, 0x18(%r12)
testq %rbx, %rbx
je 0x223f6
movq %rbx, 0x20(%r12)
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
callq 0x1fef3
movq %rax, %rbx
movl 0x8(%rax), %edi
callq 0x2a7c4
xorl %ecx, %ecx
xorl %edx, %edx
movl 0x8(%rbx), %edi
cmpq %rdi, %rdx
jae 0x2287c
movq 0x10(%rbx), %rsi
movsd (%rsi,%rcx), %xmm0
movsd %xmm0, (%rax,%rdx,8)
incq %rdx
addq $0x10, %rcx
jmp 0x2285d
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x2246c
// File: /workspace/github_c_makefile_star2_O2/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 0x3d0ae(%rip), %r12     # 0x5f950
xorl %ecx, %ecx
cmpl %esi, 0x4(%r12)
seta %cl
leaq 0xa130(%rip), %r15      # 0x2c9e3
leaq 0xa1dc(%rip), %rdx      # 0x2ca96
pushq $0x6e
popq %rsi
movq %r15, %rdi
callq 0x6903
movq %r12, %rdi
movl %r14d, %esi
callq 0x2a7f2
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movups %xmm0, (%rbx)
movups %xmm1, 0x10(%rbx)
movups %xmm2, 0x20(%rbx)
movups %xmm3, 0x30(%rbx)
xorl %ecx, %ecx
cmpl %r14d, (%rbx)
sete %cl
leaq 0xa1e0(%rip), %rdx      # 0x2cadd
pushq $0x70
popq %rsi
movq %r15, %rdi
callq 0x6903
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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
movaps %xmm0, %xmm3
mulps %xmm2, %xmm3
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
mulss %xmm0, %xmm2
addss %xmm3, %xmm2
movl 0x3c(%rbp), %eax
movq 0x40(%rbp), %rcx
xorps %xmm3, %xmm3
xorl %edx, %edx
cmpq %rdx, %rax
je 0x229da
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
jmp 0x229a0
movaps %xmm3, %xmm0
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/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 0x3cf4a(%rip), %rax     # 0x5f950
xorl %ecx, %ecx
cmpl %esi, 0x4(%rax)
seta %cl
leaq 0x9fce(%rip), %rdi      # 0x2c9e3
leaq 0xa110(%rip), %rdx      # 0x2cb2c
movl $0x8e, %esi
callq 0x6903
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rbx)
movups %xmm0, 0x28(%rbx)
movups %xmm0, 0x8(%rbx)
andl $0x0, 0x38(%rbx)
movsd 0x884f(%rip), %xmm0     # 0x2b290
movsd %xmm0, 0x1c(%rbx)
orl $-0x1, 0x4(%rbx)
movss -0x14(%rbp), %xmm0
movss %xmm0, 0x40(%rbx)
movl %r14d, (%rbx)
movss -0x18(%rbp), %xmm0
movss %xmm0, 0x44(%rbx)
movss 0x859b(%rip), %xmm0     # 0x2b004
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_O2/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 $0x40, %rsp
movaps %xmm2, -0x40(%rbp)
movaps %xmm1, -0x30(%rbp)
movaps %xmm3, %xmm1
xorps 0x8372(%rip), %xmm1     # 0x2b040
movaps %xmm1, -0x20(%rbp)
callq 0x6aaa
movaps %xmm0, -0x10(%rbp)
movaps -0x30(%rbp), %xmm0
movaps -0x20(%rbp), %xmm1
callq 0x6aaa
movaps -0x10(%rbp), %xmm5
movaps -0x40(%rbp), %xmm4
movaps %xmm5, %xmm1
subss %xmm0, %xmm1
movaps 0x8342(%rip), %xmm2     # 0x2b040
xorps %xmm1, %xmm2
maxss %xmm1, %xmm2
cvtss2sd %xmm2, %xmm1
cvtss2sd %xmm4, %xmm2
mulsd 0x8d1b(%rip), %xmm2     # 0x2ba30
movapd 0x8633(%rip), %xmm3     # 0x2b350
xorpd %xmm2, %xmm3
maxsd %xmm2, %xmm3
ucomisd %xmm1, %xmm3
jbe 0x22d6d
subps %xmm0, %xmm5
shufps $0x55, %xmm5, %xmm5     # xmm5 = xmm5[1,1,1,1]
movaps 0x8307(%rip), %xmm0     # 0x2b040
xorps %xmm5, %xmm0
maxss %xmm5, %xmm0
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
cvtss2sd %xmm4, %xmm1
mulsd 0x8ce0(%rip), %xmm1     # 0x2ba30
cvtss2sd %xmm0, %xmm0
movapd 0x85f4(%rip), %xmm2     # 0x2b350
xorpd %xmm1, %xmm2
maxsd %xmm1, %xmm2
ucomisd %xmm0, %xmm2
seta %al
jmp 0x22d6f
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq