// File: /workspace/github_cpp_makefile_star2_O1/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 %r8, %rbx
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, -0x38(%rbp)
movq 0x18(%rbp), %r15
movq (%rsi), %rax
movq %rax, -0x30(%rbp)
testq %r9, %r9
je 0x452a5
movsd (%r9), %xmm0
jmp 0x452fc
movq 0xb8a24(%rip), %rax     # 0xfdcd0
movss 0x1980(%rax), %xmm0
cmpq %r14, %rbx
je 0x452f1
movq 0x1978(%rax), %rdi
movss 0x72578(%rip), %xmm1    # 0xb7840
xorps %xmm2, %xmm2
movq %r14, %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x8359c
movss 0x7257c(%rip), %xmm1    # 0xb785c
addss %xmm0, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
jmp 0x452fc
movq %xmm0, %xmm0            # xmm0 = xmm0[0],zero
xorps %xmm1, %xmm1
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
testq %r15, %r15
cmovneq %r15, %r12
leaq 0x8(%r15), %rax
cmoveq %r13, %rax
movss -0x30(%rbp), %xmm3
movaps %xmm3, %xmm2
addss %xmm0, %xmm2
movss (%rax), %xmm1
movb $0x1, %cl
ucomiss %xmm1, %xmm2
movaps %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm2     # xmm2 = xmm2[1,1],xmm0[1,1]
jae 0x45339
movss -0x2c(%rbp), %xmm4
addss %xmm2, %xmm4
ucomiss 0x4(%rax), %xmm4
setae %cl
movq 0x10(%rbp), %rdx
testq %r15, %r15
je 0x45362
movss (%r12), %xmm4
movb $0x1, %sil
ucomiss %xmm3, %xmm4
ja 0x4535f
movss 0x4(%r12), %xmm4
ucomiss -0x2c(%rbp), %xmm4
seta %sil
orb %sil, %cl
movss (%rdx), %xmm5
xorps %xmm4, %xmm4
ucomiss %xmm4, %xmm5
jbe 0x4539d
movss (%r13), %xmm6
subss %xmm3, %xmm6
subss %xmm0, %xmm6
mulss %xmm5, %xmm6
addss %xmm3, %xmm6
movaps %xmm6, %xmm0
cmpless %xmm3, %xmm0
movaps %xmm0, %xmm5
andnps %xmm6, %xmm5
andps %xmm3, %xmm0
orps %xmm5, %xmm0
movss %xmm0, -0x30(%rbp)
movss 0x4(%rdx), %xmm0
ucomiss %xmm4, %xmm0
jbe 0x453db
movss -0x2c(%rbp), %xmm3
movss 0x4(%r13), %xmm4
subss %xmm3, %xmm4
subss %xmm2, %xmm4
mulss %xmm0, %xmm4
addss %xmm3, %xmm4
movaps %xmm4, %xmm0
cmpless %xmm3, %xmm0
movaps %xmm0, %xmm2
andnps %xmm4, %xmm2
andps %xmm3, %xmm0
orps %xmm2, %xmm0
movss %xmm0, -0x2c(%rbp)
testb %cl, %cl
je 0x4542d
movq (%r12), %rcx
movss 0x4(%rax), %xmm0
leaq -0x60(%rbp), %r15
movq %rcx, (%r15)
movss %xmm1, 0x8(%r15)
movss %xmm0, 0xc(%r15)
movq 0xb88ce(%rip), %rax     # 0xfdcd0
movups 0x1624(%rax), %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x1560(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x42e9e
movq %r15, (%rsp)
jmp 0x45461
movq 0xb889c(%rip), %rax     # 0xfdcd0
movups 0x1624(%rax), %xmm0
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movss 0x1560(%rax), %xmm0
mulss 0xc(%rdi), %xmm0
movss %xmm0, 0xc(%rdi)
callq 0x42e9e
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 %rbx, %r9
callq 0x7ae8c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq