// File: /workspace/github_cpp_makefile_star2_O1/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::EndGroup()
void ImGui::EndGroup()
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = g.CurrentWindow;
    IM_ASSERT(g.GroupStack.Size > 0); // Mismatched BeginGroup()/EndGroup() calls

    ImGuiGroupData& group_data = g.GroupStack.back();
    IM_ASSERT(group_data.WindowID == window->ID); // EndGroup() in wrong window?

    ImRect group_bb(group_data.BackupCursorPos, ImMax(window->DC.CursorMaxPos, group_data.BackupCursorPos));

    window->DC.CursorPos = group_data.BackupCursorPos;
    window->DC.CursorMaxPos = ImMax(group_data.BackupCursorMaxPos, window->DC.CursorMaxPos);
    window->DC.Indent = group_data.BackupIndent;
    window->DC.GroupOffset = group_data.BackupGroupOffset;
    window->DC.CurrLineSize = group_data.BackupCurrLineSize;
    window->DC.CurrLineTextBaseOffset = group_data.BackupCurrLineTextBaseOffset;
    if (g.LogEnabled)
        g.LogLinePosY = -FLT_MAX; // To enforce Log carriage return

    if (!group_data.EmitItem)
    {
        g.GroupStack.pop_back();
        return;
    }

    window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset);      // 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());
    ItemAdd(group_bb, 0);

    // If the current ActiveId was declared within the boundary of our group, we copy it to LastItemId so IsItemActive(), IsItemDeactivated() etc. will be functional on the entire group.
    // It would be be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but would put a little more burden on individual widgets.
    // Also if you grep for LastItemId you'll notice it is only used in that context.
    // (The two tests not the same because ActiveIdIsAlive is an ID itself, in order to be able to handle ActiveId being overwritten during the frame.)
    const bool group_contains_curr_active_id = (group_data.BackupActiveIdIsAlive != g.ActiveId) && (g.ActiveIdIsAlive == g.ActiveId) && g.ActiveId;
    const bool group_contains_prev_active_id = (group_data.BackupActiveIdPreviousFrameIsAlive == false) && (g.ActiveIdPreviousFrameIsAlive == true);
    if (group_contains_curr_active_id)
        window->DC.LastItemId = g.ActiveId;
    else if (group_contains_prev_active_id)
        window->DC.LastItemId = g.ActiveIdPreviousFrame;
    window->DC.LastItemRect = group_bb;

    // Forward Edited flag
    if (group_contains_curr_active_id && g.ActiveIdHasBeenEditedThisFrame)
        window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_Edited;

    // Forward Deactivated flag
    window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_HasDeactivated;
    if (group_contains_prev_active_id && g.ActiveId != g.ActiveIdPreviousFrame)
        window->DC.LastItemStatusFlags |= ImGuiItemStatusFlags_Deactivated;

    g.GroupStack.pop_back();
    //window->DrawList->AddRect(group_bb.Min, group_bb.Max, IM_COL32(255,0,255,255));   // [Debug]
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0xa7595(%rip), %r14     # 0xfdcd0
movslq 0x1c60(%r14), %rax
testq %rax, %rax
jle 0x56984
movq 0x1ae0(%r14), %r15
movq 0x1c68(%r14), %r12
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movl -0x30(%r12,%rax), %ecx
cmpl 0x8(%r15), %ecx
jne 0x569a3
addq %rax, %r12
movss 0xf0(%r15), %xmm1
movss 0xf4(%r15), %xmm0
movss -0x2c(%r12), %xmm2
movss -0x28(%r12), %xmm3
movaps %xmm2, %xmm4
cmpless %xmm1, %xmm4
movaps %xmm4, %xmm5
andps %xmm1, %xmm5
andnps %xmm2, %xmm4
orps %xmm5, %xmm4
movaps %xmm3, %xmm2
cmpless %xmm0, %xmm2
movaps %xmm2, %xmm5
andps %xmm0, %xmm5
andnps %xmm3, %xmm2
orps %xmm5, %xmm2
unpcklps %xmm2, %xmm4            # xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
movq -0x2c(%r12), %rax
movq %rax, -0x38(%rbp)
movlps %xmm4, -0x30(%rbp)
movq %rax, 0xd8(%r15)
movss -0x24(%r12), %xmm2
movss -0x20(%r12), %xmm3
movaps %xmm1, %xmm4
cmpless %xmm2, %xmm4
andps %xmm4, %xmm2
andnps %xmm1, %xmm4
orps %xmm2, %xmm4
movaps %xmm0, %xmm1
cmpless %xmm3, %xmm1
andps %xmm1, %xmm3
andnps %xmm0, %xmm1
orps %xmm3, %xmm1
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
movlps %xmm4, 0xf0(%r15)
movl -0x1c(%r12), %eax
movl %eax, 0x118(%r15)
movl -0x18(%r12), %eax
movl %eax, 0x120(%r15)
movq -0x14(%r12), %rax
movq %rax, 0x100(%r15)
movss -0xc(%r12), %xmm0
movss %xmm0, 0x110(%r15)
cmpb $0x1, 0x3138(%r14)
jne 0x56856
movl $0xff7fffff, 0x3158(%r14) # imm = 0xFF7FFFFF
cmpb $0x0, -0x3(%r12)
je 0x56961
movss 0x114(%r15), %xmm1
movaps %xmm0, %xmm2
cmpless %xmm1, %xmm2
andps %xmm2, %xmm1
andnps %xmm0, %xmm2
orps %xmm1, %xmm2
movss %xmm2, 0x110(%r15)
leaq -0x38(%rbp), %rbx
movss 0x8(%rbx), %xmm0
movss 0xc(%rbx), %xmm1
subss (%rbx), %xmm0
subss 0x4(%rbx), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x40(%rbp), %rdi
movlps %xmm0, (%rdi)
movss 0x60722(%rip), %xmm0    # 0xb6fd0
callq 0x532de
xorl %r13d, %r13d
movq %rbx, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5346f
movl 0x1b30(%r14), %ecx
cmpl %ecx, -0x8(%r12)
je 0x568e3
cmpl %ecx, 0x1b34(%r14)
sete %al
testl %ecx, %ecx
setne %r13b
andb %al, %r13b
cmpb $0x0, -0x4(%r12)
je 0x568ef
xorl %eax, %eax
jmp 0x568f6
movb 0x1b74(%r14), %al
testb %r13b, %r13b
jne 0x56906
testb %al, %al
je 0x5690d
movl 0x1b70(%r14), %ecx
movl %ecx, 0x124(%r15)
movups -0x38(%rbp), %xmm0
movups %xmm0, 0x12c(%r15)
testb %r13b, %r13b
je 0x56930
cmpb $0x1, 0x1b41(%r14)
jne 0x56930
orb $0x4, 0x128(%r15)
movl 0x128(%r15), %ecx
movl %ecx, %edx
orl $0x20, %edx
movl %edx, 0x128(%r15)
testb %al, %al
je 0x56961
movl 0x1b30(%r14), %eax
cmpl 0x1b70(%r14), %eax
je 0x56961
orl $0x60, %ecx
movl %ecx, 0x128(%r15)
movl 0x1c60(%r14), %eax
testl %eax, %eax
jle 0x569c2
decl %eax
movl %eax, 0x1c60(%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x634e2(%rip), %rdi     # 0xb9e6d
leaq 0x617d3(%rip), %rsi     # 0xb8165
leaq 0x634ea(%rip), %rcx     # 0xb9e83
movl $0x1d82, %edx           # imm = 0x1D82
callq 0xc140
leaq 0x634f0(%rip), %rdi     # 0xb9e9a
leaq 0x617b4(%rip), %rsi     # 0xb8165
leaq 0x634cb(%rip), %rcx     # 0xb9e83
movl $0x1d85, %edx           # imm = 0x1D85
callq 0xc140
leaq 0x79011(%rip), %rdi     # 0xcf9da
leaq 0x64cbb(%rip), %rsi     # 0xbb68b
leaq 0x663e0(%rip), %rcx     # 0xbcdb7
movl $0x672, %edx            # imm = 0x672
callq 0xc140