//P5S water PS 3.
// ---- Created with 3Dmigoto v1.3.16 on Thu Mar 17 20:51:24 2022
//
//cbuffer _Globals : register(b0)
//{
//  float4 vEye : packoffset(c0);
//  float4 mWV[3] : packoffset(c1);
//  float fAmbMapsDORate : packoffset(c4) = {0};
//  float4 vAmbDifScl : packoffset(c5) = {1,1,1,1};
//  float3 vNormalNoiseParam : packoffset(c6);
//  float4 mRrW2T[3] : packoffset(c7);
//  float fRrRefractiveIndex : packoffset(c10);
//  float fRrTransparency : packoffset(c10.y);
//  float fDiffuseTransparency : packoffset(c10.z);
//  float4 vRrParam : packoffset(c11);
//  float2 vD2Z : packoffset(c12);
//  float4 vRrCameraPos : packoffset(c13);
//  float4 vRrCameraDir : packoffset(c14);
//  float4 vWaveBubbleColorScale : packoffset(c15);
//  float4 vWaveSurfaceBubbleColor[3] : packoffset(c16);
//  float4 vWaveSurfaceBubbleParam : packoffset(c19);
//  float4 vWaveInnerBubbleColor[3] : packoffset(c20);
//  float4 vWaveInnerBubbleParam : packoffset(c23);
//  float4 vShoreBubbleColor[3] : packoffset(c24);
//  float4 vShoreBubbleParam : packoffset(c27);
//  float4 vBubbleShoalingAjustParam : packoffset(c28);
//  float4 vOceanScatteringColor : packoffset(c29);
//  float4 vWaveBubbleSpawnPointArray[16] : packoffset(c30);
//  float4 vBubbleDepth : packoffset(c46);
//  float4 vBubbleTextureArrayNo : packoffset(c47);
//  float4 vWaveSurfaceBubbleScale : packoffset(c48);
//  float4 vWaveInnerBubbleScale : packoffset(c49);
//  float4 vShoreBubbleScale : packoffset(c50);
//  float2 vWaveBubbleOffset : packoffset(c51);
//  float4 vAlbedoColor : packoffset(c52);
//  float4 vReflectance : packoffset(c53);
//}
//
//SamplerState __smpsOceanNormalMap_s : register(s0);
//SamplerState __smpsOceanDepthMap_s : register(s2);
//SamplerState __smpsOceanNormalNoiseMap_s : register(s3);
//SamplerState __smpsOceanBubbleMap_s : register(s4);
//Texture3D<float4> sOceanNormalMap : register(t0);
//Texture2D<float4> sOceanDepthMap : register(t2);
//Texture2D<float4> sOceanNormalNoiseMap : register(t3);
//Texture2DArray<float4> sOceanBubbleMap : register(t4);
//
//
//// 3Dmigoto declarations
//#define cmp -
//Texture1D<float4> IniParams : register(t120);
//Texture2D<float4> StereoParams : register(t125);
//
//
//void main(
//  float4 v0 : SV_ClipDistance1,
//  float4 v1 : SV_ClipDistance0,
//  float4 v2 : SV_Position0,
//  float4 v3 : TEXCOORD0,
//  float4 v4 : TEXCOORD1,
//  float4 v5 : TEXCOORD2,
//  float4 v6 : TEXCOORD3,
//  float4 v7 : TEXCOORD4,
//  float v8 : TEXCOORD5,
//  out float4 o0 : SV_Target0,
//  out float4 o1 : SV_Target1,
//  out float4 o2 : SV_Target2,
//  out float4 o3 : SV_Target3,
//  out float4 o4 : SV_Target4,
//  out float4 o5 : SV_Target5)
//{
//  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9;
//  uint4 bitmask, uiDest;
//  float4 fDest;
//
//  r0.x = sOceanNormalNoiseMap.Sample(__smpsOceanNormalNoiseMap_s, v3.zw).x;
//  r0.z = vNormalNoiseParam.z + r0.x;
//  r0.xy = v7.xy;
//  r0.xy = sOceanNormalMap.Sample(__smpsOceanNormalMap_s, r0.xyz).xy;
//  r0.xy = r0.xy * float2(2,2) + v6.xz;
//  r0.xz = float2(-1,-1) + r0.xy;
//  r0.y = v6.y;
//  r0.w = dot(r0.xyz, r0.xyz);
//  r0.w = rsqrt(r0.w);
//  r1.xyz = r0.xyz * r0.www;
//  r2.xyz = float3(0,1,0) * r1.zxy;
//  r2.xyz = r1.yzx * float3(1,0,0) + -r2.xyz;
//  r1.w = dot(r2.xy, r2.xy);
//  r1.w = rsqrt(r1.w);
//  r2.xyz = r2.xyz * r1.www;
//  r3.xyz = vEye.xyz + -v5.xyz;
//  r1.w = dot(r3.xyz, r3.xyz);
//  r1.w = rsqrt(r1.w);
//  r3.xyz = r3.xyz * r1.www;
//  r0.xyz = -r0.xyz * r0.www + float3(0,1,0);
//  r0.xyz = r0.xyz * vRrParam.yyy + -r3.xyz;
//  r0.w = dot(r0.xyz, r0.xyz);
//  r0.w = rsqrt(r0.w);
//  r0.xyz = r0.xyz * r0.www;
//  r3.xzw = -vRrCameraPos.xyz + v5.xyz;
//  r4.x = dot(v5.xyzw, mRrW2T[0].xyzw);
//  r4.y = dot(v5.xyzw, mRrW2T[1].xyzw);
//  r0.w = dot(v5.xyzw, mRrW2T[2].xyzw);
//  r4.xy = r4.xy / r0.ww;
//  r0.w = sOceanDepthMap.Sample(__smpsOceanDepthMap_s, r4.xy).x;
//  r0.w = saturate(vD2Z.y * r0.w + vD2Z.x);
//  r0.w = 1 / r0.w;
//  r1.w = dot(r3.xzw, vRrCameraDir.xyz);
//  r2.w = -r1.w + r0.w;
//  r2.w = min(vRrParam.z, r2.w);
//  r4.xyz = r0.xyz * r2.www + v5.xyz;
//  r4.w = 1;
//  r0.x = dot(r4.xyzw, mRrW2T[0].xyzw);
//  r0.y = dot(r4.xyzw, mRrW2T[1].xyzw);
//  r0.z = dot(r4.xyzw, mRrW2T[2].xyzw);
//  r0.xy = r0.xy / r0.zz;
//  r0.x = sOceanDepthMap.Sample(__smpsOceanDepthMap_s, r0.xy).x;
//  r0.x = saturate(vD2Z.y * r0.x + vD2Z.x);
//  r0.x = 1 / r0.x;
//  r0.y = cmp(r0.x < r1.w);
//  r0.x = r0.y ? r0.w : r0.x;
//  r0.x = r0.x + -r1.w;
//  r0.y = vRrParam.w * r0.x;
//  r0.y = r0.y * abs(r3.y);
//  r0.y = exp2(r0.y);
//  r0.y = min(1, r0.y);
//  r0.y = 1 + -r0.y;
//  r0.zw = vWaveSurfaceBubbleScale.zw * v3.xy;
//  r0.zw = v4.xy * vWaveSurfaceBubbleScale.xy + r0.zw;
//  r3.xy = vWaveBubbleOffset.xy + r0.zw;
//  r0.zw = vWaveInnerBubbleScale.zw * v3.xy;
//  r0.zw = v4.xy * vWaveInnerBubbleScale.xy + r0.zw;
//  r4.xy = vWaveBubbleOffset.xy + r0.zw;
//  r0.zw = vShoreBubbleScale.zw * v3.xy;
//  r0.zw = v4.xy * vShoreBubbleScale.xy + r0.zw;
//  r5.xy = vWaveBubbleOffset.xy + r0.zw;
//  r0.z = saturate(v8.x);
//  r3.z = vBubbleTextureArrayNo.x;
//  r3.xyzw = sOceanBubbleMap.Sample(__smpsOceanBubbleMap_s, r3.xyz).xyzw;
//  r3.xyzw = vWaveBubbleColorScale.xyzw * r3.xyzw;
//  r0.w = 1;
//  r1.w = vWaveSurfaceBubbleColor[0].w * r3.w;
//  r1.w = r1.w * r0.z;
//  r4.z = vBubbleTextureArrayNo.y;
//  r4.xyzw = sOceanBubbleMap.Sample(__smpsOceanBubbleMap_s, r4.xyz).xyzw;
//  r4.xyzw = vWaveBubbleColorScale.xyzw * r4.xyzw;
//  r2.w = 1;
//  r3.w = vWaveInnerBubbleColor[0].w * r4.w;
//  r3.w = r3.w * r0.z;
//  r5.z = vBubbleTextureArrayNo.z;
//  r5.xyzw = sOceanBubbleMap.Sample(__smpsOceanBubbleMap_s, r5.xyz).xyzw;
//  r4.w = 1;
//  r5.w = vShoreBubbleColor[0].w * r5.w;
//  r5.w = r5.w * r0.z;
//  r6.x = cmp(0 < vShoreBubbleParam.y);
//  r6.y = saturate(r1.y);
//  r6.y = log2(r6.y);
//  r6.y = vShoreBubbleParam.y * r6.y;
//  r6.y = exp2(r6.y);
//  r6.x = r6.x ? r6.y : 1;
//  r6.x = vBubbleDepth.x * r6.x;
//  r5.w = r6.x * r5.w;
//  r6.x = v7.z * r5.w;
//  r6.x = cmp(r6.x < vShoreBubbleParam.w);
//  r6.y = cmp(vShoreBubbleParam.w < 1);
//  r6.z = r5.w * v7.z + -vShoreBubbleParam.w;
//  r6.w = 1 + -vShoreBubbleParam.w;
//  r6.z = r6.z / r6.w;
//  r5.w = r6.y ? r6.z : r5.w;
//  r5.w = r6.x ? 0 : r5.w;
//  r6.xyz = cmp(r0.yyy < vBubbleShoalingAjustParam.wyz);
//  r7.xyz = r0.yyy / vBubbleShoalingAjustParam.wyz;
//  r7.xyz = abs(r7.xyz) * abs(r7.xyz);
//  r0.y = r7.x * r5.w;
//  r0.y = r6.x ? r0.y : r5.w;
//  r6.xw = float2(0,0);
//  while (true) {
//    r5.w = cmp((uint)r6.w >= 16);
//    if (r5.w != 0) break;
//    r7.xw = -vWaveBubbleSpawnPointArray[r6.w].xy + v5.xz;
//    r5.w = dot(r7.xw, r7.xw);
//    r7.x = vWaveBubbleSpawnPointArray[r6.w].z * vWaveBubbleSpawnPointArray[r6.w].z;
//    r7.w = cmp(r5.w < r7.x);
//    if (r7.w != 0) {
//      r5.w = r5.w / r7.x;
//      r5.w = 1 + -r5.w;
//      r6.x = vWaveBubbleSpawnPointArray[r6.w].w * r5.w + r6.x;
//    }
//    r6.w = (int)r6.w + 1;
//  }
//  r5.w = min(3, r6.x);
//  r6.x = 0.159154952 * v6.w;
//  r6.w = cmp(r6.x >= -r6.x);
//  r6.x = frac(abs(r6.x));
//  r6.x = r6.w ? r6.x : -r6.x;
//  r6.w = 6.28318501 * r6.x;
//  r7.x = cmp(0.499999911 < r6.x);
//  r7.w = cmp(r6.x < -0.499999911);
//  r8.xy = r6.xx * float2(6.28318501,6.28318501) + float2(-6.28318501,6.28318501);
//  r6.x = r7.w ? r8.y : r6.w;
//  r6.x = r7.x ? r8.x : r6.x;
//  r6.w = 1.57079601 + vWaveSurfaceBubbleParam.x;
//  r6.w = r6.x + -r6.w;
//  r7.x = cmp(0 < r6.w);
//  r7.w = vWaveSurfaceBubbleParam.y + r6.w;
//  r7.w = cmp(r7.w < 0);
//  r8.x = -0.333333343 * vWaveSurfaceBubbleParam.y;
//  r8.x = cmp(r8.x < r6.w);
//  r8.y = -3 * r6.w;
//  r8.y = r8.y / vWaveSurfaceBubbleParam.y;
//  r8.z = 1.5 / vWaveSurfaceBubbleParam.y;
//  r6.w = r6.w * r8.z + 1.5;
//  r6.w = r8.x ? r8.y : r6.w;
//  r6.w = log2(r6.w);
//  r6.w = vWaveSurfaceBubbleParam.z * r6.w;
//  r6.w = exp2(r6.w);
//  r6.w = min(1, r6.w);
//  r8.x = saturate(v4.w);
//  r6.w = r8.x * r6.w;
//  r7.x = (int)r7.x | (int)r7.w;
//  r7.w = 1.57079601 + vWaveInnerBubbleParam.x;
//  r6.x = -r7.w + r6.x;
//  r7.w = cmp(0 < r6.x);
//  r8.y = vWaveInnerBubbleParam.y + r6.x;
//  r8.y = cmp(r8.y < 0);
//  r8.z = -0.125 * vWaveInnerBubbleParam.y;
//  r8.z = cmp(r8.z < r6.x);
//  r8.w = -8 * r6.x;
//  r8.w = r8.w / vWaveInnerBubbleParam.y;
//  r9.x = 1.14285719 / vWaveInnerBubbleParam.y;
//  r6.x = r6.x * r9.x + 1.14285719;
//  r6.x = r8.z ? r8.w : r6.x;
//  r6.x = log2(r6.x);
//  r6.x = vWaveInnerBubbleParam.z * r6.x;
//  r6.x = exp2(r6.x);
//  r6.xw = min(float2(1,0.899999976), r6.xw);
//  r6.x = r6.x * r8.x;
//  r7.w = (int)r7.w | (int)r8.y;
//  r6.w = 1 + -r6.w;
//  r6.w = r7.x ? 1 : r6.w;
//  r6.w = cmp(r1.w < r6.w);
//  r7.x = saturate(vBubbleDepth.x * r5.w);
//  r1.w = r7.x * r1.w;
//  r1.w = r6.w ? 0 : r1.w;
//  r6.x = vBubbleDepth.x * r6.x;
//  r6.x = r7.w ? 0 : r6.x;
//  r5.w = saturate(r6.x * r5.w);
//  r6.x = r5.w * r3.w;
//  r6.w = cmp(r6.x < vWaveInnerBubbleParam.w);
//  r7.x = cmp(vWaveInnerBubbleParam.w < 1);
//  r3.w = r3.w * r5.w + -vWaveInnerBubbleParam.w;
//  r5.w = 1 + -vWaveInnerBubbleParam.w;
//  r3.w = r3.w / r5.w;
//  r3.w = r7.x ? r3.w : r6.x;
//  r3.w = r6.w ? 0 : r3.w;
//  r5.w = r1.w * r7.y;
//  r1.w = r6.y ? r5.w : r1.w;
//  r5.w = r3.w * r7.z;
//  r3.w = r6.z ? r5.w : r3.w;
//  r6.xyz = r2.www * vWaveInnerBubbleColor[0].xyz + -vAlbedoColor.xyz;
//  r6.xyz = r3.www * r6.xyz + vAlbedoColor.xyz;
//  r7.xyz = r0.www * vWaveSurfaceBubbleColor[0].xyz + -r6.xyz;
//  r6.xyz = r1.www * r7.xyz + r6.xyz;
//  r0.w = cmp(0 < v7.w);
//  r2.w = cmp(0 < vOceanScatteringColor.w);
//  r0.w = r0.w ? r2.w : 0;
//  r7.xyz = float3(1,1,1) + -vOceanScatteringColor.xyz;
//  r7.xyz = r7.xyz * r6.xyz;
//  r2.w = vOceanScatteringColor.w * vOceanScatteringColor.w;
//  r2.w = v7.w * r2.w;
//  r2.w = fRrTransparency / r2.w;
//  r2.w = exp2(-r2.w);
//  r7.xyz = -r7.xyz * r2.www + r6.xyz;
//  r6.xyz = r0.www ? r7.xyz : r6.xyz;
//  r7.xyz = r4.www * vShoreBubbleColor[0].xyz + -r6.xyz;
//  o0.xyz = r0.yyy * r7.xyz + r6.xyz;
//  r6.xyzw = -vReflectance.xyzw + vWaveInnerBubbleColor[1].xyzw;
//  r6.xyzw = r3.wwww * r6.xyzw + vReflectance.xyzw;
//  r7.xyzw = vWaveSurfaceBubbleColor[1].xyzw + -r6.xyzw;
//  r6.xyzw = r1.wwww * r7.xyzw + r6.xyzw;
//  r7.xyzw = vShoreBubbleColor[1].xyzw + -r6.xyzw;
//  r6.xyzw = r0.yyyy * r7.wxyz + r6.wxyz;
//  o2.xyz = saturate(r6.yzw);
//  r6.x = saturate(r6.x);
//  r0.w = max(0, v7.w);
//  r0.w = cmp(r0.w < vShoreBubbleParam.z);
//  r2.w = saturate(v7.w / vShoreBubbleParam.z);
//  r2.w = 1 + -r2.w;
//  r0.z = r2.w * r0.z;
//  r0.z = r0.z * -r6.x + r6.x;
//  r0.z = r0.w ? r0.z : r6.x;
//  r0.w = cmp(vWaveInnerBubbleColor[2].y < r3.w);
//  r6.xyz = r2.zxy * r1.yzx;
//  r6.xyz = r2.yzx * r1.zxy + -r6.xyz;
//  r7.xyz = r4.yyy * r2.xyz;
//  r4.xyw = r6.xyz * r4.xxx + r7.xyz;
//  r4.xyz = r1.xyz * r4.zzz + r4.xyw;
//  r1.xyz = r0.www ? r4.xyz : r1.xyz;
//  r0.w = cmp(vShoreBubbleColor[2].y < r0.y);
//  r4.xyz = r2.zxy * r1.yzx;
//  r4.xyz = r2.yzx * r1.zxy + -r4.xyz;
//  r6.xyz = r5.yyy * r2.xyz;
//  r4.xyz = r4.xyz * r5.xxx + r6.xyz;
//  r4.xyz = r1.xyz * r5.zzz + r4.xyz;
//  r1.xyz = r0.www ? r4.xyz : r1.xyz;
//  r0.w = cmp(vWaveSurfaceBubbleColor[2].y < r1.w);
//  r4.xyz = r2.zxy * r1.yzx;
//  r4.xyz = r2.yzx * r1.zxy + -r4.xyz;
//  r5.xyz = r3.yyy * r2.xyz;
//  r4.xyz = r4.xyz * r3.xxx + r5.xyz;
//  r3.xyz = r1.xyz * r3.zzz + r4.xyz;
//  r1.xyz = r0.www ? r3.xyz : r1.xyz;
//  r0.w = 1 + -r1.w;
//  r0.w = min(fDiffuseTransparency, r0.w);
//  r1.w = 1 + -r3.w;
//  r0.w = min(r1.w, r0.w);
//  r0.y = 1 + -r0.y;
//  r0.y = min(r0.w, r0.y);
//  o2.w = 0.5 * r0.z;
//  r3.y = dot(mWV[0].xyz, r1.xyz);
//  r3.z = dot(mWV[1].xyz, r1.xyz);
//  r3.x = dot(mWV[2].xyz, r1.xyz);
//  r0.z = abs(r3.y) + abs(r3.z);
//  r0.z = r0.z + abs(r3.x);
//  r1.xyz = r3.xyz / r0.zzz;
//  r0.zw = float2(1,1) + -abs(r1.zy);
//  r3.xyz = cmp(r1.xyz >= float3(0,0,0));
//  r1.xw = r3.yz ? float2(1,1) : float2(-1,-1);
//  r0.zw = r1.xw * r0.zw;
//  r0.zw = r3.xx ? r1.yz : r0.zw;
//  o1.xy = r0.zw * float2(0.5,0.5) + float2(0.5,0.5);
//  r0.z = abs(v6.x) + abs(v6.y);
//  r0.z = abs(v6.z) + r0.z;
//  r1.xyz = v6.zxy / r0.zzz;
//  r0.zw = float2(1,1) + -abs(r1.zy);
//  r3.xyz = cmp(r1.xyz >= float3(0,0,0));
//  r1.xw = r3.yz ? float2(1,1) : float2(-1,-1);
//  r0.zw = r1.xw * r0.zw;
//  r0.zw = r3.xx ? r1.yz : r0.zw;
//  o4.xy = r0.zw * float2(0.5,0.5) + float2(0.5,0.5);
//  r0.z = abs(r2.x) + abs(r2.y);
//  r0.zw = r2.xy / r0.zz;
//  o4.zw = r0.zw * float2(0.5,0.5) + float2(0.5,0.5);
//  r0.y = 255 * r0.y;
//  r0.y = (uint)r0.y;
//  r0.y = (uint)r0.y << 8;
//  r0.y = (uint)r0.y;
//  o1.z = 1.52590219e-005 * r0.y;
//  o1.w = 0;
//  o3.xyzw = float4(0,0,0,0);
//  o5.xy = fRrRefractiveIndex;
//  o5.w = 0;
//  o5.z = r0.x;
//  o0.w = 1;
//  return;
//}
//
///*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Thu Mar 17 20:51:24 2022
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 vEye;                       // Offset:    0 Size:    16
//   float4 mWV[3];                     // Offset:   16 Size:    48
//   float fAmbMapsDORate;              // Offset:   64 Size:     4 [unused]
//      = 0x00000000
//   float4 vAmbDifScl;                 // Offset:   80 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
//   float3 vNormalNoiseParam;          // Offset:   96 Size:    12
//   float4 mRrW2T[3];                  // Offset:  112 Size:    48
//   float fRrRefractiveIndex;          // Offset:  160 Size:     4
//   float fRrTransparency;             // Offset:  164 Size:     4
//   float fDiffuseTransparency;        // Offset:  168 Size:     4
//   float4 vRrParam;                   // Offset:  176 Size:    16
//   float2 vD2Z;                       // Offset:  192 Size:     8
//   float4 vRrCameraPos;               // Offset:  208 Size:    16
//   float4 vRrCameraDir;               // Offset:  224 Size:    16
//   float4 vWaveBubbleColorScale;      // Offset:  240 Size:    16
//   float4 vWaveSurfaceBubbleColor[3]; // Offset:  256 Size:    48
//   float4 vWaveSurfaceBubbleParam;    // Offset:  304 Size:    16
//   float4 vWaveInnerBubbleColor[3];   // Offset:  320 Size:    48
//   float4 vWaveInnerBubbleParam;      // Offset:  368 Size:    16
//   float4 vShoreBubbleColor[3];       // Offset:  384 Size:    48
//   float4 vShoreBubbleParam;          // Offset:  432 Size:    16
//   float4 vBubbleShoalingAjustParam;  // Offset:  448 Size:    16
//   float4 vOceanScatteringColor;      // Offset:  464 Size:    16
//   float4 vWaveBubbleSpawnPointArray[16];// Offset:  480 Size:   256
//   float4 vBubbleDepth;               // Offset:  736 Size:    16
//   float4 vBubbleTextureArrayNo;      // Offset:  752 Size:    16
//   float4 vWaveSurfaceBubbleScale;    // Offset:  768 Size:    16
//   float4 vWaveInnerBubbleScale;      // Offset:  784 Size:    16
//   float4 vShoreBubbleScale;          // Offset:  800 Size:    16
//   float2 vWaveBubbleOffset;          // Offset:  816 Size:     8
//   float4 vAlbedoColor;               // Offset:  832 Size:    16
//   float4 vReflectance;               // Offset:  848 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __smpsOceanNormalMap              sampler      NA          NA    0        1
// __smpsOceanDepthMap               sampler      NA          NA    2        1
// __smpsOceanNormalNoiseMap         sampler      NA          NA    3        1
// __smpsOceanBubbleMap              sampler      NA          NA    4        1
// sOceanNormalMap                   texture  float4          3d    0        1
// sOceanDepthMap                    texture  float4          2d    2        1
// sOceanNormalNoiseMap              texture  float4          2d    3        1
// sOceanBubbleMap                   texture  float4     2darray    4        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_ClipDistance          1   xyzw        0  CLIPDST   float
// SV_ClipDistance          0   xyzw        1  CLIPDST   float
// SV_Position              0   xyzw        2      POS   float
// TEXCOORD                 0   xyzw        3     NONE   float   xyzw
// TEXCOORD                 1   xyzw        4     NONE   float   xy w
// TEXCOORD                 2   xyzw        5     NONE   float   xyzw
// TEXCOORD                 3   xyzw        6     NONE   float   xyzw
// TEXCOORD                 4   xyzw        7     NONE   float   xyzw
// TEXCOORD                 5   x           8     NONE   float   x
//
//
// 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
// SV_Target                2   xyzw        2   TARGET   float   xyzw
// SV_Target                3   xyzw        3   TARGET   float   xyzw
// SV_Target                4   xyzw        4   TARGET   float   xyzw
// SV_Target                5   xyzw        5   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[54], dynamicIndexed
dcl_constantbuffer cb13[10], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_resource_texture3d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2darray (float,float,float,float) t4
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v4.xyw
dcl_input_ps linear v5.xyzw
dcl_input_ps linear v6.xyzw
dcl_input_ps linear v7.xyzw
dcl_input_ps linear v8.x
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_temps 30
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw
sample_indexable(texture2d)(float,float,float,float) r0.x, v3.zwzz, t3.xyzw, s3
add r0.z, r0.x, cb0[6].z
mov r0.xy, v7.xyxx
sample_indexable(texture3d)(float,float,float,float) r0.xy, r0.xyzx, t0.xyzw, s0
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), v6.xzxx
add r0.xz, r0.xxyx, l(-1.000000, 0.000000, -1.000000, 0.000000)
mov r0.y, v6.y
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r0.xyzx
mul r2.xyz, r1.zxyz, l(0.000000, 1.000000, 0.000000, 0.000000)
mad r2.xyz, r1.yzxy, l(1.000000, 0.000000, 0.000000, 0.000000), -r2.xyzx
dp2 r1.w, r2.xyxx, r2.xyxx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r2.xyzx
add r3.xyz, -v5.xyzx, cb0[0].xyzx

mul r26.x, cb13[1].x, r25.y
mul r26.y, cb13[2].x, r25.y
mul r26.z, cb13[3].x, r25.y
mul r26.w, cb13[1].x, cb13[1].x
mad r26.w, cb13[2].x, cb13[2].x, r26.w
mad r26.w, cb13[3].x, cb13[3].x, r26.w
div r26.xyz, r26.xyzx, r26.wwww

mad r3.xyz, r25.xxxx, r26.xyzx, r3.xyzx

dp3 r1.w, r3.xyzx, r3.xyzx
rsq r1.w, r1.w
mul r3.xyz, r1.wwww, r3.xyzx
mad r0.xyz, -r0.xyzx, r0.wwww, l(0.000000, 1.000000, 0.000000, 0.000000)
mad r0.xyz, r0.xyzx, cb0[11].yyyy, -r3.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
add r3.xzw, v5.xxyz, -cb0[13].xxyz
dp4 r4.x, v5.xyzw, cb0[7].xyzw
dp4 r4.y, v5.xyzw, cb0[8].xyzw
dp4 r0.w, v5.xyzw, cb0[9].xyzw

add r25.w, r0.w, -r25.y
mul r25.w, r25.w, l(0.5)
mad r4.x, r25.x, r25.w, r4.x

div r4.xy, r4.xyxx, r0.wwww
sample_indexable(texture2d)(float,float,float,float) r0.w, r4.xyxx, t2.yzwx, s2
mad_sat r0.w, cb0[12].y, r0.w, cb0[12].x
div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
dp3 r1.w, r3.xzwx, cb0[14].xyzx
add r2.w, r0.w, -r1.w
min r2.w, r2.w, cb0[11].z
mad r4.xyz, r0.xyzx, r2.wwww, v5.xyzx
mov r4.w, l(1.000000)
dp4 r0.x, r4.xyzw, cb0[7].xyzw
dp4 r0.y, r4.xyzw, cb0[8].xyzw
dp4 r0.z, r4.xyzw, cb0[9].xyzw

add r25.w, r0.z, -r25.y
mul r25.w, r25.w, l(0.5)
mad r0.x, r25.x, r25.w, r0.x

div r0.xy, r0.xyxx, r0.zzzz
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t2.xyzw, s2
mad_sat r0.x, cb0[12].y, r0.x, cb0[12].x
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
lt r0.y, r0.x, r1.w
movc r0.x, r0.y, r0.w, r0.x
add r0.x, -r1.w, r0.x
mul r0.y, r0.x, cb0[11].w
mul r0.y, |r3.y|, r0.y
exp r0.y, r0.y
min r0.y, r0.y, l(1.000000)
add r0.y, -r0.y, l(1.000000)
mul r0.zw, v3.xxxy, cb0[48].zzzw
mad r0.zw, v4.xxxy, cb0[48].xxxy, r0.zzzw
add r3.xy, r0.zwzz, cb0[51].xyxx
mul r0.zw, v3.xxxy, cb0[49].zzzw
mad r0.zw, v4.xxxy, cb0[49].xxxy, r0.zzzw
add r4.xy, r0.zwzz, cb0[51].xyxx
mul r0.zw, v3.xxxy, cb0[50].zzzw
mad r0.zw, v4.xxxy, cb0[50].xxxy, r0.zzzw
add r5.xy, r0.zwzz, cb0[51].xyxx
mov_sat r0.z, v8.x
mov r3.z, cb0[47].x
sample_indexable(texture2darray)(float,float,float,float) r3.xyzw, r3.xyzx, t4.xyzw, s4
mul r3.xyzw, r3.xyzw, cb0[15].xyzw
mov r0.w, l(1.000000)
mul r1.w, r3.w, cb0[16].w
mul r1.w, r0.z, r1.w
mov r4.z, cb0[47].y
sample_indexable(texture2darray)(float,float,float,float) r4.xyzw, r4.xyzx, t4.xyzw, s4
mul r4.xyzw, r4.xyzw, cb0[15].xyzw
mov r2.w, l(1.000000)
mul r3.w, r4.w, cb0[20].w
mul r3.w, r0.z, r3.w
mov r5.z, cb0[47].z
sample_indexable(texture2darray)(float,float,float,float) r5.xyzw, r5.xyzx, t4.xyzw, s4
mov r4.w, l(1.000000)
mul r5.w, r5.w, cb0[24].w
mul r5.w, r0.z, r5.w
lt r6.x, l(0.000000), cb0[27].y
mov_sat r6.y, r1.y
log r6.y, r6.y
mul r6.y, r6.y, cb0[27].y
exp r6.y, r6.y
movc r6.x, r6.x, r6.y, l(1.000000)
mul r6.x, r6.x, cb0[46].x
mul r5.w, r5.w, r6.x
mul r6.x, r5.w, v7.z
lt r6.x, r6.x, cb0[27].w
lt r6.y, cb0[27].w, l(1.000000)
mad r6.z, r5.w, v7.z, -cb0[27].w
add r6.w, -cb0[27].w, l(1.000000)
div r6.z, r6.z, r6.w
movc r5.w, r6.y, r6.z, r5.w
movc r5.w, r6.x, l(0), r5.w
lt r6.xyz, r0.yyyy, cb0[28].wyzw
div r7.xyz, r0.yyyy, cb0[28].wyzw
mul r7.xyz, |r7.xyzx|, |r7.xyzx|
mul r0.y, r5.w, r7.x
movc r0.y, r6.x, r0.y, r5.w
mov r6.xw, l(0,0,0,0)
loop
  uge r5.w, r6.w, l(16)
  breakc_nz r5.w
  add r7.xw, v5.xxxz, -cb0[r6.w + 30].xxxy
  dp2 r5.w, r7.xwxx, r7.xwxx
  mul r7.x, cb0[r6.w + 30].z, cb0[r6.w + 30].z
  lt r7.w, r5.w, r7.x
  if_nz r7.w
    div r5.w, r5.w, r7.x
    add r5.w, -r5.w, l(1.000000)
    mad r6.x, cb0[r6.w + 30].w, r5.w, r6.x
  endif
  iadd r6.w, r6.w, l(1)
endloop
min r5.w, r6.x, l(3.000000)
mul r6.x, v6.w, l(0.159154952)
ge r6.w, r6.x, -r6.x
frc r6.x, |r6.x|
movc r6.x, r6.w, r6.x, -r6.x
mul r6.w, r6.x, l(6.283185)
lt r7.x, l(0.499999911), r6.x
lt r7.w, r6.x, l(-0.499999911)
mad r8.xy, r6.xxxx, l(6.283185, 6.283185, 0.000000, 0.000000), l(-6.283185, 6.283185, 0.000000, 0.000000)
movc r6.x, r7.w, r8.y, r6.w
movc r6.x, r7.x, r8.x, r6.x
add r6.w, cb0[19].x, l(1.570796)
add r6.w, -r6.w, r6.x
lt r7.x, l(0.000000), r6.w
add r7.w, r6.w, cb0[19].y
lt r7.w, r7.w, l(0.000000)
mul r8.x, cb0[19].y, l(-0.333333343)
lt r8.x, r8.x, r6.w
mul r8.y, r6.w, l(-3.000000)
div r8.y, r8.y, cb0[19].y
div r8.z, l(1.500000), cb0[19].y
mad r6.w, r6.w, r8.z, l(1.500000)
movc r6.w, r8.x, r8.y, r6.w
log r6.w, r6.w
mul r6.w, r6.w, cb0[19].z
exp r6.w, r6.w
min r6.w, r6.w, l(1.000000)
mov_sat r8.x, v4.w
mul r6.w, r6.w, r8.x
or r7.x, r7.x, r7.w
add r7.w, cb0[23].x, l(1.570796)
add r6.x, r6.x, -r7.w
lt r7.w, l(0.000000), r6.x
add r8.y, r6.x, cb0[23].y
lt r8.y, r8.y, l(0.000000)
mul r8.z, cb0[23].y, l(-0.125000)
lt r8.z, r8.z, r6.x
mul r8.w, r6.x, l(-8.000000)
div r8.w, r8.w, cb0[23].y
div r9.x, l(1.14285719), cb0[23].y
mad r6.x, r6.x, r9.x, l(1.14285719)
movc r6.x, r8.z, r8.w, r6.x
log r6.x, r6.x
mul r6.x, r6.x, cb0[23].z
exp r6.x, r6.x
min r6.xw, r6.xxxw, l(1.000000, 0.000000, 0.000000, 0.900000)
mul r6.x, r8.x, r6.x
or r7.w, r7.w, r8.y
add r6.w, -r6.w, l(1.000000)
movc r6.w, r7.x, l(1.000000), r6.w
lt r6.w, r1.w, r6.w
mul_sat r7.x, r5.w, cb0[46].x
mul r1.w, r1.w, r7.x
movc r1.w, r6.w, l(0), r1.w
mul r6.x, r6.x, cb0[46].x
movc r6.x, r7.w, l(0), r6.x
mul_sat r5.w, r5.w, r6.x
mul r6.x, r3.w, r5.w
lt r6.w, r6.x, cb0[23].w
lt r7.x, cb0[23].w, l(1.000000)
mad r3.w, r3.w, r5.w, -cb0[23].w
add r5.w, -cb0[23].w, l(1.000000)
div r3.w, r3.w, r5.w
movc r3.w, r7.x, r3.w, r6.x
movc r3.w, r6.w, l(0), r3.w
mul r5.w, r7.y, r1.w
movc r1.w, r6.y, r5.w, r1.w
mul r5.w, r7.z, r3.w
movc r3.w, r6.z, r5.w, r3.w
mad r6.xyz, r2.wwww, cb0[20].xyzx, -cb0[52].xyzx
mad r6.xyz, r3.wwww, r6.xyzx, cb0[52].xyzx
mad r7.xyz, r0.wwww, cb0[16].xyzx, -r6.xyzx
mad r6.xyz, r1.wwww, r7.xyzx, r6.xyzx
lt r0.w, l(0.000000), v7.w
lt r2.w, l(0.000000), cb0[29].w
and r0.w, r0.w, r2.w
add r7.xyz, -cb0[29].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r7.xyz, r6.xyzx, r7.xyzx
mul r2.w, cb0[29].w, cb0[29].w
mul r2.w, r2.w, v7.w
div r2.w, cb0[10].y, r2.w
exp r2.w, -r2.w
mad r7.xyz, -r7.xyzx, r2.wwww, r6.xyzx
movc r6.xyz, r0.wwww, r7.xyzx, r6.xyzx
mad r7.xyz, r4.wwww, cb0[24].xyzx, -r6.xyzx
mad o0.xyz, r0.yyyy, r7.xyzx, r6.xyzx
add r6.xyzw, cb0[21].xyzw, -cb0[53].xyzw
mad r6.xyzw, r3.wwww, r6.xyzw, cb0[53].xyzw
add r7.xyzw, -r6.xyzw, cb0[17].xyzw
mad r6.xyzw, r1.wwww, r7.xyzw, r6.xyzw
add r7.xyzw, -r6.xyzw, cb0[25].xyzw
mad r6.xyzw, r0.yyyy, r7.wxyz, r6.wxyz
mov_sat o2.xyz, r6.yzwy
mov_sat r6.x, r6.x
max r0.w, v7.w, l(0.000000)
lt r0.w, r0.w, cb0[27].z
div_sat r2.w, v7.w, cb0[27].z
add r2.w, -r2.w, l(1.000000)
mul r0.z, r0.z, r2.w
mad r0.z, r0.z, -r6.x, r6.x
movc r0.z, r0.w, r0.z, r6.x
lt r0.w, cb0[22].y, r3.w
mul r6.xyz, r1.yzxy, r2.zxyz
mad r6.xyz, r2.yzxy, r1.zxyz, -r6.xyzx
mul r7.xyz, r2.xyzx, r4.yyyy
mad r4.xyw, r6.xyxz, r4.xxxx, r7.xyxz
mad r4.xyz, r1.xyzx, r4.zzzz, r4.xywx
movc r1.xyz, r0.wwww, r4.xyzx, r1.xyzx
lt r0.w, cb0[26].y, r0.y
mul r4.xyz, r1.yzxy, r2.zxyz
mad r4.xyz, r2.yzxy, r1.zxyz, -r4.xyzx
mul r6.xyz, r2.xyzx, r5.yyyy
mad r4.xyz, r4.xyzx, r5.xxxx, r6.xyzx
mad r4.xyz, r1.xyzx, r5.zzzz, r4.xyzx
movc r1.xyz, r0.wwww, r4.xyzx, r1.xyzx
lt r0.w, cb0[18].y, r1.w
mul r4.xyz, r1.yzxy, r2.zxyz
mad r4.xyz, r2.yzxy, r1.zxyz, -r4.xyzx
mul r5.xyz, r2.xyzx, r3.yyyy
mad r4.xyz, r4.xyzx, r3.xxxx, r5.xyzx
mad r3.xyz, r1.xyzx, r3.zzzz, r4.xyzx
movc r1.xyz, r0.wwww, r3.xyzx, r1.xyzx
add r0.w, -r1.w, l(1.000000)
min r0.w, r0.w, cb0[10].z
add r1.w, -r3.w, l(1.000000)
min r0.w, r0.w, r1.w
add r0.y, -r0.y, l(1.000000)
min r0.y, r0.y, r0.w
mul o2.w, r0.z, l(0.500000)
dp3 r3.y, cb0[1].xyzx, r1.xyzx
dp3 r3.z, cb0[2].xyzx, r1.xyzx
dp3 r3.x, cb0[3].xyzx, r1.xyzx
add r0.z, |r3.z|, |r3.y|
add r0.z, |r3.x|, r0.z
div r1.xyz, r3.xyzx, r0.zzzz
add r0.zw, -|r1.zzzy|, l(0.000000, 0.000000, 1.000000, 1.000000)
ge r3.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r1.xw, r3.yyyz, l(1.000000,0,0,1.000000), l(-1.000000,0,0,-1.000000)
mul r0.zw, r0.zzzw, r1.xxxw
movc r0.zw, r3.xxxx, r1.yyyz, r0.zzzw
mad o1.xy, r0.zwzz, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r0.z, |v6.y|, |v6.x|
add r0.z, r0.z, |v6.z|
div r1.xyz, v6.zxyz, r0.zzzz
add r0.zw, -|r1.zzzy|, l(0.000000, 0.000000, 1.000000, 1.000000)
ge r3.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r1.xw, r3.yyyz, l(1.000000,0,0,1.000000), l(-1.000000,0,0,-1.000000)
mul r0.zw, r0.zzzw, r1.xxxw
movc r0.zw, r3.xxxx, r1.yyyz, r0.zzzw
mad o4.xy, r0.zwzz, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r0.z, |r2.y|, |r2.x|
div r0.zw, r2.xxxy, r0.zzzz
mad o4.zw, r0.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
mul r0.y, r0.y, l(255.000000)
ftou r0.y, r0.y
ishl r0.y, r0.y, l(8)
utof r0.y, r0.y
mul o1.z, r0.y, l(0.0000152590219)
mov o1.w, l(0)
mov o3.xyzw, l(0,0,0,0)
mov o5.xy, cb0[10].xyxx
mov o5.w, l(0)
mov o5.z, r0.x
mov o0.w, l(1.000000)
ret
// Approximately 280 instruction slots used
