// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::RenderTextClippedEx(ImDrawList*, ImVec2 const&, ImVec2 const&, char const*, char const*, ImVec2 const*, ImVec2 const&, ImRect const*)
void ImGui::RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_display_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect)
{
    // Perform CPU side clipping for single clipped element to avoid using scissor state
    ImVec2 pos = pos_min;
    const ImVec2 text_size = text_size_if_known ? *text_size_if_known : CalcTextSize(text, text_display_end, false, 0.0f);

    const ImVec2* clip_min = clip_rect ? &clip_rect->Min : &pos_min;
    const ImVec2* clip_max = clip_rect ? &clip_rect->Max : &pos_max;
    bool need_clipping = (pos.x + text_size.x >= clip_max->x) || (pos.y + text_size.y >= clip_max->y);
    if (clip_rect) // If we had no explicit clipping rectangle then pos==clip_min
        need_clipping |= (pos.x < clip_min->x) || (pos.y < clip_min->y);

    // Align whole block. We should defer that to the better rendering function when we'll have support for individual line alignment.
    if (align.x > 0.0f) pos.x = ImMax(pos.x, pos.x + (pos_max.x - pos.x - text_size.x) * align.x);
    if (align.y > 0.0f) pos.y = ImMax(pos.y, pos.y + (pos_max.y - pos.y - text_size.y) * align.y);

    // Render
    if (need_clipping)
    {
        ImVec4 fine_clip_rect(clip_min->x, clip_min->y, clip_max->x, clip_max->y);
        draw_list->AddText(NULL, 0.0f, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, &fine_clip_rect);
    }
    else
    {
        draw_list->AddText(NULL, 0.0f, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, NULL);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, -0x38(%rbp)
movq 0x18(%rbp), %r15
movq (%rsi), %rbx
movq %rbx, -0x30(%rbp)
movd %ebx, %xmm7
shrq $0x20, %rbx
testq %r9, %r9
movq %r8, -0x40(%rbp)
je 0x36486
movsd (%r9), %xmm0
jmp 0x364a0
xorps %xmm0, %xmm0
movq %r14, %rdi
movq %r8, %rsi
xorl %edx, %edx
movdqa %xmm7, -0x50(%rbp)
callq 0x365e8
movdqa -0x50(%rbp), %xmm7
movd %ebx, %xmm2
leaq 0x8(%r15), %rax
testq %r15, %r15
cmovneq %r15, %r12
cmoveq %r13, %rax
movaps %xmm0, %xmm3
addss %xmm7, %xmm3
movss (%rax), %xmm1
movb $0x1, %cl
ucomiss %xmm1, %xmm3
movaps %xmm0, %xmm3
shufps $0x55, %xmm0, %xmm3     # xmm3 = xmm3[1,1],xmm0[1,1]
jae 0x364da
movaps %xmm3, %xmm4
addss %xmm2, %xmm4
ucomiss 0x4(%rax), %xmm4
setae %cl
movq 0x10(%rbp), %rdx
testq %r15, %r15
je 0x36500
movss (%r15), %xmm4
movb $0x1, %sil
ucomiss %xmm7, %xmm4
ja 0x364fd
movss 0x4(%r15), %xmm4
ucomiss %xmm2, %xmm4
seta %sil
orb %sil, %cl
movss (%rdx), %xmm5
xorps %xmm4, %xmm4
ucomiss %xmm4, %xmm5
jbe 0x3653b
movss (%r13), %xmm6
subss %xmm7, %xmm6
subss %xmm0, %xmm6
mulss %xmm5, %xmm6
addss %xmm7, %xmm6
movaps %xmm6, %xmm0
cmpless %xmm7, %xmm0
movaps %xmm0, %xmm5
andnps %xmm6, %xmm5
andps %xmm7, %xmm0
orps %xmm5, %xmm0
movss %xmm0, -0x30(%rbp)
movss 0x4(%rdx), %xmm0
ucomiss %xmm4, %xmm0
jbe 0x36574
movss 0x4(%r13), %xmm4
subss %xmm2, %xmm4
subss %xmm3, %xmm4
mulss %xmm0, %xmm4
addss %xmm2, %xmm4
movaps %xmm4, %xmm0
cmpless %xmm2, %xmm0
movaps %xmm0, %xmm3
andnps %xmm4, %xmm3
andps %xmm2, %xmm0
orps %xmm3, %xmm0
movss %xmm0, -0x2c(%rbp)
testb %cl, %cl
je 0x365a7
movq (%r12), %rcx
movss 0x4(%rax), %xmm0
leaq -0x60(%rbp), %rbx
movq %rcx, (%rbx)
movss %xmm1, 0x8(%rbx)
movss %xmm0, 0xc(%rbx)
movss 0x65a5e(%rip), %xmm0    # 0x9bff8
xorl %edi, %edi
callq 0x35d33
movq %rbx, (%rsp)
jmp 0x365bb
movss 0x65a49(%rip), %xmm0    # 0x9bff8
xorl %edi, %edi
callq 0x35d33
andq $0x0, (%rsp)
leaq -0x30(%rbp), %rdx
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
movq -0x38(%rbp), %rdi
xorl %esi, %esi
movl %eax, %ecx
movq %r14, %r8
movq -0x40(%rbp), %r9
callq 0x64732
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq