// File: /workspace/github_c_makefile_star2_O3/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 $0x148, %rsp            # imm = 0x148
movss %xmm6, -0xc(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm4, -0x60(%rbp)
movaps %xmm3, -0x50(%rbp)
movaps %xmm2, -0x40(%rbp)
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x20(%rbp)
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x10, %edi
setb %cl
leaq 0x105fc(%rip), %rdi     # 0x31075
leaq 0x10677(%rip), %rdx     # 0x310f7
movl $0x1d7, %esi            # imm = 0x1D7
callq 0x729c
movaps -0x20(%rbp), %xmm8
movaps %xmm8, %xmm4
movaps -0x30(%rbp), %xmm6
subss %xmm6, %xmm4
movaps %xmm8, %xmm3
shufps $0x55, %xmm8, %xmm3     # xmm3 = xmm3[1,1],xmm8[1,1]
movaps %xmm6, %xmm0
shufps $0x55, %xmm6, %xmm0     # xmm0 = xmm0[1,1],xmm6[1,1]
movaps %xmm3, %xmm2
subss %xmm0, %xmm2
movaps 0xf587(%rip), %xmm1     # 0x30040
xorps %xmm2, %xmm1
movaps %xmm4, %xmm5
mulss %xmm4, %xmm5
mulss %xmm2, %xmm2
addss %xmm5, %xmm2
xorps %xmm5, %xmm5
sqrtss %xmm2, %xmm5
movss 0xf52a(%rip), %xmm2     # 0x30004
divss %xmm5, %xmm2
mulss %xmm2, %xmm1
mulss %xmm4, %xmm2
movss -0xc(%rbp), %xmm4
mulss %xmm4, %xmm1
mulss %xmm4, %xmm2
movss 0xf50d(%rip), %xmm4     # 0x30008
mulss %xmm4, %xmm1
mulss %xmm4, %xmm2
movaps %xmm8, %xmm4
addss %xmm1, %xmm4
movaps %xmm3, %xmm5
addss %xmm2, %xmm5
unpcklps %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
movq %xmm4, %xmm4            # xmm4 = xmm4[0],zero
leaq -0x150(%rbp), %rdx
movdqa %xmm4, (%rdx)
movl $0xbf800000, %eax       # imm = 0xBF800000
movl %eax, 0x10(%rdx)
movaps -0x40(%rbp), %xmm5
unpcklpd -0x50(%rbp), %xmm5      # xmm5 = xmm5[0],mem[0]
movups %xmm5, 0x14(%rdx)
movaps %xmm5, %xmm7
subss %xmm1, %xmm8
subss %xmm2, %xmm3
unpcklps %xmm3, %xmm8            # xmm8 = xmm8[0],xmm3[0],xmm8[1],xmm3[1]
movq %xmm8, %xmm3            # xmm3 = xmm8[0],zero
movdqu %xmm3, 0x24(%rdx)
movl %eax, 0x34(%rdx)
movups %xmm5, 0x38(%rdx)
movaps %xmm6, %xmm3
subss %xmm1, %xmm3
movaps %xmm0, %xmm5
subss %xmm2, %xmm5
unpcklps %xmm5, %xmm3            # xmm3 = xmm3[0],xmm5[0],xmm3[1],xmm5[1]
movq %xmm3, %xmm3            # xmm3 = xmm3[0],zero
movdqu %xmm3, 0x48(%rdx)
movl %eax, 0x58(%rdx)
movaps -0x60(%rbp), %xmm5
unpcklpd -0x70(%rbp), %xmm5      # xmm5 = xmm5[0],mem[0]
movups %xmm5, 0x5c(%rdx)
movdqu %xmm4, 0x6c(%rdx)
movl %eax, 0x7c(%rdx)
movaps %xmm7, 0x80(%rdx)
movdqa %xmm3, 0x90(%rdx)
movl %eax, 0xa0(%rdx)
movups %xmm5, 0xa4(%rdx)
addss %xmm6, %xmm1
addss %xmm0, %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
movq %xmm1, %xmm0            # xmm0 = xmm1[0],zero
movdqu %xmm0, 0xb4(%rdx)
movl %eax, 0xc4(%rdx)
movups %xmm5, 0xc8(%rdx)
movl %ebx, %edi
shlq $0x5, %rdi
addq 0x2e407(%rip), %rdi     # 0x4efe0
movl $0x6, %esi
callq 0x2d8ee
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %rbp
retq