// File: /workspace/github_cpp_makefile_star2_O2/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::RenderTextClipped(ImVec2 const&, ImVec2 const&, char const*, char const*, ImVec2 const*, int, ImVec2 const*, ImVec2 const*)
void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, ImGuiAlign align, const ImVec2* clip_min, const ImVec2* clip_max)
{
    // Hide anything after a '##' string
    const char* text_display_end = FindTextDisplayEnd(text, text_end);
    const int text_len = (int)(text_display_end - text);
    if (text_len == 0)
        return;

    ImGuiState& g = *GImGui;
    ImGuiWindow* window = GetCurrentWindow();

    // 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 : ImGui::CalcTextSize(text, text_display_end, false, 0.0f);

    if (!clip_max) clip_max = &pos_max;
    bool need_clipping = (pos.x + text_size.x >= clip_max->x) || (pos.y + text_size.y >= clip_max->y);
    if (!clip_min) clip_min = &pos_min; else need_clipping |= (pos.x < clip_min->x) || (pos.y < clip_min->y);

    // Align
    if (align & ImGuiAlign_Center) pos.x = ImMax(pos.x, (pos.x + pos_max.x - text_size.x) * 0.5f);
    else if (align & ImGuiAlign_Right) pos.x = ImMax(pos.x, pos_max.x - text_size.x);
    if (align & ImGuiAlign_VCenter) pos.y = ImMax(pos.y, (pos.y + pos_max.y - text_size.y) * 0.5f);

    // Render
    if (need_clipping)
    {
        ImVec4 fine_clip_rect(clip_min->x, clip_min->y, clip_max->x, clip_max->y);
        window->DrawList->AddText(g.Font, g.FontSize, pos, window->Color(ImGuiCol_Text), text, text_display_end, 0.0f, &fine_clip_rect);
    }
    else
    {
        window->DrawList->AddText(g.Font, g.FontSize, pos, window->Color(ImGuiCol_Text), text, text_display_end, 0.0f, NULL);
    }
    if (g.LogEnabled)
        LogRenderedText(pos, text, text_display_end);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl %r9d, -0x2c(%rbp)
movq %r8, %r15
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r14
movq %rdx, %rdi
movq %rcx, %rsi
callq 0xc24f
cmpl %r12d, %eax
je 0xc6d4
movq %r12, -0x40(%rbp)
movq %rax, -0x48(%rbp)
movq 0x18(%rbp), %r12
movq 0x43f99(%rip), %rax     # 0x50480
movq %rax, -0x50(%rbp)
movq 0x1758(%rax), %rdi
movb $0x1, 0x72(%rdi)
movq (%r14), %r13
movq %r13, -0x38(%rbp)
movd %r13d, %xmm6
shrq $0x20, %r13
testq %r15, %r15
je 0xc512
movsd (%r15), %xmm0
jmp 0xc534
xorps %xmm0, %xmm0
movq %rdi, %r15
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
xorl %edx, %edx
movdqa %xmm6, -0x60(%rbp)
callq 0xc6e3
movdqa -0x60(%rbp), %xmm6
movq %r15, %rdi
movq 0x10(%rbp), %rax
movd %r13d, %xmm2
testq %r12, %r12
cmoveq %rbx, %r12
movaps %xmm0, %xmm3
addss %xmm6, %xmm3
movss (%r12), %xmm1
movb $0x1, %cl
ucomiss %xmm1, %xmm3
movaps %xmm0, %xmm3
shufps $0x55, %xmm0, %xmm3     # xmm3 = xmm3[1,1],xmm0[1,1]
movl -0x2c(%rbp), %esi
jae 0xc572
movaps %xmm3, %xmm4
addss %xmm2, %xmm4
ucomiss 0x4(%r12), %xmm4
setae %cl
testq %rax, %rax
movq -0x50(%rbp), %r13
je 0xc595
movss (%rax), %xmm4
movb $0x1, %dl
ucomiss %xmm6, %xmm4
ja 0xc591
movss 0x4(%rax), %xmm4
ucomiss %xmm2, %xmm4
seta %dl
orb %dl, %cl
jmp 0xc598
movq %r14, %rax
testb $0x2, %sil
jne 0xc5ae
testb $0x4, %sil
je 0xc5db
movss (%rbx), %xmm4
subss %xmm0, %xmm4
jmp 0xc5c2
movss (%rbx), %xmm4
addss %xmm6, %xmm4
subss %xmm0, %xmm4
mulss 0x29e0e(%rip), %xmm4    # 0x363d0
movaps %xmm4, %xmm0
cmpless %xmm6, %xmm0
movaps %xmm0, %xmm5
andnps %xmm4, %xmm5
andps %xmm6, %xmm0
orps %xmm5, %xmm0
movss %xmm0, -0x38(%rbp)
testb $0x10, %sil
je 0xc60f
movss 0x4(%rbx), %xmm0
addss %xmm2, %xmm0
subss %xmm3, %xmm0
mulss 0x29dda(%rip), %xmm0    # 0x363d0
movaps %xmm0, %xmm3
cmpless %xmm2, %xmm3
movaps %xmm3, %xmm4
andnps %xmm0, %xmm4
andps %xmm2, %xmm3
orps %xmm4, %xmm3
movss %xmm3, -0x34(%rbp)
testb %cl, %cl
je 0xc664
movq (%rax), %rax
movss 0x4(%r12), %xmm0
leaq -0x70(%rbp), %r12
movq %rax, (%r12)
movss %xmm1, 0x8(%r12)
movss %xmm0, 0xc(%r12)
movq 0x270(%rdi), %r14
movq 0x1710(%r13), %r15
movss 0x1718(%r13), %xmm0
movss %xmm0, -0x2c(%rbp)
movss 0x29d39(%rip), %xmm0    # 0x36390
xorl %esi, %esi
callq 0x1eae4
movq %r12, (%rsp)
jmp 0xc694
movq 0x270(%rdi), %r14
movq 0x1710(%r13), %r15
movss 0x1718(%r13), %xmm0
movss %xmm0, -0x2c(%rbp)
movss 0x29d08(%rip), %xmm0    # 0x36390
xorl %esi, %esi
callq 0x1eae4
andq $0x0, (%rsp)
leaq -0x38(%rbp), %rdx
xorps %xmm1, %xmm1
movq %r14, %rdi
movq %r15, %rsi
movss -0x2c(%rbp), %xmm0
movl %eax, %ecx
movq -0x40(%rbp), %rbx
movq %rbx, %r8
movq -0x48(%rbp), %r14
movq %r14, %r9
callq 0x29d4c
cmpb $0x1, 0x2be8(%r13)
jne 0xc6d4
leaq -0x38(%rbp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0xc29f
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq