// File: donfreiday[P]gb/./imgui/imgui_draw.cpp
// Function: PathBezierToCasteljau(ImVector<ImVec2>*, float, float, float, float, float, float, float, float, float, int)
static void PathBezierToCasteljau(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;

        PathBezierToCasteljau(path, x1,y1,        x12,y12,    x123,y123,  x1234,y1234, tess_tol, level+1); 
        PathBezierToCasteljau(path, x1234,y1234,  x234,y234,  x34,y34,    x4,y4,       tess_tol, level+1); 
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movss 0x10(%rbp), %xmm8
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movss %xmm1, -0x10(%rbp)
movss %xmm2, -0x14(%rbp)
movss %xmm3, -0x18(%rbp)
movss %xmm4, -0x1c(%rbp)
movss %xmm5, -0x20(%rbp)
movss %xmm6, -0x24(%rbp)
movss %xmm7, -0x28(%rbp)
movl %esi, -0x2c(%rbp)
movss -0x24(%rbp), %xmm0
subss -0xc(%rbp), %xmm0
movss %xmm0, -0x30(%rbp)
movss -0x28(%rbp), %xmm0
subss -0x10(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movss -0x14(%rbp), %xmm0
subss -0x24(%rbp), %xmm0
movss -0x34(%rbp), %xmm2
movss -0x18(%rbp), %xmm1
subss -0x28(%rbp), %xmm1
mulss -0x30(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x38(%rbp)
movss -0x1c(%rbp), %xmm0
subss -0x24(%rbp), %xmm0
movss -0x34(%rbp), %xmm2
movss -0x20(%rbp), %xmm1
subss -0x28(%rbp), %xmm1
mulss -0x30(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x3fdd7
movss -0x38(%rbp), %xmm0
movss %xmm0, -0x78(%rbp)
jmp 0x3fdee
movss -0x38(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x78(%rbp)
movss -0x78(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
movss -0x3c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x3fe11
movss -0x3c(%rbp), %xmm0
movss %xmm0, -0x7c(%rbp)
jmp 0x3fe28
movss -0x3c(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0x7c(%rbp)
movss -0x7c(%rbp), %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x38(%rbp), %xmm1
addss -0x3c(%rbp), %xmm1
movss -0x38(%rbp), %xmm0
addss -0x3c(%rbp), %xmm0
mulss %xmm0, %xmm1
movss 0x10(%rbp), %xmm0
movss -0x30(%rbp), %xmm2
movss -0x30(%rbp), %xmm4
movss -0x34(%rbp), %xmm3
mulss -0x34(%rbp), %xmm3
mulss %xmm4, %xmm2
addss %xmm3, %xmm2
mulss %xmm2, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x3fea7
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movss -0x24(%rbp), %xmm0
movss -0x28(%rbp), %xmm1
leaq -0x44(%rbp), %rdi
callq 0x2d280
movq -0x88(%rbp), %rdi
leaq -0x44(%rbp), %rsi
callq 0x31200
jmp 0x4007d
cmpl $0xa, -0x2c(%rbp)
jge 0x4007b
movss -0xc(%rbp), %xmm0
addss -0x14(%rbp), %xmm0
movss 0x1b161(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x48(%rbp)
movss -0x10(%rbp), %xmm0
addss -0x18(%rbp), %xmm0
movss 0x1b146(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x4c(%rbp)
movss -0x14(%rbp), %xmm0
addss -0x1c(%rbp), %xmm0
movss 0x1b12b(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x50(%rbp)
movss -0x18(%rbp), %xmm0
addss -0x20(%rbp), %xmm0
movss 0x1b110(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x54(%rbp)
movss -0x1c(%rbp), %xmm0
addss -0x24(%rbp), %xmm0
movss 0x1b0f5(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x58(%rbp)
movss -0x20(%rbp), %xmm0
addss -0x28(%rbp), %xmm0
movss 0x1b0da(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x5c(%rbp)
movss -0x48(%rbp), %xmm0
addss -0x50(%rbp), %xmm0
movss 0x1b0bf(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x60(%rbp)
movss -0x4c(%rbp), %xmm0
addss -0x54(%rbp), %xmm0
movss 0x1b0a4(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x64(%rbp)
movss -0x50(%rbp), %xmm0
addss -0x58(%rbp), %xmm0
movss 0x1b089(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x68(%rbp)
movss -0x54(%rbp), %xmm0
addss -0x5c(%rbp), %xmm0
movss 0x1b06e(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x6c(%rbp)
movss -0x60(%rbp), %xmm0
addss -0x68(%rbp), %xmm0
movss 0x1b053(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x70(%rbp)
movss -0x64(%rbp), %xmm0
addss -0x6c(%rbp), %xmm0
movss 0x1b038(%rip), %xmm1    # 0x5b024
mulss %xmm1, %xmm0
movss %xmm0, -0x74(%rbp)
movq -0x8(%rbp), %rdi
movss -0xc(%rbp), %xmm0
movss -0x10(%rbp), %xmm1
movss -0x48(%rbp), %xmm2
movss -0x4c(%rbp), %xmm3
movss -0x60(%rbp), %xmm4
movss -0x64(%rbp), %xmm5
movss -0x70(%rbp), %xmm6
movss -0x74(%rbp), %xmm7
movss 0x10(%rbp), %xmm8
movl -0x2c(%rbp), %esi
addl $0x1, %esi
movss %xmm8, (%rsp)
callq 0x3fcf0
movq -0x8(%rbp), %rdi
movss -0x70(%rbp), %xmm0
movss -0x74(%rbp), %xmm1
movss -0x68(%rbp), %xmm2
movss -0x6c(%rbp), %xmm3
movss -0x58(%rbp), %xmm4
movss -0x5c(%rbp), %xmm5
movss -0x24(%rbp), %xmm6
movss -0x28(%rbp), %xmm7
movss 0x10(%rbp), %xmm8
movl -0x2c(%rbp), %esi
addl $0x1, %esi
movss %xmm8, (%rsp)
callq 0x3fcf0
jmp 0x4007d
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)