// File: Ciaxur[P]yagb-emu/include/imgui/imgui_widgets.cpp
// Function: bool ImGui::SliderBehaviorT<int, int, float>(ImRect const&, unsigned int, int, int*, int, int, char const*, int, ImRect*)
bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, TYPE* v, const TYPE v_min, const TYPE v_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb)
{
    ImGuiContext& g = *GImGui;
    const ImGuiStyle& style = g.Style;

    const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X;
    const bool is_decimal = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double);
    const bool is_logarithmic = (flags & ImGuiSliderFlags_Logarithmic) && is_decimal;

    const float grab_padding = 2.0f;
    const float slider_sz = (bb.Max[axis] - bb.Min[axis]) - grab_padding * 2.0f;
    float grab_sz = style.GrabMinSize;
    SIGNEDTYPE v_range = (v_min < v_max ? v_max - v_min : v_min - v_max);
    if (!is_decimal && v_range >= 0)                                             // v_range < 0 may happen on integer overflows
        grab_sz = ImMax((float)(slider_sz / (v_range + 1)), style.GrabMinSize);  // For integer sliders: if possible have the grab size represent 1 unit
    grab_sz = ImMin(grab_sz, slider_sz);
    const float slider_usable_sz = slider_sz - grab_sz;
    const float slider_usable_pos_min = bb.Min[axis] + grab_padding + grab_sz * 0.5f;
    const float slider_usable_pos_max = bb.Max[axis] - grab_padding - grab_sz * 0.5f;

    float logarithmic_zero_epsilon = 0.0f; // Only valid when is_logarithmic is true
    float zero_deadzone_halfsize = 0.0f; // Only valid when is_logarithmic is true
    if (is_logarithmic)
    {
        // When using logarithmic sliders, we need to clamp to avoid hitting zero, but our choice of clamp value greatly affects slider precision. We attempt to use the specified precision to estimate a good lower bound.
        const int decimal_precision = is_decimal ? ImParseFormatPrecision(format, 3) : 1;
        logarithmic_zero_epsilon = ImPow(0.1f, (float)decimal_precision);
        zero_deadzone_halfsize = (style.LogSliderDeadzone * 0.5f) / ImMax(slider_usable_sz, 1.0f);
    }

    // Process interacting with the slider
    bool value_changed = false;
    if (g.ActiveId == id)
    {
        bool set_new_value = false;
        float clicked_t = 0.0f;
        if (g.ActiveIdSource == ImGuiInputSource_Mouse)
        {
            if (!g.IO.MouseDown[0])
            {
                ClearActiveID();
            }
            else
            {
                const float mouse_abs_pos = g.IO.MousePos[axis];
                clicked_t = (slider_usable_sz > 0.0f) ? ImClamp((mouse_abs_pos - slider_usable_pos_min) / slider_usable_sz, 0.0f, 1.0f) : 0.0f;
                if (axis == ImGuiAxis_Y)
                    clicked_t = 1.0f - clicked_t;
                set_new_value = true;
            }
        }
        else if (g.ActiveIdSource == ImGuiInputSource_Nav)
        {
            if (g.ActiveIdIsJustActivated)
            {
                g.SliderCurrentAccum = 0.0f; // Reset any stored nav delta upon activation
                g.SliderCurrentAccumDirty = false;
            }

            const ImVec2 input_delta2 = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard | ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_RepeatFast, 0.0f, 0.0f);
            float input_delta = (axis == ImGuiAxis_X) ? input_delta2.x : -input_delta2.y;
            if (input_delta != 0.0f)
            {
                const int decimal_precision = is_decimal ? ImParseFormatPrecision(format, 3) : 0;
                if (decimal_precision > 0)
                {
                    input_delta /= 100.0f;    // Gamepad/keyboard tweak speeds in % of slider bounds
                    if (IsNavInputDown(ImGuiNavInput_TweakSlow))
                        input_delta /= 10.0f;
                }
                else
                {
                    if ((v_range >= -100.0f && v_range <= 100.0f) || IsNavInputDown(ImGuiNavInput_TweakSlow))
                        input_delta = ((input_delta < 0.0f) ? -1.0f : +1.0f) / (float)v_range; // Gamepad/keyboard tweak speeds in integer steps
                    else
                        input_delta /= 100.0f;
                }
                if (IsNavInputDown(ImGuiNavInput_TweakFast))
                    input_delta *= 10.0f;

                g.SliderCurrentAccum += input_delta;
                g.SliderCurrentAccumDirty = true;
            }

            float delta = g.SliderCurrentAccum;
            if (g.NavActivatePressedId == id && !g.ActiveIdIsJustActivated)
            {
                ClearActiveID();
            }
            else if (g.SliderCurrentAccumDirty)
            {
                clicked_t = ScaleRatioFromValueT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, *v, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);

                if ((clicked_t >= 1.0f && delta > 0.0f) || (clicked_t <= 0.0f && delta < 0.0f)) // This is to avoid applying the saturation when already past the limits
                {
                    set_new_value = false;
                    g.SliderCurrentAccum = 0.0f; // If pushing up against the limits, don't continue to accumulate
                }
                else
                {
                    set_new_value = true;
                    float old_clicked_t = clicked_t;
                    clicked_t = ImSaturate(clicked_t + delta);

                    // Calculate what our "new" clicked_t will be, and thus how far we actually moved the slider, and subtract this from the accumulator
                    TYPE v_new = ScaleValueFromRatioT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, clicked_t, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);
                    if (!(flags & ImGuiSliderFlags_NoRoundToFormat))
                        v_new = RoundScalarWithFormatT<TYPE, SIGNEDTYPE>(format, data_type, v_new);
                    float new_clicked_t = ScaleRatioFromValueT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, v_new, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);

                    if (delta > 0)
                        g.SliderCurrentAccum -= ImMin(new_clicked_t - old_clicked_t, delta);
                    else
                        g.SliderCurrentAccum -= ImMax(new_clicked_t - old_clicked_t, delta);
                }

                g.SliderCurrentAccumDirty = false;
            }
        }

        if (set_new_value)
        {
            TYPE v_new = ScaleValueFromRatioT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, clicked_t, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);

            // Round to user desired precision based on format string
            if (!(flags & ImGuiSliderFlags_NoRoundToFormat))
                v_new = RoundScalarWithFormatT<TYPE, SIGNEDTYPE>(format, data_type, v_new);

            // Apply result
            if (*v != v_new)
            {
                *v = v_new;
                value_changed = true;
            }
        }
    }

    if (slider_sz < 1.0f)
    {
        *out_grab_bb = ImRect(bb.Min, bb.Min);
    }
    else
    {
        // Output grab position so it can be displayed by the caller
        float grab_t = ScaleRatioFromValueT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, *v, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);
        if (axis == ImGuiAxis_Y)
            grab_t = 1.0f - grab_t;
        const float grab_pos = ImLerp(slider_usable_pos_min, slider_usable_pos_max, grab_t);
        if (axis == ImGuiAxis_X)
            *out_grab_bb = ImRect(grab_pos - grab_sz * 0.5f, bb.Min.y + grab_padding, grab_pos + grab_sz * 0.5f, bb.Max.y - grab_padding);
        else
            *out_grab_bb = ImRect(bb.Min.x + grab_padding, grab_pos - grab_sz * 0.5f, bb.Max.x - grab_padding, grab_pos + grab_sz * 0.5f);
    }

    return value_changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq 0x20(%rbp), %rax
movl 0x18(%rbp), %eax
movq 0x10(%rbp), %rax
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movl %r9d, -0x20(%rbp)
leaq 0xb48cd(%rip), %rax     # 0x212f40
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq $0x1560, %rax           # imm = 0x1560
movq %rax, -0x30(%rbp)
movl 0x18(%rbp), %edx
andl $0x100000, %edx         # imm = 0x100000
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovnel %ecx, %eax
movl %eax, -0x34(%rbp)
movb $0x1, %al
cmpl $0x8, -0x10(%rbp)
movb %al, -0xc9(%rbp)
je 0x15e6bc
cmpl $0x9, -0x10(%rbp)
sete %al
movb %al, -0xc9(%rbp)
movb -0xc9(%rbp), %al
andb $0x1, %al
movb %al, -0x35(%rbp)
movl 0x18(%rbp), %ecx
andl $0x20, %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0xca(%rbp)
je 0x15e6e3
movb -0x35(%rbp), %al
movb %al, -0xca(%rbp)
movb -0xca(%rbp), %al
andb $0x1, %al
movb %al, -0x36(%rbp)
movss 0x138d6(%rip), %xmm0    # 0x171fcc
movss %xmm0, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movslq -0x34(%rbp), %rsi
callq 0x167c90
movss %xmm0, -0xd0(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x167c90
movaps %xmm0, %xmm1
movss -0xd0(%rbp), %xmm0
subss %xmm1, %xmm0
movss 0x13ffc(%rip), %xmm1    # 0x172734
subss %xmm1, %xmm0
movss %xmm0, -0x40(%rbp)
movq -0x30(%rbp), %rax
movss 0x78(%rax), %xmm0
movss %xmm0, -0x44(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x20(%rbp), %eax
jge 0x15e765
movl -0x20(%rbp), %eax
subl -0x1c(%rbp), %eax
movl %eax, -0xd4(%rbp)
jmp 0x15e771
movl -0x1c(%rbp), %eax
subl -0x20(%rbp), %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
movl %eax, -0x48(%rbp)
testb $0x1, -0x35(%rbp)
jne 0x15e7ac
cmpl $0x0, -0x48(%rbp)
jl 0x15e7ac
movss -0x40(%rbp), %xmm0
movl -0x48(%rbp), %eax
addl $0x1, %eax
cvtsi2ss %eax, %xmm1
divss %xmm1, %xmm0
movq -0x30(%rbp), %rax
movss 0x78(%rax), %xmm1
callq 0x139050
movss %xmm0, -0x44(%rbp)
movss -0x44(%rbp), %xmm0
movss -0x40(%rbp), %xmm1
callq 0x13c690
movss %xmm0, -0x44(%rbp)
movss -0x40(%rbp), %xmm0
subss -0x44(%rbp), %xmm0
movss %xmm0, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
movslq -0x34(%rbp), %rsi
callq 0x167c90
movaps %xmm0, %xmm1
movss 0x137e5(%rip), %xmm0    # 0x171fcc
addss %xmm0, %xmm1
movss -0x44(%rbp), %xmm0
movss 0x137e0(%rip), %xmm2    # 0x171fd8
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rdi
addq $0x8, %rdi
movslq -0x34(%rbp), %rsi
callq 0x167c90
movaps %xmm0, %xmm1
movss 0x137ab(%rip), %xmm0    # 0x171fcc
subss %xmm0, %xmm1
movss -0x44(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss 0x13799(%rip), %xmm2    # 0x171fd8
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x54(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x5c(%rbp)
testb $0x1, -0x36(%rbp)
je 0x15e8f1
testb $0x1, -0x35(%rbp)
je 0x15e882
movq 0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x145670
movl %eax, -0xd8(%rbp)
jmp 0x15e88f
movl $0x1, %eax
movl %eax, -0xd8(%rbp)
jmp 0x15e88f
movl -0xd8(%rbp), %eax
movl %eax, -0x60(%rbp)
cvtsi2ssl -0x60(%rbp), %xmm1
movss 0x13ed7(%rip), %xmm0    # 0x17277c
callq 0x15b1d0
movss %xmm0, -0x58(%rbp)
movq -0x30(%rbp), %rax
movss 0x1371d(%rip), %xmm0    # 0x171fd8
mulss 0x80(%rax), %xmm0
movss %xmm0, -0xdc(%rbp)
movss -0x4c(%rbp), %xmm0
movss 0x12364(%rip), %xmm1    # 0x170c3c
callq 0x139050
movaps %xmm0, %xmm1
movss -0xdc(%rbp), %xmm0
divss %xmm1, %xmm0
movss %xmm0, -0x5c(%rbp)
movb $0x0, -0x61(%rbp)
movq -0x28(%rbp), %rax
movl 0x1b30(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x15ee12
movb $0x0, -0x62(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x68(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x1, 0x1b68(%rax)
jne 0x15e9ce
movq -0x28(%rbp), %rax
testb $0x1, 0x130(%rax)
jne 0x15e93c
callq 0xca040
jmp 0x15e9c9
movq -0x28(%rbp), %rdi
addq $0x8, %rdi
addq $0x120, %rdi            # imm = 0x120
movslq -0x34(%rbp), %rsi
callq 0x15bb20
movss (%rax), %xmm0
movss %xmm0, -0x6c(%rbp)
movss -0x4c(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x15e993
movss -0x6c(%rbp), %xmm0
subss -0x50(%rbp), %xmm0
divss -0x4c(%rbp), %xmm0
xorps %xmm1, %xmm1
movss 0x122b8(%rip), %xmm2    # 0x170c3c
callq 0x13c020
movss %xmm0, -0xe0(%rbp)
jmp 0x15e9a0
xorps %xmm0, %xmm0
movss %xmm0, -0xe0(%rbp)
jmp 0x15e9a0
movss -0xe0(%rbp), %xmm0
movss %xmm0, -0x68(%rbp)
cmpl $0x1, -0x34(%rbp)
jne 0x15e9c5
movss 0x12281(%rip), %xmm0    # 0x170c3c
subss -0x68(%rbp), %xmm0
movss %xmm0, -0x68(%rbp)
movb $0x1, -0x62(%rbp)
jmp 0x15ed9c
movq -0x28(%rbp), %rax
cmpl $0x2, 0x1b68(%rax)
jne 0x15ed9a
movq -0x28(%rbp), %rax
testb $0x1, 0x1b3c(%rax)
je 0x15ea06
movq -0x28(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x3094(%rax)
movq -0x28(%rbp), %rax
movb $0x0, 0x3098(%rax)
movl $0x3, %edi
movl $0x5, %esi
xorps %xmm1, %xmm1
movaps %xmm1, %xmm0
callq 0xdf970
movlpd %xmm0, -0x74(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x15ea35
movss -0x74(%rbp), %xmm0
movss %xmm0, -0xe4(%rbp)
jmp 0x15ea4f
movss -0x70(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss %xmm0, -0xe4(%rbp)
movss -0xe4(%rbp), %xmm0
movss %xmm0, -0x78(%rbp)
movss -0x78(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x15ea70
jp 0x15ea70
jmp 0x15ebb1
testb $0x1, -0x35(%rbp)
je 0x15ea8c
movq 0x10(%rbp), %rdi
movl $0x3, %esi
callq 0x145670
movl %eax, -0xe8(%rbp)
jmp 0x15ea96
xorl %eax, %eax
movl %eax, -0xe8(%rbp)
jmp 0x15ea96
movl -0xe8(%rbp), %eax
movl %eax, -0x7c(%rbp)
cmpl $0x0, -0x7c(%rbp)
jle 0x15eae6
movss -0x78(%rbp), %xmm0
movss 0x13cc6(%rip), %xmm1    # 0x172778
divss %xmm1, %xmm0
movss %xmm0, -0x78(%rbp)
movl $0xe, %edi
callq 0xec0f0
testb $0x1, %al
jne 0x15eacb
jmp 0x15eae1
movss -0x78(%rbp), %xmm0
movss 0x13504(%rip), %xmm1    # 0x171fdc
divss %xmm1, %xmm0
movss %xmm0, -0x78(%rbp)
jmp 0x15eb6b
cvtsi2ssl -0x48(%rbp), %xmm0
movss 0x19b21(%rip), %xmm1    # 0x178614
ucomiss %xmm1, %xmm0
jb 0x15eb0a
cvtsi2ssl -0x48(%rbp), %xmm1
movss 0x13c73(%rip), %xmm0    # 0x172778
ucomiss %xmm1, %xmm0
jae 0x15eb1a
movl $0xe, %edi
callq 0xec0f0
testb $0x1, %al
jne 0x15eb1a
jmp 0x15eb53
movss -0x78(%rbp), %xmm0
movss 0x13459(%rip), %xmm3    # 0x171f80
movss 0x1210d(%rip), %xmm2    # 0x170c3c
xorps %xmm1, %xmm1
cmpltss %xmm1, %xmm0
movaps %xmm0, %xmm1
andps %xmm3, %xmm1
andnps %xmm2, %xmm0
orps %xmm1, %xmm0
cvtsi2ssl -0x48(%rbp), %xmm1
divss %xmm1, %xmm0
movss %xmm0, -0x78(%rbp)
jmp 0x15eb69
movss -0x78(%rbp), %xmm0
movss 0x13c18(%rip), %xmm1    # 0x172778
divss %xmm1, %xmm0
movss %xmm0, -0x78(%rbp)
jmp 0x15eb6b
movl $0xf, %edi
callq 0xec0f0
testb $0x1, %al
jne 0x15eb7b
jmp 0x15eb8d
movss 0x13459(%rip), %xmm0    # 0x171fdc
mulss -0x78(%rbp), %xmm0
movss %xmm0, -0x78(%rbp)
movss -0x78(%rbp), %xmm0
movq -0x28(%rbp), %rax
addss 0x3094(%rax), %xmm0
movss %xmm0, 0x3094(%rax)
movq -0x28(%rbp), %rax
movb $0x1, 0x3098(%rax)
movq -0x28(%rbp), %rax
movss 0x3094(%rax), %xmm0
movss %xmm0, -0x80(%rbp)
movq -0x28(%rbp), %rax
movl 0x1ca8(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x15ebe8
movq -0x28(%rbp), %rax
testb $0x1, 0x1b3c(%rax)
jne 0x15ebe8
callq 0xca040
jmp 0x15ed98
movq -0x28(%rbp), %rax
testb $0x1, 0x3098(%rax)
je 0x15ed96
movl -0x10(%rbp), %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movb -0x36(%rbp), %al
movss -0x58(%rbp), %xmm0
movss -0x5c(%rbp), %xmm1
andb $0x1, %al
movzbl %al, %r8d
callq 0x1630b0
movss %xmm0, -0x68(%rbp)
movss -0x68(%rbp), %xmm0
movss 0x1200a(%rip), %xmm1    # 0x170c3c
ucomiss %xmm1, %xmm0
jb 0x15ec44
movss -0x80(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
ja 0x15ec56
xorps %xmm0, %xmm0
ucomiss -0x68(%rbp), %xmm0
jb 0x15ec6e
xorps %xmm0, %xmm0
ucomiss -0x80(%rbp), %xmm0
jbe 0x15ec6e
movb $0x0, -0x62(%rbp)
movq -0x28(%rbp), %rax
xorps %xmm0, %xmm0
movss %xmm0, 0x3094(%rax)
jmp 0x15ed8b
movb $0x1, -0x62(%rbp)
movss -0x68(%rbp), %xmm0
movss %xmm0, -0x84(%rbp)
movss -0x68(%rbp), %xmm0
addss -0x80(%rbp), %xmm0
callq 0x13bfc0
movss %xmm0, -0x68(%rbp)
movl -0x10(%rbp), %edi
movss -0x68(%rbp), %xmm0
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movb -0x36(%rbp), %al
movss -0x58(%rbp), %xmm1
movss -0x5c(%rbp), %xmm2
andb $0x1, %al
movzbl %al, %ecx
callq 0x163530
movl %eax, -0x88(%rbp)
movl 0x18(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x15ece1
movq 0x10(%rbp), %rdi
movl -0x10(%rbp), %esi
movl -0x88(%rbp), %edx
callq 0x163a20
movl %eax, -0x88(%rbp)
movl -0x10(%rbp), %edi
movl -0x88(%rbp), %esi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movb -0x36(%rbp), %al
movss -0x58(%rbp), %xmm0
movss -0x5c(%rbp), %xmm1
andb $0x1, %al
movzbl %al, %r8d
callq 0x1630b0
movss %xmm0, -0x8c(%rbp)
movss -0x80(%rbp), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jbe 0x15ed54
movss -0x8c(%rbp), %xmm0
subss -0x84(%rbp), %xmm0
movss -0x80(%rbp), %xmm1
callq 0x13c690
movaps %xmm0, %xmm1
movq -0x28(%rbp), %rax
movss 0x3094(%rax), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x3094(%rax)
jmp 0x15ed89
movss -0x8c(%rbp), %xmm0
subss -0x84(%rbp), %xmm0
movss -0x80(%rbp), %xmm1
callq 0x139050
movaps %xmm0, %xmm1
movq -0x28(%rbp), %rax
movss 0x3094(%rax), %xmm0
subss %xmm1, %xmm0
movss %xmm0, 0x3094(%rax)
jmp 0x15ed8b
movq -0x28(%rbp), %rax
movb $0x0, 0x3098(%rax)
jmp 0x15ed98
jmp 0x15ed9a
jmp 0x15ed9c
testb $0x1, -0x62(%rbp)
je 0x15ee10
movl -0x10(%rbp), %edi
movss -0x68(%rbp), %xmm0
movl -0x1c(%rbp), %esi
movl -0x20(%rbp), %edx
movb -0x36(%rbp), %al
movss -0x58(%rbp), %xmm1
movss -0x5c(%rbp), %xmm2
andb $0x1, %al
movzbl %al, %ecx
callq 0x163530
movl %eax, -0x90(%rbp)
movl 0x18(%rbp), %eax
andl $0x40, %eax
cmpl $0x0, %eax
jne 0x15edf0
movq 0x10(%rbp), %rdi
movl -0x10(%rbp), %esi
movl -0x90(%rbp), %edx
callq 0x163a20
movl %eax, -0x90(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
cmpl -0x90(%rbp), %eax
je 0x15ee0e
movl -0x90(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x61(%rbp)
jmp 0x15ee10
jmp 0x15ee12
movss 0x11e22(%rip), %xmm0    # 0x170c3c
ucomiss -0x40(%rbp), %xmm0
jbe 0x15ee52
movq -0x8(%rbp), %rsi
movq -0x8(%rbp), %rdx
leaq -0xa0(%rbp), %rdi
callq 0xe8660
movq 0x20(%rbp), %rax
movq -0xa0(%rbp), %rcx
movq %rcx, (%rax)
movq -0x98(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x15eff2
movl -0x10(%rbp), %edi
movq -0x18(%rbp), %rax
movl (%rax), %esi
movl -0x1c(%rbp), %edx
movl -0x20(%rbp), %ecx
movb -0x36(%rbp), %al
movss -0x58(%rbp), %xmm0
movss -0x5c(%rbp), %xmm1
andb $0x1, %al
movzbl %al, %r8d
callq 0x1630b0
movss %xmm0, -0xa4(%rbp)
cmpl $0x1, -0x34(%rbp)
jne 0x15ee9f
movss 0x11dad(%rip), %xmm0    # 0x170c3c
subss -0xa4(%rbp), %xmm0
movss %xmm0, -0xa4(%rbp)
movss -0x50(%rbp), %xmm0
movss -0x54(%rbp), %xmm1
movss -0xa4(%rbp), %xmm2
callq 0x13c080
movss %xmm0, -0xa8(%rbp)
cmpl $0x0, -0x34(%rbp)
jne 0x15ef5f
movss -0xa8(%rbp), %xmm1
movss -0x44(%rbp), %xmm0
movd %xmm0, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm0
movss 0x130ee(%rip), %xmm2    # 0x171fd8
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss 0x130ce(%rip), %xmm1    # 0x171fcc
addss 0x4(%rax), %xmm1
movss -0xa8(%rbp), %xmm3
movss -0x44(%rbp), %xmm2
movss 0x130c0(%rip), %xmm4    # 0x171fd8
mulss %xmm4, %xmm2
addss %xmm3, %xmm2
movq -0x8(%rbp), %rax
movss 0xc(%rax), %xmm3
movss 0x1309b(%rip), %xmm4    # 0x171fcc
subss %xmm4, %xmm3
leaq -0xb8(%rbp), %rdi
callq 0xec090
movq 0x20(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, (%rax)
movq -0xb0(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x15eff0
movq -0x8(%rbp), %rax
movss 0x13061(%rip), %xmm0    # 0x171fcc
addss (%rax), %xmm0
movss -0xa8(%rbp), %xmm2
movss -0x44(%rbp), %xmm1
movd %xmm1, %eax
xorl $0x80000000, %eax       # imm = 0x80000000
movd %eax, %xmm1
movss 0x13047(%rip), %xmm3    # 0x171fd8
mulss %xmm3, %xmm1
addss %xmm2, %xmm1
movq -0x8(%rbp), %rax
movss 0x8(%rax), %xmm2
movss 0x13022(%rip), %xmm3    # 0x171fcc
subss %xmm3, %xmm2
movss -0xa8(%rbp), %xmm4
movss -0x44(%rbp), %xmm3
movss 0x13015(%rip), %xmm5    # 0x171fd8
mulss %xmm5, %xmm3
addss %xmm4, %xmm3
leaq -0xc8(%rbp), %rdi
callq 0xec090
movq 0x20(%rbp), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, (%rax)
movq -0xc0(%rbp), %rcx
movq %rcx, 0x8(%rax)
jmp 0x15eff2
movb -0x61(%rbp), %al
andb $0x1, %al
addq $0xf0, %rsp
popq %rbp
retq