//6068988c22d07012-ps.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.17672
//
//   using 3Dmigoto v1.2.27 on Sat Feb 06 00:39:09 2016
//
//
// Buffer Definitions: 
//
// cbuffer SceneBuffer
// {
//
//   row_major float4x4 View;           // Offset:    0 Size:    64
//   row_major float4x4 ScreenMatrix;   // Offset:   64 Size:    64 [unused]
//   float2 DepthExportScale;           // Offset:  128 Size:     8 [unused]
//   float2 __padding0;                 // Offset:  136 Size:     8 [unused]
//   float4 FogParams;                  // Offset:  144 Size:    16 [unused]
//   float3 __CameraPosition;           // Offset:  160 Size:    12 [unused]
//   float __padding12;                 // Offset:  172 Size:     4 [unused]
//   float3 CameraDirection;            // Offset:  176 Size:    12 [unused]
//   float __padding9;                  // Offset:  188 Size:     4 [unused]
//   float3 DepthFactors;               // Offset:  192 Size:    12 [unused]
//   float __padding10;                 // Offset:  204 Size:     4 [unused]
//   float3 ShadowDepthBiasAndLightType;// Offset:  208 Size:    12 [unused]
//   float __padding11;                 // Offset:  220 Size:     4 [unused]
//   float4 SubframeViewport;           // Offset:  224 Size:    16 [unused]
//   row_major float3x4 DepthToWorld;   // Offset:  240 Size:    48
//   float4 DepthToView;                // Offset:  288 Size:    16
//   float4 OneOverDepthToView;         // Offset:  304 Size:    16 [unused]
//   float4 DepthToW;                   // Offset:  320 Size:    16 [unused]
//   float4 ClipPlane;                  // Offset:  336 Size:    16 [unused]
//   float2 ViewportDepthScaleOffset;   // Offset:  352 Size:     8 [unused]
//   float2 __padding1;                 // Offset:  360 Size:     8 [unused]
//   float2 ColorDOFDepthScaleOffset;   // Offset:  368 Size:     8 [unused]
//   float2 __padding2;                 // Offset:  376 Size:     8 [unused]
//   float4 TimeVector;                 // Offset:  384 Size:    16
//   float4 FogParams2;                 // Offset:  400 Size:    16 [unused]
//   float4 FogParams3;                 // Offset:  416 Size:    16 [unused]
//   float3 GlobalAmbient;              // Offset:  432 Size:    12 [unused]
//   float __padding8;                  // Offset:  444 Size:     4 [unused]
//   float4 GlobalParams[16];           // Offset:  448 Size:   256 [unused]
//   float4 ViewToFogH;                 // Offset:  704 Size:    16 [unused]
//   float4 ScreenExtents;              // Offset:  720 Size:    16
//   float2 ScreenResolution;           // Offset:  736 Size:     8 [unused]
//   float2 __padding3;                 // Offset:  744 Size:     8 [unused]
//   float4 PSSMToMap1Lin;              // Offset:  752 Size:    16 [unused]
//   float4 PSSMToMap1Const;            // Offset:  768 Size:    16 [unused]
//   float4 PSSMToMap2Lin;              // Offset:  784 Size:    16 [unused]
//   float4 PSSMToMap2Const;            // Offset:  800 Size:    16 [unused]
//   float4 PSSMToMap3Lin;              // Offset:  816 Size:    16 [unused]
//   float4 PSSMToMap3Const;            // Offset:  832 Size:    16 [unused]
//   float4 PSSMDistances;              // Offset:  848 Size:    16 [unused]
//   row_major float4x4 WorldToPSSM0;   // Offset:  864 Size:    64 [unused]
//   row_major float4x4 PrevViewProject;// Offset:  928 Size:    64 [unused]
//   row_major float4x4 PrevWorld;      // Offset:  992 Size:    64 [unused]
//   row_major float4x4 ViewT;          // Offset: 1056 Size:    64 [unused]
//   float4 PSSMExtents;                // Offset: 1120 Size:    16 [unused]
//   float4 ShadowAtlasResolution;      // Offset: 1136 Size:    16 [unused]
//   float4 UnitRimData[3];             // Offset: 1152 Size:    48 [unused]
//   float3 __CameraPositionForCorrection;// Offset: 1200 Size:    12 [unused]
//   float __padding7;                  // Offset: 1212 Size:     4 [unused]
//   row_major float4x4 CameraViewProject;// Offset: 1216 Size:    64 [unused]
//   float4 BackBufferResolution;       // Offset: 1280 Size:    16 [unused]
//   row_major float4x4 InverseProjection;// Offset: 1296 Size:    64 [unused]
//   float4 StereoOffset;               // Offset: 1360 Size:    16 [unused]
//   row_major float4x4 Projection;     // Offset: 1376 Size:    64 [unused]
//   row_major float4x4 ViewInv;        // Offset: 1440 Size:    64 [unused]
//   float4 ColorSSAO;                  // Offset: 1504 Size:    16 [unused]
//   float4 GlobalFogColor;             // Offset: 1520 Size:    16 [unused]
//   float4 VolumetricLightGlobalParams;// Offset: 1536 Size:    16 [unused]
//   float4 SnowParams01;               // Offset: 1552 Size:    16
//   float4 SnowParams02;               // Offset: 1568 Size:    16
//   float4 SnowParams03;               // Offset: 1584 Size:    16
//   int SSREnabled;                    // Offset: 1600 Size:     4 [unused]
//   int __padding4;                    // Offset: 1604 Size:     4 [unused]
//   int __padding5;                    // Offset: 1608 Size:     4 [unused]
//   int __padding6;                    // Offset: 1612 Size:     4 [unused]
//
// }
//
// cbuffer MaterialBuffer
// {
//
//   float4 MaterialParams[512];        // Offset:    0 Size:  8192
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SamplerGenericTrilinearWrap       sampler      NA          NA   11        1
// SamplerGenericBilinearWrap        sampler      NA          NA   12        1
// p_default_Setup_8CD6AD409878073_cp6_Param_texture    texture  float4          2d    0        1
// p_default_Setup_n15_n168_Texture_texture    texture  float4          2d    3        1
// p_default_Setup_n15_n169_Texture_texture    texture  float4          2d    4        1
// p_default_Setup_n15_45BC9410321659_Param_texture    texture  float4          2d    5        1
// p_default_Setup_n5_n106_458FBB301198422_cp2_Param_texture    texture  float4          2d    6        1
// p_default_Setup_n5_n70_Texture_texture    texture  float4          2d    8        1
// p_default_Setup_n5_1BB3530022408697_cp0_Param_texture    texture  float4          2d    9        1
// p_default_Setup_n3_1BB3530022408697_cp0_Param_texture    texture  float4          2d   10        1
// p_default_Setup_n3_n70_Texture_texture    texture  float4          2d   11        1
// p_default_Setup_n5_9075B4F026705685_cp2_Param_texture    texture  float4          2d   12        1
// p_default_Setup_n4_n106_458FBB301198422_cp2_Param_texture    texture  float4          2d   14        1
// p_default_Setup_n4_n70_Texture_texture    texture  float4          2d   17        1
// p_default_Setup_n4_9075B4F026705685_cp2_Param_texture    texture  float4          2d   18        1
// p_default_Setup_n4_1BB3530022408697_cp0_Param_texture    texture  float4          2d   19        1
// p_default_Setup_n4_8B09DC7019763283_cp1_Param_texture    texture  float4          2d   20        1
// SceneBuffer                       cbuffer      NA          NA    2        1
// MaterialBuffer                    cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy w
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float     z 
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// PSIZE                    0   x           4     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 cb2[100], immediateIndexed
dcl_constantbuffer cb3[20], immediateIndexed
dcl_sampler s11, mode_default
dcl_sampler s12, mode_default
dcl_resource_texture2d (float,float,float,float) t0
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) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t14
dcl_resource_texture2d (float,float,float,float) t17
dcl_resource_texture2d (float,float,float,float) t18
dcl_resource_texture2d (float,float,float,float) t19
dcl_resource_texture2d (float,float,float,float) t20
dcl_input_ps_siv linear noperspective v0.xyw, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.z
dcl_input_ps linear v3.xyz
dcl_output o0.xyzw
// dcl_temps 13
dcl_temps 15
dcl_resource_texture2d (float,float,float,float) t125
dp3 r0.x, v3.xyzx, v3.xyzx
rsq r0.x, r0.x
mul r0.yzw, r0.xxxx, v3.xxyz
mad r1.xyzw, v0.xyxy, cb2[45].zwzw, cb2[45].xyxy
mul r2.xyzw, r1.xyzw, v0.wwww
mov r3.xy, r2.xyxx
mov r3.z, v0.w

//Screen space correction, therefore need the '0.5'
ld_indexable(texture2d)(float,float,float,float) r14.xyzw, l(0, 0, 0, 0), t125.xyzw
add r14.w, v0.w, -r14.y
mul r14.w, r14.w, r14.x
mul r14.w, r14.w, l(0.5)
add r3.x, r3.x, -r14.w


mov r3.w, l(1.000000)
dp4 r4.x, cb2[15].xyzw, r3.xyzw
dp4 r4.y, cb2[16].xyzw, r3.xyzw
dp4 r4.z, cb2[17].xyzw, r3.xyzw
mad r1.xy, r1.zwzz, cb2[18].xyxx, cb2[18].zwzz
mul r1.xy, r1.xyxx, v0.wwww
mov r1.z, v0.w

//View space correction, therefore need the InvProj._m00
ld_indexable(texture2d)(float,float,float,float) r14.xyzw, l(0, 0, 0, 0), t125.xyzw
add r14.w, v0.w, -r14.y
mul r14.w, r14.w, r14.x
mul r14.w, r14.w, cb2[81].x
add r1.x, r1.x, -r14.w


dp3 r1.w, -r1.xyzx, -r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, -r1.xyzx
dp3 r5.x, r1.xyzx, cb2[0].xyzx
dp3 r5.y, r1.xyzx, cb2[1].xyzx
dp3 r5.z, r1.xyzx, cb2[2].xyzx
deriv_rty_fine r1.xy, v1.xyxx
deriv_rtx_fine r2.xy, v1.xyxx
mov r3.xy, r2.zwzz
dp4 r1.w, cb2[15].xyzw, r3.xyzw
dp4 r2.z, cb2[16].xyzw, r3.xyzw
dp4 r2.w, cb2[17].xyzw, r3.xyzw
deriv_rty_fine r3.x, r1.w
deriv_rty_fine r3.yz, r2.zzwz
deriv_rtx_fine r6.z, r1.w
deriv_rtx_fine r6.xy, r2.zwzz
mul r7.xyzw, v1.zwxy, cb3[13].zwxy
sample_indexable(texture2d)(float,float,float,float) r2.zw, r7.xyxx, t0.ywxz, s11
dp3 r1.w, r6.zxyz, r0.yzwy
mad r6.xyz, -r1.wwww, r0.zwyz, r6.xyzx
dp3 r1.w, r3.xyzx, r0.yzwy
mad r3.xyz, -r1.wwww, r0.yzwy, r3.xyzx
mul r1.x, r1.x, r2.y
mad r1.x, r2.x, r1.y, -r1.x
lt r1.w, r1.x, l(0.000000)
movc r1.w, r1.w, l(-1.000000), l(1.000000)
mov r1.z, -r2.y
mul r1.yz, r1.yyzy, r1.wwww
mul r8.xyz, r1.zzzz, r3.xyzx
mad r8.xyz, r6.zxyz, r1.yyyy, r8.xyzx
lt r1.x, l(0.000000), |r1.x|
dp3 r1.y, r8.xyzx, r8.xyzx
rsq r1.y, r1.y
mul r9.xyz, r1.yyyy, r8.xyzx
movc r1.xyz, r1.xxxx, r9.xyzx, r8.xyzx
mul r8.xyz, r0.wyzw, r1.yzxy
mad r8.xyz, r0.zwyz, r1.zxyz, -r8.xyzx
mul r9.xyz, r0.wyzw, r6.xyzx
mad r6.xyz, r0.zwyz, r6.yzxy, -r9.xyzx
dp3 r2.x, r3.xyzx, r6.xyzx
lt r2.x, r2.x, l(0.000000)
movc r2.x, r2.x, l(-1.000000), l(1.000000)
mul r1.w, r1.w, r2.x
mul r3.xyz, r1.wwww, r8.xyzx
mul r6.xyzw, v1.xyxy, cb3[11].xyzw
mul r8.xyzw, v1.xyxy, cb3[14].zwxy
sample_indexable(texture2d)(float,float,float,float) r1.w, r8.xyxx, t11.xzwy, s11
sample_indexable(texture2d)(float,float,float,float) r2.xy, r6.xyxx, t10.xyzw, s11
mad r2.xy, r2.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r6.xy, r2.xyxx, r2.xyxx
mad r3.w, -r2.x, r2.x, l(1.000000)
mad r3.w, -r2.y, r2.y, r3.w
max r4.w, r6.y, r6.x
mul r4.w, r4.w, l(0.0000610351563)
max r3.w, r3.w, r4.w
rsq r3.w, r3.w
mul r2.xy, r2.xyxx, -r3.wwww
add r3.w, cb3[16].z, -cb3[18].x
mad r1.w, r1.w, r3.w, cb3[18].x
mul r2.xy, r2.xyxx, cb3[15].wwww
add_sat r3.w, cb3[15].x, cb3[15].y
add r1.w, r1.w, l(-1.000000)
mad r1.w, r3.w, r1.w, l(1.000000)
mul r6.xy, r2.xyxx, r3.wwww
dp3 r4.w, r5.xyzx, r0.yzwy
mul r5.zw, r0.yyyz, r4.wwww
mad r5.xy, r5.zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), -r5.xyxx
mul r5.xy, r5.xyxx, cb3[18].zzzz
mul r9.xyzw, v1.xyxy, cb3[7].zwxy
sample_indexable(texture2d)(float,float,float,float) r4.w, r9.xyxx, t20.yzwx, s11
mul r10.xyzw, v1.xyxy, cb3[8].zwxy
sample_indexable(texture2d)(float,float,float,float) r5.z, r10.zwzz, t17.xzyw, s11
sample_indexable(texture2d)(float,float,float,float) r9.y, r9.zwzz, t18.yxzw, s11
mul r4.w, r4.w, cb3[18].y
sample_indexable(texture2d)(float,float,float,float) r7.xy, r10.xyxx, t19.xyzw, s11
mad r7.xy, r7.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r5.w, -cb3[16].y, cb3[16].w
mad r5.z, r5.z, r5.w, cb3[16].y
mul r8.xy, r7.xyxx, r7.xyxx
mad r5.w, -r7.x, r7.x, l(1.000000)
mad r5.w, -r7.y, r7.y, r5.w
max r8.x, r8.y, r8.x
mul r8.x, r8.x, l(0.0000610351563)
max r5.w, r5.w, r8.x
rsq r5.w, r5.w
mul r7.xy, r7.xyxx, -r5.wwww
sample_indexable(texture2d)(float,float,float,float) r5.x, r5.xyxx, t20.yxzw, s11
mul r5.yw, cb2[24].xxxx, cb3[10].zzzw
mad r5.yw, v1.xxxy, cb3[9].zzzw, r5.yyyw
sample_indexable(texture2d)(float,float,float,float) r5.yw, r5.ywyy, t14.zxwy, s11
mad r5.yw, r5.yyyw, l(0.000000, 2.000000, 0.000000, 2.000000), l(0.000000, -1.000000, 0.000000, -1.000000)
mul r8.xy, r5.ywyy, r5.ywyy
mad r9.w, -r5.y, r5.y, l(1.000000)
mad r9.w, -r5.w, r5.w, r9.w
max r8.x, r8.y, r8.x
mul r8.x, r8.x, l(0.0000610351563)
max r8.x, r8.x, r9.w
rsq r8.x, r8.x
mul r5.yw, r5.yyyw, -r8.xxxx
mul r5.yw, r5.yyyw, cb3[19].yyyy
mad r5.yw, r7.xxxy, cb3[17].yyyy, r5.yyyw
mul_sat r4.w, r4.w, r5.x
add r5.x, -r5.z, cb3[17].z
mad r4.w, r4.w, r5.x, r5.z
mad_sat r9.x, r2.w, cb3[19].x, cb3[17].x
mov r9.z, l(1.000000)
dp3_sat r2.w, cb3[5].xyzx, r9.xyzx
mad r2.xy, -r3.wwww, r2.xyxx, r5.ywyy
mad r2.xy, r2.wwww, r2.xyxx, r6.xyxx
add r3.w, -r1.w, r4.w
mad r1.w, r2.w, r3.w, r1.w
mul r5.xy, v1.xyxx, cb3[12].zwzz
sample_indexable(texture2d)(float,float,float,float) r8.y, r8.zwzz, t12.yxzw, s11
sample_indexable(texture2d)(float,float,float,float) r2.w, r7.zwzz, t8.xzwy, s11
sample_indexable(texture2d)(float,float,float,float) r5.xy, r5.xyxx, t9.xyzw, s11
mad r5.xy, r5.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r3.w, -cb3[15].z, cb3[18].w
mad r2.w, r2.w, r3.w, cb3[15].z
mul r5.zw, r5.xxxy, r5.xxxy
mad r3.w, -r5.x, r5.x, l(1.000000)
mad r3.w, -r5.y, r5.y, r3.w
max r4.w, r5.w, r5.z
mul r4.w, r4.w, l(0.0000610351563)
max r3.w, r3.w, r4.w
rsq r3.w, r3.w
mul r5.xy, r5.xyxx, -r3.wwww
mad r5.zw, cb2[24].xxxx, cb3[6].zzzw, r6.zzzw
sample_indexable(texture2d)(float,float,float,float) r5.zw, r5.zwzz, t6.zwxy, s11
mad r5.zw, r5.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mul r6.xy, r5.zwzz, r5.zwzz
mad r3.w, -r5.z, r5.z, l(1.000000)
mad r3.w, -r5.w, r5.w, r3.w
max r4.w, r6.y, r6.x
mul r4.w, r4.w, l(0.0000610351563)
max r3.w, r3.w, r4.w
rsq r3.w, r3.w
mul r5.zw, r5.zzzw, -r3.wwww
mul r5.zw, r5.zzzw, cb3[16].xxxx
mad r5.xy, r5.xyxx, cb3[5].wwww, r5.zwzz
mad_sat r8.x, r2.z, cb3[4].w, cb3[3].w
mov r8.z, l(1.000000)
dp3_sat r2.z, cb3[4].xyzx, r8.xyzx
add r2.w, -r1.w, r2.w
mad r1.w, r2.z, r2.w, r1.w
add r5.xy, -r2.xyxx, r5.xyxx
mad r2.xy, r2.zzzz, r5.xyxx, r2.xyxx
mul r2.yzw, r3.xxyz, r2.yyyy
mad r2.xyz, r2.xxxx, r1.xyzx, r2.yzwy
mad r2.xyz, v3.xyzx, r0.xxxx, -r2.xyzx
dp3 r0.x, r2.xyzx, r2.xyzx
rsq r0.x, r0.x
mul r2.xyz, r0.xxxx, r2.xyzx
mul r5.xy, v1.xyxx, cb3[6].xyxx
sample_indexable(texture2d)(float,float,float,float) r5.zw, r5.xyxx, t4.zwxy, s11
mad r6.xy, r5.zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.x, r6.xyxx, r6.xyxx
add r0.x, -r0.x, l(1.000000)
max r0.x, r0.x, l(0.000000)
sqrt r6.z, r0.x
sample_indexable(texture2d)(float,float,float,float) r5.xy, r5.xyxx, t3.xyzw, s11
mad r5.xy, r5.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.x, r5.xyxx, r5.xyxx
add r0.x, -r0.x, l(1.000000)
max r0.x, r0.x, l(0.000000)
sqrt r5.z, r0.x
add r7.xy, cb2[98].xyxx, l(3072.000000, 3072.000000, 0.000000, 0.000000)
add_sat r8.xyz, r4.xyzx, -cb2[98].xyzx
mul r0.x, r8.y, r8.x
mul r0.x, r8.z, r0.x
eq r0.x, r0.x, l(0.000000)
add_sat r4.zw, -r4.xxxy, r7.xxxy
mul r3.w, r4.w, r4.z
eq r3.w, r3.w, l(0.000000)
or r0.x, r0.x, r3.w
mul r4.zw, r4.xxxy, l(0.000000, 0.000000, 0.000325520843, 0.000325520843)
mad r7.xyzw, r4.xyxy, l(0.000325520843, 0.000325520843, 0.000325520843, 0.000325520843), l(-0.000488281250, -0.000000, 0.000488281250, 0.000000)
mad r8.xyzw, r4.xyxy, l(0.000325520843, 0.000325520843, 0.000325520843, 0.000325520843), l(-0.000000, -0.000488281250, 0.000000, 0.000488281250)
sample_indexable(texture2d)(float,float,float,float) r4.xy, r7.xyxx, t5.xyzw, s12
sample_indexable(texture2d)(float,float,float,float) r7.xy, r7.zwzz, t5.xyzw, s12
sample_indexable(texture2d)(float,float,float,float) r7.zw, r8.xyxx, t5.zwxy, s12
sample_indexable(texture2d)(float,float,float,float) r8.xw, r8.zwzz, t5.yzwx, s12
sample_indexable(texture2d)(float,float,float,float) r4.zw, r4.zwzz, t5.zwxy, s12
if_z r0.x
  add r0.x, v2.z, -cb2[98].z
  mov r9.x, r4.y
  mov r9.yz, r7.yywy
  mov r9.w, r8.x
  mad r9.xyzw, r9.xyzw, l(8192.000000, 8192.000000, 8192.000000, 8192.000000), cb2[99].xxxx
  mov r8.x, r4.x
  mov r8.yz, r7.xxzx
  mad r7.xyzw, r8.xyzw, l(1024.000000, 1024.000000, 1024.000000, 1024.000000), cb2[99].yyyy
  mad r4.xy, r4.wzww, l(8192.000000, 1024.000000, 0.000000, 0.000000), cb2[99].xyxx
  add r8.xyzw, -r7.xyzw, r9.xyzw
  add r9.xyzw, r0.xxxx, -r8.xyzw
  add r3.w, r8.y, r8.x
  add r3.w, r8.z, r3.w
  add r3.w, r8.w, r3.w
  mad r8.xyzw, -r3.wwww, l(0.250000, 0.250000, 0.250000, 0.250000), r8.xyzw
  add_sat r8.xyzw, r8.xyzw, cb2[99].wwww
  mov_sat r10.xyzw, r9.xyzw
  mul r4.zw, r10.zzzw, r10.xxxy
  mul r3.w, r4.w, r4.z
  eq r3.w, r3.w, l(0.000000)
  add_sat r10.xyzw, -r9.xyzw, l(150.000000, 150.000000, 150.000000, 150.000000)
  mul r4.zw, r10.zzzw, r10.xxxy
  mul r4.z, r4.w, r4.z
  eq r4.z, r4.z, l(0.000000)
  or r3.w, r3.w, r4.z
  mul r4.zw, r8.zzzw, r8.xxxy
  mul r4.z, r4.w, r4.z
  eq r4.z, r4.z, l(0.000000)
  or r3.w, r3.w, r4.z
  mul r8.xyzw, r9.xyzw, l(0.400000, 0.400000, 0.400000, 0.400000)
  mul r10.xyzw, r9.xyzw, l(0.200000, 0.200000, 0.200000, 0.200000)
  mul r11.xyzw, r9.xyzw, cb2[97].xxxx
  sqrt r11.xyzw, r11.xyzw
  mul r12.xyzw, r7.xyzw, cb2[97].xxxx
  sqrt r12.xyzw, r12.xyzw
  add r11.xyzw, -r11.xyzw, r12.xyzw
  mul r11.xyzw, r11.xyzw, cb2[97].yyyy
  mul r11.xyzw, r11.xyzw, l(3.000000, 3.000000, 3.000000, 3.000000)
  div_sat r8.xyzw, r11.xyzw, r8.xyzw
  add r8.xyzw, r8.xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000)
  add r8.xyzw, r8.xyzw, r8.xyzw
  mad r8.xyzw, -r8.xyzw, r8.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  add r7.xyzw, -r7.xyzw, r9.xyzw
  max r7.xyzw, r7.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mad r7.xyzw, r8.xyzw, r10.xyzw, -r7.xyzw
  add r4.zw, -r7.xxxz, r7.yyyw
  mul r7.xy, r4.zwzz, l(3.000000, 3.000000, 0.000000, 0.000000)
  mov r7.z, l(0)
  add r7.xyz, -r7.xyzx, l(0.000000, 0.000000, 9.000000, 0.000000)
  dp3 r4.z, r7.xyzx, r7.xyzx
  rsq r4.z, r4.z
  mad r7.xyz, r7.xyzx, r4.zzzz, l(0.000000, 0.000000, 1.000000, 0.000000)
  mul r8.xyz, r2.xyzx, l(-1.000000, -1.000000, 1.000000, 0.000000)
  dp3 r4.z, r7.xyzx, r8.xyzx
  mul r8.xyz, r7.zzzz, r8.xyzx
  mad r7.xyz, r7.xyzx, r4.zzzz, -r8.xyzx
  dp3 r4.z, r7.xyzx, r7.xyzx
  rsq r4.z, r4.z
  mul r7.xyz, r4.zzzz, r7.xyzx
  add r4.x, -r4.y, r4.x
  add r0.x, r0.x, -r4.x
  mul r4.x, r0.x, l(0.400000)
  mul r4.z, r0.x, cb2[97].x
  mul r4.w, r4.y, cb2[97].x
  sqrt r4.zw, r4.zzzw
  add r4.z, -r4.z, r4.w
  mul r4.z, r4.z, cb2[97].y
  mul r4.z, r4.z, l(3.000000)
  div_sat r4.x, r4.z, r4.x
  div_sat r0.x, r4.y, r0.x
  add r7.w, r4.x, r0.x
  mov r2.w, l(2.000000)
  movc r2.xyzw, r3.wwww, r2.xyzw, r7.xyzw
else 
  mov r2.w, l(2.000000)
endif 
lt r0.x, r2.w, l(2.000000)
mul r2.w, r2.w, l(0.500000)
add r4.xyz, -r6.xyzx, r5.xyzx
mad r4.xyz, r2.wwww, r4.xyzx, r6.xyzx
dp3 r2.w, r4.xyzx, r4.xyzx
rsq r2.w, r2.w
mul r4.xyz, r2.wwww, r4.xyzx
movc r4.xyz, r0.xxxx, r4.xyzx, l(0,0,1.000000,0)
and r0.x, r0.x, cb3[17].w
mul r3.xyz, r3.xyzx, r4.yyyy
mad r1.xyz, r4.xxxx, r1.xyzx, r3.xyzx
mad r0.yzw, r4.zzzz, r0.yyzw, r1.xxyz
dp3 r0.w, r0.yzwy, r0.yzwy
rsq r0.w, r0.w
mul r0.yz, r0.wwww, r0.yyzy
mul r0.xy, r0.yzyy, r0.xxxx
mov r0.z, l(0)
add r0.xyz, r0.xyzx, r2.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul o0.xyz, r0.wwww, r0.xyzx
max r0.x, r1.w, l(2.000000)
log r0.x, r0.x
add r0.x, r0.x, l(-1.000000)
mul r0.x, r0.x, l(0.0833333358)
min o0.w, r0.x, l(1.000000)
ret 
// Approximately 300 instruction slots used
