// File: /workspace/github_cpp_makefile_star2_O2/donfreiday[P]gb/./imgui/imgui.cpp
// Function: LogRenderedText(ImVec2 const&, char const*, char const*)
static void LogRenderedText(const ImVec2& ref_pos, const char* text, const char* text_end)
{
    ImGuiState& g = *GImGui;
    ImGuiWindow* window = ImGui::GetCurrentWindowRead();

    if (!text_end)
        text_end = FindTextDisplayEnd(text, text_end);

    const bool log_new_line = ref_pos.y > window->DC.LogLinePosY+1;
    window->DC.LogLinePosY = ref_pos.y;

    const char* text_remaining = text;
    if (g.LogStartDepth > window->DC.TreeDepth)  // Re-adjust padding if we have popped out of our starting depth
        g.LogStartDepth = window->DC.TreeDepth;
    const int tree_depth = (window->DC.TreeDepth - g.LogStartDepth);
    for (;;)
    {
        // Split the string. Each new line (after a '\n') is followed by spacing corresponding to the current depth of our log entry.
        const char* line_end = text_remaining;
        while (line_end < text_end)
            if (*line_end == '\n')
                break;
            else
                line_end++;
        if (line_end >= text_end)
            line_end = NULL;

        const bool is_first_line = (text == text_remaining);
        bool is_last_line = false;
        if (line_end == NULL)
        {
            is_last_line = true;
            line_end = text_end;
        }
        if (line_end != NULL && !(is_last_line && (line_end - text_remaining)==0))
        {
            const int char_count = (int)(line_end - text_remaining);
            if (log_new_line || !is_first_line)
                ImGui::LogText(IM_NEWLINE "%*s%.*s", tree_depth*4, "", char_count, text_remaining);
            else
                ImGui::LogText(" %.*s", char_count, text_remaining);
        }

        if (is_last_line)
            break;
        text_remaining = line_end + 1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq 0x441c3(%rip), %r12     # 0x50480
movq 0x1758(%r12), %r13
testq %rdx, %rdx
jne 0xc2d7
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc24f
movq %rax, %r14
movss 0x4(%r15), %xmm0
movss 0xd8(%r13), %xmm1
movss %xmm1, -0x2c(%rbp)
movss %xmm0, -0x30(%rbp)
movss %xmm0, 0xd8(%r13)
movl 0x2c00(%r12), %eax
movl 0xdc(%r13), %r15d
cmpl %r15d, %eax
jle 0xc318
movl %r15d, 0x2c00(%r12)
movl %r15d, %eax
movss -0x2c(%rbp), %xmm0
addss 0x2a06b(%rip), %xmm0    # 0x36390
movss %xmm0, -0x2c(%rbp)
subl %eax, %r15d
shll $0x2, %r15d
movq %rbx, %r8
movq %r8, %r13
cmpq %r14, %r13
jae 0xc348
cmpb $0xa, (%r13)
je 0xc34b
incq %r13
jmp 0xc337
xorl %r13d, %r13d
testq %r13, %r13
sete %al
movq %r13, %r12
cmoveq %r14, %r12
testq %r12, %r12
sete %cl
cmpq %r8, %r12
sete %dl
andb %al, %dl
orb %cl, %dl
jne 0xc3ad
movl %r12d, %ecx
subl %r8d, %ecx
movss -0x30(%rbp), %xmm0
ucomiss -0x2c(%rbp), %xmm0
ja 0xc395
cmpq %rbx, %r8
jne 0xc395
leaq 0x2b870(%rip), %rdi     # 0x37bf7
movl %ecx, %esi
movq %r8, %rdx
xorl %eax, %eax
callq 0xc0ac
jmp 0xc3ad
leaq 0x2b852(%rip), %rdi     # 0x37bee
movl %r15d, %esi
leaq 0x2e283(%rip), %rdx     # 0x3a629
xorl %eax, %eax
callq 0xc0ac
incq %r12
movq %r12, %r8
testq %r13, %r13
jne 0xc334
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq