// File: rurban[P]dgnlib/dgnwrite.cpp
// Function: DGNCreateArcElem
DGNElemCore *
DGNCreateArcElem( DGNHandle hDGN, int nType, 
                  double dfOriginX, double dfOriginY, double dfOriginZ,
                  double dfPrimaryAxis, double dfSecondaryAxis, 
                  double dfStartAngle, double dfSweepAngle,
                  double dfRotation, int *panQuaternion )

{
    DGNElemArc *psArc;
    DGNElemCore *psCore;
    DGNInfo *psDGN = (DGNInfo *) hDGN;
    DGNPoint sMin, sMax, sOrigin;
    GInt32 nAngle;

    CPLAssert( nType == DGNT_ARC || nType == DGNT_ELLIPSE );

    DGNLoadTCB( hDGN );

/* -------------------------------------------------------------------- */
/*      Allocate element.                                               */
/* -------------------------------------------------------------------- */
    psArc = (DGNElemArc *) CPLCalloc( sizeof(DGNElemArc), 1 );
    psCore = &(psArc->core);

    DGNInitializeElemCore( hDGN, psCore );
    psCore->stype = DGNST_ARC;
    psCore->type = nType;

/* -------------------------------------------------------------------- */
/*      Set arc specific information in the structure.                  */
/* -------------------------------------------------------------------- */
    sOrigin.x = dfOriginX;
    sOrigin.y = dfOriginY;
    sOrigin.z = dfOriginZ;

    psArc->origin = sOrigin;
    psArc->primary_axis = dfPrimaryAxis;
    psArc->secondary_axis = dfSecondaryAxis;
    memset( psArc->quat, 0, sizeof(int) * 4 );
    psArc->startang = dfStartAngle;
    psArc->sweepang = dfSweepAngle;

    psArc->rotation = dfRotation;
    if( panQuaternion == NULL )
    {
        DGNRotationToQuaternion( dfRotation, psArc->quat );
    }
    else
    {
        memcpy( psArc->quat, panQuaternion, sizeof(long)*4 );
    }

/* -------------------------------------------------------------------- */
/*      Setup Raw data for the arc section.                             */
/* -------------------------------------------------------------------- */
    if( nType == DGNT_ARC )
    {
        double dfScaledAxis;

        if( psDGN->dimension == 3 )
            psCore->raw_bytes = 100;
        else
            psCore->raw_bytes = 80;
        psCore->raw_data = (unsigned char*) CPLCalloc(psCore->raw_bytes,1);

        /* start angle */
        nAngle = (int) (dfStartAngle * 360000.0);
        DGN_WRITE_INT32( nAngle, psCore->raw_data + 36 );

        /* sweep angle */
        if( dfSweepAngle < 0.0 )
        {
            nAngle = (int) (ABS(dfSweepAngle) * 360000.0);
            nAngle |= 0x80000000;
        }
        else if( dfSweepAngle > 364.9999 )
        {
            nAngle = 0;
        }
        else
        {
            nAngle = (int) (dfSweepAngle * 360000.0);
        }
        DGN_WRITE_INT32( nAngle, psCore->raw_data + 40 );

        /* axes */
        dfScaledAxis = dfPrimaryAxis / psDGN->scale;
        memcpy( psCore->raw_data + 44, &dfScaledAxis, 8 );
        IEEE2DGNDouble( psCore->raw_data + 44 );

        dfScaledAxis = dfSecondaryAxis / psDGN->scale;
        memcpy( psCore->raw_data + 52, &dfScaledAxis, 8 );
        IEEE2DGNDouble( psCore->raw_data + 52 );

        if( psDGN->dimension == 3 )
        {
            /* quaternion */
            DGN_WRITE_INT32( psArc->quat[0], psCore->raw_data + 60 );
            DGN_WRITE_INT32( psArc->quat[1], psCore->raw_data + 64 );
            DGN_WRITE_INT32( psArc->quat[2], psCore->raw_data + 68 );
            DGN_WRITE_INT32( psArc->quat[3], psCore->raw_data + 72 );
            
            /* origin */
            DGNInverseTransformPoint( psDGN, &sOrigin );
            memcpy( psCore->raw_data + 76, &(sOrigin.x), 8 );
            memcpy( psCore->raw_data + 84, &(sOrigin.y), 8 );
            memcpy( psCore->raw_data + 92, &(sOrigin.z), 8 );
            IEEE2DGNDouble( psCore->raw_data + 76 );
            IEEE2DGNDouble( psCore->raw_data + 84 );
            IEEE2DGNDouble( psCore->raw_data + 92 );
        }
        else
        {
            /* rotation */
            nAngle = (int) (dfRotation * 360000.0);
            DGN_WRITE_INT32( nAngle, psCore->raw_data + 60 );
            
            /* origin */
            DGNInverseTransformPoint( psDGN, &sOrigin );
            memcpy( psCore->raw_data + 64, &(sOrigin.x), 8 );
            memcpy( psCore->raw_data + 72, &(sOrigin.y), 8 );
            IEEE2DGNDouble( psCore->raw_data + 64 );
            IEEE2DGNDouble( psCore->raw_data + 72 );
        }
    }

/* -------------------------------------------------------------------- */
/*      Setup Raw data for the ellipse section.                         */
/* -------------------------------------------------------------------- */
    else
    {
        double dfScaledAxis;

        if( psDGN->dimension == 3 )
            psCore->raw_bytes = 92;
        else
            psCore->raw_bytes = 72;
        psCore->raw_data = (unsigned char*) CPLCalloc(psCore->raw_bytes,1);

        /* axes */
        dfScaledAxis = dfPrimaryAxis / psDGN->scale;
        memcpy( psCore->raw_data + 36, &dfScaledAxis, 8 );
        IEEE2DGNDouble( psCore->raw_data + 36 );

        dfScaledAxis = dfSecondaryAxis / psDGN->scale;
        memcpy( psCore->raw_data + 44, &dfScaledAxis, 8 );
        IEEE2DGNDouble( psCore->raw_data + 44 );

        if( psDGN->dimension == 3 )
        {
            /* quaternion */
            DGN_WRITE_INT32( psArc->quat[0], psCore->raw_data + 52 );
            DGN_WRITE_INT32( psArc->quat[1], psCore->raw_data + 56 );
            DGN_WRITE_INT32( psArc->quat[2], psCore->raw_data + 60 );
            DGN_WRITE_INT32( psArc->quat[3], psCore->raw_data + 64 );
            
            /* origin */
            DGNInverseTransformPoint( psDGN, &sOrigin );
            memcpy( psCore->raw_data + 68, &(sOrigin.x), 8 );
            memcpy( psCore->raw_data + 76, &(sOrigin.y), 8 );
            memcpy( psCore->raw_data + 84, &(sOrigin.z), 8 );
            IEEE2DGNDouble( psCore->raw_data + 68 );
            IEEE2DGNDouble( psCore->raw_data + 76 );
            IEEE2DGNDouble( psCore->raw_data + 84 );
        }
        else
        {
            /* rotation */
            nAngle = (int) (dfRotation * 360000.0);
            DGN_WRITE_INT32( nAngle, psCore->raw_data + 52 );
            
            /* origin */
            DGNInverseTransformPoint( psDGN, &sOrigin );
            memcpy( psCore->raw_data + 56, &(sOrigin.x), 8 );
            memcpy( psCore->raw_data + 64, &(sOrigin.y), 8 );
            IEEE2DGNDouble( psCore->raw_data + 56 );
            IEEE2DGNDouble( psCore->raw_data + 64 );
        }
        
        psArc->startang = 0.0;
        psArc->sweepang = 360.0;
    }
    
/* -------------------------------------------------------------------- */
/*      Set the core raw data, including the bounds.                    */
/* -------------------------------------------------------------------- */
    DGNUpdateElemCoreExtended( hDGN, psCore );

    sMin.x = dfOriginX - MAX(dfPrimaryAxis,dfSecondaryAxis);
    sMin.y = dfOriginY - MAX(dfPrimaryAxis,dfSecondaryAxis);
    sMin.z = dfOriginZ - MAX(dfPrimaryAxis,dfSecondaryAxis);
    sMax.x = dfOriginX + MAX(dfPrimaryAxis,dfSecondaryAxis);
    sMax.y = dfOriginY + MAX(dfPrimaryAxis,dfSecondaryAxis);
    sMax.z = dfOriginZ + MAX(dfPrimaryAxis,dfSecondaryAxis);

    DGNWriteBounds( psDGN, psCore, &sMin, &sMax );
    
    return psCore;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movsd %xmm0, -0x18(%rbp)
movsd %xmm1, -0x20(%rbp)
movsd %xmm2, -0x28(%rbp)
movsd %xmm3, -0x30(%rbp)
movsd %xmm4, -0x38(%rbp)
movsd %xmm5, -0x40(%rbp)
movsd %xmm6, -0x48(%rbp)
movsd %xmm7, -0x50(%rbp)
movq %rdx, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
callq 0x11190
movl $0xa0, %edi
movl $0x1, %esi
callq 0x2fc0
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x135f0
movq -0x68(%rbp), %rax
movl $0x5, 0xc(%rax)
movl -0xc(%rbp), %ecx
movq -0x68(%rbp), %rax
movl %ecx, 0x14(%rax)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0xb8(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0xa8(%rbp)
movq -0x60(%rbp), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq -0xb0(%rbp), %rcx
movq %rcx, 0x58(%rax)
movq -0xa8(%rbp), %rcx
movq %rcx, 0x60(%rax)
movsd -0x30(%rbp), %xmm0
movq -0x60(%rbp), %rax
movsd %xmm0, 0x68(%rax)
movsd -0x38(%rbp), %xmm0
movq -0x60(%rbp), %rax
movsd %xmm0, 0x70(%rax)
movq -0x60(%rbp), %rdi
addq $0x80, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x2170
movsd -0x40(%rbp), %xmm0
movq -0x60(%rbp), %rax
movsd %xmm0, 0x90(%rax)
movsd -0x48(%rbp), %xmm0
movq -0x60(%rbp), %rax
movsd %xmm0, 0x98(%rax)
movsd -0x50(%rbp), %xmm0
movq -0x60(%rbp), %rax
movsd %xmm0, 0x78(%rax)
cmpq $0x0, -0x58(%rbp)
jne 0x138c9
movsd -0x50(%rbp), %xmm0
movq -0x60(%rbp), %rdi
addq $0x80, %rdi
callq 0xc5f0
jmp 0x138fc
movq -0x60(%rbp), %rax
movq -0x58(%rbp), %rcx
movq (%rcx), %rdx
movq %rdx, 0x80(%rax)
movq 0x8(%rcx), %rdx
movq %rdx, 0x88(%rax)
movq 0x10(%rcx), %rdx
movq %rdx, 0x90(%rax)
movq 0x18(%rcx), %rcx
movq %rcx, 0x98(%rax)
cmpl $0x10, -0xc(%rbp)
jne 0x13ed8
movq -0x70(%rbp), %rax
cmpl $0x3, 0x20018(%rax)
jne 0x13920
movq -0x68(%rbp), %rax
movl $0x64, 0x40(%rax)
jmp 0x1392b
movq -0x68(%rbp), %rax
movl $0x50, 0x40(%rax)
movq -0x68(%rbp), %rax
movslq 0x40(%rax), %rdi
movl $0x1, %esi
callq 0x2fc0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x48(%rax)
movsd 0x69f8(%rip), %xmm0     # 0x1a348
mulsd -0x40(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, -0xcc(%rbp)
movl -0xcc(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x24(%rax)
movl -0xcc(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x25(%rax)
movl -0xcc(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x26(%rax)
movl -0xcc(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x27(%rax)
xorps %xmm0, %xmm0
ucomisd -0x48(%rbp), %xmm0
jbe 0x13a40
xorps %xmm0, %xmm0
ucomisd -0x48(%rbp), %xmm0
jbe 0x13a02
movsd 0x584d(%rip), %xmm0     # 0x19240
mulsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
jmp 0x13a0f
movsd -0x48(%rbp), %xmm0
movsd %xmm0, -0x110(%rbp)
movsd -0x110(%rbp), %xmm0
movsd 0x6929(%rip), %xmm1     # 0x1a348
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, -0xbc(%rbp)
jmp 0x13a78
movsd -0x48(%rbp), %xmm0
movsd 0x6b6b(%rip), %xmm1     # 0x1a5b8
ucomisd %xmm1, %xmm0
jbe 0x13a5f
movl $0x0, -0xbc(%rbp)
jmp 0x13a76
movsd 0x68e1(%rip), %xmm0     # 0x1a348
mulsd -0x48(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xbc(%rbp)
jmp 0x13a78
movl -0xbc(%rbp), %eax
movl %eax, -0xd0(%rbp)
movl -0xd0(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x28(%rax)
movl -0xd0(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x29(%rax)
movl -0xd0(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x2a(%rax)
movl -0xd0(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x2b(%rax)
movsd -0x30(%rbp), %xmm0
movq -0x70(%rbp), %rax
divsd 0x20020(%rax), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, 0x2c(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x2c, %rdi
callq 0xa320
movsd -0x38(%rbp), %xmm0
movq -0x70(%rbp), %rax
divsd 0x20020(%rax), %xmm0
movsd %xmm0, -0xc8(%rbp)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xc8(%rbp), %rcx
movq %rcx, 0x34(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x34, %rdi
callq 0xa320
movq -0x70(%rbp), %rax
cmpl $0x3, 0x20018(%rax)
jne 0x13dec
movq -0x60(%rbp), %rax
movl 0x80(%rax), %eax
movl %eax, -0xd4(%rbp)
movl -0xd4(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3c(%rax)
movl -0xd4(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3d(%rax)
movl -0xd4(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3e(%rax)
movl -0xd4(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3f(%rax)
movq -0x60(%rbp), %rax
movl 0x84(%rax), %eax
movl %eax, -0xd8(%rbp)
movl -0xd8(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x40(%rax)
movl -0xd8(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x41(%rax)
movl -0xd8(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x42(%rax)
movl -0xd8(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x43(%rax)
movq -0x60(%rbp), %rax
movl 0x88(%rax), %eax
movl %eax, -0xdc(%rbp)
movl -0xdc(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x44(%rax)
movl -0xdc(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x45(%rax)
movl -0xdc(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x46(%rax)
movl -0xdc(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x47(%rax)
movq -0x60(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, -0xe0(%rbp)
movl -0xe0(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x48(%rax)
movl -0xe0(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x49(%rax)
movl -0xe0(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x4a(%rax)
movl -0xe0(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x4b(%rax)
movq -0x70(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x10d60
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, 0x4c(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, 0x54(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xa8(%rbp), %rcx
movq %rcx, 0x5c(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x4c, %rdi
callq 0xa320
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x54, %rdi
callq 0xa320
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x5c, %rdi
callq 0xa320
jmp 0x13ed3
movsd 0x6554(%rip), %xmm0     # 0x1a348
mulsd -0x50(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, -0xe4(%rbp)
movl -0xe4(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3c(%rax)
movl -0xe4(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3d(%rax)
movl -0xe4(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3e(%rax)
movl -0xe4(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3f(%rax)
movq -0x70(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x10d60
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x40, %rdi
callq 0xa320
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x48, %rdi
callq 0xa320
jmp 0x14320
movq -0x70(%rbp), %rax
cmpl $0x3, 0x20018(%rax)
jne 0x13ef2
movq -0x68(%rbp), %rax
movl $0x5c, 0x40(%rax)
jmp 0x13efd
movq -0x68(%rbp), %rax
movl $0x48, 0x40(%rax)
movq -0x68(%rbp), %rax
movslq 0x40(%rax), %rdi
movl $0x1, %esi
callq 0x2fc0
movq %rax, %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x48(%rax)
movsd -0x30(%rbp), %xmm0
movq -0x70(%rbp), %rax
divsd 0x20020(%rax), %xmm0
movsd %xmm0, -0xf0(%rbp)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xf0(%rbp), %rcx
movq %rcx, 0x24(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x24, %rdi
callq 0xa320
movsd -0x38(%rbp), %xmm0
movq -0x70(%rbp), %rax
divsd 0x20020(%rax), %xmm0
movsd %xmm0, -0xf0(%rbp)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xf0(%rbp), %rcx
movq %rcx, 0x2c(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x2c, %rdi
callq 0xa320
movq -0x70(%rbp), %rax
cmpl $0x3, 0x20018(%rax)
jne 0x14216
movq -0x60(%rbp), %rax
movl 0x80(%rax), %eax
movl %eax, -0xf4(%rbp)
movl -0xf4(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x34(%rax)
movl -0xf4(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x35(%rax)
movl -0xf4(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x36(%rax)
movl -0xf4(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x37(%rax)
movq -0x60(%rbp), %rax
movl 0x84(%rax), %eax
movl %eax, -0xf8(%rbp)
movl -0xf8(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x38(%rax)
movl -0xf8(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x39(%rax)
movl -0xf8(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3a(%rax)
movl -0xf8(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3b(%rax)
movq -0x60(%rbp), %rax
movl 0x88(%rax), %eax
movl %eax, -0xfc(%rbp)
movl -0xfc(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3c(%rax)
movl -0xfc(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3d(%rax)
movl -0xfc(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3e(%rax)
movl -0xfc(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x3f(%rax)
movq -0x60(%rbp), %rax
movl 0x8c(%rax), %eax
movl %eax, -0x100(%rbp)
movl -0x100(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x40(%rax)
movl -0x100(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x41(%rax)
movl -0x100(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x42(%rax)
movl -0x100(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x43(%rax)
movq -0x70(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x10d60
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, 0x44(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, 0x4c(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xa8(%rbp), %rcx
movq %rcx, 0x54(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x44, %rdi
callq 0xa320
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x4c, %rdi
callq 0xa320
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x54, %rdi
callq 0xa320
jmp 0x142fd
movsd 0x612a(%rip), %xmm0     # 0x1a348
mulsd -0x50(%rbp), %xmm0
cvttsd2si %xmm0, %eax
movl %eax, -0xbc(%rbp)
movl -0xbc(%rbp), %eax
movl %eax, -0x104(%rbp)
movl -0x104(%rbp), %eax
andl $0xff0000, %eax         # imm = 0xFF0000
sarl $0x10, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x34(%rax)
movl -0x104(%rbp), %eax
andl $0xff000000, %eax       # imm = 0xFF000000
shrl $0x18, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x35(%rax)
movl -0x104(%rbp), %eax
andl $0xff, %eax
sarl $0x0, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x36(%rax)
movl -0x104(%rbp), %eax
andl $0xff00, %eax           # imm = 0xFF00
sarl $0x8, %eax
movb %al, %cl
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movb %cl, 0x37(%rax)
movq -0x70(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x10d60
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xb8(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rax
movq -0xb0(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x38, %rdi
callq 0xa320
movq -0x68(%rbp), %rax
movq 0x48(%rax), %rdi
addq $0x40, %rdi
callq 0xa320
movq -0x60(%rbp), %rax
xorps %xmm0, %xmm0
movsd %xmm0, 0x90(%rax)
movq -0x60(%rbp), %rax
movsd 0x6038(%rip), %xmm0     # 0x1a350
movsd %xmm0, 0x98(%rax)
movq -0x8(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0x12f50
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x118(%rbp)
movsd -0x30(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0x14355
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
jmp 0x14362
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x120(%rbp)
movsd -0x118(%rbp), %xmm0
movsd -0x120(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x88(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x128(%rbp)
movsd -0x30(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0x143a6
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
jmp 0x143b3
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x130(%rbp)
movsd -0x128(%rbp), %xmm0
movsd -0x130(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x138(%rbp)
movsd -0x30(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0x143f4
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
jmp 0x14401
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x140(%rbp)
movsd -0x138(%rbp), %xmm0
movsd -0x140(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
movsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x148(%rbp)
movsd -0x30(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0x14442
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
jmp 0x1444f
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x150(%rbp)
movsd -0x148(%rbp), %xmm0
movsd -0x150(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0xa0(%rbp)
movsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x158(%rbp)
movsd -0x30(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0x14493
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
jmp 0x144a0
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x160(%rbp)
movsd -0x158(%rbp), %xmm0
movsd -0x160(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x98(%rbp)
movsd -0x28(%rbp), %xmm0
movsd %xmm0, -0x168(%rbp)
movsd -0x30(%rbp), %xmm0
ucomisd -0x38(%rbp), %xmm0
jbe 0x144e4
movsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x170(%rbp)
jmp 0x144f1
movsd -0x38(%rbp), %xmm0
movsd %xmm0, -0x170(%rbp)
movsd -0x168(%rbp), %xmm0
movsd -0x170(%rbp), %xmm1
addsd %xmm1, %xmm0
movsd %xmm0, -0x90(%rbp)
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0xa0(%rbp), %rcx
callq 0x13630
movq -0x68(%rbp), %rax
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
nopw %cs:(%rax,%rax)