// File: /workspace/github_cpp_makefile_star2_O3/donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::EndGroup()
void ImGui::EndGroup()
{
    ImGuiWindow* window = GetCurrentWindow();
    ImGuiStyle& style = ImGui::GetStyle();

    IM_ASSERT(!window->DC.GroupStack.empty());

    ImGuiGroupData& group_data = window->DC.GroupStack.back();

    ImRect group_bb(group_data.BackupCursorPos, window->DC.CursorMaxPos);
    group_bb.Max.y -= style.ItemSpacing.y;      // Cancel out last vertical spacing because we are adding one ourselves.
    group_bb.Max = ImMax(group_bb.Min, group_bb.Max);

    window->DC.CursorPos = group_data.BackupCursorPos;
    window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos);
    window->DC.CurrentLineHeight = group_data.BackupCurrentLineHeight;
    window->DC.CurrentLineTextBaseOffset = group_data.BackupCurrentLineTextBaseOffset;
    window->DC.ColumnsStartX = group_data.BackupColumnsStartX;
    window->DC.LogLinePosY = window->DC.CursorPos.y - 9999.0f;

    if (group_data.AdvanceCursor)
    {
        window->DC.CurrentLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrentLineTextBaseOffset);      // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now.
        ItemSize(group_bb.GetSize(), group_data.BackupCurrentLineTextBaseOffset);
        ItemAdd(group_bb, NULL);
    }

    window->DC.GroupStack.pop_back();

    //window->DrawList->AddRect(group_bb.Min, group_bb.Max, 0xFFFF00FF);   // Debug
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
movq 0x39af4(%rip), %rdi     # 0x55480
movq 0x1758(%rdi), %rbx
movb $0x1, 0x72(%rbx)
movl 0x168(%rbx), %eax
testq %rax, %rax
je 0x1bb05
testl %eax, %eax
jle 0x1bb24
movq 0x170(%rbx), %rcx
leaq (%rax,%rax,8), %rdx
movq -0x24(%rcx,%rdx,4), %rsi
movq %rsi, -0x18(%rbp)
movss 0xc0(%rbx), %xmm5
movss 0xc4(%rbx), %xmm0
movaps %xmm0, %xmm6
subss 0x1418(%rdi), %xmm6
movd %esi, %xmm2
movq %rsi, %rdi
shrq $0x20, %rdi
movd %edi, %xmm3
movaps %xmm5, %xmm1
cmpless %xmm2, %xmm1
movaps %xmm1, %xmm4
andps %xmm2, %xmm4
andnps %xmm5, %xmm1
orps %xmm4, %xmm1
movaps %xmm6, %xmm4
cmpless %xmm3, %xmm4
movaps %xmm4, %xmm7
andps %xmm3, %xmm7
andnps %xmm6, %xmm4
orps %xmm7, %xmm4
movaps %xmm1, %xmm6
unpcklps %xmm4, %xmm6            # xmm6 = xmm6[0],xmm4[0],xmm6[1],xmm4[1]
movlps %xmm6, -0x10(%rbp)
movq %rsi, 0xa8(%rbx)
movss -0x1c(%rcx,%rdx,4), %xmm6
movss -0x18(%rcx,%rdx,4), %xmm7
movaps %xmm5, %xmm8
cmpless %xmm6, %xmm8
andps %xmm8, %xmm6
andnps %xmm5, %xmm8
orps %xmm6, %xmm8
movaps %xmm0, %xmm5
cmpless %xmm7, %xmm5
andps %xmm5, %xmm7
andnps %xmm0, %xmm5
orps %xmm7, %xmm5
unpcklps %xmm5, %xmm8            # xmm8 = xmm8[0],xmm5[0],xmm8[1],xmm5[1]
movlps %xmm8, 0xc0(%rbx)
movss -0x10(%rcx,%rdx,4), %xmm0
movss %xmm0, 0xc8(%rbx)
movss -0xc(%rcx,%rdx,4), %xmm0
movss %xmm0, 0xcc(%rbx)
movss -0x14(%rcx,%rdx,4), %xmm5
movss %xmm5, 0x194(%rbx)
movss 0x21922(%rip), %xmm5    # 0x3d3b8
addss %xmm3, %xmm5
movss %xmm5, 0xd8(%rbx)
cmpb $0x1, -0x4(%rcx,%rdx,4)
jne 0x1baf6
movss 0xd4(%rbx), %xmm5
movaps %xmm0, %xmm6
cmpless %xmm5, %xmm6
andps %xmm6, %xmm5
andnps %xmm0, %xmm6
orps %xmm5, %xmm6
movss %xmm6, 0xcc(%rbx)
subss %xmm2, %xmm1
subss %xmm3, %xmm4
unpcklps %xmm4, %xmm1            # xmm1 = xmm1[0],xmm4[0],xmm1[1],xmm4[1]
leaq -0x20(%rbp), %rdi
movlps %xmm1, (%rdi)
callq 0xa99d
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0xaaef
movl 0x168(%rbx), %eax
testl %eax, %eax
jle 0x1bb43
decl %eax
movl %eax, 0x168(%rbx)
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0x22ce3(%rip), %rdi     # 0x3e7ef
leaq 0x21ba2(%rip), %rsi     # 0x3d6b5
leaq 0x22cf4(%rip), %rcx     # 0x3e80e
movl $0x215a, %edx           # imm = 0x215A
callq 0x7140
leaq 0x2b00a(%rip), %rdi     # 0x46b35
leaq 0x22f91(%rip), %rsi     # 0x3eac3
leaq 0x23acb(%rip), %rcx     # 0x3f604
movl $0x326, %edx            # imm = 0x326
callq 0x7140
leaq 0x2afeb(%rip), %rdi     # 0x46b35
leaq 0x22f72(%rip), %rsi     # 0x3eac3
leaq 0x23aee(%rip), %rcx     # 0x3f646
movl $0x338, %edx            # imm = 0x338
callq 0x7140