// File: /workspace/github_cpp_makefile_star2_O2/Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: ImGui::ColorEdit4(char const*, float*, int)
bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags)
{
    ImGuiWindow* window = GetCurrentWindow();
    if (window->SkipItems)
        return false;

    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;
    const float square_sz = GetFrameHeight();
    const float w_full = CalcItemWidth();
    const float w_button = (flags & ImGuiColorEditFlags_NoSmallPreview) ? 0.0f : (square_sz + style.ItemInnerSpacing.x);
    const float w_inputs = w_full - w_button;
    const char* label_display_end = FindRenderedTextEnd(label);
    g.NextItemData.ClearFlags();

    BeginGroup();
    PushID(label);

    // If we're not showing any slider there's no point in doing any HSV conversions
    const ImGuiColorEditFlags flags_untouched = flags;
    if (flags & ImGuiColorEditFlags_NoInputs)
        flags = (flags & (~ImGuiColorEditFlags__DisplayMask)) | ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_NoOptions;

    // Context menu: display and modify options (before defaults are applied)
    if (!(flags & ImGuiColorEditFlags_NoOptions))
        ColorEditOptionsPopup(col, flags);

    // Read stored options
    if (!(flags & ImGuiColorEditFlags__DisplayMask))
        flags |= (g.ColorEditOptions & ImGuiColorEditFlags__DisplayMask);
    if (!(flags & ImGuiColorEditFlags__DataTypeMask))
        flags |= (g.ColorEditOptions & ImGuiColorEditFlags__DataTypeMask);
    if (!(flags & ImGuiColorEditFlags__PickerMask))
        flags |= (g.ColorEditOptions & ImGuiColorEditFlags__PickerMask);
    if (!(flags & ImGuiColorEditFlags__InputMask))
        flags |= (g.ColorEditOptions & ImGuiColorEditFlags__InputMask);
    flags |= (g.ColorEditOptions & ~(ImGuiColorEditFlags__DisplayMask | ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags__PickerMask | ImGuiColorEditFlags__InputMask));
    IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__DisplayMask)); // Check that only 1 is selected
    IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiColorEditFlags__InputMask));   // Check that only 1 is selected

    const bool alpha = (flags & ImGuiColorEditFlags_NoAlpha) == 0;
    const bool hdr = (flags & ImGuiColorEditFlags_HDR) != 0;
    const int components = alpha ? 4 : 3;

    // Convert to the formats we need
    float f[4] = { col[0], col[1], col[2], alpha ? col[3] : 1.0f };
    if ((flags & ImGuiColorEditFlags_InputHSV) && (flags & ImGuiColorEditFlags_DisplayRGB))
        ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]);
    else if ((flags & ImGuiColorEditFlags_InputRGB) && (flags & ImGuiColorEditFlags_DisplayHSV))
    {
        // Hue is lost when converting from greyscale rgb (saturation=0). Restore it.
        ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]);
        if (memcmp(g.ColorEditLastColor, col, sizeof(float) * 3) == 0)
        {
            if (f[1] == 0)
                f[0] = g.ColorEditLastHue;
            if (f[2] == 0)
                f[1] = g.ColorEditLastSat;
        }
    }
    int i[4] = { IM_F32_TO_INT8_UNBOUND(f[0]), IM_F32_TO_INT8_UNBOUND(f[1]), IM_F32_TO_INT8_UNBOUND(f[2]), IM_F32_TO_INT8_UNBOUND(f[3]) };

    bool value_changed = false;
    bool value_changed_as_float = false;

    const ImVec2 pos = window->DC.CursorPos;
    const float inputs_offset_x = (style.ColorButtonPosition == ImGuiDir_Left) ? w_button : 0.0f;
    window->DC.CursorPos.x = pos.x + inputs_offset_x;

    if ((flags & (ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV)) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
    {
        // RGB/HSV 0..255 Sliders
        const float w_item_one  = ImMax(1.0f, IM_FLOOR((w_inputs - (style.ItemInnerSpacing.x) * (components - 1)) / (float)components));
        const float w_item_last = ImMax(1.0f, IM_FLOOR(w_inputs - (w_item_one + style.ItemInnerSpacing.x) * (components - 1)));

        const bool hide_prefix = (w_item_one <= CalcTextSize((flags & ImGuiColorEditFlags_Float) ? "M:0.000" : "M:000").x);
        static const char* ids[4] = { "##X", "##Y", "##Z", "##W" };
        static const char* fmt_table_int[3][4] =
        {
            {   "%3d",   "%3d",   "%3d",   "%3d" }, // Short display
            { "R:%3d", "G:%3d", "B:%3d", "A:%3d" }, // Long display for RGBA
            { "H:%3d", "S:%3d", "V:%3d", "A:%3d" }  // Long display for HSVA
        };
        static const char* fmt_table_float[3][4] =
        {
            {   "%0.3f",   "%0.3f",   "%0.3f",   "%0.3f" }, // Short display
            { "R:%0.3f", "G:%0.3f", "B:%0.3f", "A:%0.3f" }, // Long display for RGBA
            { "H:%0.3f", "S:%0.3f", "V:%0.3f", "A:%0.3f" }  // Long display for HSVA
        };
        const int fmt_idx = hide_prefix ? 0 : (flags & ImGuiColorEditFlags_DisplayHSV) ? 2 : 1;

        for (int n = 0; n < components; n++)
        {
            if (n > 0)
                SameLine(0, style.ItemInnerSpacing.x);
            SetNextItemWidth((n + 1 < components) ? w_item_one : w_item_last);

            // FIXME: When ImGuiColorEditFlags_HDR flag is passed HS values snap in weird ways when SV values go below 0.
            if (flags & ImGuiColorEditFlags_Float)
            {
                value_changed |= DragFloat(ids[n], &f[n], 1.0f / 255.0f, 0.0f, hdr ? 0.0f : 1.0f, fmt_table_float[fmt_idx][n]);
                value_changed_as_float |= value_changed;
            }
            else
            {
                value_changed |= DragInt(ids[n], &i[n], 1.0f, 0, hdr ? 0 : 255, fmt_table_int[fmt_idx][n]);
            }
            if (!(flags & ImGuiColorEditFlags_NoOptions))
                OpenPopupOnItemClick("context");
        }
    }
    else if ((flags & ImGuiColorEditFlags_DisplayHex) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
    {
        // RGB Hexadecimal Input
        char buf[64];
        if (alpha)
            ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X%02X", ImClamp(i[0], 0, 255), ImClamp(i[1], 0, 255), ImClamp(i[2], 0, 255), ImClamp(i[3], 0, 255));
        else
            ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp(i[0], 0, 255), ImClamp(i[1], 0, 255), ImClamp(i[2], 0, 255));
        SetNextItemWidth(w_inputs);
        if (InputText("##Text", buf, IM_ARRAYSIZE(buf), ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase))
        {
            value_changed = true;
            char* p = buf;
            while (*p == '#' || ImCharIsBlankA(*p))
                p++;
            i[0] = i[1] = i[2] = i[3] = 0;
            if (alpha)
                sscanf(p, "%02X%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2], (unsigned int*)&i[3]); // Treat at unsigned (%X is unsigned)
            else
                sscanf(p, "%02X%02X%02X", (unsigned int*)&i[0], (unsigned int*)&i[1], (unsigned int*)&i[2]);
        }
        if (!(flags & ImGuiColorEditFlags_NoOptions))
            OpenPopupOnItemClick("context");
    }

    ImGuiWindow* picker_active_window = NULL;
    if (!(flags & ImGuiColorEditFlags_NoSmallPreview))
    {
        const float button_offset_x = ((flags & ImGuiColorEditFlags_NoInputs) || (style.ColorButtonPosition == ImGuiDir_Left)) ? 0.0f : w_inputs + style.ItemInnerSpacing.x;
        window->DC.CursorPos = ImVec2(pos.x + button_offset_x, pos.y);

        const ImVec4 col_v4(col[0], col[1], col[2], alpha ? col[3] : 1.0f);
        if (ColorButton("##ColorButton", col_v4, flags))
        {
            if (!(flags & ImGuiColorEditFlags_NoPicker))
            {
                // Store current color and open a picker
                g.ColorPickerRef = col_v4;
                OpenPopup("picker");
                SetNextWindowPos(window->DC.LastItemRect.GetBL() + ImVec2(-1, style.ItemSpacing.y));
            }
        }
        if (!(flags & ImGuiColorEditFlags_NoOptions))
            OpenPopupOnItemClick("context");

        if (BeginPopup("picker"))
        {
            picker_active_window = g.CurrentWindow;
            if (label != label_display_end)
            {
                TextEx(label, label_display_end);
                Spacing();
            }
            ImGuiColorEditFlags picker_flags_to_forward = ImGuiColorEditFlags__DataTypeMask | ImGuiColorEditFlags__PickerMask | ImGuiColorEditFlags__InputMask | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaBar;
            ImGuiColorEditFlags picker_flags = (flags_untouched & picker_flags_to_forward) | ImGuiColorEditFlags__DisplayMask | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_AlphaPreviewHalf;
            SetNextItemWidth(square_sz * 12.0f); // Use 256 + bar sizes?
            value_changed |= ColorPicker4("##picker", col, picker_flags, &g.ColorPickerRef.x);
            EndPopup();
        }
    }

    if (label != label_display_end && !(flags & ImGuiColorEditFlags_NoLabel))
    {
        const float text_offset_x = (flags & ImGuiColorEditFlags_NoInputs) ? w_button : w_full + style.ItemInnerSpacing.x;
        window->DC.CursorPos = ImVec2(pos.x + text_offset_x, pos.y + style.FramePadding.y);
        TextEx(label, label_display_end);
    }

    // Convert back
    if (value_changed && picker_active_window == NULL)
    {
        if (!value_changed_as_float)
            for (int n = 0; n < 4; n++)
                f[n] = i[n] / 255.0f;
        if ((flags & ImGuiColorEditFlags_DisplayHSV) && (flags & ImGuiColorEditFlags_InputRGB))
        {
            g.ColorEditLastHue = f[0];
            g.ColorEditLastSat = f[1];
            ColorConvertHSVtoRGB(f[0], f[1], f[2], f[0], f[1], f[2]);
            memcpy(g.ColorEditLastColor, f, sizeof(float) * 3);
        }
        if ((flags & ImGuiColorEditFlags_DisplayRGB) && (flags & ImGuiColorEditFlags_InputHSV))
            ColorConvertRGBtoHSV(f[0], f[1], f[2], f[0], f[1], f[2]);

        col[0] = f[0];
        col[1] = f[1];
        col[2] = f[2];
        if (alpha)
            col[3] = f[3];
    }

    PopID();
    EndGroup();

    // Drag and Drop Target
    // NB: The flag test is merely an optional micro-optimization, BeginDragDropTarget() does the same test.
    if ((window->DC.LastItemStatusFlags & ImGuiItemStatusFlags_HoveredRect) && !(flags & ImGuiColorEditFlags_NoDragDrop) && BeginDragDropTarget())
    {
        bool accepted_drag_drop = false;
        if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F))
        {
            memcpy((float*)col, payload->Data, sizeof(float) * 3); // Preserve alpha if any //-V512
            value_changed = accepted_drag_drop = true;
        }
        if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F))
        {
            memcpy((float*)col, payload->Data, sizeof(float) * components);
            value_changed = accepted_drag_drop = true;
        }

        // Drag-drop payloads are always RGB
        if (accepted_drag_drop && (flags & ImGuiColorEditFlags_InputHSV))
            ColorConvertRGBtoHSV(col[0], col[1], col[2], col[0], col[1], col[2]);
        EndDragDropTarget();
    }

    // When picker is being actively used, use its active id so IsItemActive() will function on ColorEdit4().
    if (picker_active_window && g.ActiveId != 0 && g.ActiveIdWindow == picker_active_window)
        window->DC.LastItemId = g.ActiveId;

    if (value_changed)
        MarkItemEdited(window->DC.LastItemId);

    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
leaq 0x5ec24(%rip), %rax     # 0xe3ce0
movq (%rax), %r12
movq 0x1ae0(%r12), %r15
movb $0x1, 0x90(%r15)
cmpb $0x0, 0x93(%r15)
je 0x850e1
xorl %r14d, %r14d
jmp 0x85c3a
movl %edx, %ebx
movq %rsi, %r13
movq %rdi, %r14
callq 0x43ec9
movss %xmm0, -0x84(%rbp)
callq 0x43d17
movss %xmm0, -0x8c(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x44(%rbp)
testb $0x10, %bl
jne 0x85127
movss 0x15b0(%r12), %xmm0
addss -0x84(%rbp), %xmm0
movss %xmm0, -0x44(%rbp)
movq %r14, %rdi
xorl %esi, %esi
callq 0x36123
movq %rax, -0xa8(%rbp)
andl $0x0, 0x1bf8(%r12)
callq 0x43ff2
movq %r14, %rdi
callq 0x42ea4
movl %ebx, %esi
andl $0xff8ffff7, %esi       # imm = 0xFF8FFFF7
orl $0x100008, %esi         # imm = 0x100008
testb $0x20, %bl
cmovel %ebx, %esi
testb $0x8, %sil
movq %r14, -0xb0(%rbp)
jne 0x8518f
movq %r13, %rdi
movq %r15, %r14
movq %r12, %r15
movq %r13, %r12
movl %esi, %r13d
callq 0x85c91
movl %r13d, %esi
movq %r12, %r13
movq %r15, %r12
movq %r14, %r15
testl $0x700000, %esi         # imm = 0x700000
jne 0x851a6
movl $0x700000, %eax         # imm = 0x700000
andl 0x306c(%r12), %eax
orl %eax, %esi
testl $0x1800000, %esi        # imm = 0x1800000
jne 0x851bd
movl $0x1800000, %eax        # imm = 0x1800000
andl 0x306c(%r12), %eax
orl %eax, %esi
testl $0x6000000, %esi        # imm = 0x6000000
movl %ebx, -0xb8(%rbp)
jne 0x851da
movl $0x6000000, %eax        # imm = 0x6000000
andl 0x306c(%r12), %eax
orl %eax, %esi
movl 0x306c(%r12), %ebx
movl %ebx, %eax
andl $0x18000000, %eax       # imm = 0x18000000
xorl %edx, %edx
testl $0x18000000, %esi       # imm = 0x18000000
cmovel %eax, %edx
movl %esi, %eax
andl $0x700000, %eax         # imm = 0x700000
leal -0x1(%rax), %ecx
xorl %ecx, %eax
cmpl %ecx, %eax
jbe 0x85c53
movl %esi, -0x50(%rbp)
orl %esi, %edx
movl %edx, %eax
andl $0x18000000, %eax       # imm = 0x18000000
leal -0x1(%rax), %ecx
xorl %ecx, %eax
cmpl %ecx, %eax
jbe 0x85c72
andl $0xe00fffff, %ebx       # imm = 0xE00FFFFF
orl %edx, %ebx
testb $0x2, %bl
sete %r14b
movss (%r13), %xmm0
movss %xmm0, -0x40(%rbp)
movss 0x4(%r13), %xmm1
movss %xmm1, -0x3c(%rbp)
movss 0x8(%r13), %xmm2
movss %xmm2, -0x38(%rbp)
testb $0x2, %bl
jne 0x8525e
movss 0xc(%r13), %xmm3
jmp 0x85266
movss 0x16d92(%rip), %xmm3    # 0x9bff8
leaq -0x3c(%rbp), %rsi
leaq -0x38(%rbp), %rcx
movss %xmm3, 0x4(%rcx)
movl $0x10100000, %eax       # imm = 0x10100000
movl %edx, %edi
andl %eax, %edi
movl %edx, %r8d
notl %r8d
movl %edi, -0xc0(%rbp)
cmpl %eax, %edi
movl %ebx, -0x2c(%rbp)
movl %edx, -0xb4(%rbp)
movl %r8d, -0xbc(%rbp)
jne 0x852b2
leaq -0x40(%rbp), %rbx
movq %rcx, %rdx
movq %rbx, %rdi
callq 0x34e2e
movss 0x4(%rbx), %xmm1
jmp 0x852eb
testl $0x8200000, %r8d        # imm = 0x8200000
jne 0x852ee
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
leaq -0x38(%rbp), %rdx
callq 0x34d92
leaq 0x3078(%r12), %rdi
pushq $0xc
popq %rdx
movq %r13, %rsi
callq 0xc5f0
movss 0x4(%rbx), %xmm1
testl %eax, %eax
je 0x85767
movl -0x2c(%rbp), %ebx
xorl %eax, %eax
movb %r14b, %al
movq %rax, %r14
movss -0x40(%rbp), %xmm5
movss -0x38(%rbp), %xmm4
xorps %xmm0, %xmm0
xorps %xmm6, %xmm6
cmpless %xmm5, %xmm6
movss 0x16d05(%rip), %xmm2    # 0x9c018
movaps %xmm6, %xmm7
andps %xmm2, %xmm7
movss 0x175d3(%rip), %xmm3    # 0x9c8f4
andnps %xmm3, %xmm6
orps %xmm7, %xmm6
movss 0x17545(%rip), %xmm7    # 0x9c874
mulss %xmm7, %xmm5
addss %xmm6, %xmm5
cvttss2si %xmm5, %ecx
movl %ecx, -0x80(%rbp)
xorps %xmm5, %xmm5
cmpless %xmm1, %xmm5
movaps %xmm5, %xmm6
andps %xmm2, %xmm6
andnps %xmm3, %xmm5
orps %xmm6, %xmm5
mulss %xmm7, %xmm1
addss %xmm5, %xmm1
cvttss2si %xmm1, %r8d
xorps %xmm1, %xmm1
cmpless %xmm4, %xmm1
movaps %xmm1, %xmm5
andps %xmm2, %xmm5
andnps %xmm3, %xmm1
orps %xmm5, %xmm1
mulss %xmm7, %xmm4
addss %xmm1, %xmm4
cvttss2si %xmm4, %r9d
movl %r8d, -0x7c(%rbp)
movl %r9d, -0x78(%rbp)
movss -0x34(%rbp), %xmm1
cmpless %xmm1, %xmm0
andps %xmm0, %xmm2
andnps %xmm3, %xmm0
orps %xmm2, %xmm0
mulss %xmm7, %xmm1
addss %xmm0, %xmm1
cvttss2si %xmm1, %eax
movl %eax, -0x74(%rbp)
movss 0xd8(%r15), %xmm0
movss %xmm0, -0x68(%rbp)
cmpl $0x0, 0x15f0(%r12)
movss -0x44(%rbp), %xmm0
je 0x853cb
xorps %xmm0, %xmm0
movss -0x8c(%rbp), %xmm1
subss -0x44(%rbp), %xmm1
movss %xmm1, -0x64(%rbp)
addl $0x3, %r14d
movss 0xdc(%r15), %xmm1
movss %xmm1, -0x88(%rbp)
addss -0x68(%rbp), %xmm0
movss %xmm0, 0xd8(%r15)
movl %ebx, %edx
andl $0x20, %edx
testl $0x300000, -0x50(%rbp)  # imm = 0x300000
movq %r14, -0xd8(%rbp)
je 0x85640
testl %edx, %edx
jne 0x85640
movq %r13, -0x98(%rbp)
movq %r15, -0xa0(%rbp)
movq %r12, -0xd0(%rbp)
movss 0x15b0(%r12), %xmm0
movss %xmm0, -0x60(%rbp)
movl %ebx, %r12d
leal -0x1(%r14), %ebx
movl -0x50(%rbp), %r13d
btl $0x18, %r13d
leaq 0x34383(%rip), %rax     # 0xb97df
leaq 0x34374(%rip), %rdi     # 0xb97d7
cmovaeq %rax, %rdi
xorl %r15d, %r15d
movss 0x16b7e(%rip), %xmm0    # 0x9bff0
xorl %esi, %esi
xorl %edx, %edx
callq 0x365e8
btl $0x15, %r13d
movl $0x0, %r13d
adcl $0x1, %r13d
btl $0x13, %r12d
cvtsi2ss %ebx, %xmm1
movss -0x60(%rbp), %xmm6
movaps %xmm6, %xmm2
mulss %xmm1, %xmm2
movss -0x64(%rbp), %xmm4
movaps %xmm4, %xmm3
subss %xmm2, %xmm3
cvtsi2ss %r14d, %xmm2
divss %xmm2, %xmm3
cvttps2dq %xmm3, %xmm2
cvtdq2ps %xmm2, %xmm2
movss 0x16b35(%rip), %xmm3    # 0x9bff8
movaps %xmm3, %xmm5
maxss %xmm2, %xmm5
movss %xmm5, -0x58(%rbp)
movaps %xmm6, %xmm2
addss %xmm5, %xmm2
mulss %xmm1, %xmm2
movaps %xmm4, %xmm1
subss %xmm2, %xmm1
cvttps2dq %xmm1, %xmm1
cvtdq2ps %xmm1, %xmm1
movss %xmm3, -0x6c(%rbp)
movss %xmm3, -0x90(%rbp)
jae 0x85502
xorps %xmm2, %xmm2
movss %xmm2, -0x90(%rbp)
movss -0x6c(%rbp), %xmm2
maxss %xmm1, %xmm2
movss %xmm2, -0x6c(%rbp)
movl $0xff, %eax
cmovbl %r15d, %eax
movl %eax, -0xc4(%rbp)
movq %r14, %rax
leal (,%r14,4), %edx
movq %rdx, -0xe8(%rbp)
ucomiss -0x58(%rbp), %xmm0
cmovael %r15d, %r13d
movl %eax, %eax
movq %rax, -0xe0(%rbp)
shll $0x5, %r13d
leaq 0x59623(%rip), %r12     # 0xdeb70
pushq $0x1
popq %rbx
movq $0x0, -0x60(%rbp)
xorl %r14d, %r14d
cmpq %r15, -0xe8(%rbp)
je 0x856a5
testq %r15, %r15
je 0x85584
movq -0xd0(%rbp), %rax
movss 0x15b0(%rax), %xmm1
xorps %xmm0, %xmm0
callq 0x437ec
movss -0x58(%rbp), %xmm0
cmpq -0xe0(%rbp), %rbx
jb 0x85597
movss -0x6c(%rbp), %xmm0
callq 0x35469
btl $0x18, -0x50(%rbp)
movq (%r12), %rdi
leaq (%r13,%r15,2), %rax
jb 0x855dc
leaq (%r15,%rbp), %rsi
addq $-0x80, %rsi
leaq 0x595d5(%rip), %rcx     # 0xdeb90
movq (%rcx,%rax), %r8
movss 0x16a31(%rip), %xmm0    # 0x9bff8
xorl %edx, %edx
movl -0xc4(%rbp), %ecx
xorl %r9d, %r9d
callq 0x7f7d3
orb %al, %r14b
jmp 0x8561b
leaq (%r15,%rbp), %rsi
addq $-0x40, %rsi
leaq 0x59605(%rip), %rcx     # 0xdebf0
movq (%rcx,%rax), %rdx
xorps %xmm1, %xmm1
movss 0x1727e(%rip), %xmm0    # 0x9c878
movss -0x90(%rbp), %xmm2
xorl %ecx, %ecx
callq 0x7f52a
movq %r14, %rcx
orb %al, %cl
movq %rcx, %r14
movq -0x60(%rbp), %rax
orb %cl, %al
movq %rax, -0x60(%rbp)
testb $0x8, -0x2c(%rbp)
jne 0x85630
leaq 0x19c91(%rip), %rdi     # 0x9f2b9
pushq $0x1
popq %rsi
callq 0x44dd8
addq $0x4, %r15
addq $0x8, %r12
incq %rbx
jmp 0x8555b
movq $0x0, -0x60(%rbp)
btl $0x16, -0x50(%rbp)
jae 0x856c2
movl $0x0, %r14d
testl %edx, %edx
jne 0x857e2
movl $0xff, %edx
cmpl %edx, %ecx
cmovgel %edx, %ecx
xorl %esi, %esi
testl %ecx, %ecx
cmovlel %esi, %ecx
cmpl %edx, %r8d
cmovgel %edx, %r8d
testl %r8d, %r8d
cmovlel %esi, %r8d
cmpl %edx, %r9d
cmovgel %edx, %r9d
testl %r9d, %r9d
cmovlel %esi, %r9d
testb $0x2, %bl
jne 0x856ca
cmpl %edx, %eax
cmovll %eax, %edx
testl %edx, %edx
cmovlel %esi, %edx
movl %edx, (%rsp)
leaq 0x341b4(%rip), %rdx     # 0xb9857
jmp 0x856d1
movq -0xa0(%rbp), %r15
movq -0xd0(%rbp), %r12
movq -0x98(%rbp), %r13
movl -0x2c(%rbp), %ebx
jmp 0x857e2
xorl %r14d, %r14d
jmp 0x857e2
leaq 0x34198(%rip), %rdx     # 0xb9869
leaq -0x140(%rbp), %rdi
pushq $0x40
popq %rsi
xorl %eax, %eax
callq 0x3468c
movss -0x64(%rbp), %xmm0
callq 0x35469
leaq 0x34184(%rip), %rdi     # 0xb9877
xorl %r14d, %r14d
leaq -0x140(%rbp), %rbx
pushq $0x40
popq %rdx
pushq $0x6
popq %rcx
movq %rbx, %rsi
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x83c1c
testb %al, %al
je 0x857c3
leaq -0x7c(%rbp), %rcx
leaq -0x78(%rbp), %r8
leaq -0x74(%rbp), %r9
movabsq $0x900000200, %rax      # imm = 0x900000200
movzbl (%rbx), %edx
cmpq $0x23, %rdx
ja 0x85743
btq %rdx, %rax
jae 0x85743
incq %rbx
jmp 0x8572f
xorps %xmm0, %xmm0
movaps %xmm0, -0x80(%rbp)
testb $0x2, -0x2c(%rbp)
jne 0x857ab
leaq 0x34101(%rip), %rsi     # 0xb9858
leaq -0x80(%rbp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc0c0
jmp 0x857c0
xorps %xmm0, %xmm0
ucomiss %xmm0, %xmm1
movl -0x2c(%rbp), %ebx
jne 0x85783
jp 0x85783
movss 0x3070(%r12), %xmm2
movss %xmm2, -0x40(%rbp)
movss -0x38(%rbp), %xmm2
ucomiss %xmm0, %xmm2
jne 0x852ee
jp 0x852ee
movss 0x3074(%r12), %xmm1
movss %xmm1, -0x3c(%rbp)
jmp 0x852ee
leaq 0x340b8(%rip), %rsi     # 0xb986a
leaq -0x80(%rbp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0xc0c0
movb $0x1, %r14b
movl -0x2c(%rbp), %ebx
testb $0x8, %bl
jne 0x857da
leaq 0x19ae7(%rip), %rdi     # 0x9f2b9
pushq $0x1
popq %rsi
callq 0x44dd8
movq $0x0, -0x60(%rbp)
testb $0x10, %bl
jne 0x85847
xorps %xmm0, %xmm0
testb $0x20, %bl
jne 0x85809
cmpl $0x0, 0x15f0(%r12)
je 0x85809
movss -0x64(%rbp), %xmm0
addss 0x15b0(%r12), %xmm0
addss -0x68(%rbp), %xmm0
movss %xmm0, 0xd8(%r15)
movss -0x88(%rbp), %xmm0
movss %xmm0, 0xdc(%r15)
movss (%r13), %xmm0
movss 0x4(%r13), %xmm1
movss 0x8(%r13), %xmm2
testb $0x2, %bl
jne 0x85854
movss 0xc(%r13), %xmm3
jmp 0x8585c
movq $0x0, -0x50(%rbp)
jmp 0x859c7
movss 0x1679c(%rip), %xmm3    # 0x9bff8
leaq -0x140(%rbp), %rsi
movss %xmm0, (%rsi)
movss %xmm1, 0x4(%rsi)
movss %xmm2, 0x8(%rsi)
movss %xmm3, 0xc(%rsi)
leaq 0x34001(%rip), %rdi     # 0xb987e
xorps %xmm0, %xmm0
movl %ebx, %edx
callq 0x86066
testb $0x4, %bl
sete %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x858f2
movups -0x140(%rbp), %xmm0
movups %xmm0, 0x3084(%r12)
leaq 0x207f9(%rip), %rdi     # 0xa60a4
xorl %esi, %esi
callq 0x446ff
movups 0x12c(%r15), %xmm0
movaps %xmm0, %xmm1
shufps $0xff, %xmm0, %xmm1     # xmm1 = xmm1[3,3],xmm0[3,3]
addss 0x16727(%rip), %xmm0    # 0x9bff0
addss 0x15ac(%r12), %xmm1
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
leaq -0xf0(%rbp), %rdi
movlps %xmm0, (%rdi)
leaq -0xf8(%rbp), %rdx
andq $0x0, (%rdx)
xorl %esi, %esi
callq 0x42997
testb $0x8, %bl
jne 0x85906
leaq 0x199bb(%rip), %rdi     # 0x9f2b9
pushq $0x1
popq %rsi
callq 0x44dd8
leaq 0x20797(%rip), %rdi     # 0xa60a4
movq $0x0, -0x50(%rbp)
xorl %esi, %esi
callq 0x44c84
testb %al, %al
je 0x859c7
movq %r15, -0xa0(%rbp)
movq %r14, -0x58(%rbp)
movq %r13, -0x98(%rbp)
movq 0x1ae0(%r12), %rax
movq %rax, -0x50(%rbp)
movq -0xb0(%rbp), %rdi
movq -0xa8(%rbp), %r15
cmpq %rdi, %r15
je 0x85964
movq %r15, %rsi
xorl %edx, %edx
callq 0x7911c
callq 0x7c641
movl -0xb8(%rbp), %r13d
andl $0x1f890002, %r13d      # imm = 0x1F890002
orl $0x740080, %r13d        # imm = 0x740080
movss -0x84(%rbp), %xmm0
mulss 0x16faf(%rip), %xmm0    # 0x9c938
callq 0x35469
leaq 0x3084(%r12), %rcx
leaq 0x20705(%rip), %rdi     # 0xa60a2
movq -0x98(%rbp), %rsi
movl %r13d, %edx
movq %rsi, %r13
callq 0x865a3
movq -0x58(%rbp), %r14
orb %al, %r14b
callq 0x44bbe
movq %r15, %rsi
movq -0xa0(%rbp), %r15
jmp 0x859ce
movq -0xa8(%rbp), %rsi
cmpq -0xb0(%rbp), %rsi
je 0x85a38
movl %ebx, %eax
andl $0x80, %eax
jne 0x85a38
testb $0x20, %bl
jne 0x859fc
movss -0x8c(%rbp), %xmm0
addss 0x15b0(%r12), %xmm0
movss %xmm0, -0x44(%rbp)
movss -0x68(%rbp), %xmm0
addss -0x44(%rbp), %xmm0
movss -0x88(%rbp), %xmm1
addss 0x159c(%r12), %xmm1
movss %xmm0, 0xd8(%r15)
movss %xmm1, 0xdc(%r15)
movq -0xb0(%rbp), %rdi
xorl %edx, %edx
callq 0x7911c
testb $0x1, %r14b
je 0x85b3f
cmpq $0x0, -0x50(%rbp)
jne 0x85b3f
testb $0x1, -0x60(%rbp)
leaq -0x3c(%rbp), %rsi
movl -0xbc(%rbp), %ecx
je 0x85ac5
movq %r14, -0x58(%rbp)
movss -0x40(%rbp), %xmm0
movss -0x3c(%rbp), %xmm1
movss -0x38(%rbp), %xmm2
testl $0x8200000, %ecx        # imm = 0x8200000
jne 0x85ae6
movss %xmm0, 0x3070(%r12)
movss %xmm1, 0x3074(%r12)
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %rsi, %r14
leaq -0x38(%rbp), %rdx
callq 0x34e2e
movl 0x8(%rbx), %eax
movl %eax, 0x3080(%r12)
movq (%rbx), %rax
movq %rax, 0x3078(%r12)
movss (%rbx), %xmm0
movss 0x4(%rbx), %xmm1
movss 0x8(%rbx), %xmm2
jmp 0x85ae9
xorl %eax, %eax
cmpq $0x4, %rax
je 0x85a5d
cvtsi2ssl -0x80(%rbp,%rax,4), %xmm0
divss 0x16d99(%rip), %xmm0    # 0x9c874
movss %xmm0, -0x40(%rbp,%rax,4)
incq %rax
jmp 0x85ac7
movq %rsi, %r14
cmpl $0x10100000, -0xc0(%rbp) # imm = 0x10100000
jne 0x85b16
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
leaq -0x38(%rbp), %rdx
callq 0x34d92
movss (%rbx), %xmm0
movss 0x4(%rbx), %xmm1
movss 0x8(%rbx), %xmm2
movl -0x2c(%rbp), %ebx
movq -0x58(%rbp), %r14
movss %xmm0, (%r13)
movss %xmm1, 0x4(%r13)
movss %xmm2, 0x8(%r13)
testb $0x2, %bl
jne 0x85b3f
movss -0x34(%rbp), %xmm0
movss %xmm0, 0xc(%r13)
callq 0x42fea
callq 0x4352b
testb $0x1, 0x128(%r15)
je 0x85c00
andl $0x200, %ebx            # imm = 0x200
jne 0x85c00
callq 0x45f1c
testb %al, %al
je 0x85c00
leaq 0x20564(%rip), %rdi     # 0xa60db
xorl %esi, %esi
callq 0x45ffc
testq %rax, %rax
setne %bl
je 0x85b9a
movq (%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%r13)
movq (%rax), %rax
movq %rax, (%r13)
movb $0x1, %r14b
leaq 0x20541(%rip), %rdi     # 0xa60e2
xorl %esi, %esi
callq 0x45ffc
testq %rax, %rax
je 0x85bc7
movq (%rax), %rsi
movq -0xd8(%rbp), %rdx
shll $0x2, %edx
movq %r13, %rdi
callq 0xc080
movb $0x1, %r14b
movb $0x1, %bl
btl $0x1c, -0xb4(%rbp)
setae %al
xorb $0x1, %bl
orb %al, %bl
jne 0x85bfb
leaq 0x4(%r13), %rsi
leaq 0x8(%r13), %rdx
movss (%r13), %xmm0
movss 0x4(%r13), %xmm1
movss 0x8(%r13), %xmm2
movq %r13, %rdi
callq 0x34d92
callq 0x4628f
cmpq $0x0, -0x50(%rbp)
je 0x85c28
movl 0x1b30(%r12), %eax
testl %eax, %eax
je 0x85c28
movq -0x50(%rbp), %rcx
cmpq %rcx, 0x1b60(%r12)
jne 0x85c28
movl %eax, 0x124(%r15)
testb $0x1, %r14b
je 0x85c3a
movl 0x124(%r15), %edi
callq 0x3749e
andb $0x1, %r14b
movl %r14d, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x33aca(%rip), %rdi     # 0xb9724
leaq 0x32727(%rip), %rsi     # 0xb8388
leaq 0x33af5(%rip), %rcx     # 0xb975d
movl $0x123b, %edx           # imm = 0x123B
callq 0xc140
leaq 0x33b27(%rip), %rdi     # 0xb97a0
leaq 0x32708(%rip), %rsi     # 0xb8388
leaq 0x33ad6(%rip), %rcx     # 0xb975d
movl $0x123c, %edx           # imm = 0x123C
callq 0xc140