// File: Ciaxur[P]yagb-emu/include/imgui/imgui_demo.cpp
// Function: ShowExampleAppLongText(bool*)
static void ShowExampleAppLongText(bool* p_open)
{
    ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver);
    if (!ImGui::Begin("Example: Long text display", p_open))
    {
        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()\0"
        "Multiple calls to Text(), clipped\0"
        "Multiple calls to Text(), not clipped (slow)\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.appendf("%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;
            clipper.Begin(lines);
            while (clipper.Step())
                for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
                    ImGui::Text("%i The quick brown fox jumps over the lazy dog", i);
            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", i);
        ImGui::PopStyleVar();
        break;
    }
    ImGui::EndChild();
    ImGui::End();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x10(%rbp), %rdi
movss 0x86ca9(%rip), %xmm0    # 0x178584
movss 0x80ed1(%rip), %xmm1    # 0x1727b4
callq 0xbf4c0
leaq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0xd00c0
movq -0x8(%rbp), %rsi
leaq 0x916da(%rip), %rdi     # 0x182fdb
xorl %edx, %edx
callq 0xd0170
testb $0x1, %al
jne 0xf1916
callq 0xd3b60
jmp 0xf1c48
cmpb $0x0, 0x122b1b(%rip)    # 0x214438
jne 0xf1964
leaq 0x122b12(%rip), %rdi    # 0x214438
callq 0xd380
cmpl $0x0, %eax
je 0xf1964
leaq 0x122af1(%rip), %rdi    # 0x214428
callq 0xed6d0
jmp 0xf193e
leaq -0x4185(%rip), %rdi     # 0xed7c0
leaq 0x122adc(%rip), %rsi    # 0x214428
leaq 0x11cc65(%rip), %rdx    # 0x20e5b8
callq 0xd820
leaq 0x122ad9(%rip), %rdi    # 0x214438
callq 0xd580
leaq 0x9168b(%rip), %rdi     # 0x182ff6
movb $0x0, %al
callq 0x139160
leaq 0x916a5(%rip), %rdi     # 0x18301e
leaq 0x122aa0(%rip), %rsi    # 0x214420
leaq 0x86e77(%rip), %rdx     # 0x1787fe
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x13fb50
movl 0x122aa9(%rip), %eax    # 0x214440
movl %eax, -0x70(%rbp)
leaq 0x122a87(%rip), %rdi    # 0x214428
callq 0xec2b0
movl -0x70(%rbp), %esi
movl %eax, %edx
leaq 0x91676(%rip), %rdi     # 0x183028
movb $0x0, %al
callq 0x139160
leaq -0x24(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
leaq 0x8436a(%rip), %rdi     # 0x175d39
leaq -0x24(%rbp), %rsi
callq 0x13a930
testb $0x1, %al
jne 0xf19de
jmp 0xf1a13
leaq 0x122a43(%rip), %rdi    # 0x214428
callq 0xeb160
movl $0x0, 0x122a4c(%rip)    # 0x214440
jmp 0xf1a13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq 0x122a2f(%rip), %rdi    # 0x214438
callq 0xd460
jmp 0xf1c51
xorps %xmm0, %xmm0
movss 0x80562(%rip), %xmm1    # 0x171f80
callq 0xdc1c0
leaq -0x2c(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
leaq 0x91613(%rip), %rdi     # 0x18304c
leaq -0x2c(%rbp), %rsi
callq 0x13a930
testb $0x1, %al
jne 0xf1a48
jmp 0xf1a92
movl $0x0, -0x30(%rbp)
cmpl $0x3e8, -0x30(%rbp)     # imm = 0x3E8
jge 0xf1a81
movl 0x1229e2(%rip), %edx    # 0x214440
addl -0x30(%rbp), %edx
leaq 0x1229c0(%rip), %rdi    # 0x214428
leaq 0x915ec(%rip), %rsi     # 0x18305b
movb $0x0, %al
callq 0xc6bd0
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0xf1a4f
movl 0x1229b9(%rip), %eax    # 0x214440
addl $0x3e8, %eax            # imm = 0x3E8
movl %eax, 0x1229ae(%rip)    # 0x214440
leaq -0x38(%rbp), %rdi
movq %rdi, -0x80(%rbp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0x80(%rbp), %rsi
leaq 0x911c2(%rip), %rdi     # 0x182c72
xorl %ecx, %ecx
movl %ecx, %edx
callq 0xd5cc0
movl 0x122961(%rip), %eax    # 0x214420
movl %eax, -0x74(%rbp)
testl %eax, %eax
je 0xf1ae3
jmp 0xf1ac8
movl -0x74(%rbp), %eax
subl $0x1, %eax
je 0xf1b16
jmp 0xf1ad2
movl -0x74(%rbp), %eax
subl $0x2, %eax
je 0xf1be9
jmp 0xf1c3e
leaq 0x12293e(%rip), %rdi    # 0x214428
callq 0xec300
movq %rax, -0x88(%rbp)
leaq 0x12292b(%rip), %rdi    # 0x214428
callq 0x10b690
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x139130
jmp 0xf1c3e
leaq -0x40(%rbp), %rdi
movq %rdi, -0x98(%rbp)
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0x98(%rbp), %rsi
movl $0xd, %edi
callq 0xc7b50
leaq -0x5c(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0xc6ff0
movq -0x90(%rbp), %rdi
movl 0x1228e6(%rip), %esi    # 0x214440
movss 0x8041e(%rip), %xmm0    # 0x171f80
callq 0xc7090
jmp 0xf1b69
jmp 0xf1b6b
leaq -0x5c(%rbp), %rdi
callq 0xc7320
movb %al, -0x99(%rbp)
jmp 0xf1b7c
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0xf1b88
jmp 0xf1bd2
movl -0x5c(%rbp), %eax
movl %eax, -0x60(%rbp)
movl -0x60(%rbp), %eax
cmpl -0x58(%rbp), %eax
jge 0xf1bd0
movl -0x60(%rbp), %esi
leaq 0x914eb(%rip), %rdi     # 0x18308b
xorl %eax, %eax
callq 0x139160
jmp 0xf1ba9
jmp 0xf1bab
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0xf1b8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
leaq -0x5c(%rbp), %rdi
callq 0xc7030
jmp 0xf1c51
jmp 0xf1b6b
movl $0x1, %edi
callq 0xc7c10
jmp 0xf1bde
leaq -0x5c(%rbp), %rdi
callq 0xc7030
jmp 0xf1c3e
leaq -0x68(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4c0
movl $0xd, %edi
leaq -0x68(%rbp), %rsi
callq 0xc7b50
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl 0x12282a(%rip), %eax    # 0x214440
jge 0xf1c34
movl -0x6c(%rbp), %esi
leaq 0x91469(%rip), %rdi     # 0x18308b
movb $0x0, %al
callq 0x139160
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0xf1c0d
movl $0x1, %edi
callq 0xc7c10
callq 0xd5d90
callq 0xd3b60
addq $0xa0, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0xd620
nopw (%rax,%rax)