LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/util/performance.cpp
// Function: Perf::_start_perf_clock(Perf::MarkerID, char const*)
void _start_perf_clock(MarkerID id, const char *name) {
    ASSERT(0 <= id && id < NUMBER_OF_MARKERS, "Invalid perf ID");
    volatile Clock *clock = clocks + id;
    clock->name = name;
    CHECK(!clock->active, "Starting allready started clock");
    clock->count++;
    if (!clock->active) {
        clock->active = true;
        clock->start = highp_now();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, %r14d
xorl %ecx, %ecx
cmpl $0xa, %edi
setb %cl
leaq 0xf905(%rip), %rdi      # 0x316de
leaq 0xf93f(%rip), %rdx      # 0x3171f
movl $0x15, %esi
callq 0x729c
movslq %r14d, %rax
leaq (%rax,%rax,8), %rax
leaq 0x2e838(%rip), %rcx     # 0x50630
leaq (%rcx,%rax,8), %r14
movq %rbx, (%r14)
cmpb $0x0, 0x8(%r14)
je 0x21e38
movq 0x2d1c3(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xed4c(%rip), %rdi      # 0x30b63
leaq 0xf8c0(%rip), %rdx      # 0x316de
leaq 0xed46(%rip), %r8       # 0x30b6b
leaq 0xf926(%rip), %r9       # 0x31752
movl $0x18, %ecx
xorl %eax, %eax
callq 0x718c
incq 0x10(%r14)
cmpb $0x0, 0x8(%r14)
jne 0x21e80
movb $0x1, 0x8(%r14)
leaq -0x20(%rbp), %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2210
imulq $0x3b9aca00, (%rbx), %rax # imm = 0x3B9ACA00
addq 0x8(%rbx), %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
movq %rdx, 0x18(%r14)
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x20, %rsp
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0xa, %edi
setb %cl
leaq 0xf839(%rip), %rdi      # 0x316de
leaq 0xf873(%rip), %rdx      # 0x3171f
movl $0x21, %esi
callq 0x729c
movslq %ebx, %rax
leaq (%rax,%rax,8), %rax
leaq 0x2e76c(%rip), %rcx     # 0x50630
leaq (%rcx,%rax,8), %r14
cmpb $0x0, 0x8(%r14)
jne 0x21f01
movq 0x2d0fa(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xec83(%rip), %rdi      # 0x30b63
leaq 0xf7f7(%rip), %rdx      # 0x316de
leaq 0xec7d(%rip), %r8       # 0x30b6b
leaq 0xf88f(%rip), %r9       # 0x31784
movl $0x23, %ecx
xorl %eax, %eax
callq 0x718c
cmpb $0x0, 0x8(%r14)
je 0x21ffc
movb $0x0, 0x8(%r14)
leaq -0x20(%rbp), %rbx
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2210
imulq $0x3b9aca00, (%rbx), %rax # imm = 0x3B9ACA00
addq 0x8(%rbx), %rax
movabsq $0x20c49ba5e353f7cf, %rcx # imm = 0x20C49BA5E353F7CF
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x7, %rdx
addq %rax, %rdx
cmpq 0x18(%r14), %rdx
jae 0x21f86
movq 0x2d07e(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
movq (%r14), %rax
movq %rax, (%rsp)
leaq 0xed3c(%rip), %rdi      # 0x30c9f
leaq 0xf774(%rip), %rdx      # 0x316de
leaq 0xf844(%rip), %r8       # 0x317b5
leaq 0xf84e(%rip), %r9       # 0x317c6
movl $0x28, %ecx
xorl %eax, %eax
callq 0x718c
jmp 0x21ffc
subq 0x18(%r14), %rdx
movq %rdx, %xmm0
punpckldq 0xe329(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xe331(%rip), %xmm0     # 0x302d0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
addsd 0x20(%r14), %xmm1
movsd %xmm1, 0x20(%r14)
cmpb $0x0, 0x9(%r14)
je 0x21ffc
movsd 0x20(%r14), %xmm0
divsd 0xeaa4(%rip), %xmm0     # 0x30a70
movsd 0x38(%r14), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x38(%r14)
movsd %xmm0, 0x28(%r14)
xorl %eax, %eax
movq %rax, 0x20(%r14)
movq 0x10(%r14), %rcx
addq %rcx, 0x40(%r14)
movq 0x10(%r14), %rcx
movq %rcx, 0x30(%r14)
movq %rax, 0x10(%r14)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf3da(%rip), %rdi      # 0x31413
leaq 0xf3fb(%rip), %rdx      # 0x3143b
movl $0x76, %esi
callq 0x729c
testl %ebx, %ebx
je 0x220d5
movl 0x10c(%r14), %edx
leaq -0xa0(%rbp), %r15
cmpl %edx, 0x108(%r14)
jne 0x22087
cmpb $0x0, 0x12d(%r14)
je 0x220d5
incl %edx
movl %edx, %eax
xorl %edx, %edx
divl 0x110(%r14)
movl %edx, 0x108(%r14)
movq %r15, %rdi
movq %r14, %rsi
callq 0x225c6
movl 0x10c(%r14), %eax
movq %rax, %rcx
shlq $0x7, %rcx
leaq (%rcx,%rax,8), %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)
decl %ebx
jne 0x22060
addq $0x88, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf2fa(%rip), %rdi      # 0x31413
leaq 0xf31b(%rip), %rdx      # 0x3143b
movl $0x84, %esi
callq 0x729c
movl 0x108(%rbx), %edx
movb $0x1, %r15b
movl %edx, %r14d
movq %r14, %rax
shlq $0x7, %rax
leaq (%rax,%r14,8), %r12
movq 0x118(%rbx), %rdi
addq %r12, %rdi
movss -0x24(%rbp), %xmm0
callq 0x223ba
testb %r15b, %r15b
jne 0x22168
movl 0x10c(%rbx), %ecx
movl 0x110(%rbx), %esi
jmp 0x22183
movq 0x118(%rbx), %rax
cmpb $0x0, 0x9(%rax,%r12)
movl 0x10c(%rbx), %ecx
movl 0x110(%rbx), %esi
je 0x22196
xorl %r15d, %r15d
incl %r14d
movl %r14d, %eax
xorl %edx, %edx
divl %esi
cmpl %ecx, %edx
jne 0x22133
jmp 0x221b1
movl 0x108(%rbx), %eax
incl %eax
xorl %edx, %edx
divl %esi
movb $0x1, %r15b
cmpl %ecx, %edx
je 0x22186
movl %edx, 0x108(%rbx)
jmp 0x22186
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf229(%rip), %rdi      # 0x31413
leaq 0xf24a(%rip), %rdx      # 0x3143b
movl $0x95, %esi
callq 0x729c
cmpb $0x0, 0x128(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x20(%rbp)
je 0x22217
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
movq %r14, %rax
shlq $0x7, %rax
leaq (%rax,%r14,8), %rdi
addq 0x118(%rbx), %rdi
cmpl $0x0, (%rbx)
je 0x22252
movswq 0x80(%rdi), %rax
movq 0x8(%rbx,%rax,8), %rdx
jmp 0x22257
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl 0x4(%rbx), %esi
movaps -0x20(%rbp), %xmm0
callq 0x2248e
incl %r14d
movl 0x110(%rbx), %ecx
movl %r14d, %eax
xorl %edx, %edx
divl %ecx
cmpl 0x10c(%rbx), %edx
jne 0x22223
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movl 0x110(%rdi), %ecx
testq %rcx, %rcx
je 0x222fb
pushq %rbp
movq %rsp, %rbp
movq 0x118(%rdi), %rax
movq %rcx, %rdx
shlq $0x7, %rdx
leaq (%rdx,%rcx,8), %rcx
xorl %edx, %edx
movb $0x0, 0x9(%rax,%rdx)
addq $0x88, %rdx
cmpq %rdx, %rcx
jne 0x222e9
popq %rbp
movq $0x1, 0x108(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xf0dd(%rip), %rdi      # 0x31413
leaq 0xf0fe(%rip), %rdx      # 0x3143b
movl $0xac, %esi
callq 0x729c
leaq 0x48f4a(%rip), %rax     # 0x6b298
cmpq %rbx, (%rax)
jae 0x22357
xorl %eax, %eax
jmp 0x22366
movq 0x28(%rax), %rax
imulq $0x38, %rbx, %rcx
cmpl $0x3, (%rax,%rcx)
sete %al
movzbl %al, %ecx
leaq 0xf0a3(%rip), %r15      # 0x31413
leaq 0xf104(%rip), %rdx      # 0x3147b
movq %r15, %rdi
movl $0xad, %esi
callq 0x729c
xorl %ecx, %ecx
cmpl $0x20, (%r14)
setne %cl
leaq 0xf138(%rip), %rdx      # 0x314cc
movq %r15, %rdi
movl $0xaf, %esi
callq 0x729c
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_O3/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 0x2248d
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movaps %xmm0, %xmm2
movq %rdi, %rbx
cmpb $0x0, 0x8(%rdi)
je 0x223e0
movb $0x1, 0x9(%rbx)
movss (%rbx), %xmm0
jmp 0x223f9
movss (%rbx), %xmm0
movss 0xdc18(%rip), %xmm1     # 0x30004
ucomiss %xmm0, %xmm1
seta 0x9(%rbx)
jbe 0x22487
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_O3/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 0x224da
movq %rdx, %r14
movl %esi, %ebx
movq %rdi, %r15
movaps %xmm0, -0x40(%rbp)
cmpb $0x0, 0x8(%rdi)
movss (%rdi), %xmm4
je 0x224e5
xorps %xmm0, %xmm0
cvtss2sd %xmm4, %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x2100
movsd -0x30(%rbp), %xmm1
subsd %xmm0, %xmm1
xorps %xmm4, %xmm4
cvtsd2ss %xmm1, %xmm4
jmp 0x224ed
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
minss 0xdb17(%rip), %xmm4     # 0x30004
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 0x225a7
xorps %xmm3, %xmm3
xorps %xmm4, %xmm4
movl %ebx, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movaps -0x30(%rbp), %xmm1
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21891
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 0x21508
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xe834(%rip), %rdi      # 0x31533
leaq 0xe84c(%rip), %rdx      # 0x31552
movl $0x10, %esi
callq 0x729c
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
leaq 0x2dbe8(%rip), %rcx     # 0x50908
movl (%rcx), %edx
btl %ebx, %edx
jb 0x22d34
orl %eax, %edx
movl %edx, (%rcx)
leaq 0x2dbda(%rip), %rax     # 0x5090c
incl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xe7e1(%rip), %rdi      # 0x31533
leaq 0xe7f9(%rip), %rdx      # 0x31552
movl $0x18, %esi
callq 0x729c
movl $0x1, %eax
movl %ebx, %ecx
shll %cl, %eax
leaq 0x2db95(%rip), %rcx     # 0x50908
movl (%rcx), %edx
btl %ebx, %edx
jae 0x22d89
notl %eax
andl %eax, %edx
movl %edx, (%rcx)
leaq 0x2db85(%rip), %rax     # 0x5090c
decl (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xe77d(%rip), %rdi      # 0x31533
leaq 0xe7b6(%rip), %rdx      # 0x31573
movl $0x21, %esi
callq 0x729c
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movl $0x3f800000, 0x10(%rbx) # imm = 0x3F800000
movss 0x48474(%rip), %xmm0    # 0x6b254
movss %xmm0, 0x14(%rbx)
movq %rbx, %rdi
movl %r15d, %esi
movq %r14, %rdx
movss -0x1c(%rbp), %xmm0
callq 0x22e06
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xe707(%rip), %rdi      # 0x31533
leaq 0xe740(%rip), %rdx      # 0x31573
movl $0x37, %esi
callq 0x729c
movss (%r14), %xmm2
movss 0x4(%r14), %xmm0
movsd (%r14), %xmm3
testl %r15d, %r15d
je 0x22e8b
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 0x22e5a
jmp 0x22e8e
movaps %xmm3, %xmm1
addss %xmm1, %xmm2
movaps %xmm1, %xmm3
shufps $0x55, %xmm1, %xmm3     # xmm3 = xmm3[1,1],xmm1[1,1]
addss %xmm3, %xmm0
movss 0xd39f(%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 0x22ee3
jp 0x22ee3
ucomiss %xmm2, %xmm0
jne 0x22ee3
jp 0x22ee3
movss 0xd123(%rip), %xmm0     # 0x30004
jmp 0x22ef8
mulss 0x14(%rbx), %xmm0
maxss %xmm0, %xmm1
movss 0xd110(%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_O3/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 0xe3e9(%rip), %r15      # 0x31533
leaq 0xe451(%rip), %r12      # 0x315a2
movq %r15, %rdi
movl $0x59, %esi
movq %r12, %rdx
movl %r14d, %ecx
callq 0x729c
movq %r15, %rdi
movl $0x52, %esi
movq %r12, %rdx
movl %r14d, %ecx
callq 0x729c
movl %ebx, %eax
shlq $0x5, %rax
leaq 0x480bc(%rip), %r14     # 0x6b240
addq %rax, %r14
leaq 0x2c14a(%rip), %r15     # 0x4f2d8
testb $0x1, 0x68(%r15)
je 0x231ba
movl %ebx, %edi
callq 0xbbae
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 0xce3d(%rip), %xmm1     # 0x30004
movaps %xmm1, %xmm0
je 0x231e4
xorps %xmm0, %xmm0
cvtsi2ssl 0x80(%r15), %xmm0
mulss 0xd06c(%rip), %xmm0     # 0x3024c
addss %xmm1, %xmm0
movl 0x88(%r15), %eax
testl %eax, %eax
je 0x23202
xorps %xmm0, %xmm0
cvtsi2ss %eax, %xmm0
mulss 0xce0e(%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_O3/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 0x48064(%rip), %rcx     # 0x6b298
cmpq %rdi, (%rcx)
jb 0x2325c
testl %esi, %esi
je 0x2324a
movq 0x28(%rcx), %rax
imulq $0x38, %rdi, %rdx
cmpl %esi, (%rax,%rdx)
jne 0x2328d
leaq (%rdi,%rdi,2), %rax
shlq $0x4, %rax
addq 0x30(%rcx), %rax
addq $0x10, %rsp
popq %rbp
retq
movq 0x2bd6d(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
movq %rdi, (%rsp)
leaq 0xda2e(%rip), %rdi      # 0x30c9f
leaq 0xe35e(%rip), %rdx      # 0x315d6
leaq 0xe372(%rip), %r8       # 0x315f1
leaq 0xe375(%rip), %r9       # 0x315fb
movl $0xf, %ecx
jmp 0x232bc
movq 0x2bd3c(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
movq %rdi, (%rsp)
leaq 0xd9fd(%rip), %rdi      # 0x30c9f
leaq 0xe32d(%rip), %rdx      # 0x315d6
leaq 0xe341(%rip), %r8       # 0x315f1
leaq 0xe35a(%rip), %r9       # 0x31611
movl $0x16, %ecx
xorl %eax, %eax
callq 0x718c
callq 0x7243
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x2330
// File: /workspace/github_c_makefile_star2_O3/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 0x2cf6d(%rip), %rbx     # 0x50630
xorl %r14d, %r14d
leaq 0xe031(%rip), %r15      # 0x316fe
leaq 0xe030(%rip), %r12      # 0x31704
cmpb $0x0, -0x37(%rbx,%r13)
jne 0x23760
cmpb $0x0, -0x38(%rbx,%r13)
je 0x2371b
movq 0x2b8e1(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
movq -0x40(%rbx,%r13), %rax
movq %rax, (%rsp)
leaq 0xd59d(%rip), %rdi      # 0x30c9f
leaq 0xdfd5(%rip), %rdx      # 0x316de
movl $0x8, %ecx
movq %r15, %r8
movq %r12, %r9
xorl %eax, %eax
callq 0x718c
movsd -0x20(%rbx,%r13), %xmm0
divsd 0xd346(%rip), %xmm0     # 0x30a70
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 0x236d4
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/FredTheDino[P]Fog/src/engine/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 0x476a7(%rip), %xmm0    # 0x6b254
movsd %xmm0, -0x8(%rbp)
movss 0xc676(%rip), %xmm0     # 0x30230
divss 0x476be(%rip), %xmm0    # 0x6b280
leaq 0x40db7(%rip), %rax     # 0x64980
movq (%rax), %rsi
leaq 0x13835(%rip), %rdi     # 0x37408
callq 0xa218
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
cvtss2sd %xmm0, %xmm0
mulsd 0xce70(%rip), %xmm0     # 0x30a58
addsd -0x8(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
leaq 0x2c1f0(%rip), %rax     # 0x4fde8
movss %xmm0, 0xc(%rax)
movl $0x0, 0x10(%rax)
leaq 0x2b6cd(%rip), %rcx     # 0x4f2d8
movl 0x68(%rcx), %edx
cmpl $0x3, %edx
je 0x23c21
testb $0x1, %dl
jne 0x23c5b
xorps %xmm0, %xmm0
movups %xmm0, 0x18(%rax)
jmp 0x23c5b
movq 0x18(%rax), %rsi
testq %rsi, %rsi
je 0x23c30
movq %rsi, 0x20(%rax)
jmp 0x23c3b
leaq 0xdc4c(%rip), %rsi      # 0x31883
movq %rsi, 0x18(%rax)
cmpl $0x3, %edx
jne 0x23c5b
cmpq $0x0, 0x18(%rax)
je 0x23c5b
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_O3/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 0xce0b(%rip), %xmm2     # 0x30a80
mulsd %xmm0, %xmm2
addsd %xmm1, %xmm2
cvtsd2ss %xmm2, %xmm2
mulsd 0xcdff(%rip), %xmm0     # 0x30a88
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss 0xc58f(%rip), %xmm1     # 0x30228
leaq 0x2b638(%rip), %rax     # 0x4f2d8
cvtsi2ssl 0x78(%rax), %xmm3
divss 0x475d3(%rip), %xmm1    # 0x6b280
addss %xmm3, %xmm3
mulss %xmm1, %xmm3
addss 0x475cb(%rip), %xmm3    # 0x6b288
cmpltps %xmm3, %xmm2
cmpltps %xmm0, %xmm3
andps %xmm2, %xmm3
movd %xmm3, %eax
andb $0x1, %al
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xc54b(%rip), %xmm0     # 0x30230
divss 0x47593(%rip), %xmm0    # 0x6b280
leaq 0x40c8c(%rip), %rax     # 0x64980
movq (%rax), %rsi
leaq 0x1370a(%rip), %rdi     # 0x37408
callq 0xa218
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
leaq 0x2c0da(%rip), %rax     # 0x4fde8
movss 0xc(%rax), %xmm1
leaq 0x2b5be(%rip), %rcx     # 0x4f2d8
movq 0x18(%rax), %rdx
testq %rdx, %rdx
jne 0x23d88
cvtss2sd %xmm1, %xmm2
cvtss2sd %xmm0, %xmm3
movsd 0xcd4d(%rip), %xmm4     # 0x30a80
mulsd %xmm3, %xmm4
addsd %xmm2, %xmm4
cvtsd2ss %xmm4, %xmm5
movss 0xc4e1(%rip), %xmm6     # 0x30228
xorps %xmm4, %xmm4
cvtsi2ssl 0x78(%rcx), %xmm4
divss 0x47529(%rip), %xmm6    # 0x6b280
addss %xmm4, %xmm4
mulss %xmm6, %xmm4
addss 0x47521(%rip), %xmm4    # 0x6b288
ucomiss %xmm5, %xmm4
jbe 0x23d88
mulsd 0xcd14(%rip), %xmm3     # 0x30a88
addsd %xmm3, %xmm2
cvtsd2ss %xmm2, %xmm2
ucomiss %xmm4, %xmm2
jbe 0x23d88
movq %r14, 0x18(%rax)
movq %r14, %rdx
cmpq %r14, 0x20(%rax)
je 0x23d9c
xorl %esi, %esi
cmpq %r14, %rdx
jne 0x23da7
movl $0x1, %esi
jmp 0x23da1
movl $0x2, %esi
incl 0x8c(%rcx)
movl 0x10(%rax), %ecx
xorps %xmm2, %xmm2
cvtsi2ss %rcx, %xmm2
mulss %xmm0, %xmm2
addss 0xc46a(%rip), %xmm2     # 0x30228
subss %xmm0, %xmm1
movss %xmm1, 0xc(%rax)
movq %rbx, %rdi
movaps %xmm2, %xmm0
popq %rbx
popq %r14
popq %rbp
jmp 0xa391
// File: /workspace/github_c_makefile_star2_O3/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 0x2b461(%rip), %rax     # 0x4f2d8
cvtsi2ssl 0x74(%rax), %xmm0
cvtsi2ssl 0x78(%rax), %xmm1
cvtsi2ssl 0x7c(%rax), %xmm2
cvtsi2ssl 0x80(%rax), %xmm3
leaq 0x2bf53(%rip), %rax     # 0x4fde8
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_O3/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, 0x2b40e(%rip)     # 0x4f370
je 0x23fbe
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0xd91a(%rip), %rdi      # 0x31892
movq %r14, %rsi
xorl %eax, %eax
callq 0xa899
movq %r14, %rdi
movq %rax, %rsi
callq 0x23cd0
leaq 0x2be54(%rip), %rax     # 0x4fde8
movb (%rbx), %cl
cmpq %r14, 0x18(%rax)
jne 0x23fb1
leaq 0x2b335(%rip), %rdx     # 0x4f2d8
cmpl $0x3, 0x68(%rdx)
jne 0x23fb1
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_O3/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 0xacd1
leaq 0x2c870(%rip), %rcx     # 0x50910
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 0x240c7
movw $0xffff, 0x4fd8(%rdx)   # imm = 0xFFFF
incq %rbx
addq $0x5008, %rax           # imm = 0x5008
cmpq $0x4, %rbx
jne 0x240a6
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2420c
movq %rdi, %rbx
leaq 0x5000(%rdi), %r15
movss 0xc09a(%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 0x241ac
jnp 0x241c6
movq %r14, %rdi
movss -0x20(%rbp), %xmm1
callq 0x2eb68
movss 0xc067(%rip), %xmm2     # 0x30228
movss -0x1c(%rbp), %xmm0
ucomiss 0x4(%r14), %xmm0
jae 0x241d6
movzwl (%r14), %eax
movq %r14, %r15
jmp 0x24206
movss 0xc(%r14), %xmm1
ucomiss %xmm1, %xmm0
jb 0x241cd
ucomiss %xmm2, %xmm1
jne 0x241e8
jnp 0x241cd
movzwl (%r14), %eax
movzwl 0x5002(%rbx), %ecx
movw %cx, (%r14)
movzwl (%r15), %ecx
movw %cx, 0x5002(%rbx)
movw %ax, (%r15)
cmpw $-0x1, %ax
jne 0x24193
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xd69e(%rip), %rdi      # 0x318d7
leaq 0xd6b2(%rip), %rdx      # 0x318f2
movl $0x34, %esi
callq 0x729c
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_O3/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 0x2432a
movq %rax, %rbx
testq %rax, %rax
jne 0x24315
movq 0x2ace6(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xc86f(%rip), %rdi      # 0x30b63
leaq 0xd5dc(%rip), %rdx      # 0x318d7
leaq 0xc869(%rip), %r8       # 0x30b6b
leaq 0xd610(%rip), %r9       # 0x31919
movl $0x4a, %ecx
xorl %eax, %eax
callq 0x718c
movabsq $-0x407fffff40800000, %rax # imm = 0xBF800000BF800000
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xd57b(%rip), %rdi      # 0x318d7
leaq 0xd5e0(%rip), %rdx      # 0x31943
movl $0x50, %esi
callq 0x729c
movslq %r14d, %rax
leaq (%rax,%rax,4), %rax
cmpb %r15b, 0x2(%rbx,%rax,8)
jne 0x24381
leaq (%rbx,%rax,8), %rbx
jmp 0x243b5
movq 0x2ac48(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xc90d(%rip), %rdi      # 0x30c9f
leaq 0xd53e(%rip), %rdx      # 0x318d7
leaq 0xd5d9(%rip), %r8       # 0x31979
leaq 0xd5dc(%rip), %r9       # 0x31983
xorl %ebx, %ebx
movl $0x54, %ecx
xorl %eax, %eax
callq 0x718c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xbe38(%rip), %xmm1     # 0x30228
cmpneqss %xmm0, %xmm1
movd %xmm1, %ecx
andl $0x1, %ecx
leaq 0xd4d4(%rip), %rdi      # 0x318d7
leaq 0xd58d(%rip), %rdx      # 0x31997
movl $0x5a, %esi
callq 0x729c
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 0x2c4b3(%rip), %rcx     # 0x50910
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
callq 0x24218
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_O3/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 0xbd56(%rip), %xmm1     # 0x30228
movss %xmm0, -0x1c(%rbp)
cmpneqss %xmm0, %xmm1
movd %xmm1, %ecx
andl $0x1, %ecx
leaq 0xd3ed(%rip), %rdi      # 0x318d7
leaq 0xd4a6(%rip), %rdx      # 0x31997
movl $0x67, %esi
callq 0x729c
movl %r15d, %eax
imulq $0x5008, %rax, %rax     # imm = 0x5008
leaq 0x2c404(%rip), %rcx     # 0x50910
leaq (%rcx,%rax), %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x2432a
movq %rax, %r15
testq %rax, %rax
jne 0x24556
movq 0x2aaa5(%rip), %rax     # 0x4efd0
movq (%rax), %rsi
leaq 0xc62e(%rip), %rdi      # 0x30b63
leaq 0xd39b(%rip), %rdx      # 0x318d7
leaq 0xc628(%rip), %r8       # 0x30b6b
leaq 0xd4a3(%rip), %r9       # 0x319ed
movl $0x69, %ecx
xorl %eax, %eax
callq 0x718c
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 0x2458a
movq %rbx, 0x20(%r15)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x23225
movq %rax, %rbx
movl 0x8(%rax), %esi
cmpl $0x1, 0x2a8ab(%rip)     # 0x4f374
jne 0x24ad5
movl $0x0, 0x2a89f(%rip)     # 0x4f374
movl 0x3ff05(%rip), %eax     # 0x649e0
leaq 0x3feee(%rip), %rcx     # 0x649d0
movq (%rcx,%rax,8), %rdi
callq 0x2f580
cmpl $0x0, 0x8(%rbx)
je 0x24b14
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 0x24af5
jmp 0x24b16
xorl %edi, %edi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x24604
// File: /workspace/github_c_makefile_star2_O3/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 0x3fe04(%rip), %r12     # 0x64940
xorl %ecx, %ecx
cmpl %esi, 0x4(%r12)
seta %cl
leaq 0xcebe(%rip), %r15      # 0x31a0b
leaq 0xcf6a(%rip), %rdx      # 0x31abe
movq %r15, %rdi
movl $0x6e, %esi
callq 0x729c
xorl %ecx, %ecx
cmpb $0x0, 0x10(%r12)
setne %cl
leaq 0x20e1b(%rip), %rdi     # 0x4598e
leaq 0x20e31(%rip), %rdx     # 0x459ab
movl $0x21, %esi
callq 0x729c
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 0xcf44(%rip), %rdx      # 0x31b05
movq %r15, %rdi
movl $0x70, %esi
callq 0x729c
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x24ca9
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 0x24c6f
jmp 0x24cac
xorps %xmm3, %xmm3
movaps %xmm3, %xmm0
popq %rbp
retq