// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::EndChild()
void ImGui::EndChild()
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;

    IM_ASSERT(g.WithinEndChild == false);
    IM_ASSERT(window->Flags & ImGuiWindowFlags_ChildWindow);   // Mismatched BeginChild()/EndChild() calls

    g.WithinEndChild = true;
    if (window->BeginCount > 1)
    {
        End();
    }
    else
    {
        ImVec2 sz = window->Size;
        if (window->AutoFitChildAxises & (1 << ImGuiAxis_X)) // Arbitrary minimum zero-ish child size of 4.0f causes less trouble than a 0.0f
            sz.x = ImMax(4.0f, sz.x);
        if (window->AutoFitChildAxises & (1 << ImGuiAxis_Y))
            sz.y = ImMax(4.0f, sz.y);
        End();

        ImGuiWindow* parent_window = g.CurrentWindow;
        ImRect bb(parent_window->DC.CursorPos, parent_window->DC.CursorPos + sz);
        ItemSize(sz);
        if ((window->DC.NavLayerActiveMask != 0 || window->DC.NavHasScroll) && !(window->Flags & ImGuiWindowFlags_NavFlattened))
        {
            ItemAdd(bb, window->ChildId);
            RenderNavHighlight(bb, window->ChildId);

            // When browsing a window that has no activable items (scroll only) we keep a highlight on the child
            if (window->DC.NavLayerActiveMask == 0 && window == g.NavWindow)
                RenderNavHighlight(ImRect(bb.Min - ImVec2(2, 2), bb.Max + ImVec2(2, 2)), g.NavId, ImGuiNavHighlightFlags_TypeThin);
        }
        else
        {
            // Not navigable into
            ItemAdd(bb, 0);
        }
    }
    g.WithinEndChild = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x48, %rsp
movq 0xa3181(%rip), %r14     # 0xe3ce0
cmpb $0x0, 0x1a76(%r14)
jne 0x40cfd
movq 0x1ae0(%r14), %r15
testb $0x1, 0xf(%r15)
je 0x40d1c
movb $0x1, 0x1a76(%r14)
cmpw $0x2, 0x9a(%r15)
jl 0x40b9c
callq 0x3f958
jmp 0x40cea
movq 0x18(%r15), %rcx
movq %rcx, -0x30(%rbp)
movb 0xa6(%r15), %al
movd %ecx, %xmm1
shrq $0x20, %rcx
testb $0x1, %al
je 0x40bcb
movss 0x5bcd1(%rip), %xmm0    # 0x9c890
maxss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
movaps %xmm0, %xmm1
movd %ecx, %xmm2
testb $0x2, %al
movaps %xmm1, -0x50(%rbp)
jne 0x40bdd
movaps %xmm2, -0x40(%rbp)
jmp 0x40bf2
movss 0x5bcab(%rip), %xmm0    # 0x9c890
maxss %xmm2, %xmm0
movss %xmm0, -0x2c(%rbp)
movaps %xmm0, -0x40(%rbp)
callq 0x3f958
movq 0x1ae0(%r14), %rax
movaps -0x50(%rbp), %xmm0
addss 0xd8(%rax), %xmm0
movaps -0x40(%rbp), %xmm1
addss 0xdc(%rax), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movq 0xd8(%rax), %rax
movq %rax, -0x28(%rbp)
movlps %xmm0, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
movss 0x5b3bc(%rip), %xmm0    # 0x9bff0
callq 0x40d3b
cmpl $0x0, 0x150(%r15)
jne 0x40c51
cmpb $0x1, 0x15d(%r15)
jne 0x40cdd
testb $-0x80, 0xe(%r15)
jne 0x40cdd
movl 0x58(%r15), %esi
leaq -0x28(%rbp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x40ea5
movl 0x58(%r15), %esi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x36c91
cmpl $0x0, 0x150(%r15)
jne 0x40cea
cmpq 0x1c90(%r14), %r15
jne 0x40cea
movss 0x5bc20(%rip), %xmm0    # 0x9c8b8
movss -0x28(%rbp), %xmm1
addss %xmm0, %xmm1
addss -0x24(%rbp), %xmm0
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movss 0x5bbe3(%rip), %xmm0    # 0x9c894
movss -0x20(%rbp), %xmm2
addss %xmm0, %xmm2
addss -0x1c(%rbp), %xmm0
unpcklps %xmm0, %xmm2            # xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
movlhps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0]
leaq -0x60(%rbp), %rdi
movups %xmm1, (%rdi)
movl 0x1c98(%r14), %esi
pushq $0x2
popq %rdx
callq 0x36c91
jmp 0x40cea
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x40ea5
movb $0x0, 0x1a76(%r14)
addq $0x48, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5d2fa(%rip), %rdi     # 0x9dffe
leaq 0x5c48a(%rip), %rsi     # 0x9d195
leaq 0x5d306(%rip), %rcx     # 0x9e018
movl $0x1316, %edx           # imm = 0x1316
callq 0xc140
leaq 0x5d30c(%rip), %rdi     # 0x9e02f
leaq 0x5c46b(%rip), %rsi     # 0x9d195
leaq 0x5d2e7(%rip), %rcx     # 0x9e018
movl $0x1317, %edx           # imm = 0x1317
callq 0xc140