// File: /workspace/github_c_makefile_star2_O0/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
subq $0x110, %rsp            # imm = 0x110
movlpd %xmm0, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0xd8(%rbp)
cmpb $0x0, 0x9(%rax)
jne 0x2ef51
jmp 0x2f212
movq -0xd8(%rbp), %rax
cmpb $0x0, 0x8(%rax)
je 0x2efbc
movq -0xd8(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0xe0(%rbp)
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x160db(%rip), %xmm1    # 0x45060
divsd %xmm1, %xmm0
callq 0x2100
movsd -0xe0(%rbp), %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
addsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
jmp 0x2f015
movq -0xd8(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x1608d(%rip), %xmm0    # 0x45060
ucomisd %xmm1, %xmm0
jbe 0x2eff2
movq -0xd8(%rbp), %rax
movss (%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd %xmm0, -0xe8(%rbp)
jmp 0x2f004
movsd 0x16066(%rip), %xmm0    # 0x45060
movsd %xmm0, -0xe8(%rbp)
jmp 0x2f004
movsd -0xe8(%rbp), %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
movq -0xd8(%rbp), %rcx
movq %rcx, %rax
addq $0x48, %rax
movq %rax, -0xf0(%rbp)
movq 0x40(%rcx), %rax
movq (%rax), %rax
movss 0x30(%rcx), %xmm0
movss 0x34(%rcx), %xmm1
movss 0x38(%rcx), %xmm2
movss 0x3c(%rcx), %xmm3
movss -0x24(%rbp), %xmm4
callq *%rax
movq -0xf0(%rbp), %rdi
callq 0x5810
movq -0xd8(%rbp), %rcx
movlpd %xmm0, -0x2c(%rbp)
movq 0x78(%rcx), %rax
movq (%rax), %rax
movups 0x50(%rcx), %xmm0
movaps %xmm0, -0x50(%rbp)
movss 0x60(%rcx), %xmm2
movups 0x64(%rcx), %xmm0
movaps %xmm0, -0x60(%rbp)
movss 0x74(%rcx), %xmm5
movss -0x24(%rbp), %xmm6
movsd -0x50(%rbp), %xmm0
movsd -0x48(%rbp), %xmm1
movsd -0x60(%rbp), %xmm3
movsd -0x58(%rbp), %xmm4
callq *%rax
movlpd %xmm0, -0x3c(%rbp)
movlpd %xmm1, -0x34(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x20(%rbp)
jne 0x2f17f
movq -0xd8(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0xf8(%rbp)
addq $0x14, %rdi
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
callq 0x40dc0
movq -0xd8(%rbp), %rax
movlpd %xmm0, -0x68(%rbp)
movq -0x2c(%rbp), %rcx
movq %rcx, -0x78(%rbp)
movss 0xc(%rax), %xmm0
movss %xmm0, -0xf4(%rbp)
xorps %xmm1, %xmm1
movss %xmm1, -0xfc(%rbp)
movaps %xmm1, %xmm0
callq 0xbc10
movss -0xfc(%rbp), %xmm1
movlpd %xmm0, -0x80(%rbp)
movaps %xmm1, %xmm0
callq 0xbc10
movl -0xf8(%rbp), %edi
movss -0xf4(%rbp), %xmm2
movlpd %xmm0, -0x88(%rbp)
movups -0x3c(%rbp), %xmm0
movaps %xmm0, -0xa0(%rbp)
movsd -0x68(%rbp), %xmm0
movsd -0x78(%rbp), %xmm1
movsd -0x80(%rbp), %xmm3
movsd -0x88(%rbp), %xmm4
movsd -0xa0(%rbp), %xmm5
movsd -0x98(%rbp), %xmm6
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0x2dcf0
jmp 0x2f212
movq -0xd8(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, -0x10c(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x108(%rbp)
addq $0x14, %rdi
movq -0x8(%rbp), %rax
movq %rax, -0xb0(%rbp)
movsd -0xb0(%rbp), %xmm0
callq 0x40dc0
movq -0xd8(%rbp), %rax
movl -0x10c(%rbp), %edi
movq -0x108(%rbp), %rsi
movlpd %xmm0, -0xa8(%rbp)
movq -0x2c(%rbp), %rcx
movq %rcx, -0xb8(%rbp)
movss 0xc(%rax), %xmm2
movups -0x3c(%rbp), %xmm0
movaps %xmm0, -0xd0(%rbp)
movsd -0xa8(%rbp), %xmm0
movsd -0xb8(%rbp), %xmm1
movsd -0xd0(%rbp), %xmm3
movsd -0xc8(%rbp), %xmm4
callq 0x2d940
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopl (%rax,%rax)