// File: /workspace/github_cpp_makefile_star2_O2/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::TextUnformatted(char const*, char const*)
void ImGui::TextUnformatted(const char* text, const char* text_end)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return;

    ImGuiState& g = *GImGui;
    IM_ASSERT(text != NULL);
    const char* text_begin = text;
    if (text_end == NULL)
        text_end = text + strlen(text); // FIXME-OPT

    const float wrap_pos_x = window->DC.TextWrapPos;
    const bool wrap_enabled = wrap_pos_x >= 0.0f;
    if (text_end - text > 2000 && !wrap_enabled)
    {
        // Long text!
        // Perform manual coarse clipping to optimize for long multi-line text
        // From this point we will only compute the width of lines that are visible. Optimization only available when word-wrapping is disabled.
        // We also don't vertically center the text within the line full height, which is unlikely to matter because we are likely the biggest and only item on the line.
        const char* line = text;
        const float line_height = ImGui::GetTextLineHeight();
        const ImVec2 text_pos = window->DC.CursorPos + ImVec2(0.0f, window->DC.CurrentLineTextBaseOffset);
        const ImRect clip_rect = window->ClipRect;
        ImVec2 text_size(0,0);

        if (text_pos.y <= clip_rect.Max.y)
        {
            ImVec2 pos = text_pos;

            // Lines to skip (can't skip when logging text)
            if (!g.LogEnabled)
            {
                int lines_skippable = (int)((clip_rect.Min.y - text_pos.y) / line_height);
                if (lines_skippable > 0)
                {
                    int lines_skipped = 0;
                    while (line < text_end && lines_skipped < lines_skippable)
                    {
                        const char* line_end = strchr(line, '\n');
                        line = line_end + 1;
                        lines_skipped++;
                    }
                    pos.y += lines_skipped * line_height;
                }
            }

            // Lines to render
            if (line < text_end)
            {
                ImRect line_rect(pos, pos + ImVec2(ImGui::GetWindowWidth(), line_height));
                while (line < text_end)
                {
                    const char* line_end = strchr(line, '\n');
                    if (IsClippedEx(line_rect, NULL, false))
                        break;

                    const ImVec2 line_size = CalcTextSize(line, line_end, false);
                    text_size.x = ImMax(text_size.x, line_size.x);
                    RenderText(pos, line, line_end, false);
                    if (!line_end)
                        line_end = text_end;
                    line = line_end + 1;
                    line_rect.Min.y += line_height;
                    line_rect.Max.y += line_height;
                    pos.y += line_height;
                }

                // Count remaining lines
                int lines_skipped = 0;
                while (line < text_end)
                {
                    const char* line_end = strchr(line, '\n');
                    if (!line_end)
                        line_end = text_end;
                    line = line_end + 1;
                    lines_skipped++;
                }
                pos.y += lines_skipped * line_height;
            }

            text_size.y += (pos - text_pos).y;
        }

        ImRect bb(text_pos, text_pos + text_size);
        ItemSize(bb);
        ItemAdd(bb, NULL);
    }
    else
    {
        const float wrap_width = wrap_enabled ? CalcWrapWidthForPos(window->DC.CursorPos, wrap_pos_x) : 0.0f;
        const ImVec2 text_size = CalcTextSize(text_begin, text_end, false, wrap_width);

        // Account of baseline offset
        ImVec2 text_pos = window->DC.CursorPos;
        text_pos.y += window->DC.CurrentLineTextBaseOffset;

        ImRect bb(text_pos, text_pos + text_size);
        ItemSize(text_size);
        if (!ItemAdd(bb, NULL))
            return;

        // Render (we don't hide text after ## in this end-user function)
        RenderTextWrapped(bb.Min, text_begin, text_end, wrap_width);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq 0x448c4(%rip), %r15     # 0x50480
movq 0x1758(%r15), %r12
movb $0x1, 0x72(%r12)
cmpb $0x0, 0x74(%r12)
jne 0xbf49
movq %rdi, %r14
testq %rdi, %rdi
je 0xbf5b
movq %rsi, %rbx
testq %rsi, %rsi
jne 0xbbf7
movq %r14, %rdi
callq 0x7300
movq %rax, %rbx
addq %r14, %rbx
movss 0x120(%r12), %xmm0
movq %rbx, %rax
subq %r14, %rax
cmpq $0x7d1, %rax            # imm = 0x7D1
jl 0xbc89
xorps %xmm2, %xmm2
ucomiss %xmm2, %xmm0
jae 0xbc89
movss 0xa8(%r12), %xmm0
addss %xmm2, %xmm0
movss 0xcc(%r12), %xmm1
addss 0xac(%r12), %xmm1
movaps %xmm0, -0xa0(%rbp)
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps %xmm0, -0x60(%rbp)
movss 0x1ec(%r12), %xmm0
ucomiss %xmm1, %xmm0
movaps %xmm1, %xmm0
xorps %xmm3, %xmm3
jb 0xbf11
movss 0x1718(%r15), %xmm2
cmpb $0x0, 0x2be8(%r15)
movss %xmm2, -0x2c(%rbp)
movaps %xmm0, -0x70(%rbp)
je 0xbd35
movaps -0x60(%rbp), %xmm3
jmp 0xbda5
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0xbca1
leaq 0xa8(%r12), %rdi
callq 0xa045
movaps %xmm0, %xmm1
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movss %xmm1, -0x50(%rbp)
movaps %xmm1, %xmm0
callq 0xc6e3
leaq -0xa8(%rbp), %rdi
movlps %xmm0, (%rdi)
movl 0xa8(%r12), %eax
movss 0xac(%r12), %xmm1
movd %eax, %xmm2
addss 0xcc(%r12), %xmm1
addss %xmm0, %xmm2
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss %xmm1, %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
leaq -0x40(%rbp), %r15
movl %eax, (%r15)
movss %xmm1, 0x4(%r15)
movlps %xmm2, 0x8(%r15)
xorps %xmm0, %xmm0
callq 0x99d9
movq %r15, %rdi
xorl %esi, %esi
callq 0x9b28
testb %al, %al
je 0xbf49
movsd -0x40(%rbp), %xmm0
movq %r14, %rdi
movq %rbx, %rsi
movss -0x50(%rbp), %xmm1
callq 0xc3cb
jmp 0xbf49
movaps %xmm0, %xmm1
movss 0x1e4(%r12), %xmm0
subss %xmm1, %xmm0
divss %xmm2, %xmm0
cvttss2si %xmm0, %r13d
testl %r13d, %r13d
jle 0xbd9d
xorl %r15d, %r15d
cmpq %rbx, %r14
jae 0xbd7c
cmpl %r13d, %r15d
jge 0xbd7c
movq %r14, %rdi
pushq $0xa
popq %rsi
callq 0x73f0
movss -0x2c(%rbp), %xmm2
movq %rax, %r14
incq %r14
incl %r15d
jmp 0xbd57
cvtsi2ss %r15d, %xmm3
mulss %xmm2, %xmm3
movaps -0x70(%rbp), %xmm1
addss %xmm1, %xmm3
movaps -0x60(%rbp), %xmm0
movlhps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm3     # xmm3 = xmm3[2,0],xmm0[2,3]
movaps %xmm1, %xmm0
jmp 0xbda5
movaps -0x60(%rbp), %xmm3
movaps -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
cmpq %rbx, %r14
jae 0xbf02
movss 0x20(%r12), %xmm0
addss %xmm3, %xmm0
movaps %xmm3, %xmm1
shufps $0x55, %xmm3, %xmm1     # xmm1 = xmm1[1,1],xmm3[1,1]
addss %xmm2, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps %xmm3, %xmm1
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
leaq -0x40(%rbp), %r15
movups %xmm1, (%r15)
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
pushq $0xa
popq %r12
movaps %xmm3, -0x50(%rbp)
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
movaps %xmm3, -0x90(%rbp)
cmpq %rbx, %r14
jae 0xbeac
movq %r14, %rdi
movl %r12d, %esi
callq 0x73f0
movq %rax, %r13
movq %r15, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x9c0b
testb %al, %al
jne 0xbeac
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
movss 0x2a56f(%rip), %xmm0    # 0x3639c
callq 0xc6e3
movaps %xmm0, %xmm3
movaps -0x80(%rbp), %xmm2
cmpless %xmm2, %xmm3
movaps %xmm3, %xmm1
andnps %xmm0, %xmm1
andps %xmm2, %xmm3
orps %xmm1, %xmm3
movaps %xmm3, -0x80(%rbp)
movaps -0x50(%rbp), %xmm0
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0xc16e
testq %r13, %r13
cmoveq %rbx, %r13
incq %r13
movss -0x3c(%rbp), %xmm0
movss -0x2c(%rbp), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x3c(%rbp)
movss -0x34(%rbp), %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x34(%rbp)
movaps -0x90(%rbp), %xmm3
addss %xmm1, %xmm3
movaps -0x50(%rbp), %xmm0
movlhps %xmm0, %xmm3            # xmm3 = xmm3[0],xmm0[0]
shufps $0xe2, %xmm0, %xmm3     # xmm3 = xmm3[2,0],xmm0[2,3]
movaps %xmm3, -0x50(%rbp)
movq %r13, %r14
jmp 0xbde7
xorl %r12d, %r12d
pushq $0xa
popq %r15
cmpq %rbx, %r14
jae 0xbed5
movq %r14, %rdi
movl %r15d, %esi
callq 0x73f0
movq %rax, %r14
testq %rax, %rax
cmoveq %rbx, %r14
incq %r14
incl %r12d
jmp 0xbeb3
cvtsi2ss %r12d, %xmm0
mulss -0x2c(%rbp), %xmm0
addss -0x90(%rbp), %xmm0
movaps -0x50(%rbp), %xmm1
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movaps %xmm0, %xmm3
movaps -0x70(%rbp), %xmm0
xorps %xmm1, %xmm1
movaps -0x80(%rbp), %xmm2
jmp 0xbf05
xorps %xmm2, %xmm2
shufps $0x55, %xmm3, %xmm3     # xmm3 = xmm3[1,1,1,1]
subss %xmm0, %xmm3
addss %xmm1, %xmm3
movaps %xmm0, %xmm1
movaps -0xa0(%rbp), %xmm0
addss %xmm2, %xmm0
addss %xmm3, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps -0x60(%rbp), %xmm1
movlhps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0]
leaq -0x40(%rbp), %rbx
movups %xmm1, (%rbx)
xorps %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9af8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9b28
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b1cb(%rip), %rdi     # 0x3712d
leaq 0x2a704(%rip), %rsi     # 0x3666d
leaq 0x2b1cc(%rip), %rcx     # 0x3713c
movl $0x133d, %edx           # imm = 0x133D
callq 0x7140