//Rain PS.
// ---- Created with 3Dmigoto v1.3.14 on Tue Feb 12 21:56:53 2019
//
//cbuffer SceneInfo : register(b0)
//{
//  row_major float4x4 viewProjMat : packoffset(c0);
//  row_major float3x4 transposeViewMat : packoffset(c4);
//  row_major float3x4 transposeViewInvMat : packoffset(c7);
//  float4 projElement[2] : packoffset(c10);
//  float4 projInvElements[2] : packoffset(c12);
//  row_major float4x4 viewProjInvMat : packoffset(c14);
//  row_major float4x4 prevViewProjMat : packoffset(c18);
//  float3 ZToLinear : packoffset(c22);
//  float subdivisionLevel : packoffset(c22.w);
//  float2 screenSize : packoffset(c23);
//  float2 screenInverseSize : packoffset(c23.z);
//  float2 cullingHelper : packoffset(c24);
//  float cameraNearPlane : packoffset(c24.z);
//  float cameraFarPlane : packoffset(c24.w);
//  float4 viewFrustum[6] : packoffset(c25);
//  float4 clipplane : packoffset(c31);
//}
//
//cbuffer EnvironmentInfo : register(b1)
//{
//  uint timeMillisecond : packoffset(c0);
//  uint frameCount : packoffset(c0.y);
//  uint isOddFrame : packoffset(c0.z);
//  uint reserveEnvironmentInfo : packoffset(c0.w);
//  row_major float4x4 userGlobalParams : packoffset(c1);
//  float breakingPBRSpecularIntensity : packoffset(c5);
//  float breakingPBRIBLReflectanceBias : packoffset(c5.y);
//  float breakingPBRIBLIntensity : packoffset(c5.z);
//  float breakingPBR_Reserved : packoffset(c5.w);
//}
//
//cbuffer UserMaterial : register(b2)
//{
//  float4 VAR_ColorParam : packoffset(c0);
//  float VAR_UseGlobalTimer : packoffset(c1);
//  float VAR_BaseHight : packoffset(c1.y);
//  float VAR_FollowSpeed : packoffset(c1.z);
//  float VAR_LoopRange : packoffset(c1.w);
//  float VAR_CubeMap_clamp : packoffset(c2);
//  float VAR_RefractiveIndex_2 : packoffset(c2.y);
//  float VAR_RefractiveIndex_1 : packoffset(c2.z);
//  float VAR_FlashLightBrighntness : packoffset(c2.w);
//  float VAR_ReflectBrightnessScale : packoffset(c3);
//  float VAR_RainScale : packoffset(c3.y);
//  float VAR_RainWidth : packoffset(c3.z);
//  float VAR_MaskLevel : packoffset(c3.w);
//  float VAR_use_FakeCubeMap : packoffset(c4);
//  float VAR_use_FlashLight : packoffset(c4.y);
//  float VAR_FlashLightScale : packoffset(c4.z);
//  float CAPCOM_MATERIAL_RESERVE : packoffset(c4.w);
//}
//
//SamplerState BilinearWrap_s : register(s0);
//TextureCube<float4> DynamicCubeMap : register(t0);
//Texture2D<float4> DynamicTransparentHDR : register(t1);
//Texture2D<float4> AlphaMap : register(t2);
//Texture2D<float4> NormalMap : register(t3);
//Texture2D<float4> LoopMask : register(t4);
//
//
//// 3Dmigoto declarations
//#define cmp -
//Texture1D<float4> IniParams : register(t120);
//Texture2D<float4> StereoParams : register(t125);
//
//
//void main(
//  float4 v0 : SV_POSITION0,
//  float4 v1 : INTERPOLATOR0,
//  float4 v2 : INTERPOLATOR1,
//  float4 v3 : INTERPOLATOR2,
//  float2 v4 : INTERPOLATOR3,
//  out float4 o0 : SV_TARGET0,
//  out float o1 : SV_TARGET1)
//{
//  float4 r0,r1,r2,r3,r4,r5,r6,r7;
//  uint4 bitmask, uiDest;
//  float4 fDest;
//
//  float4 stereo = StereoParams.Load(0);
//  
//  r0.x = dot(v1.xyz, v1.xyz);
//  r0.x = rsqrt(r0.x);
//  r0.xyz = v1.xyz * r0.xxx;
//  r1.x = v2.w;
//  r1.yz = v3.xy;
//  r0.w = dot(r1.xyz, r1.xyz);
//  r0.w = rsqrt(r0.w);
//  r1.xyz = r1.xyz * r0.www;
//  r2.xyz = r1.yzx * r0.zxy;
//  r2.xyz = r0.yzx * r1.zxy + -r2.xyz;
//  r0.w = cmp(v3.z < 0);
//  r2.xyz = r0.www ? -r2.xyz : r2.xyz;
//  r3.x = -transposeViewInvMat._m03;
//  r3.y = -transposeViewInvMat._m13;
//  r3.z = -transposeViewInvMat._m23;
//  r4.x = v3.w;
//  r4.yz = v4.xy;
//  r3.xyz = r4.xyz + r3.xyz;
//  r0.w = dot(r3.xyz, r3.xyz);
//  r0.w = rsqrt(r0.w);
//  r3.xyz = r3.xyz * r0.www;
//  r4.xy = float2(1,1) / VAR_RainWidth;
//  r5.x = v1.w * r4.x;
//  r0.w = r4.y + r4.y;
//  r0.w = 1 / r0.w;
//  r1.w = -1 + r4.y;
//  r5.yz = v2.xy;
//  r4.xz = r0.ww * r1.ww + r5.xy;
//  r4.xy = saturate(r4.xz * r4.yy + -r1.ww);
//  r6.xyz = NormalMap.Sample(BilinearWrap_s, r4.xy).xyz;
//  r7.xyz = r6.xyz * float3(2,2,2) + float3(-1,-1,-1);
//  r0.w = dot(r2.xyz, r2.xyz);
//  r0.w = rsqrt(r0.w);
//  r2.xyz = r2.xyz * r0.www;
//  r2.xyz = r7.yyy * r2.xyz;
//  r1.xyz = r7.xxx * r1.xyz + r2.xyz;
//  r0.xyz = r7.zzz * r0.xyz + r1.xyz;
//  r0.w = dot(r0.xyz, r0.xyz);
//  r0.w = rsqrt(r0.w);
//  r0.xyz = r0.xyz * r0.www;
//  r1.xyzw = float4(-0.5,-0.5,-0.5,-0.5) + r6.yyxx;
//  r2.xy = screenInverseSize.xy * v0.xy;
//  r6.xyz = userGlobalParams._m02_m02_m02 * viewProjMat._m10_m11_m13;
//  r6.xyz = userGlobalParams._m01_m01_m01 * viewProjMat._m00_m01_m03 + r6.xyz;
//  r6.xyz = userGlobalParams._m03_m03_m03 * viewProjMat._m20_m21_m23 + r6.xyz;
//  r6.xyz = viewProjMat._m30_m31_m33 + r6.xyz;
//  r6.x+=stereo.x*(r6.z-stereo.y);
//  r2.zw = r6.xy / r6.zz;
//  r2.zw = r2.zw * float2(0.5,-0.5) + float2(0.5,0.5);
//  r5.x = screenSize.x * screenInverseSize.y;
//  r1.xyzw = VAR_RefractiveIndex_2 * r1.xyzw;
//  r2.zw = -screenInverseSize.xy * v0.xy + r2.zw;
//  r0.w = VAR_BaseHight * VAR_LoopRange;
//  r0.w = VAR_FollowSpeed / r0.w;
//  r5.y = 1;
//  r2.zw = r5.xy * r2.zw;
//  r3.w = -0.5 + v2.z;
//  r1.xyzw = r1.wxzy * float4(1,1.77999997,1,1.77999997) + r2.xyxy;
//  r2.x = dot(r2.zw, r2.zw);
//  r2.x = sqrt(r2.x);
//  r0.w = 1000 / r0.w;
//  r2.y = AlphaMap.Sample(BilinearWrap_s, r4.xy).x;
//  r1.xyzw = max(float4(0.00100000005,0.00100000005,0.00100000005,0.00100000005), r1.zwxy);
//  r2.z = r3.w / VAR_LoopRange;
//  r2.w = 1 / VAR_FlashLightScale;
//  r2.x = saturate(r2.x * r2.w);
//  r2.w = r2.x * -2 + 3;
//  r2.x = r2.x * r2.x;
//  r1.xyzw = min(float4(0.999000013,0.999000013,0.999000013,0.999000013), r1.xyzw);
//  r3.w = timeMillisecond;
//  r3.w = r3.w / r0.w;
//  r3.w = frac(r3.w);
//  r0.w = userGlobalParams._m10 / r0.w;
//  r0.w = frac(r0.w);
//  r0.w = r0.w + -r3.w;
//  r0.w = VAR_UseGlobalTimer * r0.w + r3.w;
//  r0.w = r0.w + r2.z;
//  r4.xyz = DynamicTransparentHDR.Sample(BilinearWrap_s, r1.xy).xyz;
//  r1.x = -r2.w * r2.x + 1;
//  r1.yzw = DynamicTransparentHDR.Sample(BilinearWrap_s, r1.zw).xyz;
//  r1.yzw = r1.yzw + -r4.xyz;
//  r1.yzw = r2.yyy * r1.yzw + r4.xyz;
//  r5.w = 0.5 + r0.w;
//  r0.w = dot(r0.xyz, -r3.xyz);
//  r0.w = saturate(r0.w + r0.w);
//  r2.x = r0.w * -2 + 3;
//  r0.w = r0.w * r0.w;
//  r0.w = r2.x * r0.w;
//  r2.x = cmp(0 < VAR_use_FakeCubeMap);
//  if (r2.x != 0) {
//    r2.x = dot(r3.xyz, r0.xyz);
//    r2.x = r2.x + r2.x;
//    r2.xzw = -r2.xxx * r0.zxy + r3.zxy;
//    r3.w = min(abs(r2.x), abs(r2.z));
//    r4.x = max(abs(r2.x), abs(r2.z));
//    r4.x = 1 / r4.x;
//    r3.w = r4.x * r3.w;
//    r4.x = r3.w * r3.w;
//    r4.y = r4.x * 0.0208350997 + -0.0851330012;
//    r4.y = r4.x * r4.y + 0.180141002;
//    r4.y = r4.x * r4.y + -0.330299497;
//    r4.x = r4.x * r4.y + 0.999866009;
//    r4.y = r4.x * r3.w;
//    r4.z = cmp(abs(r2.z) < abs(r2.x));
//    r4.y = r4.y * -2 + 1.57079637;
//    r4.y = r4.z ? r4.y : 0;
//    r3.w = r3.w * r4.x + r4.y;
//    r4.xy = cmp(r2.zw < -r2.zw);
//    r4.x = r4.x ? -3.141593 : 0;
//    r3.w = r4.x + r3.w;
//    r4.x = min(r2.x, r2.z);
//    r2.x = max(r2.x, r2.z);
//    r2.z = cmp(r4.x < -r4.x);
//    r2.x = cmp(r2.x >= -r2.x);
//    r2.x = r2.x ? r2.z : 0;
//    r2.x = r2.x ? -r3.w : r3.w;
//    r2.x = 0.159154937 * r2.x;
//    r5.x = frac(r2.x);
//    r2.x = 1 + -abs(r2.w);
//    r2.x = sqrt(r2.x);
//    r2.z = abs(r2.w) * -0.0187292993 + 0.0742610022;
//    r2.z = r2.z * abs(r2.w) + -0.212114394;
//    r2.z = r2.z * abs(r2.w) + 1.57072878;
//    r2.w = r2.z * r2.x;
//    r2.w = r2.w * -2 + 3.14159274;
//    r2.w = r4.y ? r2.w : 0;
//    r2.x = r2.z * r2.x + r2.w;
//    r5.y = 0.318309873 * r2.x;
//    r2.xzw = DynamicTransparentHDR.Sample(BilinearWrap_s, r5.xy).xyz;
//    r2.xzw = max(float3(0,0,0), r2.xzw);
//    r2.xzw = min(VAR_CubeMap_clamp, r2.xzw);
//    r2.xzw = VAR_ReflectBrightnessScale * r2.xzw;
//  } else {
//    r3.w = dot(r3.xyz, r0.xyz);
//    r3.w = r3.w + r3.w;
//    r0.xyz = -r3.www * r0.xyz + r3.xyz;
//    r0.xyz = DynamicCubeMap.SampleLevel(BilinearWrap_s, r0.xyz, 0).xyz;
//    r0.xyz = max(float3(0,0,0), r0.xyz);
//    r0.xyz = min(VAR_CubeMap_clamp, r0.xyz);
//    r2.xzw = VAR_ReflectBrightnessScale * r0.xyz;
//  }
//  r0.x = VAR_FlashLightBrighntness * r1.x;
//  r0.y = VAR_ColorParam.w * r2.y;
//  r0.x = userGlobalParams._m00 * r0.x;
//  r0.z = max(0.0500000007, VAR_MaskLevel);
//  r1.xyz = r2.xzw * r0.www + r1.yzw;
//  r0.x = VAR_use_FlashLight * r0.x;
//  r0.w = LoopMask.Sample(BilinearWrap_s, r5.zw).x;
//  r0.z = cmp(r0.w >= r0.z);
//  r0.z = r0.z ? 1.000000 : 0;
//  r1.xyz = VAR_ColorParam.xyz * r1.xyz;
//  r0.y = r0.y * r0.z;
//  r0.xzw = r0.xxx * float3(8,8,8) + r1.xyz;
//  o0.xyz = r0.xzw * r0.yyy;
//  o0.w = r0.y;
//  o1.x = r0.y;
//  return;
//}
//
///*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.14 on Tue Feb 12 21:56:53 2019
//
//
// Buffer Definitions:
//
// cbuffer SceneInfo
// {
//
//   row_major float4x4 viewProjMat;    // Offset:    0 Size:    64
//   row_major float3x4 transposeViewMat;// Offset:   64 Size:    48 [unused]
//   row_major float3x4 transposeViewInvMat;// Offset:  112 Size:    48
//   float4 projElement[2];             // Offset:  160 Size:    32 [unused]
//   float4 projInvElements[2];         // Offset:  192 Size:    32 [unused]
//   row_major float4x4 viewProjInvMat; // Offset:  224 Size:    64 [unused]
//   row_major float4x4 prevViewProjMat;// Offset:  288 Size:    64 [unused]
//   float3 ZToLinear;                  // Offset:  352 Size:    12 [unused]
//   float subdivisionLevel;            // Offset:  364 Size:     4 [unused]
//   float2 screenSize;                 // Offset:  368 Size:     8
//   float2 screenInverseSize;          // Offset:  376 Size:     8
//   float2 cullingHelper;              // Offset:  384 Size:     8 [unused]
//   float cameraNearPlane;             // Offset:  392 Size:     4 [unused]
//   float cameraFarPlane;              // Offset:  396 Size:     4 [unused]
//   float4 viewFrustum[6];             // Offset:  400 Size:    96 [unused]
//   float4 clipplane;                  // Offset:  496 Size:    16 [unused]
//
// }
//
// cbuffer EnvironmentInfo
// {
//
//   uint timeMillisecond;              // Offset:    0 Size:     4
//   uint frameCount;                   // Offset:    4 Size:     4 [unused]
//   uint isOddFrame;                   // Offset:    8 Size:     4 [unused]
//   uint reserveEnvironmentInfo;       // Offset:   12 Size:     4 [unused]
//   row_major float4x4 userGlobalParams;// Offset:   16 Size:    64
//   float breakingPBRSpecularIntensity;// Offset:   80 Size:     4 [unused]
//   float breakingPBRIBLReflectanceBias;// Offset:   84 Size:     4 [unused]
//   float breakingPBRIBLIntensity;     // Offset:   88 Size:     4 [unused]
//   float breakingPBR_Reserved;        // Offset:   92 Size:     4 [unused]
//
// }
//
// cbuffer UserMaterial
// {
//
//   float4 VAR_ColorParam;             // Offset:    0 Size:    16
//   float VAR_UseGlobalTimer;          // Offset:   16 Size:     4
//   float VAR_BaseHight;               // Offset:   20 Size:     4
//   float VAR_FollowSpeed;             // Offset:   24 Size:     4
//   float VAR_LoopRange;               // Offset:   28 Size:     4
//   float VAR_CubeMap_clamp;           // Offset:   32 Size:     4
//   float VAR_RefractiveIndex_2;       // Offset:   36 Size:     4
//   float VAR_RefractiveIndex_1;       // Offset:   40 Size:     4
//   float VAR_FlashLightBrighntness;   // Offset:   44 Size:     4
//   float VAR_ReflectBrightnessScale;  // Offset:   48 Size:     4
//   float VAR_RainScale;               // Offset:   52 Size:     4
//   float VAR_RainWidth;               // Offset:   56 Size:     4
//   float VAR_MaskLevel;               // Offset:   60 Size:     4
//   float VAR_use_FakeCubeMap;         // Offset:   64 Size:     4
//   float VAR_use_FlashLight;          // Offset:   68 Size:     4
//   float VAR_FlashLightScale;         // Offset:   72 Size:     4
//   float CAPCOM_MATERIAL_RESERVE;     // Offset:   76 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// BilinearWrap                      sampler      NA          NA    0        1
// DynamicCubeMap                    texture  float4        cube    0        1
// DynamicTransparentHDR             texture  float4          2d    1        1
// AlphaMap                          texture  float4          2d    2        1
// NormalMap                         texture  float4          2d    3        1
// LoopMask                          texture  float4          2d    4        1
// SceneInfo                         cbuffer      NA          NA    0        1
// EnvironmentInfo                   cbuffer      NA          NA    1        1
// UserMaterial                      cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy
// INTERPOLATOR             0   xyzw        1     NONE   float   xyzw
// INTERPOLATOR             1   xyzw        2     NONE   float   xyzw
// INTERPOLATOR             2   xyzw        3     NONE   float   xyzw
// INTERPOLATOR             3   xy          4     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
// SV_TARGET                1   x           1   TARGET   float   x
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[24], immediateIndexed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texturecube (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_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v4.xy
dcl_output o0.xyzw
dcl_output o1.x
//dcl_temps 8
dcl_temps 38

dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r26.xyzw, l(0, 0, 0, 0), t120.xyzw

dp3 r0.x, v1.xyzx, v1.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, v1.xyzx
mov r1.x, v2.w
mov r1.yz, v3.xxyx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
mul r2.xyz, r0.zxyz, r1.yzxy
mad r2.xyz, r0.yzxy, r1.zxyz, -r2.xyzx
lt r0.w, v3.z, l(0.000000)
movc r2.xyz, r0.wwww, -r2.xyzx, r2.xyzx
mov r3.x, -cb0[7].w
mov r3.y, -cb0[8].w
mov r3.z, -cb0[9].w
mov r4.x, v3.w
mov r4.yz, v4.xxyx
add r3.xyz, r3.xyzx, r4.xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r3.xyzx
div r4.xy, l(1.000000, 1.000000, 1.000000, 1.000000), cb2[3].zyzz
mul r5.x, r4.x, v1.w
add r0.w, r4.y, r4.y
div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
add r1.w, r4.y, l(-1.000000)
mov r5.yz, v2.xxyx
mad r4.xz, r0.wwww, r1.wwww, r5.xxyx
mad_sat r4.xy, r4.xzxx, r4.yyyy, -r1.wwww
sample_indexable(texture2d)(float,float,float,float) r6.xyz, r4.xyxx, t3.xyzw, s0
mad r7.xyz, r6.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r2.xyzx
mul r2.xyz, r2.xyzx, r7.yyyy
mad r1.xyz, r7.xxxx, r1.xyzx, r2.xyzx
mad r0.xyz, r7.zzzz, r0.xyzx, r1.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
add r1.xyzw, r6.yyxx, l(-0.500000, -0.500000, -0.500000, -0.500000)
mul r2.xy, v0.xyxx, cb0[23].zwzz
mul r6.xyz, cb0[1].xywx, cb1[1].zzzz
mad r6.xyz, cb1[1].yyyy, cb0[0].xywx, r6.xyzx
mad r6.xyz, cb1[1].wwww, cb0[2].xywx, r6.xyzx
add r6.xyz, r6.xyzx, cb0[3].xywx

add r25.w, r6.z, -r25.y
//mul r25.w, r25.w, r26.x
mad r6.x, r25.x, r25.w, r6.x

div r2.zw, r6.xxxy, r6.zzzz
mad r2.zw, r2.zzzw, l(0.000000, 0.000000, 0.500000, -0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
mul r5.x, cb0[23].w, cb0[23].x
mul r1.xyzw, r1.xyzw, cb2[2].yzzy
mad r2.zw, -cb0[23].zzzw, v0.xxxy, r2.zzzw
mul r0.w, cb2[1].w, cb2[1].y
div r0.w, cb2[1].z, r0.w
mov r5.y, l(1.000000)
mul r2.zw, r2.zzzw, r5.xxxy
add r3.w, v2.z, l(-0.500000)
mad r1.xyzw, r1.wxzy, l(1.000000, 1.780000, 1.000000, 1.780000), r2.xyxy
dp2 r2.x, r2.zwzz, r2.zwzz
sqrt r2.x, r2.x
div r0.w, l(1000.000000), r0.w
sample_indexable(texture2d)(float,float,float,float) r2.y, r4.xyxx, t2.yxzw, s0
max r1.xyzw, r1.zwxy, l(0.001000, 0.001000, 0.001000, 0.001000)
div r2.z, r3.w, cb2[1].w
div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), cb2[4].z
mul_sat r2.x, r2.w, r2.x
mad r2.w, r2.x, l(-2.000000), l(3.000000)
mul r2.x, r2.x, r2.x
min r1.xyzw, r1.xyzw, l(0.999000, 0.999000, 0.999000, 0.999000)
utof r3.w, cb1[0].x
div r3.w, r3.w, r0.w
frc r3.w, r3.w
div r0.w, cb1[2].x, r0.w
frc r0.w, r0.w
add r0.w, -r3.w, r0.w
mad r0.w, cb2[1].x, r0.w, r3.w
add r0.w, r2.z, r0.w
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r1.xyxx, t1.xyzw, s0
mad r1.x, -r2.w, r2.x, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r1.yzw, r1.zwzz, t1.wxyz, s0
add r1.yzw, -r4.xxyz, r1.yyzw
mad r1.yzw, r2.yyyy, r1.yyzw, r4.xxyz
add r5.w, r0.w, l(0.500000)
dp3 r0.w, r0.xyzx, -r3.xyzx
add_sat r0.w, r0.w, r0.w
mad r2.x, r0.w, l(-2.000000), l(3.000000)
mul r0.w, r0.w, r0.w
mul r0.w, r0.w, r2.x
lt r2.x, l(0.000000), cb2[4].x
if_nz r2.x
  dp3 r2.x, r3.xyzx, r0.xyzx
  add r2.x, r2.x, r2.x
  mad r2.xzw, -r2.xxxx, r0.zzxy, r3.zzxy
  min r3.w, |r2.z|, |r2.x|
  max r4.x, |r2.z|, |r2.x|
  div r4.x, l(1.000000, 1.000000, 1.000000, 1.000000), r4.x
  mul r3.w, r3.w, r4.x
  mul r4.x, r3.w, r3.w
  mad r4.y, r4.x, l(0.0208350997), l(-0.085133)
  mad r4.y, r4.x, r4.y, l(0.180141)
  mad r4.y, r4.x, r4.y, l(-0.330299497)
  mad r4.x, r4.x, r4.y, l(0.999866)
  mul r4.y, r3.w, r4.x
  lt r4.z, |r2.z|, |r2.x|
  mad r4.y, r4.y, l(-2.000000), l(1.57079637)
  and r4.y, r4.z, r4.y
  mad r3.w, r3.w, r4.x, r4.y
  lt r4.xy, r2.zwzz, -r2.zwzz
  and r4.x, r4.x, l(0xc0490fdb)
  add r3.w, r3.w, r4.x
  min r4.x, r2.z, r2.x
  max r2.x, r2.z, r2.x
  lt r2.z, r4.x, -r4.x
  ge r2.x, r2.x, -r2.x
  and r2.x, r2.x, r2.z
  movc r2.x, r2.x, -r3.w, r3.w
  mul r2.x, r2.x, l(0.159154937)
  frc r5.x, r2.x
  add r2.x, -|r2.w|, l(1.000000)
  sqrt r2.x, r2.x
  mad r2.z, |r2.w|, l(-0.0187292993), l(0.074261)
  mad r2.z, r2.z, |r2.w|, l(-0.212114394)
  mad r2.z, r2.z, |r2.w|, l(1.57072878)
  mul r2.w, r2.x, r2.z
  mad r2.w, r2.w, l(-2.000000), l(3.14159274)
  and r2.w, r4.y, r2.w
  mad r2.x, r2.z, r2.x, r2.w
  mul r5.y, r2.x, l(0.318309873)
  sample_indexable(texture2d)(float,float,float,float) r2.xzw, r5.xyxx, t1.xwyz, s0
  max r2.xzw, r2.xxzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  min r2.xzw, r2.xxzw, cb2[2].xxxx
  mul r2.xzw, r2.xxzw, cb2[3].xxxx
else
  dp3 r3.w, r3.xyzx, r0.xyzx
  add r3.w, r3.w, r3.w
  mad r0.xyz, -r3.wwww, r0.xyzx, r3.xyzx
  sample_l_indexable(texturecube)(float,float,float,float) r0.xyz, r0.xyzx, t0.xyzw, s0, l(0.000000)
  max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  min r0.xyz, r0.xyzx, cb2[2].xxxx
  mul r2.xzw, r0.xxyz, cb2[3].xxxx
endif
mul r0.x, r1.x, cb2[2].w
mul r0.y, r2.y, cb2[0].w
mul r0.x, r0.x, cb1[1].x
max r0.z, cb2[3].w, l(0.050000)
mad r1.xyz, r2.xzwx, r0.wwww, r1.yzwy
mul r0.x, r0.x, cb2[4].y
sample_indexable(texture2d)(float,float,float,float) r0.w, r5.zwzz, t4.yzwx, s0
ge r0.z, r0.w, r0.z
and r0.z, r0.z, l(0x3f800000)
mul r1.xyz, r1.xyzx, cb2[0].xyzx
mul r0.y, r0.z, r0.y
mad r0.xzw, r0.xxxx, l(8.000000, 0.000000, 8.000000, 8.000000), r1.xxyz
mul o0.xyz, r0.yyyy, r0.xzwx
mov o0.w, r0.y
mov o1.x, r0.y
ret
// Approximately 156 instruction slots used

