// File: /workspace/github_c_makefile_star2_O1/FredTheDino[P]Fog/src/engine/renderer/opengl_renderer.cpp
// Function: Renderer::Impl::push_line(unsigned int, Vec2, Vec2, Vec4, Vec4, float)
void push_line(u32 layer, Vec2 start, Vec2 end, Vec4 start_color, Vec4 end_color,
                      f32 thickness) {
    LAYER_CHECK(layer);
    Vec2 normal = normalize(rotate_ccw(start - end));
    Vec2 offset = normal * thickness * 0.5;
    Vertex verticies[] = {
        {start + offset, V2(0, 0), OPENGL_INVALID_SPRITE, start_color},
        {start - offset, V2(0, 0), OPENGL_INVALID_SPRITE, start_color},
        {end - offset, V2(0, 0), OPENGL_INVALID_SPRITE, end_color},

        {start + offset, V2(0, 0), OPENGL_INVALID_SPRITE, start_color},
        {end - offset, V2(0, 0), OPENGL_INVALID_SPRITE, end_color},
        {end + offset, V2(0, 0), OPENGL_INVALID_SPRITE, end_color},
    };
    sprite_render_queues[layer].push(LEN(verticies), verticies);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movss %xmm6, -0xc(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm4, -0xa0(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm2, -0x90(%rbp)
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x20(%rbp)
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x10, %edi
setb %cl
leaq 0x1032f(%rip), %rdi     # 0x31085
leaq 0x103aa(%rip), %rdx     # 0x31107
movl $0x1d7, %esi            # imm = 0x1D7
callq 0x722f
movaps -0x20(%rbp), %xmm4
movaps %xmm4, %xmm2
subps -0x30(%rbp), %xmm2
shufps $0x55, %xmm4, %xmm4     # xmm4 = xmm4[1,1,1,1]
movaps %xmm2, %xmm0
shufps $0x55, %xmm2, %xmm0     # xmm0 = xmm0[1,1],xmm2[1,1]
movaps 0xf2bc(%rip), %xmm7     # 0x30040
xorps %xmm0, %xmm7
movaps %xmm2, %xmm1
mulss %xmm2, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x20da4
sqrtss %xmm0, %xmm0
jmp 0x20dc1
movaps %xmm7, -0x60(%rbp)
movaps %xmm4, -0x50(%rbp)
movaps %xmm2, -0x40(%rbp)
callq 0x2480
movaps -0x40(%rbp), %xmm2
movaps -0x50(%rbp), %xmm4
movaps -0x60(%rbp), %xmm7
movss 0xf23b(%rip), %xmm1     # 0x30004
divss %xmm0, %xmm1
mulss %xmm1, %xmm7
mulss %xmm2, %xmm1
movss -0xc(%rbp), %xmm0
mulss %xmm0, %xmm7
mulss %xmm0, %xmm1
movss 0xf21e(%rip), %xmm0     # 0x30008
mulss %xmm0, %xmm7
mulss %xmm0, %xmm1
movaps -0x20(%rbp), %xmm3
movaps %xmm3, %xmm0
addss %xmm7, %xmm0
movaps %xmm4, %xmm2
addss %xmm1, %xmm2
unpcklps %xmm2, %xmm0            # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movq %xmm0, %xmm0            # xmm0 = xmm0[0],zero
leaq -0x180(%rbp), %rdx
movdqa %xmm0, (%rdx)
movl $0xbf800000, %eax       # imm = 0xBF800000
movl %eax, 0x10(%rdx)
movaps -0x90(%rbp), %xmm6
unpcklpd -0x70(%rbp), %xmm6      # xmm6 = xmm6[0],mem[0]
movups %xmm6, 0x14(%rdx)
subss %xmm7, %xmm3
subss %xmm1, %xmm4
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movq %xmm3, %xmm2            # xmm2 = xmm3[0],zero
movdqu %xmm2, 0x24(%rdx)
movl %eax, 0x34(%rdx)
movups %xmm6, 0x38(%rdx)
movaps -0x30(%rbp), %xmm5
movaps %xmm5, %xmm2
subss %xmm7, %xmm2
movaps %xmm5, %xmm3
shufps $0x55, %xmm5, %xmm3     # xmm3 = xmm3[1,1],xmm5[1,1]
movaps %xmm3, %xmm4
subss %xmm1, %xmm4
unpcklps %xmm4, %xmm2            # xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
movq %xmm2, %xmm2            # xmm2 = xmm2[0],zero
movdqu %xmm2, 0x48(%rdx)
movl %eax, 0x58(%rdx)
movaps -0xa0(%rbp), %xmm4
unpcklpd -0x80(%rbp), %xmm4      # xmm4 = xmm4[0],mem[0]
movups %xmm4, 0x5c(%rdx)
movdqu %xmm0, 0x6c(%rdx)
movl %eax, 0x7c(%rdx)
movaps %xmm6, 0x80(%rdx)
movdqa %xmm2, 0x90(%rdx)
movl %eax, 0xa0(%rdx)
movups %xmm4, 0xa4(%rdx)
addss %xmm5, %xmm7
addss %xmm1, %xmm3
unpcklps %xmm3, %xmm7            # xmm7 = xmm7[0],xmm3[0],xmm7[1],xmm3[1]
movq %xmm7, %xmm0            # xmm0 = xmm7[0],zero
movdqu %xmm0, 0xb4(%rdx)
movl %eax, 0xc4(%rdx)
movups %xmm4, 0xc8(%rdx)
movl %ebx, %edi
shlq $0x5, %rdi
addq 0x2e10a(%rip), %rdi     # 0x4efe0
movl $0x6, %esi
callq 0x2e06a
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %rbp
retq