//Nioh 2 water PS 1.
// ---- Created with 3Dmigoto v1.3.16 on Fri Feb 05 17:44:21 2021

cbuffer _Globals : register(b0)
{
  float4 litDir[4] : packoffset(c0);
  float4 litCol[4] : packoffset(c4);
  int nDirLit : packoffset(c8);
  float4 vEye : packoffset(c9);
  int3 vSplsNumSS : packoffset(c10);
  int numLocalShadowParams[2] : packoffset(c11);
  float4 vSubCbW2S[16] : packoffset(c13);
  int3 vSslsNumSS : packoffset(c29);
  row_major float4x4 mSubSptW2S[8] : packoffset(c30);
  float4 vClstZPrm : packoffset(c62);
  int nClstPtch[2] : packoffset(c63);
  float fClstScl : packoffset(c64.y);
  float2 vFadeDist : packoffset(c64.z);
  float3 vCameraPos : packoffset(c65);
  float3 vCameraDir : packoffset(c66);
  float2 vD2Z : packoffset(c67);
  float4 mRrW2T[3] : packoffset(c68);
  row_major float4x4 mV2W : packoffset(c71);
  row_major float4x4 mP2W : packoffset(c75);
  float fAmbMapsDORate : packoffset(c79) = {0};
  float4 vAmbDifScl : packoffset(c80) = {1,1,1,1};
  float4 vAmbSpcScl : packoffset(c81) = {1,1,1,1};
}

SamplerState __smpsIES_s : register(s0);
SamplerState __smpsDepthMap_s : register(s1);
SamplerState __smpsAmbSpc_s : register(s5);
SamplerState __smpsTrnsSpc_s : register(s6);
SamplerComparisonState __smpsSplShadow_s : register(s2);
SamplerComparisonState __smpsSslShadow_s : register(s3);
Texture2DArray<float4> sIES : register(t0);
Texture2D<float4> sDepthMap : register(t1);
TextureCubeArray<float4> sSplShadow : register(t2);
Texture2DArray<float4> sSslShadow : register(t3);
Texture2D<float4> sShadowBuffer : register(t4);
TextureCube<float4> sAmbSpc : register(t5);
Texture2D<float4> sTrnsSpc : register(t6);
Texture2D<float4> sDepth : register(t7);
Texture2D<float4> sGBuf0 : register(t8);
Texture2D<float4> sGBuf1 : register(t9);
Texture2D<float4> sGBuf2 : register(t10);
Texture2D<float4> sGBuf3 : register(t11);
Texture2D<float4> sGBuf4 : register(t12);
Texture2D<float4> sGBuf5 : register(t13);
Buffer<uint> tCllLightIndices : register(t16);
Buffer<float4> tCllLightPositions : register(t17);
Buffer<float3> tCllLightAttributes : register(t18);
Buffer<uint> tCllLightExAttributes : register(t19);
Buffer<float3> tCllSptLightAttributes : register(t20);
Buffer<uint> tCllSptLightExAttributes : register(t21);
Buffer<uint> tMaterialTable : register(t30);


// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  const float4 icb[] = { { 1.000000, 0, 0, 0},
                              { 0, 1.000000, 0, 0},
                              { 0, 0, 1.000000, 0},
                              { 0, 0, 0, 1.000000} };
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,r25,r26,r27,r28,r29,r30,r31,r32,r33,r34;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  
  r0.xy = (int2)v0.xy;
  r0.zw = float2(0,0);
  r1.xyzw = sGBuf1.Load(r0.xyw).xyzw;
  r1.xyz = float3(255,0.996336997,0.996336997) * r1.zxy;
  r1.w = r1.w * 255 + 0.5;
  r1.w = (int)r1.w;
  r1.w = tMaterialTable.Load(r1.w).x;
  r2.xyzw = sGBuf0.Load(r0.xyw).xyzw;
  r3.xyzw = sGBuf2.Load(r0.xyw).xyzw;
  r4.xyz = sGBuf3.Load(r0.xyw).xyw;
  r5.xyz = sGBuf4.Load(r0.xyw).xyz;
  r6.xyz = sGBuf5.Load(r0.xyw).xyz;
  r4.w = sDepth.Load(r0.xyw).x;
  
  r30.xyzw=v1.xyzw;
  
  r17.xyzw = mP2W._m10_m11_m12_m13 * v1.yyyy;
  r17.xyzw = v1.xxxx * mP2W._m00_m01_m02_m03 + r17.xyzw;
  r17.xyzw = r4.wwww * mP2W._m20_m21_m22_m23 + r17.xyzw;
  r17.xyzw = mP2W._m30_m31_m32_m33 + r17.xyzw;
  
  r30.x-=stereo.x;
  
  r27.xyzw = mP2W._m10_m11_m12_m13 * v1.yyyy;
  r27.xyzw = r30.xxxx * mP2W._m00_m01_m02_m03 + r27.xyzw;
  r27.xyzw = r4.wwww * mP2W._m20_m21_m22_m23 + r27.xyzw;
  r27.xyzw = mP2W._m30_m31_m32_m33 + r27.xyzw;
  r27.xyzw = r27.xyzw / r27.wwww;
  
  r30.x+=stereo.x*stereo.y*r17.w;
  
  r7.xyzw = mP2W._m10_m11_m12_m13 * v1.yyyy;
  r7.xyzw = r30.xxxx * mP2W._m00_m01_m02_m03 + r7.xyzw;
  r7.xyzw = r4.wwww * mP2W._m20_m21_m22_m23 + r7.xyzw;
  r7.xyzw = mP2W._m30_m31_m32_m33 + r7.xyzw;
  r7.xyzw = r7.xyzw / r7.wwww;
  r8.xyz = vEye.xyz + -r27.xyz;
  r5.w = dot(r8.xyz, r8.xyz);
  r5.w = rsqrt(r5.w);
  r9.xyz = r8.xyz * r5.www;
  r3.w = r3.w + r3.w;
  r1.x = (uint)r1.x;
  r6.w = (int)r1.x & 15;
  r6.w = (uint)r6.w;
  r10.x = r6.w * 0.000244200259 + r1.y;
  r1.x = (uint)r1.x >> 4;
  r1.x = (uint)r1.x;
  r10.y = r1.x * 0.000244200259 + r1.z;
  r1.xy = r10.xy * float2(2,2) + float2(-1,-1);
  r10.xyz = float3(1,1,1) + -abs(r1.xyx);
  r11.z = r10.x + -abs(r1.y);
  r1.z = cmp(r11.z >= 0);
  r10.xw = cmp(r1.xy >= float2(0,0));
  r10.xw = r10.xw ? float2(1,1) : float2(-1,-1);
  r10.xy = r10.yz * r10.xw;
  r11.xy = r1.zz ? r1.xy : r10.xy;
  r1.x = dot(r11.xyz, r11.xyz);
  r1.x = rsqrt(r1.x);
  r1.xyz = r11.xyz * r1.xxx;
  r10.xyz = mV2W._m10_m11_m12 * r1.yyy;
  r10.xyz = r1.xxx * mV2W._m00_m01_m02 + r10.xyz;
  r1.xyz = r1.zzz * mV2W._m20_m21_m22 + r10.xyz;
  r6.w = 1 + r4.x;
  r1.w = (int)r1.w & 1;
  r6.xyz = r1.www ? r6.xyz : float3(0,0,0);
  
  
  r10.xy = v1.xy / v1.ww;
  r10.xy = r10.xy * float2(0.5,-0.5) + float2(0.5,0.5);
  r11.xyz = vCameraPos.xyz + -r27.xyz;
  r12.xyz = max(float3(9.99999975e-005,9.99999975e-005,9.99999975e-005), r2.xyz);
  r12.xyz = min(float3(0.999899983,0.999899983,0.999899983), r12.xyz);
  r12.xyz = log2(r12.xyz);
  r12.xyz = float3(0.693147182,0.693147182,0.693147182) * r12.xyz;
  r10.zw = max(float2(9.99999975e-005,0), r5.yz);
  r12.xyz = -r12.xyz / r10.zzz;
  r12.xyz = -r12.xyz * r10.www;
  r12.xyz = float3(1.44269502,1.44269502,1.44269502) * r12.xyz;
  r12.xyz = exp2(r12.xyz);
  r13.xyz = sTrnsSpc.SampleLevel(__smpsTrnsSpc_s, r10.xy, 0).xyz;
  r0.xyzw = sShadowBuffer.Load(r0.xyz).xyzw;
  r1.w = cmp(0 < numLocalShadowParams[1]);
  if (r1.w != 0) {
    r1.w = numLocalShadowParams[0] + 1;
    r14.x = dot(r0.xyzw, icb[r1.w+0].xyzw);
    r1.w = 1;
  } else {
    r14.x = 1;
    r1.w = 0;
  }
  r5.y = cmp((int)r1.w < numLocalShadowParams[1]);
  if (r5.y != 0) {
    r8.w = numLocalShadowParams[0] + 2;
    r14.y = dot(r0.xyzw, icb[r8.w+0].xyzw);
    r1.w = 2;
  } else {
    r14.y = 1;
  }
  r8.w = cmp((int)r1.w < numLocalShadowParams[1]);
  r5.y = r5.y ? r8.w : 0;
  if (r5.y != 0) {
    r8.w = numLocalShadowParams[0] + 3;
    r14.z = dot(r0.xyzw, icb[r8.w+0].xyzw);
    r1.w = 3;
  } else {
    r14.z = 1;
  }
  r1.w = cmp((int)r1.w < numLocalShadowParams[1]);
  r1.w = r1.w ? r5.y : 0;
  if (r1.w != 0) {
    r1.w = numLocalShadowParams[0] + 4;
    r14.w = dot(r0.xyzw, icb[r1.w+0].xyzw);
  } else {
    r14.w = 1;
  }
  r1.w = saturate(dot(r1.xyz, r9.xyz));
  r5.y = r1.w + r2.w;
  r5.y = r5.y * r5.y + r2.w;
  r5.y = saturate(-1 + r5.y);
  r0.x = min(r0.x, r4.z);
  r15.x = dot(r1.xyz, -litDir[0].xyz);
  r4.z = cmp(r15.x < 0);
  r8.w = cmp(1 < r6.w);
  r4.z = r4.z ? r8.w : 0;
  r9.w = r15.x + r15.x;
  r16.yzw = r1.xyz * r9.www + litDir[0].xyz;
  r16.x = -r15.x;
  r17.xyz = litCol[0].xyz * r12.xyz;
  r18.xyz = r8.xyz * r5.www + -r16.yzw;
  r9.w = dot(r18.xyz, r18.xyz);
  r9.w = rsqrt(r9.w);
  r18.xyz = r18.xyz * r9.www;
  r9.w = saturate(dot(r9.xyz, r18.xyz));
  r18.xyz = float3(1,1,1) + -r3.xyz;
  r9.w = 1 + -r9.w;
  r10.z = r9.w * r9.w;
  r10.z = r10.z * r10.z;
  r9.w = r10.z * r9.w;
  r19.xyz = r18.xyz * r9.www + r3.xyz;
  r20.xyz = float3(1,1,1) + -r19.xyz;
  r6.w = 2 + -r6.w;
  r21.xyz = r20.xyz * r6.www;
  r19.xyz = r20.xyz * r6.www + r19.xyz;
  r19.xyz = float3(1,1,1) + -r19.xyz;
  r20.xyz = r21.xyz * r4.xxx;
  r19.xyz = r4.zzz ? r19.yzx : float3(-1,-1,-1);
  r20.xyz = r4.zzz ? r20.xyz : float3(-1,-1,-1);
  r17.xyz = r4.zzz ? r17.xyz : litCol[0].xyz;
  r15.yzw = litDir[0].xyz;
  r16.xyzw = r4.zzzz ? r16.xyzw : r15.xyzw;
  r15.yzw = r8.xyz * r5.www + -r16.yzw;
  r4.z = dot(r15.yzw, r15.yzw);
  r4.z = rsqrt(r4.z);
  r15.yzw = r15.yzw * r4.zzz;
  r4.z = dot(r9.xyz, r15.yzw);
  r9.w = cmp(r19.z >= 0);
  r10.z = saturate(r4.z);
  r10.z = 1 + -r10.z;
  r10.w = r10.z * r10.z;
  r10.w = r10.w * r10.w;
  r10.z = r10.z * r10.w;
  r16.yzw = r18.xyz * r10.zzz + r3.xyz;
  r16.yzw = r9.www ? r19.zxy : r16.yzw;
  r3.w = r3.w * r3.w;
  r3.w = r3.w * r3.w;
  r10.z = dot(r1.xyz, r15.yzw);
  r10.w = r3.w * r3.w;
  r10.z = r10.z * r10.z;
  r11.w = r3.w * r3.w + -1;
  r10.z = r10.z * r11.w + 1;
  r10.z = max(9.99999975e-005, r10.z);
  r10.z = r10.z * r10.z;
  r10.z = 4 * r10.z;
  r10.z = r10.w / r10.z;
  r12.w = 0.5 * r3.w;
  r3.w = -r3.w * 0.5 + 1;
  r4.z = r4.z * r3.w + r12.w;
  r4.z = r4.z * r4.z;
  r4.z = 1 / r4.z;
  r4.z = r10.z * r4.z;
  r15.yzw = r16.yzw * r4.zzz;
  r15.yzw = r15.yzw * r17.xyz;
  r16.x = saturate(r16.x);
  r4.z = r16.x * r5.y;
  r15.yzw = r15.yzw * r4.zzz;
  r16.xyz = r17.xyz * r16.xxx;
  r17.xyz = r18.xyz * r6.www;
  r21.xyz = r9.www ? r20.xyz : r17.xyz;
  r16.xyz = r21.xyz * r16.xyz;
  r16.xyz = r16.xyz * r2.www;
  r4.z = cmp(0 < nDirLit);
  if (r4.z != 0) {
    r21.x = dot(r1.xyz, -litDir[1].xyz);
    r4.z = cmp(r21.x < 0);
    r4.z = r8.w ? r4.z : 0;
    r9.w = r21.x + r21.x;
    r22.yzw = r1.xyz * r9.www + litDir[1].xyz;
    r22.x = -r21.x;
    r23.xyz = litCol[1].xyz * r12.xyz;
    r24.xyz = r8.xyz * r5.www + -r22.yzw;
    r9.w = dot(r24.xyz, r24.xyz);
    r9.w = rsqrt(r9.w);
    r24.xyz = r24.xyz * r9.www;
    r9.w = saturate(dot(r9.xyz, r24.xyz));
    r9.w = 1 + -r9.w;
    r10.z = r9.w * r9.w;
    r10.z = r10.z * r10.z;
    r9.w = r10.z * r9.w;
    r24.xyz = r18.xyz * r9.www + r3.xyz;
    r25.xyz = float3(1,1,1) + -r24.xyz;
    r26.xyz = r25.xyz * r6.www;
    r24.xyz = r25.xyz * r6.www + r24.xyz;
    r24.xyz = float3(1,1,1) + -r24.xyz;
    r25.xyz = r26.xyz * r4.xxx;
    r19.w = -1;
    r19.xyz = r4.zzz ? r24.yzx : r19.xyw;
    r20.xyz = r4.zzz ? r25.xyz : r20.xyz;
    r23.xyz = r4.zzz ? r23.xyz : litCol[1].xyz;
    r21.yzw = litDir[1].xyz;
    r21.xyzw = r4.zzzz ? r22.xyzw : r21.xyzw;
    r21.yzw = r8.xyz * r5.www + -r21.yzw;
    r4.z = dot(r21.yzw, r21.yzw);
    r4.z = rsqrt(r4.z);
    r21.yzw = r21.yzw * r4.zzz;
    r4.z = dot(r9.xyz, r21.yzw);
    r9.w = cmp(r19.z >= 0);
    r10.z = saturate(r4.z);
    r10.z = 1 + -r10.z;
    r13.w = r10.z * r10.z;
    r13.w = r13.w * r13.w;
    r10.z = r13.w * r10.z;
    r22.xyz = r18.xyz * r10.zzz + r3.xyz;
    r22.xyz = r9.www ? r19.zxy : r22.xyz;
    r10.z = dot(r1.xyz, r21.yzw);
    r10.z = r10.z * r10.z;
    r10.z = r10.z * r11.w + 1;
    r10.z = max(9.99999975e-005, r10.z);
    r10.z = r10.z * r10.z;
    r10.z = 4 * r10.z;
    r10.z = r10.w / r10.z;
    r4.z = r4.z * r3.w + r12.w;
    r4.z = r4.z * r4.z;
    r4.z = 1 / r4.z;
    r4.z = r10.z * r4.z;
    r21.yzw = r22.xyz * r4.zzz;
    r21.yzw = r21.yzw * r23.xyz;
    r21.x = saturate(r21.x);
    r4.z = r21.x * r5.y;
    r15.yzw = r21.yzw * r4.zzz + r15.yzw;
    r21.xyz = r23.xyz * r21.xxx;
    r22.xyz = r9.www ? r20.xyz : r17.xyz;
    r21.xyz = r22.xyz * r21.xyz;
    r16.xyz = r21.xyz * r2.www + r16.xyz;
    r4.z = cmp(1 < nDirLit);
    if (r4.z != 0) {
      r21.x = dot(r1.xyz, -litDir[2].xyz);
      r4.z = cmp(r21.x < 0);
      r4.z = r8.w ? r4.z : 0;
      r9.w = r21.x + r21.x;
      r22.yzw = r1.xyz * r9.www + litDir[2].xyz;
      r22.x = -r21.x;
      r23.xyz = litCol[2].xyz * r12.xyz;
      r24.xyz = r8.xyz * r5.www + -r22.yzw;
      r9.w = dot(r24.xyz, r24.xyz);
      r9.w = rsqrt(r9.w);
      r24.xyz = r24.xyz * r9.www;
      r9.w = saturate(dot(r9.xyz, r24.xyz));
      r9.w = 1 + -r9.w;
      r10.z = r9.w * r9.w;
      r10.z = r10.z * r10.z;
      r9.w = r10.z * r9.w;
      r24.xyz = r18.xyz * r9.www + r3.xyz;
      r25.xyz = float3(1,1,1) + -r24.xyz;
      r26.xyz = r25.xyz * r6.www;
      r24.xyz = r25.xyz * r6.www + r24.xyz;
      r24.xyz = float3(1,1,1) + -r24.xyz;
      r25.xyz = r26.xyz * r4.xxx;
      r19.w = -1;
      r19.xyz = r4.zzz ? r24.yzx : r19.xyw;
      r20.xyz = r4.zzz ? r25.xyz : r20.xyz;
      r23.xyz = r4.zzz ? r23.xyz : litCol[2].xyz;
      r21.yzw = litDir[2].xyz;
      r21.xyzw = r4.zzzz ? r22.xyzw : r21.xyzw;
      r21.yzw = r8.xyz * r5.www + -r21.yzw;
      r4.z = dot(r21.yzw, r21.yzw);
      r4.z = rsqrt(r4.z);
      r21.yzw = r21.yzw * r4.zzz;
      r4.z = dot(r9.xyz, r21.yzw);
      r9.w = cmp(r19.z >= 0);
      r10.z = saturate(r4.z);
      r10.z = 1 + -r10.z;
      r13.w = r10.z * r10.z;
      r13.w = r13.w * r13.w;
      r10.z = r13.w * r10.z;
      r22.xyz = r18.xyz * r10.zzz + r3.xyz;
      r22.xyz = r9.www ? r19.zxy : r22.xyz;
      r10.z = dot(r1.xyz, r21.yzw);
      r10.z = r10.z * r10.z;
      r10.z = r10.z * r11.w + 1;
      r10.z = max(9.99999975e-005, r10.z);
      r10.z = r10.z * r10.z;
      r10.z = 4 * r10.z;
      r10.z = r10.w / r10.z;
      r4.z = r4.z * r3.w + r12.w;
      r4.z = r4.z * r4.z;
      r4.z = 1 / r4.z;
      r4.z = r10.z * r4.z;
      r21.yzw = r22.xyz * r4.zzz;
      r21.yzw = r21.yzw * r23.xyz;
      r21.x = saturate(r21.x);
      r4.z = r21.x * r5.y;
      r15.yzw = r21.yzw * r4.zzz + r15.yzw;
      r21.xyz = r23.xyz * r21.xxx;
      r22.xyz = r9.www ? r20.xyz : r17.xyz;
      r21.xyz = r22.xyz * r21.xyz;
      r16.xyz = r21.xyz * r2.www + r16.xyz;
      r4.z = cmp(2 < nDirLit);
      if (r4.z != 0) {
        r21.x = dot(r1.xyz, -litDir[3].xyz);
        r4.z = cmp(r21.x < 0);
        r4.z = r8.w ? r4.z : 0;
        r9.w = r21.x + r21.x;
        r22.yzw = r1.xyz * r9.www + litDir[3].xyz;
        r22.x = -r21.x;
        r23.xyz = litCol[3].xyz * r12.xyz;
        r24.xyz = r8.xyz * r5.www + -r22.yzw;
        r9.w = dot(r24.xyz, r24.xyz);
        r9.w = rsqrt(r9.w);
        r24.xyz = r24.xyz * r9.www;
        r9.w = saturate(dot(r9.xyz, r24.xyz));
        r9.w = 1 + -r9.w;
        r10.z = r9.w * r9.w;
        r10.z = r10.z * r10.z;
        r9.w = r10.z * r9.w;
        r24.xyz = r18.xyz * r9.www + r3.xyz;
        r25.xyz = float3(1,1,1) + -r24.xyz;
        r26.xyz = r25.xyz * r6.www;
        r24.xyz = r25.xyz * r6.www + r24.xyz;
        r24.xyz = float3(1,1,1) + -r24.xyz;
        r25.xyz = r26.xyz * r4.xxx;
        r19.w = -1;
        r19.xyz = r4.zzz ? r24.yzx : r19.xyw;
        r20.xyz = r4.zzz ? r25.xyz : r20.xyz;
        r23.xyz = r4.zzz ? r23.xyz : litCol[3].xyz;
        r21.yzw = litDir[3].xyz;
        r21.xyzw = r4.zzzz ? r22.xyzw : r21.xyzw;
        r21.yzw = r8.xyz * r5.www + -r21.yzw;
        r4.z = dot(r21.yzw, r21.yzw);
        r4.z = rsqrt(r4.z);
        r21.yzw = r21.yzw * r4.zzz;
        r4.z = dot(r9.xyz, r21.yzw);
        r9.w = cmp(r19.z >= 0);
        r10.z = saturate(r4.z);
        r10.z = 1 + -r10.z;
        r13.w = r10.z * r10.z;
        r13.w = r13.w * r13.w;
        r10.z = r13.w * r10.z;
        r22.xyz = r18.xyz * r10.zzz + r3.xyz;
        r22.xyz = r9.www ? r19.zxy : r22.xyz;
        r10.z = dot(r1.xyz, r21.yzw);
        r10.z = r10.z * r10.z;
        r10.z = r10.z * r11.w + 1;
        r10.z = max(9.99999975e-005, r10.z);
        r10.z = r10.z * r10.z;
        r10.z = 4 * r10.z;
        r10.z = r10.w / r10.z;
        r4.z = r4.z * r3.w + r12.w;
        r4.z = r4.z * r4.z;
        r4.z = 1 / r4.z;
        r4.z = r10.z * r4.z;
        r21.yzw = r22.xyz * r4.zzz;
        r21.yzw = r21.yzw * r23.xyz;
        r21.x = saturate(r21.x);
        r4.z = r21.x * r5.y;
        r15.yzw = r21.yzw * r4.zzz + r15.yzw;
        r21.xyz = r23.xyz * r21.xxx;
        r22.xyz = r9.www ? r20.xyz : r17.xyz;
        r21.xyz = r22.xyz * r21.xyz;
        r16.xyz = r21.xyz * r2.www + r16.xyz;
      }
    }
  }
  r4.z = r4.w * vClstZPrm.x + vClstZPrm.y;
  r4.w = log2(r4.z);
  r4.w = r4.w * vClstZPrm.z + vClstZPrm.w;
  r4.w = max(0, r4.w);
  r4.w = (uint)r4.w;
  r9.w = cmp((uint)r4.w < 16);
  if (r9.w != 0) {
    r9.w = cmp(0 < numLocalShadowParams[0]);
    r21.xz = r0.yz;
    r21.yw = float2(1.40129846e-045,2.80259693e-045);
    r22.xy = r9.ww ? r21.xy : float2(1,0);
    r0.y = cmp((int)r22.y < numLocalShadowParams[0]);
    r22.z = 1;
    r21.xy = r0.yy ? r21.wz : r22.yz;
    r0.z = cmp((int)r21.x < numLocalShadowParams[0]);
    r0.y = r0.z ? r0.y : 0;
    r21.z = r0.y ? r0.w : 1;
    r0.yz = float2(0.015625,0.015625) * v0.xy;
    r0.yz = (uint2)r0.yz;
    r0.z = (int)r0.z * nClstPtch[0];
    r0.z = mad(nClstPtch[1], (int)r4.w, (int)r0.z);
    r0.y = (int)r0.y + (int)r0.z;
    r0.z = -1 / r4.z;
    r0.w = vFadeDist.x + -vFadeDist.y;
    r0.z = -vFadeDist.y + r0.z;
    r0.w = 1 / r0.w;
    r0.z = saturate(r0.z * r0.w);
    r0.w = r0.z * -2 + 3;
    r0.z = r0.z * r0.z;
    r0.z = r0.w * r0.z;
    r0.w = (uint)r0.y << 2;
    r0.w = tCllLightIndices.Load(r0.w).x;
    bitmask.x = ((~(-1 << 30)) << 2) & 0xffffffff;  r23.x = (((uint)r0.y << 2) & bitmask.x) | ((uint)1 & ~bitmask.x);
    bitmask.y = ((~(-1 << 30)) << 2) & 0xffffffff;  r23.y = (((uint)r0.y << 2) & bitmask.y) | ((uint)2 & ~bitmask.y);
    bitmask.z = ((~(-1 << 30)) << 2) & 0xffffffff;  r23.z = (((uint)r0.y << 2) & bitmask.z) | ((uint)3 & ~bitmask.z);
    r0.y = tCllLightIndices.Load(r23.x).x;
    r0.y = (uint)r0.y << 16;
    r0.y = (int)r0.y | (int)r0.w;
    r0.w = tCllLightIndices.Load(r23.y).x;
    r4.z = tCllLightIndices.Load(r23.z).x;
    r21.xw = r22.xz;
    r22.x = 1;
    r23.x = -1;
    r24.xyz = r16.xyz;
    r25.xyz = r20.xyz;
    r26.xyz = r15.yzw;
    r27.xy = r19.xy;
    r4.w = vSplsNumSS.x;
    r9.w = numLocalShadowParams[0];
    r10.z = 0;
    while (true) {
      r13.w = cmp((uint)r10.z >= (uint)r0.w);
      if (r13.w != 0) break;
      r13.w = (int)r0.y + (int)r10.z;
      r13.w = tCllLightIndices.Load(r13.w).x;
      r28.xyzw = tCllLightPositions.Load(r13.w).xyzw;
      r16.w = r28.w * r28.w;
      r28.xyz = r28.xyz + -r7.xyz;
      r22.z = dot(r28.xyz, r28.xyz);
      r17.w = r22.z / r16.w;
      r18.w = saturate(r17.w * -16 + 16);
      r19.z = cmp(0 < r18.w);
      if (r19.z != 0) {
        r19.z = (int)r13.w * 3;
        r29.xyz = tCllLightAttributes.Load(r19.z).xyz;
        r29.xyz = r29.xyz * r0.zzz;
        r19.w = cmp((uint)r13.w < (uint)r4.w);
        if (r19.w != 0) {
          r19.w = cmp((uint)r13.w < (uint)r9.w);
          if (r19.w != 0) {
            r20.w = dot(r21.xyzw, icb[r13.w+0].xyzw);
          }
          if (r19.w == 0) {
            r19.w = (uint)r13.w << 1;
            bitmask.w = ((~(-1 << 31)) << 1) & 0xffffffff;  r22.w = (((uint)r13.w << 1) & bitmask.w) | ((uint)1 & ~bitmask.w);
            r30.xyz = vSubCbW2S[r19.w].xyz + r7.xyz;
            r30.xyw = vSubCbW2S[r19.w].www * r30.xyz;
            r30.z = -r30.w;
            r19.w = dot(r30.xyz, r30.xyz);
            r19.w = sqrt(r19.w);
            r19.w = saturate(vSubCbW2S[r22.w].x + r19.w);
            r30.w = (uint)r13.w;
            r20.w = sSplShadow.SampleCmpLevelZero(__smpsSplShadow_s, r30.xyzw, r19.w).x;
          }
          r19.w = cmp(r20.w != 0.000000);
          r22.w = ~(int)r19.w;
          r30.xyz = r29.xyz * r20.www;
          r29.xyz = r19.www ? r30.xyz : r29.xyz;
        } else {
          r22.w = 0;
        }
        if (r22.w == 0) {
          r19.w = mad(3, (int)r13.w, 1);
          r30.xyz = tCllLightAttributes.Load(r19.w).xyz;
          r19.w = cmp((uint)r13.w >= (uint)r4.w);
          r20.w = r19.w ? 1.000000 : 0;
          r19.z = tCllLightExAttributes.Load(r19.z).x;
          r22.w = rsqrt(r22.z);
          r31.xyz = -r28.xyz * r22.www;
          r23.w = cmp((int)r19.z == 3);
          if (r23.w != 0) {
            r13.w = mad(3, (int)r13.w, 2);
            r23.w = tCllLightExAttributes.Load(r13.w).x;
            r32.xyz = tCllLightAttributes.Load(r13.w).xyz;
            r13.w = dot(-r28.xyz, -r28.xyz);
            r13.w = rsqrt(r13.w);
            r28.xyz = -r28.xyz * r13.www;
            r13.w = dot(r28.xyz, r32.xyz);
            r33.x = r13.w * -0.5 + 0.5;
            r24.w = dot(r28.xyz, r30.xyz);
            r13.w = -r13.w * r13.w + 1;
            r13.w = rsqrt(r13.w);
            r13.w = r24.w * r13.w;
            r34.xyz = r32.yzx * r30.zxy;
            r32.xyz = r30.yzx * r32.zxy + -r34.xyz;
            r24.w = dot(r32.xyz, r28.xyz);
            r24.w = cmp(r24.w >= 0);
            r28.xy = r13.ww * float2(-0.25,0.25) + float2(0.25,0.75);
            r33.y = r24.w ? r28.x : r28.y;
            r33.z = (uint)r23.w;
            r13.w = sIES.SampleLevel(__smpsIES_s, r33.xyz, 0).x;
            r13.w = r13.w * r16.w;
            r13.w = r13.w / r22.z;
            r16.w = 1 + -r17.w;
            r16.w = max(0, r16.w);
            r13.w = r16.w * r13.w;
          } else {
            r16.w = cmp((int)r19.z == 2);
            r17.w = r30.x * -r22.z;
            r17.w = 1.44269502 * r17.w;
            r17.w = exp2(r17.w);
            r17.w = saturate(r30.y * r17.w);
            r22.y = r22.z * r22.w;
            r19.z = dot(r30.xyz, r22.xyz);
            r19.z = 1 / r19.z;
            r13.w = r16.w ? r17.w : r19.z;
          }
          r13.w = r13.w * r18.w;
          r22.yzw = r13.www * r29.xyz;
          r13.w = dot(r1.xyz, -r31.xyz);
          r16.w = cmp(r13.w < 0);
          r16.w = r8.w ? r16.w : 0;
          if (r16.w != 0) {
            r16.w = r13.w + r13.w;
            r31.xyz = r1.xyz * r16.www + r31.xyz;
            r22.yzw = r22.yzw * r12.xyz;
            r28.xyz = r8.xyz * r5.www + -r31.xyz;
            r16.w = dot(r28.xyz, r28.xyz);
            r16.w = rsqrt(r16.w);
            r28.xyz = r28.xyz * r16.www;
            r16.w = saturate(dot(r9.xyz, r28.xyz));
            r16.w = 1 + -r16.w;
            r17.w = r16.w * r16.w;
            r17.w = r17.w * r17.w;
            r16.w = r17.w * r16.w;
            r28.xyz = r18.xyz * r16.www + r3.xyz;
            r29.xyz = float3(1,1,1) + -r28.xyz;
            r30.xyz = r29.xyz * r6.www;
            r28.xyz = r29.xyz * r6.www + r28.xyz;
            r27.xyz = float3(1,1,1) + -r28.yzx;
            r25.xyz = r30.xyz * r4.xxx;
            r13.w = -r13.w;
          } else {
            r23.yz = r27.xy;
            r27.xyz = r23.yzx;
          }
          r23.yzw = r8.xyz * r5.www + -r31.xyz;
          r16.w = dot(r23.yzw, r23.yzw);
          r16.w = rsqrt(r16.w);
          r23.yzw = r23.yzw * r16.www;
          r16.w = dot(r9.xyz, r23.yzw);
          r17.w = cmp(r27.z >= 0);
          r18.w = saturate(r16.w);
          r18.w = 1 + -r18.w;
          r19.z = r18.w * r18.w;
          r19.z = r19.z * r19.z;
          r18.w = r19.z * r18.w;
          r28.xyz = r18.xyz * r18.www + r3.xyz;
          r28.xyz = r17.www ? r27.zxy : r28.xyz;
          r18.w = dot(r1.xyz, r23.yzw);
          r18.w = r18.w * r18.w;
          r18.w = r18.w * r11.w + 1;
          r18.w = max(9.99999975e-005, r18.w);
          r18.w = r18.w * r18.w;
          r18.w = 4 * r18.w;
          r18.w = r10.w / r18.w;
          r16.w = r16.w * r3.w + r12.w;
          r16.w = r16.w * r16.w;
          r16.w = 1 / r16.w;
          r16.w = r18.w * r16.w;
          r23.yzw = r28.xyz * r16.www;
          r23.yzw = r23.yzw * r22.yzw;
          r13.w = saturate(r13.w);
          r16.w = r19.w ? 0 : 1;
          r18.w = r5.y * r20.w + r16.w;
          r18.w = r18.w * r13.w;
          r26.xyz = r23.yzw * r18.www + r26.xyz;
          r22.yzw = r22.yzw * r13.www;
          r23.yzw = r17.www ? r25.xyz : r17.xyz;
          r22.yzw = r23.yzw * r22.yzw;
          r13.w = r2.w * r20.w + r16.w;
          r24.xyz = r22.yzw * r13.www + r24.xyz;
        }
      }
      r10.z = (int)r10.z + 1;
    }
    r0.y = (int)r0.w + (int)r0.y;
    r19.x = 1;
    r20.x = -1;
    r16.xyz = r24.xyz;
    r21.xyz = r25.xyz;
    r15.yzw = r26.xyz;
    r22.xy = r27.xy;
    r0.w = numLocalShadowParams[1];
    r4.w = vSslsNumSS.x;
    r9.w = 0;
    while (true) {
      r10.z = cmp((uint)r9.w >= (uint)r4.z);
      if (r10.z != 0) break;
      r10.z = (int)r0.y + (int)r9.w;
      r10.z = tCllLightIndices.Load(r10.z).x;
      r13.w = (int)r10.z * 5;
      r23.xyz = tCllSptLightAttributes.Load(r13.w).xyz;
      r13.w = mad(5, (int)r10.z, 4);
      r28.xyz = tCllSptLightAttributes.Load(r13.w).xyz;
      r23.xyz = r23.xyz + -r7.xyz;
      r19.z = dot(r23.xyz, r23.xyz);
      r13.w = r19.z / r28.x;
      r16.w = saturate(r13.w * -16 + 16);
      r17.w = cmp(0 < r16.w);
      if (r17.w != 0) {
        r17.w = mad(5, (int)r10.z, 2);
        r29.xyz = tCllSptLightAttributes.Load(r17.w).xyz;
        r29.xyz = r29.xyz * r0.zzz;
        r17.w = cmp((uint)r10.z < (uint)r4.w);
        if (r17.w != 0) {
          r17.w = cmp((uint)r10.z < (uint)r0.w);
          if (r17.w != 0) {
            r18.w = dot(r14.xyzw, icb[r10.z+0].xyzw);
          }
          if (r17.w == 0) {
            r17.w = (uint)r10.z << 2;
            r30.xyzw = mSubSptW2S[r17.w/4]._m10_m11_m12_m13 * r7.yyyy;
            r30.xyzw = r7.xxxx * mSubSptW2S[r17.w/4]._m00_m01_m02_m03 + r30.xyzw;
            r30.xyzw = r7.zzzz * mSubSptW2S[r17.w/4]._m20_m21_m22_m23 + r30.xyzw;
            r30.xyzw = r7.wwww * mSubSptW2S[r17.w/4]._m30_m31_m32_m33 + r30.xyzw;
			
			r30.x+=stereo.x*(r30.w-stereo.y)*0.5;
			
            r30.xyz = r30.xyz / r30.www;
            r30.w = (uint)r10.z;
            r18.w = sSslShadow.SampleCmpLevelZero(__smpsSslShadow_s, r30.xyw, r30.z).x;
          }
          r17.w = cmp(r18.w != 0.000000);
          r19.w = ~(int)r17.w;
          r30.xyz = r29.xyz * r18.www;
          r29.xyz = r17.www ? r30.xyz : r29.xyz;
        } else {
          r19.w = 0;
        }
        if (r19.w == 0) {
          r27.zw = mad(int2(5,5), (int2)r10.zz, int2(1,3));
          r30.xyz = tCllSptLightAttributes.Load(r27.z).xyz;
          r31.xyz = tCllSptLightAttributes.Load(r27.w).xyz;
          r17.w = cmp((uint)r10.z >= (uint)r4.w);
          r18.w = r17.w ? 1.000000 : 0;
          r19.w = (int)r10.z * 3;
          r19.w = tCllSptLightExAttributes.Load(r19.w).x;
          r20.w = rsqrt(r19.z);
          r32.xyz = -r23.xyz * r20.www;
          r21.w = dot(-r32.xyz, r30.xyz);
          r21.w = saturate(r21.w * r28.z + r28.y);
          r22.w = cmp((int)r19.w == 3);
          if (r22.w != 0) {
            r10.z = mad(3, (int)r10.z, 2);
            r10.z = tCllSptLightExAttributes.Load(r10.z).x;
            r22.w = dot(-r23.xyz, -r23.xyz);
            r22.w = rsqrt(r22.w);
            r23.xyz = -r23.xyz * r22.www;
            r22.w = dot(r23.xyz, r30.xyz);
            r33.x = r22.w * -0.5 + 0.5;
            r23.w = dot(r23.xyz, r31.xyz);
            r22.w = -r22.w * r22.w + 1;
            r22.w = rsqrt(r22.w);
            r22.w = r23.w * r22.w;
            r28.yzw = r31.zxy * r30.yzx;
            r28.yzw = r31.yzx * r30.zxy + -r28.yzw;
            r23.x = dot(r28.yzw, r23.xyz);
            r23.x = cmp(r23.x >= 0);
            r23.yz = r22.ww * float2(-0.25,0.25) + float2(0.25,0.75);
            r33.y = r23.x ? r23.y : r23.z;
            r33.z = (uint)r10.z;
            r10.z = sIES.SampleLevel(__smpsIES_s, r33.xyz, 0).x;
            r10.z = r10.z * r28.x;
            r10.z = r10.z / r19.z;
            r13.w = saturate(1 + -r13.w);
            r10.z = r13.w * r10.z;
            r10.z = r10.z * r21.w;
          } else {
            r13.w = cmp((int)r19.w == 2);
            r19.w = r31.x * -r19.z;
            r19.w = 1.44269502 * r19.w;
            r19.w = exp2(r19.w);
            r19.w = saturate(r31.y * r19.w);
            r19.w = r21.w * r19.w;
            r19.y = r20.w * r19.z;
            r19.y = dot(r19.xyz, r31.xyz);
            r19.y = r21.w / r19.y;
            r10.z = r13.w ? r19.w : r19.y;
          }
          r10.z = r10.z * r16.w;
          r19.yzw = r10.zzz * r29.xyz;
          r10.z = dot(r1.xyz, -r32.xyz);
          r13.w = cmp(r10.z < 0);
          r13.w = r8.w ? r13.w : 0;
          if (r13.w != 0) {
            r13.w = r10.z + r10.z;
            r32.xyz = r1.xyz * r13.www + r32.xyz;
            r19.yzw = r19.yzw * r12.xyz;
            r23.xyz = r8.xyz * r5.www + -r32.xyz;
            r13.w = dot(r23.xyz, r23.xyz);
            r13.w = rsqrt(r13.w);
            r23.xyz = r23.xyz * r13.www;
            r13.w = saturate(dot(r9.xyz, r23.xyz));
            r13.w = 1 + -r13.w;
            r16.w = r13.w * r13.w;
            r16.w = r16.w * r16.w;
            r13.w = r16.w * r13.w;
            r23.xyz = r18.xyz * r13.www + r3.xyz;
            r28.xyz = float3(1,1,1) + -r23.xyz;
            r29.xyz = r28.xyz * r6.www;
            r23.xyz = r28.xyz * r6.www + r23.xyz;
            r22.xyz = float3(1,1,1) + -r23.yzx;
            r21.xyz = r29.xyz * r4.xxx;
            r10.z = -r10.z;
          } else {
            r20.yz = r22.xy;
            r22.xyz = r20.yzx;
          }
          r20.yzw = r8.xyz * r5.www + -r32.xyz;
          r13.w = dot(r20.yzw, r20.yzw);
          r13.w = rsqrt(r13.w);
          r20.yzw = r20.yzw * r13.www;
          r13.w = dot(r9.xyz, r20.yzw);
          r16.w = cmp(r22.z >= 0);
          r21.w = saturate(r13.w);
          r21.w = 1 + -r21.w;
          r22.w = r21.w * r21.w;
          r22.w = r22.w * r22.w;
          r21.w = r22.w * r21.w;
          r23.xyz = r18.xyz * r21.www + r3.xyz;
          r23.xyz = r16.www ? r22.zxy : r23.xyz;
          r20.y = dot(r1.xyz, r20.yzw);
          r20.y = r20.y * r20.y;
          r20.y = r20.y * r11.w + 1;
          r20.y = max(9.99999975e-005, r20.y);
          r20.y = r20.y * r20.y;
          r20.y = 4 * r20.y;
          r20.y = r10.w / r20.y;
          r13.w = r13.w * r3.w + r12.w;
          r13.w = r13.w * r13.w;
          r13.w = 1 / r13.w;
          r13.w = r20.y * r13.w;
          r20.yzw = r23.xyz * r13.www;
          r20.yzw = r20.yzw * r19.yzw;
          r10.z = saturate(r10.z);
          r13.w = r17.w ? 0 : 1;
          r17.w = r5.y * r18.w + r13.w;
          r17.w = r17.w * r10.z;
          r15.yzw = r20.yzw * r17.www + r15.yzw;
          r19.yzw = r19.yzw * r10.zzz;
          r20.yzw = r16.www ? r21.xyz : r17.xyz;
          r19.yzw = r20.yzw * r19.yzw;
          r10.z = r2.w * r18.w + r13.w;
          r16.xyz = r19.yzw * r10.zzz + r16.xyz;
        }
      }
      r9.w = (int)r9.w + 1;
    }
  }
  r0.y = cmp(fAmbMapsDORate != 0.000000);
  r0.z = saturate(-r1.y);
  r15.x = saturate(r15.x);
  r0.z = r15.x + r0.z;
  r0.z = saturate(fAmbMapsDORate * r0.z);
  r0.x = -1 + r0.x;
  r0.x = r0.z * r0.x + 1;
  r0.x = r0.y ? r0.x : 1;
  r0.yzw = sAmbSpc.SampleLevel(__smpsAmbSpc_s, r1.xyz, 6).xyz;
  r0.xyz = r0.yzw * r0.xxx;
  r0.xyz = vAmbDifScl.xyz * r0.xyz;
  r0.w = 1 + -vAmbDifScl.w;
  r0.w = r2.w * vAmbDifScl.w + r0.w;
  r0.w = -1 + r0.w;
  r0.w = 1 + r0.w;
  r0.xyz = r0.xyz * r0.www;
  r0.xyz = r0.xyz * r17.xyz + r16.xyz;
  r3.w = 1 / r5.x;
  r4.x = dot(r11.xyz, r11.xyz);
  r4.x = rsqrt(r4.x);
  r4.xzw = r11.xyz * r4.xxx;
  r5.x = saturate(dot(r1.xyz, r4.xzw));
  r5.x = -r5.x * r5.x + 1;
  r5.x = sqrt(r5.x);
  r5.w = cmp(r1.y >= 0);
  r8.y = r5.w ? 1 : -1;
  r5.x = r5.x * r3.w + -r5.x;
  r8.xz = float2(0,0);
  r1.xyz = -r8.xyz + r1.xyz;
  r4.xzw = r4.xzw * r3.www;
  r1.xyz = r5.xxx * r1.xyz + -r4.xzw;
  r3.w = dot(r1.xyz, r1.xyz);
  r3.w = rsqrt(r3.w);
  r1.xyz = r3.www * r1.xyz;
  r1.xyz = r1.xyz * r5.zzz;
  r7.xyz = r1.xyz * r4.yyy + r7.xyz;
  r7.w = 1;
  r1.x = dot(r7.xyzw, mRrW2T[0].xyzw);
  r1.y = dot(r7.xyzw, mRrW2T[1].xyzw);
  r1.z = dot(r7.xyzw, mRrW2T[2].xyzw);
  
  r1.x+=stereo.x*(r1.z-stereo.y)*0.5;
  
  r1.xy = r1.xy / r1.zz;
  r1.z = sDepthMap.Sample(__smpsDepthMap_s, r1.xy).x;
  if (r8.w != 0) {
    r3.w = dot(-r11.xyz, vCameraDir.xyz);
    r1.w = 1 + -r1.w;
    r4.x = r1.w * r1.w;
    r4.x = r4.x * r4.x;
    r1.w = r4.x * r1.w;
    r3.xyz = r18.xyz * r1.www + r3.xyz;
    r4.xzw = float3(1,1,1) + -r3.xyz;
    r3.xyz = r4.xzw * r6.www + r3.xyz;
    r3.xyz = float3(1,1,1) + -r3.xyz;
    r4.xzw = r3.xyz * r6.www;
    r1.z = saturate(vD2Z.y * r1.z + vD2Z.x);
    r1.z = 1 / r1.z;
    r1.z = cmp(r1.z < r3.w);
    r1.xy = r1.zz ? r10.xy : r1.xy;
    r5.xzw = sTrnsSpc.SampleLevel(__smpsTrnsSpc_s, r1.xy, 16).xyz;
    r5.xzw = vAmbDifScl.xyz * r5.xzw;
    r5.xzw = r5.xzw * r0.www;
    r4.xzw = r5.xzw * r4.xzw;
    r0.xyz = r4.xzw * r12.xyz + r0.xyz;
    r1.xyz = sTrnsSpc.SampleLevel(__smpsTrnsSpc_s, r1.xy, 0).xyz;
    r1.xyz = vAmbSpcScl.xyz * r1.xyz;
    r0.w = 1 + -vAmbSpcScl.w;
    r0.w = r2.w * vAmbSpcScl.w + r0.w;
    r1.w = 1 + -r0.w;
    r1.w = r5.y * r1.w + r0.w;
    r0.w = r0.w * r1.w + -1;
    r0.w = 1 + r0.w;
    r1.xyz = r1.xyz * r0.www;
    r1.xyz = r1.xyz * r3.xyz;
    r15.yzw = r1.xyz * r12.xyz + r15.yzw;
  }
  r0.xyz = r0.xyz * r2.xyz + r6.xyz;
  r0.xyz = r0.xyz + r15.yzw;
  r0.xyz = r0.xyz + -r13.xyz;
  o0.xyz = r4.yyy * r0.xyz + r13.xyz;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Fri Feb 05 17:44:21 2021
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 litDir[4];                  // Offset:    0 Size:    64
//   float4 litCol[4];                  // Offset:   64 Size:    64
//   int nDirLit;                       // Offset:  128 Size:     4
//   float4 vEye;                       // Offset:  144 Size:    16
//   int3 vSplsNumSS;                   // Offset:  160 Size:    12
//   int numLocalShadowParams[2];       // Offset:  176 Size:    20
//   float4 vSubCbW2S[16];              // Offset:  208 Size:   256
//   int3 vSslsNumSS;                   // Offset:  464 Size:    12
//   row_major float4x4 mSubSptW2S[8];  // Offset:  480 Size:   512
//   float4 vClstZPrm;                  // Offset:  992 Size:    16
//   int nClstPtch[2];                  // Offset: 1008 Size:    20
//   float fClstScl;                    // Offset: 1028 Size:     4 [unused]
//   float2 vFadeDist;                  // Offset: 1032 Size:     8
//   float3 vCameraPos;                 // Offset: 1040 Size:    12
//   float3 vCameraDir;                 // Offset: 1056 Size:    12
//   float2 vD2Z;                       // Offset: 1072 Size:     8
//   float4 mRrW2T[3];                  // Offset: 1088 Size:    48
//   row_major float4x4 mV2W;           // Offset: 1136 Size:    64
//   row_major float4x4 mP2W;           // Offset: 1200 Size:    64
//   float fAmbMapsDORate;              // Offset: 1264 Size:     4
//      = 0x00000000
//   float4 vAmbDifScl;                 // Offset: 1280 Size:    16
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//   float4 vAmbSpcScl;                 // Offset: 1296 Size:    16
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __smpsIES                         sampler      NA          NA    0        1
// __smpsDepthMap                    sampler      NA          NA    1        1
// __smpsSplShadow                 sampler_c      NA          NA    2        1
// __smpsSslShadow                 sampler_c      NA          NA    3        1
// __smpsAmbSpc                      sampler      NA          NA    5        1
// __smpsTrnsSpc                     sampler      NA          NA    6        1
// sIES                              texture  float4     2darray    0        1
// sDepthMap                         texture  float4          2d    1        1
// sSplShadow                        texture  float4   cubearray    2        1
// sSslShadow                        texture  float4     2darray    3        1
// sShadowBuffer                     texture  float4          2d    4        1
// sAmbSpc                           texture  float4        cube    5        1
// sTrnsSpc                          texture  float4          2d    6        1
// sDepth                            texture  float4          2d    7        1
// sGBuf0                            texture  float4          2d    8        1
// sGBuf1                            texture  float4          2d    9        1
// sGBuf2                            texture  float4          2d   10        1
// sGBuf3                            texture  float4          2d   11        1
// sGBuf4                            texture  float4          2d   12        1
// sGBuf5                            texture  float4          2d   13        1
// tCllLightIndices                  texture    uint         buf   16        1
// tCllLightPositions                texture  float4         buf   17        1
// tCllLightAttributes               texture  float3         buf   18        1
// tCllLightExAttributes             texture    uint         buf   19        1
// tCllSptLightAttributes            texture  float3         buf   20        1
// tCllSptLightExAttributes          texture    uint         buf   21        1
// tMaterialTable                    texture    uint         buf   30        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xyzw        1     NONE   float   xy w
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_immediateConstantBuffer { { 1.000000, 0, 0, 0},
                              { 0, 1.000000, 0, 0},
                              { 0, 0, 1.000000, 0},
                              { 0, 0, 0, 1.000000} }
dcl_constantbuffer cb0[82], dynamicIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_comparison
dcl_sampler s3, mode_comparison
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_resource_texture2darray (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texturecubearray (float,float,float,float) t2
dcl_resource_texture2darray (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texturecube (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_buffer (uint,uint,uint,uint) t16
dcl_resource_buffer (float,float,float,float) t17
dcl_resource_buffer (float,float,float,float) t18
dcl_resource_buffer (uint,uint,uint,uint) t19
dcl_resource_buffer (float,float,float,float) t20
dcl_resource_buffer (uint,uint,uint,uint) t21
dcl_resource_buffer (uint,uint,uint,uint) t30
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyw
dcl_output o0.xyzw
dcl_temps 35
ftoi r0.xy, v0.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.xyww, t9.xyzw
mul r1.xyz, r1.zxyz, l(255.000000, 0.996337, 0.996337, 0.000000)
mad r1.w, r1.w, l(255.000000), l(0.500000)
ftoi r1.w, r1.w
ld_indexable(buffer)(uint,uint,uint,uint) r1.w, r1.wwww, t30.yzwx
ld_indexable(texture2d)(float,float,float,float) r2.xyzw, r0.xyww, t8.xyzw
ld_indexable(texture2d)(float,float,float,float) r3.xyzw, r0.xyww, t10.xyzw
ld_indexable(texture2d)(float,float,float,float) r4.xyz, r0.xyww, t11.xywz
ld_indexable(texture2d)(float,float,float,float) r5.xyz, r0.xyww, t12.xyzw
ld_indexable(texture2d)(float,float,float,float) r6.xyz, r0.xyww, t13.xyzw
ld_indexable(texture2d)(float,float,float,float) r4.w, r0.xyww, t7.yzwx
mul r7.xyzw, v1.yyyy, cb0[76].xyzw
mad r7.xyzw, v1.xxxx, cb0[75].xyzw, r7.xyzw
mad r7.xyzw, r4.wwww, cb0[77].xyzw, r7.xyzw
add r7.xyzw, r7.xyzw, cb0[78].xyzw
div r7.xyzw, r7.xyzw, r7.wwww
add r8.xyz, -r7.xyzx, cb0[9].xyzx
dp3 r5.w, r8.xyzx, r8.xyzx
rsq r5.w, r5.w
mul r9.xyz, r5.wwww, r8.xyzx
add r3.w, r3.w, r3.w
ftou r1.x, r1.x
and r6.w, r1.x, l(15)
utof r6.w, r6.w
mad r10.x, r6.w, l(0.000244200259), r1.y
ushr r1.x, r1.x, l(4)
utof r1.x, r1.x
mad r10.y, r1.x, l(0.000244200259), r1.z
mad r1.xy, r10.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r10.xyz, -|r1.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
add r11.z, -|r1.y|, r10.x
ge r1.z, r11.z, l(0.000000)
ge r10.xw, r1.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r10.xw, r10.xxxw, l(1.000000,0,0,1.000000), l(-1.000000,0,0,-1.000000)
mul r10.xy, r10.xwxx, r10.yzyy
movc r11.xy, r1.zzzz, r1.xyxx, r10.xyxx
dp3 r1.x, r11.xyzx, r11.xyzx
rsq r1.x, r1.x
mul r1.xyz, r1.xxxx, r11.xyzx
mul r10.xyz, r1.yyyy, cb0[72].xyzx
mad r10.xyz, r1.xxxx, cb0[71].xyzx, r10.xyzx
mad r1.xyz, r1.zzzz, cb0[73].xyzx, r10.xyzx
add r6.w, r4.x, l(1.000000)
and r1.w, r1.w, l(1)
movc r6.xyz, r1.wwww, r6.xyzx, l(0,0,0,0)
div r10.xy, v1.xyxx, v1.wwww
mad r10.xy, r10.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r11.xyz, -r7.xyzx, cb0[65].xyzx
max r12.xyz, r2.xyzx, l(0.000100, 0.000100, 0.000100, 0.000000)
min r12.xyz, r12.xyzx, l(0.999900, 0.999900, 0.999900, 0.000000)
log r12.xyz, r12.xyzx
mul r12.xyz, r12.xyzx, l(0.693147182, 0.693147182, 0.693147182, 0.000000)
max r10.zw, r5.yyyz, l(0.000000, 0.000000, 0.000100, 0.000000)
div r12.xyz, -r12.xyzx, r10.zzzz
mul r12.xyz, r10.wwww, -r12.xyzx
mul r12.xyz, r12.xyzx, l(1.442695, 1.442695, 1.442695, 0.000000)
exp r12.xyz, r12.xyzx
sample_l_indexable(texture2d)(float,float,float,float) r13.xyz, r10.xyxx, t6.xyzw, s6, l(0.000000)
ld_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xyzw, t4.xyzw
ilt r1.w, l(0), cb0[12].x
if_nz r1.w
  iadd r1.w, cb0[11].x, l(1)
  dp4 r14.x, r0.xyzw, icb[r1.w + 0].xyzw
  mov r1.w, l(1)
else
  mov r14.x, l(1.000000)
  mov r1.w, l(0)
endif
ilt r5.y, r1.w, cb0[12].x
if_nz r5.y
  iadd r8.w, cb0[11].x, l(2)
  dp4 r14.y, r0.xyzw, icb[r8.w + 0].xyzw
  mov r1.w, l(2)
else
  mov r14.y, l(1.000000)
endif
ilt r8.w, r1.w, cb0[12].x
and r5.y, r5.y, r8.w
if_nz r5.y
  iadd r8.w, cb0[11].x, l(3)
  dp4 r14.z, r0.xyzw, icb[r8.w + 0].xyzw
  mov r1.w, l(3)
else
  mov r14.z, l(1.000000)
endif
ilt r1.w, r1.w, cb0[12].x
and r1.w, r1.w, r5.y
if_nz r1.w
  iadd r1.w, cb0[11].x, l(4)
  dp4 r14.w, r0.xyzw, icb[r1.w + 0].xyzw
else
  mov r14.w, l(1.000000)
endif
dp3_sat r1.w, r1.xyzx, r9.xyzx
add r5.y, r2.w, r1.w
mad r5.y, r5.y, r5.y, r2.w
add_sat r5.y, r5.y, l(-1.000000)
min r0.x, r4.z, r0.x
dp3 r15.x, r1.xyzx, -cb0[0].xyzx
lt r4.z, r15.x, l(0.000000)
lt r8.w, l(1.000000), r6.w
and r4.z, r4.z, r8.w
add r9.w, r15.x, r15.x
mad r16.yzw, r1.xxyz, r9.wwww, cb0[0].xxyz
mov r16.x, -r15.x
mul r17.xyz, r12.xyzx, cb0[4].xyzx
mad r18.xyz, r8.xyzx, r5.wwww, -r16.yzwy
dp3 r9.w, r18.xyzx, r18.xyzx
rsq r9.w, r9.w
mul r18.xyz, r9.wwww, r18.xyzx
dp3_sat r9.w, r9.xyzx, r18.xyzx
add r18.xyz, -r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
add r9.w, -r9.w, l(1.000000)
mul r10.z, r9.w, r9.w
mul r10.z, r10.z, r10.z
mul r9.w, r9.w, r10.z
mad r19.xyz, r18.xyzx, r9.wwww, r3.xyzx
add r20.xyz, -r19.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
add r6.w, -r6.w, l(2.000000)
mul r21.xyz, r6.wwww, r20.xyzx
mad r19.xyz, r20.xyzx, r6.wwww, r19.xyzx
add r19.xyz, -r19.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r20.xyz, r4.xxxx, r21.xyzx
movc r19.xyz, r4.zzzz, r19.yzxy, l(-1.000000,-1.000000,-1.000000,0)
movc r20.xyz, r4.zzzz, r20.xyzx, l(-1.000000,-1.000000,-1.000000,0)
movc r17.xyz, r4.zzzz, r17.xyzx, cb0[4].xyzx
mov r15.yzw, cb0[0].xxyz
movc r16.xyzw, r4.zzzz, r16.xyzw, r15.xyzw
mad r15.yzw, r8.xxyz, r5.wwww, -r16.yyzw
dp3 r4.z, r15.yzwy, r15.yzwy
rsq r4.z, r4.z
mul r15.yzw, r4.zzzz, r15.yyzw
dp3 r4.z, r9.xyzx, r15.yzwy
ge r9.w, r19.z, l(0.000000)
mov_sat r10.z, r4.z
add r10.z, -r10.z, l(1.000000)
mul r10.w, r10.z, r10.z
mul r10.w, r10.w, r10.w
mul r10.z, r10.w, r10.z
mad r16.yzw, r18.xxyz, r10.zzzz, r3.xxyz
movc r16.yzw, r9.wwww, r19.zzxy, r16.yyzw
mul r3.w, r3.w, r3.w
mul r3.w, r3.w, r3.w
dp3 r10.z, r1.xyzx, r15.yzwy
mul r10.w, r3.w, r3.w
mul r10.z, r10.z, r10.z
mad r11.w, r3.w, r3.w, l(-1.000000)
mad r10.z, r10.z, r11.w, l(1.000000)
max r10.z, r10.z, l(0.000100)
mul r10.z, r10.z, r10.z
mul r10.z, r10.z, l(4.000000)
div r10.z, r10.w, r10.z
mul r12.w, r3.w, l(0.500000)
mad r3.w, -r3.w, l(0.500000), l(1.000000)
mad r4.z, r4.z, r3.w, r12.w
mul r4.z, r4.z, r4.z
div r4.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.z
mul r4.z, r4.z, r10.z
mul r15.yzw, r4.zzzz, r16.yyzw
mul r15.yzw, r17.xxyz, r15.yyzw
mov_sat r16.x, r16.x
mul r4.z, r5.y, r16.x
mul r15.yzw, r4.zzzz, r15.yyzw
mul r16.xyz, r16.xxxx, r17.xyzx
mul r17.xyz, r6.wwww, r18.xyzx
movc r21.xyz, r9.wwww, r20.xyzx, r17.xyzx
mul r16.xyz, r16.xyzx, r21.xyzx
mul r16.xyz, r2.wwww, r16.xyzx
ilt r4.z, l(0), cb0[8].x
if_nz r4.z
  dp3 r21.x, r1.xyzx, -cb0[1].xyzx
  lt r4.z, r21.x, l(0.000000)
  and r4.z, r8.w, r4.z
  add r9.w, r21.x, r21.x
  mad r22.yzw, r1.xxyz, r9.wwww, cb0[1].xxyz
  mov r22.x, -r21.x
  mul r23.xyz, r12.xyzx, cb0[5].xyzx
  mad r24.xyz, r8.xyzx, r5.wwww, -r22.yzwy
  dp3 r9.w, r24.xyzx, r24.xyzx
  rsq r9.w, r9.w
  mul r24.xyz, r9.wwww, r24.xyzx
  dp3_sat r9.w, r9.xyzx, r24.xyzx
  add r9.w, -r9.w, l(1.000000)
  mul r10.z, r9.w, r9.w
  mul r10.z, r10.z, r10.z
  mul r9.w, r9.w, r10.z
  mad r24.xyz, r18.xyzx, r9.wwww, r3.xyzx
  add r25.xyz, -r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r26.xyz, r6.wwww, r25.xyzx
  mad r24.xyz, r25.xyzx, r6.wwww, r24.xyzx
  add r24.xyz, -r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r25.xyz, r4.xxxx, r26.xyzx
  mov r19.w, l(-1.000000)
  movc r19.xyz, r4.zzzz, r24.yzxy, r19.xywx
  movc r20.xyz, r4.zzzz, r25.xyzx, r20.xyzx
  movc r23.xyz, r4.zzzz, r23.xyzx, cb0[5].xyzx
  mov r21.yzw, cb0[1].xxyz
  movc r21.xyzw, r4.zzzz, r22.xyzw, r21.xyzw
  mad r21.yzw, r8.xxyz, r5.wwww, -r21.yyzw
  dp3 r4.z, r21.yzwy, r21.yzwy
  rsq r4.z, r4.z
  mul r21.yzw, r4.zzzz, r21.yyzw
  dp3 r4.z, r9.xyzx, r21.yzwy
  ge r9.w, r19.z, l(0.000000)
  mov_sat r10.z, r4.z
  add r10.z, -r10.z, l(1.000000)
  mul r13.w, r10.z, r10.z
  mul r13.w, r13.w, r13.w
  mul r10.z, r10.z, r13.w
  mad r22.xyz, r18.xyzx, r10.zzzz, r3.xyzx
  movc r22.xyz, r9.wwww, r19.zxyz, r22.xyzx
  dp3 r10.z, r1.xyzx, r21.yzwy
  mul r10.z, r10.z, r10.z
  mad r10.z, r10.z, r11.w, l(1.000000)
  max r10.z, r10.z, l(0.000100)
  mul r10.z, r10.z, r10.z
  mul r10.z, r10.z, l(4.000000)
  div r10.z, r10.w, r10.z
  mad r4.z, r4.z, r3.w, r12.w
  mul r4.z, r4.z, r4.z
  div r4.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.z
  mul r4.z, r4.z, r10.z
  mul r21.yzw, r4.zzzz, r22.xxyz
  mul r21.yzw, r23.xxyz, r21.yyzw
  mov_sat r21.x, r21.x
  mul r4.z, r5.y, r21.x
  mad r15.yzw, r21.yyzw, r4.zzzz, r15.yyzw
  mul r21.xyz, r21.xxxx, r23.xyzx
  movc r22.xyz, r9.wwww, r20.xyzx, r17.xyzx
  mul r21.xyz, r21.xyzx, r22.xyzx
  mad r16.xyz, r21.xyzx, r2.wwww, r16.xyzx
  ilt r4.z, l(1), cb0[8].x
  if_nz r4.z
    dp3 r21.x, r1.xyzx, -cb0[2].xyzx
    lt r4.z, r21.x, l(0.000000)
    and r4.z, r8.w, r4.z
    add r9.w, r21.x, r21.x
    mad r22.yzw, r1.xxyz, r9.wwww, cb0[2].xxyz
    mov r22.x, -r21.x
    mul r23.xyz, r12.xyzx, cb0[6].xyzx
    mad r24.xyz, r8.xyzx, r5.wwww, -r22.yzwy
    dp3 r9.w, r24.xyzx, r24.xyzx
    rsq r9.w, r9.w
    mul r24.xyz, r9.wwww, r24.xyzx
    dp3_sat r9.w, r9.xyzx, r24.xyzx
    add r9.w, -r9.w, l(1.000000)
    mul r10.z, r9.w, r9.w
    mul r10.z, r10.z, r10.z
    mul r9.w, r9.w, r10.z
    mad r24.xyz, r18.xyzx, r9.wwww, r3.xyzx
    add r25.xyz, -r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    mul r26.xyz, r6.wwww, r25.xyzx
    mad r24.xyz, r25.xyzx, r6.wwww, r24.xyzx
    add r24.xyz, -r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    mul r25.xyz, r4.xxxx, r26.xyzx
    mov r19.w, l(-1.000000)
    movc r19.xyz, r4.zzzz, r24.yzxy, r19.xywx
    movc r20.xyz, r4.zzzz, r25.xyzx, r20.xyzx
    movc r23.xyz, r4.zzzz, r23.xyzx, cb0[6].xyzx
    mov r21.yzw, cb0[2].xxyz
    movc r21.xyzw, r4.zzzz, r22.xyzw, r21.xyzw
    mad r21.yzw, r8.xxyz, r5.wwww, -r21.yyzw
    dp3 r4.z, r21.yzwy, r21.yzwy
    rsq r4.z, r4.z
    mul r21.yzw, r4.zzzz, r21.yyzw
    dp3 r4.z, r9.xyzx, r21.yzwy
    ge r9.w, r19.z, l(0.000000)
    mov_sat r10.z, r4.z
    add r10.z, -r10.z, l(1.000000)
    mul r13.w, r10.z, r10.z
    mul r13.w, r13.w, r13.w
    mul r10.z, r10.z, r13.w
    mad r22.xyz, r18.xyzx, r10.zzzz, r3.xyzx
    movc r22.xyz, r9.wwww, r19.zxyz, r22.xyzx
    dp3 r10.z, r1.xyzx, r21.yzwy
    mul r10.z, r10.z, r10.z
    mad r10.z, r10.z, r11.w, l(1.000000)
    max r10.z, r10.z, l(0.000100)
    mul r10.z, r10.z, r10.z
    mul r10.z, r10.z, l(4.000000)
    div r10.z, r10.w, r10.z
    mad r4.z, r4.z, r3.w, r12.w
    mul r4.z, r4.z, r4.z
    div r4.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.z
    mul r4.z, r4.z, r10.z
    mul r21.yzw, r4.zzzz, r22.xxyz
    mul r21.yzw, r23.xxyz, r21.yyzw
    mov_sat r21.x, r21.x
    mul r4.z, r5.y, r21.x
    mad r15.yzw, r21.yyzw, r4.zzzz, r15.yyzw
    mul r21.xyz, r21.xxxx, r23.xyzx
    movc r22.xyz, r9.wwww, r20.xyzx, r17.xyzx
    mul r21.xyz, r21.xyzx, r22.xyzx
    mad r16.xyz, r21.xyzx, r2.wwww, r16.xyzx
    ilt r4.z, l(2), cb0[8].x
    if_nz r4.z
      dp3 r21.x, r1.xyzx, -cb0[3].xyzx
      lt r4.z, r21.x, l(0.000000)
      and r4.z, r8.w, r4.z
      add r9.w, r21.x, r21.x
      mad r22.yzw, r1.xxyz, r9.wwww, cb0[3].xxyz
      mov r22.x, -r21.x
      mul r23.xyz, r12.xyzx, cb0[7].xyzx
      mad r24.xyz, r8.xyzx, r5.wwww, -r22.yzwy
      dp3 r9.w, r24.xyzx, r24.xyzx
      rsq r9.w, r9.w
      mul r24.xyz, r9.wwww, r24.xyzx
      dp3_sat r9.w, r9.xyzx, r24.xyzx
      add r9.w, -r9.w, l(1.000000)
      mul r10.z, r9.w, r9.w
      mul r10.z, r10.z, r10.z
      mul r9.w, r9.w, r10.z
      mad r24.xyz, r18.xyzx, r9.wwww, r3.xyzx
      add r25.xyz, -r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      mul r26.xyz, r6.wwww, r25.xyzx
      mad r24.xyz, r25.xyzx, r6.wwww, r24.xyzx
      add r24.xyz, -r24.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      mul r25.xyz, r4.xxxx, r26.xyzx
      mov r19.w, l(-1.000000)
      movc r19.xyz, r4.zzzz, r24.yzxy, r19.xywx
      movc r20.xyz, r4.zzzz, r25.xyzx, r20.xyzx
      movc r23.xyz, r4.zzzz, r23.xyzx, cb0[7].xyzx
      mov r21.yzw, cb0[3].xxyz
      movc r21.xyzw, r4.zzzz, r22.xyzw, r21.xyzw
      mad r21.yzw, r8.xxyz, r5.wwww, -r21.yyzw
      dp3 r4.z, r21.yzwy, r21.yzwy
      rsq r4.z, r4.z
      mul r21.yzw, r4.zzzz, r21.yyzw
      dp3 r4.z, r9.xyzx, r21.yzwy
      ge r9.w, r19.z, l(0.000000)
      mov_sat r10.z, r4.z
      add r10.z, -r10.z, l(1.000000)
      mul r13.w, r10.z, r10.z
      mul r13.w, r13.w, r13.w
      mul r10.z, r10.z, r13.w
      mad r22.xyz, r18.xyzx, r10.zzzz, r3.xyzx
      movc r22.xyz, r9.wwww, r19.zxyz, r22.xyzx
      dp3 r10.z, r1.xyzx, r21.yzwy
      mul r10.z, r10.z, r10.z
      mad r10.z, r10.z, r11.w, l(1.000000)
      max r10.z, r10.z, l(0.000100)
      mul r10.z, r10.z, r10.z
      mul r10.z, r10.z, l(4.000000)
      div r10.z, r10.w, r10.z
      mad r4.z, r4.z, r3.w, r12.w
      mul r4.z, r4.z, r4.z
      div r4.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.z
      mul r4.z, r4.z, r10.z
      mul r21.yzw, r4.zzzz, r22.xxyz
      mul r21.yzw, r23.xxyz, r21.yyzw
      mov_sat r21.x, r21.x
      mul r4.z, r5.y, r21.x
      mad r15.yzw, r21.yyzw, r4.zzzz, r15.yyzw
      mul r21.xyz, r21.xxxx, r23.xyzx
      movc r22.xyz, r9.wwww, r20.xyzx, r17.xyzx
      mul r21.xyz, r21.xyzx, r22.xyzx
      mad r16.xyz, r21.xyzx, r2.wwww, r16.xyzx
    endif
  endif
endif
mad r4.z, r4.w, cb0[62].x, cb0[62].y
log r4.w, r4.z
mad r4.w, r4.w, cb0[62].z, cb0[62].w
max r4.w, r4.w, l(0.000000)
ftou r4.w, r4.w
ult r9.w, r4.w, l(16)
if_nz r9.w
  ilt r9.w, l(0), cb0[11].x
  mov r21.xz, r0.yyzy
  mov r21.yw, l(0,1,0,2)
  movc r22.xy, r9.wwww, r21.xyxx, l(1.000000,0,0,0)
  ilt r0.y, r22.y, cb0[11].x
  mov r22.z, l(1.000000)
  movc r21.xy, r0.yyyy, r21.wzww, r22.yzyy
  ilt r0.z, r21.x, cb0[11].x
  and r0.y, r0.z, r0.y
  movc r21.z, r0.y, r0.w, l(1.000000)
  mul r0.yz, v0.xxyx, l(0.000000, 0.015625, 0.015625, 0.000000)
  ftou r0.yz, r0.yyzy
  imul null, r0.z, r0.z, cb0[63].x
  imad r0.z, cb0[64].x, r4.w, r0.z
  iadd r0.y, r0.y, r0.z
  div r0.z, l(-1.000000), r4.z
  add r0.w, -cb0[64].w, cb0[64].z
  add r0.z, r0.z, -cb0[64].w
  div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
  mul_sat r0.z, r0.w, r0.z
  mad r0.w, r0.z, l(-2.000000), l(3.000000)
  mul r0.z, r0.z, r0.z
  mul r0.z, r0.z, r0.w
  ishl r0.w, r0.y, l(2)
  ld_indexable(buffer)(uint,uint,uint,uint) r0.w, r0.wwww, t16.yzwx
  bfi r23.xyz, l(30, 30, 30, 0), l(2, 2, 2, 0), r0.yyyy, l(1, 2, 3, 0)
  ld_indexable(buffer)(uint,uint,uint,uint) r0.y, r23.xxxx, t16.yxzw
  ishl r0.y, r0.y, l(16)
  or r0.y, r0.y, r0.w
  ld_indexable(buffer)(uint,uint,uint,uint) r0.w, r23.yyyy, t16.yzwx
  ld_indexable(buffer)(uint,uint,uint,uint) r4.z, r23.zzzz, t16.yzxw
  mov r21.xw, r22.xxxz
  mov r22.x, l(1.000000)
  mov r23.x, l(-1.000000)
  mov r24.xyz, r16.xyzx
  mov r25.xyz, r20.xyzx
  mov r26.xyz, r15.yzwy
  mov r27.xy, r19.xyxx
  mov r4.w, cb0[10].x
  mov r9.w, cb0[11].x
  mov r10.z, l(0)
  loop
    uge r13.w, r10.z, r0.w
    breakc_nz r13.w
    iadd r13.w, r0.y, r10.z
    ld_indexable(buffer)(uint,uint,uint,uint) r13.w, r13.wwww, t16.yzwx
    ld_indexable(buffer)(float,float,float,float) r28.xyzw, r13.wwww, t17.xyzw
    mul r16.w, r28.w, r28.w
    add r28.xyz, -r7.xyzx, r28.xyzx
    dp3 r22.z, r28.xyzx, r28.xyzx
    div r17.w, r22.z, r16.w
    mad_sat r18.w, r17.w, l(-16.000000), l(16.000000)
    lt r19.z, l(0.000000), r18.w
    if_nz r19.z
      imul null, r19.z, r13.w, l(3)
      ld_indexable(buffer)(float,float,float,float) r29.xyz, r19.zzzz, t18.xyzw
      mul r29.xyz, r0.zzzz, r29.xyzx
      ult r19.w, r13.w, r4.w
      if_nz r19.w
        ult r19.w, r13.w, r9.w
        if_nz r19.w
          dp4 r20.w, r21.xyzw, icb[r13.w + 0].xyzw
        endif
        if_z r19.w
          ishl r19.w, r13.w, l(1)
          bfi r22.w, l(31), l(1), r13.w, l(1)
          add r30.xyz, r7.xyzx, cb0[r19.w + 13].xyzx
          mul r30.xyw, r30.xyxz, cb0[r19.w + 13].wwww
          mov r30.z, -r30.w
          dp3 r19.w, r30.xyzx, r30.xyzx
          sqrt r19.w, r19.w
          add_sat r19.w, r19.w, cb0[r22.w + 13].x
          utof r30.w, r13.w
          sample_c_lz_indexable(texturecubearray)(float,float,float,float) r20.w, r30.xyzw, t2.xxxx, s2, r19.w
        endif
        ne r19.w, r20.w, l(0.000000)
        not r22.w, r19.w
        mul r30.xyz, r20.wwww, r29.xyzx
        movc r29.xyz, r19.wwww, r30.xyzx, r29.xyzx
      else
        mov r22.w, l(0)
      endif
      if_z r22.w
        imad r19.w, l(3), r13.w, l(1)
        ld_indexable(buffer)(float,float,float,float) r30.xyz, r19.wwww, t18.xyzw
        uge r19.w, r13.w, r4.w
        and r20.w, r19.w, l(0x3f800000)
        ld_indexable(buffer)(uint,uint,uint,uint) r19.z, r19.zzzz, t19.yzxw
        rsq r22.w, r22.z
        mul r31.xyz, r22.wwww, -r28.xyzx
        ieq r23.w, r19.z, l(3)
        if_nz r23.w
          imad r13.w, l(3), r13.w, l(2)
          ld_indexable(buffer)(uint,uint,uint,uint) r23.w, r13.wwww, t19.yzwx
          ld_indexable(buffer)(float,float,float,float) r32.xyz, r13.wwww, t18.xyzw
          dp3 r13.w, -r28.xyzx, -r28.xyzx
          rsq r13.w, r13.w
          mul r28.xyz, r13.wwww, -r28.xyzx
          dp3 r13.w, r28.xyzx, r32.xyzx
          mad r33.x, r13.w, l(-0.500000), l(0.500000)
          dp3 r24.w, r28.xyzx, r30.xyzx
          mad r13.w, -r13.w, r13.w, l(1.000000)
          rsq r13.w, r13.w
          mul r13.w, r13.w, r24.w
          mul r34.xyz, r30.zxyz, r32.yzxy
          mad r32.xyz, r30.yzxy, r32.zxyz, -r34.xyzx
          dp3 r24.w, r32.xyzx, r28.xyzx
          ge r24.w, r24.w, l(0.000000)
          mad r28.xy, r13.wwww, l(-0.250000, 0.250000, 0.000000, 0.000000), l(0.250000, 0.750000, 0.000000, 0.000000)
          movc r33.y, r24.w, r28.x, r28.y
          utof r33.z, r23.w
          sample_l_indexable(texture2darray)(float,float,float,float) r13.w, r33.xyzx, t0.yzwx, s0, l(0.000000)
          mul r13.w, r16.w, r13.w
          div r13.w, r13.w, r22.z
          add r16.w, -r17.w, l(1.000000)
          max r16.w, r16.w, l(0.000000)
          mul r13.w, r13.w, r16.w
        else
          ieq r16.w, r19.z, l(2)
          mul r17.w, -r22.z, r30.x
          mul r17.w, r17.w, l(1.442695)
          exp r17.w, r17.w
          mul_sat r17.w, r17.w, r30.y
          mul r22.y, r22.w, r22.z
          dp3 r19.z, r30.xyzx, r22.xyzx
          div r19.z, l(1.000000, 1.000000, 1.000000, 1.000000), r19.z
          movc r13.w, r16.w, r17.w, r19.z
        endif
        mul r13.w, r18.w, r13.w
        mul r22.yzw, r29.xxyz, r13.wwww
        dp3 r13.w, r1.xyzx, -r31.xyzx
        lt r16.w, r13.w, l(0.000000)
        and r16.w, r8.w, r16.w
        if_nz r16.w
          add r16.w, r13.w, r13.w
          mad r31.xyz, r1.xyzx, r16.wwww, r31.xyzx
          mul r22.yzw, r12.xxyz, r22.yyzw
          mad r28.xyz, r8.xyzx, r5.wwww, -r31.xyzx
          dp3 r16.w, r28.xyzx, r28.xyzx
          rsq r16.w, r16.w
          mul r28.xyz, r16.wwww, r28.xyzx
          dp3_sat r16.w, r9.xyzx, r28.xyzx
          add r16.w, -r16.w, l(1.000000)
          mul r17.w, r16.w, r16.w
          mul r17.w, r17.w, r17.w
          mul r16.w, r16.w, r17.w
          mad r28.xyz, r18.xyzx, r16.wwww, r3.xyzx
          add r29.xyz, -r28.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
          mul r30.xyz, r6.wwww, r29.xyzx
          mad r28.xyz, r29.xyzx, r6.wwww, r28.xyzx
          add r27.xyz, -r28.yzxy, l(1.000000, 1.000000, 1.000000, 0.000000)
          mul r25.xyz, r4.xxxx, r30.xyzx
          mov r13.w, -r13.w
        else
          mov r23.yz, r27.xxyx
          mov r27.xyz, r23.yzxy
        endif
        mad r23.yzw, r8.xxyz, r5.wwww, -r31.xxyz
        dp3 r16.w, r23.yzwy, r23.yzwy
        rsq r16.w, r16.w
        mul r23.yzw, r16.wwww, r23.yyzw
        dp3 r16.w, r9.xyzx, r23.yzwy
        ge r17.w, r27.z, l(0.000000)
        mov_sat r18.w, r16.w
        add r18.w, -r18.w, l(1.000000)
        mul r19.z, r18.w, r18.w
        mul r19.z, r19.z, r19.z
        mul r18.w, r18.w, r19.z
        mad r28.xyz, r18.xyzx, r18.wwww, r3.xyzx
        movc r28.xyz, r17.wwww, r27.zxyz, r28.xyzx
        dp3 r18.w, r1.xyzx, r23.yzwy
        mul r18.w, r18.w, r18.w
        mad r18.w, r18.w, r11.w, l(1.000000)
        max r18.w, r18.w, l(0.000100)
        mul r18.w, r18.w, r18.w
        mul r18.w, r18.w, l(4.000000)
        div r18.w, r10.w, r18.w
        mad r16.w, r16.w, r3.w, r12.w
        mul r16.w, r16.w, r16.w
        div r16.w, l(1.000000, 1.000000, 1.000000, 1.000000), r16.w
        mul r16.w, r16.w, r18.w
        mul r23.yzw, r16.wwww, r28.xxyz
        mul r23.yzw, r22.yyzw, r23.yyzw
        mov_sat r13.w, r13.w
        movc r16.w, r19.w, l(0), l(1.000000)
        mad r18.w, r5.y, r20.w, r16.w
        mul r18.w, r13.w, r18.w
        mad r26.xyz, r23.yzwy, r18.wwww, r26.xyzx
        mul r22.yzw, r13.wwww, r22.yyzw
        movc r23.yzw, r17.wwww, r25.xxyz, r17.xxyz
        mul r22.yzw, r22.yyzw, r23.yyzw
        mad r13.w, r2.w, r20.w, r16.w
        mad r24.xyz, r22.yzwy, r13.wwww, r24.xyzx
      endif
    endif
    iadd r10.z, r10.z, l(1)
  endloop
  iadd r0.y, r0.w, r0.y
  mov r19.x, l(1.000000)
  mov r20.x, l(-1.000000)
  mov r16.xyz, r24.xyzx
  mov r21.xyz, r25.xyzx
  mov r15.yzw, r26.xxyz
  mov r22.xy, r27.xyxx
  mov r0.w, cb0[12].x
  mov r4.w, cb0[29].x
  mov r9.w, l(0)
  loop
    uge r10.z, r9.w, r4.z
    breakc_nz r10.z
    iadd r10.z, r0.y, r9.w
    ld_indexable(buffer)(uint,uint,uint,uint) r10.z, r10.zzzz, t16.yzxw
    imul null, r13.w, r10.z, l(5)
    ld_indexable(buffer)(float,float,float,float) r23.xyz, r13.wwww, t20.xyzw
    imad r13.w, l(5), r10.z, l(4)
    ld_indexable(buffer)(float,float,float,float) r28.xyz, r13.wwww, t20.xyzw
    add r23.xyz, -r7.xyzx, r23.xyzx
    dp3 r19.z, r23.xyzx, r23.xyzx
    div r13.w, r19.z, r28.x
    mad_sat r16.w, r13.w, l(-16.000000), l(16.000000)
    lt r17.w, l(0.000000), r16.w
    if_nz r17.w
      imad r17.w, l(5), r10.z, l(2)
      ld_indexable(buffer)(float,float,float,float) r29.xyz, r17.wwww, t20.xyzw
      mul r29.xyz, r0.zzzz, r29.xyzx
      ult r17.w, r10.z, r4.w
      if_nz r17.w
        ult r17.w, r10.z, r0.w
        if_nz r17.w
          dp4 r18.w, r14.xyzw, icb[r10.z + 0].xyzw
        endif
        if_z r17.w
          ishl r17.w, r10.z, l(2)
          mul r30.xyzw, r7.yyyy, cb0[r17.w + 31].xyzw
          mad r30.xyzw, r7.xxxx, cb0[r17.w + 30].xyzw, r30.xyzw
          mad r30.xyzw, r7.zzzz, cb0[r17.w + 32].xyzw, r30.xyzw
          mad r30.xyzw, r7.wwww, cb0[r17.w + 33].xyzw, r30.xyzw
          div r30.xyz, r30.xyzx, r30.wwww
          utof r30.w, r10.z
          sample_c_lz_indexable(texture2darray)(float,float,float,float) r18.w, r30.xywx, t3.xxxx, s3, r30.z
        endif
        ne r17.w, r18.w, l(0.000000)
        not r19.w, r17.w
        mul r30.xyz, r18.wwww, r29.xyzx
        movc r29.xyz, r17.wwww, r30.xyzx, r29.xyzx
      else
        mov r19.w, l(0)
      endif
      if_z r19.w
        imad r27.zw, l(0, 0, 5, 5), r10.zzzz, l(0, 0, 1, 3)
        ld_indexable(buffer)(float,float,float,float) r30.xyz, r27.zzzz, t20.xyzw
        ld_indexable(buffer)(float,float,float,float) r31.xyz, r27.wwww, t20.xyzw
        uge r17.w, r10.z, r4.w
        and r18.w, r17.w, l(0x3f800000)
        imul null, r19.w, r10.z, l(3)
        ld_indexable(buffer)(uint,uint,uint,uint) r19.w, r19.wwww, t21.yzwx
        rsq r20.w, r19.z
        mul r32.xyz, r20.wwww, -r23.xyzx
        dp3 r21.w, -r32.xyzx, r30.xyzx
        mad_sat r21.w, r21.w, r28.z, r28.y
        ieq r22.w, r19.w, l(3)
        if_nz r22.w
          imad r10.z, l(3), r10.z, l(2)
          ld_indexable(buffer)(uint,uint,uint,uint) r10.z, r10.zzzz, t21.yzxw
          dp3 r22.w, -r23.xyzx, -r23.xyzx
          rsq r22.w, r22.w
          mul r23.xyz, r22.wwww, -r23.xyzx
          dp3 r22.w, r23.xyzx, r30.xyzx
          mad r33.x, r22.w, l(-0.500000), l(0.500000)
          dp3 r23.w, r23.xyzx, r31.xyzx
          mad r22.w, -r22.w, r22.w, l(1.000000)
          rsq r22.w, r22.w
          mul r22.w, r22.w, r23.w
          mul r28.yzw, r30.yyzx, r31.zzxy
          mad r28.yzw, r31.yyzx, r30.zzxy, -r28.yyzw
          dp3 r23.x, r28.yzwy, r23.xyzx
          ge r23.x, r23.x, l(0.000000)
          mad r23.yz, r22.wwww, l(0.000000, -0.250000, 0.250000, 0.000000), l(0.000000, 0.250000, 0.750000, 0.000000)
          movc r33.y, r23.x, r23.y, r23.z
          utof r33.z, r10.z
          sample_l_indexable(texture2darray)(float,float,float,float) r10.z, r33.xyzx, t0.yzxw, s0, l(0.000000)
          mul r10.z, r28.x, r10.z
          div r10.z, r10.z, r19.z
          add_sat r13.w, -r13.w, l(1.000000)
          mul r10.z, r10.z, r13.w
          mul r10.z, r21.w, r10.z
        else
          ieq r13.w, r19.w, l(2)
          mul r19.w, -r19.z, r31.x
          mul r19.w, r19.w, l(1.442695)
          exp r19.w, r19.w
          mul_sat r19.w, r19.w, r31.y
          mul r19.w, r19.w, r21.w
          mul r19.y, r19.z, r20.w
          dp3 r19.y, r19.xyzx, r31.xyzx
          div r19.y, r21.w, r19.y
          movc r10.z, r13.w, r19.w, r19.y
        endif
        mul r10.z, r16.w, r10.z
        mul r19.yzw, r29.xxyz, r10.zzzz
        dp3 r10.z, r1.xyzx, -r32.xyzx
        lt r13.w, r10.z, l(0.000000)
        and r13.w, r8.w, r13.w
        if_nz r13.w
          add r13.w, r10.z, r10.z
          mad r32.xyz, r1.xyzx, r13.wwww, r32.xyzx
          mul r19.yzw, r12.xxyz, r19.yyzw
          mad r23.xyz, r8.xyzx, r5.wwww, -r32.xyzx
          dp3 r13.w, r23.xyzx, r23.xyzx
          rsq r13.w, r13.w
          mul r23.xyz, r13.wwww, r23.xyzx
          dp3_sat r13.w, r9.xyzx, r23.xyzx
          add r13.w, -r13.w, l(1.000000)
          mul r16.w, r13.w, r13.w
          mul r16.w, r16.w, r16.w
          mul r13.w, r13.w, r16.w
          mad r23.xyz, r18.xyzx, r13.wwww, r3.xyzx
          add r28.xyz, -r23.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
          mul r29.xyz, r6.wwww, r28.xyzx
          mad r23.xyz, r28.xyzx, r6.wwww, r23.xyzx
          add r22.xyz, -r23.yzxy, l(1.000000, 1.000000, 1.000000, 0.000000)
          mul r21.xyz, r4.xxxx, r29.xyzx
          mov r10.z, -r10.z
        else
          mov r20.yz, r22.xxyx
          mov r22.xyz, r20.yzxy
        endif
        mad r20.yzw, r8.xxyz, r5.wwww, -r32.xxyz
        dp3 r13.w, r20.yzwy, r20.yzwy
        rsq r13.w, r13.w
        mul r20.yzw, r13.wwww, r20.yyzw
        dp3 r13.w, r9.xyzx, r20.yzwy
        ge r16.w, r22.z, l(0.000000)
        mov_sat r21.w, r13.w
        add r21.w, -r21.w, l(1.000000)
        mul r22.w, r21.w, r21.w
        mul r22.w, r22.w, r22.w
        mul r21.w, r21.w, r22.w
        mad r23.xyz, r18.xyzx, r21.wwww, r3.xyzx
        movc r23.xyz, r16.wwww, r22.zxyz, r23.xyzx
        dp3 r20.y, r1.xyzx, r20.yzwy
        mul r20.y, r20.y, r20.y
        mad r20.y, r20.y, r11.w, l(1.000000)
        max r20.y, r20.y, l(0.000100)
        mul r20.y, r20.y, r20.y
        mul r20.y, r20.y, l(4.000000)
        div r20.y, r10.w, r20.y
        mad r13.w, r13.w, r3.w, r12.w
        mul r13.w, r13.w, r13.w
        div r13.w, l(1.000000, 1.000000, 1.000000, 1.000000), r13.w
        mul r13.w, r13.w, r20.y
        mul r20.yzw, r13.wwww, r23.xxyz
        mul r20.yzw, r19.yyzw, r20.yyzw
        mov_sat r10.z, r10.z
        movc r13.w, r17.w, l(0), l(1.000000)
        mad r17.w, r5.y, r18.w, r13.w
        mul r17.w, r10.z, r17.w
        mad r15.yzw, r20.yyzw, r17.wwww, r15.yyzw
        mul r19.yzw, r10.zzzz, r19.yyzw
        movc r20.yzw, r16.wwww, r21.xxyz, r17.xxyz
        mul r19.yzw, r19.yyzw, r20.yyzw
        mad r10.z, r2.w, r18.w, r13.w
        mad r16.xyz, r19.yzwy, r10.zzzz, r16.xyzx
      endif
    endif
    iadd r9.w, r9.w, l(1)
  endloop
endif
ne r0.y, cb0[79].x, l(0.000000)
mov_sat r0.z, -r1.y
mov_sat r15.x, r15.x
add r0.z, r0.z, r15.x
mul_sat r0.z, r0.z, cb0[79].x
add r0.x, r0.x, l(-1.000000)
mad r0.x, r0.z, r0.x, l(1.000000)
movc r0.x, r0.y, r0.x, l(1.000000)
sample_l_indexable(texturecube)(float,float,float,float) r0.yzw, r1.xyzx, t5.wxyz, s5, l(6.000000)
mul r0.xyz, r0.xxxx, r0.yzwy
mul r0.xyz, r0.xyzx, cb0[80].xyzx
add r0.w, -cb0[80].w, l(1.000000)
mad r0.w, r2.w, cb0[80].w, r0.w
add r0.w, r0.w, l(-1.000000)
add r0.w, r0.w, l(1.000000)
mul r0.xyz, r0.wwww, r0.xyzx
mad r0.xyz, r0.xyzx, r17.xyzx, r16.xyzx
div r3.w, l(1.000000, 1.000000, 1.000000, 1.000000), r5.x
dp3 r4.x, r11.xyzx, r11.xyzx
rsq r4.x, r4.x
mul r4.xzw, r4.xxxx, r11.xxyz
dp3_sat r5.x, r1.xyzx, r4.xzwx
mad r5.x, -r5.x, r5.x, l(1.000000)
sqrt r5.x, r5.x
ge r5.w, r1.y, l(0.000000)
movc r8.y, r5.w, l(1.000000), l(-1.000000)
mad r5.x, r5.x, r3.w, -r5.x
mov r8.xz, l(0,0,0,0)
add r1.xyz, r1.xyzx, -r8.xyzx
mul r4.xzw, r3.wwww, r4.xxzw
mad r1.xyz, r5.xxxx, r1.xyzx, -r4.xzwx
dp3 r3.w, r1.xyzx, r1.xyzx
rsq r3.w, r3.w
mul r1.xyz, r1.xyzx, r3.wwww
mul r1.xyz, r5.zzzz, r1.xyzx
mad r7.xyz, r1.xyzx, r4.yyyy, r7.xyzx
mov r7.w, l(1.000000)
dp4 r1.x, r7.xyzw, cb0[68].xyzw
dp4 r1.y, r7.xyzw, cb0[69].xyzw
dp4 r1.z, r7.xyzw, cb0[70].xyzw
div r1.xy, r1.xyxx, r1.zzzz
sample_indexable(texture2d)(float,float,float,float) r1.z, r1.xyxx, t1.yzxw, s1
if_nz r8.w
  dp3 r3.w, -r11.xyzx, cb0[66].xyzx
  add r1.w, -r1.w, l(1.000000)
  mul r4.x, r1.w, r1.w
  mul r4.x, r4.x, r4.x
  mul r1.w, r1.w, r4.x
  mad r3.xyz, r18.xyzx, r1.wwww, r3.xyzx
  add r4.xzw, -r3.xxyz, l(1.000000, 0.000000, 1.000000, 1.000000)
  mad r3.xyz, r4.xzwx, r6.wwww, r3.xyzx
  add r3.xyz, -r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mul r4.xzw, r6.wwww, r3.xxyz
  mad_sat r1.z, cb0[67].y, r1.z, cb0[67].x
  div r1.z, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z
  lt r1.z, r1.z, r3.w
  movc r1.xy, r1.zzzz, r10.xyxx, r1.xyxx
  sample_l_indexable(texture2d)(float,float,float,float) r5.xzw, r1.xyxx, t6.xwyz, s6, l(16.000000)
  mul r5.xzw, r5.xxzw, cb0[80].xxyz
  mul r5.xzw, r0.wwww, r5.xxzw
  mul r4.xzw, r4.xxzw, r5.xxzw
  mad r0.xyz, r4.xzwx, r12.xyzx, r0.xyzx
  sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t6.xyzw, s6, l(0.000000)
  mul r1.xyz, r1.xyzx, cb0[81].xyzx
  add r0.w, -cb0[81].w, l(1.000000)
  mad r0.w, r2.w, cb0[81].w, r0.w
  add r1.w, -r0.w, l(1.000000)
  mad r1.w, r5.y, r1.w, r0.w
  mad r0.w, r0.w, r1.w, l(-1.000000)
  add r0.w, r0.w, l(1.000000)
  mul r1.xyz, r0.wwww, r1.xyzx
  mul r1.xyz, r3.xyzx, r1.xyzx
  mad r15.yzw, r1.xxyz, r12.xxyz, r15.yyzw
endif
mad r0.xyz, r0.xyzx, r2.xyzx, r6.xyzx
add r0.xyz, r15.yzwy, r0.xyzx
add r0.xyz, -r13.xyzx, r0.xyzx
mad o0.xyz, r4.yyyy, r0.xyzx, r13.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 817 instruction slots used

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