// File: donfreiday[P]gb/./imgui/imgui.cpp
// Function: ImGui::NewFrame()
void ImGui::NewFrame()
{
    ImGuiState& g = *GImGui;

    // Check user data
    IM_ASSERT(g.IO.DeltaTime >= 0.0f);
    IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f);
    IM_ASSERT(g.IO.Fonts->Fonts.Size > 0);           // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?
    IM_ASSERT(g.IO.Fonts->Fonts[0]->IsLoaded());     // Font Atlas not created. Did you call io.Fonts->GetTexDataAsRGBA32 / GetTexDataAsAlpha8 ?
    IM_ASSERT(g.Style.CurveTessellationTol > 0.0f);  // Invalid

    if (!g.Initialized)
    {
        // Initialize on first frame
        g.LogClipboard = (ImGuiTextBuffer*)ImGui::MemAlloc(sizeof(ImGuiTextBuffer));
        new(g.LogClipboard) ImGuiTextBuffer();

        IM_ASSERT(g.Settings.empty());
        LoadSettings();
        g.Initialized = true;
    }

    SetCurrentFont(g.IO.Fonts->Fonts[0]);

    g.Time += g.IO.DeltaTime;
    g.FrameCount += 1;
    g.Tooltip[0] = '\0';
    g.OverlayDrawList.Clear();
    g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID);
    g.OverlayDrawList.PushClipRectFullScreen();
    g.OverlayDrawList.AddDrawCmd();

    // Mark rendering data as invalid to prevent user who may have a handle on it to use it
    g.RenderDrawData.Valid = false;
    g.RenderDrawData.CmdLists = NULL;
    g.RenderDrawData.CmdListsCount = g.RenderDrawData.TotalVtxCount = g.RenderDrawData.TotalIdxCount = 0;

    // Update inputs state
    if (g.IO.MousePos.x < 0 && g.IO.MousePos.y < 0)
        g.IO.MousePos = ImVec2(-9999.0f, -9999.0f);
    if ((g.IO.MousePos.x < 0 && g.IO.MousePos.y < 0) || (g.IO.MousePosPrev.x < 0 && g.IO.MousePosPrev.y < 0))   // if mouse just appeared or disappeared (negative coordinate) we cancel out movement in MouseDelta
        g.IO.MouseDelta = ImVec2(0.0f, 0.0f);
    else
        g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev;
    g.IO.MousePosPrev = g.IO.MousePos;
    for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
    {
        g.IO.MouseDownDurationPrev[i] = g.IO.MouseDownDuration[i];
        g.IO.MouseDownDuration[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownDuration[i] < 0.0f ? 0.0f : g.IO.MouseDownDuration[i] + g.IO.DeltaTime) : -1.0f;
        g.IO.MouseClicked[i] = g.IO.MouseDownDuration[i] == 0.0f;
        g.IO.MouseReleased[i] = g.IO.MouseDownDurationPrev[i] >= 0.0f && !g.IO.MouseDown[i];
        g.IO.MouseDoubleClicked[i] = false;
        if (g.IO.MouseClicked[i])
        {
            if (g.Time - g.IO.MouseClickedTime[i] < g.IO.MouseDoubleClickTime)
            {
                if (ImLengthSqr(g.IO.MousePos - g.IO.MouseClickedPos[i]) < g.IO.MouseDoubleClickMaxDist * g.IO.MouseDoubleClickMaxDist)
                    g.IO.MouseDoubleClicked[i] = true;
                g.IO.MouseClickedTime[i] = -FLT_MAX;    // so the third click isn't turned into a double-click
            }
            else
            {
                g.IO.MouseClickedTime[i] = g.Time;
            }
            g.IO.MouseClickedPos[i] = g.IO.MousePos;
            g.IO.MouseDragMaxDistanceSqr[i] = 0.0f;
        }
        else if (g.IO.MouseDown[i])
        {
            g.IO.MouseDragMaxDistanceSqr[i] = ImMax(g.IO.MouseDragMaxDistanceSqr[i], ImLengthSqr(g.IO.MousePos - g.IO.MouseClickedPos[i]));
        }
    }
    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;

    // 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 = 1.0f / (g.FramerateSecPerFrameAccum / (float)IM_ARRAYSIZE(g.FramerateSecPerFrame));

    // Clear reference to active widget if the widget isn't alive anymore
    g.HoveredIdPreviousFrame = g.HoveredId;
    g.HoveredId = 0;
    if (!g.ActiveIdIsAlive && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0)
        SetActiveID(0);
    g.ActiveIdPreviousFrame = g.ActiveId;
    g.ActiveIdIsAlive = false;
    g.ActiveIdIsJustActivated = false;
    if (!g.ActiveId)
        g.MovedWindow = NULL;

    // Delay saving settings so we don't spam disk too much
    if (g.SettingsDirtyTimer > 0.0f)
    {
        g.SettingsDirtyTimer -= g.IO.DeltaTime;
        if (g.SettingsDirtyTimer <= 0.0f)
            SaveSettings();
    }

    // Find the window we are hovering. Child windows can extend beyond the limit of their parent so we need to derive HoveredRootWindow from HoveredWindow
    g.HoveredWindow = FindHoveredWindow(g.IO.MousePos, false);
    if (g.HoveredWindow && (g.HoveredWindow->Flags & ImGuiWindowFlags_ChildWindow))
        g.HoveredRootWindow = g.HoveredWindow->RootWindow;
    else
        g.HoveredRootWindow = FindHoveredWindow(g.IO.MousePos, true);

    if (ImGuiWindow* modal_window = GetFrontMostModalRootWindow())
    {
        g.ModalWindowDarkeningRatio = ImMin(g.ModalWindowDarkeningRatio + g.IO.DeltaTime * 6.0f, 1.0f);
        if (g.HoveredRootWindow != modal_window)
            g.HoveredRootWindow = g.HoveredWindow = NULL;
    }
    else
    {
        g.ModalWindowDarkeningRatio = 0.0f;
    }

    // Are we using inputs? Tell user so they can capture/discard the inputs away from the rest of their application.
    // When clicking outside of a window we assume the click is owned by the application and won't request capture.
    int mouse_earliest_button_down = -1;
    bool mouse_any_down = false;
    for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
    {
        if (g.IO.MouseClicked[i])
            g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL) || (!g.OpenedPopupStack.empty());
        mouse_any_down |= g.IO.MouseDown[i];
        if (g.IO.MouseDown[i])
            if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[mouse_earliest_button_down] > g.IO.MouseClickedTime[i])
                mouse_earliest_button_down = i;
    }
    bool mouse_owned_by_application = mouse_earliest_button_down != -1 && !g.IO.MouseDownOwned[mouse_earliest_button_down];
    g.IO.WantCaptureMouse = (!mouse_owned_by_application && g.HoveredWindow != NULL) || (!mouse_owned_by_application && mouse_any_down) || (g.ActiveId != 0) || (!g.OpenedPopupStack.empty()) || (g.CaptureMouseNextFrame);
    g.IO.WantCaptureKeyboard = (g.ActiveId != 0) || (g.CaptureKeyboardNextFrame);
    g.IO.WantTextInput = (g.ActiveId != 0 && g.InputTextState.Id == g.ActiveId);
    g.MouseCursor = ImGuiMouseCursor_Arrow;
    g.CaptureMouseNextFrame = g.CaptureKeyboardNextFrame = false;

    // If mouse was first clicked outside of ImGui bounds we also cancel out hovering.
    if (mouse_owned_by_application)
        g.HoveredWindow = g.HoveredRootWindow = NULL;

    // Scale & Scrolling
    if (g.HoveredWindow && g.IO.MouseWheel != 0.0f && !g.HoveredWindow->Collapsed)
    {
        ImGuiWindow* window = g.HoveredWindow;
        if (g.IO.KeyCtrl)
        {
            if (g.IO.FontAllowUserScaling)
            {
                // Zoom / Scale window
                float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f);
                float scale = new_font_scale / window->FontWindowScale;
                window->FontWindowScale = new_font_scale;

                const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size;
                window->Pos += offset;
                window->PosFloat += offset;
                window->Size *= scale;
                window->SizeFull *= scale;
            }
        }
        else
        {
            // Scroll
            if (!(window->Flags & ImGuiWindowFlags_NoScrollWithMouse))
            {
                const int scroll_lines = (window->Flags & ImGuiWindowFlags_ComboBox) ? 3 : 5;
                SetWindowScrollY(window, window->Scroll.y - g.IO.MouseWheel * window->CalcFontSize() * scroll_lines);
            }
        }
    }

    // Pressing TAB activate widget focus
    // NB: Don't discard FocusedWindow if it isn't active, so that a window that go on/off programatically won't lose its keyboard focus.
    if (g.ActiveId == 0 && g.FocusedWindow != NULL && g.FocusedWindow->Active && IsKeyPressedMap(ImGuiKey_Tab, false))
        g.FocusedWindow->FocusIdxTabRequestNext = 0;

    // Mark all windows as not visible
    for (int i = 0; i != g.Windows.Size; i++)
    {
        ImGuiWindow* window = g.Windows[i];
        window->WasActive = window->Active;
        window->Active = false;
        window->Accessed = false;
    }

    // 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.CurrentPopupStack.resize(0);
    CloseInactivePopups();

    // Create implicit window - we will only render it if the user has added something to it.
    ImGui::SetNextWindowSize(ImVec2(400,400), ImGuiSetCond_FirstUseEver);
    ImGui::Begin("Debug");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq 0x6c95e(%rip), %rax     # 0x794c0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0xcb79
jmp 0xcb98
leaq 0x4e881(%rip), %rdi     # 0x5b401
leaq 0x4e73e(%rip), %rsi     # 0x5b2c5
movl $0x70b, %edx            # imm = 0x70B
leaq 0x4e885(%rip), %rcx     # 0x5b418
callq 0x7160
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movb %al, -0xa9(%rbp)
jb 0xcbc9
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
setae %al
movb %al, -0xa9(%rbp)
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0xcbd5
jmp 0xcbd7
jmp 0xcbf6
leaq 0x4e851(%rip), %rdi     # 0x5b42f
leaq 0x4e6e0(%rip), %rsi     # 0x5b2c5
movl $0x70c, %edx            # imm = 0x70C
leaq 0x4e827(%rip), %rcx     # 0x5b418
callq 0x7160
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
cmpl $0x0, 0x30(%rax)
jle 0xcc09
jmp 0xcc28
leaq 0x4e858(%rip), %rdi     # 0x5b468
leaq 0x4e6ae(%rip), %rsi     # 0x5b2c5
movl $0x70d, %edx            # imm = 0x70D
leaq 0x4e7f5(%rip), %rcx     # 0x5b418
callq 0x7160
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rdi
addq $0x30, %rdi
xorl %esi, %esi
callq 0x2e330
movq (%rax), %rdi
callq 0x2e390
testb $0x1, %al
jne 0xcc4c
jmp 0xcc4e
jmp 0xcc6d
leaq 0x4e82e(%rip), %rdi     # 0x5b483
leaq 0x4e669(%rip), %rsi     # 0x5b2c5
movl $0x70e, %edx            # imm = 0x70E
leaq 0x4e7b0(%rip), %rcx     # 0x5b418
callq 0x7160
movq -0x8(%rbp), %rax
movss 0x145c(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xcc83
jmp 0xcca2
leaq 0x4e81a(%rip), %rdi     # 0x5b4a4
leaq 0x4e634(%rip), %rsi     # 0x5b2c5
movl $0x70f, %edx            # imm = 0x70F
leaq 0x4e77b(%rip), %rcx     # 0x5b418
callq 0x7160
movq -0x8(%rbp), %rax
testb $0x1, (%rax)
jne 0xcd16
movl $0x10, %edi
callq 0x93d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x2bf8(%rax)
movq -0x8(%rbp), %rax
movq 0x2bf8(%rax), %rdi
callq 0x2e3b0
movq -0x8(%rbp), %rdi
addq $0x17b0, %rdi           # imm = 0x17B0
callq 0x2e400
testb $0x1, %al
jne 0xcce9
jmp 0xcceb
jmp 0xcd0a
leaq 0x4e7d6(%rip), %rdi     # 0x5b4c8
leaq 0x4e5cc(%rip), %rsi     # 0x5b2c5
movl $0x717, %edx            # imm = 0x717
leaq 0x4e713(%rip), %rcx     # 0x5b418
callq 0x7160
callq 0xdb50
movq -0x8(%rbp), %rax
movb $0x1, (%rax)
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rdi
addq $0x30, %rdi
xorl %esi, %esi
callq 0x2e330
movq (%rax), %rdi
callq 0xdde0
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x8(%rbp), %rax
addss 0x1728(%rax), %xmm0
movss %xmm0, 0x1728(%rax)
movq -0x8(%rbp), %rax
movl 0x172c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x172c(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x27e0(%rax)
movq -0x8(%rbp), %rdi
addq $0x18a8, %rdi           # imm = 0x18A8
callq 0x3cbd0
movq -0x8(%rbp), %rdi
addq $0x18a8, %rdi           # imm = 0x18A8
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rsi
callq 0x3d2c0
movq -0x8(%rbp), %rdi
addq $0x18a8, %rdi           # imm = 0x18A8
callq 0x3d180
movq -0x8(%rbp), %rdi
addq $0x18a8, %rdi           # imm = 0x18A8
callq 0x3cda0
movq -0x8(%rbp), %rax
movb $0x0, 0x1850(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x1858(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1868(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1864(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1860(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0xf0(%rax), %xmm0
jbe 0xce41
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0xf4(%rax), %xmm0
jbe 0xce41
leaq -0x10(%rbp), %rdi
movss 0x4e27e(%rip), %xmm1    # 0x5b0a8
movaps %xmm1, %xmm0
callq 0x2d280
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0xf0(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0xf0(%rax), %xmm0
jbe 0xce61
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0xf4(%rax), %xmm0
ja 0xce81
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0x344(%rax), %xmm0
jbe 0xcea1
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0x348(%rax), %xmm0
jbe 0xcea1
leaq -0x18(%rbp), %rdi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0x2d280
movq -0x8(%rbp), %rax
movq -0x18(%rbp), %rcx
movq %rcx, 0x34c(%rax)
jmp 0xcecf
movq -0x8(%rbp), %rsi
movq %rsi, %rdi
addq $0xf0, %rdi
addq $0x344, %rsi            # imm = 0x344
callq 0xdf20
movlpd %xmm0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, 0x34c(%rax)
movq -0x8(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0xf0(%rcx), %rcx
movq %rcx, 0x344(%rax)
movl $0x0, -0x24(%rbp)
cmpl $0x5, -0x24(%rbp)
jge 0xd1c0
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss 0x3a8(%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss %xmm0, 0x3bc(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
testb $0x1, 0xf8(%rax,%rcx)
je 0xcf80
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
xorps %xmm0, %xmm0
ucomiss 0x3a8(%rax,%rcx,4), %xmm0
jbe 0xcf4c
xorps %xmm0, %xmm0
movss %xmm0, -0xb0(%rbp)
jmp 0xcf6e
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss 0x3a8(%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
addss 0x10(%rax), %xmm0
movss %xmm0, -0xb0(%rbp)
movss -0xb0(%rbp), %xmm0
movss %xmm0, -0xb4(%rbp)
jmp 0xcf92
movss 0x4e0f4(%rip), %xmm0    # 0x5b07c
movss %xmm0, -0xb4(%rbp)
jmp 0xcf92
movss -0xb4(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss %xmm0, 0x3a8(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss 0x3a8(%rax,%rcx,4), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
sete %dl
setnp %al
andb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
andb $0x1, %dl
movb %dl, 0x354(%rax,%rcx)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss 0x3bc(%rax,%rcx,4), %xmm0
xorl %eax, %eax
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
movb %al, -0xb5(%rbp)
jb 0xd014
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb 0xf8(%rax,%rcx), %al
xorb $-0x1, %al
movb %al, -0xb5(%rbp)
movb -0xb5(%rbp), %dl
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
andb $0x1, %dl
movb %dl, 0x39d(%rax,%rcx)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x0, 0x398(%rax,%rcx)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
testb $0x1, 0x354(%rax,%rcx)
je 0xd13d
movq -0x8(%rbp), %rax
movss 0x1728(%rax), %xmm1
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
subss 0x384(%rax,%rcx,4), %xmm1
movq -0x8(%rbp), %rax
movss 0x28(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xd0ef
movq -0x8(%rbp), %rax
movq %rax, %rdi
addq $0xf0, %rdi
movslq -0x24(%rbp), %rcx
leaq 0x35c(%rax,%rcx,8), %rsi
callq 0xdf20
movlpd %xmm0, -0x2c(%rbp)
leaq -0x2c(%rbp), %rdi
callq 0xdf70
movaps %xmm0, %xmm1
movq -0x8(%rbp), %rax
movss 0x2c(%rax), %xmm0
movq -0x8(%rbp), %rax
mulss 0x2c(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xd0d4
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb $0x1, 0x398(%rax,%rcx)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss 0x4dfbc(%rip), %xmm0    # 0x5b0a0
movss %xmm0, 0x384(%rax,%rcx,4)
jmp 0xd10c
movq -0x8(%rbp), %rax
movss 0x1728(%rax), %xmm0
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss %xmm0, 0x384(%rax,%rcx,4)
movq -0x8(%rbp), %rdx
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movq 0xf0(%rdx), %rdx
movq %rdx, 0x35c(%rax,%rcx,8)
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
xorps %xmm0, %xmm0
movss %xmm0, 0x3d0(%rax,%rcx,4)
jmp 0xd1b0
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
testb $0x1, 0xf8(%rax,%rcx)
je 0xd1ae
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss 0x3d0(%rax,%rcx,4), %xmm0
movss %xmm0, -0xbc(%rbp)
movq %rax, %rdi
addq $0xf0, %rdi
leaq 0x35c(%rax,%rcx,8), %rsi
callq 0xdf20
movlpd %xmm0, -0x34(%rbp)
leaq -0x34(%rbp), %rdi
callq 0xdf70
movaps %xmm0, %xmm1
movss -0xbc(%rbp), %xmm0
callq 0xb7c0
movq -0x8(%rbp), %rax
movslq -0x24(%rbp), %rcx
movss %xmm0, 0x3d0(%rax,%rcx,4)
jmp 0xd1b0
jmp 0xd1b2
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0xceec
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
addq $0xbdc, %rdi            # imm = 0xBDC
movq -0x8(%rbp), %rsi
addq $0x8, %rsi
addq $0x3dc, %rsi            # imm = 0x3DC
movl $0x800, %edx            # imm = 0x800
callq 0x7080
movl $0x0, -0x38(%rbp)
cmpl $0x200, -0x38(%rbp)     # imm = 0x200
jge 0xd29d
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
testb $0x1, 0x108(%rax,%rcx)
je 0xd264
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
xorps %xmm0, %xmm0
ucomiss 0x3e4(%rax,%rcx,4), %xmm0
jbe 0xd230
xorps %xmm0, %xmm0
movss %xmm0, -0xc0(%rbp)
jmp 0xd252
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movss 0x3e4(%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
addss 0x10(%rax), %xmm0
movss %xmm0, -0xc0(%rbp)
movss -0xc0(%rbp), %xmm0
movss %xmm0, -0xc4(%rbp)
jmp 0xd276
movss 0x4de10(%rip), %xmm0    # 0x5b07c
movss %xmm0, -0xc4(%rbp)
jmp 0xd276
movss -0xc4(%rbp), %xmm0
movq -0x8(%rbp), %rax
movslq -0x38(%rbp), %rcx
movss %xmm0, 0x3e4(%rax,%rcx,4)
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0xd1ef
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x2de8(%rcx), %rcx
subss 0x2c08(%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
addss 0x2dec(%rax), %xmm0
movss %xmm0, 0x2dec(%rax)
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movq -0x8(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq 0x2de8(%rcx), %rcx
movss %xmm0, 0x2c08(%rax,%rcx,4)
movq -0x8(%rbp), %rax
movl 0x2de8(%rax), %eax
addl $0x1, %eax
movl $0x78, %ecx
cltd
idivl %ecx
movq -0x8(%rbp), %rax
movl %edx, 0x2de8(%rax)
movq -0x8(%rbp), %rax
movss 0x2dec(%rax), %xmm1
movss 0x4dd86(%rip), %xmm0    # 0x5b0ac
divss %xmm0, %xmm1
movss 0x4dce6(%rip), %xmm0    # 0x5b018
divss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x330(%rax)
movq -0x8(%rbp), %rax
movl 0x1788(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x178c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1788(%rax)
movq -0x8(%rbp), %rax
testb $0x1, 0x1798(%rax)
jne 0xd39f
movq -0x8(%rbp), %rax
movl 0x1794(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1790(%rcx), %eax
jne 0xd39f
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1790(%rax)
je 0xd39f
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0xbe60
movq -0x8(%rbp), %rax
movl 0x1790(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x1794(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1798(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x1799(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1790(%rax)
jne 0xd3e5
movq -0x8(%rbp), %rax
movq $0x0, 0x17a8(%rax)
movq -0x8(%rbp), %rax
movss 0x17c0(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0xd431
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x17c0(%rax), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x17c0(%rax)
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
ucomiss 0x17c0(%rax), %xmm0
jb 0xd42f
callq 0xdfb0
jmp 0xd431
movq -0x8(%rbp), %rax
movq 0xf0(%rax), %rax
movq %rax, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
xorl %edi, %edi
callq 0xe1c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1778(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1778(%rax)
je 0xd49f
movq -0x8(%rbp), %rax
movq 0x1778(%rax), %rax
movl 0xc(%rax), %eax
andl $0x100000, %eax         # imm = 0x100000
cmpl $0x0, %eax
je 0xd49f
movq -0x8(%rbp), %rax
movq 0x1778(%rax), %rax
movq 0x278(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1780(%rax)
jmp 0xd4cb
movq -0x8(%rbp), %rax
movq 0xf0(%rax), %rax
movq %rax, -0x48(%rbp)
movsd -0x48(%rbp), %xmm0
movl $0x1, %edi
callq 0xe1c0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1780(%rax)
callq 0xe2f0
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xd54a
movq -0x8(%rbp), %rax
movss 0x18a0(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x10(%rax), %xmm0
movss 0x4db74(%rip), %xmm2    # 0x5b06c
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x4db10(%rip), %xmm1    # 0x5b018
callq 0xe370
movq -0x8(%rbp), %rax
movss %xmm0, 0x18a0(%rax)
movq -0x8(%rbp), %rax
movq 0x1780(%rax), %rax
cmpq -0x50(%rbp), %rax
je 0xd548
movq -0x8(%rbp), %rax
movq $0x0, 0x1778(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x1780(%rax)
jmp 0xd559
movq -0x8(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x18a0(%rax)
movl $0xffffffff, -0x54(%rbp) # imm = 0xFFFFFFFF
movb $0x0, -0x55(%rbp)
movl $0x0, -0x5c(%rbp)
cmpl $0x5, -0x5c(%rbp)
jge 0xd649
movq -0x8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
testb $0x1, 0x354(%rax,%rcx)
je 0xd5cd
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpq $0x0, 0x1778(%rcx)
movb %al, -0xc5(%rbp)
jne 0xd5b5
movq -0x8(%rbp), %rdi
addq $0x17f8, %rdi           # imm = 0x17F8
callq 0x2e420
xorb $-0x1, %al
movb %al, -0xc5(%rbp)
movb -0xc5(%rbp), %dl
movq -0x8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
andb $0x1, %dl
movb %dl, 0x3a2(%rax,%rcx)
movq -0x8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movb 0xf8(%rax,%rcx), %al
andb $0x1, %al
movzbl %al, %ecx
movb -0x55(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
orl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x55(%rbp)
movq -0x8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
testb $0x1, 0xf8(%rax,%rcx)
je 0xd639
cmpl $-0x1, -0x54(%rbp)
je 0xd631
movq -0x8(%rbp), %rax
movslq -0x54(%rbp), %rcx
movss 0x384(%rax,%rcx,4), %xmm0
movq -0x8(%rbp), %rax
movslq -0x5c(%rbp), %rcx
ucomiss 0x384(%rax,%rcx,4), %xmm0
jbe 0xd637
movl -0x5c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0xd639
jmp 0xd63b
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0xd56b
xorl %eax, %eax
cmpl $-0x1, -0x54(%rbp)
movb %al, -0xc6(%rbp)
je 0xd66e
movq -0x8(%rbp), %rax
movslq -0x54(%rbp), %rcx
movb 0x3a2(%rax,%rcx), %al
xorb $-0x1, %al
movb %al, -0xc6(%rbp)
movb -0xc6(%rbp), %al
andb $0x1, %al
movb %al, -0x5d(%rbp)
testb $0x1, -0x5d(%rbp)
jne 0xd695
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpq $0x0, 0x1778(%rcx)
movb %al, -0xc7(%rbp)
jne 0xd6ef
testb $0x1, -0x5d(%rbp)
jne 0xd6a9
movb $0x1, %al
testb $0x1, -0x55(%rbp)
movb %al, -0xc7(%rbp)
jne 0xd6ef
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x1790(%rcx)
movb %al, -0xc7(%rbp)
jne 0xd6ef
movq -0x8(%rbp), %rdi
addq $0x17f8, %rdi           # imm = 0x17F8
callq 0x2e420
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0xc7(%rbp)
jne 0xd6df
jmp 0xd6ef
movq -0x8(%rbp), %rax
movb 0x2df0(%rax), %al
movb %al, -0xc7(%rbp)
movb -0xc7(%rbp), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x32a(%rax)
movq -0x8(%rbp), %rcx
movb $0x1, %al
cmpl $0x0, 0x1790(%rcx)
movb %al, -0xc8(%rbp)
jne 0xd727
movq -0x8(%rbp), %rax
movb 0x2df1(%rax), %al
movb %al, -0xc8(%rbp)
movb -0xc8(%rbp), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x32b(%rax)
movq -0x8(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x1790(%rcx)
movb %al, -0xc9(%rbp)
je 0xd76c
movq -0x8(%rbp), %rax
movl 0x1ab0(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1790(%rcx), %eax
sete %al
movb %al, -0xc9(%rbp)
movb -0xc9(%rbp), %cl
movq -0x8(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x32c(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x1940(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x2df1(%rax)
movq -0x8(%rbp), %rax
movb $0x0, 0x2df0(%rax)
testb $0x1, -0x5d(%rbp)
je 0xd7c7
movq -0x8(%rbp), %rax
movq $0x0, 0x1780(%rax)
movq -0x8(%rbp), %rax
movq $0x0, 0x1778(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1778(%rax)
je 0xda19
movq -0x8(%rbp), %rax
movss 0x100(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0xd7f4
jp 0xd7f4
jmp 0xda19
movq -0x8(%rbp), %rax
movq 0x1778(%rax), %rax
testb $0x1, 0x73(%rax)
jne 0xda19
movq -0x8(%rbp), %rax
movq 0x1778(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
testb $0x1, 0x105(%rax)
je 0xd966
movq -0x8(%rbp), %rax
testb $0x1, 0x9c(%rax)
je 0xd961
movq -0x68(%rbp), %rax
movss 0x268(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x100(%rax), %xmm0
movss 0x4d7b6(%rip), %xmm2    # 0x5b010
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss 0x4d7ba(%rip), %xmm1    # 0x5b024
movss 0x4d83e(%rip), %xmm2    # 0x5b0b0
callq 0xe3b0
movss %xmm0, -0x6c(%rbp)
movss -0x6c(%rbp), %xmm0
movq -0x68(%rbp), %rax
movss 0x268(%rax), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x70(%rbp)
movss -0x6c(%rbp), %xmm0
movq -0x68(%rbp), %rax
movss %xmm0, 0x268(%rax)
movq -0x68(%rbp), %rdi
addq $0x20, %rdi
movss -0x70(%rbp), %xmm1
movss 0x4d75c(%rip), %xmm0    # 0x5b018
subss %xmm1, %xmm0
callq 0xe4b0
movlpd %xmm0, -0x88(%rbp)
movq -0x8(%rbp), %rdi
addq $0xf0, %rdi
movq -0x68(%rbp), %rsi
addq $0x18, %rsi
callq 0xdf20
movlpd %xmm0, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xe460
movlpd %xmm0, -0x80(%rbp)
movq -0x68(%rbp), %rsi
addq $0x20, %rsi
leaq -0x80(%rbp), %rdi
callq 0xe410
movlpd %xmm0, -0x78(%rbp)
movq -0x68(%rbp), %rdi
addq $0x18, %rdi
leaq -0x78(%rbp), %rsi
callq 0xe4f0
movq -0x68(%rbp), %rdi
addq $0x10, %rdi
leaq -0x78(%rbp), %rsi
callq 0xe4f0
movss -0x70(%rbp), %xmm0
movq -0x68(%rbp), %rdi
addq $0x20, %rdi
callq 0xe530
movss -0x70(%rbp), %xmm0
movq -0x68(%rbp), %rdi
addq $0x28, %rdi
callq 0xe530
jmp 0xda17
movq -0x68(%rbp), %rax
movl 0xc(%rax), %eax
andl $0x10, %eax
cmpl $0x0, %eax
jne 0xda15
movq -0x68(%rbp), %rax
movl 0xc(%rax), %edx
andl $0x800000, %edx         # imm = 0x800000
movl $0x5, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x94(%rbp)
movq -0x68(%rbp), %rax
movq %rax, -0xd8(%rbp)
movq -0x68(%rbp), %rax
movss 0x50(%rax), %xmm0
movss %xmm0, -0xdc(%rbp)
movq -0x8(%rbp), %rax
movss 0x100(%rax), %xmm0
movss %xmm0, -0xd0(%rbp)
movq -0x68(%rbp), %rdi
callq 0x2e440
movss -0xdc(%rbp), %xmm1
movq -0xd8(%rbp), %rdi
movaps %xmm0, %xmm2
movss -0xd0(%rbp), %xmm0
mulss %xmm2, %xmm0
cvtsi2ssl -0x94(%rbp), %xmm2
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
callq 0xe570
jmp 0xda17
jmp 0xda19
movq -0x8(%rbp), %rax
cmpl $0x0, 0x1790(%rax)
jne 0xda69
movq -0x8(%rbp), %rax
cmpq $0x0, 0x1770(%rax)
je 0xda69
movq -0x8(%rbp), %rax
movq 0x1770(%rax), %rax
testb $0x1, 0x70(%rax)
je 0xda69
xorl %esi, %esi
movl %esi, %edi
callq 0xc620
testb $0x1, %al
jne 0xda54
jmp 0xda69
movq -0x8(%rbp), %rax
movq 0x1770(%rax), %rax
movl $0x0, 0x29c(%rax)
movl $0x0, -0x98(%rbp)
movl -0x98(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1738(%rcx), %eax
je 0xdae3
movq -0x8(%rbp), %rdi
addq $0x1738, %rdi           # imm = 0x1738
movl -0x98(%rbp), %esi
callq 0x2e1c0
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movb 0x70(%rax), %cl
movq -0xa0(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x71(%rax)
movq -0xa0(%rbp), %rax
movb $0x0, 0x70(%rax)
movq -0xa0(%rbp), %rax
movb $0x0, 0x72(%rax)
movl -0x98(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x98(%rbp)
jmp 0xda73
movq -0x8(%rbp), %rdi
addq $0x1760, %rdi           # imm = 0x1760
xorl %esi, %esi
callq 0x2e470
movq -0x8(%rbp), %rdi
addq $0x1808, %rdi           # imm = 0x1808
xorl %esi, %esi
callq 0x2e4c0
callq 0xe5d0
leaq -0xa8(%rbp), %rdi
movss 0x4d599(%rip), %xmm1    # 0x5b0b4
movaps %xmm1, %xmm0
callq 0x2d280
leaq -0xa8(%rbp), %rdi
movl $0x4, %esi
callq 0xe790
leaq 0x4d9a0(%rip), %rdi     # 0x5b4db
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0xe7e0
addq $0xe0, %rsp
popq %rbp
retq
nop