// File: Ciaxur[P]yagb-emu/include/imgui/imgui.cpp
// Function: ImGui::NewFrame()
void ImGui::NewFrame()
{
    IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
    ImGuiContext& g = *GImGui;

    CallContextHooks(&g, ImGuiContextHookType_NewFramePre);

    // Check and assert for various common IO and Configuration mistakes
    ErrorCheckNewFrameSanityChecks();

    // Load settings on first frame, save settings when modified (after a delay)
    UpdateSettings();

    g.Time += g.IO.DeltaTime;
    g.WithinFrameScope = true;
    g.FrameCount += 1;
    g.TooltipOverrideCount = 0;
    g.WindowsActiveCount = 0;
    g.MenusIdSubmittedThisFrame.resize(0);

    // Calculate frame-rate for the user, as a purely luxurious feature
    g.FramerateSecPerFrameAccum += g.IO.DeltaTime - g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx];
    g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx] = g.IO.DeltaTime;
    g.FramerateSecPerFrameIdx = (g.FramerateSecPerFrameIdx + 1) % IM_ARRAYSIZE(g.FramerateSecPerFrame);
    g.IO.Framerate = (g.FramerateSecPerFrameAccum > 0.0f) ? (1.0f / (g.FramerateSecPerFrameAccum / (float)IM_ARRAYSIZE(g.FramerateSecPerFrame))) : FLT_MAX;

    // Setup current font and draw list shared data
    g.IO.Fonts->Locked = true;
    SetCurrentFont(GetDefaultFont());
    IM_ASSERT(g.Font->IsLoaded());
    g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
    g.DrawListSharedData.CurveTessellationTol = g.Style.CurveTessellationTol;
    g.DrawListSharedData.SetCircleSegmentMaxError(g.Style.CircleSegmentMaxError);
    g.DrawListSharedData.InitialFlags = ImDrawListFlags_None;
    if (g.Style.AntiAliasedLines)
        g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLines;
    if (g.Style.AntiAliasedLinesUseTex && !(g.Font->ContainerAtlas->Flags & ImFontAtlasFlags_NoBakedLines))
        g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedLinesUseTex;
    if (g.Style.AntiAliasedFill)
        g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AntiAliasedFill;
    if (g.IO.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset)
        g.DrawListSharedData.InitialFlags |= ImDrawListFlags_AllowVtxOffset;

    g.BackgroundDrawList._ResetForNewFrame();
    g.BackgroundDrawList.PushTextureID(g.IO.Fonts->TexID);
    g.BackgroundDrawList.PushClipRectFullScreen();

    g.ForegroundDrawList._ResetForNewFrame();
    g.ForegroundDrawList.PushTextureID(g.IO.Fonts->TexID);
    g.ForegroundDrawList.PushClipRectFullScreen();

    // Mark rendering data as invalid to prevent user who may have a handle on it to use it.
    g.DrawData.Clear();

    // Drag and drop keep the source ID alive so even if the source disappear our state is consistent
    if (g.DragDropActive && g.DragDropPayload.SourceId == g.ActiveId)
        KeepAliveID(g.DragDropPayload.SourceId);

    // Update HoveredId data
    if (!g.HoveredIdPreviousFrame)
        g.HoveredIdTimer = 0.0f;
    if (!g.HoveredIdPreviousFrame || (g.HoveredId && g.ActiveId == g.HoveredId))
        g.HoveredIdNotActiveTimer = 0.0f;
    if (g.HoveredId)
        g.HoveredIdTimer += g.IO.DeltaTime;
    if (g.HoveredId && g.ActiveId != g.HoveredId)
        g.HoveredIdNotActiveTimer += g.IO.DeltaTime;
    g.HoveredIdPreviousFrame = g.HoveredId;
    g.HoveredIdPreviousFrameUsingMouseWheel = g.HoveredIdUsingMouseWheel;
    g.HoveredId = 0;
    g.HoveredIdAllowOverlap = false;
    g.HoveredIdUsingMouseWheel = false;
    g.HoveredIdDisabled = false;

    // Update ActiveId data (clear reference to active widget if the widget isn't alive anymore)
    if (g.ActiveIdIsAlive != g.ActiveId && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0)
        ClearActiveID();
    if (g.ActiveId)
        g.ActiveIdTimer += g.IO.DeltaTime;
    g.LastActiveIdTimer += g.IO.DeltaTime;
    g.ActiveIdPreviousFrame = g.ActiveId;
    g.ActiveIdPreviousFrameWindow = g.ActiveIdWindow;
    g.ActiveIdPreviousFrameHasBeenEditedBefore = g.ActiveIdHasBeenEditedBefore;
    g.ActiveIdIsAlive = 0;
    g.ActiveIdHasBeenEditedThisFrame = false;
    g.ActiveIdPreviousFrameIsAlive = false;
    g.ActiveIdIsJustActivated = false;
    if (g.TempInputId != 0 && g.ActiveId != g.TempInputId)
        g.TempInputId = 0;
    if (g.ActiveId == 0)
    {
        g.ActiveIdUsingNavDirMask = 0x00;
        g.ActiveIdUsingNavInputMask = 0x00;
        g.ActiveIdUsingKeyInputMask = 0x00;
    }

    // Drag and drop
    g.DragDropAcceptIdPrev = g.DragDropAcceptIdCurr;
    g.DragDropAcceptIdCurr = 0;
    g.DragDropAcceptIdCurrRectSurface = FLT_MAX;
    g.DragDropWithinSource = false;
    g.DragDropWithinTarget = false;
    g.DragDropHoldJustPressedId = 0;

    // Update keyboard input state
    // Synchronize io.KeyMods with individual modifiers io.KeyXXX bools
    g.IO.KeyMods = GetMergedKeyModFlags();
    memcpy(g.IO.KeysDownDurationPrev, g.IO.KeysDownDuration, sizeof(g.IO.KeysDownDuration));
    for (int i = 0; i < IM_ARRAYSIZE(g.IO.KeysDown); i++)
        g.IO.KeysDownDuration[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownDuration[i] < 0.0f ? 0.0f : g.IO.KeysDownDuration[i] + g.IO.DeltaTime) : -1.0f;

    // Update gamepad/keyboard navigation
    NavUpdate();

    // Update mouse input state
    UpdateMouseInputs();

    // Find hovered window
    // (needs to be before UpdateMouseMovingWindowNewFrame so we fill g.HoveredWindowUnderMovingWindow on the mouse release frame)
    UpdateHoveredWindowAndCaptureFlags();

    // Handle user moving window with mouse (at the beginning of the frame to avoid input lag or sheering)
    UpdateMouseMovingWindowNewFrame();

    // Background darkening/whitening
    if (GetTopMostPopupModal() != NULL || (g.NavWindowingTarget != NULL && g.NavWindowingHighlightAlpha > 0.0f))
        g.DimBgRatio = ImMin(g.DimBgRatio + g.IO.DeltaTime * 6.0f, 1.0f);
    else
        g.DimBgRatio = ImMax(g.DimBgRatio - g.IO.DeltaTime * 10.0f, 0.0f);

    g.MouseCursor = ImGuiMouseCursor_Arrow;
    g.WantCaptureMouseNextFrame = g.WantCaptureKeyboardNextFrame = g.WantTextInputNextFrame = -1;
    g.PlatformImePos = ImVec2(1.0f, 1.0f); // OS Input Method Editor showing on top-left of our window by default

    // Mouse wheel scrolling, scale
    UpdateMouseWheel();

    // Update legacy TAB focus
    UpdateTabFocus();

    // Mark all windows as not visible and compact unused memory.
    IM_ASSERT(g.WindowsFocusOrder.Size == g.Windows.Size);
    const float memory_compact_start_time = (g.GcCompactAll || g.IO.ConfigMemoryCompactTimer < 0.0f) ? FLT_MAX : (float)g.Time - g.IO.ConfigMemoryCompactTimer;
    for (int i = 0; i != g.Windows.Size; i++)
    {
        ImGuiWindow* window = g.Windows[i];
        window->WasActive = window->Active;
        window->BeginCount = 0;
        window->Active = false;
        window->WriteAccessed = false;

        // Garbage collect transient buffers of recently unused windows
        if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time)
            GcCompactTransientWindowBuffers(window);
    }

    // Garbage collect transient buffers of recently unused tables
    for (int i = 0; i < g.TablesLastTimeActive.Size; i++)
        if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time)
            TableGcCompactTransientBuffers(g.Tables.GetByIndex(i));
    if (g.GcCompactAll)
        GcCompactTransientMiscBuffers();
    g.GcCompactAll = false;

    // Closing the focused window restore focus to the first active root window in descending z-order
    if (g.NavWindow && !g.NavWindow->WasActive)
        FocusTopMostWindowUnderOne(NULL, NULL);

    // No window should be open at the beginning of the frame.
    // But in order to allow the user to call NewFrame() multiple times without calling Render(), we are doing an explicit clear.
    g.CurrentWindowStack.resize(0);
    g.BeginPopupStack.resize(0);
    g.ItemFlagsStack.resize(0);
    g.ItemFlagsStack.push_back(ImGuiItemFlags_Default_);
    g.GroupStack.resize(0);
    ClosePopupsOverWindow(g.NavWindow, false);

    // [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack.
    UpdateDebugToolItemPicker();

    // Create implicit/fallback window - which we will only render it if the user has added something to it.
    // We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags.
    // This fallback is particularly important as it avoid ImGui:: calls from crashing.
    g.WithinFrameScopeWithImplicitWindow = true;
    SetNextWindowSize(ImVec2(400, 400), ImGuiCond_FirstUseEver);
    Begin("Debug##Default");
    IM_ASSERT(g.CurrentWindow->IsFallbackWindow == true);

    CallContextHooks(&g, ImGuiContextHookType_NewFramePost);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
xorl %eax, %eax
cmpq $0x0, 0x1468ae(%rip)    # 0x212f40
movb %al, -0x49(%rbp)
je 0xcc69e
movb $0x1, %al
movb %al, -0x49(%rbp)
jmp 0xcc69e
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0xcc6a7
jmp 0xcc6a9
jmp 0xcc6c8
leaq 0xa6bbf(%rip), %rdi     # 0x17326f
leaq 0xa6852(%rip), %rsi     # 0x172f09
movl $0xec5, %edx            # imm = 0xEC5
leaq 0xa71ec(%rip), %rcx     # 0x1738af
callq 0xd180
movq 0x146871(%rip), %rax    # 0x212f40
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xcb100
callq 0xcd250
callq 0xcd700
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movq -0x8(%rbp), %rax
addsd 0x1a60(%rax), %xmm0
movsd %xmm0, 0x1a60(%rax)
movq -0x8(%rbp), %rax
movb $0x1, 0x1a74(%rax)
movq -0x8(%rbp), %rax
movl 0x1a68(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x1a68(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x30a8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1ad8(%rax)
movq -0x8(%rbp), %rdi
addq $0x30c0, %rdi           # imm = 0x30C0
xorl %esi, %esi
callq 0xea790
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x3364(%rcx), %rcx
subss 0x3184(%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
addss 0x3368(%rax), %xmm0
movss %xmm0, 0x3368(%rax)
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x3364(%rcx), %rcx
movss %xmm0, 0x3184(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movl 0x3364(%rax), %eax
addl $0x1, %eax
movl $0x78, %ecx
cltd
idivl %ecx
movq -0x8(%rbp), %rax
movl %edx, 0x3364(%rax)
movq -0x8(%rbp), %rax
movss 0x3368(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xcc809
movq -0x8(%rbp), %rax
movss 0x3368(%rax), %xmm1
movss 0xa5f82(%rip), %xmm0    # 0x172774
divss %xmm0, %xmm1
movss 0xa443e(%rip), %xmm0    # 0x170c3c
divss %xmm1, %xmm0
movss %xmm0, -0x50(%rbp)
jmp 0xcc818
movss 0xa57a3(%rip), %xmm0    # 0x171fb4
movss %xmm0, -0x50(%rbp)
jmp 0xcc818
movss -0x50(%rbp), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x3a0(%rax)
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movb $0x1, (%rax)
callq 0xea7e0
movq %rax, %rdi
callq 0xcd800
movq -0x8(%rbp), %rax
movq 0x1978(%rax), %rdi
callq 0xea840
testb $0x1, %al
jne 0xcc85a
jmp 0xcc85c
jmp 0xcc87b
leaq 0xa7063(%rip), %rdi     # 0x1738c6
leaq 0xa669f(%rip), %rsi     # 0x172f09
movl $0xee0, %edx            # imm = 0xEE0
leaq 0xa7039(%rip), %rcx     # 0x1738af
callq 0xd180
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm2
movq -0x8(%rbp), %rax
movss 0x14(%rax), %xmm3
leaq -0x18(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xbf4f0
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, 0x19a4(%rax)
movq -0x10(%rbp), %rcx
movq %rcx, 0x19ac(%rax)
movq -0x8(%rbp), %rax
movss 0x161c(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x199c(%rax)
movq -0x8(%rbp), %rdi
addq $0x1988, %rdi           # imm = 0x1988
movq -0x8(%rbp), %rax
movss 0x1620(%rax), %xmm0
callq 0x10ec50
movq -0x8(%rbp), %rax
movl $0x0, 0x19b4(%rax)
movq -0x8(%rbp), %rax
testb $0x1, 0x1618(%rax)
je 0xcc918
movq -0x8(%rbp), %rax
movl 0x19b4(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x19b4(%rax)
movq -0x8(%rbp), %rax
testb $0x1, 0x1619(%rax)
je 0xcc952
movq -0x8(%rbp), %rax
movq 0x1978(%rax), %rax
movq 0x40(%rax), %rax
movl 0x4(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0xcc952
movq -0x8(%rbp), %rax
movl 0x19b4(%rax), %ecx
orl $0x2, %ecx
movl %ecx, 0x19b4(%rax)
movq -0x8(%rbp), %rax
testb $0x1, 0x161a(%rax)
je 0xcc972
movq -0x8(%rbp), %rax
movl 0x19b4(%rax), %ecx
orl $0x4, %ecx
movl %ecx, 0x19b4(%rax)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0xcc994
movq -0x8(%rbp), %rax
movl 0x19b4(%rax), %ecx
orl $0x8, %ecx
movl %ecx, 0x19b4(%rax)
movq -0x8(%rbp), %rdi
addq $0x1e70, %rdi           # imm = 0x1E70
callq 0x10ed80
movq -0x8(%rbp), %rdi
addq $0x1e70, %rdi           # imm = 0x1E70
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x10f740
movq -0x8(%rbp), %rdi
addq $0x1e70, %rdi           # imm = 0x1E70
callq 0x10f650
movq -0x8(%rbp), %rdi
addq $0x1f38, %rdi           # imm = 0x1F38
callq 0x10ed80
movq -0x8(%rbp), %rdi
addq $0x1f38, %rdi           # imm = 0x1F38
movq -0x8(%rbp), %rax
movq 0xa8(%rax), %rax
movq 0x8(%rax), %rsi
callq 0x10f740
movq -0x8(%rbp), %rdi
addq $0x1f38, %rdi           # imm = 0x1F38
callq 0x10f650
movq -0x8(%rbp), %rdi
addq $0x1e10, %rdi           # imm = 0x1E10
callq 0xea860
movq -0x8(%rbp), %rax
testb $0x1, 0x2004(%rax)
je 0xcca54
movq -0x8(%rbp), %rax
movl 0x2024(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1b30(%rcx), %eax
jne 0xcca54
movq -0x8(%rbp), %rax
movl 0x2024(%rax), %edi
callq 0xc9a90
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1b20(%rax)
jne 0xcca70
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1b28(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1b20(%rax)
je 0xccaa0
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1b1c(%rax)
je 0xccaaf
movq -0x8(%rbp), %rax
movl 0x1b30(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1b1c(%rcx), %eax
jne 0xccaaf
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x1b2c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1b1c(%rax)
je 0xccad9
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x1b28(%rax), %xmm0
movss %xmm0, 0x1b28(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1b1c(%rax)
je 0xccb19
movq -0x8(%rbp), %rax
movl 0x1b30(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1b1c(%rcx), %eax
je 0xccb19
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x1b2c(%rax), %xmm0
movss %xmm0, 0x1b2c(%rax)
movq -0x8(%rbp), %rax
movl 0x1b1c(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1b20(%rax)
movq -0x8(%rbp), %rax
movb 0x1b25(%rax), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x1b26(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1b1c(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1b24(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1b25(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1b27(%rax)
movq -0x8(%rbp), %rax
movl 0x1b34(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1b30(%rcx), %eax
je 0xccbb1
movq -0x8(%rbp), %rax
movl 0x1b70(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1b30(%rcx), %eax
jne 0xccbb1
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1b30(%rax)
je 0xccbb1
callq 0xca040
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1b30(%rax)
je 0xccbdb
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x1b38(%rax), %xmm0
movss %xmm0, 0x1b38(%rax)
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x1b84(%rax), %xmm0
movss %xmm0, 0x1b84(%rax)
movq -0x8(%rbp), %rax
movl 0x1b30(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1b70(%rax)
movq -0x8(%rbp), %rax
movq 0x1b60(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1b78(%rax)
movq -0x8(%rbp), %rax
movb 0x1b40(%rax), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x1b75(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1b34(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1b41(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1b74(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1b3c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x3068(%rax)
je 0xccc99
movq -0x8(%rbp), %rax
movl 0x1b30(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x3068(%rcx), %eax
je 0xccc99
movq -0x8(%rbp), %rax
movl $0x0, 0x3068(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1b30(%rax)
jne 0xcccd1
movq -0x8(%rbp), %rax
movl $0x0, 0x1b44(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1b48(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x1b50(%rax)
movq -0x8(%rbp), %rax
movl 0x2074(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2078(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x2074(%rax)
movq -0x8(%rbp), %rax
movss 0xa52b5(%rip), %xmm0    # 0x171fb4
movss %xmm0, 0x2070(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x2005(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x2006(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x2080(%rax)
callq 0xcc600
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x3c0(%rax)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0xc98, %rdi            # imm = 0xC98
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
addq $0x498, %rsi            # imm = 0x498
movl $0x800, %edx            # imm = 0x800
callq 0xd0a0
movl $0x0, -0x1c(%rbp)
cmpl $0x200, -0x1c(%rbp)     # imm = 0x200
jge 0xcce07
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
testb $0x1, 0x144(%rax,%rcx)
je 0xccdd4
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
xorps %xmm0, %xmm0
ucomiss 0x4a0(%rax,%rcx,4), %xmm0
jbe 0xccda9
xorps %xmm0, %xmm0
movss %xmm0, -0x54(%rbp)
jmp 0xccdc8
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movss 0x4a0(%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
addss 0x18(%rax), %xmm0
movss %xmm0, -0x54(%rbp)
movss -0x54(%rbp), %xmm0
movss %xmm0, -0x58(%rbp)
jmp 0xccde3
movss 0xa51a4(%rip), %xmm0    # 0x171f80
movss %xmm0, -0x58(%rbp)
jmp 0xccde3
movss -0x58(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movss %xmm0, 0x4a0(%rax,%rcx,4)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0xccd6b
callq 0xcd990
callq 0xcef10
callq 0xcbf40
callq 0xcb560
callq 0xcbca0
cmpq $0x0, %rax
jne 0xcce48
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1dc0(%rax)
je 0xcce88
movq -0x8(%rbp), %rax
movss 0x1ddc(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xcce88
movq -0x8(%rbp), %rax
movss 0x1e68(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movss 0xa517b(%rip), %xmm2    # 0x171fe0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0xa3dc7(%rip), %xmm1    # 0x170c3c
callq 0xc4620
movq -0x8(%rbp), %rax
movss %xmm0, 0x1e68(%rax)
jmp 0xccece
movq -0x8(%rbp), %rax
movss 0x1e68(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x18(%rax), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss 0xa512a(%rip), %xmm2    # 0x171fdc
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
xorps %xmm1, %xmm1
callq 0xc88c0
movq -0x8(%rbp), %rax
movss %xmm0, 0x1e68(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x2000(%rax)
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x3374(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x3370(%rax) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rax
movl $0xffffffff, 0x336c(%rax) # imm = 0xFFFFFFFF
leaq -0x24(%rbp), %rdi
movss 0xa3d2a(%rip), %xmm1    # 0x170c3c
movaps %xmm1, %xmm0
callq 0xbf4c0
movq -0x8(%rbp), %rax
movq -0x24(%rbp), %rcx
movq %rcx, 0x30d0(%rax)
callq 0xcf500
callq 0xcfc60
movq -0x8(%rbp), %rax
movl 0x1a98(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1a88(%rcx), %eax
jne 0xccf4b
jmp 0xccf6a
leaq 0xa6987(%rip), %rdi     # 0x1738d9
leaq 0xa5fb0(%rip), %rsi     # 0x172f09
movl $0xf50, %edx            # imm = 0xF50
leaq 0xa694a(%rip), %rcx     # 0x1738af
callq 0xd180
movq -0x8(%rbp), %rax
testb $0x1, 0x1a77(%rax)
jne 0xccf87
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0xd0(%rax), %xmm0
jbe 0xccf96
movss 0xa5025(%rip), %xmm0    # 0x171fb4
movss %xmm0, -0x5c(%rbp)
jmp 0xccfb7
movq -0x8(%rbp), %rax
movsd 0x1a60(%rax), %xmm0
cvtsd2ss %xmm0, %xmm0
movq -0x8(%rbp), %rax
subss 0xd0(%rax), %xmm0
movss %xmm0, -0x5c(%rbp)
movss -0x5c(%rbp), %xmm0
movss %xmm0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1a88(%rcx), %eax
je 0xcd078
movq -0x8(%rbp), %rdi
addq $0x1a88, %rdi           # imm = 0x1A88
movl -0x2c(%rbp), %esi
callq 0xea8d0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb 0x8e(%rax), %cl
movq -0x38(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x8f(%rax)
movq -0x38(%rbp), %rax
movw $0x0, 0x9a(%rax)
movq -0x38(%rbp), %rax
movb $0x0, 0x8e(%rax)
movq -0x38(%rbp), %rax
movb $0x0, 0x90(%rax)
movq -0x38(%rbp), %rax
testb $0x1, 0x8f(%rax)
jne 0xcd068
movq -0x38(%rbp), %rax
testb $0x1, 0x3e0(%rax)
jne 0xcd068
movq -0x38(%rbp), %rax
movss 0x284(%rax), %xmm1
movss -0x28(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xcd068
movq -0x38(%rbp), %rdi
callq 0xc9d80
jmp 0xcd06a
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0xccfc8
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x20e8(%rcx), %eax
jge 0xcd0f6
movq -0x8(%rbp), %rdi
addq $0x20e8, %rdi           # imm = 0x20E8
movl -0x3c(%rbp), %esi
callq 0xea950
movss (%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0xcd0e9
movq -0x8(%rbp), %rdi
addq $0x20e8, %rdi           # imm = 0x20E8
movl -0x3c(%rbp), %esi
callq 0xea950
movss (%rax), %xmm1
movss -0x28(%rbp), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xcd0e9
movq -0x8(%rbp), %rdi
addq $0x20b0, %rdi           # imm = 0x20B0
movl -0x3c(%rbp), %esi
callq 0xea9d0
movq %rax, %rdi
callq 0x134230
jmp 0xcd0eb
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0xcd07f
movq -0x8(%rbp), %rax
testb $0x1, 0x1a77(%rax)
je 0xcd108
callq 0xc9d40
movq -0x8(%rbp), %rax
movb $0x0, 0x1a77(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1c90(%rax)
je 0xcd141
movq -0x8(%rbp), %rax
movq 0x1c90(%rax), %rax
testb $0x1, 0x8f(%rax)
jne 0xcd141
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0xcfed0
movq -0x8(%rbp), %rdi
addq $0x1ab8, %rdi           # imm = 0x1AB8
xorl %esi, %esi
callq 0xeaa00
movq -0x8(%rbp), %rdi
addq $0x1c80, %rdi           # imm = 0x1C80
xorl %esi, %esi
callq 0xeaa50
movq -0x8(%rbp), %rdi
addq $0x1c50, %rdi           # imm = 0x1C50
xorl %esi, %esi
callq 0xeaaa0
movq -0x8(%rbp), %rdi
addq $0x1c50, %rdi           # imm = 0x1C50
movl $0x0, -0x40(%rbp)
leaq -0x40(%rbp), %rsi
callq 0xeaaf0
movq -0x8(%rbp), %rdi
addq $0x1c60, %rdi           # imm = 0x1C60
xorl %esi, %esi
callq 0xeab50
movq -0x8(%rbp), %rax
movq 0x1c90(%rax), %rdi
xorl %esi, %esi
callq 0xcbdc0
callq 0xcffc0
movq -0x8(%rbp), %rax
movb $0x1, 0x1a75(%rax)
leaq -0x48(%rbp), %rdi
movss 0xa4daa(%rip), %xmm1    # 0x171f7c
movaps %xmm1, %xmm0
callq 0xbf4c0
leaq -0x48(%rbp), %rdi
movl $0x4, %esi
callq 0xd00c0
leaq 0xa6715(%rip), %rdi     # 0x173904
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0xd0170
movq -0x8(%rbp), %rax
movq 0x1ae0(%rax), %rax
movb 0x96(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xcd217
jmp 0xcd236
leaq 0xa66f5(%rip), %rdi     # 0x173913
leaq 0xa5ce4(%rip), %rsi     # 0x172f09
movl $0xf7d, %edx            # imm = 0xF7D
leaq 0xa667e(%rip), %rcx     # 0x1738af
callq 0xd180
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0xcb100
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)