// File: donfreiday[P]gb/./imgui/imgui_demo.cpp
// Function: ShowExampleAppLongText(bool*)
static void ShowExampleAppLongText(bool* opened)
{
    ImGui::SetNextWindowSize(ImVec2(520,600), ImGuiSetCond_FirstUseEver);
    if (!ImGui::Begin("Example: Long text display", opened))
    {
        ImGui::End();
        return;
    }

    static int test_type = 0;
    static ImGuiTextBuffer log;
    static int lines = 0;
    ImGui::Text("Printing unusually long amount of text.");
    ImGui::Combo("Test type", &test_type, "Single call to TextUnformatted()\0Multiple calls to Text(), clipped manually\0Multiple calls to Text(), not clipped\0");
    ImGui::Text("Buffer contents: %d lines, %d bytes", lines, log.size());
    if (ImGui::Button("Clear")) { log.clear(); lines = 0; }
    ImGui::SameLine();
    if (ImGui::Button("Add 1000 lines"))
    {
        for (int i = 0; i < 1000; i++)
            log.append("%i The quick brown fox jumps over the lazy dog\n", lines+i);
        lines += 1000;
    }
    ImGui::BeginChild("Log");
    switch (test_type)
    {
    case 0:
        // Single call to TextUnformatted() with a big buffer
        ImGui::TextUnformatted(log.begin(), log.end());
        break;
    case 1:
        {
            // Multiple calls to Text(), manually coarsely clipped - demonstrate how to use the ImGuiListClipper helper.
            ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
            ImGuiListClipper clipper(lines, ImGui::GetTextLineHeight());
            for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
                ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
            clipper.End();
            ImGui::PopStyleVar();
            break;
        }
    case 2:
        // Multiple calls to Text(), not clipped (slow)
        ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0,0));
        for (int i = 0; i < lines; i++)
            ImGui::Text("%i The quick brown fox jumps over the lazy dog\n", i);
        ImGui::PopStyleVar();
        break;
    }
    ImGui::EndChild();
    ImGui::End();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x10(%rbp), %rdi
movss 0x24825(%rip), %xmm0    # 0x5d600
movss 0x247d1(%rip), %xmm1    # 0x5d5b4
callq 0x2d280
leaq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0xe790
movq -0x8(%rbp), %rsi
leaq 0x275f8(%rip), %rdi     # 0x603f9
xorl %edx, %edx
callq 0xe7e0
testb $0x1, %al
jne 0x38e16
callq 0xee30
jmp 0x39110
cmpb $0x0, 0x4adeb(%rip)     # 0x83c08
jne 0x38e64
leaq 0x4ade2(%rip), %rdi     # 0x83c08
callq 0x72e0
cmpl $0x0, %eax
je 0x38e64
leaq 0x4adc1(%rip), %rdi     # 0x83bf8
callq 0x2e3b0
jmp 0x38e3e
leaq -0xa605(%rip), %rdi     # 0x2e840
leaq 0x4adac(%rip), %rsi     # 0x83bf8
leaq 0x40665(%rip), %rdx     # 0x794b8
callq 0x76b0
leaq 0x4ada9(%rip), %rdi     # 0x83c08
callq 0x7460
leaq 0x275a9(%rip), %rdi     # 0x60414
movb $0x0, %al
callq 0x1a220
leaq 0x275c3(%rip), %rdi     # 0x6043c
leaq 0x4ad74(%rip), %rsi     # 0x83bf4
leaq 0x276c0(%rip), %rdx     # 0x60547
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x27000
movl 0x4ad79(%rip), %eax     # 0x83c10
movl %eax, -0x64(%rbp)
leaq 0x4ad57(%rip), %rdi     # 0x83bf8
callq 0x2fd70
movl -0x64(%rbp), %esi
movl %eax, %edx
leaq 0x27594(%rip), %rdi     # 0x60446
movb $0x0, %al
callq 0x1a220
leaq -0x24(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
leaq 0x27029(%rip), %rdi     # 0x5fef8
leaq -0x24(%rbp), %rsi
callq 0x1ad10
testb $0x1, %al
jne 0x38ede
jmp 0x38f13
leaq 0x4ad13(%rip), %rdi     # 0x83bf8
callq 0x2fdb0
movl $0x0, 0x4ad1c(%rip)     # 0x83c10
jmp 0x38f13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq 0x4acff(%rip), %rdi     # 0x83c08
callq 0x7380
jmp 0x39119
xorps %xmm0, %xmm0
movss 0x2215e(%rip), %xmm1    # 0x5b07c
callq 0x1a5e0
leaq -0x2c(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
leaq 0x27531(%rip), %rdi     # 0x6046a
leaq -0x2c(%rbp), %rsi
callq 0x1ad10
testb $0x1, %al
jne 0x38f48
jmp 0x38f92
movl $0x0, -0x30(%rbp)
cmpl $0x3e8, -0x30(%rbp)     # imm = 0x3E8
jge 0x38f81
movl 0x4acb2(%rip), %edx     # 0x83c10
addl -0x30(%rbp), %edx
leaq 0x4ac90(%rip), %rdi     # 0x83bf8
leaq 0x2750a(%rip), %rsi     # 0x60479
movb $0x0, %al
callq 0xb4a0
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x38f4f
movl 0x4ac89(%rip), %eax     # 0x83c10
addl $0x3e8, %eax            # imm = 0x3E8
movl %eax, 0x4ac7e(%rip)     # 0x83c10
leaq -0x38(%rbp), %rdi
movq %rdi, -0x70(%rbp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
movq -0x70(%rbp), %rsi
leaq 0x2734f(%rip), %rdi     # 0x602ff
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x15bc0
movl 0x4ac35(%rip), %eax     # 0x83bf4
movl %eax, -0x68(%rbp)
testl %eax, %eax
je 0x38fe3
jmp 0x38fc8
movl -0x68(%rbp), %eax
subl $0x1, %eax
je 0x39010
jmp 0x38fd2
movl -0x68(%rbp), %eax
subl $0x2, %eax
je 0x390b1
jmp 0x39106
leaq 0x4ac0e(%rip), %rdi     # 0x83bf8
callq 0x2fd90
movq %rax, -0x78(%rbp)
leaq 0x4abfe(%rip), %rdi     # 0x83bf8
callq 0x3cb50
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0xf8c0
jmp 0x39106
leaq -0x40(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
movl $0x7, %edi
leaq -0x40(%rbp), %rsi
callq 0x18ae0
movl 0x4abdd(%rip), %eax     # 0x83c10
movl %eax, -0x7c(%rbp)
callq 0x199e0
movl -0x7c(%rbp), %esi
leaq -0x50(%rbp), %rdi
callq 0x30090
movl -0x48(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x44(%rbp), %eax
jge 0x3908f
movl -0x54(%rbp), %esi
leaq 0x2741a(%rip), %rdi     # 0x60479
xorl %eax, %eax
callq 0x1a220
jmp 0x39068
jmp 0x3906a
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x3904d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x30150
jmp 0x39119
leaq -0x50(%rbp), %rdi
callq 0x300d0
jmp 0x3909a
movl $0x1, %edi
callq 0x159f0
jmp 0x390a6
leaq -0x50(%rbp), %rdi
callq 0x30150
jmp 0x39106
leaq -0x5c(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
movl $0x7, %edi
leaq -0x5c(%rbp), %rsi
callq 0x18ae0
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl 0x4ab32(%rip), %eax     # 0x83c10
jge 0x390fc
movl -0x60(%rbp), %esi
leaq 0x2738f(%rip), %rdi     # 0x60479
movb $0x0, %al
callq 0x1a220
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x390d5
movl $0x1, %edi
callq 0x159f0
callq 0x15e60
callq 0xee30
addq $0x80, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x74f0
nopw %cs:(%rax,%rax)