// File: /workspace/github_cpp_makefile_star2_O3/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 $0x58, %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 0x4483d
movsd (%r9), %xmm0
jmp 0x4489e
movq 0xb748c(%rip), %rax     # 0xfbcd0
movss 0x1980(%rax), %xmm0
cmpq %r14, %r8
je 0x44893
movq 0x1978(%rax), %rdi
movss 0x70fe0(%rip), %xmm1    # 0xb5840
xorps %xmm2, %xmm2
movq %r14, %rsi
movq %r8, %rdx
xorl %ecx, %ecx
movdqa %xmm7, -0x50(%rbp)
callq 0x81a68
movdqa -0x50(%rbp), %xmm7
movss 0x70fda(%rip), %xmm1    # 0xb585c
addss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
jmp 0x4489e
movq %xmm0, %xmm0            # xmm0 = xmm0[0],zero
xorps %xmm1, %xmm1
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
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 0x448d8
movaps %xmm3, %xmm4
addss %xmm2, %xmm4
ucomiss 0x4(%rax), %xmm4
setae %cl
movq 0x10(%rbp), %rdx
testq %r15, %r15
je 0x448fe
movss (%r15), %xmm4
movb $0x1, %sil
ucomiss %xmm7, %xmm4
ja 0x448fb
movss 0x4(%r15), %xmm4
ucomiss %xmm2, %xmm4
seta %sil
orb %sil, %cl
movss (%rdx), %xmm5
xorps %xmm4, %xmm4
ucomiss %xmm4, %xmm5
jbe 0x44939
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 0x44972
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 0x449c2
movq (%r12), %rcx
movss 0x4(%rax), %xmm0
leaq -0x70(%rbp), %rbx
movq %rcx, (%rbx)
movss %xmm1, 0x8(%rbx)
movss %xmm0, 0xc(%rbx)
movq 0xb7339(%rip), %rax     # 0xfbcd0
movups 0x1624(%rax), %xmm0
leaq -0x60(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x1560(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x42601
movq %rbx, (%rsp)
jmp 0x449f6
movq 0xb7307(%rip), %rax     # 0xfbcd0
movups 0x1624(%rax), %xmm0
leaq -0x60(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x1560(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x42601
movq $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 0x79640
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq