// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_draw.cpp
// Function: PathBezierCubicCurveToCasteljau(ImVector<ImVec2>*, float, float, float, float, float, float, float, float, float, int)
static void PathBezierCubicCurveToCasteljau(ImVector<ImVec2>* path, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, float tess_tol, int level)
{
    float dx = x4 - x1;
    float dy = y4 - y1;
    float d2 = (x2 - x4) * dy - (y2 - y4) * dx;
    float d3 = (x3 - x4) * dy - (y3 - y4) * dx;
    d2 = (d2 >= 0) ? d2 : -d2;
    d3 = (d3 >= 0) ? d3 : -d3;
    if ((d2 + d3) * (d2 + d3) < tess_tol * (dx * dx + dy * dy))
    {
        path->push_back(ImVec2(x4, y4));
    }
    else if (level < 10)
    {
        float x12 = (x1 + x2) * 0.5f, y12 = (y1 + y2) * 0.5f;
        float x23 = (x2 + x3) * 0.5f, y23 = (y2 + y3) * 0.5f;
        float x34 = (x3 + x4) * 0.5f, y34 = (y3 + y4) * 0.5f;
        float x123 = (x12 + x23) * 0.5f, y123 = (y12 + y23) * 0.5f;
        float x234 = (x23 + x34) * 0.5f, y234 = (y23 + y34) * 0.5f;
        float x1234 = (x123 + x234) * 0.5f, y1234 = (y123 + y234) * 0.5f;
        PathBezierCubicCurveToCasteljau(path, x1, y1, x12, y12, x123, y123, x1234, y1234, tess_tol, level + 1);
        PathBezierCubicCurveToCasteljau(path, x1234, y1234, x234, y234, x34, y34, x4, y4, tess_tol, level + 1);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x30, %rsp
movl %esi, %ebx
movaps %xmm7, %xmm8
movaps %xmm6, %xmm9
movaps %xmm5, %xmm10
movaps %xmm4, %xmm11
movaps %xmm3, %xmm12
movaps %xmm2, %xmm13
movq %rdi, %r14
movss 0x10(%rbp), %xmm14
movss %xmm7, -0x18(%rbp)
movss %xmm6, -0x14(%rbp)
movaps %xmm9, %xmm2
subss %xmm0, %xmm2
movaps %xmm8, %xmm3
subss %xmm1, %xmm3
movaps %xmm13, %xmm4
subss %xmm9, %xmm4
movaps %xmm12, %xmm5
subss %xmm8, %xmm5
mulss %xmm2, %xmm5
mulss %xmm3, %xmm4
subss %xmm5, %xmm4
movaps %xmm11, %xmm5
subss %xmm9, %xmm5
movaps %xmm10, %xmm6
subss %xmm8, %xmm6
mulss %xmm2, %xmm6
mulss %xmm3, %xmm5
subss %xmm6, %xmm5
movaps %xmm4, %xmm6
movaps 0x38702(%rip), %xmm15   # 0x9bfe0
xorps %xmm15, %xmm6
movaps %xmm6, %xmm7
cmpless %xmm4, %xmm7
andps %xmm7, %xmm4
andnps %xmm6, %xmm7
orps %xmm4, %xmm7
movaps %xmm5, %xmm4
xorps %xmm15, %xmm4
movaps %xmm4, %xmm6
cmpless %xmm5, %xmm6
andps %xmm6, %xmm5
andnps %xmm4, %xmm6
orps %xmm5, %xmm6
addss %xmm7, %xmm6
mulss %xmm6, %xmm6
mulss %xmm3, %xmm3
mulss %xmm2, %xmm2
addss %xmm3, %xmm2
mulss %xmm14, %xmm2
ucomiss %xmm6, %xmm2
ja 0x63a39
cmpl $0x9, %ebx
jg 0x63a50
movaps %xmm0, %xmm2
addss %xmm13, %xmm2
movss 0x386d2(%rip), %xmm6    # 0x9c018
mulss %xmm6, %xmm2
movaps %xmm1, %xmm3
addss %xmm12, %xmm3
mulss %xmm6, %xmm3
addss %xmm11, %xmm13
mulss %xmm6, %xmm13
addss %xmm10, %xmm12
mulss %xmm6, %xmm12
addss %xmm9, %xmm11
mulss %xmm6, %xmm11
movss %xmm11, -0x2c(%rbp)
addss %xmm8, %xmm10
mulss %xmm6, %xmm10
movss %xmm10, -0x30(%rbp)
movaps %xmm2, %xmm4
addss %xmm13, %xmm4
mulss %xmm6, %xmm4
movaps %xmm3, %xmm5
addss %xmm12, %xmm5
mulss %xmm6, %xmm5
addss %xmm11, %xmm13
mulss %xmm6, %xmm13
movss %xmm13, -0x24(%rbp)
addss %xmm10, %xmm12
mulss %xmm6, %xmm12
movss %xmm12, -0x28(%rbp)
movaps %xmm4, %xmm7
addss %xmm13, %xmm7
mulss %xmm6, %xmm7
movss %xmm7, -0x20(%rbp)
movaps %xmm5, %xmm10
addss %xmm12, %xmm10
mulss %xmm6, %xmm10
movss %xmm10, -0x1c(%rbp)
incl %ebx
movss %xmm14, (%rsp)
movq %r14, %rdi
movaps %xmm7, %xmm6
movaps %xmm10, %xmm7
movl %ebx, %esi
callq 0x6384f
movss 0x10(%rbp), %xmm14
movss -0x24(%rbp), %xmm13
movss -0x28(%rbp), %xmm12
movss -0x2c(%rbp), %xmm11
movss -0x30(%rbp), %xmm10
movss -0x14(%rbp), %xmm9
movss -0x18(%rbp), %xmm8
movss -0x20(%rbp), %xmm0
movss -0x1c(%rbp), %xmm1
jmp 0x63887
leaq -0x38(%rbp), %rsi
movss %xmm9, (%rsi)
movss %xmm8, 0x4(%rsi)
movq %r14, %rdi
callq 0x4c382
addq $0x30, %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop