// File: donfreiday[P]gb/./imgui/imgui_demo.cpp
// Function: ShowExampleAppLayout(bool*)
static void ShowExampleAppLayout(bool* opened)
{
    ImGui::SetNextWindowSize(ImVec2(500, 440), ImGuiSetCond_FirstUseEver);
    if (ImGui::Begin("Example: Layout", opened, ImGuiWindowFlags_MenuBar))
    {
        if (ImGui::BeginMenuBar())
        {
            if (ImGui::BeginMenu("File"))
            {
                if (ImGui::MenuItem("Close")) *opened = false;
                ImGui::EndMenu();
            }
            ImGui::EndMenuBar();
        }

        // left
        static int selected = 0;
        ImGui::BeginChild("left pane", ImVec2(150, 0), true);
        for (int i = 0; i < 100; i++)
        {
            char label[128];
            sprintf(label, "MyObject %d", i);
            if (ImGui::Selectable(label, selected == i))
                selected = i;
        }
        ImGui::EndChild();
        ImGui::SameLine();

        // right
        ImGui::BeginGroup();
            ImGui::BeginChild("item view", ImVec2(0, -ImGui::GetItemsLineHeightWithSpacing())); // Leave room for 1 line below us
                ImGui::Text("MyObject: %d", selected);
                ImGui::Separator();
                ImGui::TextWrapped("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. ");
            ImGui::EndChild();
            ImGui::BeginChild("buttons");
                if (ImGui::Button("Revert")) {}
                ImGui::SameLine();
                if (ImGui::Button("Save")) {}
            ImGui::EndChild();
        ImGui::EndGroup();
    }
    ImGui::End();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
leaq -0x10(%rbp), %rdi
movss 0x24abd(%rip), %xmm0    # 0x5d5f8
movss 0x24ab9(%rip), %xmm1    # 0x5d5fc
callq 0x2d280
leaq -0x10(%rbp), %rdi
movl $0x4, %esi
callq 0xe790
movq -0x8(%rbp), %rsi
leaq 0x277de(%rip), %rdi     # 0x6033f
movl $0x400, %edx            # imm = 0x400
callq 0xe7e0
testb $0x1, %al
jne 0x38b74
jmp 0x38da5
callq 0x282f0
testb $0x1, %al
jne 0x38b7f
jmp 0x38bc4
leaq 0x232a7(%rip), %rdi     # 0x5be2d
movl $0x1, %esi
callq 0x28570
testb $0x1, %al
jne 0x38b96
jmp 0x38bbf
leaq 0x265e9(%rip), %rdi     # 0x5f186
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x27ed0
testb $0x1, %al
jne 0x38bb3
jmp 0x38bba
movq -0x8(%rbp), %rax
movb $0x0, (%rax)
callq 0x28f70
callq 0x28460
leaq -0x18(%rbp), %rdi
movss 0x249d8(%rip), %xmm0    # 0x5d5a8
xorps %xmm1, %xmm1
callq 0x2d280
leaq 0x27770(%rip), %rdi     # 0x6034f
leaq -0x18(%rbp), %rsi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x15bc0
movl $0x0, -0x1c(%rbp)
cmpl $0x64, -0x1c(%rbp)
jge 0x38c8a
leaq -0xa0(%rbp), %rdi
movl -0x1c(%rbp), %edx
leaq 0x27748(%rip), %rsi     # 0x60359
movb $0x0, %al
callq 0x77b0
leaq -0xa0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movl 0x4afc4(%rip), %eax     # 0x83bf0
cmpl -0x1c(%rbp), %eax
sete %al
movb %al, -0xd1(%rbp)
leaq -0xa8(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
movb -0xd1(%rbp), %al
movq -0xd0(%rbp), %rdi
movzbl %al, %esi
andl $0x1, %esi
xorl %edx, %edx
leaq -0xa8(%rbp), %rcx
callq 0x27150
testb $0x1, %al
jne 0x38c71
jmp 0x38c7a
movl -0x1c(%rbp), %eax
movl %eax, 0x4af76(%rip)     # 0x83bf0
jmp 0x38c7c
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x38bf6
callq 0x15e60
xorps %xmm0, %xmm0
movss 0x223e2(%rip), %xmm1    # 0x5b07c
callq 0x1a5e0
callq 0x211c0
callq 0x19a30
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
leaq -0xb0(%rbp), %rdi
xorps %xmm0, %xmm0
callq 0x2d280
leaq 0x27699(%rip), %rdi     # 0x60365
leaq -0xb0(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x15bc0
movl 0x4af0e(%rip), %esi     # 0x83bf0
leaq 0x27686(%rip), %rdi     # 0x6036f
movb $0x0, %al
callq 0x1a220
callq 0x29c00
leaq 0x27680(%rip), %rdi     # 0x6037c
movb $0x0, %al
callq 0x1a4c0
callq 0x15e60
leaq -0xb8(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
leaq 0x25c58(%rip), %rdi     # 0x5e979
leaq -0xb8(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x15bc0
leaq -0xc0(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
leaq 0x26dd4(%rip), %rdi     # 0x5fb1e
leaq -0xc0(%rbp), %rsi
callq 0x1ad10
testb $0x1, %al
jne 0x38d5c
jmp 0x38d5e
jmp 0x38d5e
xorps %xmm0, %xmm0
movss 0x22313(%rip), %xmm1    # 0x5b07c
callq 0x1a5e0
leaq -0xc8(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
leaq 0x26d9e(%rip), %rdi     # 0x5fb25
leaq -0xc8(%rbp), %rsi
callq 0x1ad10
testb $0x1, %al
jne 0x38d99
jmp 0x38d9b
jmp 0x38d9b
callq 0x15e60
callq 0x21490
callq 0xee30
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)