// File: /workspace/github_cpp_makefile_star2_O2/YiweiMao[P]tessDX/src/tessellator.cpp
// Function: CHLSLTessellator::QuadHLSLProcessTessFactors(float, float, float, float, float, float)
void CHLSLTessellator::QuadHLSLProcessTessFactors( float tessFactor_Ueq0, float tessFactor_Veq0, float tessFactor_Ueq1, float tessFactor_Veq1, 
                                               float insideTessFactorScaleU, float insideTessFactorScaleV )
{
    if( !(tessFactor_Ueq0 > 0) ||// NaN will pass
        !(tessFactor_Veq0 > 0) || 
        !(tessFactor_Ueq1 > 0) ||
        !(tessFactor_Veq1 > 0) )
    {
        m_LastUnRoundedComputedTessFactors[0] = tessFactor_Ueq0;
        m_LastUnRoundedComputedTessFactors[1] = tessFactor_Veq0;
        m_LastUnRoundedComputedTessFactors[2] = tessFactor_Ueq1;
        m_LastUnRoundedComputedTessFactors[3] = tessFactor_Veq1;
        m_LastUnRoundedComputedTessFactors[4] = 0;
        m_LastUnRoundedComputedTessFactors[5] = 0;
        m_LastComputedTessFactors[0] = 
        m_LastComputedTessFactors[1] = 
        m_LastComputedTessFactors[2] = 
        m_LastComputedTessFactors[3] = 
        m_LastComputedTessFactors[4] = 
        m_LastComputedTessFactors[5] = 0;
        return;
    }

    CleanupFloatTessFactor(tessFactor_Ueq0);// clamp to [1.0f..INF], NaN->1.0f
    CleanupFloatTessFactor(tessFactor_Veq0); 
    CleanupFloatTessFactor(tessFactor_Ueq1);
    CleanupFloatTessFactor(tessFactor_Veq1);

    // Save off tessFactors so they can be returned to app
    m_LastUnRoundedComputedTessFactors[0] = tessFactor_Ueq0;
    m_LastUnRoundedComputedTessFactors[1] = tessFactor_Veq0;
    m_LastUnRoundedComputedTessFactors[2] = tessFactor_Ueq1;
    m_LastUnRoundedComputedTessFactors[3] = tessFactor_Veq1;

    // Process outside tessFactors
    float outsideTessFactor[QUAD_EDGES] = {tessFactor_Ueq0, tessFactor_Veq0, tessFactor_Ueq1, tessFactor_Veq1};
    int edge, axis;
    TESSELLATOR_PARITY insideTessFactorParity[QUAD_AXES], outsideTessFactorParity[QUAD_EDGES];
    if( Pow2Partitioning() || IntegerPartitioning() )
    {
        for( edge = 0; edge < QUAD_EDGES; edge++ )
        {
            RoundUpTessFactor(outsideTessFactor[edge]);
            ClampTessFactor(outsideTessFactor[edge]); // clamp unbounded user input based on tessellation mode
            int edgeEven = isEven(outsideTessFactor[edge]);
            outsideTessFactorParity[edge] = edgeEven ? TESSELLATOR_PARITY_EVEN : TESSELLATOR_PARITY_ODD;
        }
    }
    else
    {
        SetTessellationParity(m_originalParity); // ClampTessFactor needs it
        for( edge = 0; edge < QUAD_EDGES; edge++ )
        {
            ClampTessFactor(outsideTessFactor[edge]); // clamp unbounded user input based on tessellation mode
            outsideTessFactorParity[edge] = m_originalParity;
        }
    }
    
    // Compute inside TessFactors
    float insideTessFactor[QUAD_AXES];
    if( m_quadInsideTessFactorReductionAxis == D3D11_TESSELLATOR_QUAD_REDUCTION_1_AXIS )
    {
        switch( m_insideTessFactorReduction )
        {
        case D3D11_TESSELLATOR_REDUCTION_MIN:
            insideTessFactor[U] = fmin(fmin(tessFactor_Veq0,tessFactor_Veq1),fmin(tessFactor_Ueq0,tessFactor_Ueq1));
            break;
        case D3D11_TESSELLATOR_REDUCTION_MAX:
            insideTessFactor[U] = fmax(fmax(tessFactor_Veq0,tessFactor_Veq1),fmax(tessFactor_Ueq0,tessFactor_Ueq1));
            break;
        case D3D11_TESSELLATOR_REDUCTION_AVERAGE:
            insideTessFactor[U] = (tessFactor_Veq0 + tessFactor_Veq1 + tessFactor_Ueq0 + tessFactor_Ueq1) / 4;
            break;
        }
        // Scale inside tessFactor based on user scale factor.

        ClampFloatTessFactorScale(insideTessFactorScaleU); // clamp scale value to [0..1], NaN->0
        insideTessFactor[U] = insideTessFactor[U]*insideTessFactorScaleU;

        // Compute inside parity
        if( Pow2Partitioning() || IntegerPartitioning() )
        {
            ClampTessFactor(insideTessFactor[U]); // clamp reduction + scale result that is based on unbounded user input
            m_LastUnRoundedComputedTessFactors[4] = m_LastUnRoundedComputedTessFactors[5] = insideTessFactor[U]; // Save off TessFactors so they can be returned to app
            RoundUpTessFactor(insideTessFactor[U]);
            insideTessFactorParity[U] = 
            insideTessFactorParity[V] = 
                (isEven(insideTessFactor[U]) || (FLOAT_ONE == insideTessFactor[U]) )
                ? TESSELLATOR_PARITY_EVEN : TESSELLATOR_PARITY_ODD;
        }
        else
        {
            ClampTessFactor(insideTessFactor[U]); // clamp reduction + scale result that is based on unbounded user input
            m_LastUnRoundedComputedTessFactors[4] = m_LastUnRoundedComputedTessFactors[5] = insideTessFactor[U]; // Save off TessFactors so they can be returned to app
            // no parity changes for fractional tessellation - just use what the user requested
            insideTessFactorParity[U] = insideTessFactorParity[V] = m_originalParity;
        }

        // To prevent snapping on edges, the "picture frame" comes
        // in using avg or max (and ignore inside TessFactor scaling) until it is at least 3.
        if( (TESSELLATOR_PARITY_ODD == insideTessFactorParity[U]) &&
            (insideTessFactor[U] < FLOAT_THREE) )
        {
            if(D3D11_TESSELLATOR_REDUCTION_MAX == m_insideTessFactorReduction)
            {
                insideTessFactor[U] = fmin(FLOAT_THREE,fmax(fmax(tessFactor_Veq0,tessFactor_Veq1),fmax(tessFactor_Ueq0,tessFactor_Ueq1)));
            }
            else
            {
                insideTessFactor[U] = fmin(FLOAT_THREE,(tessFactor_Veq0 + tessFactor_Veq1 + tessFactor_Ueq0 + tessFactor_Ueq1) / 4);
            }
            ClampTessFactor(insideTessFactor[U]); // clamp reduction result that is based on unbounded user input
            m_LastUnRoundedComputedTessFactors[4] = m_LastUnRoundedComputedTessFactors[5] = insideTessFactor[U]; // Save off TessFactors so they can be returned to app
            if( IntegerPartitioning())
            {
                RoundUpTessFactor(insideTessFactor[U]);
                insideTessFactorParity[U] = 
                insideTessFactorParity[V] = isEven(insideTessFactor[U]) ? TESSELLATOR_PARITY_EVEN : TESSELLATOR_PARITY_ODD;
            }
        }
        insideTessFactor[V] = insideTessFactor[U];
    }
    else
    {
        switch( m_insideTessFactorReduction )
        {
        case D3D11_TESSELLATOR_REDUCTION_MIN:
            insideTessFactor[U] = fmin(tessFactor_Veq0,tessFactor_Veq1);
            insideTessFactor[V] = fmin(tessFactor_Ueq0,tessFactor_Ueq1);
            break;
        case D3D11_TESSELLATOR_REDUCTION_MAX:
            insideTessFactor[U] = fmax(tessFactor_Veq0,tessFactor_Veq1);
            insideTessFactor[V] = fmax(tessFactor_Ueq0,tessFactor_Ueq1);
            break;
        case D3D11_TESSELLATOR_REDUCTION_AVERAGE:
            insideTessFactor[U] = (tessFactor_Veq0 + tessFactor_Veq1) / 2;
            insideTessFactor[V] = (tessFactor_Ueq0 + tessFactor_Ueq1) / 2;
            break;
        }
        // Scale inside tessFactors based on user scale factor.

        ClampFloatTessFactorScale(insideTessFactorScaleU); // clamp scale value to [0..1], NaN->0
        ClampFloatTessFactorScale(insideTessFactorScaleV);
        insideTessFactor[U] = insideTessFactor[U]*insideTessFactorScaleU;
        insideTessFactor[V] = insideTessFactor[V]*insideTessFactorScaleV;

        // Compute inside parity
        if( Pow2Partitioning() || IntegerPartitioning() )
        {
            for( axis = 0; axis < QUAD_AXES; axis++ )
            {
                ClampTessFactor(insideTessFactor[axis]); // clamp reduction + scale result that is based on unbounded user input
                m_LastUnRoundedComputedTessFactors[4+axis] = insideTessFactor[axis]; // Save off TessFactors so they can be returned to app
                RoundUpTessFactor(insideTessFactor[axis]);
                insideTessFactorParity[axis] = 
                    (isEven(insideTessFactor[axis]) || (FLOAT_ONE == insideTessFactor[axis]) )
                    ? TESSELLATOR_PARITY_EVEN : TESSELLATOR_PARITY_ODD;
            }
        }
        else
        {
            ClampTessFactor(insideTessFactor[U]); // clamp reduction + scale result that is based on unbounded user input
            ClampTessFactor(insideTessFactor[V]); // clamp reduction + scale result that is based on unbounded user input
            m_LastUnRoundedComputedTessFactors[4] = insideTessFactor[U]; // Save off TessFactors so they can be returned to app
            m_LastUnRoundedComputedTessFactors[5] = insideTessFactor[V]; // Save off TessFactors so they can be returned to app
             // no parity changes for fractional tessellation - just use what the user requested
            insideTessFactorParity[U] = insideTessFactorParity[V] = m_originalParity;
        }

        // To prevent snapping on edges, the "picture frame" comes
        // in using avg or max (and ignore inside TessFactor scaling) until it is at least 3.
        if( (TESSELLATOR_PARITY_ODD == insideTessFactorParity[U]) &&
            (insideTessFactor[U] < FLOAT_THREE) )
        {
            if(D3D11_TESSELLATOR_REDUCTION_MAX == m_insideTessFactorReduction)
            {
                insideTessFactor[U] = fmin(FLOAT_THREE,fmax(tessFactor_Veq0,tessFactor_Veq1));
            }
            else
            {
                insideTessFactor[U] = fmin(FLOAT_THREE,(tessFactor_Veq0 + tessFactor_Veq1) / 2);
            }
            ClampTessFactor(insideTessFactor[U]); // clamp reduction result that is based on unbounded user input
            m_LastUnRoundedComputedTessFactors[4] = insideTessFactor[U]; // Save off TessFactors so they can be returned to app
            if( IntegerPartitioning())
            {
                RoundUpTessFactor(insideTessFactor[U]);
                insideTessFactorParity[U] = isEven(insideTessFactor[U]) ? TESSELLATOR_PARITY_EVEN : TESSELLATOR_PARITY_ODD;
            }
        }

        if( (TESSELLATOR_PARITY_ODD == insideTessFactorParity[V]) &&
            (insideTessFactor[V] < FLOAT_THREE) )
        {
            if(D3D11_TESSELLATOR_REDUCTION_MAX == m_insideTessFactorReduction)
            {
                insideTessFactor[V] = fmin(FLOAT_THREE,fmax(tessFactor_Ueq0,tessFactor_Ueq1));
            }
            else
            {
                insideTessFactor[V] = fmin(FLOAT_THREE,(tessFactor_Ueq0 + tessFactor_Ueq1) / 2);
            }
            ClampTessFactor(insideTessFactor[V]);// clamp reduction result that is based on unbounded user input
            m_LastUnRoundedComputedTessFactors[5] = insideTessFactor[V]; // Save off TessFactors so they can be returned to app
            if( IntegerPartitioning())
            {
                RoundUpTessFactor(insideTessFactor[V]);
                insideTessFactorParity[V] = isEven(insideTessFactor[V]) ? TESSELLATOR_PARITY_EVEN : TESSELLATOR_PARITY_ODD;
            }
        }

        for( axis = 0; axis < QUAD_AXES; axis++ )
        {
            if( TESSELLATOR_PARITY_ODD == insideTessFactorParity[axis] )
            {
                // Ensure the first ring ("picture frame") interpolates in on all sides
                // as much as the side with the minimum TessFactor.  Prevents snapping to edge. 
                if( (insideTessFactor[axis] < FLOAT_THREE) && (insideTessFactor[axis] < insideTessFactor[(axis+1)&0x1]))
                {
                    insideTessFactor[axis] = fmin(insideTessFactor[(axis+1)&0x1],FLOAT_THREE);
                    m_LastUnRoundedComputedTessFactors[4+axis] = insideTessFactor[axis]; // Save off TessFactors so they can be returned to app
                }
            }
        }
    }

    // Save off TessFactors so they can be returned to app
    m_LastComputedTessFactors[0] = outsideTessFactor[Ueq0];
    m_LastComputedTessFactors[1] = outsideTessFactor[Veq0];
    m_LastComputedTessFactors[2] = outsideTessFactor[Ueq1];
    m_LastComputedTessFactors[3] = outsideTessFactor[Veq1];
    m_LastComputedTessFactors[4] = insideTessFactor[U];
    m_LastComputedTessFactors[5] = insideTessFactor[V];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
movss %xmm4, 0x48(%rsp)
movss %xmm5, 0x4c(%rsp)
xorps %xmm4, %xmm4
ucomiss %xmm4, %xmm0
jbe 0x40447c
ucomiss %xmm4, %xmm1
jbe 0x40447c
ucomiss %xmm4, %xmm2
jbe 0x40447c
ucomiss %xmm4, %xmm3
jbe 0x40447c
unpcklps %xmm1, %xmm0            # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movaps 0xc0d4a(%rip), %xmm1    # 0x4c50f0
movaps %xmm0, %xmm4
cmpltps %xmm1, %xmm4
unpcklps %xmm3, %xmm2            # xmm2 = xmm2[0],xmm3[0],xmm2[1],xmm3[1]
movaps %xmm2, %xmm3
cmpltps %xmm1, %xmm3
movaps 0xc0d42(%rip), %xmm5    # 0x4c5100
movaps %xmm0, %xmm6
andps %xmm5, %xmm6
pcmpeqd %xmm5, %xmm6
movaps 0xc0d40(%rip), %xmm9    # 0x4c5110
movaps %xmm0, %xmm8
andps %xmm9, %xmm8
pxor %xmm7, %xmm7
pcmpeqd %xmm7, %xmm8
pandn %xmm6, %xmm8
por %xmm4, %xmm8
movaps %xmm1, %xmm4
andps %xmm8, %xmm4
andnps %xmm0, %xmm8
orps %xmm4, %xmm8
movaps %xmm2, %xmm0
andps %xmm5, %xmm0
pcmpeqd %xmm5, %xmm0
andps %xmm2, %xmm9
pcmpeqd %xmm7, %xmm9
pandn %xmm0, %xmm9
por %xmm3, %xmm9
andps %xmm9, %xmm1
andnps %xmm2, %xmm9
orps %xmm1, %xmm9
movaps %xmm8, 0x30(%rsp)
movaps %xmm8, %xmm0
movaps %xmm9, 0x10(%rsp)
movlhps %xmm9, %xmm0            # xmm0 = xmm0[0],xmm9[0]
movups %xmm0, 0x94(%rbx)
movaps %xmm0, 0x50(%rsp)
movl 0x6c(%rbx), %ebp
cmpl $0x1, %ebp
ja 0x4044b8
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x4044dd
leaq (%rsp,%r15), %r14
addq $0x50, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a02
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a38
addq $0x4, %r15
jmp 0x40444e
movss %xmm0, 0x94(%rbx)
movss %xmm1, 0x98(%rbx)
movss %xmm2, 0x9c(%rbx)
movss %xmm3, 0xa0(%rbx)
andq $0x0, 0xa4(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x7c(%rbx)
andq $0x0, 0x8c(%rbx)
jmp 0x4049be
movl 0x60(%rbx), %eax
movl %eax, 0x64(%rbx)
xorl %r14d, %r14d
cmpq $0x10, %r14
je 0x4044dd
leaq (%rsp,%r14), %rsi
addq $0x50, %rsi
movq %rbx, %rdi
callq 0x404a38
addq $0x4, %r14
jmp 0x4044c1
cmpl $0x0, 0x78(%rbx)
movl 0x74(%rbx), %r13d
je 0x404524
movaps 0x30(%rsp), %xmm0
movaps %xmm0, %xmm1
addps 0x10(%rsp), %xmm1
cmpl $0x2, %r13d
movaps %xmm1, 0x60(%rsp)
je 0x4045ad
cmpl $0x1, %r13d
je 0x404585
testl %r13d, %r13d
jne 0x4045bc
movaps 0x10(%rsp), %xmm2
movaps %xmm2, %xmm0
movaps 0x30(%rsp), %xmm1
minps %xmm1, %xmm0
jmp 0x404593
cmpl $0x2, %r13d
movaps 0x30(%rsp), %xmm0
je 0x40483d
cmpl $0x1, %r13d
je 0x404801
testl %r13d, %r13d
jne 0x404861
movaps 0x30(%rsp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps 0x10(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
callq 0x410d40
movss %xmm0, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x410d40
movaps %xmm0, %xmm1
movss 0x20(%rsp), %xmm0
callq 0x410d40
jmp 0x404836
movaps %xmm0, %xmm1
movaps 0x10(%rsp), %xmm2
movaps %xmm2, %xmm0
maxps %xmm1, %xmm0
movaps %xmm1, %xmm3
cmpunordps %xmm1, %xmm3
movaps %xmm2, %xmm1
andps %xmm3, %xmm1
andnps %xmm0, %xmm3
orps %xmm1, %xmm3
movaps %xmm3, 0x20(%rsp)
jmp 0x4045bc
movaps 0xc0b6c(%rip), %xmm0    # 0x4c5120
mulps %xmm1, %xmm0
movaps %xmm0, 0x20(%rsp)
leaq 0x48(%rsp), %r15
movq %r15, %rsi
callq 0x404a88
leaq 0x4c(%rsp), %r12
movq %r12, %rsi
callq 0x404a88
leaq 0x4(%rsp), %r14
movss (%r12), %xmm0
movss (%r15), %xmm1
unpcklps %xmm0, %xmm1            # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
movaps 0x20(%rsp), %xmm0
shufps $0xe1, %xmm0, %xmm0     # xmm0 = xmm0[1,0,2,3]
mulps %xmm1, %xmm0
movlps %xmm0, -0x4(%r14)
cmpl $0x1, %ebp
ja 0x40465d
xorl %r12d, %r12d
cmpq $0x8, %r12
je 0x404690
leaq (%rsp,%r12), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x404a38
movss (%r15), %xmm0
movss %xmm0, 0xa4(%rbx,%r12)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x404a02
movss (%r15), %xmm0
cvttss2si %xmm0, %eax
ucomiss 0xc09ff(%rip), %xmm0    # 0x4c5044
setp %cl
setne %dl
orb %cl, %dl
andb %al, %dl
movzbl %dl, %eax
movl %eax, 0x8(%rsp,%r12)
addq $0x4, %r12
jmp 0x404602
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x404a38
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a38
movsd (%r15), %xmm0
movsd %xmm0, 0xa4(%rbx)
movl 0x60(%rbx), %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x8(%rsp)
jmp 0x404699
movl 0x8(%rsp), %eax
movss (%rsp), %xmm0
cmpl $0x1, %eax
jne 0x404725
movss 0xc09ae(%rip), %xmm1    # 0x4c5058
ucomiss %xmm0, %xmm1
jbe 0x404725
cmpl $0x1, %r13d
movaps 0x60(%rsp), %xmm0
jne 0x4046d3
movaps 0x30(%rsp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps 0x10(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
callq 0x410d00
jmp 0x4046df
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
mulss 0xc097d(%rip), %xmm0    # 0x4c505c
minss 0xc0971(%rip), %xmm0    # 0x4c5058
movq %rsp, %r15
movss %xmm0, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x404a38
movss (%r15), %xmm0
movss %xmm0, 0xa4(%rbx)
testl %ebp, %ebp
jne 0x404725
movq %rsp, %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x404a02
cvttss2si (%r15), %eax
andl $0x1, %eax
movl %eax, 0x8(%rsp)
cmpl $0x1, 0xc(%rsp)
jne 0x4047a8
movss 0xc0924(%rip), %xmm0    # 0x4c5058
ucomiss 0x4(%rsp), %xmm0
jbe 0x4047a8
cmpl $0x1, %r13d
jne 0x404752
movaps 0x30(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x410d00
jmp 0x404765
movaps 0x30(%rsp), %xmm0
addss 0x10(%rsp), %xmm0
mulss 0xc08f7(%rip), %xmm0    # 0x4c505c
minss 0xc08eb(%rip), %xmm0    # 0x4c5058
movss %xmm0, 0x4(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a38
movss 0x4(%rsp), %xmm0
movss %xmm0, 0xa8(%rbx)
testl %ebp, %ebp
jne 0x4047a8
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a02
cvttss2si 0x4(%rsp), %eax
andl $0x1, %eax
movl %eax, 0xc(%rsp)
xorl %eax, %eax
movss 0xc08a6(%rip), %xmm0    # 0x4c5058
cmpq $0x2, %rax
je 0x4047f1
cmpl $0x1, 0x8(%rsp,%rax,4)
jne 0x4047ec
movss (%rsp,%rax,4), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x4047ec
movq %rax, %rcx
xorq $0x1, %rcx
movss (%rsp,%rcx,4), %xmm2
ucomiss %xmm1, %xmm2
jbe 0x4047ec
minss %xmm0, %xmm2
movss %xmm2, (%rsp,%rax,4)
movss %xmm2, 0xa4(%rbx,%rax,4)
incq %rax
jmp 0x4047b2
movss (%rsp), %xmm1
movss 0x4(%rsp), %xmm0
jmp 0x4049a5
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps 0x10(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
callq 0x410d00
movss %xmm0, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x410d00
movaps %xmm0, %xmm1
movss 0x20(%rsp), %xmm0
callq 0x410d00
movaps %xmm0, 0x20(%rsp)
jmp 0x404861
movaps %xmm0, %xmm2
movaps 0x10(%rsp), %xmm1
addps %xmm1, %xmm2
shufps $0x55, %xmm2, %xmm2     # xmm2 = xmm2[1,1,1,1]
addss %xmm0, %xmm2
addss %xmm1, %xmm2
mulss 0xc0804(%rip), %xmm2    # 0x4c5060
movaps %xmm2, 0x20(%rsp)
leaq 0x48(%rsp), %r14
movq %r14, %rsi
callq 0x404a88
movaps 0x20(%rsp), %xmm0
mulss (%r14), %xmm0
movq %rsp, %r14
movss %xmm0, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a38
movss (%r14), %xmm0
movss %xmm0, 0xa8(%rbx)
movss %xmm0, 0xa4(%rbx)
cmpl $0x1, %ebp
ja 0x4048cf
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a02
movss (%r14), %xmm0
cvttss2si %xmm0, %ecx
ucomiss 0xc0781(%rip), %xmm0    # 0x4c5044
setp %dl
setne %al
orb %dl, %al
andb %cl, %al
jmp 0x4048d6
cmpl $0x1, 0x60(%rbx)
sete %al
testb %al, %al
je 0x4049a2
movss 0xc0772(%rip), %xmm1    # 0x4c5058
ucomiss %xmm0, %xmm1
movaps %xmm0, %xmm1
jbe 0x4049a5
cmpl $0x1, %r13d
jne 0x404934
movaps 0x30(%rsp), %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
movaps 0x10(%rsp), %xmm1
shufps $0x55, %xmm1, %xmm1     # xmm1 = xmm1[1,1,1,1]
callq 0x410d00
movss %xmm0, 0x20(%rsp)
movaps 0x30(%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
callq 0x410d00
movaps %xmm0, %xmm1
movss 0x20(%rsp), %xmm0
callq 0x410d00
jmp 0x404958
movaps 0x30(%rsp), %xmm1
movaps %xmm1, %xmm0
movaps 0x10(%rsp), %xmm2
addps %xmm2, %xmm0
shufps $0x55, %xmm0, %xmm0     # xmm0 = xmm0[1,1,1,1]
addss %xmm1, %xmm0
addss %xmm2, %xmm0
mulss 0xc0708(%rip), %xmm0    # 0x4c5060
minss 0xc06f8(%rip), %xmm0    # 0x4c5058
movq %rsp, %r14
movss %xmm0, (%r14)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a38
movss (%r14), %xmm0
movss %xmm0, 0xa8(%rbx)
movss %xmm0, 0xa4(%rbx)
movaps %xmm0, %xmm1
testl %ebp, %ebp
jne 0x4049a5
movq %rsp, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x404a02
movss (%r14), %xmm0
movaps %xmm0, %xmm1
movaps 0x50(%rsp), %xmm2
movups %xmm2, 0x7c(%rbx)
movss %xmm1, 0x8c(%rbx)
movss %xmm0, 0x90(%rbx)
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop