// File: /workspace/github_cpp_makefile_star2_O3/Ciaxur[P]yagb-emu/include/imgui/imgui_draw.cpp
// Function: ImDrawList::AddPolyline(ImVec2 const*, int, unsigned int, bool, float)
void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 col, bool closed, float thickness)
{
    if (points_count < 2)
        return;

    const ImVec2 opaque_uv = _Data->TexUvWhitePixel;
    const int count = closed ? points_count : points_count - 1; // The number of line segments we need to draw
    const bool thick_line = (thickness > _FringeScale);

    if (Flags & ImDrawListFlags_AntiAliasedLines)
    {
        // Anti-aliased stroke
        const float AA_SIZE = _FringeScale;
        const ImU32 col_trans = col & ~IM_COL32_A_MASK;

        // Thicknesses <1.0 should behave like thickness 1.0
        thickness = ImMax(thickness, 1.0f);
        const int integer_thickness = (int)thickness;
        const float fractional_thickness = thickness - integer_thickness;

        // Do we want to draw this line using a texture?
        // - For now, only draw integer-width lines using textures to avoid issues with the way scaling occurs, could be improved.
        // - If AA_SIZE is not 1.0f we cannot use the texture path.
        const bool use_texture = (Flags & ImDrawListFlags_AntiAliasedLinesUseTex) && (integer_thickness < IM_DRAWLIST_TEX_LINES_WIDTH_MAX) && (fractional_thickness <= 0.00001f) && (AA_SIZE == 1.0f);

        // We should never hit this, because NewFrame() doesn't set ImDrawListFlags_AntiAliasedLinesUseTex unless ImFontAtlasFlags_NoBakedLines is off
        IM_ASSERT_PARANOID(!use_texture || !(_Data->Font->ContainerAtlas->Flags & ImFontAtlasFlags_NoBakedLines));

        const int idx_count = use_texture ? (count * 6) : (thick_line ? count * 18 : count * 12);
        const int vtx_count = use_texture ? (points_count * 2) : (thick_line ? points_count * 4 : points_count * 3);
        PrimReserve(idx_count, vtx_count);

        // Temporary buffer
        // The first <points_count> items are normals at each line point, then after that there are either 2 or 4 temp points for each line point
        ImVec2* temp_normals = (ImVec2*)alloca(points_count * ((use_texture || !thick_line) ? 3 : 5) * sizeof(ImVec2)); //-V630
        ImVec2* temp_points = temp_normals + points_count;

        // Calculate normals (tangents) for each line segment
        for (int i1 = 0; i1 < count; i1++)
        {
            const int i2 = (i1 + 1) == points_count ? 0 : i1 + 1;
            float dx = points[i2].x - points[i1].x;
            float dy = points[i2].y - points[i1].y;
            IM_NORMALIZE2F_OVER_ZERO(dx, dy);
            temp_normals[i1].x = dy;
            temp_normals[i1].y = -dx;
        }
        if (!closed)
            temp_normals[points_count - 1] = temp_normals[points_count - 2];

        // If we are drawing a one-pixel-wide line without a texture, or a textured line of any width, we only need 2 or 3 vertices per point
        if (use_texture || !thick_line)
        {
            // [PATH 1] Texture-based lines (thick or non-thick)
            // [PATH 2] Non texture-based lines (non-thick)

            // The width of the geometry we need to draw - this is essentially <thickness> pixels for the line itself, plus "one pixel" for AA.
            // - In the texture-based path, we don't use AA_SIZE here because the +1 is tied to the generated texture
            //   (see ImFontAtlasBuildRenderLinesTexData() function), and so alternate values won't work without changes to that code.
            // - In the non texture-based paths, we would allow AA_SIZE to potentially be != 1.0f with a patch (e.g. fringe_scale patch to
            //   allow scaling geometry while preserving one-screen-pixel AA fringe).
            const float half_draw_size = use_texture ? ((thickness * 0.5f) + 1) : AA_SIZE;

            // If line is not closed, the first and last points need to be generated differently as there are no normals to blend
            if (!closed)
            {
                temp_points[0] = points[0] + temp_normals[0] * half_draw_size;
                temp_points[1] = points[0] - temp_normals[0] * half_draw_size;
                temp_points[(points_count-1)*2+0] = points[points_count-1] + temp_normals[points_count-1] * half_draw_size;
                temp_points[(points_count-1)*2+1] = points[points_count-1] - temp_normals[points_count-1] * half_draw_size;
            }

            // Generate the indices to form a number of triangles for each line segment, and the vertices for the line edges
            // This takes points n and n+1 and writes into n+1, with the first point in a closed line being generated from the final one (as n+1 wraps)
            // FIXME-OPT: Merge the different loops, possibly remove the temporary buffer.
            unsigned int idx1 = _VtxCurrentIdx; // Vertex index for start of line segment
            for (int i1 = 0; i1 < count; i1++) // i1 is the first point of the line segment
            {
                const int i2 = (i1 + 1) == points_count ? 0 : i1 + 1; // i2 is the second point of the line segment
                const unsigned int idx2 = ((i1 + 1) == points_count) ? _VtxCurrentIdx : (idx1 + (use_texture ? 2 : 3)); // Vertex index for end of segment

                // Average normals
                float dm_x = (temp_normals[i1].x + temp_normals[i2].x) * 0.5f;
                float dm_y = (temp_normals[i1].y + temp_normals[i2].y) * 0.5f;
                IM_FIXNORMAL2F(dm_x, dm_y);
                dm_x *= half_draw_size; // dm_x, dm_y are offset to the outer edge of the AA area
                dm_y *= half_draw_size;

                // Add temporary vertexes for the outer edges
                ImVec2* out_vtx = &temp_points[i2 * 2];
                out_vtx[0].x = points[i2].x + dm_x;
                out_vtx[0].y = points[i2].y + dm_y;
                out_vtx[1].x = points[i2].x - dm_x;
                out_vtx[1].y = points[i2].y - dm_y;

                if (use_texture)
                {
                    // Add indices for two triangles
                    _IdxWritePtr[0] = (ImDrawIdx)(idx2 + 0); _IdxWritePtr[1] = (ImDrawIdx)(idx1 + 0); _IdxWritePtr[2] = (ImDrawIdx)(idx1 + 1); // Right tri
                    _IdxWritePtr[3] = (ImDrawIdx)(idx2 + 1); _IdxWritePtr[4] = (ImDrawIdx)(idx1 + 1); _IdxWritePtr[5] = (ImDrawIdx)(idx2 + 0); // Left tri
                    _IdxWritePtr += 6;
                }
                else
                {
                    // Add indexes for four triangles
                    _IdxWritePtr[0] = (ImDrawIdx)(idx2 + 0); _IdxWritePtr[1] = (ImDrawIdx)(idx1 + 0); _IdxWritePtr[2] = (ImDrawIdx)(idx1 + 2); // Right tri 1
                    _IdxWritePtr[3] = (ImDrawIdx)(idx1 + 2); _IdxWritePtr[4] = (ImDrawIdx)(idx2 + 2); _IdxWritePtr[5] = (ImDrawIdx)(idx2 + 0); // Right tri 2
                    _IdxWritePtr[6] = (ImDrawIdx)(idx2 + 1); _IdxWritePtr[7] = (ImDrawIdx)(idx1 + 1); _IdxWritePtr[8] = (ImDrawIdx)(idx1 + 0); // Left tri 1
                    _IdxWritePtr[9] = (ImDrawIdx)(idx1 + 0); _IdxWritePtr[10] = (ImDrawIdx)(idx2 + 0); _IdxWritePtr[11] = (ImDrawIdx)(idx2 + 1); // Left tri 2
                    _IdxWritePtr += 12;
                }

                idx1 = idx2;
            }

            // Add vertexes for each point on the line
            if (use_texture)
            {
                // If we're using textures we only need to emit the left/right edge vertices
                ImVec4 tex_uvs = _Data->TexUvLines[integer_thickness];
                /*if (fractional_thickness != 0.0f) // Currently always zero when use_texture==false!
                {
                    const ImVec4 tex_uvs_1 = _Data->TexUvLines[integer_thickness + 1];
                    tex_uvs.x = tex_uvs.x + (tex_uvs_1.x - tex_uvs.x) * fractional_thickness; // inlined ImLerp()
                    tex_uvs.y = tex_uvs.y + (tex_uvs_1.y - tex_uvs.y) * fractional_thickness;
                    tex_uvs.z = tex_uvs.z + (tex_uvs_1.z - tex_uvs.z) * fractional_thickness;
                    tex_uvs.w = tex_uvs.w + (tex_uvs_1.w - tex_uvs.w) * fractional_thickness;
                }*/
                ImVec2 tex_uv0(tex_uvs.x, tex_uvs.y);
                ImVec2 tex_uv1(tex_uvs.z, tex_uvs.w);
                for (int i = 0; i < points_count; i++)
                {
                    _VtxWritePtr[0].pos = temp_points[i * 2 + 0]; _VtxWritePtr[0].uv = tex_uv0; _VtxWritePtr[0].col = col; // Left-side outer edge
                    _VtxWritePtr[1].pos = temp_points[i * 2 + 1]; _VtxWritePtr[1].uv = tex_uv1; _VtxWritePtr[1].col = col; // Right-side outer edge
                    _VtxWritePtr += 2;
                }
            }
            else
            {
                // If we're not using a texture, we need the center vertex as well
                for (int i = 0; i < points_count; i++)
                {
                    _VtxWritePtr[0].pos = points[i];              _VtxWritePtr[0].uv = opaque_uv; _VtxWritePtr[0].col = col;       // Center of line
                    _VtxWritePtr[1].pos = temp_points[i * 2 + 0]; _VtxWritePtr[1].uv = opaque_uv; _VtxWritePtr[1].col = col_trans; // Left-side outer edge
                    _VtxWritePtr[2].pos = temp_points[i * 2 + 1]; _VtxWritePtr[2].uv = opaque_uv; _VtxWritePtr[2].col = col_trans; // Right-side outer edge
                    _VtxWritePtr += 3;
                }
            }
        }
        else
        {
            // [PATH 2] Non texture-based lines (thick): we need to draw the solid line core and thus require four vertices per point
            const float half_inner_thickness = (thickness - AA_SIZE) * 0.5f;

            // If line is not closed, the first and last points need to be generated differently as there are no normals to blend
            if (!closed)
            {
                const int points_last = points_count - 1;
                temp_points[0] = points[0] + temp_normals[0] * (half_inner_thickness + AA_SIZE);
                temp_points[1] = points[0] + temp_normals[0] * (half_inner_thickness);
                temp_points[2] = points[0] - temp_normals[0] * (half_inner_thickness);
                temp_points[3] = points[0] - temp_normals[0] * (half_inner_thickness + AA_SIZE);
                temp_points[points_last * 4 + 0] = points[points_last] + temp_normals[points_last] * (half_inner_thickness + AA_SIZE);
                temp_points[points_last * 4 + 1] = points[points_last] + temp_normals[points_last] * (half_inner_thickness);
                temp_points[points_last * 4 + 2] = points[points_last] - temp_normals[points_last] * (half_inner_thickness);
                temp_points[points_last * 4 + 3] = points[points_last] - temp_normals[points_last] * (half_inner_thickness + AA_SIZE);
            }

            // Generate the indices to form a number of triangles for each line segment, and the vertices for the line edges
            // This takes points n and n+1 and writes into n+1, with the first point in a closed line being generated from the final one (as n+1 wraps)
            // FIXME-OPT: Merge the different loops, possibly remove the temporary buffer.
            unsigned int idx1 = _VtxCurrentIdx; // Vertex index for start of line segment
            for (int i1 = 0; i1 < count; i1++) // i1 is the first point of the line segment
            {
                const int i2 = (i1 + 1) == points_count ? 0 : (i1 + 1); // i2 is the second point of the line segment
                const unsigned int idx2 = (i1 + 1) == points_count ? _VtxCurrentIdx : (idx1 + 4); // Vertex index for end of segment

                // Average normals
                float dm_x = (temp_normals[i1].x + temp_normals[i2].x) * 0.5f;
                float dm_y = (temp_normals[i1].y + temp_normals[i2].y) * 0.5f;
                IM_FIXNORMAL2F(dm_x, dm_y);
                float dm_out_x = dm_x * (half_inner_thickness + AA_SIZE);
                float dm_out_y = dm_y * (half_inner_thickness + AA_SIZE);
                float dm_in_x = dm_x * half_inner_thickness;
                float dm_in_y = dm_y * half_inner_thickness;

                // Add temporary vertices
                ImVec2* out_vtx = &temp_points[i2 * 4];
                out_vtx[0].x = points[i2].x + dm_out_x;
                out_vtx[0].y = points[i2].y + dm_out_y;
                out_vtx[1].x = points[i2].x + dm_in_x;
                out_vtx[1].y = points[i2].y + dm_in_y;
                out_vtx[2].x = points[i2].x - dm_in_x;
                out_vtx[2].y = points[i2].y - dm_in_y;
                out_vtx[3].x = points[i2].x - dm_out_x;
                out_vtx[3].y = points[i2].y - dm_out_y;

                // Add indexes
                _IdxWritePtr[0]  = (ImDrawIdx)(idx2 + 1); _IdxWritePtr[1]  = (ImDrawIdx)(idx1 + 1); _IdxWritePtr[2]  = (ImDrawIdx)(idx1 + 2);
                _IdxWritePtr[3]  = (ImDrawIdx)(idx1 + 2); _IdxWritePtr[4]  = (ImDrawIdx)(idx2 + 2); _IdxWritePtr[5]  = (ImDrawIdx)(idx2 + 1);
                _IdxWritePtr[6]  = (ImDrawIdx)(idx2 + 1); _IdxWritePtr[7]  = (ImDrawIdx)(idx1 + 1); _IdxWritePtr[8]  = (ImDrawIdx)(idx1 + 0);
                _IdxWritePtr[9]  = (ImDrawIdx)(idx1 + 0); _IdxWritePtr[10] = (ImDrawIdx)(idx2 + 0); _IdxWritePtr[11] = (ImDrawIdx)(idx2 + 1);
                _IdxWritePtr[12] = (ImDrawIdx)(idx2 + 2); _IdxWritePtr[13] = (ImDrawIdx)(idx1 + 2); _IdxWritePtr[14] = (ImDrawIdx)(idx1 + 3);
                _IdxWritePtr[15] = (ImDrawIdx)(idx1 + 3); _IdxWritePtr[16] = (ImDrawIdx)(idx2 + 3); _IdxWritePtr[17] = (ImDrawIdx)(idx2 + 2);
                _IdxWritePtr += 18;

                idx1 = idx2;
            }

            // Add vertices
            for (int i = 0; i < points_count; i++)
            {
                _VtxWritePtr[0].pos = temp_points[i * 4 + 0]; _VtxWritePtr[0].uv = opaque_uv; _VtxWritePtr[0].col = col_trans;
                _VtxWritePtr[1].pos = temp_points[i * 4 + 1]; _VtxWritePtr[1].uv = opaque_uv; _VtxWritePtr[1].col = col;
                _VtxWritePtr[2].pos = temp_points[i * 4 + 2]; _VtxWritePtr[2].uv = opaque_uv; _VtxWritePtr[2].col = col;
                _VtxWritePtr[3].pos = temp_points[i * 4 + 3]; _VtxWritePtr[3].uv = opaque_uv; _VtxWritePtr[3].col = col_trans;
                _VtxWritePtr += 4;
            }
        }
        _VtxCurrentIdx += (ImDrawIdx)vtx_count;
    }
    else
    {
        // [PATH 4] Non texture-based, Non anti-aliased lines
        const int idx_count = count * 6;
        const int vtx_count = count * 4;    // FIXME-OPT: Not sharing edges
        PrimReserve(idx_count, vtx_count);

        for (int i1 = 0; i1 < count; i1++)
        {
            const int i2 = (i1 + 1) == points_count ? 0 : i1 + 1;
            const ImVec2& p1 = points[i1];
            const ImVec2& p2 = points[i2];

            float dx = p2.x - p1.x;
            float dy = p2.y - p1.y;
            IM_NORMALIZE2F_OVER_ZERO(dx, dy);
            dx *= (thickness * 0.5f);
            dy *= (thickness * 0.5f);

            _VtxWritePtr[0].pos.x = p1.x + dy; _VtxWritePtr[0].pos.y = p1.y - dx; _VtxWritePtr[0].uv = opaque_uv; _VtxWritePtr[0].col = col;
            _VtxWritePtr[1].pos.x = p2.x + dy; _VtxWritePtr[1].pos.y = p2.y - dx; _VtxWritePtr[1].uv = opaque_uv; _VtxWritePtr[1].col = col;
            _VtxWritePtr[2].pos.x = p2.x - dy; _VtxWritePtr[2].pos.y = p2.y + dx; _VtxWritePtr[2].uv = opaque_uv; _VtxWritePtr[2].col = col;
            _VtxWritePtr[3].pos.x = p1.x - dy; _VtxWritePtr[3].pos.y = p1.y + dx; _VtxWritePtr[3].uv = opaque_uv; _VtxWritePtr[3].col = col;
            _VtxWritePtr += 4;

            _IdxWritePtr[0] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[1] = (ImDrawIdx)(_VtxCurrentIdx + 1); _IdxWritePtr[2] = (ImDrawIdx)(_VtxCurrentIdx + 2);
            _IdxWritePtr[3] = (ImDrawIdx)(_VtxCurrentIdx); _IdxWritePtr[4] = (ImDrawIdx)(_VtxCurrentIdx + 2); _IdxWritePtr[5] = (ImDrawIdx)(_VtxCurrentIdx + 3);
            _IdxWritePtr += 6;
            _VtxCurrentIdx += 4;
        }
    }
}

// Assembly:
cmpl $0x2, %edx
jl 0x76d33
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %r14d
movl %edx, %r12d
movq %rsi, %r15
movq %rdi, %rbx
movq 0x38(%rdi), %rax
movq (%rax), %r13
leal -0x1(%r12), %r9d
testb %r8b, %r8b
movl %r9d, %r10d
cmovnel %edx, %r10d
movl 0x30(%rdi), %eax
testb $0x1, %al
movss %xmm0, -0x38(%rbp)
movq %r10, -0x60(%rbp)
jne 0x7648b
leal (%r10,%r10), %eax
leal (%rax,%rax,2), %esi
leal (,%r10,4), %edx
movq %rbx, %rdi
callq 0x75e52
movss -0x38(%rbp), %xmm8
mulss 0x3ecf8(%rip), %xmm8    # 0xb5004
movl %r12d, %eax
movl -0x60(%rbp), %ecx
negq %rcx
movl $0x1, %edx
xorl %esi, %esi
xorps %xmm0, %xmm0
movss 0x3ecbd(%rip), %xmm1    # 0xb4fe4
cmpq %rdx, %rax
movl %edx, %edi
cmoveq %rsi, %rdi
movss -0x8(%r15,%rdx,8), %xmm5
movss -0x4(%r15,%rdx,8), %xmm4
movss (%r15,%rdi,8), %xmm2
movss 0x4(%r15,%rdi,8), %xmm3
subss %xmm5, %xmm2
subss %xmm4, %xmm3
movaps %xmm3, %xmm7
mulss %xmm3, %xmm7
movaps %xmm2, %xmm6
mulss %xmm2, %xmm6
addss %xmm7, %xmm6
ucomiss %xmm0, %xmm6
jbe 0x7637d
sqrtss %xmm6, %xmm6
movaps %xmm1, %xmm7
divss %xmm6, %xmm7
mulss %xmm7, %xmm2
mulss %xmm7, %xmm3
mulss %xmm8, %xmm2
mulss %xmm8, %xmm3
addss %xmm3, %xmm5
movq 0x48(%rbx), %r8
movss %xmm5, (%r8)
subss %xmm2, %xmm4
movss %xmm4, 0x4(%r8)
movq %r13, 0x8(%r8)
movq 0x48(%rbx), %r8
movl %r14d, 0x10(%r8)
movss (%r15,%rdi,8), %xmm4
addss %xmm3, %xmm4
movss %xmm4, 0x14(%r8)
movss 0x4(%r15,%rdi,8), %xmm4
subss %xmm2, %xmm4
movss %xmm4, 0x18(%r8)
movq %r13, 0x1c(%r8)
movq 0x48(%rbx), %r8
movl %r14d, 0x24(%r8)
movss (%r15,%rdi,8), %xmm4
subss %xmm3, %xmm4
movss %xmm4, 0x28(%r8)
movss 0x4(%r15,%rdi,8), %xmm4
addss %xmm2, %xmm4
movss %xmm4, 0x2c(%r8)
movq %r13, 0x30(%r8)
movq 0x48(%rbx), %rdi
movl %r14d, 0x38(%rdi)
movss -0x8(%r15,%rdx,8), %xmm4
subss %xmm3, %xmm4
movss %xmm4, 0x3c(%rdi)
addss -0x4(%r15,%rdx,8), %xmm2
movss %xmm2, 0x40(%rdi)
movq %r13, 0x44(%rdi)
movq 0x48(%rbx), %rdi
movl %r14d, 0x4c(%rdi)
addq $0x50, %rdi
movq %rdi, 0x48(%rbx)
movl 0x34(%rbx), %edi
movq 0x50(%rbx), %r8
movw %di, (%r8)
leal 0x1(%rdi), %r9d
movw %r9w, 0x2(%r8)
leal 0x2(%rdi), %r9d
movw %r9w, 0x4(%r8)
movw %di, 0x6(%r8)
movw %r9w, 0x8(%r8)
leal 0x3(%rdi), %r9d
movw %r9w, 0xa(%r8)
addq $0xc, %r8
movq %r8, 0x50(%rbx)
addl $0x4, %edi
movl %edi, 0x34(%rbx)
leaq (%rcx,%rdx), %rdi
incq %rdi
incq %rdx
cmpq $0x1, %rdi
jne 0x76327
jmp 0x76d25
movss 0x3eb51(%rip), %xmm2    # 0xb4fe4
movaps %xmm0, %xmm3
maxss %xmm2, %xmm3
cvttss2si %xmm3, %ecx
cvtsi2ss %ecx, %xmm4
movaps %xmm3, %xmm1
subss %xmm4, %xmm1
shrb %al
movl %ecx, -0x40(%rbp)
cmpl $0x3f, %ecx
setl %cl
andb %al, %cl
movss 0x3f3da(%rip), %xmm4    # 0xb5898
ucomiss %xmm1, %xmm4
movss 0xc0(%rbx), %xmm1
setae %al
ucomiss %xmm2, %xmm1
setnp %dl
sete %dil
andb %dl, %dil
andb %cl, %dil
andb %al, %dil
ucomiss %xmm1, %xmm0
movl $0xc, %eax
movl $0x12, %ecx
cmovbel %eax, %ecx
testb %dil, %dil
movl $0x6, %esi
cmovel %ecx, %esi
imull %r10d, %esi
movb %dil, -0x2c(%rbp)
cmpb $0x1, %dil
movss %xmm1, -0x4c(%rbp)
movss %xmm3, -0x48(%rbp)
movq %r9, -0x68(%rbp)
movl %r8d, -0x44(%rbp)
jne 0x76525
leal (%r12,%r12), %edx
movl $0x3, %eax
jmp 0x76543
xorl %eax, %eax
ucomiss %xmm1, %xmm0
leal (,%r12,4), %ecx
seta %al
leal (%r12,%r12,2), %edx
cmoval %ecx, %edx
leal 0x3(,%rax,2), %eax
movq %rax, -0x58(%rbp)
movl %r14d, %eax
andl $0xffffff, %eax         # imm = 0xFFFFFF
movl %eax, -0x3c(%rbp)
movq %rbx, %rdi
movl %edx, -0x50(%rbp)
callq 0x75e52
movq -0x58(%rbp), %rax
imull %r12d, %eax
leaq 0xf(,%rax,8), %rax
andq $-0x10, %rax
movq %rsp, %rcx
subq %rax, %rcx
movq %rcx, %rsp
movl %r12d, %eax
leaq (%rcx,%rax,8), %rdx
movl -0x60(%rbp), %r12d
movq %r12, %rdi
negq %rdi
movl $0x1, %r8d
xorl %r9d, %r9d
xorps %xmm0, %xmm0
movaps 0x3ea22(%rip), %xmm1    # 0xb4fc0
movss 0x3ea3d(%rip), %xmm12   # 0xb4fe4
movb -0x2c(%rbp), %sil
cmpq %r8, %rax
movl %r8d, %r10d
cmoveq %r9, %r10
movss (%r15,%r10,8), %xmm2
movss 0x4(%r15,%r10,8), %xmm3
subss -0x8(%r15,%r8,8), %xmm2
subss -0x4(%r15,%r8,8), %xmm3
movaps %xmm3, %xmm5
mulss %xmm3, %xmm5
movaps %xmm2, %xmm4
mulss %xmm2, %xmm4
addss %xmm5, %xmm4
ucomiss %xmm0, %xmm4
jbe 0x765fb
sqrtss %xmm4, %xmm4
movaps %xmm12, %xmm5
divss %xmm4, %xmm5
mulss %xmm5, %xmm2
mulss %xmm5, %xmm3
xorps %xmm1, %xmm2
movss %xmm3, -0x8(%rcx,%r8,8)
movss %xmm2, -0x4(%rcx,%r8,8)
leaq (%rdi,%r8), %r10
incq %r10
incq %r8
cmpq $0x1, %r10
jne 0x765ab
cmpb $0x0, -0x44(%rbp)
movss -0x4c(%rbp), %xmm13
movss -0x48(%rbp), %xmm14
movss -0x38(%rbp), %xmm0
je 0x76668
ucomiss %xmm13, %xmm0
setbe %dil
orb %sil, %dil
je 0x768ad
testb %sil, %sil
je 0x7673e
mulss 0x3e9ae(%rip), %xmm14   # 0xb5004
addss 0x3e985(%rip), %xmm14   # 0xb4fe4
movaps %xmm14, %xmm13
jmp 0x7673e
ucomiss %xmm13, %xmm0
setbe %r8b
movq -0x68(%rbp), %r10
movl %r10d, %edi
movq -0x10(%rdx), %r9
movq %r9, (%rcx,%rdi,8)
orb %sil, %r8b
movss (%r15,%rdi,8), %xmm0
movss 0x4(%r15,%rdi,8), %xmm1
je 0x768c8
testb %sil, %sil
je 0x766b0
mulss 0x3e961(%rip), %xmm14   # 0xb5004
addss 0x3e938(%rip), %xmm14   # 0xb4fe4
movaps %xmm14, %xmm13
movss (%rcx), %xmm2
mulss %xmm13, %xmm2
movss 0x4(%rcx), %xmm3
mulss %xmm13, %xmm3
movss (%r15), %xmm4
movss 0x4(%r15), %xmm5
movaps %xmm2, %xmm6
addss %xmm4, %xmm6
movaps %xmm3, %xmm7
addss %xmm5, %xmm7
unpcklps %xmm7, %xmm6            # xmm6 = xmm6[0],xmm7[0],xmm6[1],xmm7[1]
subss %xmm2, %xmm4
subss %xmm3, %xmm5
unpcklps %xmm5, %xmm4            # xmm4 = xmm4[0],xmm5[0],xmm4[1],xmm5[1]
movlhps %xmm4, %xmm6            # xmm6 = xmm6[0],xmm4[0]
movups %xmm6, (%rdx)
movss (%rcx,%rdi,8), %xmm2
mulss %xmm13, %xmm2
movss 0x4(%rcx,%rdi,8), %xmm3
mulss %xmm13, %xmm3
addss %xmm0, %xmm2
addss %xmm1, %xmm3
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
addl %r10d, %r10d
movlps %xmm2, (%rdx,%r10,8)
movss (%rcx,%rdi,8), %xmm2
mulss %xmm13, %xmm2
movss 0x4(%rcx,%rdi,8), %xmm3
mulss %xmm13, %xmm3
subss %xmm2, %xmm0
subss %xmm3, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, 0x8(%rdx,%r10,8)
movq %r12, -0x38(%rbp)
movl 0x34(%rbx), %r9d
movzbl %sil, %edi
xorl $0x3, %edi
movq 0x50(%rbx), %r8
movl $0x1, %esi
movss 0x3e8a6(%rip), %xmm0    # 0xb5004
movl %r9d, %r12d
leal (%r12,%rdi), %r9d
cmpq %rsi, %rax
movl %esi, %r11d
cmovel 0x34(%rbx), %r9d
movl $0x0, %r10d
cmovel %r10d, %r11d
movss -0x8(%rcx,%rsi,8), %xmm1
movss -0x4(%rcx,%rsi,8), %xmm2
addss (%rcx,%r11,8), %xmm1
addss 0x4(%rcx,%r11,8), %xmm2
mulss %xmm0, %xmm1
mulss %xmm0, %xmm2
movaps %xmm2, %xmm3
mulss %xmm2, %xmm3
movaps %xmm1, %xmm4
mulss %xmm1, %xmm4
addss %xmm3, %xmm4
movaps %xmm0, %xmm3
maxss %xmm4, %xmm3
movaps %xmm12, %xmm4
divss %xmm3, %xmm4
mulss %xmm4, %xmm1
mulss %xmm13, %xmm1
movl %r11d, %r10d
addl %r10d, %r10d
movss (%r15,%r11,8), %xmm3
movaps %xmm3, %xmm5
addss %xmm1, %xmm5
movss %xmm5, (%rdx,%r10,8)
movss 0x4(%r15,%r11,8), %xmm5
mulss %xmm2, %xmm4
mulss %xmm13, %xmm4
movaps %xmm5, %xmm2
addss %xmm4, %xmm2
movss %xmm2, 0x4(%rdx,%r10,8)
subss %xmm1, %xmm3
movss %xmm3, 0x8(%rdx,%r10,8)
subss %xmm4, %xmm5
movss %xmm5, 0xc(%rdx,%r10,8)
movw %r9w, (%r8)
movw %r12w, 0x2(%r8)
cmpb $0x0, -0x2c(%rbp)
je 0x7684f
incl %r12d
movw %r12w, 0x4(%r8)
leal 0x1(%r9), %r10d
movw %r10w, 0x6(%r8)
movw %r12w, 0x8(%r8)
movw %r9w, 0xa(%r8)
addq $0xc, %r8
movq %r8, 0x50(%rbx)
cmpq %rsi, -0x38(%rbp)
jne 0x768a5
jmp 0x76c37
leal 0x2(%r12), %r10d
movw %r10w, 0x4(%r8)
movw %r10w, 0x6(%r8)
leal 0x2(%r9), %r10d
movw %r10w, 0x8(%r8)
movw %r9w, 0xa(%r8)
leal 0x1(%r9), %r10d
movw %r10w, 0xc(%r8)
leal 0x1(%r12), %r11d
movw %r11w, 0xe(%r8)
movw %r12w, 0x10(%r8)
movw %r12w, 0x12(%r8)
movw %r9w, 0x14(%r8)
movw %r10w, 0x16(%r8)
addq $0x18, %r8
movq %r8, 0x50(%rbx)
cmpq %rsi, -0x38(%rbp)
je 0x76cb2
incq %rsi
jmp 0x7675e
movq %r13, -0x38(%rbp)
movl %r14d, -0x2c(%rbp)
subss %xmm13, %xmm14
mulss 0x3e741(%rip), %xmm14   # 0xb5004
jmp 0x76a02
movq %r13, -0x38(%rbp)
movl %r14d, -0x2c(%rbp)
subss %xmm13, %xmm14
mulss 0x3e726(%rip), %xmm14   # 0xb5004
movaps %xmm13, %xmm2
addss %xmm14, %xmm2
movss (%rcx), %xmm3
movss 0x4(%rcx), %xmm4
movaps %xmm14, %xmm5
mulss %xmm3, %xmm5
mulss %xmm2, %xmm3
movaps %xmm2, %xmm6
mulss %xmm4, %xmm6
movss (%r15), %xmm7
movss 0x4(%r15), %xmm8
movaps %xmm3, %xmm9
addss %xmm7, %xmm9
movaps %xmm6, %xmm10
addss %xmm8, %xmm10
unpcklps %xmm10, %xmm9           # xmm9 = xmm9[0],xmm10[0],xmm9[1],xmm10[1]
mulss %xmm14, %xmm4
movaps %xmm7, %xmm10
subss %xmm5, %xmm10
addss %xmm7, %xmm5
movaps %xmm8, %xmm11
subss %xmm4, %xmm11
addss %xmm8, %xmm4
unpcklps %xmm4, %xmm5            # xmm5 = xmm5[0],xmm4[0],xmm5[1],xmm4[1]
movlhps %xmm5, %xmm9            # xmm9 = xmm9[0],xmm5[0]
movups %xmm9, (%rdx)
unpcklps %xmm11, %xmm10          # xmm10 = xmm10[0],xmm11[0],xmm10[1],xmm11[1]
subss %xmm3, %xmm7
subss %xmm6, %xmm8
unpcklps %xmm8, %xmm7            # xmm7 = xmm7[0],xmm8[0],xmm7[1],xmm8[1]
movlhps %xmm7, %xmm10           # xmm10 = xmm10[0],xmm7[0]
movups %xmm10, 0x10(%rdx)
movss (%rcx,%rdi,8), %xmm3
mulss %xmm2, %xmm3
movss 0x4(%rcx,%rdi,8), %xmm4
mulss %xmm2, %xmm4
addss %xmm0, %xmm3
addss %xmm1, %xmm4
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
shll $0x2, %r10d
movlps %xmm3, (%rdx,%r10,8)
movss (%rcx,%rdi,8), %xmm3
mulss %xmm14, %xmm3
movss 0x4(%rcx,%rdi,8), %xmm4
mulss %xmm14, %xmm4
addss %xmm0, %xmm3
addss %xmm1, %xmm4
unpcklps %xmm4, %xmm3            # xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
movlps %xmm3, 0x8(%rdx,%r10,8)
movss (%rcx,%rdi,8), %xmm3
mulss %xmm14, %xmm3
movss 0x4(%rcx,%rdi,8), %xmm4
mulss %xmm14, %xmm4
movaps %xmm0, %xmm5
subss %xmm3, %xmm5
movaps %xmm1, %xmm3
subss %xmm4, %xmm3
unpcklps %xmm3, %xmm5            # xmm5 = xmm5[0],xmm3[0],xmm5[1],xmm3[1]
movlps %xmm5, 0x10(%rdx,%r10,8)
movss (%rcx,%rdi,8), %xmm3
mulss %xmm2, %xmm3
mulss 0x4(%rcx,%rdi,8), %xmm2
subss %xmm3, %xmm0
subss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, 0x18(%rdx,%r10,8)
movl 0x34(%rbx), %r10d
addss %xmm14, %xmm13
movq 0x50(%rbx), %rdi
negq %r12
movl $0x1, %r9d
movss 0x3e5e4(%rip), %xmm0    # 0xb5004
cmpq %r9, %rax
movl %r9d, %r8d
movl $0x0, %esi
cmovel %esi, %r8d
movss -0x8(%rcx,%r9,8), %xmm1
movss -0x4(%rcx,%r9,8), %xmm3
addss (%rcx,%r8,8), %xmm1
mulss %xmm0, %xmm1
addss 0x4(%rcx,%r8,8), %xmm3
mulss %xmm0, %xmm3
movaps %xmm3, %xmm2
mulss %xmm3, %xmm2
movaps %xmm1, %xmm4
mulss %xmm1, %xmm4
addss %xmm2, %xmm4
movaps %xmm0, %xmm5
maxss %xmm4, %xmm5
leal 0x4(%r10), %r11d
movaps %xmm12, %xmm2
cmovel 0x34(%rbx), %r11d
divss %xmm5, %xmm2
mulss %xmm2, %xmm1
movaps %xmm13, %xmm4
mulss %xmm3, %xmm2
mulss %xmm1, %xmm4
movaps %xmm13, %xmm3
mulss %xmm2, %xmm3
mulss %xmm14, %xmm1
movq %r12, %r13
movl %r8d, %r12d
shll $0x2, %r12d
movss (%r15,%r8,8), %xmm5
mulss %xmm14, %xmm2
movaps %xmm5, %xmm6
addss %xmm4, %xmm6
movss %xmm6, (%rdx,%r12,8)
movss 0x4(%r15,%r8,8), %xmm6
movaps %xmm6, %xmm7
addss %xmm3, %xmm7
movaps %xmm5, %xmm8
movss %xmm7, 0x4(%rdx,%r12,8)
addss %xmm1, %xmm8
movaps %xmm6, %xmm7
addss %xmm2, %xmm7
movss %xmm8, 0x8(%rdx,%r12,8)
movss %xmm7, 0xc(%rdx,%r12,8)
movaps %xmm5, %xmm7
subss %xmm1, %xmm7
movss %xmm7, 0x10(%rdx,%r12,8)
movaps %xmm6, %xmm1
subss %xmm2, %xmm1
subss %xmm4, %xmm5
movss %xmm1, 0x14(%rdx,%r12,8)
movss %xmm5, 0x18(%rdx,%r12,8)
subss %xmm3, %xmm6
leal 0x1(%r11), %esi
movss %xmm6, 0x1c(%rdx,%r12,8)
movw %si, (%rdi)
leal 0x1(%r10), %r8d
leal 0x2(%r10), %r12d
movw %r8w, 0x2(%rdi)
movw %r12w, 0x4(%rdi)
movw %r12w, 0x6(%rdi)
leal 0x2(%r11), %r14d
movw %r14w, 0x8(%rdi)
movw %si, 0xa(%rdi)
movw %si, 0xc(%rdi)
movw %r8w, 0xe(%rdi)
movw %r10w, 0x10(%rdi)
movw %r10w, 0x12(%rdi)
movw %r11w, 0x14(%rdi)
movw %si, 0x16(%rdi)
movw %r14w, 0x18(%rdi)
movw %r12w, 0x1a(%rdi)
movq %r13, %r12
addl $0x3, %r10d
movw %r10w, 0x1c(%rdi)
movw %r10w, 0x1e(%rdi)
leal 0x3(%r11), %esi
movw %si, 0x20(%rdi)
movw %r14w, 0x22(%rdi)
addq $0x24, %rdi
leaq (%r9,%r13), %rsi
incq %rsi
incq %r9
movl %r11d, %r10d
cmpq $0x1, %rsi
jne 0x76a20
movq %rdi, 0x50(%rbx)
movq 0x48(%rbx), %rdx
leaq (%rcx,%rax,8), %rcx
addq $0x18, %rcx
movl -0x2c(%rbp), %edi
movl -0x3c(%rbp), %r8d
movq -0x38(%rbp), %r9
movq -0x18(%rcx), %rsi
movq %rsi, (%rdx)
movq 0x48(%rbx), %rdx
movq %r9, 0x8(%rdx)
movq 0x48(%rbx), %rdx
movl %r8d, 0x10(%rdx)
movq -0x10(%rcx), %rsi
movq %rsi, 0x14(%rdx)
movq 0x48(%rbx), %rdx
movq %r9, 0x1c(%rdx)
movq 0x48(%rbx), %rdx
movl %edi, 0x24(%rdx)
movq -0x8(%rcx), %rsi
movq %rsi, 0x28(%rdx)
movq 0x48(%rbx), %rdx
movq %r9, 0x30(%rdx)
movq 0x48(%rbx), %rdx
movl %edi, 0x38(%rdx)
movq (%rcx), %rsi
movq %rsi, 0x3c(%rdx)
movq 0x48(%rbx), %rdx
movq %r9, 0x44(%rdx)
movq 0x48(%rbx), %rdx
movl %r8d, 0x4c(%rdx)
addq $0x50, %rdx
movq %rdx, 0x48(%rbx)
addq $0x20, %rcx
decq %rax
jne 0x76bc5
jmp 0x76d1e
movq 0x38(%rbx), %rdx
movq 0x48(%rbx), %r9
movq 0xd0(%rdx), %r8
movslq -0x40(%rbp), %r10
shlq $0x4, %r10
movl (%r8,%r10), %edx
movl 0x4(%r8,%r10), %esi
movl 0x8(%r8,%r10), %edi
movl 0xc(%r8,%r10), %r8d
leaq (%rcx,%rax,8), %rcx
addq $0x8, %rcx
movq -0x8(%rcx), %r10
movq %r10, (%r9)
movq 0x48(%rbx), %r9
movl %edx, 0x8(%r9)
movl %esi, 0xc(%r9)
movq 0x48(%rbx), %r9
movl %r14d, 0x10(%r9)
movq (%rcx), %r10
movq %r10, 0x14(%r9)
movq 0x48(%rbx), %r9
movl %edi, 0x1c(%r9)
movl %r8d, 0x20(%r9)
movq 0x48(%rbx), %r9
movl %r14d, 0x24(%r9)
addq $0x28, %r9
movq %r9, 0x48(%rbx)
addq $0x10, %rcx
decq %rax
jne 0x76c69
jmp 0x76d1e
movq 0x48(%rbx), %rsi
leaq (%rcx,%rax,8), %rcx
addq $0x8, %rcx
xorl %edx, %edx
movl -0x3c(%rbp), %r8d
movq (%r15,%rdx,8), %rdi
movq %rdi, (%rsi)
movq 0x48(%rbx), %rsi
movq %r13, 0x8(%rsi)
movq 0x48(%rbx), %rsi
movl %r14d, 0x10(%rsi)
movq -0x8(%rcx), %rdi
movq %rdi, 0x14(%rsi)
movq 0x48(%rbx), %rsi
movq %r13, 0x1c(%rsi)
movq 0x48(%rbx), %rsi
movl %r8d, 0x24(%rsi)
movq (%rcx), %rdi
movq %rdi, 0x28(%rsi)
movq 0x48(%rbx), %rsi
movq %r13, 0x30(%rsi)
movq 0x48(%rbx), %rsi
movl %r8d, 0x38(%rsi)
addq $0x3c, %rsi
movq %rsi, 0x48(%rbx)
incq %rdx
addq $0x10, %rcx
cmpq %rdx, %rax
jne 0x76cc4
movzwl -0x50(%rbp), %eax
addl %eax, 0x34(%rbx)
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq