// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_draw.cpp
// Function: ImGui::RenderRectFilledRangeH(ImDrawList*, ImRect const&, unsigned int, float, float, float)
void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding)
{
    if (x_end_norm == x_start_norm)
        return;
    if (x_start_norm > x_end_norm)
        ImSwap(x_start_norm, x_end_norm);

    ImVec2 p0 = ImVec2(ImLerp(rect.Min.x, rect.Max.x, x_start_norm), rect.Min.y);
    ImVec2 p1 = ImVec2(ImLerp(rect.Min.x, rect.Max.x, x_end_norm), rect.Max.y);
    if (rounding == 0.0f)
    {
        draw_list->AddRectFilled(p0, p1, col, 0.0f);
        return;
    }

    rounding = ImClamp(ImMin((rect.Max.x - rect.Min.x) * 0.5f, (rect.Max.y - rect.Min.y) * 0.5f) - 1.0f, 0.0f, rounding);
    const float inv_rounding = 1.0f / rounding;
    const float arc0_b = ImAcos01(1.0f - (p0.x - rect.Min.x) * inv_rounding);
    const float arc0_e = ImAcos01(1.0f - (p1.x - rect.Min.x) * inv_rounding);
    const float half_pi = IM_PI * 0.5f; // We will == compare to this because we know this is the exact value ImAcos01 can return.
    const float x0 = ImMax(p0.x, rect.Min.x + rounding);
    if (arc0_b == arc0_e)
    {
        draw_list->PathLineTo(ImVec2(x0, p1.y));
        draw_list->PathLineTo(ImVec2(x0, p0.y));
    }
    else if (arc0_b == 0.0f && arc0_e == half_pi)
    {
        draw_list->PathArcToFast(ImVec2(x0, p1.y - rounding), rounding, 3, 6); // BL
        draw_list->PathArcToFast(ImVec2(x0, p0.y + rounding), rounding, 6, 9); // TR
    }
    else
    {
        draw_list->PathArcTo(ImVec2(x0, p1.y - rounding), rounding, IM_PI - arc0_e, IM_PI - arc0_b, 3); // BL
        draw_list->PathArcTo(ImVec2(x0, p0.y + rounding), rounding, IM_PI + arc0_b, IM_PI + arc0_e, 3); // TR
    }
    if (p1.x > rect.Min.x + rounding)
    {
        const float arc1_b = ImAcos01(1.0f - (rect.Max.x - p1.x) * inv_rounding);
        const float arc1_e = ImAcos01(1.0f - (rect.Max.x - p0.x) * inv_rounding);
        const float x1 = ImMin(p1.x, rect.Max.x - rounding);
        if (arc1_b == arc1_e)
        {
            draw_list->PathLineTo(ImVec2(x1, p0.y));
            draw_list->PathLineTo(ImVec2(x1, p1.y));
        }
        else if (arc1_b == 0.0f && arc1_e == half_pi)
        {
            draw_list->PathArcToFast(ImVec2(x1, p0.y + rounding), rounding, 9, 12); // TR
            draw_list->PathArcToFast(ImVec2(x1, p1.y - rounding), rounding, 0, 3);  // BR
        }
        else
        {
            draw_list->PathArcTo(ImVec2(x1, p0.y + rounding), rounding, -arc1_e, -arc1_b, 3); // TR
            draw_list->PathArcTo(ImVec2(x1, p1.y - rounding), rounding, +arc1_b, +arc1_e, 3); // BR
        }
    }
    draw_list->PathFillConvex(col);
}

// Assembly:
ucomiss %xmm0, %xmm1
jne 0x6bed6
jp 0x6bed6
retq
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
movaps %xmm1, %xmm3
minss %xmm0, %xmm3
maxss %xmm1, %xmm0
movss (%rsi), %xmm5
movss 0x4(%rsi), %xmm7
movss 0x8(%rsi), %xmm4
subss %xmm5, %xmm4
mulss %xmm4, %xmm3
addss %xmm5, %xmm3
movss %xmm3, -0x90(%rbp)
movss %xmm7, -0x8c(%rbp)
mulss %xmm4, %xmm0
addss %xmm5, %xmm0
movss 0xc(%rsi), %xmm6
movss %xmm0, -0x88(%rbp)
movss %xmm6, -0x84(%rbp)
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm2
jne 0x6bf72
jp 0x6bf72
leaq -0x90(%rbp), %rsi
leaq -0x88(%rbp), %rdx
pushq $0xf
popq %r8
xorps %xmm0, %xmm0
movq %r14, %rdi
movl %ebx, %ecx
callq 0x64020
jmp 0x6c381
movss %xmm0, -0x2c(%rbp)
movaps %xmm3, %xmm8
movaps %xmm3, -0xb0(%rbp)
movss 0x3008e(%rip), %xmm3    # 0x9c018
mulss %xmm3, %xmm4
movaps %xmm4, -0x50(%rbp)
movaps %xmm6, %xmm4
subss %xmm7, %xmm4
mulss %xmm3, %xmm4
movaps -0x50(%rbp), %xmm0
minss %xmm4, %xmm0
movaps %xmm0, -0x50(%rbp)
movaps -0x50(%rbp), %xmm0
addss 0x3003b(%rip), %xmm0    # 0x9bff0
movaps %xmm0, -0x50(%rbp)
minss -0x50(%rbp), %xmm2
movaps -0x50(%rbp), %xmm0
cmpltss %xmm1, %xmm0
movaps %xmm0, -0x50(%rbp)
movaps -0x50(%rbp), %xmm0
andnps %xmm2, %xmm0
movaps %xmm0, -0x50(%rbp)
movss 0x3001a(%rip), %xmm2    # 0x9bff8
movaps %xmm2, %xmm0
divss -0x50(%rbp), %xmm0
movss %xmm0, -0x80(%rbp)
movaps %xmm8, %xmm1
subss %xmm5, %xmm1
mulss %xmm0, %xmm1
movaps %xmm2, %xmm0
subss %xmm1, %xmm0
movss %xmm6, -0x34(%rbp)
movss %xmm7, -0x30(%rbp)
callq 0x6c393
movss -0x2c(%rbp), %xmm1
subss (%r15), %xmm1
movss %xmm0, -0x70(%rbp)
mulss -0x80(%rbp), %xmm1
movss 0x2ffcf(%rip), %xmm0    # 0x9bff8
subss %xmm1, %xmm0
callq 0x6c393
movss -0x70(%rbp), %xmm4
movaps -0x50(%rbp), %xmm3
movaps %xmm0, %xmm5
movss (%r15), %xmm0
addss %xmm3, %xmm0
movaps %xmm0, %xmm2
movaps -0xb0(%rbp), %xmm6
cmpless %xmm6, %xmm2
movaps %xmm2, %xmm1
andnps %xmm0, %xmm1
andps %xmm6, %xmm2
orps %xmm1, %xmm2
ucomiss %xmm5, %xmm4
movaps %xmm2, -0xa0(%rbp)
jne 0x6c0bf
jp 0x6c0bf
leaq -0x3c(%rbp), %r12
movss %xmm2, (%r12)
movss -0x34(%rbp), %xmm0
movss %xmm0, 0x4(%r12)
leaq 0x78(%r14), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x4c382
movaps -0xa0(%rbp), %xmm0
movss %xmm0, (%r12)
movss -0x30(%rbp), %xmm0
movss %xmm0, 0x4(%r12)
leaq -0x3c(%rbp), %rsi
movq %r13, %rdi
callq 0x4c382
jmp 0x6c1ca
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm4
movss -0x34(%rbp), %xmm0
subss %xmm3, %xmm0
jne 0x6c13d
jp 0x6c13d
ucomiss 0x41bcf(%rip), %xmm5    # 0xadca8
jne 0x6c13d
jp 0x6c13d
leaq -0x3c(%rbp), %r12
movss %xmm2, (%r12)
movss %xmm0, 0x4(%r12)
pushq $0x3
popq %rdx
pushq $0x6
popq %r13
movq %r14, %rdi
movq %r12, %rsi
movaps %xmm3, %xmm0
movl %r13d, %ecx
callq 0x63484
movaps -0x50(%rbp), %xmm0
movaps %xmm0, %xmm1
addss -0x30(%rbp), %xmm1
movaps -0xa0(%rbp), %xmm2
movss %xmm2, (%r12)
movss %xmm1, 0x4(%r12)
leaq -0x3c(%rbp), %rsi
pushq $0x9
popq %rcx
movq %r14, %rdi
movl %r13d, %edx
callq 0x63484
jmp 0x6c1ca
leaq -0x3c(%rbp), %r12
movss %xmm2, (%r12)
movss %xmm0, 0x4(%r12)
movss 0x41b2a(%rip), %xmm0    # 0xadc80
movaps %xmm0, %xmm1
subss %xmm5, %xmm1
movaps %xmm0, %xmm2
subss %xmm4, %xmm2
pushq $0x3
popq %r13
movq %r14, %rdi
movq %r12, %rsi
movaps %xmm3, %xmm0
movl %r13d, %edx
movss %xmm5, -0x54(%rbp)
callq 0x63550
movaps -0x50(%rbp), %xmm3
movaps %xmm3, %xmm0
addss -0x30(%rbp), %xmm0
movaps -0xa0(%rbp), %xmm1
movss %xmm1, (%r12)
movss %xmm0, 0x4(%r12)
movss 0x41ada(%rip), %xmm0    # 0xadc80
movss -0x70(%rbp), %xmm1
addss %xmm0, %xmm1
movss -0x54(%rbp), %xmm2
addss %xmm0, %xmm2
leaq -0x3c(%rbp), %rsi
movq %r14, %rdi
movaps %xmm3, %xmm0
movl %r13d, %edx
callq 0x63550
movss (%r15), %xmm0
addss -0x50(%rbp), %xmm0
movss -0x2c(%rbp), %xmm2
ucomiss %xmm0, %xmm2
jbe 0x6c377
movss 0x8(%r15), %xmm1
subss %xmm2, %xmm1
mulss -0x80(%rbp), %xmm1
movss 0x2fdff(%rip), %xmm0    # 0x9bff8
subss %xmm1, %xmm0
callq 0x6c393
movaps %xmm0, -0x70(%rbp)
movss 0x8(%r15), %xmm1
subss -0xb0(%rbp), %xmm1
mulss -0x80(%rbp), %xmm1
movss 0x2fdd7(%rip), %xmm0    # 0x9bff8
subss %xmm1, %xmm0
callq 0x6c393
movaps -0x70(%rbp), %xmm5
movaps -0x50(%rbp), %xmm4
movss -0x2c(%rbp), %xmm3
movss 0x8(%r15), %xmm1
subss %xmm4, %xmm1
minss %xmm1, %xmm3
ucomiss %xmm0, %xmm5
movss %xmm3, -0x2c(%rbp)
jne 0x6c29a
jp 0x6c29a
leaq -0x3c(%rbp), %r15
movss %xmm3, (%r15)
movss -0x30(%rbp), %xmm0
movss %xmm0, 0x4(%r15)
leaq 0x78(%r14), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x4c382
movss -0x2c(%rbp), %xmm0
movss %xmm0, (%r15)
movss -0x34(%rbp), %xmm0
movss %xmm0, 0x4(%r15)
leaq -0x3c(%rbp), %rsi
movq %r12, %rdi
callq 0x4c382
jmp 0x6c377
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm5
movss -0x30(%rbp), %xmm1
addss %xmm4, %xmm1
jne 0x6c30b
jp 0x6c30b
ucomiss 0x419f4(%rip), %xmm0    # 0xadca8
jne 0x6c30b
jp 0x6c30b
leaq -0x3c(%rbp), %r15
movss %xmm3, (%r15)
movss %xmm1, 0x4(%r15)
pushq $0x9
popq %rdx
pushq $0xc
popq %rcx
movq %r14, %rdi
movq %r15, %rsi
movaps %xmm4, %xmm0
callq 0x63484
movss -0x34(%rbp), %xmm1
movaps -0x50(%rbp), %xmm0
subss %xmm0, %xmm1
movss -0x2c(%rbp), %xmm2
movss %xmm2, (%r15)
movss %xmm1, 0x4(%r15)
leaq -0x3c(%rbp), %rsi
pushq $0x3
popq %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0x63484
jmp 0x6c377
leaq -0x3c(%rbp), %r15
movss %xmm3, (%r15)
movss %xmm1, 0x4(%r15)
movaps 0x2fcbf(%rip), %xmm2    # 0x9bfe0
movaps %xmm0, %xmm1
movaps %xmm0, -0x80(%rbp)
xorps %xmm2, %xmm1
xorps %xmm5, %xmm2
pushq $0x3
popq %r12
movq %r14, %rdi
movq %r15, %rsi
movaps %xmm4, %xmm0
movl %r12d, %edx
callq 0x63550
movss -0x34(%rbp), %xmm1
movaps -0x50(%rbp), %xmm0
subss %xmm0, %xmm1
movss -0x2c(%rbp), %xmm2
movss %xmm2, (%r15)
movss %xmm1, 0x4(%r15)
leaq -0x3c(%rbp), %rsi
movq %r14, %rdi
movaps -0x70(%rbp), %xmm1
movaps -0x80(%rbp), %xmm2
movl %r12d, %edx
callq 0x63550
movq %r14, %rdi
movl %ebx, %esi
callq 0x4c35c
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq