// PreFix Shadows

cbuffer FrameConstants : register(b0)
{
  float4x4 g_xView : packoffset(c0);
  float4x4 g_xProj : packoffset(c4);
  float4x4 g_xViewProj : packoffset(c8);
  float4x4 g_xInvView : packoffset(c12);
  float4x4 g_xInvProj : packoffset(c16);
  float4x4 g_xInvViewProj : packoffset(c20);
  float3 g_xCamPos : packoffset(c24);
  float2 g_xRcpScreenDims : packoffset(c25);
  float2 g_xDepthProjViewUnpack : packoffset(c25.z);
  float4 g_axViewFrustumPlanes[6] : packoffset(c26);
}

cbuffer ShadowReadConstants : register(b5)
{
  float g_f2DFilterSize : packoffset(c0);
  float g_fCubeFilterSize : packoffset(c0.y);
  float g_fCubeClampWidth : packoffset(c0.z);
  float g_fSunWidth : packoffset(c0.w);
}

cbuffer PointParams : register(b4)
{
  float2 g_xCameraTanHalfFOV : packoffset(c0);
  float2 g_xTwoOverScreenDims : packoffset(c0.z);
  float3 g_xLightPos : packoffset(c1);
  float g_fLightRadius : packoffset(c1.w);
  float4x4 g_xLightOrientation : packoffset(c2);
  float4x4 g_xCustomVolumeMatrix : packoffset(c6);
  float3 g_xLightDir : packoffset(c10);
  float g_fRcpLightRadius : packoffset(c10.w);
  float g_fLightFalloffScale : packoffset(c11);
  float g_fLightFalloffPower : packoffset(c11.y);
  float g_fLightAngleOuter : packoffset(c11.z);
  float g_fRcpLightAngleRange : packoffset(c11.w);
  float3 g_xLightColour : packoffset(c12);
  bool g_bUseLimitAngles : packoffset(c12.w);
  float g_fArcCosLimitAngle : packoffset(c13);
  float g_fRcpProjCubeLerpDist : packoffset(c13.y);
  bool g_bUseProjCube : packoffset(c13.z);
  bool g_bUseDualProjCube : packoffset(c13.w);
  float g_fLightMeshRadius : packoffset(c14);
  float2 g_xDepthProjection : packoffset(c14.y);
  float g_fShadowStrength : packoffset(c14.w);
}

SamplerState g_xPointClamp_s : register(s1);
SamplerState g_xTrilinearClamp_s : register(s3);
SamplerComparisonState g_xShadowCmpSamplerLessEqual_s : register(s9);
Texture2D<float4> g_xMaterialsTexture : register(t0);
Texture2D<float4> g_xNormalBuffer : register(t24);
Texture2D<float4> g_xAlbedoBuffer : register(t25);
TextureCube<float4> g_xProjCubeMap : register(t26);
TextureCube<float4> g_xProjCubeMapBlurred : register(t27);
Texture2D<float4> g_xShadowCubeMap : register(t28);


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


void main( 
  float4 v0 : SV_Position0,
  out float4 o0 : SV_Target0)
{
  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;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = (int2)v0.xy;
  r0.zw = float2(0,0);
  r1.xyzw = g_xNormalBuffer.Load(r0.xyw).xyzw;
  r0.xyzw = g_xAlbedoBuffer.Load(r0.xyz).xyzw;
  r2.x = dot(r1.xy, r1.xy);
  r3.z = r2.x * 2 + -1;
  r2.x = rsqrt(r2.x);
  r1.xy = r2.xx * r1.xy;
  r2.x = -r3.z * r3.z + 1;
  r2.x = sqrt(r2.x);
  r3.xy = r2.xx * r1.xy;
  r1.xy = g_xCameraTanHalfFOV.xy * r1.ww;
  r2.xy = v0.xy * g_xTwoOverScreenDims.xy + float2(-1,-1);
  r1.xy = r2.xy * r1.xy;
float4 stereo = StereoParams.Load(0);
float4 params = IniParams.Load(0);
r1.x -= stereo.x * (r1.w - stereo.y)*g_xInvProj._m00;
  r2.xyz = g_xInvView._m01_m11_m21 * r1.yyy;
  r2.xyz = g_xInvView._m00_m10_m20 * r1.xxx + r2.xyz;
  r1.xyw = g_xInvView._m02_m12_m22 * r1.www + r2.xyz;
  r1.xyw = g_xInvView._m03_m13_m23 + r1.xyw;
  r2.xyz = g_xLightPos.xyz + -r1.xyw;
  r2.w = dot(r2.xyz, r2.xyz);
  r3.w = rsqrt(r2.w);
  r4.xyz = r3.www * r2.xyz;
  r2.w = sqrt(r2.w);
  r3.w = g_fRcpLightRadius * r2.w;
  r4.w = -r2.w * g_fRcpLightRadius + 1;
  r4.w = saturate(g_fLightFalloffScale * r4.w);
  r4.w = log2(r4.w);
  r4.w = g_fLightFalloffPower * r4.w;
  r4.w = exp2(r4.w);
  r5.x = dot(r4.xyz, g_xLightDir.xyz);
  r5.x = g_fLightAngleOuter + r5.x;
  r5.x = saturate(g_fRcpLightAngleRange * r5.x);
  r5.x = r5.x * r4.w;
  r4.w = g_bUseLimitAngles ? r5.x : r4.w;
  r5.x = -9.99999975e-005 + r4.w;
  r5.x = cmp(r5.x < 0);
  if (r5.x != 0) discard;
  r5.x = cmp(0 < g_fShadowStrength);
  if (r5.x != 0) {
    r5.xyz = float3(-1,1,-1) * r2.xyz;
    r5.w = max(abs(r5.y), abs(r5.z));
    r5.w = max(abs(r5.x), r5.w);
    r6.xyz = cmp(abs(r5.xyz) == r5.www);
    r7.xyz = r6.xyz ? float3(1,1,1) : 0;
    r6.z = dot(r7.xyz, r5.xyz);
    r6.w = cmp(0 < r6.z);
    r6.z = cmp(r6.z < 0);
    r6.z = (int)r6.z + (int)-r6.w;
    r6.z = (int)r6.z;
    r8.x = saturate(-r6.z);
    r8.y = dot(r7.zy, float2(2,1));
    r7.xyzw = float4(0,-1,0,1) * r6.zzzz;
    r6.zw = r6.yy ? float2(1,0) : r7.wz;
    r7.zw = r6.yy ? r7.zw : float2(-1,0);
    r6.yz = r6.xx ? r7.xy : r6.zw;
    r6.xw = r6.xx ? float2(-1,0) : r7.zw;
    r5.xyz = r5.xyz / r5.www;
    r6.y = dot(r6.yz, r5.xz);
    r6.z = dot(r6.xw, r5.yz);
    r5.xy = r6.yz * float2(0.5,0.5) + float2(0.5,0.5);
    r5.z = g_xDepthProjection.y / r5.w;
    r6.w = g_xDepthProjection.x + r5.z;
    r5.z = 1 / g_fCubeFilterSize;
    r5.zw = r5.zz * r5.xy + float2(0.5,0.5);
    r7.xy = floor(r5.zw);
    r5.zw = -r7.xy + r5.zw;
    r6.yz = -r5.zw * g_fCubeFilterSize + r5.xy;
    r5.x = -g_fCubeClampWidth * 3 + 1;
    r7.y = -7 * g_fCubeFilterSize;
    r7.w = 0;
    r8.zw = float2(0,0);
    r5.y = -7;
    while (true) {
      r6.x = cmp(7 < (int)r5.y);
      if (r6.x != 0) break;
      r6.x = (int)r5.y;
      r7.z = g_fCubeFilterSize * r6.x;
      r9.yzw = r7.yzw + r6.yzw;
      r7.xz = max(g_fCubeClampWidth, r9.yz);
      r7.xz = min(r7.xz, r5.xx);
      r7.xz = r7.xz + r8.xy;
      r7.xz = float2(0.5,0.333333343) * r7.xz;
      r10.xyzw = g_xShadowCubeMap.Gather(g_xPointClamp_s, r7.xz).xyzw;
      r11.xyzw = cmp(r10.xyzw >= r9.wwww);
      r11.xyzw = r11.xyzw ? float4(0,0,0,0) : float4(1,1,1,1);
      r6.x = dot(r11.xyzw, float4(1,1,1,1));
      r7.x = dot(r10.xyzw, r11.xyzw);
      r9.x = g_fCubeFilterSize * 2 + r9.y;
      r10.xy = max(g_fCubeClampWidth, r9.xz);
      r10.xy = min(r10.xy, r5.xx);
      r10.xy = r10.xy + r8.xy;
      r10.xy = float2(0.5,0.333333343) * r10.xy;
      r10.xyzw = g_xShadowCubeMap.Gather(g_xPointClamp_s, r10.xy).xyzw;
      r11.xyzw = cmp(r10.xyzw >= r9.wwww);
      r11.xyzw = r11.xyzw ? float4(0,0,0,0) : float4(1,1,1,1);
      r7.z = dot(r11.xyzw, float4(1,1,1,1));
      r6.x = r7.z + r6.x;
      r7.z = dot(r10.xyzw, r11.xyzw);
      r7.x = r7.x + r7.z;
      r10.z = g_fCubeFilterSize * 2 + r9.x;
      r10.w = r9.z;
      r9.xy = max(g_fCubeClampWidth, r10.zw);
      r9.xy = min(r9.xy, r5.xx);
      r9.xy = r9.xy + r8.xy;
      r9.xy = float2(0.5,0.333333343) * r9.xy;
      r11.xyzw = g_xShadowCubeMap.Gather(g_xPointClamp_s, r9.xy).xyzw;
      r12.xyzw = cmp(r11.xyzw >= r9.wwww);
      r12.xyzw = r12.xyzw ? float4(0,0,0,0) : float4(1,1,1,1);
      r7.z = dot(r12.xyzw, float4(1,1,1,1));
      r6.x = r7.z + r6.x;
      r7.z = dot(r11.xyzw, r12.xyzw);
      r7.x = r7.x + r7.z;
      r10.y = g_fCubeFilterSize * 2 + r10.z;
      r9.xy = max(g_fCubeClampWidth, r10.yw);
      r9.xy = min(r9.xy, r5.xx);
      r9.xy = r9.xy + r8.xy;
      r9.xy = float2(0.5,0.333333343) * r9.xy;
      r11.xyzw = g_xShadowCubeMap.Gather(g_xPointClamp_s, r9.xy).xyzw;
      r12.xyzw = cmp(r11.xyzw >= r9.wwww);
      r12.xyzw = r12.xyzw ? float4(0,0,0,0) : float4(1,1,1,1);
      r7.z = dot(r12.xyzw, float4(1,1,1,1));
      r6.x = r7.z + r6.x;
      r7.z = dot(r11.xyzw, r12.xyzw);
      r7.x = r7.x + r7.z;
      r10.x = g_fCubeFilterSize * 2 + r10.y;
      r9.xy = max(g_fCubeClampWidth, r10.xw);
      r9.xy = min(r9.xy, r5.xx);
      r9.xy = r9.xy + r8.xy;
      r9.xy = float2(0.5,0.333333343) * r9.xy;
      r11.xyzw = g_xShadowCubeMap.Gather(g_xPointClamp_s, r9.xy).xyzw;
      r12.xyzw = cmp(r11.xyzw >= r9.wwww);
      r12.xyzw = r12.xyzw ? float4(0,0,0,0) : float4(1,1,1,1);
      r7.z = dot(r12.xyzw, float4(1,1,1,1));
      r6.x = r7.z + r6.x;
      r7.z = dot(r11.xyzw, r12.xyzw);
      r7.x = r7.x + r7.z;
      r10.z = g_fCubeFilterSize * 2 + r10.x;
      r9.xy = max(g_fCubeClampWidth, r10.zw);
      r9.xy = min(r9.xy, r5.xx);
      r9.xy = r9.xy + r8.xy;
      r9.xy = float2(0.5,0.333333343) * r9.xy;
      r11.xyzw = g_xShadowCubeMap.Gather(g_xPointClamp_s, r9.xy).xyzw;
      r12.xyzw = cmp(r11.xyzw >= r9.wwww);
      r12.xyzw = r12.xyzw ? float4(0,0,0,0) : float4(1,1,1,1);
      r7.z = dot(r12.xyzw, float4(1,1,1,1));
      r6.x = r7.z + r6.x;
      r7.z = dot(r11.xyzw, r12.xyzw);
      r7.x = r7.x + r7.z;
      r10.y = g_fCubeFilterSize * 2 + r10.z;
      r9.xy = max(g_fCubeClampWidth, r10.yw);
      r9.xy = min(r9.xy, r5.xx);
      r9.xy = r9.xy + r8.xy;
      r9.xy = float2(0.5,0.333333343) * r9.xy;
      r11.xyzw = g_xShadowCubeMap.Gather(g_xPointClamp_s, r9.xy).xyzw;
      r12.xyzw = cmp(r11.xyzw >= r9.wwww);
      r12.xyzw = r12.xyzw ? float4(0,0,0,0) : float4(1,1,1,1);
      r7.z = dot(r12.xyzw, float4(1,1,1,1));
      r6.x = r7.z + r6.x;
      r7.z = dot(r11.xyzw, r12.xyzw);
      r7.x = r7.x + r7.z;
      r10.x = g_fCubeFilterSize * 2 + r10.y;
      r9.xy = max(g_fCubeClampWidth, r10.xw);
      r9.xy = min(r9.xy, r5.xx);
      r9.xy = r9.xy + r8.xy;
      r9.xy = float2(0.5,0.333333343) * r9.xy;
      r10.xyzw = g_xShadowCubeMap.Gather(g_xPointClamp_s, r9.xy).xyzw;
      r9.xyzw = cmp(r10.xyzw >= r9.wwww);
      r9.xyzw = r9.xyzw ? float4(0,0,0,0) : float4(1,1,1,1);
      r7.z = dot(r9.xyzw, float4(1,1,1,1));
      r6.x = r7.z + r6.x;
      r7.z = dot(r10.xyzw, r9.xyzw);
      r7.x = r7.x + r7.z;
      r8.w = r8.w + r6.x;
      r8.z = r8.z + r7.x;
      r5.y = (int)r5.y + 2;
    }
    r5.y = cmp(0 < r8.w);
    if (r5.y != 0) {
      r6.x = cmp(r8.w >= 256);
      if (r6.x == 0) {
        r7.x = r8.z / r8.w;
        r7.y = -r7.x + r6.w;
        r7.y = g_fSunWidth * r7.y;
        r7.y = 10 * r7.y;
        r7.x = saturate(r7.y / r7.x);
        r7.x = r7.x * r7.x;
        r5.y = r5.y ? r7.x : 0;
        r7.x = r5.y * r5.y;
        r7.y = r7.x * r5.y;
        r9.xyzw = float4(9.89999962,9,8.5,8) * r7.yyyy;
        r7.z = 3 * r7.x;
        r7.w = 1 + -r5.y;
        r8.z = r7.z * r7.w;
        r8.w = r8.z * 0.200000003 + r9.w;
        r10.xy = float2(498.799988,0.300000012) * r7.yy;
        r9.w = r8.w * 10 + r10.x;
        r10.x = r7.w * r7.w;
        r10.z = r10.x * r5.y;
        r11.xy = float2(0.600000024,3) * r10.zz;
        r11.xz = r7.yy * float2(7,0.300000012) + r11.xy;
        r11.xz = r7.zz * r7.ww + r11.xz;
        r9.w = r11.x * 7 + r9.w;
        r9.w = r9.w + r8.w;
        r9.w = r7.y * 54.7999992 + r9.w;
        r9.w = r9.w + r8.w;
        r9.w = r9.w + r11.x;
        r9.w = r11.z * 2 + r9.w;
        r8.z = r10.z * 3 + r8.z;
        r9.w = r9.w + r8.z;
        r12.xy = float2(0.200000003,0.100000001) * r7.yy;
        r10.w = r7.y * 3 + r11.y;
        r10.w = r7.z * r7.w + r10.w;
        r9.w = r10.w + r9.w;
        r5.y = r7.x * r5.y + r11.y;
        r5.y = r7.z * r7.w + r5.y;
        r7.x = r9.w + r5.y;
        r7.x = r7.x + r11.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.y * 54.7999992 + r7.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.x + r11.x;
        r7.x = r7.x + r11.z;
        r9.w = r10.x * r7.w;
        r12.yzw = r9.www * float3(0.800000012,0.800000012,0.800000012) + r12.xxy;
        r12.yzw = r10.zzz * float3(3,3,3) + r12.yzw;
        r12.yzw = r7.zzz * r7.www + r12.yzw;
        r7.x = r12.z * 2 + r7.x;
        r9.w = r9.w * 0.800000012 + r10.y;
        r9.w = r10.z * 3 + r9.w;
        r9.w = r7.z * r7.w + r9.w;
        r7.x = r9.w + r7.x;
        r7.x = r7.x + r5.y;
        r7.x = r7.x + r11.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.y * 54.7999992 + r7.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.x + r11.x;
        r7.x = r7.x + r11.z;
        r7.x = r7.x + r12.w;
        r10.x = r10.x * r7.w + r12.x;
        r10.x = r10.z * 3 + r10.x;
        r7.z = r7.z * r7.w + r10.x;
        r7.x = r7.x + r7.z;
        r7.x = r7.x + r9.w;
        r7.x = r7.x + r5.y;
        r7.x = r7.x + r11.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.y * 54.7999992 + r7.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.x + r11.x;
        r7.x = r7.x + r11.z;
        r7.x = r12.z * 2 + r7.x;
        r7.x = r7.x + r9.w;
        r7.x = r7.x + r5.y;
        r7.x = r7.x + r11.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.y * 54.7999992 + r7.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.x + r11.x;
        r7.x = r11.z * 4 + r7.x;
        r7.x = r7.x + r5.y;
        r7.x = r7.x + r11.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.y * 54.7999992 + r7.x;
        r7.x = r7.x + r8.w;
        r7.x = r11.x * 7 + r7.x;
        r7.x = r7.x + r8.w;
        r7.x = r7.y * 54.7999992 + r7.x;
        r7.x = r8.w * 9 + r7.x;
        r7.x = r7.y * 444 + r7.x;
        r13.xyzw = g_fCubeClampWidth * float4(-14,-14,-10,-14) + r6.yzyz;
        r13.xyzw = max(g_fCubeClampWidth, r13.xyzw);
        r13.xyzw = min(r13.xyzw, r5.xxxx);
        r13.xyzw = r13.xyzw + r8.xyxy;
        r13.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r13.xyzw;
        r14.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r13.xy, r6.w, int2(0,0)).xyzw;
        r7.w = 1 + -r5.w;
        r10.x = -r9.x * r5.z + r9.x;
        r10.yz = r14.wx * r10.xx;
        r11.yw = r14.zy * r9.xx + r10.yz;
        r10.y = r11.w * r5.w;
        r10.y = r7.w * r11.y + r10.y;
        r13.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r13.zw, r6.w, int2(0,0)).xyzw;
        r11.y = dot(r13.wz, r9.xx);
        r10.y = r7.w * r11.y + r10.y;
        r11.y = dot(r13.xy, r9.xx);
        r10.y = r5.w * r11.y + r10.y;
        r15.xyzw = g_fCubeClampWidth * float4(-6,-14,-2,-14) + r6.yzyz;
        r15.xyzw = max(g_fCubeClampWidth, r15.xyzw);
        r15.xyzw = min(r15.xyzw, r5.xxxx);
        r15.xyzw = r15.xyzw + r8.xyxy;
        r15.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r15.xyzw;
        r16.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r15.xy, r6.w, int2(0,0)).xyzw;
        r11.y = dot(r16.wz, r9.xx);
        r10.y = r7.w * r11.y + r10.y;
        r11.y = dot(r16.xy, r9.xx);
        r10.y = r5.w * r11.y + r10.y;
        r15.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r15.zw, r6.w, int2(0,0)).xyzw;
        r11.y = dot(r15.wz, r9.xx);
        r10.y = r7.w * r11.y + r10.y;
        r11.y = dot(r15.xy, r9.xx);
        r10.y = r5.w * r11.y + r10.y;
        r17.xyzw = g_fCubeClampWidth * float4(2,-14,6,-14) + r6.yzyz;
        r17.xyzw = max(g_fCubeClampWidth, r17.xyzw);
        r17.xyzw = min(r17.xyzw, r5.xxxx);
        r17.xyzw = r17.xyzw + r8.xyxy;
        r17.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r17.xyzw;
        r18.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.xy, r6.w, int2(0,0)).xyzw;
        r11.y = dot(r18.wz, r9.xx);
        r10.y = r7.w * r11.y + r10.y;
        r11.y = dot(r18.xy, r9.xx);
        r10.y = r5.w * r11.y + r10.y;
        r17.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.zw, r6.w, int2(0,0)).xyzw;
        r11.y = dot(r17.wz, r9.xx);
        r10.y = r7.w * r11.y + r10.y;
        r11.y = dot(r17.xy, r9.xx);
        r10.y = r5.w * r11.y + r10.y;
        r19.xyzw = g_fCubeClampWidth * float4(10,-14,14,-14) + r6.yzyz;
        r19.xyzw = max(g_fCubeClampWidth, r19.xyzw);
        r19.xyzw = min(r19.xyzw, r5.xxxx);
        r19.xyzw = r19.xyzw + r8.xyxy;
        r19.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r19.xyzw;
        r20.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r19.xy, r6.w, int2(0,0)).xyzw;
        r11.y = dot(r20.wz, r9.xx);
        r10.y = r7.w * r11.y + r10.y;
        r11.y = dot(r20.xy, r9.xx);
        r10.y = r5.w * r11.y + r10.y;
        r19.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r19.zw, r6.w, int2(0,0)).xyzw;
        r11.yw = r19.zy * r5.zz;
        r11.yw = r11.yw * r9.xx;
        r13.zw = r19.wx * r9.xx + r11.yw;
        r10.y = r7.w * r13.z + r10.y;
        r10.y = r5.w * r13.w + r10.y;
        r21.xyzw = g_fCubeClampWidth * float4(-14,-10,-10,-10) + r6.yzyz;
        r21.xyzw = max(g_fCubeClampWidth, r21.xyzw);
        r21.xyzw = min(r21.xyzw, r5.xxxx);
        r21.xyzw = r21.xyzw + r8.xyxy;
        r21.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r21.xyzw;
        r22.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r21.xy, r6.w, int2(0,0)).xyzw;
        r11.y = r7.y * r5.z;
        r23.xyzw = r11.yyyy * float4(0.899999976,0.5,-0.5,-0.899999976) + r9.yzyx;
        r13.zw = r23.xx * r22.yz;
        r13.zw = r22.xw * r10.xx + r13.zw;
        r10.y = r7.w * r13.w + r10.y;
        r10.y = r5.w * r13.z + r10.y;
        r10.z = r14.y * r23.x + r10.z;
        r10.y = r7.w * r10.z + r10.y;
        r10.y = r5.w * r13.w + r10.y;
        r14.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r21.zw, r6.w, int2(0,0)).xyzw;
        r15.zw = r14.wx * r23.yy;
        r16.zw = r14.zy * r9.zz + r15.zw;
        r10.y = r7.w * r16.z + r10.y;
        r10.y = r5.w * r16.w + r10.y;
        r10.z = dot(r13.xy, r9.yy);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r14.wz, r9.yy);
        r10.y = r5.w * r10.z + r10.y;
        r21.xyzw = g_fCubeClampWidth * float4(-6,-10,-2,-10) + r6.yzyz;
        r21.xyzw = max(g_fCubeClampWidth, r21.xyzw);
        r21.xyzw = min(r21.xyzw, r5.xxxx);
        r21.xyzw = r21.xyzw + r8.xyxy;
        r21.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r21.xyzw;
        r22.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r21.xy, r6.w, int2(0,0)).xyzw;
        r10.z = dot(r22.wz, r9.zz);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r22.xy, r9.zz);
        r10.y = r5.w * r10.z + r10.y;
        r10.z = dot(r16.xy, r9.yy);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r22.wz, r9.yy);
        r10.y = r5.w * r10.z + r10.y;
        r16.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r21.zw, r6.w, int2(0,0)).xyzw;
        r10.z = dot(r16.wz, r9.zz);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r16.xy, r9.zz);
        r10.y = r5.w * r10.z + r10.y;
        r10.z = dot(r15.xy, r9.yy);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r16.wz, r9.yy);
        r10.y = r5.w * r10.z + r10.y;
        r21.xyzw = g_fCubeClampWidth * float4(2,-10,6,-10) + r6.yzyz;
        r21.xyzw = max(g_fCubeClampWidth, r21.xyzw);
        r21.xyzw = min(r21.xyzw, r5.xxxx);
        r21.xyzw = r21.xyzw + r8.xyxy;
        r21.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r21.xyzw;
        r24.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r21.xy, r6.w, int2(0,0)).xyzw;
        r10.z = dot(r24.wz, r9.zz);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r24.xy, r9.zz);
        r10.y = r5.w * r10.z + r10.y;
        r10.z = dot(r18.xy, r9.yy);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r24.wz, r9.yy);
        r10.y = r5.w * r10.z + r10.y;
        r18.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r21.zw, r6.w, int2(0,0)).xyzw;
        r10.z = dot(r18.wz, r9.zz);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r18.xy, r9.zz);
        r10.y = r5.w * r10.z + r10.y;
        r10.z = dot(r17.xy, r9.yy);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r18.wz, r9.yy);
        r10.y = r5.w * r10.z + r10.y;
        r17.xyzw = g_fCubeClampWidth * float4(10,-10,14,-10) + r6.yzyz;
        r17.xyzw = max(g_fCubeClampWidth, r17.xyzw);
        r17.xyzw = min(r17.xyzw, r5.xxxx);
        r17.xyzw = r17.xyzw + r8.xyxy;
        r17.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r17.xyzw;
        r21.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.xy, r6.w, int2(0,0)).xyzw;
        r13.xy = r21.zy * r23.zz;
        r13.xw = r21.wx * r9.zz + r13.xy;
        r10.y = r7.w * r13.x + r10.y;
        r10.y = r5.w * r13.w + r10.y;
        r10.z = dot(r20.xy, r9.yy);
        r10.y = r7.w * r10.z + r10.y;
        r10.z = dot(r21.wz, r9.yy);
        r10.y = r5.w * r10.z + r10.y;
        r17.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.zw, r6.w, int2(0,0)).xyzw;
        r13.xw = r17.yz * r5.zz;
        r13.xw = r13.xw * r9.xx;
        r13.xw = r17.xw * r23.ww + r13.xw;
        r10.y = r7.w * r13.w + r10.y;
        r10.y = r5.w * r13.x + r10.y;
        r10.z = r19.x * r23.w + r11.w;
        r10.y = r7.w * r10.z + r10.y;
        r10.y = r5.w * r13.w + r10.y;
        r17.xyzw = g_fCubeClampWidth * float4(-14,-6,-14,-2) + r6.yzyz;
        r17.xyzw = max(g_fCubeClampWidth, r17.xyzw);
        r17.xyzw = min(r17.xyzw, r5.xxxx);
        r17.xyzw = r17.xyzw + r8.xyxy;
        r17.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r17.xyzw;
        r19.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.xy, r6.w, int2(0,0)).xyzw;
        r11.yw = r19.yz * r23.xx;
        r11.yw = r19.xw * r10.xx + r11.yw;
        r10.y = r7.w * r11.w + r10.y;
        r10.y = r5.w * r11.y + r10.y;
        r10.y = r7.w * r13.z + r10.y;
        r10.y = r5.w * r11.w + r10.y;
        r19.xyzw = g_fCubeClampWidth * float4(-10,-6,-6,-6) + r6.yzyz;
        r19.xyzw = max(g_fCubeClampWidth, r19.xyzw);
        r19.xyzw = min(r19.xyzw, r5.xxxx);
        r19.xyzw = r19.xyzw + r8.xyxy;
        r19.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r19.xyzw;
        r20.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r19.xy, r6.w, int2(0,0)).xyzw;
        r10.z = r7.y * 8.5 + -r8.w;
        r10.z = r5.z * r10.z + r8.w;
        r13.zw = r20.yz * r10.zz;
        r13.zw = r20.xw * r23.yy + r13.zw;
        r10.y = r7.w * r13.w + r10.y;
        r10.y = r5.w * r13.z + r10.y;
        r11.w = r14.y * r10.z + r15.w;
        r10.y = r7.w * r11.w + r10.y;
        r10.y = r5.w * r13.w + r10.y;
        r14.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r19.zw, r6.w, int2(0,0)).xyzw;
        r11.w = -r11.x + r8.w;
        r11.w = r5.z * r11.w + r11.x;
        r15.xy = r14.wx * r11.ww;
        r15.xz = r14.zy * r11.xx + r15.xy;
        r10.y = r7.w * r15.x + r10.y;
        r10.y = r5.w * r15.z + r10.y;
        r12.x = dot(r22.xy, r8.ww);
        r10.y = r7.w * r12.x + r10.y;
        r12.x = dot(r14.wz, r8.ww);
        r10.y = r5.w * r12.x + r10.y;
        r19.xyzw = g_fCubeClampWidth * float4(-2,-6,2,-6) + r6.yzyz;
        r19.xyzw = max(g_fCubeClampWidth, r19.xyzw);
        r19.xyzw = min(r19.xyzw, r5.xxxx);
        r19.xyzw = r19.xyzw + r8.xyxy;
        r19.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r19.xyzw;
        r20.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r19.xy, r6.w, int2(0,0)).xyzw;
        r12.x = dot(r20.wz, r11.xx);
        r10.y = r7.w * r12.x + r10.y;
        r12.x = dot(r20.xy, r11.xx);
        r10.y = r5.w * r12.x + r10.y;
        r12.x = dot(r16.xy, r8.ww);
        r10.y = r7.w * r12.x + r10.y;
        r12.x = dot(r20.wz, r8.ww);
        r10.y = r5.w * r12.x + r10.y;
        r16.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r19.zw, r6.w, int2(0,0)).xyzw;
        r12.x = dot(r16.wz, r11.xx);
        r10.y = r7.w * r12.x + r10.y;
        r12.x = dot(r16.xy, r11.xx);
        r10.y = r5.w * r12.x + r10.y;
        r12.x = dot(r24.xy, r8.ww);
        r10.y = r7.w * r12.x + r10.y;
        r12.x = dot(r16.wz, r8.ww);
        r10.y = r5.w * r12.x + r10.y;
        r19.xyzw = g_fCubeClampWidth * float4(6,-6,10,-6) + r6.yzyz;
        r19.xyzw = max(g_fCubeClampWidth, r19.xyzw);
        r19.xyzw = min(r19.xyzw, r5.xxxx);
        r19.xyzw = r19.xyzw + r8.xyxy;
        r19.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r19.xyzw;
        r22.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r19.xy, r6.w, int2(0,0)).xyzw;
        r12.x = r11.x + -r8.w;
        r12.x = r5.z * r12.x + r8.w;
        r14.xz = r22.zy * r12.xx;
        r14.xw = r22.wx * r11.xx + r14.xz;
        r10.y = r7.w * r14.x + r10.y;
        r10.y = r5.w * r14.w + r10.y;
        r13.w = dot(r18.xy, r8.ww);
        r10.y = r7.w * r13.w + r10.y;
        r13.w = dot(r22.wz, r8.ww);
        r10.y = r5.w * r13.w + r10.y;
        r18.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r19.zw, r6.w, int2(0,0)).xyzw;
        r7.y = -r7.y * 8.5 + r8.w;
        r7.y = r5.z * r7.y + r9.z;
        r14.xw = r18.yz * r23.zz;
        r14.xw = r18.xw * r7.yy + r14.xw;
        r10.y = r7.w * r14.w + r10.y;
        r10.y = r5.w * r14.x + r10.y;
        r13.y = r21.x * r7.y + r13.y;
        r10.y = r7.w * r13.y + r10.y;
        r10.y = r5.w * r14.w + r10.y;
        r18.xyzw = g_fCubeClampWidth * float4(14,-6,2,-2) + r6.yzyz;
        r18.xyzw = max(g_fCubeClampWidth, r18.xyzw);
        r18.xyzw = min(r18.xyzw, r5.xxxx);
        r18.xyzw = r18.xyzw + r8.xyxy;
        r18.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r18.xyzw;
        r19.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r18.xy, r6.w, int2(0,0)).xyzw;
        r13.yw = r19.yz * r5.zz;
        r13.yw = r13.yw * r9.xx;
        r13.yw = r19.xw * r23.ww + r13.yw;
        r10.y = r7.w * r13.w + r10.y;
        r10.y = r5.w * r13.y + r10.y;
        r10.y = r7.w * r13.x + r10.y;
        r10.y = r5.w * r13.w + r10.y;
        r17.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.zw, r6.w, int2(0,0)).xyzw;
        r13.xw = r17.yz * r23.xx;
        r13.xw = r17.xw * r10.xx + r13.xw;
        r10.y = r7.w * r13.w + r10.y;
        r10.y = r5.w * r13.x + r10.y;
        r10.y = r7.w * r11.y + r10.y;
        r10.y = r5.w * r13.w + r10.y;
        r15.xz = g_fCubeClampWidth * float2(-10,-2) + r6.yz;
        r15.xz = max(g_fCubeClampWidth, r15.xz);
        r15.xz = min(r15.xz, r5.xx);
        r15.xz = r15.xz + r8.xy;
        r15.xz = float2(0.5,0.333333343) * r15.xz;
        r17.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r15.xz, r6.w, int2(0,0)).xyzw;
        r15.xz = r17.yz * r10.zz;
        r15.xz = r17.xw * r23.yy + r15.xz;
        r10.y = r7.w * r15.z + r10.y;
        r10.y = r5.w * r15.x + r10.y;
        r10.y = r7.w * r13.z + r10.y;
        r10.y = r5.w * r15.z + r10.y;
        r17.xyzw = g_fCubeClampWidth * float4(-6,-2,-6,2) + r6.yzyz;
        r17.xyzw = max(g_fCubeClampWidth, r17.xyzw);
        r17.xyzw = min(r17.xyzw, r5.xxxx);
        r17.xyzw = r17.xyzw + r8.xyxy;
        r17.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r17.xyzw;
        r19.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.xy, r6.w, int2(0,0)).xyzw;
        r11.y = r11.x + -r11.z;
        r11.y = r5.z * r11.y + r11.z;
        r13.zw = r19.yz * r11.yy;
        r13.zw = r19.xw * r11.ww + r13.zw;
        r10.y = r7.w * r13.w + r10.y;
        r10.y = r5.w * r13.z + r10.y;
        r14.y = r14.y * r11.y + r15.y;
        r10.y = r7.w * r14.y + r10.y;
        r10.y = r5.w * r13.w + r10.y;
        r14.yw = g_fCubeClampWidth * float2(-2,-2) + r6.yz;
        r14.yw = max(g_fCubeClampWidth, r14.yw);
        r14.yw = min(r14.yw, r5.xx);
        r14.yw = r14.yw + r8.xy;
        r14.yw = float2(0.5,0.333333343) * r14.yw;
        r19.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r14.yw, r6.w, int2(0,0)).xyzw;
        r15.yzw = -r12.zzw + r11.zzz;
        r15.yzw = r5.zzz * r15.yzw + r12.yzw;
        r21.xyz = r19.wxx * r15.zzw;
        r14.yw = r19.zy * r12.zz + r21.xy;
        r10.y = r7.w * r14.y + r10.y;
        r10.y = r5.w * r14.w + r10.y;
        r12.y = r11.z + -r8.z;
        r12.y = r5.z * r12.y + r8.z;
        r13.w = r20.y * r12.y;
        r13.w = r20.x * r11.z + r13.w;
        r10.y = r7.w * r13.w + r10.y;
        r12.y = r19.z * r12.y;
        r12.y = r19.w * r11.z + r12.y;
        r10.y = r5.w * r12.y + r10.y;
        r18.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r18.zw, r6.w, int2(0,0)).xyzw;
        r12.y = r12.z + -r9.w;
        r12.y = r5.z * r12.y + r9.w;
        r13.w = r9.w + -r5.y;
        r13.w = r5.z * r13.w + r5.y;
        r14.yw = r18.zy * r13.ww;
        r16.zw = r18.wx * r12.yy + r14.yw;
        r10.y = r7.w * r16.z + r10.y;
        r10.y = r5.w * r16.w + r10.y;
        r8.z = -r10.w + r8.z;
        r8.z = r5.z * r8.z + r10.w;
        r10.w = r10.w + -r5.y;
        r10.w = r5.z * r10.w + r5.y;
        r14.y = r16.y * r10.w;
        r14.y = r16.x * r8.z + r14.y;
        r10.y = r7.w * r14.y + r10.y;
        r10.w = r18.z * r10.w;
        r8.z = r18.w * r8.z + r10.w;
        r8.z = r5.w * r8.z + r10.y;
        r16.xyzw = g_fCubeClampWidth * float4(6,-2,10,-2) + r6.yzyz;
        r16.xyzw = max(g_fCubeClampWidth, r16.xyzw);
        r16.xyzw = min(r16.xyzw, r5.xxxx);
        r16.xyzw = r16.xyzw + r8.xyxy;
        r16.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r16.xyzw;
        r20.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r16.xy, r6.w, int2(0,0)).xyzw;
        r10.y = r5.y + -r11.x;
        r10.y = r5.z * r10.y + r11.x;
        r16.xy = r20.yz * r12.xx;
        r16.xy = r20.xw * r10.yy + r16.xy;
        r8.z = r7.w * r16.y + r8.z;
        r8.z = r5.w * r16.x + r8.z;
        r10.w = r22.x * r10.y + r14.z;
        r8.z = r7.w * r10.w + r8.z;
        r8.z = r5.w * r16.y + r8.z;
        r20.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r16.zw, r6.w, int2(0,0)).xyzw;
        r14.yz = r20.yz * r23.zz;
        r14.yz = r20.xw * r7.yy + r14.yz;
        r8.z = r7.w * r14.z + r8.z;
        r8.z = r5.w * r14.y + r8.z;
        r8.z = r7.w * r14.x + r8.z;
        r8.z = r5.w * r14.z + r8.z;
        r20.xyzw = g_fCubeClampWidth * float4(14,-2,6,2) + r6.yzyz;
        r20.xyzw = max(g_fCubeClampWidth, r20.xyzw);
        r20.xyzw = min(r20.xyzw, r5.xxxx);
        r20.xyzw = r20.xyzw + r8.xyxy;
        r20.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r20.xyzw;
        r22.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r20.xy, r6.w, int2(0,0)).xyzw;
        r14.xz = r22.yz * r5.zz;
        r14.xz = r14.xz * r9.xx;
        r14.xz = r22.xw * r23.ww + r14.xz;
        r8.z = r7.w * r14.z + r8.z;
        r8.z = r5.w * r14.x + r8.z;
        r8.z = r7.w * r13.y + r8.z;
        r8.z = r5.w * r14.z + r8.z;
        r22.xyzw = g_fCubeClampWidth * float4(-14,2,2,2) + r6.yzyz;
        r22.xyzw = max(g_fCubeClampWidth, r22.xyzw);
        r22.xyzw = min(r22.xyzw, r5.xxxx);
        r22.xyzw = r22.xyzw + r8.xyxy;
        r22.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r22.xyzw;
        r24.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r22.xy, r6.w, int2(0,0)).xyzw;
        r16.yz = r24.yz * r23.xx;
        r16.yz = r24.xw * r10.xx + r16.yz;
        r8.z = r7.w * r16.z + r8.z;
        r8.z = r5.w * r16.y + r8.z;
        r8.z = r7.w * r13.x + r8.z;
        r8.z = r5.w * r16.z + r8.z;
        r24.xyzw = g_fCubeClampWidth * float4(-10,2,-10,6) + r6.yzyz;
        r24.xyzw = max(g_fCubeClampWidth, r24.xyzw);
        r24.xyzw = min(r24.xyzw, r5.xxxx);
        r24.xyzw = r24.xyzw + r8.xyxy;
        r24.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r24.xyzw;
        r25.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r24.xy, r6.w, int2(0,0)).xyzw;
        r13.xy = r25.yz * r10.zz;
        r13.xy = r25.xw * r23.yy + r13.xy;
        r8.z = r7.w * r13.y + r8.z;
        r8.z = r5.w * r13.x + r8.z;
        r8.z = r7.w * r15.x + r8.z;
        r8.z = r5.w * r13.y + r8.z;
        r17.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.zw, r6.w, int2(0,0)).xyzw;
        r16.zw = r17.yz * r11.yy;
        r16.zw = r17.xw * r11.ww + r16.zw;
        r8.z = r7.w * r16.w + r8.z;
        r8.z = r5.w * r16.z + r8.z;
        r8.z = r7.w * r13.z + r8.z;
        r8.z = r5.w * r16.w + r8.z;
        r17.xyzw = g_fCubeClampWidth * float4(-2,2,-6,14) + r6.yzyz;
        r17.xyzw = max(g_fCubeClampWidth, r17.xyzw);
        r17.xyzw = min(r17.xyzw, r5.xxxx);
        r17.xyzw = r17.xyzw + r8.xyxy;
        r17.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r17.xyzw;
        r25.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.xy, r6.w, int2(0,0)).xyzw;
        r15.xyz = r25.wxw * r15.yzw;
        r13.yz = r25.zy * r12.zz + r15.xy;
        r8.z = r7.w * r13.y + r8.z;
        r8.z = r5.w * r13.z + r8.z;
        r10.w = r12.w + -r7.z;
        r10.w = r5.z * r10.w + r7.z;
        r12.z = r19.y * r10.w + r21.z;
        r8.z = r7.w * r12.z + r8.z;
        r10.w = r25.z * r10.w + r15.z;
        r8.z = r5.w * r10.w + r8.z;
        r15.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r22.zw, r6.w, int2(0,0)).xyzw;
        r12.zw = r15.zy * r13.ww;
        r12.yw = r15.wx * r12.yy + r12.zw;
        r8.z = r7.w * r12.y + r8.z;
        r8.z = r5.w * r12.w + r8.z;
        r7.z = r7.z + -r9.w;
        r7.z = r5.z * r7.z + r9.w;
        r9.w = r18.x * r7.z + r14.w;
        r8.z = r7.w * r9.w + r8.z;
        r7.z = r15.w * r7.z + r12.z;
        r7.z = r5.w * r7.z + r8.z;
        r18.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r20.zw, r6.w, int2(0,0)).xyzw;
        r12.yz = r18.yz * r12.xx;
        r12.yz = r18.xw * r10.yy + r12.yz;
        r7.z = r7.w * r12.z + r7.z;
        r7.z = r5.w * r12.y + r7.z;
        r7.z = r7.w * r16.x + r7.z;
        r7.z = r5.w * r12.z + r7.z;
        r18.xyzw = g_fCubeClampWidth * float4(10,2,14,2) + r6.yzyz;
        r18.xyzw = max(g_fCubeClampWidth, r18.xyzw);
        r18.xyzw = min(r18.xyzw, r5.xxxx);
        r18.xyzw = r18.xyzw + r8.xyxy;
        r18.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r18.xyzw;
        r19.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r18.xy, r6.w, int2(0,0)).xyzw;
        r12.zw = r19.yz * r23.zz;
        r12.zw = r19.xw * r7.yy + r12.zw;
        r7.z = r7.w * r12.w + r7.z;
        r7.z = r5.w * r12.z + r7.z;
        r7.z = r7.w * r14.y + r7.z;
        r7.z = r5.w * r12.w + r7.z;
        r18.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r18.zw, r6.w, int2(0,0)).xyzw;
        r13.yz = r18.yz * r5.zz;
        r13.yz = r13.yz * r9.xx;
        r13.yz = r18.xw * r23.ww + r13.yz;
        r7.z = r7.w * r13.z + r7.z;
        r7.z = r5.w * r13.y + r7.z;
        r7.z = r7.w * r14.x + r7.z;
        r7.z = r5.w * r13.z + r7.z;
        r13.zw = g_fCubeClampWidth * float2(-14,6) + r6.yz;
        r13.zw = max(g_fCubeClampWidth, r13.zw);
        r13.zw = min(r13.zw, r5.xx);
        r13.zw = r13.zw + r8.xy;
        r13.zw = float2(0.5,0.333333343) * r13.zw;
        r14.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r13.zw, r6.w, int2(0,0)).xyzw;
        r13.zw = r14.yz * r23.xx;
        r13.zw = r14.xw * r10.xx + r13.zw;
        r7.z = r7.w * r13.w + r7.z;
        r7.z = r5.w * r13.z + r7.z;
        r7.z = r7.w * r16.y + r7.z;
        r7.z = r5.w * r13.w + r7.z;
        r14.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r24.zw, r6.w, int2(0,0)).xyzw;
        r14.yz = r14.yz * r10.zz;
        r14.xy = r14.xw * r23.yy + r14.yz;
        r7.z = r7.w * r14.y + r7.z;
        r7.z = r5.w * r14.x + r7.z;
        r7.z = r7.w * r13.x + r7.z;
        r7.z = r5.w * r14.y + r7.z;
        r18.xyzw = g_fCubeClampWidth * float4(-6,6,-6,10) + r6.yzyz;
        r18.xyzw = max(g_fCubeClampWidth, r18.xyzw);
        r18.xyzw = min(r18.xyzw, r5.xxxx);
        r18.xyzw = r18.xyzw + r8.xyxy;
        r18.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r18.xyzw;
        r19.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r18.xy, r6.w, int2(0,0)).xyzw;
        r13.xw = r19.wx * r11.ww;
        r14.yz = r19.zy * r11.xx + r13.xw;
        r7.z = r7.w * r14.y + r7.z;
        r7.z = r5.w * r14.z + r7.z;
        r7.z = r7.w * r16.z + r7.z;
        r8.z = r19.z * r11.y + r13.x;
        r7.z = r5.w * r8.z + r7.z;
        r16.xyzw = g_fCubeClampWidth * float4(-2,6,-2,10) + r6.yzyz;
        r16.xyzw = max(g_fCubeClampWidth, r16.xyzw);
        r16.xyzw = min(r16.xyzw, r5.xxxx);
        r16.xyzw = r16.xyzw + r8.xyxy;
        r16.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r16.xyzw;
        r20.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r16.xy, r6.w, int2(0,0)).xyzw;
        r8.z = dot(r20.wz, r11.xx);
        r7.z = r7.w * r8.z + r7.z;
        r8.z = dot(r20.xy, r11.xx);
        r7.z = r5.w * r8.z + r7.z;
        r8.z = dot(r25.xy, r11.zz);
        r7.z = r7.w * r8.z + r7.z;
        r8.z = dot(r20.wz, r11.zz);
        r7.z = r5.w * r8.z + r7.z;
        r21.xyzw = g_fCubeClampWidth * float4(2,6,6,6) + r6.yzyz;
        r21.xyzw = max(g_fCubeClampWidth, r21.xyzw);
        r21.xyzw = min(r21.xyzw, r5.xxxx);
        r21.xyzw = r21.xyzw + r8.xyxy;
        r21.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r21.xyzw;
        r22.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r21.xy, r6.w, int2(0,0)).xyzw;
        r8.z = dot(r22.wz, r11.xx);
        r7.z = r7.w * r8.z + r7.z;
        r8.z = dot(r22.xy, r11.xx);
        r7.z = r5.w * r8.z + r7.z;
        r8.z = r11.z + -r5.y;
        r5.y = r5.z * r8.z + r5.y;
        r8.z = r15.y * r5.y;
        r8.z = r15.x * r11.z + r8.z;
        r7.z = r7.w * r8.z + r7.z;
        r5.y = r22.z * r5.y;
        r5.y = r22.w * r11.z + r5.y;
        r5.y = r5.w * r5.y + r7.z;
        r15.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r21.zw, r6.w, int2(0,0)).xyzw;
        r11.yz = r15.zy * r12.xx;
        r11.xz = r15.wx * r11.xx + r11.yz;
        r5.y = r7.w * r11.x + r5.y;
        r5.y = r5.w * r11.z + r5.y;
        r5.y = r7.w * r12.y + r5.y;
        r7.z = r15.w * r10.y + r11.y;
        r5.y = r5.w * r7.z + r5.y;
        r11.xyzw = g_fCubeClampWidth * float4(10,6,14,6) + r6.yzyz;
        r11.xyzw = max(g_fCubeClampWidth, r11.xyzw);
        r11.xyzw = min(r11.xyzw, r5.xxxx);
        r11.xyzw = r11.xyzw + r8.xyxy;
        r11.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r11.xyzw;
        r21.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r11.xy, r6.w, int2(0,0)).xyzw;
        r10.yw = r21.yz * r23.zz;
        r10.yw = r21.xw * r7.yy + r10.yw;
        r5.y = r7.w * r10.w + r5.y;
        r5.y = r5.w * r10.y + r5.y;
        r5.y = r7.w * r12.z + r5.y;
        r5.y = r5.w * r10.w + r5.y;
        r11.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r11.zw, r6.w, int2(0,0)).xyzw;
        r11.yz = r11.yz * r5.zz;
        r11.yz = r11.yz * r9.xx;
        r11.xy = r11.xw * r23.ww + r11.yz;
        r5.y = r7.w * r11.y + r5.y;
        r5.y = r5.w * r11.x + r5.y;
        r5.y = r7.w * r13.y + r5.y;
        r5.y = r5.w * r11.y + r5.y;
        r12.xyzw = g_fCubeClampWidth * float4(-14,10,-14,14) + r6.yzyz;
        r12.xyzw = max(g_fCubeClampWidth, r12.xyzw);
        r12.xyzw = min(r12.xyzw, r5.xxxx);
        r12.xyzw = r12.xyzw + r8.xyxy;
        r12.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r12.xyzw;
        r21.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r12.xy, r6.w, int2(0,0)).xyzw;
        r11.yz = r21.yz * r23.xx;
        r11.yz = r21.xw * r10.xx + r11.yz;
        r5.y = r7.w * r11.z + r5.y;
        r5.y = r5.w * r11.y + r5.y;
        r5.y = r7.w * r13.z + r5.y;
        r5.y = r5.w * r11.z + r5.y;
        r13.xyzw = g_fCubeClampWidth * float4(-10,10,-10,14) + r6.yzyz;
        r13.xyzw = max(g_fCubeClampWidth, r13.xyzw);
        r13.xyzw = min(r13.xyzw, r5.xxxx);
        r13.xyzw = r13.xyzw + r8.xyxy;
        r13.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r13.xyzw;
        r21.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r13.xy, r6.w, int2(0,0)).xyzw;
        r11.zw = r21.wx * r23.yy;
        r12.xy = r21.zy * r9.zz + r11.zw;
        r5.y = r7.w * r12.x + r5.y;
        r5.y = r5.w * r12.y + r5.y;
        r5.y = r7.w * r14.x + r5.y;
        r7.z = r21.z * r10.z + r11.z;
        r5.y = r5.w * r7.z + r5.y;
        r14.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r18.zw, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r14.wz, r9.zz);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r14.xy, r9.zz);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r19.xy, r8.ww);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r14.wz, r8.ww);
        r5.y = r5.w * r7.z + r5.y;
        r16.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r16.zw, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r16.wz, r9.zz);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r16.xy, r9.zz);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r20.xy, r8.ww);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r16.wz, r8.ww);
        r5.y = r5.w * r7.z + r5.y;
        r18.xyzw = g_fCubeClampWidth * float4(2,10,2,14) + r6.yzyz;
        r18.xyzw = max(g_fCubeClampWidth, r18.xyzw);
        r18.xyzw = min(r18.xyzw, r5.xxxx);
        r18.xyzw = r18.xyzw + r8.xyxy;
        r18.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r18.xyzw;
        r19.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r18.xy, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r19.wz, r9.zz);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r19.xy, r9.zz);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r22.xy, r8.ww);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r19.wz, r8.ww);
        r5.y = r5.w * r7.z + r5.y;
        r20.xyzw = g_fCubeClampWidth * float4(6,10,6,14) + r6.yzyz;
        r20.xyzw = max(g_fCubeClampWidth, r20.xyzw);
        r20.xyzw = min(r20.xyzw, r5.xxxx);
        r20.xyzw = r20.xyzw + r8.xyxy;
        r20.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r20.xyzw;
        r22.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r20.xy, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r22.wz, r9.zz);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r22.xy, r9.zz);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r15.xy, r8.ww);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r22.wz, r8.ww);
        r5.y = r5.w * r7.z + r5.y;
        r8.zw = g_fCubeClampWidth * float2(10,10) + r6.yz;
        r8.zw = max(g_fCubeClampWidth, r8.zw);
        r8.zw = min(r8.zw, r5.xx);
        r8.zw = r8.zw + r8.xy;
        r8.zw = float2(0.5,0.333333343) * r8.zw;
        r15.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r8.zw, r6.w, int2(0,0)).xyzw;
        r8.zw = r15.zy * r23.zz;
        r9.zw = r15.wx * r9.zz + r8.zw;
        r5.y = r7.w * r9.z + r5.y;
        r5.y = r5.w * r9.w + r5.y;
        r5.y = r7.w * r10.y + r5.y;
        r7.y = r15.w * r7.y + r8.z;
        r5.y = r5.w * r7.y + r5.y;
        r24.xyzw = g_fCubeClampWidth * float4(14,10,10,14) + r6.yzyz;
        r24.xyzw = max(g_fCubeClampWidth, r24.xyzw);
        r24.xyzw = min(r24.xyzw, r5.xxxx);
        r24.xyzw = r24.xyzw + r8.xyxy;
        r24.xyzw = float4(0.5,0.333333343,0.5,0.333333343) * r24.xyzw;
        r25.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r24.xy, r6.w, int2(0,0)).xyzw;
        r7.yz = r25.yz * r5.zz;
        r7.yz = r7.yz * r9.xx;
        r7.yz = r25.xw * r23.ww + r7.yz;
        r5.y = r7.w * r7.z + r5.y;
        r5.y = r5.w * r7.y + r5.y;
        r5.y = r7.w * r11.x + r5.y;
        r5.y = r5.w * r7.z + r5.y;
        r12.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r12.zw, r6.w, int2(0,0)).xyzw;
        r8.zw = r12.wx * r10.xx;
        r9.zw = r12.zy * r9.xx + r8.zw;
        r5.y = r7.w * r9.z + r5.y;
        r5.y = r5.w * r9.w + r5.y;
        r5.y = r7.w * r11.y + r5.y;
        r7.z = r12.z * r23.x + r8.z;
        r5.y = r5.w * r7.z + r5.y;
        r10.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r13.zw, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r10.wz, r9.xx);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.xy, r9.xx);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r21.xy, r9.yy);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.wz, r9.yy);
        r5.y = r5.w * r7.z + r5.y;
        r10.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r17.zw, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r10.wz, r9.xx);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.xy, r9.xx);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r14.xy, r9.yy);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.wz, r9.yy);
        r5.y = r5.w * r7.z + r5.y;
        r8.zw = g_fCubeClampWidth * float2(-2,14) + r6.yz;
        r8.zw = max(g_fCubeClampWidth, r8.zw);
        r8.zw = min(r8.zw, r5.xx);
        r8.zw = r8.zw + r8.xy;
        r8.zw = float2(0.5,0.333333343) * r8.zw;
        r10.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r8.zw, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r10.wz, r9.xx);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.xy, r9.xx);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r16.xy, r9.yy);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.wz, r9.yy);
        r5.y = r5.w * r7.z + r5.y;
        r10.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r18.zw, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r10.wz, r9.xx);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.xy, r9.xx);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r19.xy, r9.yy);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.wz, r9.yy);
        r5.y = r5.w * r7.z + r5.y;
        r10.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r20.zw, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r10.wz, r9.xx);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.xy, r9.xx);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r22.xy, r9.yy);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.wz, r9.yy);
        r5.y = r5.w * r7.z + r5.y;
        r10.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r24.zw, r6.w, int2(0,0)).xyzw;
        r7.z = dot(r10.wz, r9.xx);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.xy, r9.xx);
        r5.y = r5.w * r7.z + r5.y;
        r7.z = dot(r15.xy, r9.yy);
        r5.y = r7.w * r7.z + r5.y;
        r7.z = dot(r10.wz, r9.yy);
        r5.y = r5.w * r7.z + r5.y;
        r6.yz = g_fCubeClampWidth * float2(14,14) + r6.yz;
        r6.yz = max(g_fCubeClampWidth, r6.yz);
        r6.yz = min(r6.yz, r5.xx);
        r6.yz = r6.yz + r8.xy;
        r6.yz = float2(0.5,0.333333343) * r6.yz;
        r8.xyzw = g_xShadowCubeMap.GatherCmp(g_xShadowCmpSamplerLessEqual_s, r6.yz, r6.w, int2(0,0)).xyzw;
        r5.xz = r8.zy * r5.zz;
        r5.xz = r5.xz * r9.xx;
        r6.yz = r8.wx * r9.xx + r5.xz;
        r5.y = r7.w * r6.y + r5.y;
        r5.y = r5.w * r6.z + r5.y;
        r5.y = r7.w * r7.y + r5.y;
        r5.x = r8.w * r23.w + r5.x;
        r5.x = r5.w * r5.x + r5.y;
        r5.x = r5.x / r7.x;
      } else {
        r5.x = r6.x ? 0 : 1;
      }
    } else {
      r5.x = 1;
    }
    r5.x = 1 + -r5.x;
    o0.w = -g_fShadowStrength * r5.x + 1;
  } else {
    o0.w = 1;
  }
  r5.xyz = g_xLightColour.xyz * r4.www;
  if (g_bUseProjCube != 0) {
    r6.x = dot(r4.xyz, g_xLightOrientation._m00_m10_m20);
    r6.y = dot(r4.xyz, g_xLightOrientation._m01_m11_m21);
    r6.z = dot(r4.xyz, g_xLightOrientation._m02_m12_m22);
    r4.xyz = g_xProjCubeMap.Sample(g_xTrilinearClamp_s, r6.xyz).xyz;
    if (g_bUseDualProjCube != 0) {
      r6.xyz = g_xProjCubeMapBlurred.Sample(g_xTrilinearClamp_s, r6.xyz).xyz;
      r3.w = g_fRcpProjCubeLerpDist * r3.w;
      r3.w = min(1, r3.w);
      r6.xyz = r6.xyz + -r4.xyz;
      r4.xyz = r3.www * r6.xyz + r4.xyz;
    }
    r5.xyz = r5.xyz * r4.xyz;
  }
  r1.xyw = g_xCamPos.xyz + -r1.xyw;
  r3.w = dot(r1.xyw, r1.xyw);
  r3.w = rsqrt(r3.w);
  r4.xyz = r3.www * r1.xyw;
  r2.xyz = r2.xyz / r2.www;
  r2.w = dot(r5.xyz, float3(0.333000004,0.333000004,0.333000004));
  r4.w = dot(r3.xyz, r2.xyz);
  r4.w = min(1, r4.w);
  r6.yw = float2(0.994140625,0.998046875);
  r6.z = r0.w;
  r0.w = g_xMaterialsTexture.Sample(g_xPointClamp_s, r6.yz).w;
  r0.w = r0.w + r0.w;
  r6.x = r4.w * 0.490234375 + 0.4921875;
  r5.w = g_xMaterialsTexture.Sample(g_xTrilinearClamp_s, r6.xz).x;
  r5.w = r5.w + r5.w;
  r7.xyz = r5.www * r5.xyz;
  r8.xyz = r0.xyz * r2.www + -r5.xyz;
  r5.xyz = r0.www * r8.xyz + r5.xyz;
  r6.xy = g_xMaterialsTexture.Sample(g_xTrilinearClamp_s, r6.wz).xw;
  r0.w = r6.y + r6.y;
  r2.w = 256 * r6.x;
  r2.w = r2.w * r2.w;
  r1.xyw = r1.xyw * r3.www + r2.xyz;
  r2.x = dot(r1.xyw, r1.xyw);
  r2.x = rsqrt(r2.x);
  r1.xyw = r2.xxx * r1.xyw;
  r1.x = dot(r3.xyz, r1.xyw);
  r1.x = max(9.99999997e-007, r1.x);
  r1.x = log2(r1.x);
  r1.x = r2.w * r1.x;
  r1.x = exp2(r1.x);
  r1.x = r2.w * r1.x;
  r1.x = 0.03125 * r1.x;
  r1.y = max(0, r4.w);
  r1.w = saturate(dot(r3.xyz, r4.xyz));
  r2.x = 0.5 + r4.w;
  r2.x = max(0, r2.x);
  r1.w = 1 + -r1.w;
  r2.y = r1.w * r1.w;
  r2.y = r2.y * r2.y;
  r1.w = r2.y * r1.w;
  r0.w = r1.w * r0.w;
  r0.w = r0.w * r2.x;
  r0.w = 2.5 * r0.w;
  r0.w = r1.x * r1.y + r0.w;
  r0.w = r0.w * r1.z;
  r1.xyz = r5.xyz * r0.www;
  r0.xyz = r7.xyz * r0.xyz + r1.xyz;
  o0.xyz = min(float3(31.875,31.875,31.875), r0.xyz);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//
// Buffer Definitions: 
//
// cbuffer FrameConstants
// {
//
//   float4x4 g_xView;                  // Offset:    0 Size:    64 [unused]
//   float4x4 g_xProj;                  // Offset:   64 Size:    64 [unused]
//   float4x4 g_xViewProj;              // Offset:  128 Size:    64 [unused]
//   float4x4 g_xInvView;               // Offset:  192 Size:    64
//   float4x4 g_xInvProj;               // Offset:  256 Size:    64 [unused]
//   float4x4 g_xInvViewProj;           // Offset:  320 Size:    64 [unused]
//   float3 g_xCamPos;                  // Offset:  384 Size:    12
//   float2 g_xRcpScreenDims;           // Offset:  400 Size:     8 [unused]
//   float2 g_xDepthProjViewUnpack;     // Offset:  408 Size:     8 [unused]
//   float4 g_axViewFrustumPlanes[6];   // Offset:  416 Size:    96 [unused]
//
// }
//
// cbuffer ShadowReadConstants
// {
//
//   float g_f2DFilterSize;             // Offset:    0 Size:     4 [unused]
//   float g_fCubeFilterSize;           // Offset:    4 Size:     4
//   float g_fCubeClampWidth;           // Offset:    8 Size:     4
//   float g_fSunWidth;                 // Offset:   12 Size:     4
//
// }
//
// cbuffer PointParams
// {
//
//   float2 g_xCameraTanHalfFOV;        // Offset:    0 Size:     8
//   float2 g_xTwoOverScreenDims;       // Offset:    8 Size:     8
//   float3 g_xLightPos;                // Offset:   16 Size:    12
//   float g_fLightRadius;              // Offset:   28 Size:     4 [unused]
//   float4x4 g_xLightOrientation;      // Offset:   32 Size:    64
//   float4x4 g_xCustomVolumeMatrix;    // Offset:   96 Size:    64 [unused]
//   float3 g_xLightDir;                // Offset:  160 Size:    12
//   float g_fRcpLightRadius;           // Offset:  172 Size:     4
//   float g_fLightFalloffScale;        // Offset:  176 Size:     4
//   float g_fLightFalloffPower;        // Offset:  180 Size:     4
//   float g_fLightAngleOuter;          // Offset:  184 Size:     4
//   float g_fRcpLightAngleRange;       // Offset:  188 Size:     4
//   float3 g_xLightColour;             // Offset:  192 Size:    12
//   bool g_bUseLimitAngles;            // Offset:  204 Size:     4
//   float g_fArcCosLimitAngle;         // Offset:  208 Size:     4 [unused]
//   float g_fRcpProjCubeLerpDist;      // Offset:  212 Size:     4
//   bool g_bUseProjCube;               // Offset:  216 Size:     4
//   bool g_bUseDualProjCube;           // Offset:  220 Size:     4
//   float g_fLightMeshRadius;          // Offset:  224 Size:     4 [unused]
//   float2 g_xDepthProjection;         // Offset:  228 Size:     8
//   float g_fShadowStrength;           // Offset:  236 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_xPointClamp                     sampler      NA          NA    1        1
// g_xTrilinearClamp                 sampler      NA          NA    3        1
// g_xShadowCmpSamplerLessEqual    sampler_c      NA          NA    9        1
// g_xMaterialsTexture               texture  float4          2d    0        1
// g_xNormalBuffer                   texture  float4          2d   24        1
// g_xAlbedoBuffer                   texture  float4          2d   25        1
// g_xProjCubeMap                    texture  float4        cube   26        1
// g_xProjCubeMapBlurred             texture  float4        cube   27        1
// g_xShadowCubeMap                  texture  float4          2d   28        1
// FrameConstants                    cbuffer      NA          NA    0        1
// PointParams                       cbuffer      NA          NA    4        1
// ShadowReadConstants               cbuffer      NA          NA    5        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[25], immediateIndexed
dcl_constantbuffer cb5[1], immediateIndexed
dcl_constantbuffer cb4[15], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s3, mode_default
dcl_sampler s9, mode_comparison
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t24
dcl_resource_texture2d (float,float,float,float) t25
dcl_resource_texturecube (float,float,float,float) t26
dcl_resource_texturecube (float,float,float,float) t27
dcl_resource_texture2d (float,float,float,float) t28
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xyzw
dcl_temps 26
ftoi r0.xy, v0.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.xyww, t24.xyzw
ld_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xyzw, t25.xyzw
dp2 r2.x, r1.xyxx, r1.xyxx
mad r3.z, r2.x, l(2.000000), l(-1.000000)
rsq r2.x, r2.x
mul r1.xy, r1.xyxx, r2.xxxx
mad r2.x, -r3.z, r3.z, l(1.000000)
sqrt r2.x, r2.x
mul r3.xy, r1.xyxx, r2.xxxx
mul r1.xy, r1.wwww, cb4[0].xyxx
mad r2.xy, v0.xyxx, cb4[0].zwzz, l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r1.xy, r1.xyxx, r2.xyxx
mul r2.xyz, r1.yyyy, cb0[13].xyzx
mad r2.xyz, cb0[12].xyzx, r1.xxxx, r2.xyzx
mad r1.xyw, cb0[14].xyxz, r1.wwww, r2.xyxz
add r1.xyw, r1.xyxw, cb0[15].xyxz
add r2.xyz, -r1.xywx, cb4[1].xyzx
dp3 r2.w, r2.xyzx, r2.xyzx
rsq r3.w, r2.w
mul r4.xyz, r2.xyzx, r3.wwww
sqrt r2.w, r2.w
mul r3.w, r2.w, cb4[10].w
mad r4.w, -r2.w, cb4[10].w, l(1.000000)
mul_sat r4.w, r4.w, cb4[11].x
log r4.w, r4.w
mul r4.w, r4.w, cb4[11].y
exp r4.w, r4.w
dp3 r5.x, r4.xyzx, cb4[10].xyzx
add r5.x, r5.x, cb4[11].z
mul_sat r5.x, r5.x, cb4[11].w
mul r5.x, r4.w, r5.x
movc r4.w, cb4[12].w, r5.x, r4.w
add r5.x, r4.w, l(-0.000100)
lt r5.x, r5.x, l(0.000000)
discard_nz r5.x
lt r5.x, l(0.000000), cb4[14].w
if_nz r5.x
  mul r5.xyz, r2.xyzx, l(-1.000000, 1.000000, -1.000000, 0.000000)
  max r5.w, |r5.z|, |r5.y|
  max r5.w, r5.w, |r5.x|
  eq r6.xyz, |r5.xyzx|, r5.wwww
  and r7.xyz, r6.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
  dp3 r6.z, r7.xyzx, r5.xyzx
  lt r6.w, l(0.000000), r6.z
  lt r6.z, r6.z, l(0.000000)
  iadd r6.z, r6.z, -r6.w
  itof r6.z, r6.z
  mov_sat r8.x, -r6.z
  dp2 r8.y, r7.zyzz, l(2.000000, 1.000000, 0.000000, 0.000000)
  mul r7.xyzw, r6.zzzz, l(0.000000, -1.000000, 0.000000, 1.000000)
  movc r6.zw, r6.yyyy, l(0,0,1.000000,0), r7.wwwz
  movc r7.zw, r6.yyyy, r7.zzzw, l(0,0,-1.000000,0)
  movc r6.yz, r6.xxxx, r7.xxyx, r6.zzwz
  movc r6.xw, r6.xxxx, l(-1.000000,0,0,0), r7.zzzw
  div r5.xyz, r5.xyzx, r5.wwww
  dp2 r6.y, r6.yzyy, r5.xzxx
  dp2 r6.z, r6.xwxx, r5.yzyy
  mad r5.xy, r6.yzyy, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
  div r5.z, cb4[14].z, r5.w
  add r6.w, r5.z, cb4[14].y
  div r5.z, l(1.000000, 1.000000, 1.000000, 1.000000), cb5[0].y
  mad r5.zw, r5.zzzz, r5.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)
  round_ni r7.xy, r5.zwzz
  add r5.zw, r5.zzzw, -r7.xxxy
  mad r6.yz, -r5.zzwz, cb5[0].yyyy, r5.xxyx
  mad r5.x, -cb5[0].z, l(3.000000), l(1.000000)
  mul r7.y, cb5[0].y, l(-7.000000)
  mov r7.w, l(0)
  mov r8.zw, l(0,0,0,0)
  mov r5.y, l(-7)
  loop 
    ilt r6.x, l(7), r5.y
    breakc_nz r6.x
    itof r6.x, r5.y
    mul r7.z, r6.x, cb5[0].y
    add r9.yzw, r6.yyzw, r7.yyzw
    max r7.xz, r9.yyzy, cb5[0].zzzz
    min r7.xz, r5.xxxx, r7.xxzx
    add r7.xz, r8.xxyx, r7.xxzx
    mul r7.xz, r7.xxzx, l(0.500000, 0.000000, 0.333333, 0.000000)
    gather4_indexable(texture2d)(float,float,float,float) r10.xyzw, r7.xzxx, t28.xyzw, s1.x
    ge r11.xyzw, r10.xyzw, r9.wwww
    movc r11.xyzw, r11.xyzw, l(0,0,0,0), l(1.000000,1.000000,1.000000,1.000000)
    dp4 r6.x, r11.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    dp4 r7.x, r10.xyzw, r11.xyzw
    mad r9.x, cb5[0].y, l(2.000000), r9.y
    max r10.xy, r9.xzxx, cb5[0].zzzz
    min r10.xy, r5.xxxx, r10.xyxx
    add r10.xy, r8.xyxx, r10.xyxx
    mul r10.xy, r10.xyxx, l(0.500000, 0.333333, 0.000000, 0.000000)
    gather4_indexable(texture2d)(float,float,float,float) r10.xyzw, r10.xyxx, t28.xyzw, s1.x
    ge r11.xyzw, r10.xyzw, r9.wwww
    movc r11.xyzw, r11.xyzw, l(0,0,0,0), l(1.000000,1.000000,1.000000,1.000000)
    dp4 r7.z, r11.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    add r6.x, r6.x, r7.z
    dp4 r7.z, r10.xyzw, r11.xyzw
    add r7.x, r7.z, r7.x
    mad r10.z, cb5[0].y, l(2.000000), r9.x
    mov r10.w, r9.z
    max r9.xy, r10.zwzz, cb5[0].zzzz
    min r9.xy, r5.xxxx, r9.xyxx
    add r9.xy, r8.xyxx, r9.xyxx
    mul r9.xy, r9.xyxx, l(0.500000, 0.333333, 0.000000, 0.000000)
    gather4_indexable(texture2d)(float,float,float,float) r11.xyzw, r9.xyxx, t28.xyzw, s1.x
    ge r12.xyzw, r11.xyzw, r9.wwww
    movc r12.xyzw, r12.xyzw, l(0,0,0,0), l(1.000000,1.000000,1.000000,1.000000)
    dp4 r7.z, r12.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    add r6.x, r6.x, r7.z
    dp4 r7.z, r11.xyzw, r12.xyzw
    add r7.x, r7.z, r7.x
    mad r10.y, cb5[0].y, l(2.000000), r10.z
    max r9.xy, r10.ywyy, cb5[0].zzzz
    min r9.xy, r5.xxxx, r9.xyxx
    add r9.xy, r8.xyxx, r9.xyxx
    mul r9.xy, r9.xyxx, l(0.500000, 0.333333, 0.000000, 0.000000)
    gather4_indexable(texture2d)(float,float,float,float) r11.xyzw, r9.xyxx, t28.xyzw, s1.x
    ge r12.xyzw, r11.xyzw, r9.wwww
    movc r12.xyzw, r12.xyzw, l(0,0,0,0), l(1.000000,1.000000,1.000000,1.000000)
    dp4 r7.z, r12.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    add r6.x, r6.x, r7.z
    dp4 r7.z, r11.xyzw, r12.xyzw
    add r7.x, r7.z, r7.x
    mad r10.x, cb5[0].y, l(2.000000), r10.y
    max r9.xy, r10.xwxx, cb5[0].zzzz
    min r9.xy, r5.xxxx, r9.xyxx
    add r9.xy, r8.xyxx, r9.xyxx
    mul r9.xy, r9.xyxx, l(0.500000, 0.333333, 0.000000, 0.000000)
    gather4_indexable(texture2d)(float,float,float,float) r11.xyzw, r9.xyxx, t28.xyzw, s1.x
    ge r12.xyzw, r11.xyzw, r9.wwww
    movc r12.xyzw, r12.xyzw, l(0,0,0,0), l(1.000000,1.000000,1.000000,1.000000)
    dp4 r7.z, r12.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    add r6.x, r6.x, r7.z
    dp4 r7.z, r11.xyzw, r12.xyzw
    add r7.x, r7.z, r7.x
    mad r10.z, cb5[0].y, l(2.000000), r10.x
    max r9.xy, r10.zwzz, cb5[0].zzzz
    min r9.xy, r5.xxxx, r9.xyxx
    add r9.xy, r8.xyxx, r9.xyxx
    mul r9.xy, r9.xyxx, l(0.500000, 0.333333, 0.000000, 0.000000)
    gather4_indexable(texture2d)(float,float,float,float) r11.xyzw, r9.xyxx, t28.xyzw, s1.x
    ge r12.xyzw, r11.xyzw, r9.wwww
    movc r12.xyzw, r12.xyzw, l(0,0,0,0), l(1.000000,1.000000,1.000000,1.000000)
    dp4 r7.z, r12.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    add r6.x, r6.x, r7.z
    dp4 r7.z, r11.xyzw, r12.xyzw
    add r7.x, r7.z, r7.x
    mad r10.y, cb5[0].y, l(2.000000), r10.z
    max r9.xy, r10.ywyy, cb5[0].zzzz
    min r9.xy, r5.xxxx, r9.xyxx
    add r9.xy, r8.xyxx, r9.xyxx
    mul r9.xy, r9.xyxx, l(0.500000, 0.333333, 0.000000, 0.000000)
    gather4_indexable(texture2d)(float,float,float,float) r11.xyzw, r9.xyxx, t28.xyzw, s1.x
    ge r12.xyzw, r11.xyzw, r9.wwww
    movc r12.xyzw, r12.xyzw, l(0,0,0,0), l(1.000000,1.000000,1.000000,1.000000)
    dp4 r7.z, r12.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    add r6.x, r6.x, r7.z
    dp4 r7.z, r11.xyzw, r12.xyzw
    add r7.x, r7.z, r7.x
    mad r10.x, cb5[0].y, l(2.000000), r10.y
    max r9.xy, r10.xwxx, cb5[0].zzzz
    min r9.xy, r5.xxxx, r9.xyxx
    add r9.xy, r8.xyxx, r9.xyxx
    mul r9.xy, r9.xyxx, l(0.500000, 0.333333, 0.000000, 0.000000)
    gather4_indexable(texture2d)(float,float,float,float) r10.xyzw, r9.xyxx, t28.xyzw, s1.x
    ge r9.xyzw, r10.xyzw, r9.wwww
    movc r9.xyzw, r9.xyzw, l(0,0,0,0), l(1.000000,1.000000,1.000000,1.000000)
    dp4 r7.z, r9.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
    add r6.x, r6.x, r7.z
    dp4 r7.z, r10.xyzw, r9.xyzw
    add r7.x, r7.z, r7.x
    add r8.w, r6.x, r8.w
    add r8.z, r7.x, r8.z
    iadd r5.y, r5.y, l(2)
  endloop 
  lt r5.y, l(0.000000), r8.w
  if_nz r5.y
    ge r6.x, r8.w, l(256.000000)
    if_z r6.x
      div r7.x, r8.z, r8.w
      add r7.y, r6.w, -r7.x
      mul r7.y, r7.y, cb5[0].w
      mul r7.y, r7.y, l(10.000000)
      div_sat r7.x, r7.y, r7.x
      mul r7.x, r7.x, r7.x
      and r5.y, r5.y, r7.x
      mul r7.x, r5.y, r5.y
      mul r7.y, r5.y, r7.x
      mul r9.xyzw, r7.yyyy, l(9.900000, 9.000000, 8.500000, 8.000000)
      mul r7.z, r7.x, l(3.000000)
      add r7.w, -r5.y, l(1.000000)
      mul r8.z, r7.w, r7.z
      mad r8.w, r8.z, l(0.200000), r9.w
      mul r10.xy, r7.yyyy, l(498.799988, 0.300000, 0.000000, 0.000000)
      mad r9.w, r8.w, l(10.000000), r10.x
      mul r10.x, r7.w, r7.w
      mul r10.z, r5.y, r10.x
      mul r11.xy, r10.zzzz, l(0.600000, 3.000000, 0.000000, 0.000000)
      mad r11.xz, r7.yyyy, l(7.000000, 0.000000, 0.300000, 0.000000), r11.xxyx
      mad r11.xz, r7.zzzz, r7.wwww, r11.xxzx
      mad r9.w, r11.x, l(7.000000), r9.w
      add r9.w, r8.w, r9.w
      mad r9.w, r7.y, l(54.799999), r9.w
      add r9.w, r8.w, r9.w
      add r9.w, r11.x, r9.w
      mad r9.w, r11.z, l(2.000000), r9.w
      mad r8.z, r10.z, l(3.000000), r8.z
      add r9.w, r8.z, r9.w
      mul r12.xy, r7.yyyy, l(0.200000, 0.100000, 0.000000, 0.000000)
      mad r10.w, r7.y, l(3.000000), r11.y
      mad r10.w, r7.z, r7.w, r10.w
      add r9.w, r9.w, r10.w
      mad r5.y, r7.x, r5.y, r11.y
      mad r5.y, r7.z, r7.w, r5.y
      add r7.x, r5.y, r9.w
      add r7.x, r11.x, r7.x
      add r7.x, r8.w, r7.x
      mad r7.x, r7.y, l(54.799999), r7.x
      add r7.x, r8.w, r7.x
      add r7.x, r11.x, r7.x
      add r7.x, r11.z, r7.x
      mul r9.w, r7.w, r10.x
      mad r12.yzw, r9.wwww, l(0.000000, 0.800000, 0.800000, 0.800000), r12.xxxy
      mad r12.yzw, r10.zzzz, l(0.000000, 3.000000, 3.000000, 3.000000), r12.yyzw
      mad r12.yzw, r7.zzzz, r7.wwww, r12.yyzw
      mad r7.x, r12.z, l(2.000000), r7.x
      mad r9.w, r9.w, l(0.800000), r10.y
      mad r9.w, r10.z, l(3.000000), r9.w
      mad r9.w, r7.z, r7.w, r9.w
      add r7.x, r7.x, r9.w
      add r7.x, r5.y, r7.x
      add r7.x, r11.x, r7.x
      add r7.x, r8.w, r7.x
      mad r7.x, r7.y, l(54.799999), r7.x
      add r7.x, r8.w, r7.x
      add r7.x, r11.x, r7.x
      add r7.x, r11.z, r7.x
      add r7.x, r12.w, r7.x
      mad r10.x, r10.x, r7.w, r12.x
      mad r10.x, r10.z, l(3.000000), r10.x
      mad r7.z, r7.z, r7.w, r10.x
      add r7.x, r7.z, r7.x
      add r7.x, r9.w, r7.x
      add r7.x, r5.y, r7.x
      add r7.x, r11.x, r7.x
      add r7.x, r8.w, r7.x
      mad r7.x, r7.y, l(54.799999), r7.x
      add r7.x, r8.w, r7.x
      add r7.x, r11.x, r7.x
      add r7.x, r11.z, r7.x
      mad r7.x, r12.z, l(2.000000), r7.x
      add r7.x, r9.w, r7.x
      add r7.x, r5.y, r7.x
      add r7.x, r11.x, r7.x
      add r7.x, r8.w, r7.x
      mad r7.x, r7.y, l(54.799999), r7.x
      add r7.x, r8.w, r7.x
      add r7.x, r11.x, r7.x
      mad r7.x, r11.z, l(4.000000), r7.x
      add r7.x, r5.y, r7.x
      add r7.x, r11.x, r7.x
      add r7.x, r8.w, r7.x
      mad r7.x, r7.y, l(54.799999), r7.x
      add r7.x, r8.w, r7.x
      mad r7.x, r11.x, l(7.000000), r7.x
      add r7.x, r8.w, r7.x
      mad r7.x, r7.y, l(54.799999), r7.x
      mad r7.x, r8.w, l(9.000000), r7.x
      mad r7.x, r7.y, l(444.000000), r7.x
      mad r13.xyzw, cb5[0].zzzz, l(-14.000000, -14.000000, -10.000000, -14.000000), r6.yzyz
      max r13.xyzw, r13.xyzw, cb5[0].zzzz
      min r13.xyzw, r5.xxxx, r13.xyzw
      add r13.xyzw, r8.xyxy, r13.xyzw
      mul r13.xyzw, r13.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r14.xyzw, r13.xyxx, t28.xyzw, s9.x, r6.w
      add r7.w, -r5.w, l(1.000000)
      mad r10.x, -r9.x, r5.z, r9.x
      mul r10.yz, r10.xxxx, r14.wwxw
      mad r11.yw, r14.zzzy, r9.xxxx, r10.yyyz
      mul r10.y, r5.w, r11.w
      mad r10.y, r7.w, r11.y, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r13.xyzw, r13.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r11.y, r13.wzww, r9.xxxx
      mad r10.y, r7.w, r11.y, r10.y
      dp2 r11.y, r13.xyxx, r9.xxxx
      mad r10.y, r5.w, r11.y, r10.y
      mad r15.xyzw, cb5[0].zzzz, l(-6.000000, -14.000000, -2.000000, -14.000000), r6.yzyz
      max r15.xyzw, r15.xyzw, cb5[0].zzzz
      min r15.xyzw, r5.xxxx, r15.xyzw
      add r15.xyzw, r8.xyxy, r15.xyzw
      mul r15.xyzw, r15.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r16.xyzw, r15.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r11.y, r16.wzww, r9.xxxx
      mad r10.y, r7.w, r11.y, r10.y
      dp2 r11.y, r16.xyxx, r9.xxxx
      mad r10.y, r5.w, r11.y, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r15.xyzw, r15.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r11.y, r15.wzww, r9.xxxx
      mad r10.y, r7.w, r11.y, r10.y
      dp2 r11.y, r15.xyxx, r9.xxxx
      mad r10.y, r5.w, r11.y, r10.y
      mad r17.xyzw, cb5[0].zzzz, l(2.000000, -14.000000, 6.000000, -14.000000), r6.yzyz
      max r17.xyzw, r17.xyzw, cb5[0].zzzz
      min r17.xyzw, r5.xxxx, r17.xyzw
      add r17.xyzw, r8.xyxy, r17.xyzw
      mul r17.xyzw, r17.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r18.xyzw, r17.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r11.y, r18.wzww, r9.xxxx
      mad r10.y, r7.w, r11.y, r10.y
      dp2 r11.y, r18.xyxx, r9.xxxx
      mad r10.y, r5.w, r11.y, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r17.xyzw, r17.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r11.y, r17.wzww, r9.xxxx
      mad r10.y, r7.w, r11.y, r10.y
      dp2 r11.y, r17.xyxx, r9.xxxx
      mad r10.y, r5.w, r11.y, r10.y
      mad r19.xyzw, cb5[0].zzzz, l(10.000000, -14.000000, 14.000000, -14.000000), r6.yzyz
      max r19.xyzw, r19.xyzw, cb5[0].zzzz
      min r19.xyzw, r5.xxxx, r19.xyzw
      add r19.xyzw, r8.xyxy, r19.xyzw
      mul r19.xyzw, r19.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r20.xyzw, r19.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r11.y, r20.wzww, r9.xxxx
      mad r10.y, r7.w, r11.y, r10.y
      dp2 r11.y, r20.xyxx, r9.xxxx
      mad r10.y, r5.w, r11.y, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r19.xyzw, r19.zwzz, t28.xyzw, s9.x, r6.w
      mul r11.yw, r5.zzzz, r19.zzzy
      mul r11.yw, r9.xxxx, r11.yyyw
      mad r13.zw, r19.wwwx, r9.xxxx, r11.yyyw
      mad r10.y, r7.w, r13.z, r10.y
      mad r10.y, r5.w, r13.w, r10.y
      mad r21.xyzw, cb5[0].zzzz, l(-14.000000, -10.000000, -10.000000, -10.000000), r6.yzyz
      max r21.xyzw, r21.xyzw, cb5[0].zzzz
      min r21.xyzw, r5.xxxx, r21.xyzw
      add r21.xyzw, r8.xyxy, r21.xyzw
      mul r21.xyzw, r21.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r22.xyzw, r21.xyxx, t28.xyzw, s9.x, r6.w
      mul r11.y, r5.z, r7.y
      mad r23.xyzw, r11.yyyy, l(0.900000, 0.500000, -0.500000, -0.900000), r9.yzyx
      mul r13.zw, r22.yyyz, r23.xxxx
      mad r13.zw, r22.xxxw, r10.xxxx, r13.zzzw
      mad r10.y, r7.w, r13.w, r10.y
      mad r10.y, r5.w, r13.z, r10.y
      mad r10.z, r14.y, r23.x, r10.z
      mad r10.y, r7.w, r10.z, r10.y
      mad r10.y, r5.w, r13.w, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r14.xyzw, r21.zwzz, t28.xyzw, s9.x, r6.w
      mul r15.zw, r23.yyyy, r14.wwwx
      mad r16.zw, r14.zzzy, r9.zzzz, r15.zzzw
      mad r10.y, r7.w, r16.z, r10.y
      mad r10.y, r5.w, r16.w, r10.y
      dp2 r10.z, r13.xyxx, r9.yyyy
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r14.wzww, r9.yyyy
      mad r10.y, r5.w, r10.z, r10.y
      mad r21.xyzw, cb5[0].zzzz, l(-6.000000, -10.000000, -2.000000, -10.000000), r6.yzyz
      max r21.xyzw, r21.xyzw, cb5[0].zzzz
      min r21.xyzw, r5.xxxx, r21.xyzw
      add r21.xyzw, r8.xyxy, r21.xyzw
      mul r21.xyzw, r21.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r22.xyzw, r21.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r10.z, r22.wzww, r9.zzzz
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r22.xyxx, r9.zzzz
      mad r10.y, r5.w, r10.z, r10.y
      dp2 r10.z, r16.xyxx, r9.yyyy
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r22.wzww, r9.yyyy
      mad r10.y, r5.w, r10.z, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r16.xyzw, r21.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r10.z, r16.wzww, r9.zzzz
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r16.xyxx, r9.zzzz
      mad r10.y, r5.w, r10.z, r10.y
      dp2 r10.z, r15.xyxx, r9.yyyy
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r16.wzww, r9.yyyy
      mad r10.y, r5.w, r10.z, r10.y
      mad r21.xyzw, cb5[0].zzzz, l(2.000000, -10.000000, 6.000000, -10.000000), r6.yzyz
      max r21.xyzw, r21.xyzw, cb5[0].zzzz
      min r21.xyzw, r5.xxxx, r21.xyzw
      add r21.xyzw, r8.xyxy, r21.xyzw
      mul r21.xyzw, r21.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r24.xyzw, r21.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r10.z, r24.wzww, r9.zzzz
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r24.xyxx, r9.zzzz
      mad r10.y, r5.w, r10.z, r10.y
      dp2 r10.z, r18.xyxx, r9.yyyy
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r24.wzww, r9.yyyy
      mad r10.y, r5.w, r10.z, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r18.xyzw, r21.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r10.z, r18.wzww, r9.zzzz
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r18.xyxx, r9.zzzz
      mad r10.y, r5.w, r10.z, r10.y
      dp2 r10.z, r17.xyxx, r9.yyyy
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r18.wzww, r9.yyyy
      mad r10.y, r5.w, r10.z, r10.y
      mad r17.xyzw, cb5[0].zzzz, l(10.000000, -10.000000, 14.000000, -10.000000), r6.yzyz
      max r17.xyzw, r17.xyzw, cb5[0].zzzz
      min r17.xyzw, r5.xxxx, r17.xyzw
      add r17.xyzw, r8.xyxy, r17.xyzw
      mul r17.xyzw, r17.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r21.xyzw, r17.xyxx, t28.xyzw, s9.x, r6.w
      mul r13.xy, r23.zzzz, r21.zyzz
      mad r13.xw, r21.wwwx, r9.zzzz, r13.xxxy
      mad r10.y, r7.w, r13.x, r10.y
      mad r10.y, r5.w, r13.w, r10.y
      dp2 r10.z, r20.xyxx, r9.yyyy
      mad r10.y, r7.w, r10.z, r10.y
      dp2 r10.z, r21.wzww, r9.yyyy
      mad r10.y, r5.w, r10.z, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r17.xyzw, r17.zwzz, t28.xyzw, s9.x, r6.w
      mul r13.xw, r5.zzzz, r17.yyyz
      mul r13.xw, r9.xxxx, r13.xxxw
      mad r13.xw, r17.xxxw, r23.wwww, r13.xxxw
      mad r10.y, r7.w, r13.w, r10.y
      mad r10.y, r5.w, r13.x, r10.y
      mad r10.z, r19.x, r23.w, r11.w
      mad r10.y, r7.w, r10.z, r10.y
      mad r10.y, r5.w, r13.w, r10.y
      mad r17.xyzw, cb5[0].zzzz, l(-14.000000, -6.000000, -14.000000, -2.000000), r6.yzyz
      max r17.xyzw, r17.xyzw, cb5[0].zzzz
      min r17.xyzw, r5.xxxx, r17.xyzw
      add r17.xyzw, r8.xyxy, r17.xyzw
      mul r17.xyzw, r17.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r19.xyzw, r17.xyxx, t28.xyzw, s9.x, r6.w
      mul r11.yw, r23.xxxx, r19.yyyz
      mad r11.yw, r19.xxxw, r10.xxxx, r11.yyyw
      mad r10.y, r7.w, r11.w, r10.y
      mad r10.y, r5.w, r11.y, r10.y
      mad r10.y, r7.w, r13.z, r10.y
      mad r10.y, r5.w, r11.w, r10.y
      mad r19.xyzw, cb5[0].zzzz, l(-10.000000, -6.000000, -6.000000, -6.000000), r6.yzyz
      max r19.xyzw, r19.xyzw, cb5[0].zzzz
      min r19.xyzw, r5.xxxx, r19.xyzw
      add r19.xyzw, r8.xyxy, r19.xyzw
      mul r19.xyzw, r19.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r20.xyzw, r19.xyxx, t28.xyzw, s9.x, r6.w
      mad r10.z, r7.y, l(8.500000), -r8.w
      mad r10.z, r5.z, r10.z, r8.w
      mul r13.zw, r10.zzzz, r20.yyyz
      mad r13.zw, r20.xxxw, r23.yyyy, r13.zzzw
      mad r10.y, r7.w, r13.w, r10.y
      mad r10.y, r5.w, r13.z, r10.y
      mad r11.w, r14.y, r10.z, r15.w
      mad r10.y, r7.w, r11.w, r10.y
      mad r10.y, r5.w, r13.w, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r14.xyzw, r19.zwzz, t28.xyzw, s9.x, r6.w
      add r11.w, r8.w, -r11.x
      mad r11.w, r5.z, r11.w, r11.x
      mul r15.xy, r11.wwww, r14.wxww
      mad r15.xz, r14.zzyz, r11.xxxx, r15.xxyx
      mad r10.y, r7.w, r15.x, r10.y
      mad r10.y, r5.w, r15.z, r10.y
      dp2 r12.x, r22.xyxx, r8.wwww
      mad r10.y, r7.w, r12.x, r10.y
      dp2 r12.x, r14.wzww, r8.wwww
      mad r10.y, r5.w, r12.x, r10.y
      mad r19.xyzw, cb5[0].zzzz, l(-2.000000, -6.000000, 2.000000, -6.000000), r6.yzyz
      max r19.xyzw, r19.xyzw, cb5[0].zzzz
      min r19.xyzw, r5.xxxx, r19.xyzw
      add r19.xyzw, r8.xyxy, r19.xyzw
      mul r19.xyzw, r19.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r20.xyzw, r19.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r12.x, r20.wzww, r11.xxxx
      mad r10.y, r7.w, r12.x, r10.y
      dp2 r12.x, r20.xyxx, r11.xxxx
      mad r10.y, r5.w, r12.x, r10.y
      dp2 r12.x, r16.xyxx, r8.wwww
      mad r10.y, r7.w, r12.x, r10.y
      dp2 r12.x, r20.wzww, r8.wwww
      mad r10.y, r5.w, r12.x, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r16.xyzw, r19.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r12.x, r16.wzww, r11.xxxx
      mad r10.y, r7.w, r12.x, r10.y
      dp2 r12.x, r16.xyxx, r11.xxxx
      mad r10.y, r5.w, r12.x, r10.y
      dp2 r12.x, r24.xyxx, r8.wwww
      mad r10.y, r7.w, r12.x, r10.y
      dp2 r12.x, r16.wzww, r8.wwww
      mad r10.y, r5.w, r12.x, r10.y
      mad r19.xyzw, cb5[0].zzzz, l(6.000000, -6.000000, 10.000000, -6.000000), r6.yzyz
      max r19.xyzw, r19.xyzw, cb5[0].zzzz
      min r19.xyzw, r5.xxxx, r19.xyzw
      add r19.xyzw, r8.xyxy, r19.xyzw
      mul r19.xyzw, r19.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r22.xyzw, r19.xyxx, t28.xyzw, s9.x, r6.w
      add r12.x, -r8.w, r11.x
      mad r12.x, r5.z, r12.x, r8.w
      mul r14.xz, r12.xxxx, r22.zzyz
      mad r14.xw, r22.wwwx, r11.xxxx, r14.xxxz
      mad r10.y, r7.w, r14.x, r10.y
      mad r10.y, r5.w, r14.w, r10.y
      dp2 r13.w, r18.xyxx, r8.wwww
      mad r10.y, r7.w, r13.w, r10.y
      dp2 r13.w, r22.wzww, r8.wwww
      mad r10.y, r5.w, r13.w, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r18.xyzw, r19.zwzz, t28.xyzw, s9.x, r6.w
      mad r7.y, -r7.y, l(8.500000), r8.w
      mad r7.y, r5.z, r7.y, r9.z
      mul r14.xw, r23.zzzz, r18.yyyz
      mad r14.xw, r18.xxxw, r7.yyyy, r14.xxxw
      mad r10.y, r7.w, r14.w, r10.y
      mad r10.y, r5.w, r14.x, r10.y
      mad r13.y, r21.x, r7.y, r13.y
      mad r10.y, r7.w, r13.y, r10.y
      mad r10.y, r5.w, r14.w, r10.y
      mad r18.xyzw, cb5[0].zzzz, l(14.000000, -6.000000, 2.000000, -2.000000), r6.yzyz
      max r18.xyzw, r18.xyzw, cb5[0].zzzz
      min r18.xyzw, r5.xxxx, r18.xyzw
      add r18.xyzw, r8.xyxy, r18.xyzw
      mul r18.xyzw, r18.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r19.xyzw, r18.xyxx, t28.xyzw, s9.x, r6.w
      mul r13.yw, r5.zzzz, r19.yyyz
      mul r13.yw, r9.xxxx, r13.yyyw
      mad r13.yw, r19.xxxw, r23.wwww, r13.yyyw
      mad r10.y, r7.w, r13.w, r10.y
      mad r10.y, r5.w, r13.y, r10.y
      mad r10.y, r7.w, r13.x, r10.y
      mad r10.y, r5.w, r13.w, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r17.xyzw, r17.zwzz, t28.xyzw, s9.x, r6.w
      mul r13.xw, r23.xxxx, r17.yyyz
      mad r13.xw, r17.xxxw, r10.xxxx, r13.xxxw
      mad r10.y, r7.w, r13.w, r10.y
      mad r10.y, r5.w, r13.x, r10.y
      mad r10.y, r7.w, r11.y, r10.y
      mad r10.y, r5.w, r13.w, r10.y
      mad r15.xz, cb5[0].zzzz, l(-10.000000, 0.000000, -2.000000, 0.000000), r6.yyzy
      max r15.xz, r15.xxzx, cb5[0].zzzz
      min r15.xz, r5.xxxx, r15.xxzx
      add r15.xz, r8.xxyx, r15.xxzx
      mul r15.xz, r15.xxzx, l(0.500000, 0.000000, 0.333333, 0.000000)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r17.xyzw, r15.xzxx, t28.xyzw, s9.x, r6.w
      mul r15.xz, r10.zzzz, r17.yyzy
      mad r15.xz, r17.xxwx, r23.yyyy, r15.xxzx
      mad r10.y, r7.w, r15.z, r10.y
      mad r10.y, r5.w, r15.x, r10.y
      mad r10.y, r7.w, r13.z, r10.y
      mad r10.y, r5.w, r15.z, r10.y
      mad r17.xyzw, cb5[0].zzzz, l(-6.000000, -2.000000, -6.000000, 2.000000), r6.yzyz
      max r17.xyzw, r17.xyzw, cb5[0].zzzz
      min r17.xyzw, r5.xxxx, r17.xyzw
      add r17.xyzw, r8.xyxy, r17.xyzw
      mul r17.xyzw, r17.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r19.xyzw, r17.xyxx, t28.xyzw, s9.x, r6.w
      add r11.y, -r11.z, r11.x
      mad r11.y, r5.z, r11.y, r11.z
      mul r13.zw, r11.yyyy, r19.yyyz
      mad r13.zw, r19.xxxw, r11.wwww, r13.zzzw
      mad r10.y, r7.w, r13.w, r10.y
      mad r10.y, r5.w, r13.z, r10.y
      mad r14.y, r14.y, r11.y, r15.y
      mad r10.y, r7.w, r14.y, r10.y
      mad r10.y, r5.w, r13.w, r10.y
      mad r14.yw, cb5[0].zzzz, l(0.000000, -2.000000, 0.000000, -2.000000), r6.yyyz
      max r14.yw, r14.yyyw, cb5[0].zzzz
      min r14.yw, r5.xxxx, r14.yyyw
      add r14.yw, r8.xxxy, r14.yyyw
      mul r14.yw, r14.yyyw, l(0.000000, 0.500000, 0.000000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r19.xyzw, r14.ywyy, t28.xyzw, s9.x, r6.w
      add r15.yzw, r11.zzzz, -r12.zzzw
      mad r15.yzw, r5.zzzz, r15.yyzw, r12.yyzw
      mul r21.xyz, r15.zzwz, r19.wxxw
      mad r14.yw, r19.zzzy, r12.zzzz, r21.xxxy
      mad r10.y, r7.w, r14.y, r10.y
      mad r10.y, r5.w, r14.w, r10.y
      add r12.y, -r8.z, r11.z
      mad r12.y, r5.z, r12.y, r8.z
      mul r13.w, r12.y, r20.y
      mad r13.w, r20.x, r11.z, r13.w
      mad r10.y, r7.w, r13.w, r10.y
      mul r12.y, r12.y, r19.z
      mad r12.y, r19.w, r11.z, r12.y
      mad r10.y, r5.w, r12.y, r10.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r18.xyzw, r18.zwzz, t28.xyzw, s9.x, r6.w
      add r12.y, -r9.w, r12.z
      mad r12.y, r5.z, r12.y, r9.w
      add r13.w, -r5.y, r9.w
      mad r13.w, r5.z, r13.w, r5.y
      mul r14.yw, r13.wwww, r18.zzzy
      mad r16.zw, r18.wwwx, r12.yyyy, r14.yyyw
      mad r10.y, r7.w, r16.z, r10.y
      mad r10.y, r5.w, r16.w, r10.y
      add r8.z, r8.z, -r10.w
      mad r8.z, r5.z, r8.z, r10.w
      add r10.w, -r5.y, r10.w
      mad r10.w, r5.z, r10.w, r5.y
      mul r14.y, r10.w, r16.y
      mad r14.y, r16.x, r8.z, r14.y
      mad r10.y, r7.w, r14.y, r10.y
      mul r10.w, r10.w, r18.z
      mad r8.z, r18.w, r8.z, r10.w
      mad r8.z, r5.w, r8.z, r10.y
      mad r16.xyzw, cb5[0].zzzz, l(6.000000, -2.000000, 10.000000, -2.000000), r6.yzyz
      max r16.xyzw, r16.xyzw, cb5[0].zzzz
      min r16.xyzw, r5.xxxx, r16.xyzw
      add r16.xyzw, r8.xyxy, r16.xyzw
      mul r16.xyzw, r16.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r20.xyzw, r16.xyxx, t28.xyzw, s9.x, r6.w
      add r10.y, -r11.x, r5.y
      mad r10.y, r5.z, r10.y, r11.x
      mul r16.xy, r12.xxxx, r20.yzyy
      mad r16.xy, r20.xwxx, r10.yyyy, r16.xyxx
      mad r8.z, r7.w, r16.y, r8.z
      mad r8.z, r5.w, r16.x, r8.z
      mad r10.w, r22.x, r10.y, r14.z
      mad r8.z, r7.w, r10.w, r8.z
      mad r8.z, r5.w, r16.y, r8.z
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r20.xyzw, r16.zwzz, t28.xyzw, s9.x, r6.w
      mul r14.yz, r23.zzzz, r20.yyzy
      mad r14.yz, r20.xxwx, r7.yyyy, r14.yyzy
      mad r8.z, r7.w, r14.z, r8.z
      mad r8.z, r5.w, r14.y, r8.z
      mad r8.z, r7.w, r14.x, r8.z
      mad r8.z, r5.w, r14.z, r8.z
      mad r20.xyzw, cb5[0].zzzz, l(14.000000, -2.000000, 6.000000, 2.000000), r6.yzyz
      max r20.xyzw, r20.xyzw, cb5[0].zzzz
      min r20.xyzw, r5.xxxx, r20.xyzw
      add r20.xyzw, r8.xyxy, r20.xyzw
      mul r20.xyzw, r20.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r22.xyzw, r20.xyxx, t28.xyzw, s9.x, r6.w
      mul r14.xz, r5.zzzz, r22.yyzy
      mul r14.xz, r9.xxxx, r14.xxzx
      mad r14.xz, r22.xxwx, r23.wwww, r14.xxzx
      mad r8.z, r7.w, r14.z, r8.z
      mad r8.z, r5.w, r14.x, r8.z
      mad r8.z, r7.w, r13.y, r8.z
      mad r8.z, r5.w, r14.z, r8.z
      mad r22.xyzw, cb5[0].zzzz, l(-14.000000, 2.000000, 2.000000, 2.000000), r6.yzyz
      max r22.xyzw, r22.xyzw, cb5[0].zzzz
      min r22.xyzw, r5.xxxx, r22.xyzw
      add r22.xyzw, r8.xyxy, r22.xyzw
      mul r22.xyzw, r22.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r24.xyzw, r22.xyxx, t28.xyzw, s9.x, r6.w
      mul r16.yz, r23.xxxx, r24.yyzy
      mad r16.yz, r24.xxwx, r10.xxxx, r16.yyzy
      mad r8.z, r7.w, r16.z, r8.z
      mad r8.z, r5.w, r16.y, r8.z
      mad r8.z, r7.w, r13.x, r8.z
      mad r8.z, r5.w, r16.z, r8.z
      mad r24.xyzw, cb5[0].zzzz, l(-10.000000, 2.000000, -10.000000, 6.000000), r6.yzyz
      max r24.xyzw, r24.xyzw, cb5[0].zzzz
      min r24.xyzw, r5.xxxx, r24.xyzw
      add r24.xyzw, r8.xyxy, r24.xyzw
      mul r24.xyzw, r24.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r25.xyzw, r24.xyxx, t28.xyzw, s9.x, r6.w
      mul r13.xy, r10.zzzz, r25.yzyy
      mad r13.xy, r25.xwxx, r23.yyyy, r13.xyxx
      mad r8.z, r7.w, r13.y, r8.z
      mad r8.z, r5.w, r13.x, r8.z
      mad r8.z, r7.w, r15.x, r8.z
      mad r8.z, r5.w, r13.y, r8.z
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r17.xyzw, r17.zwzz, t28.xyzw, s9.x, r6.w
      mul r16.zw, r11.yyyy, r17.yyyz
      mad r16.zw, r17.xxxw, r11.wwww, r16.zzzw
      mad r8.z, r7.w, r16.w, r8.z
      mad r8.z, r5.w, r16.z, r8.z
      mad r8.z, r7.w, r13.z, r8.z
      mad r8.z, r5.w, r16.w, r8.z
      mad r17.xyzw, cb5[0].zzzz, l(-2.000000, 2.000000, -6.000000, 14.000000), r6.yzyz
      max r17.xyzw, r17.xyzw, cb5[0].zzzz
      min r17.xyzw, r5.xxxx, r17.xyzw
      add r17.xyzw, r8.xyxy, r17.xyzw
      mul r17.xyzw, r17.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r25.xyzw, r17.xyxx, t28.xyzw, s9.x, r6.w
      mul r15.xyz, r15.yzwy, r25.wxww
      mad r13.yz, r25.zzyz, r12.zzzz, r15.xxyx
      mad r8.z, r7.w, r13.y, r8.z
      mad r8.z, r5.w, r13.z, r8.z
      add r10.w, -r7.z, r12.w
      mad r10.w, r5.z, r10.w, r7.z
      mad r12.z, r19.y, r10.w, r21.z
      mad r8.z, r7.w, r12.z, r8.z
      mad r10.w, r25.z, r10.w, r15.z
      mad r8.z, r5.w, r10.w, r8.z
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r15.xyzw, r22.zwzz, t28.xyzw, s9.x, r6.w
      mul r12.zw, r13.wwww, r15.zzzy
      mad r12.yw, r15.wwwx, r12.yyyy, r12.zzzw
      mad r8.z, r7.w, r12.y, r8.z
      mad r8.z, r5.w, r12.w, r8.z
      add r7.z, -r9.w, r7.z
      mad r7.z, r5.z, r7.z, r9.w
      mad r9.w, r18.x, r7.z, r14.w
      mad r8.z, r7.w, r9.w, r8.z
      mad r7.z, r15.w, r7.z, r12.z
      mad r7.z, r5.w, r7.z, r8.z
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r18.xyzw, r20.zwzz, t28.xyzw, s9.x, r6.w
      mul r12.yz, r12.xxxx, r18.yyzy
      mad r12.yz, r18.xxwx, r10.yyyy, r12.yyzy
      mad r7.z, r7.w, r12.z, r7.z
      mad r7.z, r5.w, r12.y, r7.z
      mad r7.z, r7.w, r16.x, r7.z
      mad r7.z, r5.w, r12.z, r7.z
      mad r18.xyzw, cb5[0].zzzz, l(10.000000, 2.000000, 14.000000, 2.000000), r6.yzyz
      max r18.xyzw, r18.xyzw, cb5[0].zzzz
      min r18.xyzw, r5.xxxx, r18.xyzw
      add r18.xyzw, r8.xyxy, r18.xyzw
      mul r18.xyzw, r18.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r19.xyzw, r18.xyxx, t28.xyzw, s9.x, r6.w
      mul r12.zw, r23.zzzz, r19.yyyz
      mad r12.zw, r19.xxxw, r7.yyyy, r12.zzzw
      mad r7.z, r7.w, r12.w, r7.z
      mad r7.z, r5.w, r12.z, r7.z
      mad r7.z, r7.w, r14.y, r7.z
      mad r7.z, r5.w, r12.w, r7.z
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r18.xyzw, r18.zwzz, t28.xyzw, s9.x, r6.w
      mul r13.yz, r5.zzzz, r18.yyzy
      mul r13.yz, r9.xxxx, r13.yyzy
      mad r13.yz, r18.xxwx, r23.wwww, r13.yyzy
      mad r7.z, r7.w, r13.z, r7.z
      mad r7.z, r5.w, r13.y, r7.z
      mad r7.z, r7.w, r14.x, r7.z
      mad r7.z, r5.w, r13.z, r7.z
      mad r13.zw, cb5[0].zzzz, l(0.000000, 0.000000, -14.000000, 6.000000), r6.yyyz
      max r13.zw, r13.zzzw, cb5[0].zzzz
      min r13.zw, r5.xxxx, r13.zzzw
      add r13.zw, r8.xxxy, r13.zzzw
      mul r13.zw, r13.zzzw, l(0.000000, 0.000000, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r14.xyzw, r13.zwzz, t28.xyzw, s9.x, r6.w
      mul r13.zw, r23.xxxx, r14.yyyz
      mad r13.zw, r14.xxxw, r10.xxxx, r13.zzzw
      mad r7.z, r7.w, r13.w, r7.z
      mad r7.z, r5.w, r13.z, r7.z
      mad r7.z, r7.w, r16.y, r7.z
      mad r7.z, r5.w, r13.w, r7.z
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r14.xyzw, r24.zwzz, t28.xyzw, s9.x, r6.w
      mul r14.yz, r10.zzzz, r14.yyzy
      mad r14.xy, r14.xwxx, r23.yyyy, r14.yzyy
      mad r7.z, r7.w, r14.y, r7.z
      mad r7.z, r5.w, r14.x, r7.z
      mad r7.z, r7.w, r13.x, r7.z
      mad r7.z, r5.w, r14.y, r7.z
      mad r18.xyzw, cb5[0].zzzz, l(-6.000000, 6.000000, -6.000000, 10.000000), r6.yzyz
      max r18.xyzw, r18.xyzw, cb5[0].zzzz
      min r18.xyzw, r5.xxxx, r18.xyzw
      add r18.xyzw, r8.xyxy, r18.xyzw
      mul r18.xyzw, r18.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r19.xyzw, r18.xyxx, t28.xyzw, s9.x, r6.w
      mul r13.xw, r11.wwww, r19.wwwx
      mad r14.yz, r19.zzyz, r11.xxxx, r13.xxwx
      mad r7.z, r7.w, r14.y, r7.z
      mad r7.z, r5.w, r14.z, r7.z
      mad r7.z, r7.w, r16.z, r7.z
      mad r8.z, r19.z, r11.y, r13.x
      mad r7.z, r5.w, r8.z, r7.z
      mad r16.xyzw, cb5[0].zzzz, l(-2.000000, 6.000000, -2.000000, 10.000000), r6.yzyz
      max r16.xyzw, r16.xyzw, cb5[0].zzzz
      min r16.xyzw, r5.xxxx, r16.xyzw
      add r16.xyzw, r8.xyxy, r16.xyzw
      mul r16.xyzw, r16.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r20.xyzw, r16.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r8.z, r20.wzww, r11.xxxx
      mad r7.z, r7.w, r8.z, r7.z
      dp2 r8.z, r20.xyxx, r11.xxxx
      mad r7.z, r5.w, r8.z, r7.z
      dp2 r8.z, r25.xyxx, r11.zzzz
      mad r7.z, r7.w, r8.z, r7.z
      dp2 r8.z, r20.wzww, r11.zzzz
      mad r7.z, r5.w, r8.z, r7.z
      mad r21.xyzw, cb5[0].zzzz, l(2.000000, 6.000000, 6.000000, 6.000000), r6.yzyz
      max r21.xyzw, r21.xyzw, cb5[0].zzzz
      min r21.xyzw, r5.xxxx, r21.xyzw
      add r21.xyzw, r8.xyxy, r21.xyzw
      mul r21.xyzw, r21.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r22.xyzw, r21.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r8.z, r22.wzww, r11.xxxx
      mad r7.z, r7.w, r8.z, r7.z
      dp2 r8.z, r22.xyxx, r11.xxxx
      mad r7.z, r5.w, r8.z, r7.z
      add r8.z, -r5.y, r11.z
      mad r5.y, r5.z, r8.z, r5.y
      mul r8.z, r5.y, r15.y
      mad r8.z, r15.x, r11.z, r8.z
      mad r7.z, r7.w, r8.z, r7.z
      mul r5.y, r5.y, r22.z
      mad r5.y, r22.w, r11.z, r5.y
      mad r5.y, r5.w, r5.y, r7.z
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r15.xyzw, r21.zwzz, t28.xyzw, s9.x, r6.w
      mul r11.yz, r12.xxxx, r15.zzyz
      mad r11.xz, r15.wwxw, r11.xxxx, r11.yyzy
      mad r5.y, r7.w, r11.x, r5.y
      mad r5.y, r5.w, r11.z, r5.y
      mad r5.y, r7.w, r12.y, r5.y
      mad r7.z, r15.w, r10.y, r11.y
      mad r5.y, r5.w, r7.z, r5.y
      mad r11.xyzw, cb5[0].zzzz, l(10.000000, 6.000000, 14.000000, 6.000000), r6.yzyz
      max r11.xyzw, r11.xyzw, cb5[0].zzzz
      min r11.xyzw, r5.xxxx, r11.xyzw
      add r11.xyzw, r8.xyxy, r11.xyzw
      mul r11.xyzw, r11.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r21.xyzw, r11.xyxx, t28.xyzw, s9.x, r6.w
      mul r10.yw, r23.zzzz, r21.yyyz
      mad r10.yw, r21.xxxw, r7.yyyy, r10.yyyw
      mad r5.y, r7.w, r10.w, r5.y
      mad r5.y, r5.w, r10.y, r5.y
      mad r5.y, r7.w, r12.z, r5.y
      mad r5.y, r5.w, r10.w, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r11.xyzw, r11.zwzz, t28.xyzw, s9.x, r6.w
      mul r11.yz, r5.zzzz, r11.yyzy
      mul r11.yz, r9.xxxx, r11.yyzy
      mad r11.xy, r11.xwxx, r23.wwww, r11.yzyy
      mad r5.y, r7.w, r11.y, r5.y
      mad r5.y, r5.w, r11.x, r5.y
      mad r5.y, r7.w, r13.y, r5.y
      mad r5.y, r5.w, r11.y, r5.y
      mad r12.xyzw, cb5[0].zzzz, l(-14.000000, 10.000000, -14.000000, 14.000000), r6.yzyz
      max r12.xyzw, r12.xyzw, cb5[0].zzzz
      min r12.xyzw, r5.xxxx, r12.xyzw
      add r12.xyzw, r8.xyxy, r12.xyzw
      mul r12.xyzw, r12.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r21.xyzw, r12.xyxx, t28.xyzw, s9.x, r6.w
      mul r11.yz, r23.xxxx, r21.yyzy
      mad r11.yz, r21.xxwx, r10.xxxx, r11.yyzy
      mad r5.y, r7.w, r11.z, r5.y
      mad r5.y, r5.w, r11.y, r5.y
      mad r5.y, r7.w, r13.z, r5.y
      mad r5.y, r5.w, r11.z, r5.y
      mad r13.xyzw, cb5[0].zzzz, l(-10.000000, 10.000000, -10.000000, 14.000000), r6.yzyz
      max r13.xyzw, r13.xyzw, cb5[0].zzzz
      min r13.xyzw, r5.xxxx, r13.xyzw
      add r13.xyzw, r8.xyxy, r13.xyzw
      mul r13.xyzw, r13.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r21.xyzw, r13.xyxx, t28.xyzw, s9.x, r6.w
      mul r11.zw, r23.yyyy, r21.wwwx
      mad r12.xy, r21.zyzz, r9.zzzz, r11.zwzz
      mad r5.y, r7.w, r12.x, r5.y
      mad r5.y, r5.w, r12.y, r5.y
      mad r5.y, r7.w, r14.x, r5.y
      mad r7.z, r21.z, r10.z, r11.z
      mad r5.y, r5.w, r7.z, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r14.xyzw, r18.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r14.wzww, r9.zzzz
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r14.xyxx, r9.zzzz
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r19.xyxx, r8.wwww
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r14.wzww, r8.wwww
      mad r5.y, r5.w, r7.z, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r16.xyzw, r16.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r16.wzww, r9.zzzz
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r16.xyxx, r9.zzzz
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r20.xyxx, r8.wwww
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r16.wzww, r8.wwww
      mad r5.y, r5.w, r7.z, r5.y
      mad r18.xyzw, cb5[0].zzzz, l(2.000000, 10.000000, 2.000000, 14.000000), r6.yzyz
      max r18.xyzw, r18.xyzw, cb5[0].zzzz
      min r18.xyzw, r5.xxxx, r18.xyzw
      add r18.xyzw, r8.xyxy, r18.xyzw
      mul r18.xyzw, r18.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r19.xyzw, r18.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r19.wzww, r9.zzzz
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r19.xyxx, r9.zzzz
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r22.xyxx, r8.wwww
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r19.wzww, r8.wwww
      mad r5.y, r5.w, r7.z, r5.y
      mad r20.xyzw, cb5[0].zzzz, l(6.000000, 10.000000, 6.000000, 14.000000), r6.yzyz
      max r20.xyzw, r20.xyzw, cb5[0].zzzz
      min r20.xyzw, r5.xxxx, r20.xyzw
      add r20.xyzw, r8.xyxy, r20.xyzw
      mul r20.xyzw, r20.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r22.xyzw, r20.xyxx, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r22.wzww, r9.zzzz
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r22.xyxx, r9.zzzz
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r15.xyxx, r8.wwww
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r22.wzww, r8.wwww
      mad r5.y, r5.w, r7.z, r5.y
      mad r8.zw, cb5[0].zzzz, l(0.000000, 0.000000, 10.000000, 10.000000), r6.yyyz
      max r8.zw, r8.zzzw, cb5[0].zzzz
      min r8.zw, r5.xxxx, r8.zzzw
      add r8.zw, r8.xxxy, r8.zzzw
      mul r8.zw, r8.zzzw, l(0.000000, 0.000000, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r15.xyzw, r8.zwzz, t28.xyzw, s9.x, r6.w
      mul r8.zw, r23.zzzz, r15.zzzy
      mad r9.zw, r15.wwwx, r9.zzzz, r8.zzzw
      mad r5.y, r7.w, r9.z, r5.y
      mad r5.y, r5.w, r9.w, r5.y
      mad r5.y, r7.w, r10.y, r5.y
      mad r7.y, r15.w, r7.y, r8.z
      mad r5.y, r5.w, r7.y, r5.y
      mad r24.xyzw, cb5[0].zzzz, l(14.000000, 10.000000, 10.000000, 14.000000), r6.yzyz
      max r24.xyzw, r24.xyzw, cb5[0].zzzz
      min r24.xyzw, r5.xxxx, r24.xyzw
      add r24.xyzw, r8.xyxy, r24.xyzw
      mul r24.xyzw, r24.xyzw, l(0.500000, 0.333333, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r25.xyzw, r24.xyxx, t28.xyzw, s9.x, r6.w
      mul r7.yz, r5.zzzz, r25.yyzy
      mul r7.yz, r9.xxxx, r7.yyzy
      mad r7.yz, r25.xxwx, r23.wwww, r7.yyzy
      mad r5.y, r7.w, r7.z, r5.y
      mad r5.y, r5.w, r7.y, r5.y
      mad r5.y, r7.w, r11.x, r5.y
      mad r5.y, r5.w, r7.z, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r12.xyzw, r12.zwzz, t28.xyzw, s9.x, r6.w
      mul r8.zw, r10.xxxx, r12.wwwx
      mad r9.zw, r12.zzzy, r9.xxxx, r8.zzzw
      mad r5.y, r7.w, r9.z, r5.y
      mad r5.y, r5.w, r9.w, r5.y
      mad r5.y, r7.w, r11.y, r5.y
      mad r7.z, r12.z, r23.x, r8.z
      mad r5.y, r5.w, r7.z, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyzw, r13.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r10.wzww, r9.xxxx
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.xyxx, r9.xxxx
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r21.xyxx, r9.yyyy
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.wzww, r9.yyyy
      mad r5.y, r5.w, r7.z, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyzw, r17.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r10.wzww, r9.xxxx
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.xyxx, r9.xxxx
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r14.xyxx, r9.yyyy
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.wzww, r9.yyyy
      mad r5.y, r5.w, r7.z, r5.y
      mad r8.zw, cb5[0].zzzz, l(0.000000, 0.000000, -2.000000, 14.000000), r6.yyyz
      max r8.zw, r8.zzzw, cb5[0].zzzz
      min r8.zw, r5.xxxx, r8.zzzw
      add r8.zw, r8.xxxy, r8.zzzw
      mul r8.zw, r8.zzzw, l(0.000000, 0.000000, 0.500000, 0.333333)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyzw, r8.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r10.wzww, r9.xxxx
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.xyxx, r9.xxxx
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r16.xyxx, r9.yyyy
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.wzww, r9.yyyy
      mad r5.y, r5.w, r7.z, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyzw, r18.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r10.wzww, r9.xxxx
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.xyxx, r9.xxxx
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r19.xyxx, r9.yyyy
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.wzww, r9.yyyy
      mad r5.y, r5.w, r7.z, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyzw, r20.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r10.wzww, r9.xxxx
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.xyxx, r9.xxxx
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r22.xyxx, r9.yyyy
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.wzww, r9.yyyy
      mad r5.y, r5.w, r7.z, r5.y
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyzw, r24.zwzz, t28.xyzw, s9.x, r6.w
      dp2 r7.z, r10.wzww, r9.xxxx
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.xyxx, r9.xxxx
      mad r5.y, r5.w, r7.z, r5.y
      dp2 r7.z, r15.xyxx, r9.yyyy
      mad r5.y, r7.w, r7.z, r5.y
      dp2 r7.z, r10.wzww, r9.yyyy
      mad r5.y, r5.w, r7.z, r5.y
      mad r6.yz, cb5[0].zzzz, l(0.000000, 14.000000, 14.000000, 0.000000), r6.yyzy
      max r6.yz, r6.yyzy, cb5[0].zzzz
      min r6.yz, r5.xxxx, r6.yyzy
      add r6.yz, r8.xxyx, r6.yyzy
      mul r6.yz, r6.yyzy, l(0.000000, 0.500000, 0.333333, 0.000000)
      gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r8.xyzw, r6.yzyy, t28.xyzw, s9.x, r6.w
      mul r5.xz, r5.zzzz, r8.zzyz
      mul r5.xz, r9.xxxx, r5.xxzx
      mad r6.yz, r8.wwxw, r9.xxxx, r5.xxzx
      mad r5.y, r7.w, r6.y, r5.y
      mad r5.y, r5.w, r6.z, r5.y
      mad r5.y, r7.w, r7.y, r5.y
      mad r5.x, r8.w, r23.w, r5.x
      mad r5.x, r5.w, r5.x, r5.y
      div r5.x, r5.x, r7.x
    else 
      movc r5.x, r6.x, l(0), l(1.000000)
    endif 
  else 
    mov r5.x, l(1.000000)
  endif 
  add r5.x, -r5.x, l(1.000000)
  mad o0.w, -cb4[14].w, r5.x, l(1.000000)
else 
  mov o0.w, l(1.000000)
endif 
mul r5.xyz, r4.wwww, cb4[12].xyzx
if_nz cb4[13].z
  dp3 r6.x, r4.xyzx, cb4[2].xyzx
  dp3 r6.y, r4.xyzx, cb4[3].xyzx
  dp3 r6.z, r4.xyzx, cb4[4].xyzx
  sample_indexable(texturecube)(float,float,float,float) r4.xyz, r6.xyzx, t26.xyzw, s3
  if_nz cb4[13].w
    sample_indexable(texturecube)(float,float,float,float) r6.xyz, r6.xyzx, t27.xyzw, s3
    mul r3.w, r3.w, cb4[13].y
    min r3.w, r3.w, l(1.000000)
    add r6.xyz, -r4.xyzx, r6.xyzx
    mad r4.xyz, r3.wwww, r6.xyzx, r4.xyzx
  endif 
  mul r5.xyz, r4.xyzx, r5.xyzx
endif 
add r1.xyw, -r1.xyxw, cb0[24].xyxz
dp3 r3.w, r1.xywx, r1.xywx
rsq r3.w, r3.w
mul r4.xyz, r1.xywx, r3.wwww
div r2.xyz, r2.xyzx, r2.wwww
dp3 r2.w, r5.xyzx, l(0.333000, 0.333000, 0.333000, 0.000000)
dp3 r4.w, r3.xyzx, r2.xyzx
min r4.w, r4.w, l(1.000000)
mov r6.yw, l(0,0.994141,0,0.998047)
mov r6.z, r0.w
sample_indexable(texture2d)(float,float,float,float) r0.w, r6.yzyy, t0.xyzw, s1
add r0.w, r0.w, r0.w
mad r6.x, r4.w, l(0.490234), l(0.492188)
sample_indexable(texture2d)(float,float,float,float) r5.w, r6.xzxx, t0.yzwx, s3
add r5.w, r5.w, r5.w
mul r7.xyz, r5.xyzx, r5.wwww
mad r8.xyz, r0.xyzx, r2.wwww, -r5.xyzx
mad r5.xyz, r0.wwww, r8.xyzx, r5.xyzx
sample_indexable(texture2d)(float,float,float,float) r6.xy, r6.wzww, t0.xwyz, s3
add r0.w, r6.y, r6.y
mul r2.w, r6.x, l(256.000000)
mul r2.w, r2.w, r2.w
mad r1.xyw, r1.xyxw, r3.wwww, r2.xyxz
dp3 r2.x, r1.xywx, r1.xywx
rsq r2.x, r2.x
mul r1.xyw, r1.xyxw, r2.xxxx
dp3 r1.x, r3.xyzx, r1.xywx
max r1.x, r1.x, l(0.000001)
log r1.x, r1.x
mul r1.x, r1.x, r2.w
exp r1.x, r1.x
mul r1.x, r1.x, r2.w
mul r1.x, r1.x, l(0.031250)
max r1.y, r4.w, l(0.000000)
dp3_sat r1.w, r3.xyzx, r4.xyzx
add r2.x, r4.w, l(0.500000)
max r2.x, r2.x, l(0.000000)
add r1.w, -r1.w, l(1.000000)
mul r2.y, r1.w, r1.w
mul r2.y, r2.y, r2.y
mul r1.w, r1.w, r2.y
mul r0.w, r0.w, r1.w
mul r0.w, r2.x, r0.w
mul r0.w, r0.w, l(2.500000)
mad r0.w, r1.x, r1.y, r0.w
mul r0.w, r1.z, r0.w
mul r1.xyz, r0.wwww, r5.xyzx
mad r0.xyz, r7.xyzx, r0.xyzx, r1.xyzx
min o0.xyz, r0.xyzx, l(31.875000, 31.875000, 31.875000, 0.000000)
ret 
// Approximately 1066 instruction slots used

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