// File: Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::NavUpdateMoveResult()
static void ImGui::NavUpdateMoveResult()
{
    ImGuiContext& g = *GImGui;
    if (g.NavMoveResultLocal.ID == 0 && g.NavMoveResultOther.ID == 0)
    {
        // In a situation when there is no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result)
        if (g.NavId != 0)
        {
            g.NavDisableHighlight = false;
            g.NavDisableMouseHover = true;
        }
        return;
    }

    // Select which result to use
    ImGuiNavMoveResult* result = (g.NavMoveResultLocal.ID != 0) ? &g.NavMoveResultLocal : &g.NavMoveResultOther;

    // PageUp/PageDown behavior first jumps to the bottom/top mostly visible item, _otherwise_ use the result from the previous/next page.
    if (g.NavMoveRequestFlags & ImGuiNavMoveFlags_AlsoScoreVisibleSet)
        if (g.NavMoveResultLocalVisibleSet.ID != 0 && g.NavMoveResultLocalVisibleSet.ID != g.NavId)
            result = &g.NavMoveResultLocalVisibleSet;

    // Maybe entering a flattened child from the outside? In this case solve the tie using the regular scoring rules.
    if (result != &g.NavMoveResultOther && g.NavMoveResultOther.ID != 0 && g.NavMoveResultOther.Window->ParentWindow == g.NavWindow)
        if ((g.NavMoveResultOther.DistBox < result->DistBox) || (g.NavMoveResultOther.DistBox == result->DistBox && g.NavMoveResultOther.DistCenter < result->DistCenter))
            result = &g.NavMoveResultOther;
    IM_ASSERT(g.NavWindow && result->Window);

    // Scroll to keep newly navigated item fully into view.
    if (g.NavLayer == ImGuiNavLayer_Main)
    {
        ImVec2 delta_scroll;
        if (g.NavMoveRequestFlags & ImGuiNavMoveFlags_ScrollToEdge)
        {
            float scroll_target = (g.NavMoveDir == ImGuiDir_Up) ? result->Window->ScrollMax.y : 0.0f;
            delta_scroll.y = result->Window->Scroll.y - scroll_target;
            SetScrollY(result->Window, scroll_target);
        }
        else
        {
            ImRect rect_abs = ImRect(result->RectRel.Min + result->Window->Pos, result->RectRel.Max + result->Window->Pos);
            delta_scroll = ScrollToBringRectIntoView(result->Window, rect_abs);
        }

        // Offset our result position so mouse position can be applied immediately after in NavUpdate()
        result->RectRel.TranslateX(-delta_scroll.x);
        result->RectRel.TranslateY(-delta_scroll.y);
    }

    ClearActiveID();
    g.NavWindow = result->Window;
    if (g.NavId != result->ID)
    {
        // Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId)
        g.NavJustMovedToId = result->ID;
        g.NavJustMovedToFocusScopeId = result->FocusScopeId;
        g.NavJustMovedToKeyMods = g.NavMoveRequestKeyMods;
    }
    IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name);
    SetNavIDWithRectRel(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq 0x12c891(%rip), %rax    # 0x212f40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1d28(%rax)
jne 0xe66f5
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1d88(%rax)
jne 0xe66f5
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1c98(%rax)
je 0xe66f0
movq -0x8(%rbp), %rax
movb $0x0, 0x1ce6(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x1ce7(%rax)
jmp 0xe6a0e
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1d28(%rax)
je 0xe6712
movq -0x8(%rbp), %rax
addq $0x1d20, %rax           # imm = 0x1D20
movq %rax, -0x50(%rbp)
jmp 0xe6720
movq -0x8(%rbp), %rax
addq $0x1d80, %rax           # imm = 0x1D80
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x1d04(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0xe676d
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1d58(%rax)
je 0xe676b
movq -0x8(%rbp), %rax
movl 0x1d58(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1c98(%rcx), %eax
je 0xe676b
movq -0x8(%rbp), %rax
addq $0x1d50, %rax           # imm = 0x1D50
movq %rax, -0x10(%rbp)
jmp 0xe676d
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
addq $0x1d80, %rcx           # imm = 0x1D80
cmpq %rcx, %rax
je 0xe680d
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1d88(%rax)
je 0xe680d
movq -0x8(%rbp), %rax
movq 0x1d80(%rax), %rax
movq 0x388(%rax), %rax
movq -0x8(%rbp), %rcx
cmpq 0x1c90(%rcx), %rax
jne 0xe680d
movq -0x8(%rbp), %rax
movss 0x1d90(%rax), %xmm1
movq -0x10(%rbp), %rax
movss 0x10(%rax), %xmm0
ucomiss %xmm1, %xmm0
ja 0xe67fd
movq -0x8(%rbp), %rax
movss 0x1d90(%rax), %xmm0
movq -0x10(%rbp), %rax
ucomiss 0x10(%rax), %xmm0
jne 0xe680b
jp 0xe680b
movq -0x8(%rbp), %rax
movss 0x1d94(%rax), %xmm1
movq -0x10(%rbp), %rax
movss 0x14(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xe680b
movq -0x8(%rbp), %rax
addq $0x1d80, %rax           # imm = 0x1D80
movq %rax, -0x10(%rbp)
jmp 0xe680d
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x1c90(%rcx)
movb %al, -0x51(%rbp)
je 0xe682e
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, -0x51(%rbp)
movb -0x51(%rbp), %al
testb $0x1, %al
jne 0xe6837
jmp 0xe6839
jmp 0xe6858
leaq 0x90ee8(%rip), %rdi     # 0x177728
leaq 0x8c6c2(%rip), %rsi     # 0x172f09
movl $0x2398, %edx           # imm = 0x2398
leaq 0x90ef3(%rip), %rcx     # 0x177746
callq 0xd180
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1cdc(%rax)
jne 0xe6989
leaq -0x18(%rbp), %rdi
callq 0xe7de0
movq -0x8(%rbp), %rax
movl 0x1d04(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0xe68e1
movq -0x8(%rbp), %rax
cmpl $0x2, 0x1d10(%rax)
jne 0xe68a4
movq -0x10(%rbp), %rax
movq (%rax), %rax
movss 0x68(%rax), %xmm0
movss %xmm0, -0x58(%rbp)
jmp 0xe68ae
xorps %xmm0, %xmm0
movss %xmm0, -0x58(%rbp)
jmp 0xe68ae
movss -0x58(%rbp), %xmm0
movss %xmm0, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movss 0x60(%rax), %xmm0
subss -0x1c(%rbp), %xmm0
movss %xmm0, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movss -0x1c(%rbp), %xmm0
callq 0xdd920
jmp 0xe694b
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x1c, %rdi
movq (%rax), %rsi
addq $0x10, %rsi
callq 0xc41b0
movlpd %xmm0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq %rax, %rdi
addq $0x24, %rdi
movq (%rax), %rsi
addq $0x10, %rsi
callq 0xc41b0
movlpd %xmm0, -0x3c(%rbp)
leaq -0x2c(%rbp), %rdi
movq %rdi, -0x60(%rbp)
leaq -0x34(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
callq 0xe8660
movq -0x60(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xdd3c0
movlpd %xmm0, -0x44(%rbp)
movq -0x44(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
addq $0x1c, %rdi
movss -0x18(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
callq 0xee870
movq -0x10(%rbp), %rdi
addq $0x1c, %rdi
movss -0x14(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
callq 0xee830
callq 0xca040
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1c90(%rax)
movq -0x8(%rbp), %rax
movl 0x1c98(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
je 0xe69e9
movq -0x10(%rbp), %rax
movl 0x8(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1cb4(%rax)
movq -0x10(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1cb8(%rax)
movq -0x8(%rbp), %rax
movl 0x1d0c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1cbc(%rax)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %edi
movq -0x8(%rbp), %rax
movl 0x1cdc(%rax), %esi
movq -0x10(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x10(%rbp), %rcx
addq $0x1c, %rcx
callq 0xdf3d0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)