// File: /workspace/github_cpp_makefile_star2_O3/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 %rbx
subq $0x18, %rsp
movq 0xa66a5(%rip), %rbx     # 0xfbcd0
movslq 0x1c60(%rbx), %rax
testq %rax, %rax
jle 0x558c0
movq 0x1ae0(%rbx), %r14
movq 0x1c68(%rbx), %r15
leaq (%rax,%rax,2), %rax
shlq $0x4, %rax
movl -0x30(%r15,%rax), %ecx
cmpl 0x8(%r14), %ecx
jne 0x558df
addq %rax, %r15
movss 0xf0(%r14), %xmm3
movss 0xf4(%r14), %xmm2
movss -0x2c(%r15), %xmm1
movss -0x28(%r15), %xmm4
movaps %xmm1, %xmm0
cmpless %xmm3, %xmm0
movaps %xmm0, %xmm5
andps %xmm3, %xmm5
andnps %xmm1, %xmm0
orps %xmm5, %xmm0
movaps %xmm4, %xmm1
cmpless %xmm2, %xmm1
movaps %xmm1, %xmm5
andps %xmm2, %xmm5
andnps %xmm4, %xmm1
orps %xmm5, %xmm1
movaps %xmm0, %xmm4
unpcklps %xmm1, %xmm4            # xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1]
movq -0x2c(%r15), %rax
movq %rax, -0x28(%rbp)
movlps %xmm4, -0x20(%rbp)
movq %rax, 0xd8(%r14)
movss -0x24(%r15), %xmm4
movss -0x20(%r15), %xmm5
movaps %xmm3, %xmm6
cmpless %xmm4, %xmm6
andps %xmm6, %xmm4
andnps %xmm3, %xmm6
orps %xmm4, %xmm6
movaps %xmm2, %xmm3
cmpless %xmm5, %xmm3
andps %xmm3, %xmm5
andnps %xmm2, %xmm3
orps %xmm5, %xmm3
unpcklps %xmm3, %xmm6            # xmm6 = xmm6[0],xmm3[0],xmm6[1],xmm3[1]
movlps %xmm6, 0xf0(%r14)
movl -0x1c(%r15), %ecx
movl %ecx, 0x118(%r14)
movl -0x18(%r15), %ecx
movl %ecx, 0x120(%r14)
movq -0x14(%r15), %rcx
movq %rcx, 0x100(%r14)
movss -0xc(%r15), %xmm2
movss %xmm2, 0x110(%r14)
cmpb $0x1, 0x3138(%rbx)
jne 0x5573e
movl $0xff7fffff, 0x3158(%rbx) # imm = 0xFF7FFFFF
cmpb $0x0, -0x3(%r15)
je 0x558a3
movq %rax, %rcx
shrq $0x20, %rcx
movd %eax, %xmm3
movd %ecx, %xmm4
movss 0x114(%r14), %xmm5
movaps %xmm2, %xmm6
cmpless %xmm5, %xmm6
andps %xmm6, %xmm5
andnps %xmm2, %xmm6
orps %xmm5, %xmm6
movss %xmm6, 0x110(%r14)
subss %xmm3, %xmm0
subss %xmm4, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x30(%rbp), %rdi
movlps %xmm0, (%rdi)
movss 0x5f83b(%rip), %xmm0    # 0xb4fd0
callq 0x52315
leaq -0x28(%rbp), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x524a8
movl 0x1b30(%rbx), %eax
cmpl %eax, -0x8(%r15)
jne 0x557cc
cmpb $0x0, -0x4(%r15)
jne 0x5588f
cmpb $0x0, 0x1b74(%rbx)
jne 0x55846
jmp 0x5588f
cmpl %eax, 0x1b34(%rbx)
sete %cl
testl %eax, %eax
setne %dl
andb %cl, %dl
cmpb $0x0, -0x4(%r15)
je 0x557ef
testb %dl, %dl
je 0x5588f
xorl %ecx, %ecx
jmp 0x557f9
movb 0x1b74(%rbx), %cl
testb %dl, %dl
je 0x55842
movl %eax, 0x124(%r14)
movups -0x28(%rbp), %xmm0
movups %xmm0, 0x12c(%r14)
movl 0x128(%r14), %eax
addq $0x128, %r14            # imm = 0x128
cmpb $0x1, 0x1b41(%rbx)
jne 0x55834
movl %eax, %edx
orl $0x24, %edx
movl %edx, (%r14)
testb %cl, %cl
je 0x558a3
orl $0x4, %eax
jmp 0x55879
movl %eax, %edx
orl $0x20, %edx
movl %edx, (%r14)
testb %cl, %cl
jne 0x55879
jmp 0x558a3
testb %cl, %cl
je 0x5588f
movl 0x1b70(%rbx), %eax
movl %eax, 0x124(%r14)
movups -0x28(%rbp), %xmm0
movups %xmm0, 0x12c(%r14)
movl 0x128(%r14), %eax
movl %eax, %ecx
orl $0x20, %ecx
movl %ecx, 0x128(%r14)
addq $0x128, %r14            # imm = 0x128
movl 0x1b30(%rbx), %ecx
cmpl 0x1b70(%rbx), %ecx
je 0x558a3
orl $0x60, %eax
movl %eax, (%r14)
jmp 0x558a3
movups -0x28(%rbp), %xmm0
movups %xmm0, 0x12c(%r14)
orb $0x20, 0x128(%r14)
movl 0x1c60(%rbx), %eax
testl %eax, %eax
jle 0x558fe
decl %eax
movl %eax, 0x1c60(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x625a6(%rip), %rdi     # 0xb7e6d
leaq 0x60897(%rip), %rsi     # 0xb6165
leaq 0x625ae(%rip), %rcx     # 0xb7e83
movl $0x1d82, %edx           # imm = 0x1D82
callq 0xc140
leaq 0x625b4(%rip), %rdi     # 0xb7e9a
leaq 0x60878(%rip), %rsi     # 0xb6165
leaq 0x6258f(%rip), %rcx     # 0xb7e83
movl $0x1d85, %edx           # imm = 0x1D85
callq 0xc140
leaq 0x780a5(%rip), %rdi     # 0xcd9aa
leaq 0x63d7f(%rip), %rsi     # 0xb968b
leaq 0x65477(%rip), %rcx     # 0xbad8a
movl $0x672, %edx            # imm = 0x672
callq 0xc140