//Tojo headquarters water PS.
// ---- Created with 3Dmigoto v1.3.16 on Thu May 16 20:35:42 2019
Texture2D<float4> t8 : register(t8);

Texture2D<float4> t7 : register(t7);

Texture2D<float4> t6 : register(t6);

Texture2D<float4> t5 : register(t5);

Texture2D<float4> t4 : register(t4);

Texture2D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s8_s : register(s8);

SamplerState s7_s : register(s7);

SamplerState s6_s : register(s6);

SamplerState s5_s : register(s5);

SamplerState s4_s : register(s4);

SamplerState s3_s : register(s3);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

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

cbuffer cb9 : register(b9)
{
  float4 cb9[26];
}

cbuffer cb12 : register(b12)
{
  float4 cb12[3];
}




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


void main(
  float4 v0 : TEXCOORD0,
  float4 v1 : TEXCOORD1,
  float4 v2 : TEXCOORD2,
  float3 v3 : TEXCOORD3,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 stereo = StereoParams.Load(0);
  
  r0.xy = v1.xy / v1.zz;
  r0.z = dot(v0.xyz, v0.xyz);
  r0.z = rsqrt(r0.z);
  r1.xyz = v0.xyz * r0.zzz;
  
  r1.x-=stereo.x*r0.z*stereo.y/cb12[0].x;
  
  r0.zw = v3.xy / v3.zz;
  r2.xyz = t7.Sample(s7_s, r0.zw).xyz;
  r2.xy = float2(-0.5,-0.5) + r2.xy;
  r1.w = dot(r2.xy, r2.xy);
  r1.w = rsqrt(r1.w);
  r2.xy = r2.xy * r1.ww;
  r1.w = 1 / r2.z;
  r1.w = -1 + r1.w;
  r2.xy = r2.xy * r1.ww;
  r2.yzw = cb9[23].xyz * r2.yyy;
  r2.xyz = cb9[21].xyz * r2.xxx + r2.yzw;
  r2.xyz = cb9[14].xxx * r2.xyz;
  r3.xyz = r2.xyz * cb9[5].www + v0.xyz;
  r1.w = cb9[5].w + -1;
  r4.xyz = r2.xyz * r1.www + v0.xyz;
  r3.w = 1;
  r5.x = dot(cb9[9].xyzw, r3.xyzw);
  r5.y = dot(cb9[10].xyzw, r3.xyzw);
  r4.w = 1;
  r3.x = dot(cb9[9].xyzw, r4.xyzw);
  r3.y = dot(cb9[10].xyzw, r4.xyzw);
  r4.xyz = t2.Sample(s2_s, r5.xy).xyw;
  r3.xyz = t2.Sample(s2_s, r3.xy).xyw;
  r3.xyz = r3.xyz + -r4.xyz;
  r3.xyz = cb9[5].www * r3.xyz + r4.xyz;
  r3.xy = r3.xy * float2(2,2) + float2(-1,-1);
  r4.x = dot(r3.xy, cb9[7].xy);
  r4.y = dot(r3.xy, cb9[7].zw);
  r4.z = dot(r3.xy, cb9[8].xy);
  r5.xy = t5.Sample(s5_s, r0.zw).xy;
  r5.xy = r5.xy * float2(2,2) + float2(-1,-1);
  r2.w = dot(r5.xy, r5.xy);
  r2.w = 1 + -r2.w;
  r2.w = sqrt(r2.w);
  r5.xzw = cb9[21].xyz * r5.xxx;
  r5.xzw = cb9[0].xyz * r2.www + r5.xzw;
  r5.xyz = cb9[23].xyz * r5.yyy + r5.xzw;
  r2.w = dot(r5.xyz, r5.xyz);
  r2.w = rsqrt(r2.w);
  r5.xyz = r5.xyz * r2.www;
  r2.w = dot(r2.xyz, r2.xyz);
  r2.w = sqrt(r2.w);
  r2.w = r2.w * cb9[14].z + 1;
  r3.w = cb9[14].y / r2.w;
  r4.w = dot(r4.xyz, r5.xyz);
  r3.w = -r4.w + r3.w;
  r6.xyz = r5.xyz * r3.www + r4.xyz;
  r3.w = dot(r6.xyz, r6.xyz);
  r3.w = rsqrt(r3.w);
  r7.xyz = r6.xyz * r3.www;
  r5.w = v0.z * v0.z;
  r6.w = cb9[22].y / r5.w;
  r7.x = dot(r7.xyz, r1.xyz);
  r7.x = 1 + -r7.x;
  r6.w = saturate(abs(r7.x) * r6.w);
  r6.xyz = r6.xyz * r3.www + -r5.xyz;
  r6.xyz = r6.www * r6.xyz + r5.xyz;
  r3.w = dot(r6.xyz, r6.xyz);
  r3.w = rsqrt(r3.w);
  r7.xyz = r6.xyz * r3.www;
  r2.w = cb9[1].w / r2.w;
  r2.w = r2.w + -r4.w;
  r4.xyz = r5.xyz * r2.www + r4.xyz;
  r2.w = dot(r4.xyz, r4.xyz);
  r2.w = rsqrt(r2.w);
  r5.xyz = r4.xyz * r2.www;
  r4.w = t0.Sample(s0_s, r0.xy).x;
  r4.w = cb12[2].z + r4.w;
  r4.w = -cb12[2].w / r4.w;
  r4.w = v0.z + -r4.w;
  r4.w = max(0, r4.w);
  r6.w = 1 + r4.w;
  r6.w = 1 / r6.w;
  r6.w = 1 + -r6.w;
  r6.w = cb9[21].w * r6.w;
  r6.w = r6.w / -v0.z;
  r3.xy = r6.ww * r3.xy + r0.xy;
  r8.xyzw = float4(-0.0199999996,-0.980000019,-0.0199999996,-0.980000019) + r3.xxyy;
  r8.xyzw = float4(-9.99999975e-005,-9.99999975e-005,-9.99999975e-005,-9.99999975e-005) / r8.xyzw;
  r8.yw = float2(1,1) + r8.yw;
  r9.xyzw = cmp(r3.xxyy >= float4(0.00999999978,0.99000001,0.00999999978,0.99000001));
  r9.xyzw = r9.xyzw ? float4(1,1,1,1) : 0;
  r3.xy = -r8.xz + r3.xy;
  r3.xy = r9.xz * r3.xy + r8.xz;
  r8.xy = r8.yw + -r3.xy;
  r3.xy = r9.yw * r8.xy + r3.xy;
  r6.w = t0.Sample(s0_s, r3.xy).x;
  r6.w = cb12[2].z + r6.w;
  r6.w = -cb12[2].w / r6.w;
  r7.w = v0.z + -r6.w;
  r6.w = cmp(v0.z >= r6.w);
  r6.w = r6.w ? 1.000000 : 0;
  r7.w = r7.w + -r4.w;
  r4.w = r6.w * r7.w + r4.w;
  r3.xy = r3.xy + -r0.xy;
  r0.xy = r6.ww * r3.xy + r0.xy;
  r3.x = dot(cb9[0].xyz, cb9[5].xyz);
  r3.x = max(0.00100000005, abs(r3.x));
  r3.y = r4.w / r3.x;
  r6.w = -r4.w / r1.z;
  r8.xyz = r1.xyz * r6.www + v0.xyz;
  r6.w = r3.y * cb9[8].z + 1;
  r9.xyz = r6.www * r2.xyz;
  r10.xyz = r9.xyz * cb9[5].www + r8.xyz;
  r9.xyz = r9.xyz * r1.www + r8.xyz;
  r10.w = 1;
  r11.x = dot(cb9[9].xyzw, r10.xyzw);
  r11.y = dot(cb9[10].xyzw, r10.xyzw);
  r9.w = 1;
  r10.x = dot(cb9[9].xyzw, r9.xyzw);
  r10.y = dot(cb9[10].xyzw, r9.xyzw);
  r9.xy = t2.Sample(s2_s, r11.xy).xy;
  r9.zw = t2.Sample(s2_s, r10.xy).xy;
  r10.xy = cb9[11].yz * r3.yy;
  r9.zw = r9.zw + -r9.xy;
  r9.xy = cb9[5].ww * r9.zw + r9.xy;
  r6.w = r10.x + r10.x;
  r9.xy = r9.xy * r6.ww + -r10.xx;
  r6.w = r3.y * cb9[6].w + 1;
  r10.xzw = r6.www * r2.xyz;
  r11.xyz = r10.xzw * cb9[5].www + r8.xyz;
  r12.xyz = r10.xzw * r1.www + r8.xyz;
  r11.w = 1;
  r8.x = dot(cb9[9].xyzw, r11.xyzw);
  r8.y = dot(cb9[10].xyzw, r11.xyzw);
  r12.w = 1;
  r11.x = dot(cb9[9].xyzw, r12.xyzw);
  r11.y = dot(cb9[10].xyzw, r12.xyzw);
  r9.zw = r8.xy + r9.xy;
  r10.x = t3.SampleLevel(s3_s, r9.zw, r10.y).w;
  r12.xyzw = r9.xyxy * float4(1.10000002,1.10000002,1.20000005,1.20000005) + r8.xyxy;
  r10.z = t3.SampleLevel(s3_s, r12.xy, r10.y).w;
  r10.w = t3.SampleLevel(s3_s, r12.zw, r10.y).w;
  r8.xy = r11.xy + r9.xy;
  r8.x = t3.SampleLevel(s3_s, r8.xy, r10.y).w;
  r9.xyzw = r9.xyxy * float4(1.10000002,1.10000002,1.20000005,1.20000005) + r11.xyxy;
  r8.y = t3.SampleLevel(s3_s, r9.xy, r10.y).w;
  r8.w = t3.SampleLevel(s3_s, r9.zw, r10.y).w;
  r1.w = r3.y * 5 + 1;
  r1.w = 1 / r1.w;
  r6.w = -cb9[8].w + 1;
  r6.w = r1.w * r6.w + cb9[8].w;
  r8.xyw = r8.xyw + -r10.xzw;
  r8.xyw = cb9[5].www * r8.xyw + r10.xzw;
  r8.xyw = log2(r8.xyw);
  r8.xyw = cb9[11].xxx * r8.xyw;
  r8.xyw = exp2(r8.xyw);
  r6.w = r6.w + -r1.w;
  r8.xyw = r8.xyw * r6.www + r1.www;
  r1.w = r8.z * r8.z;
  r1.w = saturate(cb9[25].z / r1.w);
  r8.xyz = r8.xyw * r1.www;
  r9.xyz = t1.Sample(s1_s, r0.xy).xyz;
  r8.xyz = r9.xyz * r8.xyz;
  r0.x = r4.w + r3.y;
  r9.xyz = log2(cb9[1].xyz);
  r10.xyz = r9.xyz * r0.xxx;
  r10.xyz = exp2(r10.xyz);
  r0.x = -r3.z * 0.100000001 + r4.w;
  r0.x = cmp(r0.x < 0);
  if (r0.x != 0) discard;
  r0.x = max(9.99999975e-005, r4.w);
  r0.y = dot(cb9[5].xyz, r7.xyz);
  r0.y = max(0.00100000005, abs(r0.y));
  r1.w = dot(r7.xyz, r1.xyz);
  r1.w = max(0.00100000005, abs(r1.w));
  r1.w = r0.x / r1.w;
  r0.y = r1.w / r0.y;
  r0.y = r0.y / r0.x;
  r0.y = 1 + r0.y;
  r1.w = r0.y * r0.x;
  r11.xyz = r1.www * r9.xyz;
  r11.xyz = exp2(r11.xyz);
  r11.xyz = float3(-1,-1,-1) + r11.xyz;
  r11.xyz = cb9[3].xyz * r11.xyz;
  r11.xyz = r11.xyz / r0.yyy;
  r0.y = dot(cb9[0].xyz, r1.xyz);
  r1.w = max(0.00100000005, abs(r0.y));
  r1.w = r0.x / r1.w;
  r1.w = r1.w / r3.x;
  r1.w = r1.w / r0.x;
  r1.w = 1 + r1.w;
  r0.x = r1.w * r0.x;
  r3.xyz = r0.xxx * r9.xyz;
  r3.xyz = exp2(r3.xyz);
  r3.xyz = float3(-1,-1,-1) + r3.xyz;
  r3.xyz = cb9[3].xyz * r3.xyz;
  r3.xyz = r3.xyz / r1.www;
  r0.x = dot(r1.xyz, cb9[5].xyz);
  r3.xyz = r11.xyz + r3.xyz;
  r0.x = r0.x * r0.x + 1;
  r3.xyz = r3.xyz * r0.xxx;
  r3.xyz = cb9[6].xyz * r3.xyz;
  r0.x = t6.Sample(s6_s, r0.zw).x;
  r0.z = -r4.w * cb9[19].w + 1;
  r0.z = max(0, r0.z);
  r0.w = saturate(cb9[25].w / r5.w);
  r0.x = r0.z * r0.w + r0.x;
  r0.z = cmp(0 >= r0.x);
  if (r0.z != 0) {
    r11.xyz = cb9[0].xyz;
    r0.w = 0;
    r12.xyz = float3(0,0,0);
    r13.xyz = float3(0,0,0);
  }
  r2.xyz = cb9[4].xxx * r2.xyz;
  r14.xyz = v0.xyz;
  r14.w = 1;
  r15.x = dot(cb9[9].xyzw, r14.xyzw);
  r15.y = dot(cb9[10].xyzw, r14.xyzw);
  r15.xy = cb9[22].zz * r15.xy;
  r15.xy = t2.Sample(s2_s, r15.xy).xy;
  r15.xy = float2(-0.5,-0.5) + r15.xy;
  r2.xy = r15.xy * cb9[22].ww + r2.xy;
  r15.xy = cb9[4].yy + float2(0.5,-0.5);
  r16.xyz = r2.xyz * r15.xxx + v0.xyz;
  r15.xyz = r2.xyz * r15.yyy + v0.xyz;
  r16.w = 1;
  r2.x = dot(cb9[9].xyzw, r16.xyzw);
  r2.y = dot(cb9[10].xyzw, r16.xyzw);
  r15.w = 1;
  r16.x = dot(cb9[9].xyzw, r15.xyzw);
  r16.y = dot(cb9[10].xyzw, r15.xyzw);
  r2.xy = cb9[4].zz * r2.xy;
  r15.xy = cb9[4].zz * r16.xy;
  r2.xyz = t8.Sample(s8_s, r2.xy).xyw;
  r15.xyz = t8.Sample(s8_s, r15.xy).xyw;
  if (r0.z == 0) {
    r15.xyz = r15.xyz + -r2.xyz;
    r2.xyz = cb9[4].yyy * r15.xyz + r2.xyz;
    r0.z = r2.z * r0.x;
    r1.w = r0.x * r2.z + cb9[18].w;
    r2.xy = r2.xy * float2(2,-2) + float2(-1,1);
    r15.x = dot(r2.xy, cb9[7].xy);
    r15.y = dot(r2.xy, cb9[7].zw);
    r15.z = dot(r2.xy, cb9[8].xy);
    r2.xyz = cb9[0].xyz * r1.www + r15.xyz;
    r4.w = dot(r2.xyz, r2.xyz);
    r4.w = rsqrt(r4.w);
    r11.xyz = r4.www * r2.xyz;
    r2.x = dot(r11.xyz, cb9[5].xyz);
    r2.x = 1 + r2.x;
    r2.x = saturate(0.5 * r2.x);
    r2.x = log2(r2.x);
    r2.x = cb9[20].w * r2.x;
    r2.x = exp2(r2.x);
    r15.xyz = cb9[18].xyz + -cb9[17].xyz;
    r12.xyz = r2.xxx * r15.xyz + cb9[17].xyz;
    r2.x = 1 / cb9[19].x;
    r1.w = saturate(r2.x * r1.w);
    r2.x = r1.w * -2 + 3;
    r1.w = r1.w * r1.w;
    r0.w = r2.x * r1.w;
    r1.w = cb9[19].z + -cb9[19].y;
    r0.z = r0.z * r1.w + cb9[19].y;
    r2.xyz = r0.zzz * r9.xyz;
    r2.xyz = exp2(r2.xyz);
    r2.xyz = r2.xyz * r0.xxx;
    r13.xyz = cb9[20].xyz * r2.xyz;
  }
  r2.xyz = -r6.xyz * r3.www + r11.xyz;
  r2.xyz = r0.www * r2.xyz + r7.xyz;
  r0.x = dot(r2.xyz, r2.xyz);
  r0.x = rsqrt(r0.x);
  r2.xyz = r2.xyz * r0.xxx;
  r4.xyz = -r4.xyz * r2.www + r11.xyz;
  r4.xyz = r0.www * r4.xyz + r5.xyz;
  r0.x = dot(r4.xyz, r4.xyz);
  r0.x = rsqrt(r0.x);
  r4.xyz = r4.xyz * r0.xxx;
  r0.x = dot(r1.xyz, r2.xyz);
  r0.z = r0.x + r0.x;
  r2.xyz = r2.xyz * -r0.zzz + r1.xyz;
  r0.z = dot(cb9[0].xyz, r2.xyz);
  r5.xyz = cb9[13].xyz + -cb9[12].xyz;
  r5.xyz = r0.zzz * r5.xyz + cb9[12].xyz;
  r1.w = -2 * r0.z;
  r6.xyz = cb9[0].xyz * r1.www + r2.xyz;
  r1.w = cmp(r0.z >= 0);
  r1.w = r1.w ? 1.000000 : 0;
  r2.xyz = -r6.xyz + r2.xyz;
  r2.xyz = r1.www * r2.xyz + r6.xyz;
  r0.z = 0.100000001 + r0.z;
  r0.z = saturate(10 * r0.z);
  r1.w = r0.z * -2 + 3;
  r0.z = r0.z * r0.z;
  r0.z = r1.w * r0.z;
  r0.z = r0.z * 0.899999976 + 0.100000001;
  r1.w = dot(cb0[4].xyz, v0.xyz);
  r3.w = dot(cb0[5].xyz, v0.xyz);
  r4.w = dot(cb0[6].xyz, v0.xyz);
  r5.w = dot(cb0[7].xyz, v0.xyz);
  r6.x = dot(cb0[4].xyz, r2.xyz);
  r1.w = -r1.w / r6.x;
  r6.x = dot(cb0[5].xyz, r2.xyz);
  r3.w = -r3.w / r6.x;
  r6.x = dot(cb0[6].xyz, r2.xyz);
  r4.w = -r4.w / r6.x;
  r6.x = dot(cb0[7].xyz, r2.xyz);
  r5.w = -r5.w / r6.x;
  r6.x = cmp(r1.w >= 0);
  r6.x = r6.x ? 1.000000 : 0;
  r1.w = -1280 + r1.w;
  r1.w = r6.x * r1.w + 1280;
  r6.x = cmp(r3.w >= 0);
  r6.x = r6.x ? 1.000000 : 0;
  r3.w = -1280 + r3.w;
  r3.w = r6.x * r3.w + 1280;
  r6.x = cmp(r4.w >= 0);
  r6.x = r6.x ? 1.000000 : 0;
  r4.w = -1280 + r4.w;
  r4.w = r6.x * r4.w + 1280;
  r6.x = cmp(r5.w >= 0);
  r6.x = r6.x ? 1.000000 : 0;
  r5.w = -1280 + r5.w;
  r5.w = r6.x * r5.w + 1280;
  r1.w = min(r3.w, r1.w);
  r3.w = min(r5.w, r4.w);
  r1.w = min(r3.w, r1.w);
  r6.xyz = r2.xyz * r1.www + v0.xyz;
  r1.w = dot(r1.xyz, r4.xyz);
  r1.w = r1.w + r1.w;
  r1.xyz = r4.xyz * -r1.www + r1.xyz;
  r1.x = dot(cb9[16].xyz, r1.xyz);
  r1.x = -cb9[15].w + r1.x;
  r1.x = saturate(cb9[16].w * r1.x);
  r1.y = r1.x * r1.x;
  r1.x = -r1.x * 2 + 3;
  r1.x = r1.y * r1.x;
  r1.x = log2(r1.x);
  r1.x = cb9[17].w * r1.x;
  r1.x = exp2(r1.x);
  r1.y = cb9[22].x / v0.z;
  r1.y = sqrt(r1.y);
  r1.x = r1.x * r1.y;
  r0.y = saturate(-r0.y);
  r0.y = r1.x * r0.y;
  r1.xyz = cb9[15].xyz * r0.yyy + r5.xyz;
  r0.y = cmp(r2.z < 0);
  r2.w = 1;
  r4.x = dot(cb0[0].xyzw, r2.xyzw);
  r4.y = dot(cb0[1].xyzw, r2.xyzw);
  r1.w = dot(cb0[3].xyzw, r2.xyzw);
  
  r4.x+=stereo.x*(r1.w)*0.5;
  
  r4.xy = r4.xy / r1.ww;
  r1.w = t0.Sample(s0_s, r4.xy).x;
  r5.xyz = t1.Sample(s1_s, r4.xy).xyz;
  if (r0.y != 0) {
    r0.y = cb12[2].z + r1.w;
    r0.y = -cb12[2].w / r0.y;
    r0.y = r0.y / r2.z;
    r2.xyz = r2.xyz * r0.yyy + -v0.xyz;
    r0.y = dot(r2.xyz, r2.xyz);
    r0.y = rsqrt(r0.y);
    r0.y = r2.z * r0.y;
    r2.xy = float2(-0.5,-0.5) + r4.xy;
    r2.xy = float2(-0.5,-0.5) + abs(r2.xy);
    r2.xy = saturate(float2(-10.000001,-10.000001) * r2.xy);
    r2.zw = r2.xy * float2(-2,-2) + float2(3,3);
    r2.xy = r2.xy * r2.xy;
    r2.xy = r2.zw * r2.xy;
    r1.w = r2.x * r2.y;
    r0.y = max(0, -r0.y);
    r0.y = r1.w * r0.y;
    r2.xyz = r5.xyz + -r1.xyz;
    r2.xyz = r0.yyy * r2.xyz + r1.xyz;
  } else {
    r2.xyz = r1.xyz;
  }
  r0.y = v0.z * r6.z;
  r4.xyz = float3(0.300000012,0.600000024,0.899999976) * v0.zzz;
  r4.xyz = r6.zzz * float3(-0.699999988,-0.399999976,-0.100000024) + -r4.xyz;
  r4.xyz = -r0.yyy / r4.xyz;
  r5.xy = v0.xy / v0.zz;
  r5.zw = r6.xy / r6.zz;
  r5.zw = r5.zw + -r5.xy;
  r6.xyzw = r5.zwzw * float4(0.300000012,0.300000012,0.600000024,0.600000024) + r5.xyxy;
  r6.xyzw = r6.zwxy * r4.yyxx;
  r5.xy = r5.zw * float2(0.899999976,0.899999976) + r5.xy;
  r5.xy = r5.xy * r4.zz;
  r7.x = dot(cb0[0].xyzw, r14.xyzw);
  r7.y = dot(cb0[1].xyzw, r14.xyzw);
  r0.y = dot(cb0[3].xyzw, r14.xyzw);
  
  r7.x+=stereo.x*(r0.y-stereo.y)*0.5;
  
  r7.xy = r7.xy / r0.yy;
  r0.y = t0.Sample(s0_s, r7.xy).x;
  r0.y = cb12[2].z + r0.y;
  r0.y = -cb12[2].w / r0.y;
  r7.xy = r6.zw;
  r7.z = r4.x;
  r7.w = 1;
  r9.x = dot(cb0[0].xyzw, r7.xyzw);
  r9.y = dot(cb0[1].xyzw, r7.xyzw);
  r1.w = dot(cb0[3].xyzw, r7.xyzw);
  
  r9.x+=stereo.x*(r1.w-stereo.y)*0.5;
  
  r9.xy = r9.xy / r1.ww;
  r1.w = t0.Sample(s0_s, r9.xy).x;
  r1.w = cb12[2].z + r1.w;
  r1.w = -cb12[2].w / r1.w;
  r2.w = -v0.z + r0.y;
  r3.w = r1.w + -r4.x;
  r4.w = r3.w * r2.w;
  r4.w = cmp(0 < r4.w);
  r3.w = -r3.w + r2.w;
  r2.w = r2.w / r3.w;
  r9.xyz = -v0.xyz + r7.xyz;
  r9.xyz = r2.www * r9.xyz + v0.xyz;
  r9.w = 1;
  r11.x = dot(cb0[0].xyzw, r9.xyzw);
  r11.y = dot(cb0[1].xyzw, r9.xyzw);
  r2.w = dot(cb0[3].xyzw, r9.xyzw);
  
  r11.x+=stereo.x*(r2.w-stereo.y)*0.5;
  
  r11.xy = r11.xy / r2.ww;
  r14.xyz = t1.Sample(s1_s, r11.xy).xyz;
  r11.zw = t4.Sample(s4_s, r11.xy).xy;
  r2.w = t0.Sample(s0_s, r11.xy).x;
  if (r4.w != 0) {
    r0.y = r1.w;
  } else {
    r11.xy = float2(4,4) * r11.zw;
    r1.w = dot(r11.xy, r11.xy);
    r15.zw = -r1.ww * float2(0.25,0.5) + float2(1,1);
    r1.w = max(0, r15.z);
    r1.w = sqrt(r1.w);
    r15.xy = r11.xy * r1.ww;
    r1.w = cb12[2].z + r2.w;
    r1.w = -cb12[2].w / r1.w;
    r1.w = r1.w / r9.z;
    r9.xyw = r9.xyz * r1.www + -v0.xyz;
    r2.w = dot(r9.xyw, r9.xyw);
    r2.w = rsqrt(r2.w);
    r9.xyw = r9.xyw * r2.www;
    r2.w = dot(r15.xyw, r9.xyw);
    r2.w = cmp(-r2.w >= 0);
    r2.w = r2.w ? 1.000000 : 0;
    r1.w = -r9.z * r1.w + r9.z;
    r1.w = r1.w * r1.w;
    r1.w = r1.w * 0.25 + 1;
    r1.w = 1 / r1.w;
    r9.xyz = r14.xyz * r2.www + -r2.xyz;
    r2.xyz = r1.www * r9.xyz + r2.xyz;
  }
  r6.z = r4.y;
  r6.w = 1;
  r9.x = dot(cb0[0].xyzw, r6.xyzw);
  r9.y = dot(cb0[1].xyzw, r6.xyzw);
  r1.w = dot(cb0[3].xyzw, r6.xyzw);
  
  r9.x+=stereo.x*(r1.w-stereo.y)*0.5;
  
  r9.xy = r9.xy / r1.ww;
  r1.w = t0.Sample(s0_s, r9.xy).x;
  r1.w = cb12[2].z + r1.w;
  r1.w = -cb12[2].w / r1.w;
  r2.w = r0.y + -r4.x;
  r3.w = r1.w + -r4.y;
  r4.x = -r3.w + r2.w;
  r4.x = r2.w / r4.x;
  r9.xyz = r6.xyz + -r7.xyz;
  r7.xyz = r4.xxx * r9.xyz + r7.xyz;
  r7.w = 1;
  r9.x = dot(cb0[0].xyzw, r7.xyzw);
  r9.y = dot(cb0[1].xyzw, r7.xyzw);
  r4.x = dot(cb0[3].xyzw, r7.xyzw);
  
  r9.x+=stereo.x*(r4.x-stereo.y)*0.5;
  
  r9.xy = r9.xy / r4.xx;
  r11.xyz = t1.Sample(s1_s, r9.xy).xyz;
  r9.zw = t4.Sample(s4_s, r9.xy).xy;
  r4.x = t0.Sample(s0_s, r9.xy).x;
  if (r4.w != 0) {
    r2.w = r3.w * r2.w;
    r2.w = cmp(0 < r2.w);
    r3.w = ~(int)r2.w;
    if (r2.w != 0) {
      r0.y = r1.w;
    } else {
      r9.xy = float2(4,4) * r9.zw;
      r1.w = dot(r9.xy, r9.xy);
      r14.zw = -r1.ww * float2(0.25,0.5) + float2(1,1);
      r1.w = max(0, r14.z);
      r1.w = sqrt(r1.w);
      r14.xy = r9.xy * r1.ww;
      r1.w = cb12[2].z + r4.x;
      r1.w = -cb12[2].w / r1.w;
      r1.w = r1.w / r7.z;
      r7.xyw = r7.xyz * r1.www + -v0.xyz;
      r2.w = dot(r7.xyw, r7.xyw);
      r2.w = rsqrt(r2.w);
      r7.xyw = r7.xyw * r2.www;
      r2.w = dot(r14.xyw, r7.xyw);
      r2.w = cmp(-r2.w >= 0);
      r2.w = r2.w ? 1.000000 : 0;
      r1.w = -r7.z * r1.w + r7.z;
      r1.w = r1.w * r1.w;
      r1.w = r1.w * 0.25 + 1;
      r1.w = 1 / r1.w;
      r7.xyz = r11.xyz * r2.www + -r2.xyz;
      r2.xyz = r1.www * r7.xyz + r2.xyz;
    }
  } else {
    r3.w = -1;
  }
  r5.z = r4.z;
  r5.w = 1;
  r7.x = dot(cb0[0].xyzw, r5.xyzw);
  r7.y = dot(cb0[1].xyzw, r5.xyzw);
  r1.w = dot(cb0[3].xyzw, r5.xyzw);
  
  r7.x+=stereo.x*(r1.w-stereo.y)*0.5;
  
  r4.xw = r7.xy / r1.ww;
  r1.w = t0.Sample(s0_s, r4.xw).x;
  r1.w = cb12[2].z + r1.w;
  r1.w = -cb12[2].w / r1.w;
  r0.y = r0.y + -r4.y;
  r1.w = r1.w + -r4.z;
  r2.w = -r1.w + r0.y;
  r2.w = r0.y / r2.w;
  r4.xyz = -r6.xyz + r5.xyz;
  r4.xyz = r2.www * r4.xyz + r6.xyz;
  r4.w = 1;
  r5.x = dot(cb0[0].xyzw, r4.xyzw);
  r5.y = dot(cb0[1].xyzw, r4.xyzw);
  r2.w = dot(cb0[3].xyzw, r4.xyzw);
  
  r5.x+=stereo.x*(r2.w-stereo.y)*0.5;
  
  r5.xy = r5.xy / r2.ww;
  r6.xyz = t1.Sample(s1_s, r5.xy).xyz;
  r5.zw = t4.Sample(s4_s, r5.xy).xy;
  r2.w = t0.Sample(s0_s, r5.xy).x;
  if (r3.w == 0) {
    r0.y = r1.w * r0.y;
    r0.y = cmp(0 < r0.y);
    if (r0.y == 0) {
      r5.xy = float2(4,4) * r5.zw;
      r0.y = dot(r5.xy, r5.xy);
      r7.zw = -r0.yy * float2(0.25,0.5) + float2(1,1);
      r0.y = max(0, r7.z);
      r0.y = sqrt(r0.y);
      r7.xy = r5.xy * r0.yy;
      r0.y = cb12[2].z + r2.w;
      r0.y = -cb12[2].w / r0.y;
      r0.y = r0.y / r4.z;
      r4.xyw = r4.xyz * r0.yyy + -v0.xyz;
      r1.w = dot(r4.xyw, r4.xyw);
      r1.w = rsqrt(r1.w);
      r4.xyw = r4.xyw * r1.www;
      r1.w = dot(r7.xyw, r4.xyw);
      r1.w = cmp(-r1.w >= 0);
      r1.w = r1.w ? 1.000000 : 0;
      r0.y = -r4.z * r0.y + r4.z;
      r0.y = r0.y * r0.y;
      r0.y = r0.y * 0.25 + 1;
      r0.y = 1 / r0.y;
      r4.xyz = r6.xyz * r1.www + -r2.xyz;
      r2.xyz = r0.yyy * r4.xyz + r2.xyz;
    }
  }
  r2.xyz = r2.xyz + -r1.xyz;
  r1.xyz = cb9[2].zzz * r2.xyz + r1.xyz;
  r1.xyz = r1.xyz * r0.zzz;
  r0.x = 1 + -abs(r0.x);
  r0.x = log2(r0.x);
  r0.x = cb9[13].w * r0.x;
  r0.x = exp2(r0.x);
  r0.y = cb9[12].w + -cb9[11].w;
  r0.x = r0.x * r0.y + cb9[11].w;
  r0.xyz = r1.xyz * r0.xxx;
  r1.xyz = r8.xyz * r10.xyz + r3.xyz;
  r1.xyz = r1.xyz + r13.xyz;
  r2.xy = cb9[2].xy + float2(-1,-1);
  r2.xy = r0.ww * r2.xy + float2(1,1);
  r0.xyz = r2.yyy * r0.xyz;
  r0.xyz = r1.xyz * r2.xxx + r0.xyz;
  r0.xyz = r12.xyz * r0.www + r0.xyz;
  o0.xyz = max(float3(0,0,0), r0.xyz);
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Thu May 16 20:35:42 2019
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xyz         0     NONE   float   xyz
// TEXCOORD                 1   xyz         1     NONE   float   xyz
// TEXCOORD                 2   xy          2     NONE   float
// TEXCOORD                 3   xyz         3     NONE   float   xyz
//
//
// 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 cb12[3], immediateIndexed
dcl_constantbuffer cb9[26], immediateIndexed
dcl_constantbuffer cb0[8], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_sampler s8, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (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_input_ps linear v0.xyz
dcl_input_ps linear v1.xyz
dcl_input_ps linear v3.xyz
dcl_output o0.xyzw
dcl_temps 17
div r0.xy, v1.xyxx, v1.zzzz
dp3 r0.z, v0.xyzx, v0.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, v0.xyzx
div r0.zw, v3.xxxy, v3.zzzz
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r0.zwzz, t7.xyzw, s7
add r2.xy, r2.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
dp2 r1.w, r2.xyxx, r2.xyxx
rsq r1.w, r1.w
mul r2.xy, r1.wwww, r2.xyxx
div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.z
add r1.w, r1.w, l(-1.000000)
mul r2.xy, r1.wwww, r2.xyxx
mul r2.yzw, r2.yyyy, cb9[23].xxyz
mad r2.xyz, cb9[21].xyzx, r2.xxxx, r2.yzwy
mul r2.xyz, r2.xyzx, cb9[14].xxxx
mad r3.xyz, r2.xyzx, cb9[5].wwww, v0.xyzx
add r1.w, l(-1.000000), cb9[5].w
mad r4.xyz, r2.xyzx, r1.wwww, v0.xyzx
mov r3.w, l(1.000000)
dp4 r5.x, cb9[9].xyzw, r3.xyzw
dp4 r5.y, cb9[10].xyzw, r3.xyzw
mov r4.w, l(1.000000)
dp4 r3.x, cb9[9].xyzw, r4.xyzw
dp4 r3.y, cb9[10].xyzw, r4.xyzw
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r5.xyxx, t2.xywz, s2
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r3.xyxx, t2.xywz, s2
add r3.xyz, -r4.xyzx, r3.xyzx
mad r3.xyz, cb9[5].wwww, r3.xyzx, r4.xyzx
mad r3.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r4.x, r3.xyxx, cb9[7].xyxx
dp2 r4.y, r3.xyxx, cb9[7].zwzz
dp2 r4.z, r3.xyxx, cb9[8].xyxx
sample_indexable(texture2d)(float,float,float,float) r5.xy, r0.zwzz, t5.xyzw, s5
mad r5.xy, r5.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r2.w, r5.xyxx, r5.xyxx
add r2.w, -r2.w, l(1.000000)
sqrt r2.w, r2.w
mul r5.xzw, r5.xxxx, cb9[21].xxyz
mad r5.xzw, cb9[0].xxyz, r2.wwww, r5.xxzw
mad r5.xyz, cb9[23].xyzx, r5.yyyy, r5.xzwx
dp3 r2.w, r5.xyzx, r5.xyzx
rsq r2.w, r2.w
mul r5.xyz, r2.wwww, r5.xyzx
dp3 r2.w, r2.xyzx, r2.xyzx
sqrt r2.w, r2.w
mad r2.w, r2.w, cb9[14].z, l(1.000000)
div r3.w, cb9[14].y, r2.w
dp3 r4.w, r4.xyzx, r5.xyzx
add r3.w, r3.w, -r4.w
mad r6.xyz, r5.xyzx, r3.wwww, r4.xyzx
dp3 r3.w, r6.xyzx, r6.xyzx
rsq r3.w, r3.w
mul r7.xyz, r3.wwww, r6.xyzx
mul r5.w, v0.z, v0.z
div r6.w, cb9[22].y, r5.w
dp3 r7.x, r7.xyzx, r1.xyzx
add r7.x, -r7.x, l(1.000000)
mul_sat r6.w, r6.w, |r7.x|
mad r6.xyz, r6.xyzx, r3.wwww, -r5.xyzx
mad r6.xyz, r6.wwww, r6.xyzx, r5.xyzx
dp3 r3.w, r6.xyzx, r6.xyzx
rsq r3.w, r3.w
mul r7.xyz, r3.wwww, r6.xyzx
div r2.w, cb9[1].w, r2.w
add r2.w, -r4.w, r2.w
mad r4.xyz, r5.xyzx, r2.wwww, r4.xyzx
dp3 r2.w, r4.xyzx, r4.xyzx
rsq r2.w, r2.w
mul r5.xyz, r2.wwww, r4.xyzx
sample_indexable(texture2d)(float,float,float,float) r4.w, r0.xyxx, t0.yzwx, s0
add r4.w, r4.w, cb12[2].z
div r4.w, -cb12[2].w, r4.w
add r4.w, -r4.w, v0.z
max r4.w, r4.w, l(0.000000)
add r6.w, r4.w, l(1.000000)
div r6.w, l(1.000000, 1.000000, 1.000000, 1.000000), r6.w
add r6.w, -r6.w, l(1.000000)
mul r6.w, r6.w, cb9[21].w
div r6.w, r6.w, -v0.z
mad r3.xy, r6.wwww, r3.xyxx, r0.xyxx
add r8.xyzw, r3.xxyy, l(-0.020000, -0.980000, -0.020000, -0.980000)
div r8.xyzw, l(-0.000100, -0.000100, -0.000100, -0.000100), r8.xyzw
add r8.yw, r8.yyyw, l(0.000000, 1.000000, 0.000000, 1.000000)
ge r9.xyzw, r3.xxyy, l(0.010000, 0.990000, 0.010000, 0.990000)
and r9.xyzw, r9.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
add r3.xy, r3.xyxx, -r8.xzxx
mad r3.xy, r9.xzxx, r3.xyxx, r8.xzxx
add r8.xy, -r3.xyxx, r8.ywyy
mad r3.xy, r9.ywyy, r8.xyxx, r3.xyxx
sample_indexable(texture2d)(float,float,float,float) r6.w, r3.xyxx, t0.yzwx, s0
add r6.w, r6.w, cb12[2].z
div r6.w, -cb12[2].w, r6.w
add r7.w, -r6.w, v0.z
ge r6.w, v0.z, r6.w
and r6.w, r6.w, l(0x3f800000)
add r7.w, -r4.w, r7.w
mad r4.w, r6.w, r7.w, r4.w
add r3.xy, -r0.xyxx, r3.xyxx
mad r0.xy, r6.wwww, r3.xyxx, r0.xyxx
dp3 r3.x, cb9[0].xyzx, cb9[5].xyzx
max r3.x, |r3.x|, l(0.001000)
div r3.y, r4.w, r3.x
div r6.w, -r4.w, r1.z
mad r8.xyz, r1.xyzx, r6.wwww, v0.xyzx
mad r6.w, r3.y, cb9[8].z, l(1.000000)
mul r9.xyz, r2.xyzx, r6.wwww
mad r10.xyz, r9.xyzx, cb9[5].wwww, r8.xyzx
mad r9.xyz, r9.xyzx, r1.wwww, r8.xyzx
mov r10.w, l(1.000000)
dp4 r11.x, cb9[9].xyzw, r10.xyzw
dp4 r11.y, cb9[10].xyzw, r10.xyzw
mov r9.w, l(1.000000)
dp4 r10.x, cb9[9].xyzw, r9.xyzw
dp4 r10.y, cb9[10].xyzw, r9.xyzw
sample_indexable(texture2d)(float,float,float,float) r9.xy, r11.xyxx, t2.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r9.zw, r10.xyxx, t2.zwxy, s2
mul r10.xy, r3.yyyy, cb9[11].yzyy
add r9.zw, -r9.xxxy, r9.zzzw
mad r9.xy, cb9[5].wwww, r9.zwzz, r9.xyxx
add r6.w, r10.x, r10.x
mad r9.xy, r9.xyxx, r6.wwww, -r10.xxxx
mad r6.w, r3.y, cb9[6].w, l(1.000000)
mul r10.xzw, r2.xxyz, r6.wwww
mad r11.xyz, r10.xzwx, cb9[5].wwww, r8.xyzx
mad r12.xyz, r10.xzwx, r1.wwww, r8.xyzx
mov r11.w, l(1.000000)
dp4 r8.x, cb9[9].xyzw, r11.xyzw
dp4 r8.y, cb9[10].xyzw, r11.xyzw
mov r12.w, l(1.000000)
dp4 r11.x, cb9[9].xyzw, r12.xyzw
dp4 r11.y, cb9[10].xyzw, r12.xyzw
add r9.zw, r9.xxxy, r8.xxxy
sample_l_indexable(texture2d)(float,float,float,float) r10.x, r9.zwzz, t3.wzxy, s3, r10.y
mad r12.xyzw, r9.xyxy, l(1.100000, 1.100000, 1.200000, 1.200000), r8.xyxy
sample_l_indexable(texture2d)(float,float,float,float) r10.z, r12.xyxx, t3.xzwy, s3, r10.y
sample_l_indexable(texture2d)(float,float,float,float) r10.w, r12.zwzz, t3.xzyw, s3, r10.y
add r8.xy, r9.xyxx, r11.xyxx
sample_l_indexable(texture2d)(float,float,float,float) r8.x, r8.xyxx, t3.wxzy, s3, r10.y
mad r9.xyzw, r9.xyxy, l(1.100000, 1.100000, 1.200000, 1.200000), r11.xyxy
sample_l_indexable(texture2d)(float,float,float,float) r8.y, r9.xyxx, t3.xwzy, s3, r10.y
sample_l_indexable(texture2d)(float,float,float,float) r8.w, r9.zwzz, t3.xyzw, s3, r10.y
mad r1.w, r3.y, l(5.000000), l(1.000000)
div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.w
add r6.w, l(1.000000), -cb9[8].w
mad r6.w, r1.w, r6.w, cb9[8].w
add r8.xyw, -r10.xzxw, r8.xyxw
mad r8.xyw, cb9[5].wwww, r8.xyxw, r10.xzxw
log r8.xyw, r8.xyxw
mul r8.xyw, r8.xyxw, cb9[11].xxxx
exp r8.xyw, r8.xyxw
add r6.w, -r1.w, r6.w
mad r8.xyw, r8.xyxw, r6.wwww, r1.wwww
mul r1.w, r8.z, r8.z
div_sat r1.w, cb9[25].z, r1.w
mul r8.xyz, r1.wwww, r8.xywx
sample_indexable(texture2d)(float,float,float,float) r9.xyz, r0.xyxx, t1.xyzw, s1
mul r8.xyz, r8.xyzx, r9.xyzx
add r0.x, r3.y, r4.w
log r9.xyz, cb9[1].xyzx
mul r10.xyz, r0.xxxx, r9.xyzx
exp r10.xyz, r10.xyzx
mad r0.x, -r3.z, l(0.100000), r4.w
lt r0.x, r0.x, l(0.000000)
discard_nz r0.x
max r0.x, r4.w, l(0.000100)
dp3 r0.y, cb9[5].xyzx, r7.xyzx
max r0.y, |r0.y|, l(0.001000)
dp3 r1.w, r7.xyzx, r1.xyzx
max r1.w, |r1.w|, l(0.001000)
div r1.w, r0.x, r1.w
div r0.y, r1.w, r0.y
div r0.y, r0.y, r0.x
add r0.y, r0.y, l(1.000000)
mul r1.w, r0.x, r0.y
mul r11.xyz, r9.xyzx, r1.wwww
exp r11.xyz, r11.xyzx
add r11.xyz, r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
mul r11.xyz, r11.xyzx, cb9[3].xyzx
div r11.xyz, r11.xyzx, r0.yyyy
dp3 r0.y, cb9[0].xyzx, r1.xyzx
max r1.w, |r0.y|, l(0.001000)
div r1.w, r0.x, r1.w
div r1.w, r1.w, r3.x
div r1.w, r1.w, r0.x
add r1.w, r1.w, l(1.000000)
mul r0.x, r0.x, r1.w
mul r3.xyz, r9.xyzx, r0.xxxx
exp r3.xyz, r3.xyzx
add r3.xyz, r3.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
mul r3.xyz, r3.xyzx, cb9[3].xyzx
div r3.xyz, r3.xyzx, r1.wwww
dp3 r0.x, r1.xyzx, cb9[5].xyzx
add r3.xyz, r3.xyzx, r11.xyzx
mad r0.x, r0.x, r0.x, l(1.000000)
mul r3.xyz, r0.xxxx, r3.xyzx
mul r3.xyz, r3.xyzx, cb9[6].xyzx
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.zwzz, t6.xyzw, s6
mad r0.z, -r4.w, cb9[19].w, l(1.000000)
max r0.z, r0.z, l(0.000000)
div_sat r0.w, cb9[25].w, r5.w
mad r0.x, r0.z, r0.w, r0.x
ge r0.z, l(0.000000), r0.x
if_nz r0.z
  mov r11.xyz, cb9[0].xyzx
  mov r0.w, l(0)
  mov r12.xyz, l(0,0,0,0)
  mov r13.xyz, l(0,0,0,0)
endif
mul r2.xyz, r2.xyzx, cb9[4].xxxx
mov r14.xyz, v0.xyzx
mov r14.w, l(1.000000)
dp4 r15.x, cb9[9].xyzw, r14.xyzw
dp4 r15.y, cb9[10].xyzw, r14.xyzw
mul r15.xy, r15.xyxx, cb9[22].zzzz
sample_indexable(texture2d)(float,float,float,float) r15.xy, r15.xyxx, t2.xyzw, s2
add r15.xy, r15.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
mad r2.xy, r15.xyxx, cb9[22].wwww, r2.xyxx
add r15.xy, l(0.500000, -0.500000, 0.000000, 0.000000), cb9[4].yyyy
mad r16.xyz, r2.xyzx, r15.xxxx, v0.xyzx
mad r15.xyz, r2.xyzx, r15.yyyy, v0.xyzx
mov r16.w, l(1.000000)
dp4 r2.x, cb9[9].xyzw, r16.xyzw
dp4 r2.y, cb9[10].xyzw, r16.xyzw
mov r15.w, l(1.000000)
dp4 r16.x, cb9[9].xyzw, r15.xyzw
dp4 r16.y, cb9[10].xyzw, r15.xyzw
mul r2.xy, r2.xyxx, cb9[4].zzzz
mul r15.xy, r16.xyxx, cb9[4].zzzz
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r2.xyxx, t8.xywz, s8
sample_indexable(texture2d)(float,float,float,float) r15.xyz, r15.xyxx, t8.xywz, s8
if_z r0.z
  add r15.xyz, -r2.xyzx, r15.xyzx
  mad r2.xyz, cb9[4].yyyy, r15.xyzx, r2.xyzx
  mul r0.z, r0.x, r2.z
  mad r1.w, r0.x, r2.z, cb9[18].w
  mad r2.xy, r2.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
  dp2 r15.x, r2.xyxx, cb9[7].xyxx
  dp2 r15.y, r2.xyxx, cb9[7].zwzz
  dp2 r15.z, r2.xyxx, cb9[8].xyxx
  mad r2.xyz, cb9[0].xyzx, r1.wwww, r15.xyzx
  dp3 r4.w, r2.xyzx, r2.xyzx
  rsq r4.w, r4.w
  mul r11.xyz, r2.xyzx, r4.wwww
  dp3 r2.x, r11.xyzx, cb9[5].xyzx
  add r2.x, r2.x, l(1.000000)
  mul_sat r2.x, r2.x, l(0.500000)
  log r2.x, r2.x
  mul r2.x, r2.x, cb9[20].w
  exp r2.x, r2.x
  add r15.xyz, -cb9[17].xyzx, cb9[18].xyzx
  mad r12.xyz, r2.xxxx, r15.xyzx, cb9[17].xyzx
  div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), cb9[19].x
  mul_sat r1.w, r1.w, r2.x
  mad r2.x, r1.w, l(-2.000000), l(3.000000)
  mul r1.w, r1.w, r1.w
  mul r0.w, r1.w, r2.x
  add r1.w, -cb9[19].y, cb9[19].z
  mad r0.z, r0.z, r1.w, cb9[19].y
  mul r2.xyz, r9.xyzx, r0.zzzz
  exp r2.xyz, r2.xyzx
  mul r2.xyz, r0.xxxx, r2.xyzx
  mul r13.xyz, r2.xyzx, cb9[20].xyzx
endif
mad r2.xyz, -r6.xyzx, r3.wwww, r11.xyzx
mad r2.xyz, r0.wwww, r2.xyzx, r7.xyzx
dp3 r0.x, r2.xyzx, r2.xyzx
rsq r0.x, r0.x
mul r2.xyz, r0.xxxx, r2.xyzx
mad r4.xyz, -r4.xyzx, r2.wwww, r11.xyzx
mad r4.xyz, r0.wwww, r4.xyzx, r5.xyzx
dp3 r0.x, r4.xyzx, r4.xyzx
rsq r0.x, r0.x
mul r4.xyz, r0.xxxx, r4.xyzx
dp3 r0.x, r1.xyzx, r2.xyzx
add r0.z, r0.x, r0.x
mad r2.xyz, r2.xyzx, -r0.zzzz, r1.xyzx
dp3 r0.z, cb9[0].xyzx, r2.xyzx
add r5.xyz, -cb9[12].xyzx, cb9[13].xyzx
mad r5.xyz, r0.zzzz, r5.xyzx, cb9[12].xyzx
mul r1.w, r0.z, l(-2.000000)
mad r6.xyz, cb9[0].xyzx, r1.wwww, r2.xyzx
ge r1.w, r0.z, l(0.000000)
and r1.w, r1.w, l(0x3f800000)
add r2.xyz, r2.xyzx, -r6.xyzx
mad r2.xyz, r1.wwww, r2.xyzx, r6.xyzx
add r0.z, r0.z, l(0.100000)
mul_sat r0.z, r0.z, l(10.000000)
mad r1.w, r0.z, l(-2.000000), l(3.000000)
mul r0.z, r0.z, r0.z
mul r0.z, r0.z, r1.w
mad r0.z, r0.z, l(0.900000), l(0.100000)
dp3 r1.w, cb0[4].xyzx, v0.xyzx
dp3 r3.w, cb0[5].xyzx, v0.xyzx
dp3 r4.w, cb0[6].xyzx, v0.xyzx
dp3 r5.w, cb0[7].xyzx, v0.xyzx
dp3 r6.x, cb0[4].xyzx, r2.xyzx
div r1.w, -r1.w, r6.x
dp3 r6.x, cb0[5].xyzx, r2.xyzx
div r3.w, -r3.w, r6.x
dp3 r6.x, cb0[6].xyzx, r2.xyzx
div r4.w, -r4.w, r6.x
dp3 r6.x, cb0[7].xyzx, r2.xyzx
div r5.w, -r5.w, r6.x
ge r6.x, r1.w, l(0.000000)
and r6.x, r6.x, l(0x3f800000)
add r1.w, r1.w, l(-1280.000000)
mad r1.w, r6.x, r1.w, l(1280.000000)
ge r6.x, r3.w, l(0.000000)
and r6.x, r6.x, l(0x3f800000)
add r3.w, r3.w, l(-1280.000000)
mad r3.w, r6.x, r3.w, l(1280.000000)
ge r6.x, r4.w, l(0.000000)
and r6.x, r6.x, l(0x3f800000)
add r4.w, r4.w, l(-1280.000000)
mad r4.w, r6.x, r4.w, l(1280.000000)
ge r6.x, r5.w, l(0.000000)
and r6.x, r6.x, l(0x3f800000)
add r5.w, r5.w, l(-1280.000000)
mad r5.w, r6.x, r5.w, l(1280.000000)
min r1.w, r1.w, r3.w
min r3.w, r4.w, r5.w
min r1.w, r1.w, r3.w
mad r6.xyz, r2.xyzx, r1.wwww, v0.xyzx
dp3 r1.w, r1.xyzx, r4.xyzx
add r1.w, r1.w, r1.w
mad r1.xyz, r4.xyzx, -r1.wwww, r1.xyzx
dp3 r1.x, cb9[16].xyzx, r1.xyzx
add r1.x, r1.x, -cb9[15].w
mul_sat r1.x, r1.x, cb9[16].w
mul r1.y, r1.x, r1.x
mad r1.x, -r1.x, l(2.000000), l(3.000000)
mul r1.x, r1.x, r1.y
log r1.x, r1.x
mul r1.x, r1.x, cb9[17].w
exp r1.x, r1.x
div r1.y, cb9[22].x, v0.z
sqrt r1.y, r1.y
mul r1.x, r1.y, r1.x
mov_sat r0.y, -r0.y
mul r0.y, r0.y, r1.x
mad r1.xyz, cb9[15].xyzx, r0.yyyy, r5.xyzx
lt r0.y, r2.z, l(0.000000)
mov r2.w, l(1.000000)
dp4 r4.x, cb0[0].xyzw, r2.xyzw
dp4 r4.y, cb0[1].xyzw, r2.xyzw
dp4 r1.w, cb0[3].xyzw, r2.xyzw
div r4.xy, r4.xyxx, r1.wwww
sample_indexable(texture2d)(float,float,float,float) r1.w, r4.xyxx, t0.yzwx, s0
sample_indexable(texture2d)(float,float,float,float) r5.xyz, r4.xyxx, t1.xyzw, s1
if_nz r0.y
  add r0.y, r1.w, cb12[2].z
  div r0.y, -cb12[2].w, r0.y
  div r0.y, r0.y, r2.z
  mad r2.xyz, r2.xyzx, r0.yyyy, -v0.xyzx
  dp3 r0.y, r2.xyzx, r2.xyzx
  rsq r0.y, r0.y
  mul r0.y, r0.y, r2.z
  add r2.xy, r4.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
  add r2.xy, |r2.xyxx|, l(-0.500000, -0.500000, 0.000000, 0.000000)
  mul_sat r2.xy, r2.xyxx, l(-10.000001, -10.000001, 0.000000, 0.000000)
  mad r2.zw, r2.xxxy, l(0.000000, 0.000000, -2.000000, -2.000000), l(0.000000, 0.000000, 3.000000, 3.000000)
  mul r2.xy, r2.xyxx, r2.xyxx
  mul r2.xy, r2.xyxx, r2.zwzz
  mul r1.w, r2.y, r2.x
  max r0.y, -r0.y, l(0.000000)
  mul r0.y, r0.y, r1.w
  add r2.xyz, -r1.xyzx, r5.xyzx
  mad r2.xyz, r0.yyyy, r2.xyzx, r1.xyzx
else
  mov r2.xyz, r1.xyzx
endif
mul r0.y, r6.z, v0.z
mul r4.xyz, v0.zzzz, l(0.300000, 0.600000, 0.900000, 0.000000)
mad r4.xyz, r6.zzzz, l(-0.700000, -0.399999976, -0.100000024, 0.000000), -r4.xyzx
div r4.xyz, -r0.yyyy, r4.xyzx
div r5.xy, v0.xyxx, v0.zzzz
div r5.zw, r6.xxxy, r6.zzzz
add r5.zw, -r5.xxxy, r5.zzzw
mad r6.xyzw, r5.zwzw, l(0.300000, 0.300000, 0.600000, 0.600000), r5.xyxy
mul r6.xyzw, r4.yyxx, r6.zwxy
mad r5.xy, r5.zwzz, l(0.900000, 0.900000, 0.000000, 0.000000), r5.xyxx
mul r5.xy, r4.zzzz, r5.xyxx
dp4 r7.x, cb0[0].xyzw, r14.xyzw
dp4 r7.y, cb0[1].xyzw, r14.xyzw
dp4 r0.y, cb0[3].xyzw, r14.xyzw
div r7.xy, r7.xyxx, r0.yyyy
sample_indexable(texture2d)(float,float,float,float) r0.y, r7.xyxx, t0.yxzw, s0
add r0.y, r0.y, cb12[2].z
div r0.y, -cb12[2].w, r0.y
mov r7.xy, r6.zwzz
mov r7.z, r4.x
mov r7.w, l(1.000000)
dp4 r9.x, cb0[0].xyzw, r7.xyzw
dp4 r9.y, cb0[1].xyzw, r7.xyzw
dp4 r1.w, cb0[3].xyzw, r7.xyzw
div r9.xy, r9.xyxx, r1.wwww
sample_indexable(texture2d)(float,float,float,float) r1.w, r9.xyxx, t0.yzwx, s0
add r1.w, r1.w, cb12[2].z
div r1.w, -cb12[2].w, r1.w
add r2.w, r0.y, -v0.z
add r3.w, -r4.x, r1.w
mul r4.w, r2.w, r3.w
lt r4.w, l(0.000000), r4.w
add r3.w, r2.w, -r3.w
div r2.w, r2.w, r3.w
add r9.xyz, r7.xyzx, -v0.xyzx
mad r9.xyz, r2.wwww, r9.xyzx, v0.xyzx
mov r9.w, l(1.000000)
dp4 r11.x, cb0[0].xyzw, r9.xyzw
dp4 r11.y, cb0[1].xyzw, r9.xyzw
dp4 r2.w, cb0[3].xyzw, r9.xyzw
div r11.xy, r11.xyxx, r2.wwww
sample_indexable(texture2d)(float,float,float,float) r14.xyz, r11.xyxx, t1.xyzw, s1
sample_indexable(texture2d)(float,float,float,float) r11.zw, r11.xyxx, t4.zwxy, s4
sample_indexable(texture2d)(float,float,float,float) r2.w, r11.xyxx, t0.yzwx, s0
if_nz r4.w
  mov r0.y, r1.w
else
  mul r11.xy, r11.zwzz, l(4.000000, 4.000000, 0.000000, 0.000000)
  dp2 r1.w, r11.xyxx, r11.xyxx
  mad r15.zw, -r1.wwww, l(0.000000, 0.000000, 0.250000, 0.500000), l(0.000000, 0.000000, 1.000000, 1.000000)
  max r1.w, r15.z, l(0.000000)
  sqrt r1.w, r1.w
  mul r15.xy, r1.wwww, r11.xyxx
  add r1.w, r2.w, cb12[2].z
  div r1.w, -cb12[2].w, r1.w
  div r1.w, r1.w, r9.z
  mad r9.xyw, r9.xyxz, r1.wwww, -v0.xyxz
  dp3 r2.w, r9.xywx, r9.xywx
  rsq r2.w, r2.w
  mul r9.xyw, r2.wwww, r9.xyxw
  dp3 r2.w, r15.xywx, r9.xywx
  ge r2.w, -r2.w, l(0.000000)
  and r2.w, r2.w, l(0x3f800000)
  mad r1.w, -r9.z, r1.w, r9.z
  mul r1.w, r1.w, r1.w
  mad r1.w, r1.w, l(0.250000), l(1.000000)
  div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.w
  mad r9.xyz, r14.xyzx, r2.wwww, -r2.xyzx
  mad r2.xyz, r1.wwww, r9.xyzx, r2.xyzx
endif
mov r6.z, r4.y
mov r6.w, l(1.000000)
dp4 r9.x, cb0[0].xyzw, r6.xyzw
dp4 r9.y, cb0[1].xyzw, r6.xyzw
dp4 r1.w, cb0[3].xyzw, r6.xyzw
div r9.xy, r9.xyxx, r1.wwww
sample_indexable(texture2d)(float,float,float,float) r1.w, r9.xyxx, t0.yzwx, s0
add r1.w, r1.w, cb12[2].z
div r1.w, -cb12[2].w, r1.w
add r2.w, -r4.x, r0.y
add r3.w, -r4.y, r1.w
add r4.x, r2.w, -r3.w
div r4.x, r2.w, r4.x
add r9.xyz, -r7.xyzx, r6.xyzx
mad r7.xyz, r4.xxxx, r9.xyzx, r7.xyzx
mov r7.w, l(1.000000)
dp4 r9.x, cb0[0].xyzw, r7.xyzw
dp4 r9.y, cb0[1].xyzw, r7.xyzw
dp4 r4.x, cb0[3].xyzw, r7.xyzw
div r9.xy, r9.xyxx, r4.xxxx
sample_indexable(texture2d)(float,float,float,float) r11.xyz, r9.xyxx, t1.xyzw, s1
sample_indexable(texture2d)(float,float,float,float) r9.zw, r9.xyxx, t4.zwxy, s4
sample_indexable(texture2d)(float,float,float,float) r4.x, r9.xyxx, t0.xyzw, s0
if_nz r4.w
  mul r2.w, r2.w, r3.w
  lt r2.w, l(0.000000), r2.w
  not r3.w, r2.w
  if_nz r2.w
    mov r0.y, r1.w
  else
    mul r9.xy, r9.zwzz, l(4.000000, 4.000000, 0.000000, 0.000000)
    dp2 r1.w, r9.xyxx, r9.xyxx
    mad r14.zw, -r1.wwww, l(0.000000, 0.000000, 0.250000, 0.500000), l(0.000000, 0.000000, 1.000000, 1.000000)
    max r1.w, r14.z, l(0.000000)
    sqrt r1.w, r1.w
    mul r14.xy, r1.wwww, r9.xyxx
    add r1.w, r4.x, cb12[2].z
    div r1.w, -cb12[2].w, r1.w
    div r1.w, r1.w, r7.z
    mad r7.xyw, r7.xyxz, r1.wwww, -v0.xyxz
    dp3 r2.w, r7.xywx, r7.xywx
    rsq r2.w, r2.w
    mul r7.xyw, r2.wwww, r7.xyxw
    dp3 r2.w, r14.xywx, r7.xywx
    ge r2.w, -r2.w, l(0.000000)
    and r2.w, r2.w, l(0x3f800000)
    mad r1.w, -r7.z, r1.w, r7.z
    mul r1.w, r1.w, r1.w
    mad r1.w, r1.w, l(0.250000), l(1.000000)
    div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.w
    mad r7.xyz, r11.xyzx, r2.wwww, -r2.xyzx
    mad r2.xyz, r1.wwww, r7.xyzx, r2.xyzx
  endif
else
  mov r3.w, l(-1)
endif
mov r5.z, r4.z
mov r5.w, l(1.000000)
dp4 r7.x, cb0[0].xyzw, r5.xyzw
dp4 r7.y, cb0[1].xyzw, r5.xyzw
dp4 r1.w, cb0[3].xyzw, r5.xyzw
div r4.xw, r7.xxxy, r1.wwww
sample_indexable(texture2d)(float,float,float,float) r1.w, r4.xwxx, t0.yzwx, s0
add r1.w, r1.w, cb12[2].z
div r1.w, -cb12[2].w, r1.w
add r0.y, -r4.y, r0.y
add r1.w, -r4.z, r1.w
add r2.w, r0.y, -r1.w
div r2.w, r0.y, r2.w
add r4.xyz, r5.xyzx, -r6.xyzx
mad r4.xyz, r2.wwww, r4.xyzx, r6.xyzx
mov r4.w, l(1.000000)
dp4 r5.x, cb0[0].xyzw, r4.xyzw
dp4 r5.y, cb0[1].xyzw, r4.xyzw
dp4 r2.w, cb0[3].xyzw, r4.xyzw
div r5.xy, r5.xyxx, r2.wwww
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r5.xyxx, t1.xyzw, s1
sample_indexable(texture2d)(float,float,float,float) r5.zw, r5.xyxx, t4.zwxy, s4
sample_indexable(texture2d)(float,float,float,float) r2.w, r5.xyxx, t0.yzwx, s0
if_z r3.w
  mul r0.y, r0.y, r1.w
  lt r0.y, l(0.000000), r0.y
  if_z r0.y
    mul r5.xy, r5.zwzz, l(4.000000, 4.000000, 0.000000, 0.000000)
    dp2 r0.y, r5.xyxx, r5.xyxx
    mad r7.zw, -r0.yyyy, l(0.000000, 0.000000, 0.250000, 0.500000), l(0.000000, 0.000000, 1.000000, 1.000000)
    max r0.y, r7.z, l(0.000000)
    sqrt r0.y, r0.y
    mul r7.xy, r0.yyyy, r5.xyxx
    add r0.y, r2.w, cb12[2].z
    div r0.y, -cb12[2].w, r0.y
    div r0.y, r0.y, r4.z
    mad r4.xyw, r4.xyxz, r0.yyyy, -v0.xyxz
    dp3 r1.w, r4.xywx, r4.xywx
    rsq r1.w, r1.w
    mul r4.xyw, r1.wwww, r4.xyxw
    dp3 r1.w, r7.xywx, r4.xywx
    ge r1.w, -r1.w, l(0.000000)
    and r1.w, r1.w, l(0x3f800000)
    mad r0.y, -r4.z, r0.y, r4.z
    mul r0.y, r0.y, r0.y
    mad r0.y, r0.y, l(0.250000), l(1.000000)
    div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
    mad r4.xyz, r6.xyzx, r1.wwww, -r2.xyzx
    mad r2.xyz, r0.yyyy, r4.xyzx, r2.xyzx
  endif
endif
add r2.xyz, -r1.xyzx, r2.xyzx
mad r1.xyz, cb9[2].zzzz, r2.xyzx, r1.xyzx
mul r1.xyz, r0.zzzz, r1.xyzx
add r0.x, -|r0.x|, l(1.000000)
log r0.x, r0.x
mul r0.x, r0.x, cb9[13].w
exp r0.x, r0.x
add r0.y, -cb9[11].w, cb9[12].w
mad r0.x, r0.x, r0.y, cb9[11].w
mul r0.xyz, r0.xxxx, r1.xyzx
mad r1.xyz, r8.xyzx, r10.xyzx, r3.xyzx
add r1.xyz, r13.xyzx, r1.xyzx
add r2.xy, l(-1.000000, -1.000000, 0.000000, 0.000000), cb9[2].xyxx
mad r2.xy, r0.wwww, r2.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r0.xyz, r0.xyzx, r2.yyyy
mad r0.xyz, r1.xyzx, r2.xxxx, r0.xyzx
mad r0.xyz, r12.xyzx, r0.wwww, r0.xyzx
max o0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mov o0.w, l(1.000000)
ret
// Approximately 0 instruction slots used

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