// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::EndFrame()
void ImGui::EndFrame()
{
    ImGuiContext& g = *GImGui;
    IM_ASSERT(g.Initialized);

    // Don't process EndFrame() multiple times.
    if (g.FrameCountEnded == g.FrameCount)
        return;
    IM_ASSERT(g.WithinFrameScope && "Forgot to call ImGui::NewFrame()?");

    CallContextHooks(&g, ImGuiContextHookType_EndFramePre);

    ErrorCheckEndFrameSanityChecks();

    // Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
    if (g.IO.ImeSetInputScreenPosFn && (g.PlatformImeLastPos.x == FLT_MAX || ImLengthSqr(g.PlatformImeLastPos - g.PlatformImePos) > 0.0001f))
    {
        g.IO.ImeSetInputScreenPosFn((int)g.PlatformImePos.x, (int)g.PlatformImePos.y);
        g.PlatformImeLastPos = g.PlatformImePos;
    }

    // Hide implicit/fallback "Debug" window if it hasn't been used
    g.WithinFrameScopeWithImplicitWindow = false;
    if (g.CurrentWindow && !g.CurrentWindow->WriteAccessed)
        g.CurrentWindow->Active = false;
    End();

    // Update navigation: CTRL+Tab, wrap-around requests
    NavEndFrame();

    // Drag and Drop: Elapse payload (if delivered, or if source stops being submitted)
    if (g.DragDropActive)
    {
        bool is_delivered = g.DragDropPayload.Delivery;
        bool is_elapsed = (g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton));
        if (is_delivered || is_elapsed)
            ClearDragDrop();
    }

    // Drag and Drop: Fallback for source tooltip. This is not ideal but better than nothing.
    if (g.DragDropActive && g.DragDropSourceFrameCount < g.FrameCount && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoPreviewTooltip))
    {
        g.DragDropWithinSource = true;
        SetTooltip("...");
        g.DragDropWithinSource = false;
    }

    // End frame
    g.WithinFrameScope = false;
    g.FrameCountEnded = g.FrameCount;

    // Initiate moving window + handle left-click and right-click focus
    UpdateMouseMovingWindowEndFrame();

    // Sort the window list so that all child windows are after their parent
    // We cannot do that on FocusWindow() because children may not exist yet
    g.WindowsTempSortBuffer.resize(0);
    g.WindowsTempSortBuffer.reserve(g.Windows.Size);
    for (int i = 0; i != g.Windows.Size; i++)
    {
        ImGuiWindow* window = g.Windows[i];
        if (window->Active && (window->Flags & ImGuiWindowFlags_ChildWindow))       // if a child is active its parent will add it
            continue;
        AddWindowToSortBuffer(&g.WindowsTempSortBuffer, window);
    }

    // This usually assert if there is a mismatch between the ImGuiWindowFlags_ChildWindow / ParentWindow values and DC.ChildWindows[] in parents, aka we've done something wrong.
    IM_ASSERT(g.Windows.Size == g.WindowsTempSortBuffer.Size);
    g.Windows.swap(g.WindowsTempSortBuffer);
    g.IO.MetricsActiveWindows = g.WindowsActiveCount;

    // Unlock font atlas
    g.IO.Fonts->Locked = false;

    // Clear Input data for next frame
    g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f;
    g.IO.InputQueueCharacters.resize(0);
    memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs));

    CallContextHooks(&g, ImGuiContextHookType_EndFramePost);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq 0xa4b58(%rip), %rbx     # 0xe3ce0
cmpb $0x0, (%rbx)
je 0x3f85e
movl 0x1a6c(%rbx), %eax
cmpl 0x1a68(%rbx), %eax
je 0x3f84f
cmpb $0x0, 0x1a74(%rbx)
je 0x3f87d
pushq $0x2
popq %r12
movq %rbx, %rdi
movl %r12d, %esi
callq 0x37e1a
movq 0xa4b1a(%rip), %r14     # 0xe3ce0
callq 0x38b23
testl %eax, %eax
je 0x3f1dc
cmpl %eax, 0x3c0(%r14)
jne 0x3f8fb
movl 0x1ab8(%r14), %eax
cmpl $0x1, %eax
jne 0x3f89c
cmpl $0x0, 0x1c60(%r14)
jne 0x3f8bd
movq 0x118(%rbx), %rax
testq %rax, %rax
je 0x3f278
movss 0x30d8(%rbx), %xmm2
ucomiss 0x5d65b(%rip), %xmm2    # 0x9c870
jne 0x3f22b
jp 0x3f22b
movss 0x30d0(%rbx), %xmm0
movss 0x30d4(%rbx), %xmm1
jmp 0x3f260
movss 0x30d0(%rbx), %xmm0
movss 0x30d4(%rbx), %xmm1
subss %xmm0, %xmm2
movss 0x30dc(%rbx), %xmm3
subss %xmm1, %xmm3
mulss %xmm3, %xmm3
mulss %xmm2, %xmm2
addss %xmm3, %xmm2
ucomiss 0x5d69e(%rip), %xmm2    # 0x9c8fc
jbe 0x3f278
cvttss2si %xmm0, %edi
cvttss2si %xmm1, %esi
callq *%rax
movq 0x30d0(%rbx), %rax
movq %rax, 0x30d8(%rbx)
movb $0x0, 0x1a75(%rbx)
movq 0x1ae0(%rbx), %rax
testq %rax, %rax
je 0x3f29b
cmpb $0x0, 0x90(%rax)
jne 0x3f29b
movb $0x0, 0x8e(%rax)
callq 0x3f958
movq 0xa4a39(%rip), %r13     # 0xe3ce0
cmpq $0x0, 0x1dc0(%r13)
je 0x3f475
movss 0x5d643(%rip), %xmm0    # 0x9c900
ucomiss 0x1dd8(%r13), %xmm0
ja 0x3f475
cmpq $0x0, 0x1dd0(%r13)
jne 0x3f2e8
leaq 0x62192(%rip), %rdi     # 0xa146e
callq 0x412c3
movq %rax, 0x1dd0(%r13)
movss 0x10(%r13), %xmm0
movss 0x14(%r13), %xmm1
movss 0x5cd18(%rip), %xmm2    # 0x9c014
movaps %xmm0, %xmm3
mulss %xmm2, %xmm3
mulss %xmm1, %xmm2
movss %xmm3, 0x1bc4(%r13)
movss %xmm2, 0x1bc8(%r13)
movabsq $0x7f7fffff7f7fffff, %rax # imm = 0x7F7FFFFF7F7FFFFF
movq %rax, 0x1bcc(%r13)
movss 0x5cce6(%rip), %xmm2    # 0x9c018
mulss %xmm2, %xmm0
mulss %xmm2, %xmm1
xorps %xmm2, %xmm2
movups %xmm2, 0x1bd8(%r13)
orb $0x11, 0x1b88(%r13)
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movlps %xmm0, 0x1b98(%r13)
movabsq $0x3f0000003f000000, %rax # imm = 0x3F0000003F000000
movq %rax, 0x1ba0(%r13)
movl $0x1, 0x1b8c(%r13)
movss 0x1564(%r13), %xmm0
movss 0x1568(%r13), %xmm1
addss %xmm0, %xmm0
addss %xmm1, %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0x40(%rbp), %rsi
movlps %xmm0, (%rsi)
pushq $0x1
popq %rdi
callq 0x35fca
leaq 0x620c7(%rip), %rdi     # 0xa146e
xorl %esi, %esi
movl $0xc1347, %edx          # imm = 0xC1347
callq 0x3bad8
leaq 0x1a98(%r13), %r12
movq %r13, -0x48(%rbp)
movl 0x1a98(%r13), %r13d
testl %r13d, %r13d
jle 0x3f460
decl %r13d
movq %r12, %rdi
movl %r13d, %esi
callq 0x4ad62
movq (%rax), %r14
movq %r14, %rdi
callq 0x42754
testb %al, %al
je 0x3f3c5
movq (%r14), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x36123
cmpq %rax, %r15
je 0x3f402
movq %r15, %rdi
jmp 0x3f43a
movl 0xc(%r14), %eax
btl $0x1a, %eax
leaq 0x62071(%rip), %rdi     # 0xa1482
jb 0x3f43a
btl $0xa, %eax
jae 0x3f433
movq %r15, %rdi
leaq 0x62067(%rip), %rsi     # 0xa148a
callq 0xc760
leaq 0x62069(%rip), %rdi     # 0xa1498
testl %eax, %eax
je 0x3f43a
leaq 0x6206e(%rip), %rdi     # 0xa14a8
xorl %esi, %esi
movq -0x48(%rbp), %rax
cmpq %r14, 0x1dc0(%rax)
sete %sil
andq $0x0, -0x40(%rbp)
xorl %edx, %edx
leaq -0x40(%rbp), %rcx
callq 0x7d81c
jmp 0x3f3c5
callq 0x3f958
pushq $0x1
popq %rdi
callq 0x3605c
movq -0x48(%rbp), %r13
pushq $0x2
popq %r12
movq 0x1db0(%r13), %r14
testq %r14, %r14
je 0x3f6e3
cmpq %r14, 0x1c90(%r13)
jne 0x3f6e3
movl 0x1db8(%r13), %r15d
callq 0x455d9
testb %al, %al
je 0x3f6e3
cmpl $0x0, 0x1d08(%r13)
jne 0x3f6e3
cmpl $0x0, 0x1cdc(%r13)
jne 0x3f6e3
testl %r15d, %r15d
je 0x3f939
movl %r12d, %ecx
movups 0x3b8(%r14), %xmm0
movaps %xmm0, -0x40(%rbp)
movl 0x1d10(%r13), %eax
movl %eax, %r12d
testl %eax, %eax
jne 0x3f577
testb $0x5, %r15b
je 0x3f5e7
movss 0x20(%r14), %xmm0
movss 0x40(%r14), %xmm1
addss %xmm1, %xmm1
addss 0x28(%r14), %xmm1
movaps %xmm1, %xmm2
cmpless %xmm0, %xmm2
movaps %xmm2, %xmm3
andnps %xmm1, %xmm3
andps %xmm0, %xmm2
orps %xmm3, %xmm2
subss 0x5c(%r14), %xmm2
movss %xmm2, -0x38(%rbp)
movss %xmm2, -0x40(%rbp)
xorl %r12d, %r12d
testb $0x4, %r15b
je 0x3f55f
movss -0x3c(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
subss %xmm2, %xmm0
movss %xmm0, -0x3c(%rbp)
subss %xmm2, %xmm1
movss %xmm1, -0x34(%rbp)
movl %ecx, %r12d
leaq -0x40(%rbp), %rdx
xorl %edi, %edi
movl %r12d, %esi
movl %r15d, %ecx
callq 0x4561e
movl 0x1d10(%r13), %eax
testb $0x5, %r15b
sete %cl
cmpl $0x1, %eax
setne %dl
orb %cl, %dl
jne 0x3f5ec
movss 0x5c(%r14), %xmm0
xorps 0x5ca4b(%rip), %xmm0    # 0x9bfe0
movss %xmm0, -0x38(%rbp)
movss %xmm0, -0x40(%rbp)
testb $0x4, %r15b
je 0x3f5cc
movss -0x3c(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
addss %xmm2, %xmm0
movss %xmm0, -0x3c(%rbp)
addss %xmm1, %xmm2
movss %xmm2, -0x34(%rbp)
pushq $0x3
popq %r12
pushq $0x1
popq %rdi
leaq -0x40(%rbp), %rdx
movl %r12d, %esi
movl %r15d, %ecx
callq 0x4561e
movl 0x1d10(%r13), %eax
jmp 0x3f5ec
xorl %eax, %eax
xorl %r12d, %r12d
cmpl $0x2, %eax
setne %cl
testb $0xa, %r15b
sete %dl
orb %cl, %dl
jne 0x3f67c
movss 0x24(%r14), %xmm0
movss 0x44(%r14), %xmm1
addss %xmm1, %xmm1
addss 0x2c(%r14), %xmm1
movaps %xmm1, %xmm2
cmpless %xmm0, %xmm2
movaps %xmm2, %xmm3
andnps %xmm1, %xmm3
andps %xmm0, %xmm2
orps %xmm3, %xmm2
subss 0x60(%r14), %xmm2
movss %xmm2, -0x34(%rbp)
movss %xmm2, -0x3c(%rbp)
testb $0x8, %r15b
je 0x3f663
movss -0x40(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
subss %xmm2, %xmm0
movss %xmm0, -0x40(%rbp)
subss %xmm2, %xmm1
movss %xmm1, -0x38(%rbp)
xorl %r12d, %r12d
pushq $0x2
popq %rdi
leaq -0x40(%rbp), %rdx
movl %r12d, %esi
movl %r15d, %ecx
callq 0x4561e
movl 0x1d10(%r13), %eax
testb $0xa, %r15b
sete %cl
cmpl $0x3, %eax
setne %al
orb %cl, %al
jne 0x3f6e3
movss 0x60(%r14), %xmm0
xorps 0x5c946(%rip), %xmm0    # 0x9bfe0
movss %xmm0, -0x34(%rbp)
movss %xmm0, -0x3c(%rbp)
testb $0x8, %r15b
je 0x3f6d1
pushq $0x1
popq %r12
movss -0x40(%rbp), %xmm0
movss -0x38(%rbp), %xmm1
movaps %xmm1, %xmm2
subss %xmm0, %xmm2
addss %xmm2, %xmm0
movss %xmm0, -0x40(%rbp)
addss %xmm1, %xmm2
movss %xmm2, -0x38(%rbp)
pushq $0x3
popq %rdi
leaq -0x40(%rbp), %rdx
movl %r12d, %esi
movl %r15d, %ecx
callq 0x4561e
cmpb $0x1, 0x2004(%rbx)
jne 0x3f72b
movb 0x2052(%rbx), %r14b
movl 0x202c(%rbx), %eax
incl %eax
cmpl 0x1a68(%rbx), %eax
jge 0x3f71b
testb $0x20, 0x2008(%rbx)
jne 0x3f726
movl 0x2010(%rbx), %edi
callq 0x3fa7a
xorb $0x1, %al
jmp 0x3f71d
xorl %eax, %eax
testb %al, %al
jne 0x3f726
testb %r14b, %r14b
je 0x3f72b
callq 0x3fab3
movl 0x1a68(%rbx), %eax
cmpb $0x1, 0x2004(%rbx)
jne 0x3f76d
cmpl %eax, 0x200c(%rbx)
jge 0x3f76d
testb $0x1, 0x2008(%rbx)
jne 0x3f76d
movb $0x1, 0x2005(%rbx)
leaq 0x6c29d(%rip), %rdi     # 0xab9f6
xorl %eax, %eax
callq 0x3fb35
movb $0x0, 0x2005(%rbx)
movl 0x1a68(%rbx), %eax
movb $0x0, 0x1a74(%rbx)
movl %eax, 0x1a6c(%rbx)
callq 0x38382
leaq 0x1aa8(%rbx), %r14
xorl %r12d, %r12d
movq %r14, %rdi
xorl %esi, %esi
callq 0x4adce
leaq 0x1a88(%rbx), %r15
movl 0x1a88(%rbx), %esi
movq %r14, %rdi
callq 0x4b2da
cmpl (%r15), %r12d
je 0x3f7d7
movq %r15, %rdi
movl %r12d, %esi
callq 0x4ad62
movq (%rax), %rsi
cmpb $0x1, 0x8e(%rsi)
jne 0x3f7ca
testb $0x1, 0xf(%rsi)
jne 0x3f7d2
movq %r14, %rdi
callq 0x3fbb0
incl %r12d
jmp 0x3f7a8
cmpl %r12d, (%r14)
jne 0x3f8dc
movq %r15, %rdi
movq %r14, %rsi
callq 0x4b332
movl 0x1ad8(%rbx), %eax
movl %eax, 0x3b0(%rbx)
movq 0xa8(%rbx), %rax
movb $0x0, (%rax)
andq $0x0, 0x138(%rbx)
leaq 0x1550(%rbx), %rdi
xorl %esi, %esi
callq 0x49a10
xorps %xmm0, %xmm0
movups %xmm0, 0x384(%rbx)
movups %xmm0, 0x374(%rbx)
movups %xmm0, 0x364(%rbx)
movups %xmm0, 0x354(%rbx)
movups %xmm0, 0x344(%rbx)
andl $0x0, 0x394(%rbx)
pushq $0x3
popq %rsi
movq %rbx, %rdi
callq 0x37e1a
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5e2d6(%rip), %rdi     # 0x9db3b
leaq 0x5d929(%rip), %rsi     # 0x9d195
leaq 0x5e2d6(%rip), %rcx     # 0x9db49
movl $0x1096, %edx           # imm = 0x1096
callq 0xc140
leaq 0x5e2dc(%rip), %rdi     # 0x9db60
leaq 0x5d90a(%rip), %rsi     # 0x9d195
leaq 0x5e2b7(%rip), %rcx     # 0x9db49
movl $0x109b, %edx           # imm = 0x109B
callq 0xc140
jle 0x3f91a
leaq 0x6180d(%rip), %rdi     # 0xa10b2
leaq 0x5d8e9(%rip), %rsi     # 0x9d195
leaq 0x617d2(%rip), %rcx     # 0xa1085
movl $0x1b5f, %edx           # imm = 0x1B5F
callq 0xc140
leaq 0x618e9(%rip), %rdi     # 0xa11ad
leaq 0x5d8ca(%rip), %rsi     # 0x9d195
leaq 0x617b3(%rip), %rcx     # 0xa1085
movl $0x1b69, %edx           # imm = 0x1B69
callq 0xc140
leaq 0x5e2b7(%rip), %rdi     # 0x9db9a
leaq 0x5d8ab(%rip), %rsi     # 0x9d195
leaq 0x5e258(%rip), %rcx     # 0x9db49
movl $0x10d6, %edx           # imm = 0x10D6
callq 0xc140
leaq 0x61701(%rip), %rdi     # 0xa1003
leaq 0x5d88c(%rip), %rsi     # 0x9d195
leaq 0x61775(%rip), %rcx     # 0xa1085
movl $0x1b53, %edx           # imm = 0x1B53
callq 0xc140
leaq 0x6180f(%rip), %rdi     # 0xa1130
leaq 0x5d86d(%rip), %rsi     # 0x9d195
leaq 0x61756(%rip), %rcx     # 0xa1085
movl $0x1b65, %edx           # imm = 0x1B65
callq 0xc140
leaq 0x61b04(%rip), %rdi     # 0xa1444
leaq 0x5d84e(%rip), %rsi     # 0x9d195
leaq 0x61b06(%rip), %rcx     # 0xa1454
movl $0x2413, %edx           # imm = 0x2413
callq 0xc140