// File: rurban[P]dgnlib/dgnstroke.cpp
// Function: DGNStrokeCurve
int DGNStrokeCurve( DGNHandle hFile, DGNElemMultiPoint *psCurve, 
                    int nPoints, DGNPoint * pasPoints )

{
    int         k, nDGNPoints, iOutPoint;
    double      *padfMx, *padfMy, *padfD, dfTotalD = 0, dfStepSize, dfD;
    double      *padfTx, *padfTy;
    DGNPoint    *pasDGNPoints = psCurve->vertices;

    nDGNPoints = psCurve->num_vertices;

    if( nDGNPoints < 6 )
        return FALSE;

    if( nPoints < nDGNPoints - 4 )
        return FALSE;

/* -------------------------------------------------------------------- */
/*      Compute the Compute the slopes/distances of the segments.       */
/* -------------------------------------------------------------------- */
    padfMx = (double *) CPLMalloc(sizeof(double) * nDGNPoints);
    padfMy = (double *) CPLMalloc(sizeof(double) * nDGNPoints);
    padfD  = (double *) CPLMalloc(sizeof(double) * nDGNPoints);
    padfTx = (double *) CPLMalloc(sizeof(double) * nDGNPoints);
    padfTy = (double *) CPLMalloc(sizeof(double) * nDGNPoints);

    for( k = 0; k < nDGNPoints-1; k++ )
    {
        padfD[k] = sqrt( (pasDGNPoints[k+1].x-pasDGNPoints[k].x)
                           * (pasDGNPoints[k+1].x-pasDGNPoints[k].x)
                         + (pasDGNPoints[k+1].y-pasDGNPoints[k].y)
                           * (pasDGNPoints[k+1].y-pasDGNPoints[k].y) );
        if( padfD[k] == 0.0 )
        {
            padfD[k] = 0.0001;
            padfMx[k] = 0.0;
            padfMy[k] = 0.0;
        }
        else
        {
            padfMx[k] = (pasDGNPoints[k+1].x - pasDGNPoints[k].x) / padfD[k];
            padfMy[k] = (pasDGNPoints[k+1].y - pasDGNPoints[k].y) / padfD[k];
        }

        if( k > 1 && k < nDGNPoints - 3 )
            dfTotalD += padfD[k];
    }

/* -------------------------------------------------------------------- */
/*      Compute the Tx, and Ty coefficients for each segment.           */
/* -------------------------------------------------------------------- */
    for( k = 2; k < nDGNPoints - 2; k++ )
    {
        if( fabs(padfMx[k+1] - padfMx[k]) == 0.0
            && fabs(padfMx[k-1] - padfMx[k-2]) == 0.0 )
        {
            padfTx[k] = (padfMx[k] + padfMx[k-1]) / 2;
        }
        else
        {
            padfTx[k] = (padfMx[k-1] * fabs( padfMx[k+1] - padfMx[k])
                    + padfMx[k] * fabs( padfMx[k-1] - padfMx[k-2] ))
           / (ABS(padfMx[k+1] - padfMx[k]) + ABS(padfMx[k-1] - padfMx[k-2]));
        }

        if( fabs(padfMy[k+1] - padfMy[k]) == 0.0
            && fabs(padfMy[k-1] - padfMy[k-2]) == 0.0 )
        {
            padfTy[k] = (padfMy[k] + padfMy[k-1]) / 2;
        }
        else
        {
            padfTy[k] = (padfMy[k-1] * fabs( padfMy[k+1] - padfMy[k])
                    + padfMy[k] * fabs( padfMy[k-1] - padfMy[k-2] ))
            / (ABS(padfMy[k+1] - padfMy[k]) + ABS(padfMy[k-1] - padfMy[k-2]));
        }
    }

/* -------------------------------------------------------------------- */
/*      Determine a step size in D.  We scale things so that we have    */
/*      roughly equidistant steps in D, but assume we also want to      */
/*      include every node along the way.                               */
/* -------------------------------------------------------------------- */
    dfStepSize = dfTotalD / (nPoints - (nDGNPoints - 4) - 1);

/* ==================================================================== */
/*      Process each of the segments.                                   */
/* ==================================================================== */
    dfD = dfStepSize;
    iOutPoint = 0;

    for( k = 2; k < nDGNPoints - 3; k++ )
    {
        double  dfAx, dfAy, dfBx, dfBy, dfCx, dfCy;

/* -------------------------------------------------------------------- */
/*      Compute the "x" coefficients for this segment.                  */
/* -------------------------------------------------------------------- */
        dfCx = padfTx[k];
        dfBx = (3.0 * (pasDGNPoints[k+1].x - pasDGNPoints[k].x) / padfD[k]
                - 2.0 * padfTx[k] - padfTx[k+1]) / padfD[k];
        dfAx = (padfTx[k] + padfTx[k+1] 
                - 2 * (pasDGNPoints[k+1].x - pasDGNPoints[k].x) / padfD[k])
            / (padfD[k] * padfD[k]);

/* -------------------------------------------------------------------- */
/*      Compute the Y coefficients for this segment.                    */
/* -------------------------------------------------------------------- */
        dfCy = padfTy[k];
        dfBy = (3.0 * (pasDGNPoints[k+1].y - pasDGNPoints[k].y) / padfD[k]
                - 2.0 * padfTy[k] - padfTy[k+1]) / padfD[k];
        dfAy = (padfTy[k] + padfTy[k+1] 
                - 2 * (pasDGNPoints[k+1].y - pasDGNPoints[k].y) / padfD[k])
            / (padfD[k] * padfD[k]);

/* -------------------------------------------------------------------- */
/*      Add the start point for this segment.                           */
/* -------------------------------------------------------------------- */
        pasPoints[iOutPoint].x = pasDGNPoints[k].x;
        pasPoints[iOutPoint].y = pasDGNPoints[k].y;
        pasPoints[iOutPoint].z = 0.0;
        iOutPoint++;

/* -------------------------------------------------------------------- */
/*      Step along, adding intermediate points.                         */
/* -------------------------------------------------------------------- */
        while( dfD < padfD[k] && iOutPoint < nPoints - (nDGNPoints-k-1) )
        {
            pasPoints[iOutPoint].x = dfAx * dfD * dfD * dfD
                                   + dfBx * dfD * dfD
                                   + dfCx * dfD 
                                   + pasDGNPoints[k].x;
            pasPoints[iOutPoint].y = dfAy * dfD * dfD * dfD
                                   + dfBy * dfD * dfD
                                   + dfCy * dfD 
                                   + pasDGNPoints[k].y;
            pasPoints[iOutPoint].z = 0.0;
            iOutPoint++;

            dfD += dfStepSize;
        }

        dfD -= padfD[k];
    }

/* -------------------------------------------------------------------- */
/*      Add the start point for this segment.                           */
/* -------------------------------------------------------------------- */
    while( iOutPoint < nPoints )
    {
        pasPoints[iOutPoint].x = pasDGNPoints[nDGNPoints-3].x;
        pasPoints[iOutPoint].y = pasDGNPoints[nDGNPoints-3].y;
        pasPoints[iOutPoint].z = 0.0;
        iOutPoint++;
    }

/* -------------------------------------------------------------------- */
/*      Cleanup.                                                        */
/* -------------------------------------------------------------------- */
    CPLFree( padfMx );
    CPLFree( padfMy );
    CPLFree( padfD );
    CPLFree( padfTx );
    CPLFree( padfTy );

    return TRUE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x58(%rbp)
movq -0x18(%rbp), %rax
addq $0x58, %rax
movq %rax, -0x80(%rbp)
movq -0x18(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x30(%rbp)
cmpl $0x6, -0x30(%rbp)
jge 0x1805a
movl $0x0, -0x4(%rbp)
jmp 0x18d42
movl -0x1c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x4, %ecx
cmpl %ecx, %eax
jge 0x18073
movl $0x0, -0x4(%rbp)
jmp 0x18d42
movslq -0x30(%rbp), %rdi
shlq $0x3, %rdi
callq 0x3040
movq %rax, -0x40(%rbp)
movslq -0x30(%rbp), %rdi
shlq $0x3, %rdi
callq 0x3040
movq %rax, -0x48(%rbp)
movslq -0x30(%rbp), %rdi
shlq $0x3, %rdi
callq 0x3040
movq %rax, -0x50(%rbp)
movslq -0x30(%rbp), %rdi
shlq $0x3, %rdi
callq 0x3040
movq %rax, -0x70(%rbp)
movslq -0x30(%rbp), %rdi
shlq $0x3, %rdi
callq 0x3040
movq %rax, -0x78(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x182c6
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm2
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd (%rax), %xmm2
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm3
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
callq 0x2220
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x18200
jp 0x18200
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd 0x27d2(%rip), %xmm0     # 0x1a9a8
movsd %xmm0, (%rax,%rcx,8)
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
jmp 0x1828c
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd (%rax), %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
cmpl $0x1, -0x2c(%rbp)
jle 0x182b6
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jge 0x182b6
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
addsd -0x58(%rbp), %xmm0
movsd %xmm0, -0x58(%rbp)
jmp 0x182b8
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x180cf
movl $0x2, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x18806
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movaps 0x26ac(%rip), %xmm1     # 0x1a9b0
pand %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1838a
jp 0x1838a
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movaps 0x2672(%rip), %xmm1     # 0x1a9b0
pand %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1838a
jp 0x1838a
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd 0x154c(%rip), %xmm1     # 0x198c0
divsd %xmm1, %xmm0
movq -0x70(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x1856a
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm2
movaps 0x25ee(%rip), %xmm1     # 0x1a9b0
pand %xmm1, %xmm2
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm3
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm3
movaps 0x25b2(%rip), %xmm4     # 0x1a9b0
pand %xmm4, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xb8(%rbp)
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x18473
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm1
movsd 0xddb(%rip), %xmm0      # 0x19240
mulsd %xmm1, %xmm0
movsd %xmm0, -0xc0(%rbp)
jmp 0x1849a
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xc0(%rbp)
movsd -0xc0(%rbp), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x18511
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm1
movsd 0xd3d(%rip), %xmm0      # 0x19240
mulsd %xmm1, %xmm0
movsd %xmm0, -0xd0(%rbp)
jmp 0x1853d
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x40(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xd0(%rbp)
movsd -0xb8(%rbp), %xmm0
movsd -0xc8(%rbp), %xmm1
movsd -0xd0(%rbp), %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq -0x70(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movaps 0x2420(%rip), %xmm1     # 0x1a9b0
pand %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x18616
jp 0x18616
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movaps 0x23e6(%rip), %xmm1     # 0x1a9b0
pand %xmm1, %xmm0
xorps %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x18616
jp 0x18616
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movsd 0x12c0(%rip), %xmm1     # 0x198c0
divsd %xmm1, %xmm0
movq -0x78(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x187f6
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm2
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm2
movaps 0x2362(%rip), %xmm1     # 0x1a9b0
pand %xmm1, %xmm2
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm3
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm3
movaps 0x2326(%rip), %xmm4     # 0x1a9b0
pand %xmm4, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0xd8(%rbp)
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x186ff
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm1
movsd 0xb4f(%rip), %xmm0      # 0x19240
mulsd %xmm1, %xmm0
movsd %xmm0, -0xe0(%rbp)
jmp 0x18726
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movslq -0x2c(%rbp), %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xe0(%rbp)
movsd -0xe0(%rbp), %xmm0
movsd %xmm0, -0xe8(%rbp)
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm1
xorps %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x1879d
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm1
movsd 0xab1(%rip), %xmm0      # 0x19240
mulsd %xmm1, %xmm0
movsd %xmm0, -0xf0(%rbp)
jmp 0x187c9
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x48(%rbp), %rax
movl -0x2c(%rbp), %ecx
subl $0x2, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xf0(%rbp)
movsd -0xd8(%rbp), %xmm0
movsd -0xe8(%rbp), %xmm1
movsd -0xf0(%rbp), %xmm2
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movq -0x78(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
jmp 0x187f8
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x182cd
movsd -0x58(%rbp), %xmm0
movl -0x1c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x4, %ecx
subl %ecx, %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x2, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl -0x30(%rbp), %ecx
subl $0x3, %ecx
cmpl %ecx, %eax
jge 0x18c87
movq -0x70(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm1
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd (%rax), %xmm1
movsd 0x2109(%rip), %xmm0     # 0x1a9a0
mulsd %xmm1, %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm0
movq -0x70(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
addsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movq -0x70(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x98(%rbp)
movq -0x70(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x70(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm2
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd (%rax), %xmm2
movsd 0xf8a(%rip), %xmm1      # 0x198c0
mulsd %xmm2, %xmm1
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm1
subsd %xmm1, %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movq -0x78(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xb0(%rbp)
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm1
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm1
movsd 0x1fe5(%rip), %xmm0     # 0x1a9a0
mulsd %xmm1, %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm0
movq -0x78(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
addsd %xmm1, %xmm1
subsd %xmm1, %xmm0
movq -0x78(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
subsd (%rax,%rcx,8), %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0xa0(%rbp)
movq -0x78(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x78(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
addsd (%rax,%rcx,8), %xmm0
movq -0x80(%rbp), %rax
movl -0x2c(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm2
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
subsd 0x8(%rax), %xmm2
movsd 0xe64(%rip), %xmm1      # 0x198c0
mulsd %xmm2, %xmm1
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
divsd (%rax,%rcx,8), %xmm1
subsd %xmm1, %xmm0
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movsd -0x68(%rbp), %xmm1
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
xorl %eax, %eax
ucomisd %xmm1, %xmm0
movb %al, -0xf1(%rbp)
jbe 0x18b41
movl -0x34(%rbp), %eax
movl -0x1c(%rbp), %ecx
movl -0x30(%rbp), %edx
subl -0x2c(%rbp), %edx
subl $0x1, %edx
subl %edx, %ecx
cmpl %ecx, %eax
setl %al
movb %al, -0xf1(%rbp)
movb -0xf1(%rbp), %al
testb $0x1, %al
jne 0x18b50
jmp 0x18c5e
movsd -0x88(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
movsd -0x68(%rbp), %xmm2
movsd -0x98(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0xa8(%rbp), %xmm0
movsd -0x68(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
addsd (%rax), %xmm0
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movsd -0x90(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
mulsd -0x68(%rbp), %xmm1
movsd -0x68(%rbp), %xmm2
movsd -0xa0(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
mulsd -0x68(%rbp), %xmm0
mulsd %xmm2, %xmm1
addsd %xmm0, %xmm1
movsd -0xb0(%rbp), %xmm0
movsd -0x68(%rbp), %xmm2
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x80(%rbp), %rax
movslq -0x2c(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
addsd 0x8(%rax), %xmm0
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
movsd -0x60(%rbp), %xmm0
addsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
jmp 0x18b05
movq -0x50(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
movsd -0x68(%rbp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, -0x68(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x1883e
jmp 0x18c89
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x18d0e
movq -0x80(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd (%rax), %xmm0
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, (%rax)
movq -0x80(%rbp), %rax
movl -0x30(%rbp), %ecx
subl $0x3, %ecx
movslq %ecx, %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd 0x8(%rax), %xmm0
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movsd %xmm0, 0x8(%rax)
movq -0x28(%rbp), %rax
movslq -0x34(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x10(%rax)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x18c89
movq -0x40(%rbp), %rdi
callq 0xa000
movq -0x48(%rbp), %rdi
callq 0xa000
movq -0x50(%rbp), %rdi
callq 0xa000
movq -0x70(%rbp), %rdi
callq 0xa000
movq -0x78(%rbp), %rdi
callq 0xa000
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq