//AO
// 3DMigoto: b8fab946bb4a16a5 | Matched 2 variants of 1 shaders: Hidden/HBAO
//
//       Unity headers extracted from HBAO.shader
//       Shader "Hidden/HBAO" {
//         Properties {
//          _MainTex ("", 2D) = "" { }
//          _HBAOTex ("", 2D) = "" { }
//         }
//         Fallback Off
//         SubShader 1/1 {
//           Pass 5/31 {
//             ZTest Always
//             ZWrite Off
//             Cull Off
//             GpuProgramID 301833
//             Program "fp" {
//               SubProgram "d3d11 " {
// 1:              GpuProgramIndex 183
// 2:              GpuProgramIndex 195
//               }
//             }
//           }
//         }
//       }
//
//    Unity 5.3 headers extracted from HBAO.shader.decompressed:
//      API d3d11
//      Shader model ps_4_0
//      undeciphered1: 201509030 724 51 0
// 2:   Keywords { "NORMALS_CAMERA" "DEFERRED_SHADING_ON" }
// 1:   Keywords { "NORMALS_CAMERA" }
//      undeciphered2: 1 3 2 3 0
//      undeciphered3: 0 0
//      ConstBuffer "UnityPerCamera" 144
//      Vector 80 [_ProjectionParams]
//      Vector 96 [_ScreenParams]
//      Vector 112 [_ZBufferParams]
//      ConstBuffer "FrequentlyUpdatedUniforms" 176
//      Vector 0 [_UVToView]
//      Float 80 [_Radius]
//      Float 84 [_MaxRadiusPixels]
//      Float 88 [_NegInvRadius2]
//      Float 92 [_AngleBias]
//      Float 96 [_AOmultiplier]
//      Float 100 [_Intensity]
//      Float 128 [_NoiseTexSize]
//      Float 148 [_MaxDistance]
//      Float 152 [_DistanceFalloff]
//      SetTexture 0 [_CameraDepthTexture] 2D 0
//      SetTexture 1 [_NoiseTex] 2D 2
//      SetTexture 2 [_CameraDepthNormalsTexture] 2D 1
//      BindCB "UnityPerCamera" 0
//      BindCB "FrequentlyUpdatedUniforms" 1
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py

// ---- Created with 3Dmigoto v1.2.38 on Thu Feb 09 12:32:30 2017
Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb1 : register(b1)
{
  float4 cb1[10];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[8];
}




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


void main( 
  float2 v0 : TEXCOORD0,
  float2 w0 : TEXCOORD1,
  float4 v1 : SV_Position0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = t0.Sample(s0_s, w0.xy).xyzw;
  r0.x = cb0[7].z * r0.x + cb0[7].w;
  r0.z = 1 / r0.x;
  r0.w = cb1[9].y + -r0.z;
  r0.w = cmp(r0.w < 0);
  if (r0.w != 0) discard;
  r1.xy = v1.xy / cb1[8].xx;
  r1.xyzw = t1.Sample(s2_s, r1.xy).xyzw;
  r0.w = cb1[5].x / r0.z;
  r0.w = min(cb1[5].y, r0.w);
  r1.w = 0.142857149 * r0.w;
  r1.z = r1.z * r1.w + 1;
  r1.w = r0.w * 0.142857149 + r1.z;
  r2.xy = r1.ww * r1.xy;
  r2.xy = round(r2.xy);
  r2.zw = float2(-1,-1) + cb0[6].zw;
  r2.xy = r2.xy * r2.zw + w0.xy;
  r3.xyzw = t0.Sample(s0_s, r2.xy).xyzw;
  r2.xy = r2.xy * cb1[0].xy + cb1[0].zw;
  r3.x = cb0[7].z * r3.x + cb0[7].w;
  r3.z = 1 / r3.x;
  r3.xy = r3.zz * r2.xy;
  r2.xy = w0.xy * cb1[0].xy + cb1[0].zw;
  r0.xy = r2.xy * r0.zz;
  r3.xyz = r3.xyz + -r0.xyz;
  r2.x = dot(r3.xyz, r3.xyz);
  r2.y = rsqrt(r2.x);
  r2.x = saturate(r2.x * cb1[5].z + 1);
  r4.xyzw = t2.Sample(s1_s, w0.xy).xyzw;
  r4.xyz = r4.xyz * float3(3.55539989,3.55539989,0) + float3(-1.77769995,-1.77769995,1);
  r3.w = dot(r4.xyz, r4.xyz);
  r3.w = 2 / r3.w;
  r4.xy = r3.ww * r4.xy;
  r4.z = -1 + r3.w;
  r4.xyz = float3(1,-1,-1) * r4.xyz;
  r3.x = dot(r4.xyz, r3.xyz);
  r2.y = saturate(r3.x * r2.y + -cb1[5].w);
  r2.x = r2.y * r2.x;
  r3.xy = r1.zz * r1.xy;
  r3.xy = round(r3.xy);
  r3.xy = r3.xy * r2.zw + w0.xy;
  r5.xyzw = t0.Sample(s0_s, r3.xy).xyzw;
  r3.xy = r3.xy * cb1[0].xy + cb1[0].zw;
  r2.y = cb0[7].z * r5.x + cb0[7].w;
  r5.z = 1 / r2.y;
  r5.xy = r5.zz * r3.xy;
  r3.xyz = r5.xyz + -r0.xyz;
  r2.y = dot(r3.xyz, r3.xyz);
  r3.x = dot(r4.xyz, r3.xyz);
  r3.y = rsqrt(r2.y);
  r2.y = saturate(r2.y * cb1[5].z + 1);
  r3.x = saturate(r3.x * r3.y + -cb1[5].w);
  r2.x = r3.x * r2.y + r2.x;
  r2.y = r0.w * 0.142857149 + r1.w;
  r3.xy = r2.yy * r1.xy;
  r3.xy = round(r3.xy);
  r3.xy = r3.xy * r2.zw + w0.xy;
  r5.xyzw = t0.Sample(s0_s, r3.xy).xyzw;
  r3.xy = r3.xy * cb1[0].xy + cb1[0].zw;
  r3.z = cb0[7].z * r5.x + cb0[7].w;
  r5.z = 1 / r3.z;
  r5.xy = r5.zz * r3.xy;
  r3.xyz = r5.xyz + -r0.xyz;
  r3.w = dot(r3.xyz, r3.xyz);
  r3.x = dot(r4.xyz, r3.xyz);
  r3.y = rsqrt(r3.w);
  r3.z = saturate(r3.w * cb1[5].z + 1);
  r3.x = saturate(r3.x * r3.y + -cb1[5].w);
  r2.x = r3.x * r3.z + r2.x;
  r3.x = r0.w * 0.142857149 + r2.y;
  r3.yz = r3.xx * r1.xy;
  r3.yz = round(r3.yz);
  r3.yz = r3.yz * r2.zw + w0.xy;
  r5.xyzw = t0.Sample(s0_s, r3.yz).xyzw;
  r3.yz = r3.yz * cb1[0].xy + cb1[0].zw;
  r3.w = cb0[7].z * r5.x + cb0[7].w;
  r5.z = 1 / r3.w;
  r5.xy = r5.zz * r3.yz;
  r3.yzw = r5.xyz + -r0.xyz;
  r4.w = dot(r3.yzw, r3.yzw);
  r3.y = dot(r4.xyz, r3.yzw);
  r3.z = rsqrt(r4.w);
  r3.w = saturate(r4.w * cb1[5].z + 1);
  r3.y = saturate(r3.y * r3.z + -cb1[5].w);
  r2.x = r3.y * r3.w + r2.x;
  r3.y = r0.w * 0.142857149 + r3.x;
  r0.w = r0.w * 0.142857149 + r3.y;
  r3.zw = r3.yy * r1.xy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r5.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r5.x + cb0[7].w;
  r5.z = 1 / r4.w;
  r5.xy = r5.zz * r3.zw;
  r5.xyz = r5.xyz + -r0.xyz;
  r3.z = dot(r5.xyz, r5.xyz);
  r3.w = dot(r4.xyz, r5.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r0.ww * r1.xy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r5.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r5.x + cb0[7].w;
  r5.z = 1 / r4.w;
  r5.xy = r5.zz * r3.zw;
  r5.xyz = r5.xyz + -r0.xyz;
  r3.z = dot(r5.xyz, r5.xyz);
  r3.w = dot(r4.xyz, r5.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = float2(0.707106769,0.707106769) * r1.xy;
  r5.x = r1.x * 0.707106769 + -r3.w;
  r5.y = r3.w + r3.z;
  r5.zw = r5.xy * r1.zz;
  r5.zw = round(r5.zw);
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r5.zw = r5.xy * r1.ww;
  r5.zw = round(r5.zw);
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r5.zw = r5.xy * r2.yy;
  r5.zw = round(r5.zw);
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r5.zw = r5.xy * r3.xx;
  r5.zw = round(r5.zw);
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r5.zw = r5.xy * r3.yy;
  r5.xy = r5.xy * r0.ww;
  r5.xyzw = round(r5.xyzw);
  r5.xy = r5.xy * r2.zw + w0.xy;
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r6.xyzw = t0.Sample(s0_s, r5.xy).xyzw;
  r5.xy = r5.xy * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.xy;
  r5.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r5.xyz, r5.xyz);
  r5.x = dot(r4.xyz, r5.xyz);
  r5.y = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.x = saturate(r5.x * r5.y + -cb1[5].w);
  r2.x = r5.x * r4.w + r2.x;
  r5.x = r1.x * -4.37113883e-008 + -r1.y;
  r5.y = r1.y * -4.37113883e-008 + r1.x;
  r5.zw = r5.xy * r1.zz;
  r5.zw = round(r5.zw);
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r5.zw = r5.xy * r1.ww;
  r5.zw = round(r5.zw);
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r5.zw = r5.xy * r2.yy;
  r5.zw = round(r5.zw);
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r5.zw = r5.xy * r3.xx;
  r5.zw = round(r5.zw);
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r5.zw = r5.xy * r3.yy;
  r5.xy = r5.xy * r0.ww;
  r5.xyzw = round(r5.xyzw);
  r5.xy = r5.xy * r2.zw + w0.xy;
  r5.zw = r5.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r5.zw).xyzw;
  r5.zw = r5.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r6.xyz, r6.xyz);
  r5.z = dot(r4.xyz, r6.xyz);
  r5.w = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.z = saturate(r5.z * r5.w + -cb1[5].w);
  r2.x = r5.z * r4.w + r2.x;
  r6.xyzw = t0.Sample(s0_s, r5.xy).xyzw;
  r5.xy = r5.xy * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r5.xy;
  r5.xyz = r6.xyz + -r0.xyz;
  r4.w = dot(r5.xyz, r5.xyz);
  r5.x = dot(r4.xyz, r5.xyz);
  r5.y = rsqrt(r4.w);
  r4.w = saturate(r4.w * cb1[5].z + 1);
  r5.x = saturate(r5.x * r5.y + -cb1[5].w);
  r2.x = r5.x * r4.w + r2.x;
  r5.x = r1.x * -0.707106769 + -r3.w;
  r5.y = r1.y * -0.707106769 + r3.z;
  r3.zw = r5.xy * r1.zz;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r1.ww;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r2.yy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r3.xx;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r3.yy;
  r5.xy = r5.xy * r0.ww;
  r5.xy = round(r5.xy);
  r5.xy = r5.xy * r2.zw + w0.xy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r6.xyzw = t0.Sample(s0_s, r5.xy).xyzw;
  r3.zw = r5.xy * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r5.z = 1 / r4.w;
  r5.xy = r5.zz * r3.zw;
  r5.xyz = r5.xyz + -r0.xyz;
  r3.z = dot(r5.xyz, r5.xyz);
  r3.w = dot(r4.xyz, r5.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r5.x = -r1.y * -8.74227766e-008 + -r1.x;
  r5.y = r1.x * -8.74227766e-008 + -r1.y;
  r3.zw = r5.xy * r1.zz;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r1.ww;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r2.yy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r3.xx;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r3.yy;
  r5.xy = r5.xy * r0.ww;
  r5.xy = round(r5.xy);
  r5.xy = r5.xy * r2.zw + w0.xy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r6.xyzw = t0.Sample(s0_s, r5.xy).xyzw;
  r3.zw = r5.xy * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r5.z = 1 / r4.w;
  r5.xy = r5.zz * r3.zw;
  r5.xyz = r5.xyz + -r0.xyz;
  r3.z = dot(r5.xyz, r5.xyz);
  r3.w = dot(r4.xyz, r5.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.z = -0.707106888 * r1.y;
  r5.x = r1.x * -0.70710665 + -r3.z;
  r5.y = dot(r1.yx, float2(-0.70710665,-0.707106888));
  r3.zw = r5.xy * r1.zz;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r1.ww;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r2.yy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r3.xx;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r3.zw = r5.xy * r3.yy;
  r5.xy = r5.xy * r0.ww;
  r5.xy = round(r5.xy);
  r5.xy = r5.xy * r2.zw + w0.xy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r6.xyz, r6.xyz);
  r3.w = dot(r4.xyz, r6.xyz);
  r4.w = rsqrt(r3.z);
  r3.z = saturate(r3.z * cb1[5].z + 1);
  r3.w = saturate(r3.w * r4.w + -cb1[5].w);
  r2.x = r3.w * r3.z + r2.x;
  r6.xyzw = t0.Sample(s0_s, r5.xy).xyzw;
  r3.zw = r5.xy * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r5.z = 1 / r4.w;
  r5.xy = r5.zz * r3.zw;
  r5.xyz = r5.xyz + -r0.xyz;
  r3.z = dot(r4.xyz, r5.xyz);
  r3.w = dot(r5.xyz, r5.xyz);
  r4.w = rsqrt(r3.w);
  r3.w = saturate(r3.w * cb1[5].z + 1);
  r3.z = saturate(r3.z * r4.w + -cb1[5].w);
  r2.x = r3.z * r3.w + r2.x;
  r5.x = r1.x * 1.19248806e-008 + r1.y;
  r5.y = r1.y * 1.19248806e-008 + -r1.x;
  r3.zw = r5.xy * r1.zz;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r4.xyz, r6.xyz);
  r3.w = dot(r6.xyz, r6.xyz);
  r4.w = rsqrt(r3.w);
  r3.w = saturate(r3.w * cb1[5].z + 1);
  r3.z = saturate(r3.z * r4.w + -cb1[5].w);
  r2.x = r3.z * r3.w + r2.x;
  r3.zw = r5.xy * r1.ww;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r4.xyz, r6.xyz);
  r3.w = dot(r6.xyz, r6.xyz);
  r4.w = rsqrt(r3.w);
  r3.w = saturate(r3.w * cb1[5].z + 1);
  r3.z = saturate(r3.z * r4.w + -cb1[5].w);
  r2.x = r3.z * r3.w + r2.x;
  r3.zw = r5.xy * r2.yy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r4.xyz, r6.xyz);
  r3.w = dot(r6.xyz, r6.xyz);
  r4.w = rsqrt(r3.w);
  r3.w = saturate(r3.w * cb1[5].z + 1);
  r3.z = saturate(r3.z * r4.w + -cb1[5].w);
  r2.x = r3.z * r3.w + r2.x;
  r3.zw = r5.xy * r3.xx;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r4.xyz, r6.xyz);
  r3.w = dot(r6.xyz, r6.xyz);
  r4.w = rsqrt(r3.w);
  r3.w = saturate(r3.w * cb1[5].z + 1);
  r3.z = saturate(r3.z * r4.w + -cb1[5].w);
  r2.x = r3.z * r3.w + r2.x;
  r3.zw = r5.xy * r3.yy;
  r5.xy = r5.xy * r0.ww;
  r5.xy = round(r5.xy);
  r5.xy = r5.xy * r2.zw + w0.xy;
  r3.zw = round(r3.zw);
  r3.zw = r3.zw * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r3.zw).xyzw;
  r3.zw = r3.zw * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r4.w;
  r6.xy = r6.zz * r3.zw;
  r6.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r4.xyz, r6.xyz);
  r3.w = dot(r6.xyz, r6.xyz);
  r4.w = rsqrt(r3.w);
  r3.w = saturate(r3.w * cb1[5].z + 1);
  r3.z = saturate(r3.z * r4.w + -cb1[5].w);
  r2.x = r3.z * r3.w + r2.x;
  r6.xyzw = t0.Sample(s0_s, r5.xy).xyzw;
  r3.zw = r5.xy * cb1[0].xy + cb1[0].zw;
  r4.w = cb0[7].z * r6.x + cb0[7].w;
  r5.z = 1 / r4.w;
  r5.xy = r5.zz * r3.zw;
  r5.xyz = r5.xyz + -r0.xyz;
  r3.z = dot(r4.xyz, r5.xyz);
  r3.w = dot(r5.xyz, r5.xyz);
  r4.w = rsqrt(r3.w);
  r3.w = saturate(r3.w * cb1[5].z + 1);
  r3.z = saturate(r3.z * r4.w + -cb1[5].w);
  r2.x = r3.z * r3.w + r2.x;
  r3.z = -0.707106531 * r1.y;
  r5.x = r1.x * 0.707107008 + -r3.z;
  r5.y = dot(r1.yx, float2(0.707107008,-0.707106531));
  r1.xy = r5.xy * r1.zz;
  r1.xy = round(r1.xy);
  r1.xy = r1.xy * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r1.xy).xyzw;
  r1.xy = r1.xy * cb1[0].xy + cb1[0].zw;
  r1.z = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r1.z;
  r6.xy = r6.zz * r1.xy;
  r1.xyz = r6.xyz + -r0.xyz;
  r3.z = dot(r4.xyz, r1.xyz);
  r1.x = dot(r1.xyz, r1.xyz);
  r1.y = rsqrt(r1.x);
  r1.x = saturate(r1.x * cb1[5].z + 1);
  r1.y = saturate(r3.z * r1.y + -cb1[5].w);
  r1.x = r1.y * r1.x + r2.x;
  r1.yz = r5.xy * r1.ww;
  r1.yz = round(r1.yz);
  r1.yz = r1.yz * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r1.yz).xyzw;
  r1.yz = r1.yz * cb1[0].xy + cb1[0].zw;
  r1.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r1.w;
  r6.xy = r6.zz * r1.yz;
  r1.yzw = r6.xyz + -r0.xyz;
  r2.x = dot(r4.xyz, r1.yzw);
  r1.y = dot(r1.yzw, r1.yzw);
  r1.z = rsqrt(r1.y);
  r1.y = saturate(r1.y * cb1[5].z + 1);
  r1.z = saturate(r2.x * r1.z + -cb1[5].w);
  r1.x = r1.z * r1.y + r1.x;
  r1.yz = r5.xy * r2.yy;
  r1.yz = round(r1.yz);
  r1.yz = r1.yz * r2.zw + w0.xy;
  r6.xyzw = t0.Sample(s0_s, r1.yz).xyzw;
  r1.yz = r1.yz * cb1[0].xy + cb1[0].zw;
  r1.w = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r1.w;
  r6.xy = r6.zz * r1.yz;
  r1.yzw = r6.xyz + -r0.xyz;
  r2.x = dot(r4.xyz, r1.yzw);
  r1.y = dot(r1.yzw, r1.yzw);
  r1.z = rsqrt(r1.y);
  r1.y = saturate(r1.y * cb1[5].z + 1);
  r1.z = saturate(r2.x * r1.z + -cb1[5].w);
  r1.x = r1.z * r1.y + r1.x;
  r1.yz = r5.xy * r3.xx;
  r1.yz = round(r1.yz);
  r1.yz = r1.yz * r2.zw + w0.xy;
  r2.xy = r1.yz * cb1[0].xy + cb1[0].zw;
  r6.xyzw = t0.Sample(s0_s, r1.yz).xyzw;
  r1.y = cb0[7].z * r6.x + cb0[7].w;
  r6.z = 1 / r1.y;
  r6.xy = r6.zz * r2.xy;
  r1.yzw = r6.xyz + -r0.xyz;
  r2.x = dot(r4.xyz, r1.yzw);
  r1.y = dot(r1.yzw, r1.yzw);
  r1.z = rsqrt(r1.y);
  r1.y = saturate(r1.y * cb1[5].z + 1);
  r1.z = saturate(r2.x * r1.z + -cb1[5].w);
  r1.x = r1.z * r1.y + r1.x;
  r1.yz = r5.xy * r3.yy;
  r2.xy = r5.xy * r0.ww;
  r2.xy = round(r2.xy);
  r2.xy = r2.xy * r2.zw + w0.xy;
  r1.yz = round(r1.yz);
  r1.yz = r1.yz * r2.zw + w0.xy;
  r2.zw = r1.yz * cb1[0].xy + cb1[0].zw;
  r3.xyzw = t0.Sample(s0_s, r1.yz).xyzw;
  r0.w = cb0[7].z * r3.x + cb0[7].w;
  r3.z = 1 / r0.w;
  r3.xy = r3.zz * r2.zw;
  r1.yzw = r3.xyz + -r0.xyz;
  r0.w = dot(r4.xyz, r1.yzw);
  r1.y = dot(r1.yzw, r1.yzw);
  r1.z = rsqrt(r1.y);
  r1.y = saturate(r1.y * cb1[5].z + 1);
  r0.w = saturate(r0.w * r1.z + -cb1[5].w);
  r0.w = r0.w * r1.y + r1.x;
  r1.xy = r2.xy * cb1[0].xy + cb1[0].zw;
  r2.xyzw = t0.Sample(s0_s, r2.xy).xyzw;
  r1.z = cb0[7].z * r2.x + cb0[7].w;
  r2.z = 1 / r1.z;
  r2.xy = r2.zz * r1.xy;
  r1.xyz = r2.xyz + -r0.xyz;
  r0.x = dot(r4.xyz, r1.xyz);
  r0.y = dot(r1.xyz, r1.xyz);
  r1.x = rsqrt(r0.y);
  r0.y = saturate(r0.y * cb1[5].z + 1);
  r0.x = saturate(r0.x * r1.x + -cb1[5].w);
  r0.x = r0.x * r0.y + r0.w;
  r0.y = cb1[6].x * cb1[6].y;
  r0.x = r0.y * r0.x;
  r0.x = saturate(-r0.x * 0.020833334 + 1);
  r0.y = 1 + -r0.x;
  r0.w = cb1[9].y + -cb1[9].z;
  r1.x = r0.z + -r0.w;
  r0.w = cb1[9].y + -r0.w;
  r0.w = saturate(r1.x / r0.w);
  o0.w = r0.w * r0.y + r0.x;
  o0.z = 1;
  r0.x = 1 / cb0[5].z;
  r0.x = saturate(r0.z * r0.x);
  r0.xy = float2(1,255) * r0.xx;
  r0.xy = frac(r0.xy);
  o0.x = -r0.y * 0.00392156886 + r0.x;
  o0.y = r0.y;

//o0 = 0;
  return;
}