//Hissing Wastes
cbuffer _Globals : register(b0)
{
  float3 g_cameraPos : packoffset(c0);
  float2 g_invScreenSize : packoffset(c1);
  float4x4 g_invViewProjMatrix : packoffset(c2);
  float4 g_cloudOffsetAndScale : packoffset(c6);
  float4 g_cloudCoverageExponentAndFade : packoffset(c7);
  float3 g_lightDir : packoffset(c8);
  float4 g_keyColor : packoffset(c9);
  float2 g_lightAngularRadius : packoffset(c10);
  float4 g_keyTranslucencyParams : packoffset(c11);
  float4 g_subParams : packoffset(c12);
  float4 g_envmapParams : packoffset(c13);
  float g_skyEnvmap8BitTexInvScale : packoffset(c14);
  float4 g_exposureMultipliers : packoffset(c15);
  float4 g_envmapsMipmapCount : packoffset(c16);
  int g_drawReference : packoffset(c17);
  float g_skyEnvmapMipmapCount : packoffset(c17.y);
}
SamplerState g_cloudShadowSampler_s : register(s0);
SamplerState g_skyEnvmapSampler_s : register(s1);
SamplerState g_customSampler_s : register(s2);
SamplerState g_diffuseOcclusionSampler_s : register(s3);
Texture2D<float4> g_cloudShadowTexture : register(t0);
TextureCube<float4> g_skyEnvmap : register(t1);
TextureCube<float4> g_customEnvmap : register(t2);
Texture2D<float4> g_diffuseOcclusionTexture : register(t3);
Texture2D<float4> g_depthTexture : register(t4);
Texture2D<float4> g_gbufferTexture0 : register(t5);
Texture2D<float4> g_gbufferTexture1 : register(t6);
Texture2D<float4> g_gbufferTexture2 : register(t7);
Texture2D<float4> g_gbufferTexture3 : register(t8);
Texture2D<float4> g_gbufferTexture4 : register(t9);
Texture2D<float4> g_shadowAccumTexture : register(t10);

Texture2D<float4> StereoParams : register(t125);
Texture1D<float4> IniParams : register(t120);

void main(
  float4 v0 : SV_Position0,
  out float4 o0 : SV_Target0,
  out float4 o1 : SV_Target1)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14;
  uint4 bitmask, uiDest;
  float4 fDest;

//Work out Inverse
//...Variables
float4 a1, a2, a3, a4;
float4 b1, b2, b3, b4;
float det;
//...Original Matrix
a1 = g_invViewProjMatrix._m00_m10_m20_m30;
a2 = g_invViewProjMatrix._m01_m11_m21_m31;
a3 = g_invViewProjMatrix._m02_m12_m22_m32;
a4 = g_invViewProjMatrix._m03_m13_m23_m33;
//...Determinant
det  = a1.x*(a2.y*(a3.z*a4.w - a3.w*a4.z) + a2.z*(a3.w*a4.y - a3.y*a4.w) + a2.w*(a3.y*a4.z - a3.z*a4.y));
det += a1.y*(a2.x*(a3.w*a4.z - a3.z*a4.w) + a2.z*(a3.x*a4.w - a3.w*a4.z) + a2.w*(a3.z*a4.x - a3.x*a4.z));
det += a1.z*(a2.x*(a3.y*a4.w - a3.w*a4.y) + a2.y*(a3.w*a4.x - a3.x*a4.w) + a2.w*(a3.x*a4.y - a3.y*a4.x));
det += a1.w*(a2.x*(a3.z*a4.y - a3.y*a4.z) + a2.y*(a3.x*a4.z - a3.z*a4.x) + a2.z*(a3.y*a4.x - a3.x*a4.y));
//...Inverse Matrix Elements
b1.x = a2.y*(a3.z*a4.w - a3.w*a4.z) + a2.z*(a3.w*a4.y - a3.y*a4.w) + a2.w*(a3.y*a4.z - a3.z*a4.y);
b1.y = a1.y*(a3.w*a4.z - a3.z*a4.w) + a1.z*(a3.y*a4.w - a3.w*a4.y) + a1.w*(a3.z*a4.y - a3.y*a4.z);
b1.z = a1.y*(a2.z*a4.w - a2.w*a4.z) + a1.z*(a2.w*a4.y - a2.y*a4.w) + a1.w*(a2.y*a4.z - a2.z*a4.y);
b1.w = a1.y*(a2.w*a3.z - a2.z*a3.w) + a1.z*(a2.y*a3.w - a2.w*a3.y) + a1.w*(a2.z*a3.y - a2.y*a3.z);
b2.x = a2.x*(a3.w*a4.z - a3.z*a4.w) + a2.z*(a3.x*a4.w - a3.w*a4.x) + a2.w*(a3.z*a4.x - a3.x*a4.z);
b2.y = a1.x*(a3.z*a4.w - a3.w*a4.z) + a1.z*(a3.w*a4.x - a3.x*a4.w) + a1.w*(a3.x*a4.z - a3.z*a4.x);
b2.z = a1.x*(a2.w*a4.z - a2.z*a4.w) + a1.z*(a2.x*a4.w - a2.w*a4.x) + a1.w*(a2.z*a4.x - a2.x*a4.z);
b2.w = a1.x*(a2.z*a3.w - a2.w*a3.z) + a1.z*(a2.w*a3.x - a2.x*a3.w) + a1.w*(a2.x*a3.z - a2.z*a3.x);
b3.x = a2.x*(a3.y*a4.w - a3.w*a4.y) + a2.y*(a3.w*a4.x - a3.x*a4.w) + a2.w*(a3.x*a4.y - a3.y*a4.x);
b3.y = a1.x*(a3.w*a4.y - a3.y*a4.w) + a1.y*(a3.x*a4.w - a3.w*a4.x) + a1.w*(a3.y*a4.x - a3.x*a4.y);
b3.z = a1.x*(a2.y*a4.w - a2.w*a4.y) + a1.y*(a2.w*a4.x - a2.x*a4.w) + a1.w*(a2.x*a4.y - a2.y*a4.x);
b3.w = a1.x*(a2.w*a3.y - a2.y*a3.w) + a1.y*(a2.x*a3.w - a2.w*a3.x) + a1.w*(a2.y*a3.x - a2.x*a3.y);
b4.x = a2.x*(a3.z*a4.y - a3.y*a4.z) + a2.y*(a3.x*a4.z - a3.z*a4.x) + a2.z*(a3.y*a4.x - a3.x*a4.y);
b4.y = a1.x*(a3.y*a4.z - a3.z*a4.y) + a1.y*(a3.z*a4.x - a3.x*a4.z) + a1.z*(a3.x*a4.y - a3.y*a4.x);
b4.z = a1.x*(a2.z*a4.y - a2.y*a4.z) + a1.y*(a2.x*a4.z - a2.z*a4.x) + a1.z*(a2.y*a4.x - a2.x*a4.y);
b4.w = a1.x*(a2.y*a3.z - a2.z*a3.y) + a1.y*(a2.z*a3.x - a2.x*a3.z) + a1.z*(a2.x*a3.y - a2.y*a3.x);
b1.xyzw /= det;
b2.xyzw /= det;
b3.xyzw /= det;
b4.xyzw /= det;
//End Inverse

  
  r0.xy = g_invScreenSize.xy * v0.xy;
  r1.xy = (int2)v0.xy;
  r1.zw = float2(0.000000e+000,0.000000e+000);
  r2.xyzw = g_gbufferTexture0.Load(r1.xyw).xyzw;
  r3.xyzw = g_gbufferTexture1.Load(r1.xyw).xyzw;
  r4.xyz = g_gbufferTexture2.Load(r1.xyw).xzw;
  r5.xyz = g_gbufferTexture3.Load(r1.xyw).xyz;
  r6.z = g_depthTexture.Load(r1.xyw).x;
  r0.z = 2.550000000e+002 * r4.z;
  r0.z = round(r0.z);
  r0.z = (int)r0.z;
  r4.zw = (int2)r0.zz == int2(4,2);
  if (r4.z != 0) {
    r7.xyzw = g_gbufferTexture4.Load(r1.xyw).xyzw;
    r8.xyzw = r2.xyzw * float4(4.000000e+000,4.000000e+000,4.000000e+000,4.000000e+000) + float4(-2.000000e+000,-2.000000e+000,-2.000000e+000,-2.000000e+000);
    r0.w = dot(r8.xy, r8.xy);
    r9.zw = -r0.ww * float2(2.500000e-001,5.000000e-001) + float2(1.000000e+000,1.000000e+000);
    r0.w = max(0.000000000e+000, r9.z);
    r0.w = sqrt(r0.w);
    r9.xy = r8.xy * r0.ww;
    r0.w = dot(r9.xyw, r9.xyw);
    r0.w = rsqrt(r0.w);
    r9.xyz = r9.xyw * r0.www;
    r0.w = dot(r8.zw, r8.zw);
    r10.zw = -r0.ww * float2(2.500000e-001,5.000000e-001) + float2(1.000000e+000,1.000000e+000);
    r0.w = max(0.000000000e+000, r10.z);
    r0.w = sqrt(r0.w);
    r10.xy = r8.zw * r0.ww;
    r0.w = dot(r10.xyw, r10.xyw);
    r0.w = rsqrt(r0.w);
    r8.xyz = r10.xyw * r0.www;
    r0.w = dot(r7.xy, float2(6.528000e+004,2.550000e+002));
    r0.w = round(r0.w);
    r5.w = 3.125000000e-002 * r0.w;
    r5.w = trunc(r5.w);
    r10.z = r0.w * 3.125000000e-002 + -r5.w;
    r0.w = 1.562500000e-002 * r5.w;
    r10.x = trunc(r0.w);
    r10.y = r5.w * 1.562500000e-002 + -r10.x;
    r10.xyz = float3(3.225806e-002,1.015873e+000,1.032258e+000) * r10.xyz;
    r7.xy = float2(2.550000e+002,2.550000e+002) * r7.zw;
    r7.xy = round(r7.xy);
    r7.zw = float2(6.250000e-002,6.250000e-002) * r7.xy;
    r11.xy = trunc(r7.zw);
    r11.zw = r7.xy * float2(6.250000e-002,6.250000e-002) + -r11.xy;
    r7.xw = float2(6.666667e-002,1.066667e+000) * r11.yw;
    r7.yz = r11.xz * float2(8.000001e-001,1.280000e+001) + float2(1.000000e+000,1.000000e+000);
    r7.yz = exp2(r7.yz);
    r7.yz = r7.yz * float2(1.443000e+000,1.443000e+000) + float2(1.443000e+000,1.443000e+000);
    r11.xyzw = r3.xyzw * r3.xyzw;
    r12.xyz = r11.www;
    r0.w = 0.000000000e+000;
  } else {
    r2.xyz = r2.xyz * float3(2.000000e+000,2.000000e+000,2.000000e+000) + float3(-1.000000e+000,-1.000000e+000,-1.000000e+000);
    r5.w = dot(r2.xyz, r2.xyz);
    r5.w = rsqrt(r5.w);
    r9.xyz = r5.www * r2.xyz;
    r3.xyzw = r3.xyzw * r3.xyzw;
    r2.x = (int)r0.z == 5;
    if (r2.x != 0) {
      r11.xyz = r3.xyz * r3.www;
      r12.xyz = r3.xyz;
    } else {
      r2.x = (int)r0.z == 1;
      if (r2.x != 0) {
        r12.xyz = r3.www * r3.xyz;
      } else {
        r12.xyz = r3.www;
      }
      r11.xyz = r3.xyz;
    }
    r2.x = 0.000000000e+000 < r12.x;
    r0.w = r2.x ? r2.w : 0;
    r2.x = r0.w * 1.200000000e+001 + 1.000000000e+000;
    r2.x = exp2(r2.x);
    r7.y = r2.x * 1.442999959e+000 + 1.442999959e+000;
    r7.xzw = float3(0.000000e+000,0.000000e+000,0.000000e+000);
    r10.xyz = float3(0.000000e+000,0.000000e+000,0.000000e+000);
    r8.xyz = float3(0.000000e+000,0.000000e+000,0.000000e+000);
  }
  r2.xy = r0.xy * float2(2.000000e+000,2.000000e+000) + float2(-1.000000e+000,-1.000000e+000);
  r6.xy = float2(1.000000e+000,-1.000000e+000) * r2.xy;
  r6.w = 1.000000000e+000;
  r2.x = dot(r6.xyzw, g_invViewProjMatrix._m00_m10_m20_m30);
  r2.y = dot(r6.xyzw, g_invViewProjMatrix._m01_m11_m21_m31);
  r2.z = dot(r6.xyzw, g_invViewProjMatrix._m02_m12_m22_m32);
  r2.w = dot(r6.xyzw, g_invViewProjMatrix._m03_m13_m23_m33);
  r2.w = 1.000000e+000 / r2.w;
  
float4 r28, r26, r27;
r26.xyz = r2.xyz * r2.www;
r26.w = 1.0;
r28.x = dot(r26.xyzw, b1.xyzw);
r28.y = dot(r26.xyzw, b2.xyzw);
r28.z = dot(r26.xyzw, b3.xyzw);
r28.w = dot(r26.xyzw, b4.xyzw);
float4 stereo = StereoParams.Load(0);
r28.x -= stereo.x * (r28.w - stereo.y); 
r26.x = dot(r28.xyzw, a1.xyzw);
r26.y = dot(r28.xyzw, a2.xyzw);
r26.z = dot(r28.xyzw, a3.xyzw);
r26.w = dot(r28.xyzw, a4.xyzw);
r2.xyz = r26.xyz / r2.www;  
  
  r3.xyz = r2.xzy * r2.www;
  
  r2.x = dot(r3.xyz, r3.xyz);
  r2.z = rsqrt(r2.x);
  r6.xyz = r3.xzy * r2.zzz;
  r3.w = log2(abs(r4.x));
  r3.w = g_envmapParams.z * r3.w;
  r3.w = exp2(r3.w);
  r1.x = g_shadowAccumTexture.Load(r1.xyz).x;
  r1.y = r2.y * r2.w + g_cameraPos.y;
  r1.yz = g_lightDir.xz * r1.yy;
  r1.yz = r1.yz * g_cloudOffsetAndScale.ww + r3.xy;
  r1.yz = r1.yz * g_cloudOffsetAndScale.zz + g_cloudOffsetAndScale.xy;
  r1.y = g_cloudShadowTexture.SampleLevel(g_cloudShadowSampler_s, r1.yz, 0.000000000e+000).x;
  r1.y = saturate(g_cloudCoverageExponentAndFade.x + r1.y);
  r1.y = log2(r1.y);
  r1.y = g_cloudCoverageExponentAndFade.y * r1.y;
  r1.y = exp2(r1.y);
  r1.z = sqrt(r2.x);
  r1.z = -g_cloudCoverageExponentAndFade.z + r1.z;
  r1.z = saturate(g_cloudCoverageExponentAndFade.w * r1.z);
  r1.z = r1.z * r1.z;
  r1.w = 1.000000000e+000 + -r1.y;
  r1.y = r1.z * r1.w + r1.y;
  r1.x = r1.x * r1.y;
  r1.y = dot(r9.xyz, g_lightDir.xyz);
  r1.z = saturate(r1.y);
  r2.xyw = g_keyColor.xyz * r1.zzz;
  r2.xyw = r2.xyw * r1.xxx;
  if (r4.z != 0) {
    r7.w = saturate(r7.w);
    r1.y = r7.w * 5.000000000e-001 + r1.y;
    r1.z = r7.w * 5.000000000e-001 + 1.000000000e+000;
    r1.y = saturate(r1.y / r1.z);
    r1.yzw = g_keyColor.xyz * r1.yyy;
    r1.yzw = r1.yzw * r1.xxx;
    r13.xyz = -r9.xyz * r7.xxx + r8.xyz;
    r4.x = dot(r13.xyz, r13.xyz);
    r4.x = rsqrt(r4.x);
    r13.xyz = r13.xyz * r4.xxx;
    r14.xyz = -r3.xzy * r2.zzz + g_lightDir.xyz;
    r4.x = dot(r14.xyz, r14.xyz);
    r4.x = rsqrt(r4.x);
    r14.xyz = r14.xyz * r4.xxx;
    r4.x = dot(r8.xyz, r14.xyz);
    r4.x = -r4.x * r4.x + 1.000000000e+000;
    r4.x = max(0.000000000e+000, r4.x);
    r4.x = sqrt(r4.x);
    r4.x = log2(r4.x);
    r4.x = r7.y * r4.x;
    r4.x = exp2(r4.x);
    r5.w = dot(r13.xyz, r14.xyz);
    r5.w = -r5.w * r5.w + 1.000000000e+000;
    r5.w = max(0.000000000e+000, r5.w);
    r5.w = sqrt(r5.w);
    r5.w = log2(r5.w);
    r5.w = r7.z * r5.w;
    r5.w = exp2(r5.w);
    r7.xzw = r5.www * r10.xyz;
    r7.xzw = r4.xxx * r12.xxx + r7.xzw;
    r7.xzw = float3(1.500000e-001,1.500000e-001,1.500000e-001) * r7.xzw;
    r7.xzw = r7.xzw * r2.xyw;
    r7.xzw = g_keyColor.www * r7.xzw;
    r2.xyw = r1.yzw;
  } else {
    r1.yzw = -r3.xzy * r2.zzz + g_lightDir.xyz;
    r2.z = dot(r1.yzw, r1.yzw);
    r2.z = rsqrt(r2.z);
    r1.yzw = r2.zzz * r1.yzw;
    r1.y = saturate(dot(r9.xyz, r1.yzw));
    r1.z = r7.y * 8.662509918e-002 + 8.750000000e-001;
    r1.y = r1.y * r7.y + -r7.y;
    r1.y = exp2(r1.y);
    r1.y = r1.z * r1.y;
    r1.yzw = r2.xyw * r1.yyy;
    r7.xzw = g_keyColor.www * r1.yzw;
  }
  r1.yzw = r5.xyz * g_exposureMultipliers.yyy + r2.xyw;
  r0.z = (int)r0.z != 4;
  if (r0.z != 0) {
    r0.z = dot(r6.xyz, r9.xyz);
    r0.z = r0.z + r0.z;
    r2.xyz = r9.xyz * -r0.zzz + r6.xyz;
    r6.xyzw = r4.yyyy == float4(0.000000e+000,3.922000e-003,7.843000e-003,1.176500e-002);
    r6.xyzw = r6.xyzw ? g_envmapParams.xxxx : 0;
    r0.z = 1.000000000e+000 + -g_envmapParams.w;
    r0.z = r1.x * r0.z + g_envmapParams.w;
    r0.z = r0.z * r3.w;
    r3.xy = (int2)g_envmapsMipmapCount.xy;
    r4.xy = trunc(g_envmapsMipmapCount.xy);
    r4.xy = -r0.ww * float2(1.500000e+001,1.500000e+001) + r4.xy;
    r4.xy = float2(5.000000e+000,5.000000e+000) + r4.xy;
    r3.xy = (int2)r3.xy + int2(-1,-1);
    r3.xy = r3.xy;
    r4.xy = max(float2(0.000000e+000,0.000000e+000), r4.xy);
    r3.xy = min(r4.xy, r3.xy);
    r8.xyzw = g_customEnvmap.SampleLevel(g_customSampler_s, r2.xyz, r3.y).xyzw;
    r0.w = dot(r6.xyzw, r8.xyzw);
    r2.xyz = g_skyEnvmap.SampleLevel(g_skyEnvmapSampler_s, r2.xyz, r3.x).xyz;
    r2.xyz = r2.xyz * r0.zzz;
    r7.xzw = r2.xyz * g_skyEnvmap8BitTexInvScale + r7.xzw;
  } else {
    r0.w = 0.000000000e+000;
  }
  r2.xyz = r5.xyz * g_exposureMultipliers.yyy + g_envmapParams.yyy;
  r2.xyz = r2.xyz * r0.www;
  r0.z = 1.000000000e+000 + -r3.w;
  r2.xyz = r2.xyz * r0.zzz + r7.xzw;
  if (r4.z == 0) {
    r2.xyz = r2.xyz * r12.xyz;
  }
  r0.z = r4.w ? 0.000000000e+000 : 1.000000000e+000;
  r3.xyz = r2.xyz * r0.zzz;
  o0.xyz = r1.yzw * r11.xyz + r3.xyz;
  r0.xyzw = g_diffuseOcclusionTexture.Gather(g_diffuseOcclusionSampler_s, r0.xy).xyzw;
  r0.x = min(r0.x, r0.y);
  r0.x = min(r0.x, r0.z);
  o0.w = min(r0.x, r0.w);
  o1.xyz = r2.xyz;
  o1.w = 1.000000000e+000;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//   using 3Dmigoto v1.1.14 on Mon Jun 01 00:39:53 2015
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float3 g_cameraPos;                // Offset:    0 Size:    12
//   float2 g_invScreenSize;            // Offset:   16 Size:     8
//   float4x4 g_invViewProjMatrix;      // Offset:   32 Size:    64
//   float4 g_cloudOffsetAndScale;      // Offset:   96 Size:    16
//   float4 g_cloudCoverageExponentAndFade;// Offset:  112 Size:    16
//   float3 g_lightDir;                 // Offset:  128 Size:    12
//   float4 g_keyColor;                 // Offset:  144 Size:    16
//   float2 g_lightAngularRadius;       // Offset:  160 Size:     8 [unused]
//   float4 g_keyTranslucencyParams;    // Offset:  176 Size:    16 [unused]
//   float4 g_subParams;                // Offset:  192 Size:    16 [unused]
//   float4 g_envmapParams;             // Offset:  208 Size:    16
//   float g_skyEnvmap8BitTexInvScale;  // Offset:  224 Size:     4
//   float4 g_exposureMultipliers;      // Offset:  240 Size:    16
//   float4 g_envmapsMipmapCount;       // Offset:  256 Size:    16
//   int g_drawReference;               // Offset:  272 Size:     4 [unused]
//   float g_skyEnvmapMipmapCount;      // Offset:  276 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_cloudShadowSampler              sampler      NA          NA    0        1
// g_skyEnvmapSampler                sampler      NA          NA    1        1
// g_customSampler                   sampler      NA          NA    2        1
// g_diffuseOcclusionSampler         sampler      NA          NA    3        1
// g_cloudShadowTexture              texture  float4          2d    0        1
// g_skyEnvmap                       texture  float4        cube    1        1
// g_customEnvmap                    texture  float4        cube    2        1
// g_diffuseOcclusionTexture         texture  float4          2d    3        1
// g_depthTexture                    texture  float4          2d    4        1
// g_gbufferTexture0                 texture  float4          2d    5        1
// g_gbufferTexture1                 texture  float4          2d    6        1
// g_gbufferTexture2                 texture  float4          2d    7        1
// g_gbufferTexture3                 texture  float4          2d    8        1
// g_gbufferTexture4                 texture  float4          2d    9        1
// g_shadowAccumTexture              texture  float4          2d   10        1
// $Globals                          cbuffer      NA          NA    0        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
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[17], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texturecube (float,float,float,float) t1
dcl_resource_texturecube (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 15
mul r0.xy, v0.xyxx, cb0[1].xyxx
ftoi r1.xy, v0.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r2.xyzw, r1.xyww, t5.xyzw
ld_indexable(texture2d)(float,float,float,float) r3.xyzw, r1.xyww, t6.xyzw
ld_indexable(texture2d)(float,float,float,float) r4.xyz, r1.xyww, t7.xzwy
ld_indexable(texture2d)(float,float,float,float) r5.xyz, r1.xyww, t8.xyzw
ld_indexable(texture2d)(float,float,float,float) r6.z, r1.xyww, t4.yzxw
mul r0.z, r4.z, l(255.000000)
round_ne r0.z, r0.z
ftoi r0.z, r0.z
ieq r4.zw, r0.zzzz, l(0, 0, 4, 2)
if_nz r4.z
  ld_indexable(texture2d)(float,float,float,float) r7.xyzw, r1.xyww, t9.xyzw
  mad r8.xyzw, r2.xyzw, l(4.000000, 4.000000, 4.000000, 4.000000), l(-2.000000, -2.000000, -2.000000, -2.000000)
  dp2 r0.w, r8.xyxx, r8.xyxx
  mad r9.zw, -r0.wwww, l(0.000000, 0.000000, 0.250000, 0.500000), l(0.000000, 0.000000, 1.000000, 1.000000)
  max r0.w, r9.z, l(0.000000)
  sqrt r0.w, r0.w
  mul r9.xy, r0.wwww, r8.xyxx
  dp3 r0.w, r9.xywx, r9.xywx
  rsq r0.w, r0.w
  mul r9.xyz, r0.wwww, r9.xywx
  dp2 r0.w, r8.zwzz, r8.zwzz
  mad r10.zw, -r0.wwww, l(0.000000, 0.000000, 0.250000, 0.500000), l(0.000000, 0.000000, 1.000000, 1.000000)
  max r0.w, r10.z, l(0.000000)
  sqrt r0.w, r0.w
  mul r10.xy, r0.wwww, r8.zwzz
  dp3 r0.w, r10.xywx, r10.xywx
  rsq r0.w, r0.w
  mul r8.xyz, r0.wwww, r10.xywx
  dp2 r0.w, r7.xyxx, l(65280.000000, 255.000000, 0.000000, 0.000000)
  round_ne r0.w, r0.w
  mul r5.w, r0.w, l(0.031250)
  round_z r5.w, r5.w
  mad r10.z, r0.w, l(0.031250), -r5.w
  mul r0.w, r5.w, l(0.015625)
  round_z r10.x, r0.w
  mad r10.y, r5.w, l(0.015625), -r10.x
  mul r10.xyz, r10.xyzx, l(0.032258, 1.015873, 1.032258, 0.000000)
  mul r7.xy, r7.zwzz, l(255.000000, 255.000000, 0.000000, 0.000000)
  round_ne r7.xy, r7.xyxx
  mul r7.zw, r7.xxxy, l(0.000000, 0.000000, 0.062500, 0.062500)
  round_z r11.xy, r7.zwzz
  mad r11.zw, r7.xxxy, l(0.000000, 0.000000, 0.062500, 0.062500), -r11.xxxy
  mul r7.xw, r11.yyyw, l(0.066667, 0.000000, 0.000000, 1.066667)
  mad r7.yz, r11.xxzx, l(0.000000, 0.800000, 12.800001, 0.000000), l(0.000000, 1.000000, 1.000000, 0.000000)
  exp r7.yz, r7.yyzy
  mad r7.yz, r7.yyzy, l(0.000000, 1.443000, 1.443000, 0.000000), l(0.000000, 1.443000, 1.443000, 0.000000)
  mul r11.xyzw, r3.xyzw, r3.xyzw
  mov r12.xyz, r11.wwww
  mov r0.w, l(0)
else 
  mad r2.xyz, r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r5.w, r2.xyzx, r2.xyzx
  rsq r5.w, r5.w
  mul r9.xyz, r2.xyzx, r5.wwww
  mul r3.xyzw, r3.xyzw, r3.xyzw
  ieq r2.x, r0.z, l(5)
  if_nz r2.x
    mul r11.xyz, r3.wwww, r3.xyzx
    mov r12.xyz, r3.xyzx
  else 
    ieq r2.x, r0.z, l(1)
    if_nz r2.x
      mul r12.xyz, r3.xyzx, r3.wwww
    else 
      mov r12.xyz, r3.wwww
    endif 
    mov r11.xyz, r3.xyzx
  endif 
  lt r2.x, l(0.000000), r12.x
  and r0.w, r2.w, r2.x
  mad r2.x, r0.w, l(12.000000), l(1.000000)
  exp r2.x, r2.x
  mad r7.y, r2.x, l(1.443000), l(1.443000)
  mov r7.xzw, l(0,0,0,0)
  mov r10.xyz, l(0,0,0,0)
  mov r8.xyz, l(0,0,0,0)
endif 
mad r2.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r6.xy, r2.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000)
mov r6.w, l(1.000000)
dp4 r2.x, r6.xyzw, cb0[2].xyzw
dp4 r2.y, r6.xyzw, cb0[3].xyzw
dp4 r2.z, r6.xyzw, cb0[4].xyzw
dp4 r2.w, r6.xyzw, cb0[5].xyzw
div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
mul r3.xyz, r2.wwww, r2.xzyx
dp3 r2.x, r3.xyzx, r3.xyzx
rsq r2.z, r2.x
mul r6.xyz, r2.zzzz, r3.xzyx
log r3.w, |r4.x|
mul r3.w, r3.w, cb0[13].z
exp r3.w, r3.w
ld_indexable(texture2d)(float,float,float,float) r1.x, r1.xyzw, t10.xyzw
mad r1.y, r2.y, r2.w, cb0[0].y
mul r1.yz, r1.yyyy, cb0[8].xxzx
mad r1.yz, r1.yyzy, cb0[6].wwww, r3.xxyx
mad r1.yz, r1.yyzy, cb0[6].zzzz, cb0[6].xxyx
sample_l_indexable(texture2d)(float,float,float,float) r1.y, r1.yzyy, t0.yxzw, s0, l(0.000000)
add_sat r1.y, r1.y, cb0[7].x
log r1.y, r1.y
mul r1.y, r1.y, cb0[7].y
exp r1.y, r1.y
sqrt r1.z, r2.x
add r1.z, r1.z, -cb0[7].z
mul_sat r1.z, r1.z, cb0[7].w
mul r1.z, r1.z, r1.z
add r1.w, -r1.y, l(1.000000)
mad r1.y, r1.z, r1.w, r1.y
mul r1.x, r1.y, r1.x
dp3 r1.y, r9.xyzx, cb0[8].xyzx
mov_sat r1.z, r1.y
mul r2.xyw, r1.zzzz, cb0[9].xyxz
mul r2.xyw, r1.xxxx, r2.xyxw
if_nz r4.z
  mov_sat r7.w, r7.w
  mad r1.y, r7.w, l(0.500000), r1.y
  mad r1.z, r7.w, l(0.500000), l(1.000000)
  div_sat r1.y, r1.y, r1.z
  mul r1.yzw, r1.yyyy, cb0[9].xxyz
  mul r1.yzw, r1.xxxx, r1.yyzw
  mad r13.xyz, -r9.xyzx, r7.xxxx, r8.xyzx
  dp3 r4.x, r13.xyzx, r13.xyzx
  rsq r4.x, r4.x
  mul r13.xyz, r4.xxxx, r13.xyzx
  mad r14.xyz, -r3.xzyx, r2.zzzz, cb0[8].xyzx
  dp3 r4.x, r14.xyzx, r14.xyzx
  rsq r4.x, r4.x
  mul r14.xyz, r4.xxxx, r14.xyzx
  dp3 r4.x, r8.xyzx, r14.xyzx
  mad r4.x, -r4.x, r4.x, l(1.000000)
  max r4.x, r4.x, l(0.000000)
  sqrt r4.x, r4.x
  log r4.x, r4.x
  mul r4.x, r4.x, r7.y
  exp r4.x, r4.x
  dp3 r5.w, r13.xyzx, r14.xyzx
  mad r5.w, -r5.w, r5.w, l(1.000000)
  max r5.w, r5.w, l(0.000000)
  sqrt r5.w, r5.w
  log r5.w, r5.w
  mul r5.w, r5.w, r7.z
  exp r5.w, r5.w
  mul r7.xzw, r10.xxyz, r5.wwww
  mad r7.xzw, r4.xxxx, r12.xxxx, r7.xxzw
  mul r7.xzw, r7.xxzw, l(0.150000, 0.000000, 0.150000, 0.150000)
  mul r7.xzw, r2.xxyw, r7.xxzw
  mul r7.xzw, r7.xxzw, cb0[9].wwww
  mov r2.xyw, r1.yzyw
else 
  mad r1.yzw, -r3.xxzy, r2.zzzz, cb0[8].xxyz
  dp3 r2.z, r1.yzwy, r1.yzwy
  rsq r2.z, r2.z
  mul r1.yzw, r1.yyzw, r2.zzzz
  dp3_sat r1.y, r9.xyzx, r1.yzwy
  mad r1.z, r7.y, l(0.086625), l(0.875000)
  mad r1.y, r1.y, r7.y, -r7.y
  exp r1.y, r1.y
  mul r1.y, r1.y, r1.z
  mul r1.yzw, r1.yyyy, r2.xxyw
  mul r7.xzw, r1.yyzw, cb0[9].wwww
endif 
mad r1.yzw, r5.xxyz, cb0[15].yyyy, r2.xxyw
ine r0.z, r0.z, l(4)
if_nz r0.z
  dp3 r0.z, r6.xyzx, r9.xyzx
  add r0.z, r0.z, r0.z
  mad r2.xyz, r9.xyzx, -r0.zzzz, r6.xyzx
  eq r6.xyzw, r4.yyyy, l(0.000000, 0.003922, 0.007843, 0.011765)
  and r6.xyzw, r6.xyzw, cb0[13].xxxx
  add r0.z, -cb0[13].w, l(1.000000)
  mad r0.z, r1.x, r0.z, cb0[13].w
  mul r0.z, r3.w, r0.z
  ftoi r3.xy, cb0[16].xyxx
  round_z r4.xy, cb0[16].xyxx
  mad r4.xy, -r0.wwww, l(15.000000, 15.000000, 0.000000, 0.000000), r4.xyxx
  add r4.xy, r4.xyxx, l(5.000000, 5.000000, 0.000000, 0.000000)
  iadd r3.xy, r3.xyxx, l(-1, -1, 0, 0)
  itof r3.xy, r3.xyxx
  max r4.xy, r4.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
  min r3.xy, r3.xyxx, r4.xyxx
  sample_l_indexable(texturecube)(float,float,float,float) r8.xyzw, r2.xyzx, t2.xyzw, s2, r3.y
  dp4 r0.w, r6.xyzw, r8.xyzw
  sample_l_indexable(texturecube)(float,float,float,float) r2.xyz, r2.xyzx, t1.xyzw, s1, r3.x
  mul r2.xyz, r0.zzzz, r2.xyzx
  mad r7.xzw, r2.xxyz, cb0[14].xxxx, r7.xxzw
else 
  mov r0.w, l(0)
endif 
mad r2.xyz, r5.xyzx, cb0[15].yyyy, cb0[13].yyyy
mul r2.xyz, r0.wwww, r2.xyzx
add r0.z, -r3.w, l(1.000000)
mad r2.xyz, r2.xyzx, r0.zzzz, r7.xzwx
if_z r4.z
  mul r2.xyz, r12.xyzx, r2.xyzx
endif 
movc r0.z, r4.w, l(0), l(1.000000)
mul r3.xyz, r0.zzzz, r2.xyzx
mad o0.xyz, r1.yzwy, r11.xyzx, r3.xyzx
gather4_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xyxx, t3.xyzw, s3.x
min r0.x, r0.y, r0.x
min r0.x, r0.z, r0.x
min o0.w, r0.w, r0.x
mov o1.xyz, r2.xyzx
mov o1.w, l(1.000000)
ret 
// Approximately 208 instruction slots used

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