// ---- Created with 3Dmigoto v1.3.16 on Sun Dec 27 19:25:02 2020

cbuffer CBufferGlobalConstant_Z : register(b0)
{

  struct
  {
    float4 c[90];
  } Global : packoffset(c0);

}

cbuffer CBufferScatteringConstant_Z : register(b1)
{

  struct
  {
    float4 c[36];
  } Scattering : packoffset(c0);

}

cbuffer CBufferLightConstant_Z : register(b2)
{

  struct
  {
    float4 c[3];
  } Light : packoffset(c0);

}

cbuffer CBufferRenderStateConstant_Z : register(b3)
{

  struct
  {
    float AlphaRef;
    float NoOmni;
  } RenderState : packoffset(c0);

}

cbuffer CBufferObjectConstant_Z : register(b4)
{

  struct
  {
    float4 c[32];
  } Object : packoffset(c0);

}

SamplerState sMaterialSampler_s : register(s0);
SamplerState sFogOcclusionSampler_s : register(s1);
SamplerState sMipFog0Sampler_s : register(s2);
Texture2D<float4> sDiffuse : register(t0);
Texture2DArray<float4> sBlueNoiseR8 : register(t1);
Texture2D<float4> sFogOcclusion : register(t2);
Texture2D<float4> sMipFog0 : register(t3);
Texture2D<float4> sMipFog1 : register(t4);


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


void main(
  float4 v0 : SV_Position0,
  float4 v1 : PREVIOUS_POSITION0,
  float4 v2 : COLOR0,
  float4 v3 : TEXCOORD0,
  float3 v4 : TEXSPACE_NORMAL0,
  float w4 : INSTANCE_COLOR0,
  float3 v5 : TEXSPACE_POS0,
  uint2 v6 : INSTANCE_INDEXES0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyzw = sDiffuse.Sample(sMaterialSampler_s, v3.xy).xyzw;
  r1.xyz = Object.c[20].xyz * r0.xyz;
  r0.w = Object.c[21].w * r0.w;
  r0.w = v2.w * r0.w;
  r2.xyz = Object.c[18].xyz * v2.xyz;
  r1.xyz = r2.xyz * r1.xyz;
  r1.w = cmp(0 != Global.c[12].z);
  if (r1.w != 0) {
    r1.w = v4.z * 0.0500000007 + v4.y;
    r1.w = saturate(r1.w * 3 + -1);
    r3.xy = float2(-0.00999999978,-0.200000003) + Global.c[12].zz;
    r3.xy = saturate(float2(2.94117641,1.25) * r3.xy);
    r2.w = Object.c[23].y * r3.x;
    r3.xzw = r1.xyz * r1.xyz + -r1.xyz;
    r1.xyz = r2.www * r3.xzw + r1.xyz;
    r2.w = Object.c[23].y * Object.c[23].y;
    r2.w = Object.c[23].y * r2.w;
    r3.x = 0.150000006 * r2.w;
    r2.w = -r2.w * 0.150000006 + 0.0500000007;
    r1.w = r1.w * r2.w + r3.x;
    r1.w = -Object.c[23].y + r1.w;
    r1.w = r3.y * r1.w + Object.c[23].y;
  } else {
    r1.w = Object.c[23].y;
  }
  r2.w = cmp(RenderState.AlphaRef >= r0.w);
  if (r2.w != 0) discard;
  r3.xyz = Global.c[2].zxy + -v5.zxy;
  r2.w = dot(r3.xyz, r3.xyz);
  r2.w = rsqrt(r2.w);
  r4.xyz = r3.xyz * r2.www;
  r0.xyz = Object.c[21].xyz * r0.xyz;
  r0.xyz = r0.xyz * r2.xyz;
  r2.x = dot(v4.xyz, v4.xyz);
  r2.x = rsqrt(r2.x);
  r2.xyz = v4.xyz * r2.xxx;
  r3.w = dot(r2.zxy, r4.xyz);
  r4.w = saturate(r1.w * 2 + -1);
  r4.w = r4.w * -0.0399999991 + 0.0399999991;
  r5.x = saturate(r3.w);
  r6.xyzw = r1.wwww * float4(-1,-0.0274999999,-0.572000027,0.0219999999) + float4(1,0.0425000004,1.03999996,-0.0399999991);
  r5.y = r6.x * r6.x;
  r5.x = -9.27999973 * r5.x;
  r5.x = exp2(r5.x);
  r5.x = min(r5.y, r5.x);
  r5.x = r5.x * r6.x + r6.y;
  r5.xy = r5.xx * float2(-1.03999996,1.03999996) + r6.zw;
  r5.x = r4.w * r5.x + r5.y;
  o0.w = saturate(Object.c[18].w * r0.w);
  r5.yzw = Object.c[19].yyy * Light.c[1].xyz;
  r0.w = dot(r2.xyz, Light.c[0].xyz);
  r6.x = dot(-r4.yzx, r2.xyz);
  r6.x = r6.x + r6.x;
  r6.xyz = r2.xyz * -r6.xxx + -r4.yzx;
  r6.w = dot(Light.c[0].xyz, r6.xyz);
  r7.xyz = -r6.www * Light.c[0].xyz + r6.xyz;
  r6.w = cmp(r6.w < 0.999988675);
  r7.w = dot(r7.xyz, r7.xyz);
  r7.w = rsqrt(r7.w);
  r7.xyz = r7.xyz * r7.www;
  r7.xyz = float3(0.0047559822,0.0047559822,0.0047559822) * r7.xyz;
  r7.xyz = Light.c[0].xyz * float3(0.999988675,0.999988675,0.999988675) + r7.xyz;
  r7.w = dot(r7.xyz, r7.xyz);
  r7.w = rsqrt(r7.w);
  r7.xyz = r7.xyz * r7.www;
  r6.xyz = r6.www ? r7.xyz : r6.xyz;
  r1.w = max(Light.c[1].w, r1.w);
  r1.w = max(0.0799999982, r1.w);
  r3.xyz = r3.yzx * r2.www + r6.xyz;
  r2.w = dot(r3.xyz, r3.xyz);
  r2.w = rsqrt(r2.w);
  r3.xyz = r3.xyz * r2.www;
  r2.w = saturate(dot(r3.xyz, r6.xyz));
  r3.x = saturate(dot(r2.xyz, r3.xyz));
  r3.y = saturate(dot(r2.xyz, r6.xyz));
  r3.z = 1 + -r4.w;
  r6.x = 1 + -r2.w;
  r6.y = r6.x * r6.x;
  r6.y = r6.y * r6.y;
  r6.x = r6.y * r6.x;
  r3.z = r3.z * r6.x + r4.w;
  r4.w = r1.w * r1.w;
  r4.w = r4.w * r4.w;
  r6.x = r3.x * r4.w + -r3.x;
  r3.x = r6.x * r3.x + 1;
  r3.x = r3.x * r3.x;
  r3.x = r4.w / r3.x;
  r6.xy = r1.ww * float2(0.5,-0.337748349) + float2(0.5,1);
  r4.w = r6.x * r6.x;
  r6.x = -r6.x * r6.x + 1;
  r6.z = abs(r3.w) * r6.x + r4.w;
  r4.w = r3.y * r6.x + r4.w;
  r4.w = r4.w * abs(r3.w);
  r4.w = r3.y * r6.z + r4.w;
  r4.w = 9.99999975e-006 + r4.w;
  r4.w = rcp(r4.w);
  r4.w = 0.5 * r4.w;
  r3.x = r3.z * r3.x;
  r3.x = r3.x * r4.w;
  r2.w = r2.w * r2.w;
  r2.w = dot(r2.ww, r1.ww);
  r1.w = r1.w * 0.5 + r2.w;
  r1.w = -1 + r1.w;
  r2.w = 1 + -r3.y;
  r3.z = r2.w * r2.w;
  r3.z = r3.z * r3.z;
  r2.w = r3.z * r2.w;
  r2.w = r1.w * r2.w + 1;
  r3.z = 1 + -abs(r3.w);
  r3.w = r3.z * r3.z;
  r3.w = r3.w * r3.w;
  r3.z = r3.w * r3.z;
  r1.w = r1.w * r3.z + 1;
  r1.w = r2.w * r1.w;
  r1.w = r1.w * r6.y;
  r6.xyz = r1.www * r5.yzw;
  r1.w = saturate(r0.w);
  r3.xzw = r3.xxx * r5.yzw;
  r2.w = 1 + -r5.x;
  r0.w = -1 + r0.w;
  r0.w = r0.w * Light.c[2].w + 1;
  r4.w = r2.y * 0.5 + 0.5;
  r5.x = -r2.y * 0.5 + 0.5;
  r4.w = r4.w * r4.w;
  r5.x = r5.x * r5.x;
  r5.xyz = Scattering.c[26].xyz * r5.xxx;
  r5.xyz = r4.www * Scattering.c[25].xyz + r5.xyz;
  r5.xyz = Light.c[2].xyz * r0.www + r5.xyz;
  r0.w = saturate(dot(r2.xyz, Scattering.c[24].xyz));
  r2.xyz = Scattering.c[23].xyz * r0.www + r5.xyz;
  r2.xyz = r2.xyz * r2.www;
  r2.xyz = r6.xyz * r1.www + r2.xyz;
  r0.xyz = r2.xyz * r1.xyz + r0.xyz;
  r0.xyz = r3.xzw * r3.yyy + r0.xyz;
  r1.xyz = v5.xyz;
  r1.w = 1;
  r1.xyzw = -Global.c[35].xyzw + r1.xyzw;
  r2.x = dot(r1.xyzw, Global.c[31].xyzw);
  r2.y = dot(r1.xyzw, Global.c[32].xyzw);
  r2.z = dot(r1.xyzw, Global.c[33].xyzw);
  r1.xy = v0.xy * Global.c[20].xy + Global.c[20].zw;
  r0.w = dot(r2.xyz, r2.xyz);
  r0.w = sqrt(r0.w);
  r1.x = sFogOcclusion.SampleLevel(sFogOcclusionSampler_s, r1.xy, 0).x;
  r1.y = -Scattering.c[19].y + r0.w;
  r1.y = saturate(r1.y / Scattering.c[19].z);
  r1.y = -r1.y * r1.x + 1;
  r1.z = Scattering.c[19].w * r1.y;
  r1.w = min(abs(r4.x), abs(r4.y));
  r2.x = max(abs(r4.x), abs(r4.y));
  r2.x = 1 / r2.x;
  r1.w = r2.x * r1.w;
  r2.x = r1.w * r1.w;
  r2.y = r2.x * 0.0208350997 + -0.0851330012;
  r2.y = r2.x * r2.y + 0.180141002;
  r2.y = r2.x * r2.y + -0.330299497;
  r2.x = r2.x * r2.y + 0.999866009;
  r2.y = r2.x * r1.w;
  r2.z = cmp(abs(r4.y) < abs(r4.x));
  r2.y = r2.y * -2 + 1.57079637;
  r2.y = r2.z ? r2.y : 0;
  r1.w = r1.w * r2.x + r2.y;
  r2.xy = cmp(-r4.yz < r4.yz);
  r2.x = r2.x ? -3.141593 : 0;
  r1.w = r2.x + r1.w;
  r2.x = min(-r4.x, -r4.y);
  r2.z = max(-r4.x, -r4.y);
  r2.x = cmp(r2.x < -r2.x);
  r2.z = cmp(r2.z >= -r2.z);
  r2.x = r2.z ? r2.x : 0;
  r1.w = r2.x ? -r1.w : r1.w;
  r3.x = r1.w * 0.159154937 + 0.5;
  r1.w = 1 + -abs(r4.z);
  r1.w = sqrt(r1.w);
  r2.x = abs(r4.z) * -0.0187292993 + 0.0742610022;
  r2.x = r2.x * abs(r4.z) + -0.212114394;
  r2.x = r2.x * abs(r4.z) + 1.57072878;
  r2.z = r2.x * r1.w;
  r2.z = r2.z * -2 + 3.14159274;
  r2.y = r2.y ? r2.z : 0;
  r1.w = r2.x * r1.w + r2.y;
  r3.y = 0.318309873 * r1.w;
  r2.xyzw = sMipFog0.SampleLevel(sMipFog0Sampler_s, r3.xy, r1.z).xyzw;
  r1.w = cmp(0 < Scattering.c[22].w);
  if (r1.w != 0) {
    r3.xyzw = sMipFog1.SampleLevel(sMipFog0Sampler_s, r3.xy, r1.z).xyzw;
    r3.xyzw = r3.xyzw + -r2.xyzw;
    r2.xyzw = Scattering.c[22].wwww * r3.xyzw + r2.xyzw;
  }
  r3.xyz = r2.xyz * Scattering.c[20].www + Scattering.c[20].xyz;
  r3.xyz = r3.xyz + -r2.xyz;
  r1.yzw = r1.yyy * r3.xyz + r2.xyz;
  r2.xyz = float3(1,1,1) + -Scattering.c[21].xyz;
  r2.xyz = r1.xxx * r2.xyz + Scattering.c[21].xyz;
  r1.xyz = r2.xyz * r1.yzw;
  r1.xyz = Scattering.c[21].www * r1.xyz;
  r0.w = Scattering.c[19].x * -r0.w;
  r0.w = 1.44269502 * r0.w;
  r0.w = exp2(r0.w);
  r0.w = 1 + -r0.w;
  r0.w = r2.w * r0.w;
  r1.xyz = r1.xyz * Object.c[20].www + -r0.xyz;
  r0.xyz = r0.www * r1.xyz + r0.xyz;
  if (3 == 0) r0.w = 0; else if (3+2 < 32) {   r0.w = (uint)Global.c[1].x << (32-(3 + 2)); r0.w = (uint)r0.w >> (32-3);  } else r0.w = (uint)Global.c[1].x >> 2;
  r0.w = cmp((uint)r0.w >= 5);
  if (r0.w != 0) {
    r0.w = (int)Global.c[1].x & 1;
    if (r0.w != 0) {
      r1.xyz = log2(r0.xyz);
      r1.xyz = floor(r1.xyz);
      r1.xyz = float3(-6,-6,-5) + r1.xyz;
      r1.xyz = exp2(r1.xyz);
      r2.xy = (uint2)v0.xy;
      r2.xy = (int2)r2.xy & int2(63,63);
      r2.zw = float2(0,0);
      r2.x = sBlueNoiseR8.Load(r2.xyzw).x;
      r2.yz = float2(1,-1);
      r3.xyz = r2.xyy * r1.xyz;
      r1.xyz = float3(1,0,0) * r1.xyz;
      r4.xyz = cmp(float3(0,0,0) < r0.xyz);
      r4.xyz = r4.xyz ? float3(1,1,1) : 0;
      r1.xyz = r2.zxx * r3.xyz + r1.xyz;
      o0.xyz = r4.xyz * r1.xyz + r0.xyz;
    } else {
      r1.xy = (uint2)v0.xy;
      r1.xy = (int2)r1.xy & int2(63,63);
      r1.zw = float2(0,0);
      r0.w = sBlueNoiseR8.Load(r1.xyzw).x;
      r1.xyz = cmp(float3(0,0,0) < r0.xyz);
      r1.xyz = r1.xyz ? float3(1,1,1) : 0;
      r2.xyz = r0.www * float3(-0.00392156886,0.00392156886,0.00392156886) + float3(0.00392156886,0,0);
      o0.xyz = r1.xyz * r2.xyz + r0.xyz;
    }
  } else {
    o0.xyz = r0.xyz;
  }
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.16 on Sun Dec 27 19:25:02 2020
//
//
// Buffer Definitions:
//
// cbuffer CBufferGlobalConstant_Z
// {
//
//   struct StructGlobalConstant_Z
//   {
//
//       float4 c[90];                  // Offset:    0
//
//   } Global;                          // Offset:    0 Size:  1440
//
// }
//
// cbuffer CBufferScatteringConstant_Z
// {
//
//   struct StructScatteringConstant_Z
//   {
//
//       float4 c[36];                  // Offset:    0
//
//   } Scattering;                      // Offset:    0 Size:   576
//
// }
//
// cbuffer CBufferLightConstant_Z
// {
//
//   struct StructLightConstant_Z
//   {
//
//       float4 c[3];                   // Offset:    0
//
//   } Light;                           // Offset:    0 Size:    48
//
// }
//
// cbuffer CBufferRenderStateConstant_Z
// {
//
//   struct StructRenderStateConstant_Z
//   {
//
//       float AlphaRef;                // Offset:    0
//       float NoOmni;                  // Offset:    4
//
//   } RenderState;                     // Offset:    0 Size:     8
//
// }
//
// cbuffer CBufferObjectConstant_Z
// {
//
//   struct StructObjectConstant_Z
//   {
//
//       float4 c[32];                  // Offset:    0
//
//   } Object;                          // Offset:    0 Size:   512
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sMaterialSampler                  sampler      NA          NA    0        1
// sFogOcclusionSampler              sampler      NA          NA    1        1
// sMipFog0Sampler                   sampler      NA          NA    2        1
// sDiffuse                          texture  float4          2d    0        1
// sBlueNoiseR8                      texture  float4     2darray    1        1
// sFogOcclusion                     texture  float4          2d    2        1
// sMipFog0                          texture  float4          2d    3        1
// sMipFog1                          texture  float4          2d    4        1
// CBufferGlobalConstant_Z           cbuffer      NA          NA    0        1
// CBufferScatteringConstant_Z       cbuffer      NA          NA    1        1
// CBufferLightConstant_Z            cbuffer      NA          NA    2        1
// CBufferRenderStateConstant_Z      cbuffer      NA          NA    3        1
// CBufferObjectConstant_Z           cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// PREVIOUS_POSITION        0   xyzw        1     NONE   float
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xyzw        3     NONE   float   xy
// TEXSPACE_NORMAL          0   xyz         4     NONE   float   xyz
// INSTANCE_COLOR           0      w        4     NONE   float
// TEXSPACE_POS             0   xyz         5     NONE   float   xyz
// INSTANCE_INDEXES         0   xy          6     NONE    uint
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[36], immediateIndexed
dcl_constantbuffer cb1[27], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_constantbuffer cb3[1], immediateIndexed
dcl_constantbuffer cb4[24], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2darray (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_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xy
dcl_input_ps linear v4.xyz
dcl_input_ps linear v5.xyz
dcl_output o0.xyzw
dcl_temps 8
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, v3.xyxx, t0.xyzw, s0
mul r1.xyz, r0.xyzx, cb4[20].xyzx
mul r0.w, r0.w, cb4[21].w
mul r0.w, r0.w, v2.w
mul r2.xyz, v2.xyzx, cb4[18].xyzx
mul r1.xyz, r1.xyzx, r2.xyzx
ne r1.w, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[12].z
if_nz r1.w
  mad r1.w, v4.z, l(0.050000), v4.y
  mad_sat r1.w, r1.w, l(3.000000), l(-1.000000)
  add r3.xy, cb0[12].zzzz, l(-0.010000, -0.200000, 0.000000, 0.000000)
  mul_sat r3.xy, r3.xyxx, l(2.94117641, 1.250000, 0.000000, 0.000000)
  mul r2.w, r3.x, cb4[23].y
  mad r3.xzw, r1.xxyz, r1.xxyz, -r1.xxyz
  mad r1.xyz, r2.wwww, r3.xzwx, r1.xyzx
  mul r2.w, cb4[23].y, cb4[23].y
  mul r2.w, r2.w, cb4[23].y
  mul r3.x, r2.w, l(0.150000)
  mad r2.w, -r2.w, l(0.150000), l(0.050000)
  mad r1.w, r1.w, r2.w, r3.x
  add r1.w, r1.w, -cb4[23].y
  mad r1.w, r3.y, r1.w, cb4[23].y
else
  mov r1.w, cb4[23].y
endif
ge r2.w, cb3[0].x, r0.w
discard_nz r2.w
add r3.xyz, -v5.zxyz, cb0[2].zxyz
dp3 r2.w, r3.xyzx, r3.xyzx
rsq r2.w, r2.w
mul r4.xyz, r2.wwww, r3.xyzx
mul r0.xyz, r0.xyzx, cb4[21].xyzx
mul r0.xyz, r2.xyzx, r0.xyzx
dp3 r2.x, v4.xyzx, v4.xyzx
rsq r2.x, r2.x
mul r2.xyz, r2.xxxx, v4.xyzx
dp3 r3.w, r2.zxyz, r4.xyzx
mad_sat r4.w, r1.w, l(2.000000), l(-1.000000)
mad r4.w, r4.w, l(-0.040000), l(0.040000)
mov_sat r5.x, r3.w
mad r6.xyzw, r1.wwww, l(-1.000000, -0.027500, -0.572000, 0.022000), l(1.000000, 0.042500, 1.040000, -0.040000)
mul r5.y, r6.x, r6.x
mul r5.x, r5.x, l(-9.280000)
exp r5.x, r5.x
min r5.x, r5.x, r5.y
mad r5.x, r5.x, r6.x, r6.y
mad r5.xy, r5.xxxx, l(-1.040000, 1.040000, 0.000000, 0.000000), r6.zwzz
mad r5.x, r4.w, r5.x, r5.y
mul_sat o0.w, r0.w, cb4[18].w
mul r5.yzw, cb2[1].xxyz, cb4[19].yyyy
dp3 r0.w, r2.xyzx, cb2[0].xyzx
dp3 r6.x, -r4.yzxy, r2.xyzx
add r6.x, r6.x, r6.x
mad r6.xyz, r2.xyzx, -r6.xxxx, -r4.yzxy
dp3 r6.w, cb2[0].xyzx, r6.xyzx
mad r7.xyz, -r6.wwww, cb2[0].xyzx, r6.xyzx
lt r6.w, r6.w, l(0.999988675)
dp3 r7.w, r7.xyzx, r7.xyzx
rsq r7.w, r7.w
mul r7.xyz, r7.wwww, r7.xyzx
mul r7.xyz, r7.xyzx, l(0.00475598220, 0.00475598220, 0.00475598220, 0.000000)
mad r7.xyz, cb2[0].xyzx, l(0.999988675, 0.999988675, 0.999988675, 0.000000), r7.xyzx
dp3 r7.w, r7.xyzx, r7.xyzx
rsq r7.w, r7.w
mul r7.xyz, r7.wwww, r7.xyzx
movc r6.xyz, r6.wwww, r7.xyzx, r6.xyzx
max r1.w, r1.w, cb2[1].w
max r1.w, r1.w, l(0.080000)
mad r3.xyz, r3.yzxy, r2.wwww, r6.xyzx
dp3 r2.w, r3.xyzx, r3.xyzx
rsq r2.w, r2.w
mul r3.xyz, r2.wwww, r3.xyzx
dp3_sat r2.w, r3.xyzx, r6.xyzx
dp3_sat r3.x, r2.xyzx, r3.xyzx
dp3_sat r3.y, r2.xyzx, r6.xyzx
add r3.z, -r4.w, l(1.000000)
add r6.x, -r2.w, l(1.000000)
mul r6.y, r6.x, r6.x
mul r6.y, r6.y, r6.y
mul r6.x, r6.x, r6.y
mad r3.z, r3.z, r6.x, r4.w
mul r4.w, r1.w, r1.w
mul r4.w, r4.w, r4.w
mad r6.x, r3.x, r4.w, -r3.x
mad r3.x, r6.x, r3.x, l(1.000000)
mul r3.x, r3.x, r3.x
div r3.x, r4.w, r3.x
mad r6.xy, r1.wwww, l(0.500000, -0.337748349, 0.000000, 0.000000), l(0.500000, 1.000000, 0.000000, 0.000000)
mul r4.w, r6.x, r6.x
mad r6.x, -r6.x, r6.x, l(1.000000)
mad r6.z, |r3.w|, r6.x, r4.w
mad r4.w, r3.y, r6.x, r4.w
mul r4.w, |r3.w|, r4.w
mad r4.w, r3.y, r6.z, r4.w
add r4.w, r4.w, l(0.000010)
rcp r4.w, r4.w
mul r4.w, r4.w, l(0.500000)
mul r3.x, r3.x, r3.z
mul r3.x, r4.w, r3.x
mul r2.w, r2.w, r2.w
dp2 r2.w, r2.wwww, r1.wwww
mad r1.w, r1.w, l(0.500000), r2.w
add r1.w, r1.w, l(-1.000000)
add r2.w, -r3.y, l(1.000000)
mul r3.z, r2.w, r2.w
mul r3.z, r3.z, r3.z
mul r2.w, r2.w, r3.z
mad r2.w, r1.w, r2.w, l(1.000000)
add r3.z, -|r3.w|, l(1.000000)
mul r3.w, r3.z, r3.z
mul r3.w, r3.w, r3.w
mul r3.z, r3.z, r3.w
mad r1.w, r1.w, r3.z, l(1.000000)
mul r1.w, r1.w, r2.w
mul r1.w, r6.y, r1.w
mul r6.xyz, r5.yzwy, r1.wwww
mov_sat r1.w, r0.w
mul r3.xzw, r5.yyzw, r3.xxxx
add r2.w, -r5.x, l(1.000000)
add r0.w, r0.w, l(-1.000000)
mad r0.w, r0.w, cb2[2].w, l(1.000000)
mad r4.w, r2.y, l(0.500000), l(0.500000)
mad r5.x, -r2.y, l(0.500000), l(0.500000)
mul r4.w, r4.w, r4.w
mul r5.x, r5.x, r5.x
mul r5.xyz, r5.xxxx, cb1[26].xyzx
mad r5.xyz, r4.wwww, cb1[25].xyzx, r5.xyzx
mad r5.xyz, cb2[2].xyzx, r0.wwww, r5.xyzx
dp3_sat r0.w, r2.xyzx, cb1[24].xyzx
mad r2.xyz, cb1[23].xyzx, r0.wwww, r5.xyzx
mul r2.xyz, r2.wwww, r2.xyzx
mad r2.xyz, r6.xyzx, r1.wwww, r2.xyzx
mad r0.xyz, r2.xyzx, r1.xyzx, r0.xyzx
mad r0.xyz, r3.xzwx, r3.yyyy, r0.xyzx
mov r1.xyz, v5.xyzx
mov r1.w, l(1.000000)
add r1.xyzw, r1.xyzw, -cb0[35].xyzw
dp4 r2.x, r1.xyzw, cb0[31].xyzw
dp4 r2.y, r1.xyzw, cb0[32].xyzw
dp4 r2.z, r1.xyzw, cb0[33].xyzw
mad r1.xy, v0.xyxx, cb0[20].xyxx, cb0[20].zwzz
dp3 r0.w, r2.xyzx, r2.xyzx
sqrt r0.w, r0.w
sample_l_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t2.xyzw, s1, l(0.000000)
add r1.y, r0.w, -cb1[19].y
div_sat r1.y, r1.y, cb1[19].z
mad r1.y, -r1.y, r1.x, l(1.000000)
mul r1.z, r1.y, cb1[19].w
min r1.w, |r4.y|, |r4.x|
max r2.x, |r4.y|, |r4.x|
div r2.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.x
mul r1.w, r1.w, r2.x
mul r2.x, r1.w, r1.w
mad r2.y, r2.x, l(0.0208350997), l(-0.085133)
mad r2.y, r2.x, r2.y, l(0.180141)
mad r2.y, r2.x, r2.y, l(-0.330299497)
mad r2.x, r2.x, r2.y, l(0.999866)
mul r2.y, r1.w, r2.x
lt r2.z, |r4.y|, |r4.x|
mad r2.y, r2.y, l(-2.000000), l(1.57079637)
and r2.y, r2.z, r2.y
mad r1.w, r1.w, r2.x, r2.y
lt r2.xy, -r4.yzyy, r4.yzyy
and r2.x, r2.x, l(0xc0490fdb)
add r1.w, r1.w, r2.x
min r2.x, -r4.y, -r4.x
max r2.z, -r4.y, -r4.x
lt r2.x, r2.x, -r2.x
ge r2.z, r2.z, -r2.z
and r2.x, r2.z, r2.x
movc r1.w, r2.x, -r1.w, r1.w
mad r3.x, r1.w, l(0.159154937), l(0.500000)
add r1.w, -|r4.z|, l(1.000000)
sqrt r1.w, r1.w
mad r2.x, |r4.z|, l(-0.0187292993), l(0.074261)
mad r2.x, r2.x, |r4.z|, l(-0.212114394)
mad r2.x, r2.x, |r4.z|, l(1.57072878)
mul r2.z, r1.w, r2.x
mad r2.z, r2.z, l(-2.000000), l(3.14159274)
and r2.y, r2.y, r2.z
mad r1.w, r2.x, r1.w, r2.y
mul r3.y, r1.w, l(0.318309873)
sample_l_indexable(texture2d)(float,float,float,float) r2.xyzw, r3.xyxx, t3.xyzw, s2, r1.z
lt r1.w, l(0.000000), cb1[22].w
if_nz r1.w
  sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.xyxx, t4.xyzw, s2, r1.z
  add r3.xyzw, -r2.xyzw, r3.xyzw
  mad r2.xyzw, cb1[22].wwww, r3.xyzw, r2.xyzw
endif
mad r3.xyz, r2.xyzx, cb1[20].wwww, cb1[20].xyzx
add r3.xyz, -r2.xyzx, r3.xyzx
mad r1.yzw, r1.yyyy, r3.xxyz, r2.xxyz
add r2.xyz, -cb1[21].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r2.xyz, r1.xxxx, r2.xyzx, cb1[21].xyzx
mul r1.xyz, r1.yzwy, r2.xyzx
mul r1.xyz, r1.xyzx, cb1[21].wwww
mul r0.w, -r0.w, cb1[19].x
mul r0.w, r0.w, l(1.442695)
exp r0.w, r0.w
add r0.w, -r0.w, l(1.000000)
mul r0.w, r0.w, r2.w
mad r1.xyz, r1.xyzx, cb4[20].wwww, -r0.xyzx
mad r0.xyz, r0.wwww, r1.xyzx, r0.xyzx
ubfe r0.w, l(3), l(2), cb0[1].x
uge r0.w, r0.w, l(5)
if_nz r0.w
  and r0.w, cb0[1].x, l(1)
  if_nz r0.w
    log r1.xyz, r0.xyzx
    round_ni r1.xyz, r1.xyzx
    add r1.xyz, r1.xyzx, l(-6.000000, -6.000000, -5.000000, 0.000000)
    exp r1.xyz, r1.xyzx
    ftou r2.xy, v0.xyxx
    and r2.xy, r2.xyxx, l(63, 63, 0, 0)
    mov r2.zw, l(0,0,0,0)
    ld_indexable(texture2darray)(float,float,float,float) r2.x, r2.xyzw, t1.xyzw
    mov r2.yz, l(0,1.000000,-1.000000,0)
    mul r3.xyz, r1.xyzx, r2.xyyx
    mul r1.xyz, r1.xyzx, l(1.000000, 0.000000, 0.000000, 0.000000)
    lt r4.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r0.xyzx
    and r4.xyz, r4.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
    mad r1.xyz, r2.zxxz, r3.xyzx, r1.xyzx
    mad o0.xyz, r4.xyzx, r1.xyzx, r0.xyzx
  else
    ftou r1.xy, v0.xyxx
    and r1.xy, r1.xyxx, l(63, 63, 0, 0)
    mov r1.zw, l(0,0,0,0)
    ld_indexable(texture2darray)(float,float,float,float) r0.w, r1.xyzw, t1.yzwx
    lt r1.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r0.xyzx
    and r1.xyz, r1.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
    mad r2.xyz, r0.wwww, l(-0.00392156886, 0.00392156886, 0.00392156886, 0.000000), l(0.00392156886, 0.000000, 0.000000, 0.000000)
    mad o0.xyz, r1.xyzx, r2.xyzx, r0.xyzx
  endif
else
  mov o0.xyz, r0.xyzx
endif
ret
// Approximately 237 instruction slots used

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