// File: /workspace/github_cpp_makefile_star2_O3/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 %ecx, -0x30(%rbp)
movl %esi, %r9d
movq %rdi, %r10
movq 0xa9fae(%rip), %r14     # 0xfbcd0
movq 0x1ae0(%r14), %rbx
movsd 0x270(%rbx), %xmm0
cmpq $0x0, 0x1b0(%rbx)
jne 0x51d45
cmpq $0x0, 0x20a8(%r14)
je 0x51d51
movss 0x240(%rbx), %xmm1
movss %xmm1, %xmm0            # xmm0 = xmm1[0],xmm0[1,2,3]
movss (%rdx), %xmm1
movss 0x4(%rdx), %xmm3
cvttss2si %xmm1, %eax
cvttss2si %xmm3, %ecx
movl 0xc(%rbx), %r12d
testl %eax, %eax
sete -0x2c(%rbp)
testl %ecx, %ecx
sete %r15b
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 0x51da9
movss 0xd8(%rbx), %xmm3
movaps %xmm0, %xmm4
subss %xmm3, %xmm4
addss %xmm2, %xmm4
maxss 0x63abf(%rip), %xmm4    # 0xb5864
movss %xmm4, %xmm1            # xmm1 = xmm4[0],xmm1[1,2,3]
andl $0x4, %r12d
movaps %xmm1, %xmm2
shufps $0x55, %xmm1, %xmm2     # xmm2 = xmm2[1,1],xmm1[1,1]
xorps %xmm3, %xmm3
ucomiss %xmm2, %xmm3
jb 0x51dde
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
subss 0xdc(%rbx), %xmm0
addss %xmm0, %xmm2
maxss 0x63a90(%rip), %xmm2    # 0xb5864
movlhps %xmm1, %xmm2            # xmm2 = xmm2[0],xmm1[0]
shufps $0xe2, %xmm1, %xmm2     # xmm2 = xmm2[2,0],xmm1[2,3]
movaps %xmm2, %xmm1
movl %r8d, -0x34(%rbp)
orl %r8d, %r12d
addb %r15b, %r15b
orb $0x2, 0x1b88(%r14)
movlps %xmm1, 0x1ba8(%r14)
movl $0x1, 0x1b90(%r14)
leaq 0x3378(%r14), %r13
movq (%rbx), %rcx
testq %r10, %r10
movl %r9d, -0x38(%rbp)
je 0x51e31
leaq 0x65156(%rip), %rdx     # 0xb6f73
movl $0xc01, %esi            # imm = 0xC01
movq %r13, %rdi
movq %r10, %r8
xorl %eax, %eax
callq 0x41f22
jmp 0x51e4a
leaq 0x65146(%rip), %rdx     # 0xb6f7e
movl $0xc01, %esi            # imm = 0xC01
movq %r13, %rdi
movl %r9d, %r8d
xorl %eax, %eax
callq 0x41f22
orl $0x1000103, %r12d       # imm = 0x1000103
addb -0x2c(%rbp), %r15b
movss 0x158c(%r14), %xmm0
movss %xmm0, -0x2c(%rbp)
cmpb $0x0, -0x30(%rbp)
jne 0x51e74
movl $0x0, 0x158c(%r14)
movq %r13, %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x4b741
movl %eax, %r13d
movss -0x2c(%rbp), %xmm0
movss %xmm0, 0x158c(%r14)
movq 0x1ae0(%r14), %r12
movl -0x38(%rbp), %ecx
movl %ecx, 0x58(%r12)
movb %r15b, 0xa6(%r12)
cmpw $0x1, 0x9a(%r12)
jne 0x51ec1
movq 0x10(%r12), %rax
movq %rax, 0xd8(%rbx)
btl $0x17, -0x34(%rbp)
jb 0x51f12
cmpl %ecx, 0x1ca0(%r14)
jne 0x51f12
cmpl $0x0, 0x150(%r12)
jne 0x51ee7
cmpb $0x1, 0x15d(%r12)
jne 0x51f12
movq %r12, %rdi
movl %ecx, %ebx
callq 0x4726c
movq %r12, %rdi
xorl %esi, %esi
callq 0x51f7e
incl %ebx
movl %ebx, %edi
movq %r12, %rsi
callq 0x4603f
movl $0x2, 0x1b68(%r14)
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq