// File: /workspace/github_c_makefile_star2_O2/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 $0x168, %rsp            # imm = 0x168
movss %xmm6, -0xc(%rbp)
movaps %xmm5, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm3, -0x70(%rbp)
movaps %xmm2, -0x60(%rbp)
movaps %xmm1, -0x30(%rbp)
movaps %xmm0, -0x20(%rbp)
movl %edi, %ebx
xorl %ecx, %ecx
cmpl $0x10, %edi
setb %cl
leaq 0xcc45(%rip), %rdi      # 0x2c04d
leaq 0xccc0(%rip), %rdx      # 0x2c0cf
movl $0x1d7, %esi            # imm = 0x1D7
callq 0x6903
movaps -0x20(%rbp), %xmm2
movaps %xmm2, %xmm1
movaps -0x30(%rbp), %xmm0
subps %xmm0, %xmm1
movaps %xmm2, %xmm3
shufps $0x55, %xmm2, %xmm3     # xmm3 = xmm3[1,1],xmm2[1,1]
movaps %xmm3, -0x40(%rbp)
movaps %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
movaps %xmm2, -0x50(%rbp)
movaps %xmm3, %xmm0
subss %xmm2, %xmm0
xorps 0xbbf5(%rip), %xmm0     # 0x2b040
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
callq 0x6a2a
movaps %xmm0, %xmm1
movss -0xc(%rbp), %xmm2
mulss %xmm2, %xmm1
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
mulss %xmm2, %xmm0
movss 0xbb99(%rip), %xmm2     # 0x2b008
mulss %xmm2, %xmm1
mulss %xmm2, %xmm0
movaps -0x20(%rbp), %xmm6
movaps %xmm6, %xmm2
addss %xmm1, %xmm2
movaps -0x40(%rbp), %xmm4
movaps %xmm4, %xmm3
addss %xmm0, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movq %xmm2, %xmm2            # xmm2 = xmm2[0],zero
leaq -0x170(%rbp), %rdx
movdqa %xmm2, (%rdx)
movl $0xbf800000, %eax       # imm = 0xBF800000
movl %eax, 0x10(%rdx)
movaps -0x60(%rbp), %xmm3
unpcklpd -0x70(%rbp), %xmm3      # xmm3 = xmm3[0],mem[0]
movups %xmm3, 0x14(%rdx)
movaps %xmm3, %xmm5
movaps %xmm6, %xmm3
subss %xmm1, %xmm3
subss %xmm0, %xmm4
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movq %xmm3, %xmm3            # xmm3 = xmm3[0],zero
movdqu %xmm3, 0x24(%rdx)
movl %eax, 0x34(%rdx)
movups %xmm5, 0x38(%rdx)
movaps -0x30(%rbp), %xmm6
movaps %xmm6, %xmm3
subss %xmm1, %xmm3
movaps -0x50(%rbp), %xmm7
movaps %xmm7, %xmm4
subss %xmm0, %xmm4
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movq %xmm3, %xmm3            # xmm3 = xmm3[0],zero
movdqu %xmm3, 0x48(%rdx)
movl %eax, 0x58(%rdx)
movaps -0x80(%rbp), %xmm4
unpcklpd -0x90(%rbp), %xmm4      # xmm4 = xmm4[0],mem[0]
movups %xmm4, 0x5c(%rdx)
movdqu %xmm2, 0x6c(%rdx)
movl %eax, 0x7c(%rdx)
movaps %xmm5, 0x80(%rdx)
movdqa %xmm3, 0x90(%rdx)
movl %eax, 0xa0(%rdx)
movups %xmm4, 0xa4(%rdx)
addss %xmm6, %xmm1
addss %xmm7, %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movq %xmm1, %xmm0            # xmm0 = xmm1[0],zero
movdqu %xmm0, 0xb4(%rdx)
movl %eax, 0xc4(%rdx)
movups %xmm4, 0xc8(%rdx)
movl %ebx, %edi
shlq $0x5, %rdi
addq 0x2aa81(%rip), %rdi     # 0x49fe0
pushq $0x6
popq %rsi
callq 0x2968c
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %rbp
retq