//shadows & volcano smoke
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Sat Aug 15 16:16:36 2020
//
//
// Buffer Definitions:
//
// cbuffer Civ6FireFXDynamics
// {
//
//   row_major float4x4 gd_mWorld;      // Offset:    0 Size:    64
//   float gd_fScale;                   // Offset:   64 Size:     4
//   float gd_fInvScale;                // Offset:   68 Size:     4 [unused]
//   float gd_fDepthBias;               // Offset:   72 Size:     4
//   float gd_fInvSoftParticleFadeDistance;// Offset:   76 Size:     4 [unused]
//   float gd_fSoftParticleFadeBias;    // Offset:   80 Size:     4 [unused]
//   uint gd_iView;                     // Offset:   84 Size:     4
//   uint gd_nDataBase;                 // Offset:   88 Size:     4
//   uint gd_nIndexBase;                // Offset:   92 Size:     4
//   uint gd_nIndirectionBase;          // Offset:   96 Size:     4
//   uint gd_nAdjacencyToParticleBase;  // Offset:  100 Size:     4
//   uint gd_nParticleToAdjacencyBase;  // Offset:  104 Size:     4
//   uint gd_nIndirectionDrawBase;      // Offset:  108 Size:     4
//   uint gd_nParticles;                // Offset:  112 Size:     4 [unused]
//   uint gd_nParticleMax;              // Offset:  116 Size:     4
//   uint gd_eGeoType;                  // Offset:  120 Size:     4
//   uint gd_eBlendType;                // Offset:  124 Size:     4 [unused]
//   uint gd_nBaseColorUV_Offset;       // Offset:  128 Size:     4
//   uint gd_nMaskUV_Offset;            // Offset:  132 Size:     4
//   uint gd_nDistortionUV_Offset;      // Offset:  136 Size:     4
//   uint gd_nGeoStride;                // Offset:  140 Size:     4
//   uint gd_nMatStride;                // Offset:  144 Size:     4
//   uint gd_mShaderMask;               // Offset:  148 Size:     4 [unused]
//
// }
//
// cbuffer Civ6FireFXGlobals
// {
//
//   row_major float4x4 gg_aView[13];   // Offset:    0 Size:   832
//   row_major float4x4 gg_aViewProj[13];// Offset:  832 Size:   832
//   row_major float4x4 gg_aShadowMapSamplingMatrix[13];// Offset: 1664 Size:   832 [unused]
//   row_major float4x4 gg_aNDCToWorld[13];// Offset: 2496 Size:   832 [unused]
//   float4 gg_aRenderTargetDimensions[13];// Offset: 3328 Size:   208 [unused]
//   float4 gg_aViewXAxis[13];          // Offset: 3536 Size:   208
//   float4 gg_aViewYAxis[13];          // Offset: 3744 Size:   208
//   float4 gg_aCameraPosWS[13];        // Offset: 3952 Size:   208 [unused]
//   float3 g_vLightDirection;          // Offset: 4160 Size:    12 [unused]
//   float4 g_ShadowMapDimensions;      // Offset: 4176 Size:    16 [unused]
//   float2 g_vNearFar;                 // Offset: 4192 Size:     8
//   float g_ShadowZBias;               // Offset: 4200 Size:     4 [unused]
//   uint g_MainRTSamples;              // Offset: 4204 Size:     4 [unused]
//   float3 g_vLightColor;              // Offset: 4208 Size:    12 [unused]
//   float4 g_EnvSHRadiance[7];         // Offset: 4224 Size:   112 [unused]
//   float g_SceneExposure;             // Offset: 4336 Size:     4 [unused]
//   float g_IntermediateExposure;      // Offset: 4340 Size:     4 [unused]
//   float4 g_vFogParams;               // Offset: 4352 Size:    16 [unused]
//   float4 g_vFogSkyColor_IntegralDensity;// Offset: 4368 Size:    16 [unused]
//   float3 g_vFogLightColor;           // Offset: 4384 Size:    12 [unused]
//
// }
//
// Resource bind info for g_IndirectionBuffer
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for g_AdjacencyToParticle
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for g_DataBuffer
// {
//
//   float $Element;                    // Offset:    0 Size:     4
//
// }
//
// Resource bind info for g_IndexBuffer
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for g_ParticleToAdjacency
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_IndirectionBuffer               texture  struct         r/o    0        1
// g_AdjacencyToParticle             texture  struct         r/o    1        1
// g_DataBuffer                      texture  struct         r/o    4        1
// g_IndexBuffer                     texture  struct         r/o    5        1
// g_ParticleToAdjacency             texture  struct         r/o    7        1
// Civ6FireFXDynamics                cbuffer      NA          NA    0        1
// Civ6FireFXGlobals                 cbuffer      NA          NA    1        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   xyz         4     NONE   float   xyz
// TEXCOORD                 4   xyz         5     NONE   float   xyz
// TEXCOORD                 5   xyz         6     NONE   float   xyz
// COLOR                    0   xyzw        7     NONE   float   xyzw
//
vs_5_0

dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
dcl_constantbuffer cb12[0], immediateIndexed
dcl_temps 23

dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[10], immediateIndexed
dcl_constantbuffer cb1[263], dynamicIndexed
dcl_resource_structured t0, 4
dcl_resource_structured t1, 4
dcl_resource_structured t4, 4
dcl_resource_structured t5, 4
dcl_resource_structured t7, 4
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.xyz
dcl_output o5.xyz
dcl_output o6.xyz
dcl_output o7.xyzw
//dcl_temps 19
ushr r0.x, v0.x, l(2)
and r0.y, v0.x, l(-4)
iadd r0.y, -r0.y, v0.x
iadd r0.z, cb0[6].w, cb0[6].x
iadd r0.x, r0.x, r0.z
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.x, r0.x, l(0), t0.xxxx
ieq r0.zw, l(0, 0, 4, 5), cb0[7].zzzz
or r0.w, r0.w, r0.z
if_nz r0.w
  iadd r0.w, r0.x, cb0[6].z
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.w, r0.w, l(0), t7.xxxx
  imad r1.x, r0.x, l(3), cb0[5].w
  iadd r1.x, r1.x, l(2)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r1.x, l(0), t5.xxxx
  iadd r1.y, cb0[8].w, cb0[9].x
  imad r1.z, r1.y, r0.x, cb0[5].z
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r1.z, l(0), t4.xxxx
  iadd r3.xyz, r1.zzzz, l(1, 2, 3, 0)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r3.x, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.z, r3.y, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r3.z, l(0), t4.xxxx
  iadd r2.w, r1.z, cb0[8].w
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r3.x, r2.w, l(0), t4.xxxx
  iadd r4.xyz, r2.wwww, l(1, 2, 3, 0)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r3.y, r4.x, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r3.z, r4.y, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r3.w, r4.z, l(0), t4.xxxx
  iadd r4.xyz, r2.wwww, cb0[8].xyzx
  iadd r5.xyzw, r4.xxyy, l(2, 1, 2, 1)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.x, r5.x, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.y, r4.x, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.z, r5.y, l(0), t4.xxxx
  ult r4.xw, l(0, 0, 0, 0), cb0[8].yyyz
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.x, r5.z, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.y, r4.y, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.z, r5.w, l(0), t4.xxxx
  movc r5.xyz, r4.xxxx, r5.xyzx, r6.xyzx
  iadd r7.xyz, r4.zzzz, l(2, 1, 3, 0)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r8.x, r7.x, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r8.y, r4.z, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r8.z, r7.y, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r7.w, r7.z, l(0), t4.xxxx
  movc r8.xyz, r4.wwww, r8.xyzx, r6.xyzx
  iadd r2.w, r0.w, cb0[6].y
  iadd r4.y, l(-1), cb0[7].y
  ult r4.y, r0.w, r4.y
  if_nz r4.y
    iadd r4.y, r2.w, l(1)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r4.y, r4.y, l(0), t1.xxxx
    imad r4.z, r4.y, l(3), cb0[5].w
    iadd r4.z, r4.z, l(2)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r4.z, r4.z, l(0), t5.xxxx
    ieq r4.z, r1.x, r4.z
    not r9.x, r4.z
    if_nz r4.z
      imad r4.y, r1.y, r4.y, cb0[5].z
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r9.y, r4.y, l(0), t4.xxxx
      iadd r10.xyz, r4.yyyy, l(1, 2, 3, 0)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r9.z, r10.x, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r9.w, r10.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r4.z, r10.z, l(0), t4.xxxx
      iadd r4.y, r4.y, cb0[8].w
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) o7.x, r4.y, l(0), t4.xxxx
      iadd r10.xyz, r4.yyyy, l(1, 2, 3, 0)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) o7.y, r10.x, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) o7.z, r10.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) o7.w, r10.z, l(0), t4.xxxx
      iadd r10.xyz, r4.yyyy, cb0[8].xyzx
      iadd r11.xyzw, r10.xxyy, l(2, 1, 2, 1)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r7.x, r11.x, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r7.y, r10.x, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r7.z, r11.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r11.x, r11.z, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r11.y, r10.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r11.z, r11.w, l(0), t4.xxxx
      movc r11.xyz, r4.xxxx, r11.xyzx, r7.xyzx
      iadd r10.xyw, r10.zzzz, l(2, 1, 0, 3)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r12.x, r10.x, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r12.y, r10.z, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r12.z, r10.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r12.w, r10.w, l(0), t4.xxxx
      movc r10.xyzw, r4.wwww, r12.xwyz, r7.xwyz
      mov r11.w, r7.y
      mov r12.xy, r11.wyww
      mov r13.x, r7.z
      mov r13.y, r11.z
      mov r12.z, r10.z
      mov r13.z, r10.w
    else
      mov r6.w, r5.y
      mov r12.xy, r6.ywyy
      mov r5.w, r6.z
      mov r13.xy, r5.wzww
      mov o7.xyzw, r3.xyzw
      mov r7.x, r6.x
      mov r11.x, r5.x
      mov r8.w, r7.w
      mov r10.xy, r8.xwxx
      mov r12.z, r8.y
      mov r13.z, r8.z
      mov r9.yzw, r2.xxyz
      mov r4.z, r1.w
    endif
  else
    mov r12.x, r6.y
    mov r12.y, r5.y
    mov r13.x, r6.z
    mov r13.y, r5.z
    mov o7.xyzw, r3.xyzw
    mov r7.x, r6.x
    mov r11.x, r5.x
    mov r10.x, r8.x
    mov r10.y, r7.w
    mov r12.z, r8.y
    mov r13.z, r8.z
    mov r9.yzw, r2.xxyz
    mov r4.z, r1.w
    mov r9.x, l(-1)
  endif
  if_z r9.x
    ult r4.x, l(0), r0.w
    iadd r4.yw, r2.wwww, l(0, -1, 0, 2)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r4.y, l(0), t1.xxxx
    imad r4.y, r2.w, l(3), cb0[5].w
    iadd r4.y, r4.y, l(2)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r4.y, r4.y, l(0), t5.xxxx
    ieq r4.y, r1.x, r4.y
    imad r2.w, r1.y, r2.w, cb0[5].z
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r14.x, r2.w, l(0), t4.xxxx
    iadd r11.zw, r2.wwww, l(0, 0, 1, 2)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r14.y, r11.z, l(0), t4.xxxx
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r14.z, r11.w, l(0), t4.xxxx
    movc r14.xyz, r4.yyyy, r14.xyzx, r2.xyzx
    movc r14.xyz, r4.xxxx, r14.xyzx, r2.xyzx
    iadd r2.w, l(-2), cb0[7].y
    ult r0.w, r0.w, r2.w
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r4.w, l(0), t1.xxxx
    imad r4.x, r2.w, l(3), cb0[5].w
    iadd r4.x, r4.x, l(2)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r4.x, r4.x, l(0), t5.xxxx
    ieq r1.x, r1.x, r4.x
    imad r1.y, r1.y, r2.w, cb0[5].z
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r15.x, r1.y, l(0), t4.xxxx
    iadd r4.xy, r1.yyyy, l(1, 2, 0, 0)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r15.y, r4.x, l(0), t4.xxxx
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r15.z, r4.y, l(0), t4.xxxx
    movc r4.xyw, r1.xxxx, r15.xyxz, r9.yzyw
    movc r4.xyw, r0.wwww, r4.xyxw, r9.yzyw
    mul r15.xyzw, r14.yyyy, cb0[1].xyzw
    mad r15.xyzw, r14.xxxx, cb0[0].xyzw, r15.xyzw
    mad r14.xyzw, r14.zzzz, cb0[2].xyzw, r15.xyzw
    add r14.xyzw, r14.xyzw, cb0[3].xyzw
    mul r15.xyzw, r2.yyyy, cb0[1].xyzw
    mad r15.xyzw, r2.xxxx, cb0[0].xyzw, r15.xyzw
    mad r15.xyzw, r2.zzzz, cb0[2].xyzw, r15.xyzw
    add r15.xyzw, r15.xyzw, cb0[3].xyzw
    mul r16.xyzw, r9.zzzz, cb0[1].xyzw
    mad r16.xyzw, r9.yyyy, cb0[0].xyzw, r16.xyzw
    mad r16.xyzw, r9.wwww, cb0[2].xyzw, r16.xyzw
    add r16.xyzw, r16.xyzw, cb0[3].xyzw
    mul r17.xyzw, r4.yyyy, cb0[1].xyzw
    mad r17.xyzw, r4.xxxx, cb0[0].xyzw, r17.xyzw
    mad r17.xyzw, r4.wwww, cb0[2].xyzw, r17.xyzw
    add r17.xyzw, r17.xyzw, cb0[3].xyzw
    add r4.xyw, -r14.zxzy, r16.zxzy
    dp3 r0.w, r4.xywx, r4.xywx
    rsq r0.w, r0.w
    mul r4.xyw, r0.wwww, r4.xyxw
    if_nz r0.z
      ishl r0.z, cb0[5].y, l(2)
      mul r1.xy, r14.yyyy, cb1[r0.z + 1].xyxx
      mad r1.xy, r14.xxxx, cb1[r0.z + 0].xyxx, r1.xyxx
      mad r1.xy, r14.zzzz, cb1[r0.z + 2].xyxx, r1.xyxx
      mad r1.xy, r14.wwww, cb1[r0.z + 3].xyxx, r1.xyxx
      mul r11.zw, r15.yyyy, cb1[r0.z + 1].xxxy
      mad r11.zw, r15.xxxx, cb1[r0.z + 0].xxxy, r11.zzzw
      mad r11.zw, r15.zzzz, cb1[r0.z + 2].xxxy, r11.zzzw
      mad r11.zw, r15.wwww, cb1[r0.z + 3].xxxy, r11.zzzw
      mul r14.xy, r16.yyyy, cb1[r0.z + 1].xyxx
      mad r14.xy, r16.xxxx, cb1[r0.z + 0].xyxx, r14.xyxx
      mad r14.xy, r16.zzzz, cb1[r0.z + 2].xyxx, r14.xyxx
      mad r14.xy, r16.wwww, cb1[r0.z + 3].xyxx, r14.xyxx
      mul r14.zw, r17.yyyy, cb1[r0.z + 1].xxxy
      mad r14.zw, r17.xxxx, cb1[r0.z + 0].xxxy, r14.zzzw
      mad r14.zw, r17.zzzz, cb1[r0.z + 2].xxxy, r14.zzzw
      mad r0.zw, r17.wwww, cb1[r0.z + 3].xxxy, r14.zzzw
      add r1.xy, -r1.xyxx, r14.xyxx
      dp2 r2.w, r1.xyxx, r1.xyxx
      rsq r2.w, r2.w
      mul r14.xy, r1.xyxx, r2.wwww
      mov r14.z, -r14.y
      mul r1.xy, r1.wwww, r14.zxzz
      add r0.zw, -r11.zzzw, r0.zzzw
      dp2 r2.w, r0.zwzz, r0.zwzz
      rsq r2.w, r2.w
      mul r14.xy, r0.zwzz, r2.wwww
      mov r14.z, -r14.y
      mul r0.zw, r4.zzzz, r14.zzzx
      mov r2.w, cb0[5].y
      mul r14.xyz, r1.yyyy, cb1[r2.w + 234].xyzx
      mad r14.xyz, cb1[r2.w + 221].xyzx, r1.xxxx, r14.xyzx
      mul r16.xyz, r0.wwww, cb1[r2.w + 234].xyzx
      mad r16.xyz, cb1[r2.w + 221].xyzx, r0.zzzz, r16.xyzx
    else
      iadd r1.xyz, r1.zzzz, l(4, 5, 6, 0)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r18.x, r1.x, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r18.y, r1.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r18.z, r1.z, l(0), t4.xxxx
      mul r14.xyz, r1.wwww, r18.xyzx
      mul r16.xyz, r4.zzzz, r18.xyzx
    endif
    if_z r0.y
      mul r1.xyz, r4.xywx, r14.yzxy
      mad r1.xyz, r4.wxyw, r14.zxyz, -r1.xyzx
      dp3 r0.z, r1.xyzx, r1.xyzx
      rsq r0.z, r0.z
      mul o5.xyz, r0.zzzz, r1.xyzx
      dp3 r0.z, r14.xyzx, r14.xyzx
      rsq r0.z, r0.z
      mul o6.xyz, r0.zzzz, r14.xyzx
      mov o7.xyzw, r3.xyzw
      mov r7.xy, r6.xyxx
      mov r11.xy, r5.xyxx
      mov o3.xy, r8.xyxx
      mov o3.zw, r7.wwww
      mov r9.yzw, r2.xxyz
      mov r14.xyz, -r14.xyzx
    else
      ieq r0.z, r0.y, l(1)
      if_nz r0.z
        mul r1.xyz, r4.xywx, r14.yzxy
        mad r1.xyz, r4.wxyw, r14.zxyz, -r1.xyzx
        dp3 r0.z, r1.xyzx, r1.xyzx
        rsq r0.z, r0.z
        mul o5.xyz, r0.zzzz, r1.xyzx
        dp3 r0.z, r14.xyzx, r14.xyzx
        rsq r0.z, r0.z
        mul o6.xyz, r0.zzzz, r14.xyzx
        mov o7.xyzw, r3.xyzw
        mov r7.xy, r6.xzxx
        mov r11.xy, r5.xzxx
        mov o3.xy, r8.xzxx
        mov o3.zw, r7.wwww
        mov r9.yzw, r2.xxyz
      else
        add r1.xyz, -r15.zxyz, r17.zxyz
        dp3 r0.z, r1.xyzx, r1.xyzx
        rsq r0.z, r0.z
        mul r1.xyz, r0.zzzz, r1.xyzx
        ieq r0.z, r0.y, l(2)
        mul r2.xyz, r16.yzxy, r1.xyzx
        mad r1.xyz, r1.zxyz, r16.zxyz, -r2.xyzx
        dp3 r0.w, r1.xyzx, r1.xyzx
        rsq r0.w, r0.w
        mul o5.xyz, r0.wwww, r1.xyzx
        dp3 r0.w, r16.xyzx, r16.xyzx
        rsq r0.w, r0.w
        mul o6.xyz, r0.wwww, r16.xyzx
        movc r14.xyz, r0.zzzz, -r16.xyzx, r16.xyzx
        movc r7.yzw, r0.zzzz, r12.xxyz, r13.xxyz
        mov r11.y, r7.z
        mov r10.z, r7.w
        mov o3.xyzw, r10.xzyy
      endif
    endif
  else
    mov o7.xyzw, l(0,0,0,0)
    mov r7.xy, l(0,0,0,0)
    mov r11.xy, l(0,0,0,0)
    mov o3.xyzw, l(0,0,0,0)
    mov r9.yzw, l(0,0,0,0)
    mov o5.xyz, l(1.000000,0,0,0)
    mov o6.xyz, l(0,0,0,0)
    mov r14.xyz, l(0,0,0,0)
  endif
  mov o2.xyzw, l(1.000000,0,0,1.000000)
  mov o1.xy, r7.xyxx
  mov o1.zw, r11.xxxy
else
  iadd r0.z, cb0[8].w, cb0[9].x
  imad r0.x, r0.z, r0.x, cb0[5].z
  iadd r0.z, r0.x, cb0[8].w
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r9.y, r0.x, l(0), t4.xxxx
  iadd r1.xyzw, r0.xxxx, l(1, 2, 3, 4)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r9.z, r1.x, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r9.w, r1.y, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.w, r1.z, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r1.w, l(0), t4.xxxx
  if_z cb0[5].y
    mov r1.yzw, cb1[221].xxyz
    mov r2.xyz, cb1[234].xyzx
  else
    mov r2.w, cb0[5].y
    mov r1.yzw, cb1[r2.w + 221].xxyz
    mov r2.xyz, cb1[r2.w + 234].xyzx
  endif
  ieq r2.w, l(1), cb0[7].z
  if_nz r2.w
    iadd r2.w, r0.x, l(5)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r2.w, l(0), t4.xxxx
    sincos r3.x, r4.x, r2.w
    mul r3.yzw, r2.xxyz, r3.xxxx
    mad r3.yzw, r1.yyzw, r4.xxxx, r3.yyzw
    mul r3.yzw, r0.wwww, r3.yyzw
    mul r4.xyz, r2.xyzx, r4.xxxx
    mad r4.xyz, -r1.yzwy, r3.xxxx, r4.xyzx
    mul r4.xyz, r1.xxxx, r4.xyzx
  else
    ieq r2.w, l(2), cb0[7].z
    if_nz r2.w
      iadd r5.xyz, r0.xxxx, l(5, 6, 7, 0)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.x, r5.x, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.y, r5.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.z, r5.z, l(0), t4.xxxx
      ishl r2.w, cb0[5].y, l(2)
      dp3 r3.x, r6.xyzx, r6.xyzx
      rsq r3.x, r3.x
      mul r5.xyzw, r9.zzzz, cb0[1].xyzw
      mad r5.xyzw, r9.yyyy, cb0[0].xyzw, r5.xyzw
      mad r5.xyzw, r9.wwww, cb0[2].xyzw, r5.xyzw
      add r5.xyzw, r5.xyzw, cb0[3].xyzw
      mul r7.xy, r5.yyyy, cb1[r2.w + 1].xyxx
      mad r5.xy, r5.xxxx, cb1[r2.w + 0].xyxx, r7.xyxx
      mad r5.xy, r5.zzzz, cb1[r2.w + 2].xyxx, r5.xyxx
      mad r5.xy, r5.wwww, cb1[r2.w + 3].xyxx, r5.xyxx
      mad r6.xyz, r6.xyzx, r3.xxxx, r9.yzwy
      mul r7.xyzw, r6.yyyy, cb0[1].xyzw
      mad r7.xyzw, r6.xxxx, cb0[0].xyzw, r7.xyzw
      mad r6.xyzw, r6.zzzz, cb0[2].xyzw, r7.xyzw
      add r6.xyzw, r6.xyzw, cb0[3].xyzw
      mul r5.zw, r6.yyyy, cb1[r2.w + 1].xxxy
      mad r5.zw, r6.xxxx, cb1[r2.w + 0].xxxy, r5.zzzw
      mad r5.zw, r6.zzzz, cb1[r2.w + 2].xxxy, r5.zzzw
      mad r5.zw, r6.wwww, cb1[r2.w + 3].xxxy, r5.zzzw
      add r5.xy, -r5.xyxx, r5.zwzz
      dp2 r2.w, r5.xyxx, r5.xyxx
      rsq r2.w, r2.w
      mul r5.xy, r2.wwww, r5.xyxx
      mul r6.xyz, r2.xyzx, r5.yyyy
      mad r6.xyz, r1.yzwy, r5.xxxx, r6.xyzx
      mul r3.yzw, r0.wwww, r6.xxyz
      mul r2.xyz, r2.xyzx, r5.xxxx
      mad r1.yzw, -r1.yyzw, r5.yyyy, r2.xxyz
      mul r4.xyz, r1.xxxx, r1.yzwy
    else
      iadd r2.xyzw, r0.xxxx, l(5, 6, 7, 8)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.x, r2.x, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.y, r2.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.z, r2.z, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r2.w, l(0), t4.xxxx
      iadd r1.yz, r0.xxxx, l(0, 9, 10, 0)
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.y, l(0), t4.xxxx
      ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.z, r1.z, l(0), t4.xxxx
      mul r3.yzw, r0.wwww, r5.xxyz
      mul r4.xyz, r1.xxxx, r2.xyzx
    endif
  endif
  mul r1.xyz, r3.wyzw, r4.yzxy
  mad r1.xyz, r3.zwyz, r4.zxyz, -r1.xyzx
  dp3 r0.x, r1.xyzx, r1.xyzx
  rsq r0.x, r0.x
  mul o5.xyz, r0.xxxx, r1.xyzx
  dp3 r0.x, r3.yzwy, r3.yzwy
  rsq r0.x, r0.x
  mul o6.xyz, r0.xxxx, r3.yzwy
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) o7.x, r0.z, l(0), t4.xxxx
  iadd r1.xyz, r0.zzzz, l(1, 2, 3, 0)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) o7.y, r1.x, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) o7.z, r1.y, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) o7.w, r1.z, l(0), t4.xxxx
  iadd r0.xzw, r0.zzzz, cb0[8].xxyz
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r0.x, l(0), t4.xxxx
  iadd r2.xyzw, r0.xxxx, l(1, 2, 3, 4)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.y, r2.x, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r5.x, r2.y, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r6.y, r2.z, l(0), t4.xxxx
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.x, r2.w, l(0), t4.xxxx
  ult r2.xy, l(0, 0, 0, 0), cb0[8].yzyy
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.z, r0.z, l(0), t4.xxxx
  and r7.x, r2.z, r2.x
  iadd r8.xyzw, r0.zzzw, l(1, 2, 3, 1)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.z, r8.x, l(0), t4.xxxx
  and r1.z, r2.z, r2.x
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.z, r8.y, l(0), t4.xxxx
  and r10.z, r2.z, r2.x
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.z, r8.z, l(0), t4.xxxx
  and r6.x, r2.z, r2.x
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r0.w, l(0), t4.xxxx
  and r7.z, r2.x, r2.y
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r8.w, l(0), t4.xxxx
  and r1.w, r2.x, r2.y
  iadd r2.xzw, r0.wwww, l(2, 0, 3, 5)
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r2.x, l(0), t4.xxxx
  and r10.y, r2.x, r2.y
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r2.z, l(0), t4.xxxx
  and r6.z, r2.x, r2.y
  ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r2.w, l(0), t4.xxxx
  and r2.z, r2.x, r2.y
  add r2.w, -r1.x, r5.x
  add r3.x, -r1.y, r6.y
  mul r4.w, r2.w, r2.w
  rsq r4.w, r4.w
  mul r2.w, r2.w, r4.w
  mul r4.w, r3.x, r3.x
  rsq r4.w, r4.w
  mul r3.x, r3.x, r4.w
  add r8.xyz, -r3.yzwy, -r4.xyzx
  add r11.xyz, -r3.yzwy, r4.xyzx
  ieq r12.xy, r0.yyyy, l(1, 2, 0, 0)
  add r13.xyz, r3.yzwy, -r4.xyzx
  add r3.yzw, r3.yyzw, r4.xxyz
  movc r3.yzw, r12.yyyy, r13.xxyz, r3.yyzw
  movc r5.yzw, r12.yyyy, r6.yyxz, r1.yyzw
  mov r7.yw, r1.zzzw
  mov r10.xw, r5.zzzw
  movc r4.xyzw, r12.xxxx, r7.xyzw, r10.zxyw
  movc r3.yzw, r12.xxxx, r11.xxyz, r3.yyzw
  movc r1.zw, r12.xxxx, r1.yyyx, r5.yyyx
  movc r14.xyz, r0.yyyy, r3.yzwy, r8.xyzx
  mov r6.w, r1.x
  movc r1.zw, r0.yyyy, r1.zzzw, r6.yyyw
  mov r8.xw, r7.xxxz
  mov r8.yz, r6.zzxz
  movc r4.xyzw, r0.yyyy, r4.xyzw, r8.xzwy
  mov r6.x, r5.x
  add r1.xy, r1.xyxx, r6.xyxx
  sincos r0.x, r5.x, r0.x
  mad r1.zw, -r1.yyyx, l(0.000000, 0.000000, 0.500000, 0.500000), r1.zzzw
  mul r3.yz, r0.xxxx, r1.zzwz
  mad r6.x, r5.x, r1.w, -r3.y
  mad r6.y, r5.x, r1.z, r3.z
  mad o1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), r6.xyxx
  mul o2.x, r2.w, r5.x
  mul o2.y, r2.w, r0.x
  mul r0.x, r3.x, r0.x
  mov o2.z, -r0.x
  mul o2.w, r3.x, r5.x
  if_nz cb0[8].y
    iadd r0.x, r0.z, l(4)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.x, r0.x, l(0), t4.xxxx
    mov r10.w, r8.z
    add r0.yz, r7.xxyx, r10.zzwz
    sincos r0.x, r1.x, r0.x
    mad r1.yz, -r0.zzyz, l(0.000000, 0.500000, 0.500000, 0.000000), r4.yyxy
    mul r3.xy, r0.xxxx, r1.yzyy
    mad r1.z, r1.x, r1.z, -r3.x
    mad r1.w, r1.x, r1.y, r3.y
    mad o1.zw, r0.yyyz, l(0.000000, 0.000000, 0.500000, 0.500000), r1.zzzw
  else
    mov o1.zw, r4.xxxy
  endif
  if_nz cb0[8].z
    iadd r0.x, r0.w, l(4)
    ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.x, r0.x, l(0), t4.xxxx
    mov r8.x, r10.y
    add r0.yz, r7.zzwz, r8.xxyx
    sincos r0.x, r1.x, r0.x
    mad r1.yz, -r0.zzyz, l(0.000000, 0.500000, 0.500000, 0.000000), r4.wwzw
    mul r0.xw, r0.xxxx, r1.yyyz
    mad r3.x, r1.x, r1.z, -r0.x
    mad r3.y, r1.x, r1.y, r0.w
    mad r2.xy, r0.yzyy, l(0.500000, 0.500000, 0.000000, 0.000000), r3.xyxx
  else
    mov r2.xy, r4.zwzz
  endif
  mov o3.xyzw, r2.xyzz
endif
mul r0.xyz, r9.zzzz, cb0[1].xyzx
mad r0.xyz, r9.yyyy, cb0[0].xyzx, r0.xyzx
mad r0.xyz, r9.wwww, cb0[2].xyzx, r0.xyzx
add r0.xyz, r0.xyzx, cb0[3].xyzx
mad r0.xyz, r14.xyzx, cb0[4].xxxx, r0.xyzx
ishl r1.x, cb0[5].y, l(2)
mov r0.w, l(1.000000)
mov r2.x, cb1[r1.x + 0].z
mov r2.y, cb1[r1.x + 1].z
mov r2.z, cb1[r1.x + 2].z
mov r2.w, cb1[r1.x + 3].z
dp4 r0.w, r0.xyzw, r2.xyzw
add r0.w, r0.w, cb1[262].x
add r0.w, r0.w, l(0.005000)
ge r1.y, l(0.000000), r0.w
max r0.w, r0.w, cb0[4].z
and r0.w, r0.w, r1.y
mul r1.yzw, r0.yyyy, cb1[r1.x + 53].xxyw
mad r1.yzw, r0.xxxx, cb1[r1.x + 52].xxyw, r1.yyzw
mad r1.yzw, r0.zzzz, cb1[r1.x + 54].xxyw, r1.yyzw
add r1.yzw, r1.yyzw, cb1[r1.x + 55].xxyw
dp3 r2.w, r2.xyzx, r2.xyzx
rsq r2.w, r2.w
mul r2.xyz, r2.wwww, r2.xyzx
mad r2.xyz, -r2.xyzx, r0.wwww, r0.xyzx
mul r2.yw, r2.yyyy, cb1[r1.x + 53].zzzw
mad r2.xy, r2.xxxx, cb1[r1.x + 52].zwzz, r2.ywyy
mad r2.xy, r2.zzzz, cb1[r1.x + 54].zwzz, r2.xyxx
add r2.xy, r2.xyxx, cb1[r1.x + 55].zwzz
div r0.w, r2.y, r1.w
mul r19.xy, r0.wwww, r1.yzyy
mov r19.zw, r2.xxxy

ld_indexable(texture2d)(float,float,float,float) r20.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_indexable(texture1d)(float,float,float,float) r21.xyzw, l(2, 0, 0, 0), t120.xyzw

if_nz r21.z
add r20.y, r19.w, -r20.y
mad r19.x, r20.x, r20.y, r19.x
endif

mov o0.xyzw, r19.xyzw

mov o4.xyz, r0.xyzx
ret
// Approximately 501 instruction slots used

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