// File: 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:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movss %xmm0, -0x18(%rbp)
movss %xmm1, -0x1c(%rbp)
movss %xmm2, -0x20(%rbp)
movss -0x1c(%rbp), %xmm0
ucomiss -0x18(%rbp), %xmm0
jne 0x11d6c7
jp 0x11d6c7
jmp 0x11dcfe
movss -0x18(%rbp), %xmm0
ucomiss -0x1c(%rbp), %xmm0
jbe 0x11d6df
leaq -0x18(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x11dd10
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm1
movss -0x18(%rbp), %xmm2
callq 0x11dd50
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm1
leaq -0x28(%rbp), %rdi
callq 0xbf4c0
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm1
movss -0x1c(%rbp), %xmm2
callq 0x11dd50
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm1
leaq -0x30(%rbp), %rdi
callq 0xbf4c0
movss -0x20(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x11d76a
jp 0x11d76a
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %ecx
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
xorps %xmm0, %xmm0
movl $0xf, %r8d
callq 0x113090
jmp 0x11dcfe
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
movq -0x10(%rbp), %rax
subss (%rax), %xmm0
movss 0x54855(%rip), %xmm1    # 0x171fd8
mulss %xmm1, %xmm0
movq -0x10(%rbp), %rax
movss 0xc(%rax), %xmm1
movq -0x10(%rbp), %rax
subss 0x4(%rax), %xmm1
movss 0x54837(%rip), %xmm2    # 0x171fd8
mulss %xmm2, %xmm1
callq 0x112de0
movss 0x5348a(%rip), %xmm1    # 0x170c3c
subss %xmm1, %xmm0
movss -0x20(%rbp), %xmm2
xorps %xmm1, %xmm1
callq 0x1158e0
movss %xmm0, -0x20(%rbp)
movss 0x5346c(%rip), %xmm0    # 0x170c3c
divss -0x20(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movss -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
subss (%rax), %xmm0
movss -0x34(%rbp), %xmm1
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm1, %xmm0
movss 0x53437(%rip), %xmm1    # 0x170c3c
addss %xmm1, %xmm0
callq 0x11dd90
movss %xmm0, -0x38(%rbp)
movss -0x30(%rbp), %xmm0
movq -0x10(%rbp), %rax
subss (%rax), %xmm0
movss -0x34(%rbp), %xmm1
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm1, %xmm0
movss 0x533fe(%rip), %xmm1    # 0x170c3c
addss %xmm1, %xmm0
callq 0x11dd90
movss %xmm0, -0x3c(%rbp)
movss 0x54f48(%rip), %xmm0    # 0x17279c
movss %xmm0, -0x40(%rbp)
movss -0x28(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss (%rax), %xmm1
addss -0x20(%rbp), %xmm1
callq 0x10f610
movss %xmm0, -0x44(%rbp)
movss -0x38(%rbp), %xmm0
ucomiss -0x3c(%rbp), %xmm0
jne 0x11d8e3
jp 0x11d8e3
movq -0x8(%rbp), %rax
movq %rax, -0xc0(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
leaq -0x4c(%rbp), %rdi
callq 0xbf4c0
movq -0xc0(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0xee560
movq -0x8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
leaq -0x54(%rbp), %rdi
callq 0xbf4c0
movq -0xb8(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xee560
jmp 0x11da4f
movss -0x38(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x11d99f
jp 0x11d99f
movss -0x3c(%rbp), %xmm0
movss 0x54e95(%rip), %xmm1    # 0x17279c
ucomiss %xmm1, %xmm0
jne 0x11d99f
jp 0x11d99f
movq -0x8(%rbp), %rax
movq %rax, -0xd0(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
subss -0x20(%rbp), %xmm1
leaq -0x5c(%rbp), %rdi
callq 0xbf4c0
movq -0xd0(%rbp), %rdi
movss -0x20(%rbp), %xmm0
leaq -0x5c(%rbp), %rsi
movl $0x3, %edx
movl $0x6, %ecx
callq 0x111da0
movq -0x8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
addss -0x20(%rbp), %xmm1
leaq -0x64(%rbp), %rdi
callq 0xbf4c0
movq -0xc8(%rbp), %rdi
movss -0x20(%rbp), %xmm0
leaq -0x64(%rbp), %rsi
movl $0x6, %edx
movl $0x9, %ecx
callq 0x111da0
jmp 0x11da4d
movq -0x8(%rbp), %rax
movq %rax, -0xe0(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
subss -0x20(%rbp), %xmm1
leaq -0x6c(%rbp), %rdi
callq 0xbf4c0
movq -0xe0(%rbp), %rdi
movss -0x20(%rbp), %xmm0
movss 0x54dc2(%rip), %xmm1    # 0x172798
subss -0x3c(%rbp), %xmm1
movss 0x54db5(%rip), %xmm2    # 0x172798
subss -0x38(%rbp), %xmm2
leaq -0x6c(%rbp), %rsi
movl $0x3, %edx
callq 0x111ec0
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
addss -0x20(%rbp), %xmm1
leaq -0x74(%rbp), %rdi
callq 0xbf4c0
movq -0xd8(%rbp), %rdi
movss -0x20(%rbp), %xmm0
movss 0x54d6b(%rip), %xmm1    # 0x172798
addss -0x38(%rbp), %xmm1
movss 0x54d5e(%rip), %xmm2    # 0x172798
addss -0x3c(%rbp), %xmm2
leaq -0x74(%rbp), %rsi
movl $0x3, %edx
callq 0x111ec0
jmp 0x11da4f
movss -0x30(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss (%rax), %xmm1
addss -0x20(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x11dcf2
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
subss -0x30(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm1, %xmm0
movss 0x531a6(%rip), %xmm1    # 0x170c3c
addss %xmm1, %xmm0
callq 0x11dd90
movss %xmm0, -0x78(%rbp)
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm0
subss -0x28(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm1, %xmm0
movss 0x5316c(%rip), %xmm1    # 0x170c3c
addss %xmm1, %xmm0
callq 0x11dd90
movss %xmm0, -0x7c(%rbp)
movss -0x30(%rbp), %xmm0
movq -0x10(%rbp), %rax
movss 0x8(%rax), %xmm1
subss -0x20(%rbp), %xmm1
callq 0x112de0
movss %xmm0, -0x80(%rbp)
movss -0x78(%rbp), %xmm0
ucomiss -0x7c(%rbp), %xmm0
jne 0x11db75
jp 0x11db75
movq -0x8(%rbp), %rax
movq %rax, -0xf0(%rbp)
movss -0x80(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
leaq -0x88(%rbp), %rdi
callq 0xbf4c0
movq -0xf0(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0xee560
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
movss -0x80(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
leaq -0x90(%rbp), %rdi
callq 0xbf4c0
movq -0xe8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xee560
jmp 0x11dcf0
movss -0x78(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x11dc3a
jp 0x11dc3a
movss -0x7c(%rbp), %xmm0
movss 0x54c03(%rip), %xmm1    # 0x17279c
ucomiss %xmm1, %xmm0
jne 0x11dc3a
jp 0x11dc3a
movq -0x8(%rbp), %rax
movq %rax, -0x100(%rbp)
movss -0x80(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
addss -0x20(%rbp), %xmm1
leaq -0x98(%rbp), %rdi
callq 0xbf4c0
movq -0x100(%rbp), %rdi
movss -0x20(%rbp), %xmm0
leaq -0x98(%rbp), %rsi
movl $0x9, %edx
movl $0xc, %ecx
callq 0x111da0
movq -0x8(%rbp), %rax
movq %rax, -0xf8(%rbp)
movss -0x80(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
subss -0x20(%rbp), %xmm1
leaq -0xa0(%rbp), %rdi
callq 0xbf4c0
movq -0xf8(%rbp), %rdi
movss -0x20(%rbp), %xmm0
leaq -0xa0(%rbp), %rsi
xorl %edx, %edx
movl $0x3, %ecx
callq 0x111da0
jmp 0x11dcee
movq -0x8(%rbp), %rax
movq %rax, -0x110(%rbp)
movss -0x80(%rbp), %xmm0
movss -0x24(%rbp), %xmm1
addss -0x20(%rbp), %xmm1
leaq -0xa8(%rbp), %rdi
callq 0xbf4c0
movq -0x110(%rbp), %rdi
movss -0x20(%rbp), %xmm0
movss -0x7c(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
movss -0x78(%rbp), %xmm2
movd %xmm2, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm2
leaq -0xa8(%rbp), %rsi
movl $0x3, %edx
callq 0x111ec0
movq -0x8(%rbp), %rax
movq %rax, -0x108(%rbp)
movss -0x80(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
subss -0x20(%rbp), %xmm1
leaq -0xb0(%rbp), %rdi
callq 0xbf4c0
movq -0x108(%rbp), %rdi
movss -0x20(%rbp), %xmm0
movss -0x78(%rbp), %xmm1
movss -0x7c(%rbp), %xmm2
leaq -0xb0(%rbp), %rsi
movl $0x3, %edx
callq 0x111ec0
jmp 0x11dcf0
jmp 0x11dcf2
movq -0x8(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0xee590
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw (%rax,%rax)