// File: 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
subq $0x90, %rsp
movq 0x13d19e(%rip), %rax    # 0x212f40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x1ae0(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb 0x1a76(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd5dcb
jmp 0xd5dea
leaq 0x9e09b(%rip), %rdi     # 0x173e6d
leaq 0x9d130(%rip), %rsi     # 0x172f09
movl $0x1316, %edx           # imm = 0x1316
leaq 0x9e0a2(%rip), %rcx     # 0x173e87
callq 0xd180
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x0, %eax
je 0xd5dfd
jmp 0xd5e1c
leaq 0x9e09a(%rip), %rdi     # 0x173e9e
leaq 0x9d0fe(%rip), %rsi     # 0x172f09
movl $0x1317, %edx           # imm = 0x1317
leaq 0x9e070(%rip), %rcx     # 0x173e87
callq 0xd180
movq -0x8(%rbp), %rax
movb $0x1, 0x1a76(%rax)
movq -0x10(%rbp), %rax
movswl 0x9a(%rax), %eax
cmpl $0x1, %eax
jle 0xd5e41
callq 0xd3b60
jmp 0xd601c
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl 0xa6(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xd5e77
movss -0x18(%rbp), %xmm1
movss 0x9c8c7(%rip), %xmm0    # 0x172734
callq 0xc88c0
movss %xmm0, -0x18(%rbp)
movq -0x10(%rbp), %rax
movsbl 0xa6(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0xd5ea1
movss -0x14(%rbp), %xmm1
movss 0x9c89d(%rip), %xmm0    # 0x172734
callq 0xc88c0
movss %xmm0, -0x14(%rbp)
callq 0xd3b60
movq -0x8(%rbp), %rax
movq 0x1ae0(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
addq $0xd8, %rdi
movq %rdi, -0x70(%rbp)
leaq -0x18(%rbp), %rsi
callq 0xc41b0
movq -0x70(%rbp), %rsi
movlpd %xmm0, -0x38(%rbp)
leaq -0x30(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0xe8660
leaq -0x18(%rbp), %rdi
movss 0x9c091(%rip), %xmm0    # 0x171f80
callq 0xd6030
movq -0x10(%rbp), %rax
cmpl $0x0, 0x150(%rax)
jne 0xd5f12
movq -0x10(%rbp), %rax
testb $0x1, 0x15d(%rax)
je 0xd600b
movq -0x10(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x800000, %eax         # imm = 0x800000
cmpl $0x0, %eax
jne 0xd600b
movq -0x10(%rbp), %rax
movl 0x58(%rax), %esi
leaq -0x30(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
callq 0xd6250
movq -0x10(%rbp), %rax
movl 0x58(%rax), %esi
leaq -0x30(%rbp), %rdi
movl $0x1, %edx
callq 0xc91e0
movq -0x10(%rbp), %rax
cmpl $0x0, 0x150(%rax)
jne 0xd6009
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x1c90(%rcx), %rax
jne 0xd6009
leaq -0x58(%rbp), %rdi
movq %rdi, -0x90(%rbp)
movss 0x9c043(%rip), %xmm1    # 0x171fcc
movss %xmm1, -0x84(%rbp)
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0x90(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0xc3c00
movss -0x84(%rbp), %xmm1
movlpd %xmm0, -0x50(%rbp)
leaq -0x28(%rbp), %rax
movq %rax, -0x80(%rbp)
leaq -0x68(%rbp), %rdi
movq %rdi, -0x78(%rbp)
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0x80(%rbp), %rdi
movq -0x78(%rbp), %rsi
callq 0xc41b0
movlpd %xmm0, -0x60(%rbp)
leaq -0x48(%rbp), %rdi
leaq -0x50(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0xe8660
movq -0x8(%rbp), %rax
movl 0x1c98(%rax), %esi
leaq -0x48(%rbp), %rdi
movl $0x2, %edx
callq 0xc91e0
jmp 0xd601a
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
xorl %eax, %eax
movl %eax, %edx
callq 0xd6250
jmp 0xd601c
movq -0x8(%rbp), %rax
movb $0x0, 0x1a76(%rax)
addq $0x90, %rsp
popq %rbp
retq