//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.11 on Fri Nov 16 14:07:42 2018
//
//
// Buffer Definitions:
//
// cbuffer _cbPerObject
// {
//
//   struct S_cbPerObject
//   {
//
//       row_major float4x4 go_mObjectToView;// Offset:    0
//       row_major float4x4 go_mObjectToViewPrev;// Offset:   64
//       float4 go_vPosScale;           // Offset:  128
//       float4 go_vPosBias;            // Offset:  144
//       float4 go_vTexScaleBias;       // Offset:  160
//       float4 go_vObjectId;           // Offset:  176
//       float4 go_Tesselation;         // Offset:  192
//       float4 go_Flags;               // Offset:  208
//       float4 go_vSimpleColor;        // Offset:  224
//
//   } cbPerObject;                     // Offset:    0 Size:   240
//
// }
//
// cbuffer _cbSharedPerViewData
// {
//
//   struct S_cbSharedPerViewData
//   {
//
//       row_major float4x4 mProjection;// Offset:    0
//       row_major float4x4 mProjectionPrev;// Offset:   64
//       row_major float4x4 mViewToViewport;// Offset:  128
//       row_major float4x4 mViewToWorld;// Offset:  192
//       row_major float4x4 mViewToWorldPrev;// Offset:  256
//       row_major float4x4 mFxWorldToSampleSpace;// Offset:  320
//       float4 vViewRemap;             // Offset:  384
//       float4 vViewDepthRemap;        // Offset:  400
//       float4 vEyeVectorUL;           // Offset:  416
//       float4 vEyeVectorLR;           // Offset:  432
//       float4 vEyeVectorDelta;        // Offset:  448
//       float4 vPixelToEyeVectorScaleBias;// Offset:  464
//       float4 vViewSpaceUpVector;     // Offset:  480
//       float4 vViewportSize;          // Offset:  496
//       float4 vTesselationEnabled;    // Offset:  512
//       float4 vEngineTime;            // Offset:  528
//       uint nFrameCounter;            // Offset:  544
//       float4 vShaderColor0;          // Offset:  560
//       float4 vShaderColor1;          // Offset:  576
//       float4 vShaderColor2;          // Offset:  592
//       float4 vShaderColor3;          // Offset:  608
//       float4 vShaderColor4;          // Offset:  624
//       float4 vClipPlane;             // Offset:  640
//       float4 vClipPlane0;            // Offset:  656
//       float4 vClipPlane1;            // Offset:  672
//       float4 vClipPlane2;            // Offset:  688
//       float4 vClipPlane3;            // Offset:  704
//       float4 vClipPlane4;            // Offset:  720
//       float4 vClipPlane5;            // Offset:  736
//       float4 vMippedDepthRemap;      // Offset:  752
//       float4 vSpecularOcclusionSettings;// Offset:  768
//       float4 vSaturatedAmbientOcclusionSettings;// Offset:  784
//       float4 vLightModelSettings;    // Offset:  800
//       float4 vHDRScale;              // Offset:  816
//       float4 vTweakableShaderParams; // Offset:  832
//       float4 vAtmosphericScatteringParameters;// Offset:  848
//       float4 vAtmosphericScatteringParameters2;// Offset:  864
//       float4 vAtmosphericScatteringParameters3;// Offset:  880
//       float3 vAtmosphericScatteringMieBeta;// Offset:  896
//       float3 vAtmosphericScatteringRayleighBeta;// Offset:  912
//       float3 vAtmosphericScatteringShadowedMieBeta;// Offset:  928
//       float3 vAtmosphericScatteringShadowedRayleighBeta;// Offset:  944
//       float3 vAttenuatedSunColor;    // Offset:  960
//       float3 vSunDirectionVS;        // Offset:  976
//       row_major float4x4 mViewToGlobalShadowVSPT;// Offset:  992
//       float4 vWindDirectionAndStrength;// Offset: 1056
//       float4 vWindDirectionAndStrengthPrev;// Offset: 1072
//       float4 vWindInitialDirectionAndStrength;// Offset: 1088
//       float4 vFxFadeParameters;      // Offset: 1104
//       float2 vFxSize;                // Offset: 1120
//       int nEnableGBufferSpecPowerAdjustment;// Offset: 1128
//       int nNumCSMCascades;           // Offset: 1132
//       float fCSMFadeAdd;             // Offset: 1136
//       int nEnableClothBias;          // Offset: 1140
//       int2 viNumTiles;               // Offset: 1144
//       int nLightTileDebugFlags;      // Offset: 1152
//       int nEnableBoxReflections;     // Offset: 1156
//       int nSelectedBoxReflectionId;  // Offset: 1160
//       int nEnableAtmosphericScatteringBackdrop;// Offset: 1164
//       int nEnableSampleFromUICameraBackbuffer;// Offset: 1168
//       int nFallbackRoomMask;         // Offset: 1172
//       float4 vClearColor;            // Offset: 1184
//       float3 vGlobalLightDirectionVS;// Offset: 1200
//       float3 vGlobalLightFrontColor; // Offset: 1216
//       float3 vGlobalLightBackColor;  // Offset: 1232
//       float4 vShadowAtlasSize;       // Offset: 1248
//       float2 vShadowPoissonScale;    // Offset: 1264
//       int nShadowSpotKernel;         // Offset: 1272
//       int nShadowCSMKernel;          // Offset: 1276
//       float4 vJitter;                // Offset: 1280
//       float4 vUnjitter;              // Offset: 1296
//       int nHashedAlphaPeriod;        // Offset: 1312
//       int nIsRenderingOffscreen;     // Offset: 1316
//
//   } cbSharedPerViewData;             // Offset:    0 Size:  1320
//
// }
//
// cbuffer _cbSharedParticleSpritesData
// {
//
//   struct S_cbSharedParticleSpritesData
//   {
//
//       row_major float4x4 mWorldToView;// Offset:    0
//       float4 vDirScaleBias;          // Offset:   64
//       float4 vVecScale;              // Offset:   80
//       float4 vVecBias;               // Offset:   96
//       int nRoomMask;                 // Offset:  112
//       float4 vEmitterPosition;       // Offset:  128
//       float4 vSystemCenter;          // Offset:  144
//       float4 vShaderParam0;          // Offset:  160
//       float4 vShaderParam1;          // Offset:  176
//       float4 vShaderParam2;          // Offset:  192
//       float4 vShaderParam3;          // Offset:  208
//       float4 vShaderParam4;          // Offset:  224
//       float4 vShaderParam5;          // Offset:  240
//       row_major float4x4 mParticlesToView;// Offset:  256
//       row_major float4x4 mParticlesToWorld;// Offset:  320
//       int nTilesX;                   // Offset:  384
//       int nTilesY;                   // Offset:  388
//       float4 sIATiles[1024];         // Offset:  400
//       float fAspect;                 // Offset: 16784
//       float fScaleRange;             // Offset: 16788
//       float fScaleFactor;            // Offset: 16792
//       float fAOBending;              // Offset: 16796
//       int bWrapTileIndex;            // Offset: 16800
//       int bIgnoreRotation;           // Offset: 16804
//       int bScreenAligned;            // Offset: 16808
//       float fMotionStretchFactor;    // Offset: 16812
//       float fCameraFadeNearDistance; // Offset: 16816
//       float fCameraFadeFarDistance;  // Offset: 16820
//       float fCameraFadeSizeFactor;   // Offset: 16824
//       int eSpritePivot;              // Offset: 16828
//       uint nParticleBase;            // Offset: 16832
//       uint nParticleCount;           // Offset: 16836
//       int nAtlasWidth;               // Offset: 16840
//       int nAtlasHeight;              // Offset: 16844
//       float fAtlasWidth;             // Offset: 16848
//       float fAtlasHeight;            // Offset: 16852
//       float fAtlasRcpWidth;          // Offset: 16856
//       float fAtlasRcpHeight;         // Offset: 16860
//       uint nAtlasSlotMinSizeLog2;    // Offset: 16864
//       uint nAtlasSlotMaxSizeLog2;    // Offset: 16868
//       float fAtlasDownsampleFactor;  // Offset: 16872
//       uint nAtlasDebugColors;        // Offset: 16876
//       uint4 nAtlasParticlesPerSize[2];// Offset: 16880
//       float4 fAtlasVerticalOffsets[2];// Offset: 16912
//       float fTileCount;              // Offset: 16944
//       float fRcpTileCount;           // Offset: 16948
//       float fRcpCameraFadeFarMinusNear;// Offset: 16952
//       float fScaleRangeRcp;          // Offset: 16956
//       float fZeroSizeRange;          // Offset: 16960
//       float4 vPosUL;                 // Offset: 16976
//       float4 vPosLR;                 // Offset: 16992
//
//   } cbSharedParticleSpritesData;     // Offset:    0 Size: 17008
//
// }
//
// Resource bind info for srvParticles
// {
//
//   struct SParticle
//   {
//
//       float3 vVelocity;              // Offset:    0
//       uint nColorAndAlpha;           // Offset:   12
//       float3 vPosition;              // Offset:   16
//       uint nFlags;                   // Offset:   28
//       float4 qOrientation;           // Offset:   32
//       float fSize;                   // Offset:   48
//       float fRotationSpeed;          // Offset:   52
//       float fRcpTimeToLive;          // Offset:   56
//       uint nTrackInfo;               // Offset:   60
//       float fRotation;               // Offset:   64
//       float fTimeAlive;              // Offset:   68
//       uint nRandomBits;              // Offset:   72
//       uint nCollisionInfo;           // Offset:   76
//       int nLastFrameIndex;           // Offset:   80
//       float3 vPositionPrev;          // Offset:   84
//
//   } $Element;                        // Offset:    0 Size:    96
//
// }
//
// Resource bind info for srvObjectIndicesTransparent
// {
//
//   struct STileDataTransparent
//   {
//
//       uint nStartRoomIndex;          // Offset:    0
//       uint nRoomMask;                // Offset:    4
//       uint anIndices[128];           // Offset:    8
//
//   } $Element;                        // Offset:    0 Size:   520
//
// }
//
// Resource bind info for srvLightInfo
// {
//
//   uint4 $Element;                    // Offset:    0 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// srvParticles                      texture  struct         r/o   21        1
// srvObjectIndicesTransparent       texture  struct         r/o   29        1
// srvLightInfo                      texture  struct         r/o   31        1
// _cbPerObject                      cbuffer      NA          NA    1        1
// _cbSharedPerViewData              cbuffer      NA          NA    2        1
// _cbSharedParticleSpritesData      cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_VertexID              0   x           0   VERTID    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xyzw        6     NONE   float   xyzw
// TEXCOORD                 6   x           7     NONE    uint   x
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[10], immediateIndexed
dcl_constantbuffer cb2[72], immediateIndexed
dcl_constantbuffer cb4[1063], dynamicIndexed
dcl_resource_structured t21, 96
dcl_resource_structured t29, 520
dcl_resource_structured t31, 16
dcl_input_sgv v0.x, vertex_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.x
dcl_temps 10
//
// Initial variable locations:
//   v0.x <- nVertexID;
//   o7.x <- <Emissive_VS return value>.VertexID;
//   o6.x <- <Emissive_VS return value>.VertexColor.x; o6.y <- <Emissive_VS return value>.VertexColor.y; o6.z <- <Emissive_VS return value>.VertexColor.z; o6.w <- <Emissive_VS return value>.VertexColor.w;
//   o5.x <- <Emissive_VS return value>.Tangent.x; o5.y <- <Emissive_VS return value>.Tangent.y; o5.z <- <Emissive_VS return value>.Tangent.z; o5.w <- <Emissive_VS return value>.Tangent.w;
//   o4.x <- <Emissive_VS return value>.Binormal.x; o4.y <- <Emissive_VS return value>.Binormal.y; o4.z <- <Emissive_VS return value>.Binormal.z; o4.w <- <Emissive_VS return value>.Binormal.w;
//   o3.x <- <Emissive_VS return value>.Normal.x; o3.y <- <Emissive_VS return value>.Normal.y; o3.z <- <Emissive_VS return value>.Normal.z; o3.w <- <Emissive_VS return value>.Normal.w;
//   o2.x <- <Emissive_VS return value>.TexCoords0.x; o2.y <- <Emissive_VS return value>.TexCoords0.y; o2.z <- <Emissive_VS return value>.TexCoords0.z; o2.w <- <Emissive_VS return value>.TexCoords0.w;
//   o1.x <- <Emissive_VS return value>.Position.x; o1.y <- <Emissive_VS return value>.Position.y; o1.z <- <Emissive_VS return value>.Position.z; o1.w <- <Emissive_VS return value>.Position.w;
//   o0.x <- <Emissive_VS return value>.HPosition.x; o0.y <- <Emissive_VS return value>.HPosition.y; o0.z <- <Emissive_VS return value>.HPosition.z; o0.w <- <Emissive_VS return value>.HPosition.w
//
#line 148 "particles.fx"
ushr r0.x, v0.x, l(2)  // r0.x <- <GetParticleIndex return value>

#line 55
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r0.yzw, r0.x, l(12), t21.xxyz  // r0.y <- particle.nColorAndAlpha; r0.z <- particle.vPosition.x; r0.w <- particle.vPosition.y
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r1.xz, r0.x, l(24), t21.yxxx  // r1.x <- particle.nFlags; r1.z <- particle.vPosition.z
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r2.x, r0.x, l(48), t21.xxxx  // r2.x <- particle.fSize

#line 60
mul r2.yzw, r0.wwww, cb4[17].xxyz
mad r2.yzw, r0.zzzz, cb4[16].xxyz, r2.yyzw
mad r2.yzw, r1.zzzz, cb4[18].xxyz, r2.yyzw
add r2.yzw, r2.yyzw, cb4[19].xxyz  // r2.y <- vPosVS.x; r2.z <- vPosVS.y; r2.w <- vPosVS.z

#line 63
dp3 r2.y, r2.yzwy, r2.yzwy
sqrt r2.y, r2.y  // r2.y <- fDistToCamera
add r2.z, r2.y, -cb4[1060].x  // r2.z <- fDistToCameraRanged
mul_sat r2.z, r2.z, cb4[1059].w  // r2.z <- fSizeScale
mul r2.x, r2.x, r2.z
mul r2.x, r2.x, l(0.500000)  // r2.x <- fSize

#line 70
and r2.z, r0.y, l(255)
utof r3.x, r2.z  // r3.x <- vColor.x
ubfe r2.zw, l(0, 0, 8, 8), l(0, 0, 8, 16), r0.yyyy
utof r3.yz, r2.zzwz  // r3.y <- vColor.y; r3.z <- vColor.z
ushr r0.y, r0.y, l(24)
utof r3.w, r0.y  // r3.w <- vColor.w
mul r3.xyzw, r3.xyzw, l(0.003922, 0.003922, 0.003922, 0.003922)

#line 77
mad r0.y, cb4[1051].z, r2.x, cb4[1051].x  // r0.y <- fPCameraFadeNearDistance
add r2.z, -r0.y, r2.y
mul_sat r2.z, r2.z, cb4[1059].z  // r2.z <- fCameraFadeAlpha

#line 82
mul r2.z, r2.z, r3.w  // r2.z <- vColor.w

#line 85
lt r0.y, r2.y, r0.y

#line 88
movc r0.y, r0.y, l(0), r2.x  // r0.y <- fSize

#line 99
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r2.xy, r0.x, l(60), t21.xyxx  // r2.y <- particle.fRotation; r2.x <- particle.nTrackInfo
ubfe r2.w, l(8), l(16), r2.x
ftou r3.w, cb4[1059].x
umin r2.w, r2.w, r3.w  // r2.w <- iTrackBegin
ushr r4.x, r2.x, l(24)
umin r3.w, r3.w, r4.x  // r3.w <- iTrackEnd
and r2.x, r2.x, l(0x0000ffff)
utof r2.x, r2.x
mul r4.x, r2.x, l(0.000015)  // r4.x <- fTrackPosition

#line 107
ine r4.y, r2.w, r3.w
iadd r4.z, -r2.w, r3.w
itof r4.z, r4.z
div r4.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.z
mad r2.x, r2.x, l(0.000015), r4.z  // r2.x <- fTile1Position
movc r2.x, r4.y, r2.x, r4.x

#line 111
frc r5.x, r4.x  // r5.x <- fTile0Position
frc r5.y, r2.x  // r5.y <- fTile1Position

#line 116
min r4.x, r4.x, l(0.999900)  // r4.x <- fTile0Position
max r2.x, r2.x, l(0.000000)
min r4.y, r2.x, l(0.999900)  // r4.y <- fTile1Position
movc r4.xy, cb4[1050].xxxx, r5.xyxx, r4.xyxx
itof r2.x, r2.w
itof r2.w, r3.w
add r2.w, -r2.x, r2.w
mad r2.xw, r4.xxxy, r2.wwww, r2.xxxx  // r2.x <- fTile0Index; r2.w <- fTile1Index

#line 124
round_ni r2.xw, r2.xxxw  // r2.x <- fTile0IndexInt; r2.w <- fTile1IndexInt

#line 129
ftoi r2.xw, r2.xxxw  // r2.x <- iTile0Index; r2.w <- iTile1Index
ftoi r3.w, cb4[1059].x
iadd r3.w, r3.w, l(-1)
imax r2.xw, r2.xxxw, l(0, 0, 0, 0)
imin r4.xy, r3.wwww, r2.xwxx  // r4.x <- iTile0Index; r4.y <- iTile1Index

#line 135
ishl r2.xw, r4.xxxy, l(2, 0, 0, 2)
lt r2.x, cb4[r2.x + 25].x, l(0.000000)  // r2.x <- bBothTilesEmpty
lt r2.w, cb4[r2.w + 25].x, l(0.000000)  // r2.w <- bTile1Empty

#line 143
movc r4.z, r2.w, r4.x, r4.y  // r4.z <- iTile1Index
movc r2.xw, r2.xxxx, r4.yyyy, r4.xxxz  // r2.x <- iTile0Index; r2.w <- iTile1Index

#line 186
and r4.xy, r1.xxxx, l(2, 4, 0, 0)

#line 208
ishl r4.zw, r2.xxxw, l(0, 0, 2, 2)

#line 189
ge r3.w, cb4[r4.z + 25].x, l(0.000000)
if_nz r3.w

#line 199
  movc r5.xy, r4.xyxx, l(1,16,0,0), l(0,0,0,0)
  imad r3.w, r5.x, l(8), r5.y
  bfi r5.x, l(2), l(1), v0.x, l(0)
  iadd r3.w, r3.w, r5.x  // r3.w <- nShift
  ushr r3.w, l(0x4e1bb1e4), r3.w
  bfi r3.w, l(30), l(2), r2.x, r3.w
  mov r5.xy, cb4[r3.w + 25].xyxx  // r5.x <- vIALerpFactor.x; r5.y <- vIALerpFactor.y
else
  mov r5.xy, l(0.500000,0.500000,0,0)  // r5.x <- vIALerpFactor.x; r5.y <- vIALerpFactor.y
endif

#line 209
bfi r2.xw, l(30, 0, 0, 30), l(2, 0, 0, 2), r2.xxxw, l(2, 0, 0, 2)
add r5.zw, -cb4[r4.z + 25].zzzw, cb4[r2.x + 25].zzzw
mad o2.xy, r5.xyxx, r5.zwzz, cb4[r4.z + 25].zwzz
add r2.xw, -cb4[r4.w + 25].zzzw, cb4[r2.w + 25].zzzw
mad o2.zw, r5.xxxy, r2.xxxw, cb4[r4.w + 25].zzzw

#line 221
add r2.xw, -r5.xxxy, l(1.000000, 0.000000, 0.000000, 1.000000)  // r2.x <- vIALerpFactor.x; r2.w <- vIALerpFactor.y
movc r2.xw, r4.xxxy, r2.xxxw, r5.xxxy

#line 225
add r4.xy, -cb4[1061].xyxx, cb4[1062].xyxx
mad r2.xw, r2.xxxw, r4.xxxy, cb4[1061].xxxy
mul r4.xy, r0.yyyy, r2.xwxx  // r4.x <- vDir.x; r4.y <- vDir.y

#line 231
sincos r2.x, r5.x, r2.y  // r2.x <- fSin; r5.x <- fCos
mov r6.x, -r2.x  // r6.x <- mSpriteRotation._m01
mov r6.y, r5.x
mov r6.z, r2.x
dp2 r5.x, r4.xyxx, r6.yzyy  // r5.x <- vDir.x
dp2 r5.y, r4.xyxx, r6.xyxx  // r5.y <- vDir.y
mov r4.zw, l(0,0,0,1.000000)
mov r5.zw, r6.zzzy
movc r4.xyzw, cb4[1050].yyyy, r4.xyzw, r5.xyzw  // r4.x <- vDir.x; r4.y <- vDir.y; r4.z <- fSin; r4.w <- fCos

#line 267
ld_structured_indexable(structured_buffer, stride=96)(mixed,mixed,mixed,mixed) r2.xyw, r0.x, l(0), t21.xyxz
mul r2.xyw, r2.xyxw, cb4[1050].wwww  // r2.x <- vVelocity.x; r2.y <- vVelocity.y; r2.w <- vVelocity.z

#line 270
dp3 r0.x, r2.xywx, r2.xywx
ge r0.x, l(0.000000), r0.x
movc r2.xyw, r0.xxxx, l(0,0,0,0.000100), r2.xyxw

#line 219 "CommonVS.fx"
mov r1.xy, r0.zwzz
mov r1.w, l(1.000000)
mad r0.xyzw, cb1[8].xyzw, r1.xyzw, cb1[9].xyzw  // r0.x <- <RemapPosition return value>.x; r0.y <- <RemapPosition return value>.y; r0.z <- <RemapPosition return value>.z; r0.w <- <RemapPosition return value>.w

#line 377 "particles.fx"
mul r1.xyzw, r0.yyyy, cb1[1].xyzw
mad r1.xyzw, r0.xxxx, cb1[0].xyzw, r1.xyzw
mad r1.xyzw, r0.zzzz, cb1[2].xyzw, r1.xyzw
mad r0.xyzw, r0.wwww, cb1[3].xyzw, r1.xyzw  // r0.x <- v4Position.x; r0.y <- v4Position.y; r0.z <- v4Position.z; r0.w <- v4Position.w

#line 603 "common.fx"
mul o6.xyz, r3.xyzx, r3.xyzx

#line 342 "particles.fx"
ine r1.x, l(-1), cb4[7].x
if_nz r1.x

#line 346
  mul r1.xyz, r0.yyyy, cb2[9].xywx
  mad r1.xyz, r0.xxxx, cb2[8].xywx, r1.xyzx
  mad r1.xyz, r0.zzzz, cb2[10].xywx, r1.xyzx
  mad r1.xyz, r0.wwww, cb2[11].xywx, r1.xyzx  // r1.x <- vPositionVP.x; r1.y <- vPositionVP.y; r1.z <- vPositionVP.w
  div_sat r1.xy, r1.xyxx, r1.zzzz
  mul r1.xy, r1.xyxx, cb2[31].zwzz  // r1.x <- vCoords.x; r1.y <- vCoords.y

#line 350
  mul r1.xy, r1.xyxx, l(0.062500, 0.062500, 0.000000, 0.000000)
  ftoi r1.xy, r1.xyxx  // r1.x <- nTileX; r1.y <- nTileY
  iadd r1.zw, cb2[71].zzzw, l(0, 0, -1, -1)
  imin r1.xy, r1.zwzz, r1.xyxx
  imax r1.xy, r1.xyxx, l(0, 0, 0, 0)  // r1.x <- nTileX; r1.y <- nTileY

#line 815 "common.fx"
  imad r1.x, r1.y, cb2[71].z, r1.x  // r1.x <- <Mad24 return value>

#line 356 "particles.fx"
  div r1.y, l(1.000000, 1.000000, 1.000000, 1.000000), -r0.z
  mul r1.yzw, r0.xxyz, r1.yyyy  // r1.y <- vEye.x; r1.z <- vEye.y; r1.w <- vEye.z
  ld_structured_indexable(structured_buffer, stride=520)(mixed,mixed,mixed,mixed) r3.x, r1.x, l(0), t29.xxxx  // r3.x <- nStartRoomId

#line 39 "CommonLightTile.fx"
  ld_structured_indexable(structured_buffer, stride=520)(mixed,mixed,mixed,mixed) r3.y, r1.x, l(8), t29.xxxx  // r3.y <- nObjectID

#line 44
  mov r3.z, r3.x  // r3.z <- nPixelRoomIndex
  mov r3.w, l(0)  // r3.w <- fMaxGateDepth
  mov r5.x, l(0)  // r5.x <- nReadOffset
  mov r5.y, r3.y  // r5.y <- nObjectID
  loop
    ushr r5.z, r5.y, l(12)
    ine r5.z, r5.z, l(1)
    breakc_nz r5.z

#line 52
    bfi r6.xyz, l(12, 12, 12, 0), l(4, 4, 4, 0), r5.yyyy, l(0, 2, 6, 0)

#line 48
    ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r7.xyzw, r6.x, l(0), t31.xyzw  // r7.x <- vRowX.x; r7.y <- vRowX.y; r7.z <- vRowX.z; r7.w <- vRowX.w

#line 51
    iadd r5.zw, r6.xxxx, l(0, 0, 1, 3)
    ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r8.xyzw, r5.z, l(0), t31.xyzw  // r8.x <- vRowY.x; r8.y <- vRowY.y; r8.z <- vRowY.z; r8.w <- vRowY.w
    ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r9.xyzw, r6.y, l(0), t31.xyzw  // r9.x <- vRowZ.x; r9.y <- vRowZ.y; r9.z <- vRowZ.z; r9.w <- vRowZ.w
    ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r5.zw, r5.w, l(0), t31.xxxy  // r5.z <- vParams0.x; r5.w <- vParams0.y
    ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r6.x, r6.z, l(12), t31.xxxx  // r6.x <- viParams3.w
    ushr r6.x, r6.x, l(8)  // r6.x <- nRoomIdx1

#line 58
    dp3 r6.z, r1.yzwy, r7.xyzx  // r6.z <- vDots.x
    dp3 r6.w, r1.yzwy, r8.xyzx  // r6.w <- vDots.y
    dp3 r7.x, r1.yzwy, r9.xyzx  // r7.x <- vDots.z
    div r6.y, -r8.w, r6.w  // r6.y <- t
    mad r6.z, r6.z, r6.y, r7.w  // r6.z <- vIntersectXY.x
    mad r6.w, r7.x, r6.y, r9.w  // r6.w <- vIntersectXY.y
    ge r7.x, r6.y, r3.w
    ge r7.y, -r0.z, r6.y
    and r7.x, r7.y, r7.x
    ge r5.zw, r5.zzzw, |r6.zzzw|
    and r5.z, r5.z, r7.x
    and r5.z, r5.w, r5.z

#line 65
    movc r3.zw, r5.zzzz, r6.xxxy, r3.zzzw
    iadd r5.z, r5.x, l(1)  // r5.z <- nReadOffset
    ishl r5.w, r5.x, l(2)
    iadd r5.w, r5.w, l(12)
    ld_structured_indexable(structured_buffer, stride=520)(mixed,mixed,mixed,mixed) r5.y, r1.x, r5.w, t29.xxxx
    mov r5.xy, r5.zyzz  // r5.x <- nReadOffset
  endloop
  ishl r1.x, l(1), r3.z
  and r1.x, r1.x, cb4[7].x
  movc r1.x, r1.x, l(1.000000), l(0)  // r1.x <- <CalculateRoomFade return value>

#line 359 "particles.fx"
else
  mov r1.x, l(1.000000)
endif

#line 382
mul o6.w, r1.x, r2.z
mad r1.xy, cb4[4].xyxx, r4.xyxx, cb4[4].zwzz  // r1.x <- vDirection.x; r1.y <- vDirection.y
mad r2.xyz, cb4[5].xyzx, r2.xywx, cb4[6].xyzx  // r2.x <- v4Velocity.x; r2.y <- v4Velocity.y; r2.z <- v4Velocity.z

#line 388
mul r1.zw, r2.yyyy, cb1[1].xxxy
mad r1.zw, r2.xxxx, cb1[0].xxxy, r1.zzzw
mad r1.zw, r2.zzzz, cb1[2].xxxy, r1.zzzw  // r1.z <- v4VelocityVS.x; r1.w <- v4VelocityVS.y

#line 425
dp2 r2.x, r1.zwzz, r1.zwzz
rsq r2.x, r2.x
dp2 r2.z, r1.xyxx, r1.xyxx
rsq r2.z, r2.z
mul r2.xyzw, r1.zwxy, r2.xxzz
dp2 r2.x, r2.xyxx, r2.zwzz
mul r2.x, |r2.x|, l(1.414227)  // r2.x <- fDiagonalWeight
mul r1.zw, |r1.zzzw|, r2.xxxx
mad r1.xy, r1.zwzz, r1.xyxx, r1.xyxx

#line 429
add r0.xy, r0.xyxx, r1.xyxx

#line 756 "C:\p4\PRJ_PRO\main\runtime\main\neutral\_pro\effects\materialclasses\fxdraw\fx_draw_sa_sprite.materialclass\767dc738be4a1061f87398ff6d866f62.fx"
mul r1.xyzw, r0.yyyy, cb2[1].xyzw
mad r1.xyzw, r0.xxxx, cb2[0].xyzw, r1.xyzw
mad r1.xyzw, r0.zzzz, cb2[2].xyzw, r1.xyzw
mad o0.xyzw, r0.wwww, cb2[3].xyzw, r1.xyzw

#line 763
mov o1.xyzw, r0.xyzw
mov o3.xyzw, l(0,0,1.000000,1.000000)
mov o4.xy, -r4.zwzz
mov o4.zw, l(0,0,0,0)
mov o5.x, r4.w
mov o5.y, -r4.z
mov o5.zw, l(0,0,0,0)
mov o7.x, v0.x
ret
// Approximately 197 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
