// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::PlotEx(ImGuiPlotType, char const*, float (*)(void*, int), void*, int, int, char const*, float, float, ImVec2)
int ImGui::PlotEx(ImGuiPlotType plot_type, const char* label, float (*values_getter)(void* data, int idx), void* data, int values_count, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 frame_size)
{
    ImGuiContext& g = *GImGui;
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return -1;

    const ImGuiStyle& style = g.Style;
    const ImGuiID id = window->GetID(label);

    const ImVec2 label_size = CalcTextSize(label, NULL, true);
    if (frame_size.x == 0.0f)
        frame_size.x = CalcItemWidth();
    if (frame_size.y == 0.0f)
        frame_size.y = label_size.y + (style.FramePadding.y * 2);

    const ImRect frame_bb(window->DC.CursorPos, window->DC.CursorPos + frame_size);
    const ImRect inner_bb(frame_bb.Min + style.FramePadding, frame_bb.Max - style.FramePadding);
    const ImRect total_bb(frame_bb.Min, frame_bb.Max + ImVec2(label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f, 0));
    ItemSize(total_bb, style.FramePadding.y);
    if (!ItemAdd(total_bb, 0, &frame_bb))
        return -1;
    const bool hovered = ItemHoverable(frame_bb, id);

    // Determine scale from values if not specified
    if (scale_min == FLT_MAX || scale_max == FLT_MAX)
    {
        float v_min = FLT_MAX;
        float v_max = -FLT_MAX;
        for (int i = 0; i < values_count; i++)
        {
            const float v = values_getter(data, i);
            if (v != v) // Ignore NaN values
                continue;
            v_min = ImMin(v_min, v);
            v_max = ImMax(v_max, v);
        }
        if (scale_min == FLT_MAX)
            scale_min = v_min;
        if (scale_max == FLT_MAX)
            scale_max = v_max;
    }

    RenderFrame(frame_bb.Min, frame_bb.Max, GetColorU32(ImGuiCol_FrameBg), true, style.FrameRounding);

    const int values_count_min = (plot_type == ImGuiPlotType_Lines) ? 2 : 1;
    int idx_hovered = -1;
    if (values_count >= values_count_min)
    {
        int res_w = ImMin((int)frame_size.x, values_count) + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);
        int item_count = values_count + ((plot_type == ImGuiPlotType_Lines) ? -1 : 0);

        // Tooltip on hover
        if (hovered && inner_bb.Contains(g.IO.MousePos))
        {
            const float t = ImClamp((g.IO.MousePos.x - inner_bb.Min.x) / (inner_bb.Max.x - inner_bb.Min.x), 0.0f, 0.9999f);
            const int v_idx = (int)(t * item_count);
            IM_ASSERT(v_idx >= 0 && v_idx < values_count);

            const float v0 = values_getter(data, (v_idx + values_offset) % values_count);
            const float v1 = values_getter(data, (v_idx + 1 + values_offset) % values_count);
            if (plot_type == ImGuiPlotType_Lines)
                SetTooltip("%d: %8.4g\n%d: %8.4g", v_idx, v0, v_idx + 1, v1);
            else if (plot_type == ImGuiPlotType_Histogram)
                SetTooltip("%d: %8.4g", v_idx, v0);
            idx_hovered = v_idx;
        }

        const float t_step = 1.0f / (float)res_w;
        const float inv_scale = (scale_min == scale_max) ? 0.0f : (1.0f / (scale_max - scale_min));

        float v0 = values_getter(data, (0 + values_offset) % values_count);
        float t0 = 0.0f;
        ImVec2 tp0 = ImVec2( t0, 1.0f - ImSaturate((v0 - scale_min) * inv_scale) );                       // Point in the normalized space of our target rectangle
        float histogram_zero_line_t = (scale_min * scale_max < 0.0f) ? (-scale_min * inv_scale) : (scale_min < 0.0f ? 0.0f : 1.0f);   // Where does the zero line stands

        const ImU32 col_base = GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLines : ImGuiCol_PlotHistogram);
        const ImU32 col_hovered = GetColorU32((plot_type == ImGuiPlotType_Lines) ? ImGuiCol_PlotLinesHovered : ImGuiCol_PlotHistogramHovered);

        for (int n = 0; n < res_w; n++)
        {
            const float t1 = t0 + t_step;
            const int v1_idx = (int)(t0 * item_count + 0.5f);
            IM_ASSERT(v1_idx >= 0 && v1_idx < values_count);
            const float v1 = values_getter(data, (v1_idx + values_offset + 1) % values_count);
            const ImVec2 tp1 = ImVec2( t1, 1.0f - ImSaturate((v1 - scale_min) * inv_scale) );

            // NB: Draw calls are merged together by the DrawList system. Still, we should render our batch are lower level to save a bit of CPU.
            ImVec2 pos0 = ImLerp(inner_bb.Min, inner_bb.Max, tp0);
            ImVec2 pos1 = ImLerp(inner_bb.Min, inner_bb.Max, (plot_type == ImGuiPlotType_Lines) ? tp1 : ImVec2(tp1.x, histogram_zero_line_t));
            if (plot_type == ImGuiPlotType_Lines)
            {
                window->DrawList->AddLine(pos0, pos1, idx_hovered == v1_idx ? col_hovered : col_base);
            }
            else if (plot_type == ImGuiPlotType_Histogram)
            {
                if (pos1.x >= pos0.x + 2.0f)
                    pos1.x -= 1.0f;
                window->DrawList->AddRectFilled(pos0, pos1, idx_hovered == v1_idx ? col_hovered : col_base);
            }

            t0 = t1;
            tp0 = tp1;
        }
    }

    // Text overlay
    if (overlay_text)
        RenderTextClipped(ImVec2(frame_bb.Min.x, frame_bb.Min.y + style.FramePadding.y), frame_bb.Max, overlay_text, NULL, NULL, ImVec2(0.5f, 0.0f));

    if (label_size.x > 0.0f)
        RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, inner_bb.Min.y), label);

    // Return hovered index or -1 if none are hovered.
    // This is currently not exposed in the public API because we need a larger redesign of the whole thing, but in the short-term we are making it available in PlotEx().
    return idx_hovered;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movq 0x10(%rbp), %rax
movlpd %xmm2, -0xc(%rbp)
movl %edi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movl %r8d, -0x2c(%rbp)
movl %r9d, -0x30(%rbp)
movss %xmm0, -0x34(%rbp)
movss %xmm1, -0x38(%rbp)
leaq 0xc0014(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x40(%rbp)
callq 0xeb270
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
testb $0x1, 0x93(%rax)
je 0x152f55
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x153a86
movq -0x40(%rbp), %rax
addq $0x1560, %rax           # imm = 0x1560
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x170(%rbp)
callq 0xc9910
movq -0x170(%rbp), %rsi
movl %eax, -0x54(%rbp)
movq -0x18(%rbp), %rdi
movl $0x1, %edx
movss 0x1efea(%rip), %xmm0    # 0x171f80
callq 0xc87e0
movlpd %xmm0, -0x5c(%rbp)
movss -0xc(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x152fb9
jp 0x152fb9
callq 0xdcdc0
movss %xmm0, -0xc(%rbp)
movss -0x8(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x152fe3
jp 0x152fe3
movss -0x58(%rbp), %xmm1
movq -0x50(%rbp), %rax
movss 0x3c(%rax), %xmm0
addss %xmm0, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x8(%rbp)
movq -0x48(%rbp), %rdi
addq $0xd8, %rdi
movq %rdi, -0x190(%rbp)
leaq -0xc(%rbp), %rsi
callq 0x139090
movq -0x190(%rbp), %rsi
movlpd %xmm0, -0x74(%rbp)
leaq -0x6c(%rbp), %rdi
movq %rdi, -0x188(%rbp)
leaq -0x74(%rbp), %rdx
callq 0xe8660
movq -0x188(%rbp), %rdi
movq -0x50(%rbp), %rsi
addq $0x38, %rsi
callq 0x139090
movlpd %xmm0, -0x8c(%rbp)
leaq -0x64(%rbp), %rdi
movq -0x50(%rbp), %rsi
addq $0x38, %rsi
callq 0x1390e0
movlpd %xmm0, -0x94(%rbp)
leaq -0x84(%rbp), %rdi
leaq -0x8c(%rbp), %rsi
leaq -0x94(%rbp), %rdx
callq 0xe8660
leaq -0x6c(%rbp), %rax
movq %rax, -0x180(%rbp)
leaq -0x6c(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x178(%rbp)
movss -0x5c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x1530ac
movq -0x50(%rbp), %rax
movss 0x50(%rax), %xmm0
addss -0x5c(%rbp), %xmm0
movss %xmm0, -0x194(%rbp)
jmp 0x1530b9
xorps %xmm0, %xmm0
movss %xmm0, -0x194(%rbp)
jmp 0x1530b9
movss -0x194(%rbp), %xmm0
leaq -0xb4(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
xorps %xmm1, %xmm1
callq 0xbf4c0
movq -0x178(%rbp), %rdi
movq -0x1a0(%rbp), %rsi
callq 0x139090
movq -0x180(%rbp), %rsi
movlpd %xmm0, -0xac(%rbp)
leaq -0xa4(%rbp), %rdi
leaq -0xac(%rbp), %rdx
callq 0xe8660
movq -0x50(%rbp), %rax
movss 0x3c(%rax), %xmm0
leaq -0xa4(%rbp), %rdi
callq 0xdc300
leaq -0xa4(%rbp), %rdi
xorl %esi, %esi
leaq -0x6c(%rbp), %rdx
callq 0xd6250
testb $0x1, %al
jne 0x153143
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x153a86
movl -0x54(%rbp), %esi
leaq -0x6c(%rbp), %rdi
callq 0xca460
andb $0x1, %al
movb %al, -0xb5(%rbp)
movss -0x34(%rbp), %xmm0
movss 0x1ee50(%rip), %xmm1    # 0x171fb4
ucomiss %xmm1, %xmm0
jne 0x15316d
jp 0x15316d
jmp 0x153189
movss -0x38(%rbp), %xmm0
movss 0x1ee3a(%rip), %xmm1    # 0x171fb4
ucomiss %xmm1, %xmm0
jne 0x15327f
jp 0x15327f
movss 0x1ee23(%rip), %xmm0    # 0x171fb4
movss %xmm0, -0xbc(%rbp)
movss 0x1f5b7(%rip), %xmm0    # 0x172758
movss %xmm0, -0xc0(%rbp)
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0x2c(%rbp), %eax
jge 0x15323b
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rdi
movl -0xc4(%rbp), %esi
callq *%rax
movss %xmm0, -0xc8(%rbp)
movss -0xc8(%rbp), %xmm0
ucomiss -0xc8(%rbp), %xmm0
jne 0x1531eb
jp 0x1531eb
jmp 0x1531ed
jmp 0x153227
movss -0xbc(%rbp), %xmm0
movss -0xc8(%rbp), %xmm1
callq 0x13c690
movss %xmm0, -0xbc(%rbp)
movss -0xc0(%rbp), %xmm0
movss -0xc8(%rbp), %xmm1
callq 0x139050
movss %xmm0, -0xc0(%rbp)
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x1531b3
movss -0x34(%rbp), %xmm0
movss 0x1ed6c(%rip), %xmm1    # 0x171fb4
ucomiss %xmm1, %xmm0
jne 0x15325c
jp 0x15325c
movss -0xbc(%rbp), %xmm0
movss %xmm0, -0x34(%rbp)
movss -0x38(%rbp), %xmm0
movss 0x1ed4b(%rip), %xmm1    # 0x171fb4
ucomiss %xmm1, %xmm0
jne 0x15327d
jp 0x15327d
movss -0xc0(%rbp), %xmm0
movss %xmm0, -0x38(%rbp)
jmp 0x15327f
movq -0x6c(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x64(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl $0x7, %edi
movss 0x1d99a(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movl %eax, %edi
movq -0x50(%rbp), %rax
movss 0x40(%rax), %xmm2
movsd -0xd0(%rbp), %xmm0
movsd -0xd8(%rbp), %xmm1
movl $0x1, %esi
callq 0xc8f20
movl -0x10(%rbp), %edx
movl $0x1, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0xdc(%rbp)
movl $0xffffffff, -0xe0(%rbp) # imm = 0xFFFFFFFF
movl -0x2c(%rbp), %eax
cmpl -0xdc(%rbp), %eax
jl 0x1539a7
cvttss2si -0xc(%rbp), %edi
movl -0x2c(%rbp), %esi
callq 0x143780
movl -0x10(%rbp), %esi
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl $0x0, %esi
cmovel %edx, %ecx
addl %ecx, %eax
movl %eax, -0xe4(%rbp)
movl -0x2c(%rbp), %eax
movl -0x10(%rbp), %esi
xorl %ecx, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl $0x0, %esi
cmovel %edx, %ecx
addl %ecx, %eax
movl %eax, -0xe8(%rbp)
testb $0x1, -0xb5(%rbp)
je 0x1534ec
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
addq $0x120, %rsi            # imm = 0x120
leaq -0x84(%rbp), %rdi
callq 0xea710
testb $0x1, %al
jne 0x15336f
jmp 0x1534ec
movq -0x40(%rbp), %rax
movss 0x128(%rax), %xmm0
subss -0x84(%rbp), %xmm0
movss -0x7c(%rbp), %xmm1
subss -0x84(%rbp), %xmm1
divss %xmm1, %xmm0
xorps %xmm1, %xmm1
movss 0x3ae81(%rip), %xmm2    # 0x18e220
callq 0x13c020
movss %xmm0, -0xec(%rbp)
movss -0xec(%rbp), %xmm0
cvtsi2ssl -0xe8(%rbp), %xmm1
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0xf0(%rbp)
xorl %eax, %eax
cmpl $0x0, -0xf0(%rbp)
movb %al, -0x1a1(%rbp)
jl 0x1533ed
movl -0xf0(%rbp), %eax
cmpl -0x2c(%rbp), %eax
setl %al
movb %al, -0x1a1(%rbp)
movb -0x1a1(%rbp), %al
testb $0x1, %al
jne 0x1533f9
jmp 0x1533fb
jmp 0x15341a
leaq 0x3cae1(%rip), %rdi     # 0x18fee3
leaq 0x3afd7(%rip), %rsi     # 0x18e3e0
movl $0x18a7, %edx           # imm = 0x18A7
leaq 0x3caf1(%rip), %rcx     # 0x18ff06
callq 0xd180
movq -0x20(%rbp), %rax
movq %rax, -0x1b8(%rbp)
movq -0x28(%rbp), %rdi
movl -0xf0(%rbp), %eax
addl -0x30(%rbp), %eax
cltd
idivl -0x2c(%rbp)
movq -0x1b8(%rbp), %rax
movl %edx, %esi
callq *%rax
movss %xmm0, -0xf4(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1b0(%rbp)
movq -0x28(%rbp), %rdi
movl -0xf0(%rbp), %eax
addl $0x1, %eax
addl -0x30(%rbp), %eax
cltd
idivl -0x2c(%rbp)
movq -0x1b0(%rbp), %rax
movl %edx, %esi
callq *%rax
movss %xmm0, -0xf8(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x1534b8
movl -0xf0(%rbp), %esi
movss -0xf4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movl -0xf0(%rbp), %edx
addl $0x1, %edx
movss -0xf8(%rbp), %xmm1
cvtss2sd %xmm1, %xmm1
leaq 0x3cad4(%rip), %rdi     # 0x18ff83
movb $0x2, %al
callq 0xd4170
jmp 0x1534e0
cmpl $0x1, -0x10(%rbp)
jne 0x1534de
movl -0xf0(%rbp), %esi
movss -0xf4(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3cab6(%rip), %rdi     # 0x18ff8d
movb $0x1, %al
callq 0xd4170
jmp 0x1534e0
movl -0xf0(%rbp), %eax
movl %eax, -0xe0(%rbp)
cvtsi2ssl -0xe4(%rbp), %xmm1
movss 0x1d740(%rip), %xmm0    # 0x170c3c
divss %xmm1, %xmm0
movss %xmm0, -0xfc(%rbp)
movss -0x34(%rbp), %xmm0
ucomiss -0x38(%rbp), %xmm0
jne 0x153522
jp 0x153522
xorps %xmm0, %xmm0
movss %xmm0, -0x1bc(%rbp)
jmp 0x153540
movss -0x38(%rbp), %xmm1
subss -0x34(%rbp), %xmm1
movss 0x1d708(%rip), %xmm0    # 0x170c3c
divss %xmm1, %xmm0
movss %xmm0, -0x1bc(%rbp)
movss -0x1bc(%rbp), %xmm0
movss %xmm0, -0x100(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x28(%rbp), %rdi
movl -0x30(%rbp), %eax
addl $0x0, %eax
cltd
idivl -0x2c(%rbp)
movq -0x1c8(%rbp), %rax
movl %edx, %esi
callq *%rax
movss %xmm0, -0x104(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x108(%rbp)
movss -0x108(%rbp), %xmm0
movss %xmm0, -0x1c0(%rbp)
movss -0x104(%rbp), %xmm0
subss -0x34(%rbp), %xmm0
mulss -0x100(%rbp), %xmm0
callq 0x13bfc0
movaps %xmm0, %xmm2
movss -0x1c0(%rbp), %xmm0
movss 0x1d678(%rip), %xmm1    # 0x170c3c
subss %xmm2, %xmm1
leaq -0x110(%rbp), %rdi
callq 0xbf4c0
movss -0x34(%rbp), %xmm1
mulss -0x38(%rbp), %xmm1
xorps %xmm0, %xmm0
ucomiss %xmm1, %xmm0
jbe 0x15360a
movss -0x34(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
mulss -0x100(%rbp), %xmm0
movss %xmm0, -0x1cc(%rbp)
jmp 0x153633
movss -0x34(%rbp), %xmm0
xorps %xmm3, %xmm3
movss 0x1d622(%rip), %xmm2    # 0x170c3c
cmpltss %xmm3, %xmm0
movaps %xmm0, %xmm1
andps %xmm3, %xmm1
andnps %xmm2, %xmm0
orps %xmm1, %xmm0
movss %xmm0, -0x1cc(%rbp)
movss -0x1cc(%rbp), %xmm0
movss %xmm0, -0x114(%rbp)
movl -0x10(%rbp), %ecx
movl $0x28, %edi
movl $0x26, %eax
cmpl $0x0, %ecx
cmovel %eax, %edi
movss 0x1d5de(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movl %eax, -0x118(%rbp)
movl -0x10(%rbp), %ecx
movl $0x29, %edi
movl $0x27, %eax
cmpl $0x0, %ecx
cmovel %eax, %edi
movss 0x1d5b8(%rip), %xmm0    # 0x170c3c
callq 0xc76e0
movl %eax, -0x11c(%rbp)
movl $0x0, -0x120(%rbp)
movl -0x120(%rbp), %eax
cmpl -0xe4(%rbp), %eax
jge 0x1539a5
movss -0x108(%rbp), %xmm0
addss -0xfc(%rbp), %xmm0
movss %xmm0, -0x124(%rbp)
movss -0x108(%rbp), %xmm0
cvtsi2ssl -0xe8(%rbp), %xmm1
mulss %xmm1, %xmm0
movss 0x1e8f9(%rip), %xmm1    # 0x171fd8
addss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movl %eax, -0x128(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x128(%rbp)
movb %al, -0x1cd(%rbp)
jl 0x153710
movl -0x128(%rbp), %eax
cmpl -0x2c(%rbp), %eax
setl %al
movb %al, -0x1cd(%rbp)
movb -0x1cd(%rbp), %al
testb $0x1, %al
jne 0x15371c
jmp 0x15371e
jmp 0x15373d
leaq 0x3c872(%rip), %rdi     # 0x18ff97
leaq 0x3acb4(%rip), %rsi     # 0x18e3e0
movl $0x18c1, %edx           # imm = 0x18C1
leaq 0x3c7ce(%rip), %rcx     # 0x18ff06
callq 0xd180
movq -0x20(%rbp), %rax
movq %rax, -0x1f0(%rbp)
movq -0x28(%rbp), %rdi
movl -0x128(%rbp), %edx
movl -0x30(%rbp), %eax
movl %eax, %ecx
movl %edx, %eax
leal 0x1(%rax,%rcx), %eax
movl -0x2c(%rbp), %ecx
cltd
idivl %ecx
movq -0x1f0(%rbp), %rax
movl %edx, %esi
callq *%rax
movss %xmm0, -0x12c(%rbp)
movss -0x124(%rbp), %xmm0
movss %xmm0, -0x1e4(%rbp)
movss -0x12c(%rbp), %xmm0
movss -0x34(%rbp), %xmm1
subss %xmm1, %xmm0
movss -0x100(%rbp), %xmm1
mulss %xmm1, %xmm0
callq 0x13bfc0
movaps %xmm0, %xmm2
movss -0x1e4(%rbp), %xmm0
movss 0x1d481(%rip), %xmm1    # 0x170c3c
subss %xmm2, %xmm1
leaq -0x134(%rbp), %rdi
callq 0xbf4c0
leaq -0x7c(%rbp), %rsi
leaq -0x84(%rbp), %rdi
leaq -0x110(%rbp), %rdx
callq 0x153aa0
movlpd %xmm0, -0x13c(%rbp)
leaq -0x84(%rbp), %rax
movq %rax, -0x1e0(%rbp)
leaq -0x84(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x1d8(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x153820
movq -0x134(%rbp), %rax
movq %rax, -0x14c(%rbp)
jmp 0x15383c
movss -0x134(%rbp), %xmm0
movss -0x114(%rbp), %xmm1
leaq -0x14c(%rbp), %rdi
callq 0xbf4c0
movq -0x1d8(%rbp), %rsi
movq -0x1e0(%rbp), %rdi
leaq -0x14c(%rbp), %rdx
callq 0x153aa0
movlpd %xmm0, -0x144(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x1538cb
movq -0x48(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x1f8(%rbp)
movl -0xe0(%rbp), %eax
cmpl -0x128(%rbp), %eax
jne 0x153892
movl -0x11c(%rbp), %eax
movl %eax, -0x1fc(%rbp)
jmp 0x15389e
movl -0x118(%rbp), %eax
movl %eax, -0x1fc(%rbp)
movq -0x1f8(%rbp), %rdi
movl -0x1fc(%rbp), %ecx
leaq -0x13c(%rbp), %rsi
leaq -0x144(%rbp), %rdx
movss 0x1d37b(%rip), %xmm0    # 0x170c3c
callq 0x112e20
jmp 0x153973
cmpl $0x1, -0x10(%rbp)
jne 0x153971
movss -0x144(%rbp), %xmm0
movss 0x1e6e7(%rip), %xmm1    # 0x171fcc
addss -0x13c(%rbp), %xmm1
ucomiss %xmm1, %xmm0
jb 0x15390e
movss -0x144(%rbp), %xmm0
movss 0x1d33a(%rip), %xmm1    # 0x170c3c
subss %xmm1, %xmm0
movss %xmm0, -0x144(%rbp)
movq -0x48(%rbp), %rax
movq 0x2b8(%rax), %rax
movq %rax, -0x208(%rbp)
movl -0xe0(%rbp), %eax
cmpl -0x128(%rbp), %eax
jne 0x15393c
movl -0x11c(%rbp), %eax
movl %eax, -0x20c(%rbp)
jmp 0x153948
movl -0x118(%rbp), %eax
movl %eax, -0x20c(%rbp)
movq -0x208(%rbp), %rdi
movl -0x20c(%rbp), %ecx
leaq -0x13c(%rbp), %rsi
leaq -0x144(%rbp), %rdx
xorps %xmm0, %xmm0
movl $0xf, %r8d
callq 0x113090
jmp 0x153973
movss -0x124(%rbp), %xmm0
movss %xmm0, -0x108(%rbp)
movq -0x134(%rbp), %rax
movq %rax, -0x110(%rbp)
movl -0x120(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x120(%rbp)
jmp 0x153699
jmp 0x1539a7
cmpq $0x0, 0x10(%rbp)
je 0x153a33
movss -0x6c(%rbp), %xmm0
movss -0x68(%rbp), %xmm1
movq -0x50(%rbp), %rax
addss 0x3c(%rax), %xmm1
leaq -0x154(%rbp), %rdi
callq 0xbf4c0
leaq -0x6c(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x220(%rbp)
movq 0x10(%rbp), %rax
movq %rax, -0x218(%rbp)
leaq -0x15c(%rbp), %rdi
movss 0x1e5de(%rip), %xmm0    # 0x171fd8
xorps %xmm1, %xmm1
callq 0xbf4c0
movq -0x220(%rbp), %rsi
movq -0x218(%rbp), %rdx
leaq -0x154(%rbp), %rdi
xorl %eax, %eax
movl %eax, %r8d
leaq -0x15c(%rbp), %r9
movq %r8, %rcx
movq $0x0, (%rsp)
callq 0xc8900
movss -0x5c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x153a7d
movss -0x64(%rbp), %xmm0
movq -0x50(%rbp), %rax
movss 0x50(%rax), %xmm1
addss %xmm1, %xmm0
movss -0x80(%rbp), %xmm1
leaq -0x164(%rbp), %rdi
callq 0xbf4c0
movq -0x18(%rbp), %rdi
movsd -0x164(%rbp), %xmm0
xorl %eax, %eax
movl %eax, %esi
movl $0x1, %edx
callq 0xc8120
movl -0xe0(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopw %cs:(%rax,%rax)