// File: /workspace/github_cpp_makefile_star2_O3/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 %rsi, %r14
movq %rdi, %rbx
movq 0x47444(%rip), %r12     # 0x55480
movq 0x1758(%r12), %r15
testq %rsi, %rsi
movss %xmm0, -0x2c(%rbp)
jne 0xe060
movq %rbx, %rdi
xorl %esi, %esi
callq 0xdfc4
movss -0x2c(%rbp), %xmm0
movq %rax, %r14
movss 0xd8(%r15), %xmm1
movss %xmm1, -0x30(%rbp)
movss %xmm0, 0xd8(%r15)
movl 0x2c00(%r12), %eax
movl 0xdc(%r15), %r15d
cmpl %r15d, %eax
jle 0xe096
movl %r15d, 0x2c00(%r12)
movl %r15d, %eax
movss -0x30(%rbp), %xmm1
addss 0x2f2ed(%rip), %xmm1    # 0x3d390
movss %xmm1, -0x30(%rbp)
subl %eax, %r15d
shll $0x2, %r15d
movq %rbx, %r8
cmpq %r14, %r8
jae 0xe0cf
movq %r14, %rax
subq %r8, %rax
movq %r8, %r13
cmpb $0xa, (%r13)
je 0xe0d2
incq %r13
decq %rax
jne 0xe0c0
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 0xe134
movl %r12d, %ecx
subl %r8d, %ecx
ucomiss -0x30(%rbp), %xmm0
ja 0xe117
cmpq %rbx, %r8
jne 0xe117
leaq 0x30b01(%rip), %rdi     # 0x3ec0a
movl %ecx, %esi
movq %r8, %rdx
xorl %eax, %eax
callq 0xde0d
jmp 0xe12f
leaq 0x30ae3(%rip), %rdi     # 0x3ec01
movl %r15d, %esi
leaq 0x33311(%rip), %rdx     # 0x41439
xorl %eax, %eax
callq 0xde0d
movss -0x2c(%rbp), %xmm0
incq %r12
movq %r12, %r8
testq %r13, %r13
jne 0xe0b2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq