// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::BeginChildEx(char const*, unsigned int, ImVec2 const&, bool, int)
bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, bool border, ImGuiWindowFlags flags)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* parent_window = g.CurrentWindow;

    flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_ChildWindow;
    flags |= (parent_window->Flags & ImGuiWindowFlags_NoMove);  // Inherit the NoMove flag

    // Size
    const ImVec2 content_avail = GetContentRegionAvail();
    ImVec2 size = ImFloor(size_arg);
    const int auto_fit_axises = ((size.x == 0.0f) ? (1 << ImGuiAxis_X) : 0x00) | ((size.y == 0.0f) ? (1 << ImGuiAxis_Y) : 0x00);
    if (size.x <= 0.0f)
        size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too much issues)
    if (size.y <= 0.0f)
        size.y = ImMax(content_avail.y + size.y, 4.0f);
    SetNextWindowSize(size);

    // Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value.
    if (name)
        ImFormatString(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), "%s/%s_%08X", parent_window->Name, name, id);
    else
        ImFormatString(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), "%s/%08X", parent_window->Name, id);

    const float backup_border_size = g.Style.ChildBorderSize;
    if (!border)
        g.Style.ChildBorderSize = 0.0f;
    bool ret = Begin(g.TempBuffer, NULL, flags);
    g.Style.ChildBorderSize = backup_border_size;

    ImGuiWindow* child_window = g.CurrentWindow;
    child_window->ChildId = id;
    child_window->AutoFitChildAxises = (ImS8)auto_fit_axises;

    // Set the cursor to handle case where the user called SetNextWindowPos()+BeginChild() manually.
    // While this is not really documented/defined, it seems that the expected thing to do.
    if (child_window->BeginCount == 1)
        parent_window->DC.CursorPos = child_window->Pos;

    // Process navigation-in immediately so NavInit can run on first frame
    if (g.NavActivateId == id && !(flags & ImGuiWindowFlags_NavFlattened) && (child_window->DC.NavLayerActiveMask != 0 || child_window->DC.NavHasScroll))
    {
        FocusWindow(child_window);
        NavInitWindow(child_window, false);
        SetActiveID(id + 1, child_window); // Steal ActiveId with another arbitrary id so that key-press won't activate child item
        g.ActiveIdSource = ImGuiInputSource_Nav;
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, -0x34(%rbp)
movl %ecx, -0x38(%rbp)
movq %rdx, %r12
movl %esi, -0x30(%rbp)
movq %rdi, %rbx
movq 0xa34dc(%rip), %r14     # 0xe3ce0
movq 0x1ae0(%r14), %rax
movq %rax, -0x40(%rbp)
movl 0xc(%rax), %r15d
callq 0x409d2
movss (%r12), %xmm1
movss 0x4(%r12), %xmm3
cvttss2si %xmm1, %eax
cvttss2si %xmm3, %ecx
testl %eax, %eax
sete -0x2c(%rbp)
testl %ecx, %ecx
sete %r13b
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm2
cvttps2dq %xmm3, %xmm1
cvtdq2ps %xmm1, %xmm3
movaps %xmm2, %xmm1
unpcklps %xmm3, %xmm1            # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
testl %eax, %eax
jg 0x40861
addss %xmm0, %xmm2
maxss 0x5c033(%rip), %xmm2    # 0x9c890
movss %xmm2, %xmm1            # xmm1 = xmm2[0],xmm1[1,2,3]
andl $0x4, %r15d
movaps %xmm1, %xmm2
shufps $0x55, %xmm1, %xmm2     # xmm2 = xmm2[1,1],xmm1[1,1]
xorps %xmm3, %xmm3
ucomiss %xmm2, %xmm3
movq %rbx, %r8
jb 0x40890
addps %xmm1, %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
maxss 0x5c00a(%rip), %xmm0    # 0x9c890
movlhps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm0     # xmm0 = xmm0[2,0],xmm1[2,3]
movaps %xmm0, %xmm1
movl -0x30(%rbp), %ebx
orl -0x34(%rbp), %r15d
addb %r13b, %r13b
orb $0x2, 0x1b88(%r14)
movlps %xmm1, 0x1ba8(%r14)
movl $0x1, 0x1b90(%r14)
leaq 0x3378(%r14), %r12
movq -0x40(%rbp), %rax
movq (%rax), %rcx
testq %r8, %r8
je 0x408e3
leaq 0x5d6d4(%rip), %rdx     # 0x9dfa3
movl $0xc01, %esi            # imm = 0xC01
movq %r12, %rdi
movl %ebx, %r9d
xorl %eax, %eax
callq 0x3468c
jmp 0x408fc
leaq 0x5d6c4(%rip), %rdx     # 0x9dfae
movl $0xc01, %esi            # imm = 0xC01
movq %r12, %rdi
movl %ebx, %r8d
xorl %eax, %eax
callq 0x3468c
orl $0x1000103, %r15d       # imm = 0x1000103
addb -0x2c(%rbp), %r13b
movss 0x158c(%r14), %xmm0
movss %xmm0, -0x2c(%rbp)
cmpb $0x0, -0x38(%rbp)
jne 0x40923
andl $0x0, 0x158c(%r14)
movq %r12, %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x3bad8
movl %eax, %r15d
movss -0x2c(%rbp), %xmm0
movss %xmm0, 0x158c(%r14)
movq 0x1ae0(%r14), %r12
movl %ebx, 0x58(%r12)
movb %r13b, 0xa6(%r12)
cmpw $0x1, 0x9a(%r12)
jne 0x40971
movq 0x10(%r12), %rax
movq -0x40(%rbp), %rcx
movq %rax, 0xd8(%rcx)
btl $0x17, -0x34(%rbp)
jb 0x409c0
cmpl %ebx, 0x1ca0(%r14)
jne 0x409c0
cmpl $0x0, 0x150(%r12)
jne 0x40997
cmpb $0x1, 0x15d(%r12)
jne 0x409c0
movq %r12, %rdi
callq 0x37fa1
movq %r12, %rdi
xorl %esi, %esi
callq 0x40a13
incl %ebx
movl %ebx, %edi
movq %r12, %rsi
callq 0x3739b
movl $0x2, 0x1b68(%r14)
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq