// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:26 2016

cbuffer cbLightAccParam : register(b0)
{
  float4x4 g_InvProjMatrix : packoffset(c0);
  float4x3 g_ViewMatrix : packoffset(c4);
  float4 g_ScreenSize : packoffset(c7);
  float4x4 g_CameraMatrix : packoffset(c8);
  float4 g_specPowerParam : packoffset(c12);
  float4x4 g_ProjMatrix : packoffset(c13);
  uint g_lightCount : packoffset(c17);
  bool g_visualizeLightCount : packoffset(c17.y);
  uint g_spotLightCount : packoffset(c17.z);
  uint g_lineLightCount : packoffset(c17.w);
  float g_frustumNear : packoffset(c18);
  float g_frustumFar : packoffset(c18.y);
  float g_frustumSliceScale : packoffset(c18.z);
  float g_frustumSliceBias : packoffset(c18.w);
  uint4 g_lightTileSize : packoffset(c19);
}

cbuffer cbLightAccShadowInfo : register(b2)
{
  float4 g_aShadowMapInfo : packoffset(c0);
}

cbuffer cbLightAccLightParam : register(b1)
{

  struct
  {
    float4 PositionAndRange;
    float4 DiffColor;
    float4 SpecColor;
    float3 TransLightParam;
    float ShadingMode;
    float4x4 ViewToLightSpaceMatrix;
    float4 ShadowParam;
    float4 ViewportScaleOffset;
  } g_aSpotLight : packoffset(c0);

}

SamplerState SS_WrapLinear_s : register(s8);
SamplerComparisonState SS_Shadow_s : register(s12);
Texture2D<float4> g_LightPrepassAttrTexture : register(t0);
Texture2D<float4> g_DepthTexture : register(t1);
Texture2D<float4> g_GBuffer1Texture : register(t3);
Texture2D<float4> g_GBuffer3Texture : register(t5);
Texture2D<float4> g_LightShadowTexture_0_ : register(t7);
Texture2D<float4> g_SSAOTexture : register(t33);


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


void main( 
  float4 v0 : SV_POSITION0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  out float4 o0 : SV_TARGET0,
  out float4 o1 : SV_TARGET1)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.zw = float2(1,1);
  r1.xy = (uint2)v0.xy;
  r1.zw = float2(0,0);
  r2.z = g_DepthTexture.Load(r1.xyw).x;
  r2.w = 1;
  r2.xy = v2.xy / v2.ww;
  r3.x = dot(r2.xyzw, g_InvProjMatrix._m00_m10_m20_m30);
  r3.y = dot(r2.xyzw, g_InvProjMatrix._m01_m11_m21_m31);
  r3.z = dot(r2.xyzw, g_InvProjMatrix._m02_m12_m22_m32);
  r2.z = dot(r2.xyzw, g_InvProjMatrix._m03_m13_m23_m33);
  r2.xy = r2.xy * float2(0.5,-0.5) + float2(0.5,0.5);
  r2.x = g_SSAOTexture.Sample(SS_WrapLinear_s, r2.xy).x;
  r3.xyz = r3.xyz / r2.zzz;
  r3.w = 1;
  r4.x = dot(r3.xyzw, g_aSpotLight.ViewToLightSpaceMatrix._m00_m10_m20_m30);
  r4.y = dot(r3.xyzw, g_aSpotLight.ViewToLightSpaceMatrix._m01_m11_m21_m31);
  r4.w = dot(r3.xyzw, g_aSpotLight.ViewToLightSpaceMatrix._m03_m13_m23_m33);
  r4.z = dot(r3.xyzw, g_aSpotLight.ViewToLightSpaceMatrix._m02_m12_m22_m32);
  r2.yz = r4.xy / r4.ww;
  r4.xy = g_aSpotLight.ViewportScaleOffset.xy * r4.xy;
  r2.y = dot(r2.yz, r2.yz);
  r2.y = 1 + -r2.y;
  r5.y = max(0, r2.y);
  r0.y = r5.y * r5.y;
  r2.y = g_aSpotLight.PositionAndRange.w * g_aSpotLight.PositionAndRange.w;
  r2.y = 1 / r2.y;
  r6.xyz = g_aSpotLight.PositionAndRange.xyz + -r3.xyz;
  r2.z = dot(r6.xyz, r6.xyz);
  r2.w = r2.z * r2.y;
  r2.w = min(1, r2.w);
  r5.z = 1 + -r2.w;
  r5.x = 1 / r2.z;
  r2.z = rsqrt(r2.z);
  r6.xyz = r6.xyz * r2.zzz;
  r2.y = r5.x + -r2.y;
  r5.w = max(0, r2.y);
  r2.y = r4.w / g_aSpotLight.PositionAndRange.w;
  r2.y = saturate(1 + -r2.y);
  r0.x = r2.y * r2.y;
  r2.y = cmp(0 < g_aSpotLight.ShadingMode);
  r0.xyzw = r2.yyyy ? r5.xyzw : r0.xyzw;
  r0.xyz = r0.yyy * r0.wzx;
  r0.w = 32 * g_aSpotLight.TransLightParam.y;
  r2.z = dot(r3.xyz, r3.xyz);
  r2.z = rsqrt(r2.z);
  r5.xyz = r3.xyz * r2.zzz;
  r2.z = saturate(dot(r6.xyz, r5.xyz));
  r2.z = log2(r2.z);
  r0.w = r2.z * r0.w;
  r0.w = exp2(r0.w);
  r7.xyz = g_LightPrepassAttrTexture.Load(r1.xyw).xyz;
  r7.xyz = r7.xyz * float3(2,2,2) + float3(-1,-1,-1);
  r2.z = dot(r7.xyz, r7.xyz);
  r2.z = rsqrt(r2.z);
  r7.xyz = r7.xyz * r2.zzz;
  r8.x = dot(r7.xyz, g_ViewMatrix._m00_m10_m20);
  r8.y = dot(r7.xyz, g_ViewMatrix._m01_m11_m21);
  r8.z = dot(r7.xyz, g_ViewMatrix._m02_m12_m22);
  r2.z = dot(-r5.xyz, r8.xyz);
  r2.z = 1 + r2.z;
  r2.z = max(0, r2.z);
  r2.z = 0.5 * r2.z;
  r2.z = r2.z * r2.z;
  r0.w = r2.z * r0.w;
  r0.w = g_aSpotLight.TransLightParam.x * r0.w;
  r7.xyz = g_aSpotLight.DiffColor.xyz * r0.www;
  r2.zw = g_GBuffer1Texture.Load(r1.xyz).xy;
  r1.xyz = g_GBuffer3Texture.Load(r1.xyw).xyz;
  r1.xyz = r1.xyz * r1.xyz;
  r9.xy = float2(10,13) * r2.wz;
  r7.xyz = r9.xxx * r7.xyz;
  r0.w = exp2(r9.y);
  r9.xyz = r7.xyz * r0.xxx;
  r7.xyz = r7.xyz * r0.zzz;
  r1.w = cmp(0 < r4.z);
  r10.xy = g_aSpotLight.ViewportScaleOffset.zw * r4.ww;
  r10.zw = float2(0,0);
  r4.xyzw = r10.xyzw + r4.xyzw;
  r10.xyzw = g_aShadowMapInfo.zwzw * r4.wwww;
  r11.xyzw = r10.zwzw * float4(-0.5,-0.5,0,0) + r4.xyzw;
  r11.xyz = r11.xyz / r11.www;
  r11.x = g_LightShadowTexture_0_.SampleCmpLevelZero(SS_Shadow_s, r11.xy, r11.z).x;
  r12.xyzw = r10.zwzw * float4(0.5,-0.5,0,0) + r4.xyzw;
  r12.xyz = r12.xyz / r12.www;
  r11.y = g_LightShadowTexture_0_.SampleCmpLevelZero(SS_Shadow_s, r12.xy, r12.z).x;
  r12.xyzw = r10.zwzw * float4(-0.5,0.5,0,0) + r4.xyzw;
  r4.xyzw = r10.xyzw * float4(0.5,0.5,0,0) + r4.xyzw;
  r4.xyz = r4.xyz / r4.www;
  r11.w = g_LightShadowTexture_0_.SampleCmpLevelZero(SS_Shadow_s, r4.xy, r4.z).x;
  r4.xyz = r12.xyz / r12.www;
  r11.z = g_LightShadowTexture_0_.SampleCmpLevelZero(SS_Shadow_s, r4.xy, r4.z).x;
  r2.z = dot(r11.xyzw, float4(0.25,0.25,0.25,0.25));
  r2.z = -1 + r2.z;
  r2.z = g_aSpotLight.ShadowParam.x * r2.z + 1;
  r3.w = r2.w * 20 + 1;
  r4.x = dot(r6.xyz, r8.xyz);
  r4.y = r2.w * 10 + r4.x;
  r4.x = saturate(r4.x);
  r2.w = cmp(r2.w == 0.000000);
  r4.y = max(0, r4.y);
  r3.w = r4.y / r3.w;
  r4.yzw = g_aSpotLight.DiffColor.xyz * r3.www;
  r10.xyz = r4.yzw * r2.zzz;
  r4.yzw = r4.yzw * r0.zzz;
  r4.yzw = r4.yzw * r2.zzz + r7.xyz;
  r7.xyz = r10.xyz * r0.xxx + r9.xyz;
  r9.xyz = g_aSpotLight.DiffColor.xyz * r4.xxx;
  r3.w = log2(r4.x);
  r3.w = 0.100000001 * r3.w;
  r3.w = exp2(r3.w);
  r10.xyz = r9.xyz * r2.zzz;
  r10.xyz = r10.xyz * r0.xxx;
  r7.xyz = r2.www ? r10.xyz : r7.xyz;
  r0.x = r2.z * r0.z;
  r9.xyz = r9.xyz * r0.xxx;
  r4.xyz = r2.www ? r9.xyz : r4.yzw;
  r4.xyz = r2.yyy ? r7.xyz : r4.xyz;
  r4.xyz = r1.www ? r4.xyz : 0;
  r7.xyz = -r1.xyz * float3(0.5,0.5,0.5) + float3(1,1,1);
  r4.xyz = r7.xyz * r4.xyz;
  o0.xyz = r4.xyz * r2.xxx;
  o0.w = 1;
  r0.x = dot(r5.xyz, r8.xyz);
  r0.x = r0.x + r0.x;
  r4.xyz = r8.xyz * -r0.xxx + r5.xyz;
  r0.x = saturate(dot(r6.xyz, r4.xyz));
  r0.x = log2(r0.x);
  r2.w = g_aSpotLight.DiffColor.w * r0.w;
  r0.w = r0.w * 0.00999999978 + g_aSpotLight.DiffColor.w;
  r0.w = r2.w / r0.w;
  r0.w = max(1, r0.w);
  r2.w = 0.25 * r0.w;
  r0.x = r2.w * r0.x;
  r0.x = exp2(r0.x);
  r2.w = r0.w * 0.125 + 0.25;
  r0.x = r2.w * r0.x;
  r4.xyz = g_aSpotLight.SpecColor.xyz * r0.xxx;
  r4.xyz = r4.xyz * r2.zzz;
  r4.xyz = r4.xyz * r0.zzz;
  r0.x = dot(-r3.xyz, -r3.xyz);
  r0.x = rsqrt(r0.x);
  r3.xyz = -r3.xyz * r0.xxx + r6.xyz;
  r0.x = dot(r3.xyz, r3.xyz);
  r0.x = rsqrt(r0.x);
  r3.xyz = r3.xyz * r0.xxx;
  r0.x = saturate(dot(r3.xyz, r8.xyz));
  r0.x = log2(r0.x);
  r0.x = r0.w * r0.x;
  r0.x = exp2(r0.x);
  r0.xzw = g_aSpotLight.SpecColor.xyz * r0.xxx;
  r0.xzw = r0.xzw * r3.www;
  r0.xzw = r0.xzw * r2.zzz;
  r0.xyz = r0.xzw * r0.yyy;
  r0.xyz = r0.xyz * r2.www;
  r0.xyz = r2.yyy ? r0.xyz : r4.xyz;
  r0.xyz = r1.www ? r0.xyz : 0;
  r0.xyz = r0.xyz * r1.xyz;
  o1.xyz = r0.xyz * r2.xxx;
  o1.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbLightAccParam
// {
//
//   float4x4 g_InvProjMatrix;          // Offset:    0 Size:    64
//   float4x3 g_ViewMatrix;             // Offset:   64 Size:    48
//   float4 g_ScreenSize;               // Offset:  112 Size:    16 [unused]
//   float4x4 g_CameraMatrix;           // Offset:  128 Size:    64 [unused]
//   float4 g_specPowerParam;           // Offset:  192 Size:    16 [unused]
//   float4x4 g_ProjMatrix;             // Offset:  208 Size:    64 [unused]
//   uint g_lightCount;                 // Offset:  272 Size:     4 [unused]
//   bool g_visualizeLightCount;        // Offset:  276 Size:     4 [unused]
//   uint g_spotLightCount;             // Offset:  280 Size:     4 [unused]
//   uint g_lineLightCount;             // Offset:  284 Size:     4 [unused]
//   float g_frustumNear;               // Offset:  288 Size:     4 [unused]
//   float g_frustumFar;                // Offset:  292 Size:     4 [unused]
//   float g_frustumSliceScale;         // Offset:  296 Size:     4 [unused]
//   float g_frustumSliceBias;          // Offset:  300 Size:     4 [unused]
//   uint4 g_lightTileSize;             // Offset:  304 Size:    16 [unused]
//
// }
//
// cbuffer cbLightAccShadowInfo
// {
//
//   float4 g_aShadowMapInfo;           // Offset:    0 Size:    16
//
// }
//
// cbuffer cbLightAccLightParam
// {
//
//   struct SpotLight
//   {
//       
//       float4 PositionAndRange;       // Offset:    0
//       float4 DiffColor;              // Offset:   16
//       float4 SpecColor;              // Offset:   32
//       float3 TransLightParam;        // Offset:   48
//       float ShadingMode;             // Offset:   60
//       float4x4 ViewToLightSpaceMatrix;// Offset:   64
//       float4 ShadowParam;            // Offset:  128
//       float4 ViewportScaleOffset;    // Offset:  144
//
//   } g_aSpotLight;                    // Offset:    0 Size:   160
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_WrapLinear                     sampler      NA          NA    8        1
// SS_Shadow                       sampler_c      NA          NA   12        1
// g_LightPrepassAttrTexture         texture  float4          2d    0        1
// g_DepthTexture                    texture  float4          2d    1        1
// g_GBuffer1Texture                 texture  float4          2d    3        1
// g_GBuffer3Texture                 texture  float4          2d    5        1
// g_LightShadowTexture[0]           texture  float4          2d    7        1
// g_SSAOTexture                     texture  float4          2d   33        1
// cbLightAccParam                   cbuffer      NA          NA    0        1
// cbLightAccLightParam              cbuffer      NA          NA    1        1
// cbLightAccShadowInfo              cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy  
// TEXCOORD                 0   xy          1     NONE   float       
// TEXCOORD                 1   xyzw        2     NONE   float   xy w
//
//
// 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
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[7], immediateIndexed
dcl_constantbuffer cb2[1], immediateIndexed
dcl_constantbuffer cb1[10], immediateIndexed
dcl_sampler s8, mode_default
dcl_sampler s12, mode_comparison
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t33
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v2.xyw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 13
mov r0.zw, l(0,0,1.000000,1.000000)
ftou r1.xy, v0.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r2.z, r1.xyww, t1.yzxw
mov r2.w, l(1.000000)
div r2.xy, v2.xyxx, v2.wwww
dp4 r3.x, r2.xyzw, cb0[0].xyzw
dp4 r3.y, r2.xyzw, cb0[1].xyzw
dp4 r3.z, r2.xyzw, cb0[2].xyzw
dp4 r2.z, r2.xyzw, cb0[3].xyzw
mad r2.xy, r2.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t33.xyzw, s8
div r3.xyz, r3.xyzx, r2.zzzz
mov r3.w, l(1.000000)
dp4 r4.x, r3.xyzw, cb1[4].xyzw
dp4 r4.y, r3.xyzw, cb1[5].xyzw
dp4 r4.w, r3.xyzw, cb1[7].xyzw
dp4 r4.z, r3.xyzw, cb1[6].xyzw
div r2.yz, r4.xxyx, r4.wwww
mul r4.xy, r4.xyxx, cb1[9].xyxx
dp2 r2.y, r2.yzyy, r2.yzyy
add r2.y, -r2.y, l(1.000000)
max r5.y, r2.y, l(0.000000)
mul r0.y, r5.y, r5.y
mul r2.y, cb1[0].w, cb1[0].w
div r2.y, l(1.000000, 1.000000, 1.000000, 1.000000), r2.y
add r6.xyz, -r3.xyzx, cb1[0].xyzx
dp3 r2.z, r6.xyzx, r6.xyzx
mul r2.w, r2.y, r2.z
min r2.w, r2.w, l(1.000000)
add r5.z, -r2.w, l(1.000000)
div r5.x, l(1.000000, 1.000000, 1.000000, 1.000000), r2.z
rsq r2.z, r2.z
mul r6.xyz, r2.zzzz, r6.xyzx
add r2.y, -r2.y, r5.x
max r5.w, r2.y, l(0.000000)
div r2.y, r4.w, cb1[0].w
add_sat r2.y, -r2.y, l(1.000000)
mul r0.x, r2.y, r2.y
lt r2.y, l(0.000000), cb1[3].w
movc r0.xyzw, r2.yyyy, r5.xyzw, r0.xyzw
mul r0.xyz, r0.wzxw, r0.yyyy
mul r0.w, cb1[3].y, l(32.000000)
dp3 r2.z, r3.xyzx, r3.xyzx
rsq r2.z, r2.z
mul r5.xyz, r2.zzzz, r3.xyzx
dp3_sat r2.z, r6.xyzx, r5.xyzx
log r2.z, r2.z
mul r0.w, r0.w, r2.z
exp r0.w, r0.w
ld_indexable(texture2d)(float,float,float,float) r7.xyz, r1.xyww, t0.xyzw
mad r7.xyz, r7.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r2.z, r7.xyzx, r7.xyzx
rsq r2.z, r2.z
mul r7.xyz, r2.zzzz, r7.xyzx
dp3 r8.x, r7.xyzx, cb0[4].xyzx
dp3 r8.y, r7.xyzx, cb0[5].xyzx
dp3 r8.z, r7.xyzx, cb0[6].xyzx
dp3 r2.z, -r5.xyzx, r8.xyzx
add r2.z, r2.z, l(1.000000)
max r2.z, r2.z, l(0.000000)
mul r2.z, r2.z, l(0.500000)
mul r2.z, r2.z, r2.z
mul r0.w, r0.w, r2.z
mul r0.w, r0.w, cb1[3].x
mul r7.xyz, r0.wwww, cb1[1].xyzx
ld_indexable(texture2d)(float,float,float,float) r2.zw, r1.xyzw, t3.zwxy
ld_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyww, t5.xyzw
mul r1.xyz, r1.xyzx, r1.xyzx
mul r9.xy, r2.wzww, l(10.000000, 13.000000, 0.000000, 0.000000)
mul r7.xyz, r7.xyzx, r9.xxxx
exp r0.w, r9.y
mul r9.xyz, r0.xxxx, r7.xyzx
mul r7.xyz, r0.zzzz, r7.xyzx
lt r1.w, l(0.000000), r4.z
mul r10.xy, r4.wwww, cb1[9].zwzz
mov r10.zw, l(0,0,0,0)
add r4.xyzw, r4.xyzw, r10.xyzw
mul r10.xyzw, r4.wwww, cb2[0].zwzw
mad r11.xyzw, r10.zwzw, l(-0.500000, -0.500000, 0.000000, 0.000000), r4.xyzw
div r11.xyz, r11.xyzx, r11.wwww
sample_c_lz_indexable(texture2d)(float,float,float,float) r11.x, r11.xyxx, t7.xxxx, s12, r11.z
mad r12.xyzw, r10.zwzw, l(0.500000, -0.500000, 0.000000, 0.000000), r4.xyzw
div r12.xyz, r12.xyzx, r12.wwww
sample_c_lz_indexable(texture2d)(float,float,float,float) r11.y, r12.xyxx, t7.xxxx, s12, r12.z
mad r12.xyzw, r10.zwzw, l(-0.500000, 0.500000, 0.000000, 0.000000), r4.xyzw
mad r4.xyzw, r10.xyzw, l(0.500000, 0.500000, 0.000000, 0.000000), r4.xyzw
div r4.xyz, r4.xyzx, r4.wwww
sample_c_lz_indexable(texture2d)(float,float,float,float) r11.w, r4.xyxx, t7.xxxx, s12, r4.z
div r4.xyz, r12.xyzx, r12.wwww
sample_c_lz_indexable(texture2d)(float,float,float,float) r11.z, r4.xyxx, t7.xxxx, s12, r4.z
dp4 r2.z, r11.xyzw, l(0.250000, 0.250000, 0.250000, 0.250000)
add r2.z, r2.z, l(-1.000000)
mad r2.z, cb1[8].x, r2.z, l(1.000000)
mad r3.w, r2.w, l(20.000000), l(1.000000)
dp3 r4.x, r6.xyzx, r8.xyzx
mad r4.y, r2.w, l(10.000000), r4.x
mov_sat r4.x, r4.x
eq r2.w, r2.w, l(0.000000)
max r4.y, r4.y, l(0.000000)
div r3.w, r4.y, r3.w
mul r4.yzw, r3.wwww, cb1[1].xxyz
mul r10.xyz, r2.zzzz, r4.yzwy
mul r4.yzw, r0.zzzz, r4.yyzw
mad r4.yzw, r4.yyzw, r2.zzzz, r7.xxyz
mad r7.xyz, r10.xyzx, r0.xxxx, r9.xyzx
mul r9.xyz, r4.xxxx, cb1[1].xyzx
log r3.w, r4.x
mul r3.w, r3.w, l(0.100000)
exp r3.w, r3.w
mul r10.xyz, r2.zzzz, r9.xyzx
mul r10.xyz, r0.xxxx, r10.xyzx
movc r7.xyz, r2.wwww, r10.xyzx, r7.xyzx
mul r0.x, r0.z, r2.z
mul r9.xyz, r0.xxxx, r9.xyzx
movc r4.xyz, r2.wwww, r9.xyzx, r4.yzwy
movc r4.xyz, r2.yyyy, r7.xyzx, r4.xyzx
and r4.xyz, r1.wwww, r4.xyzx
mad r7.xyz, -r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000)
mul r4.xyz, r4.xyzx, r7.xyzx
mul o0.xyz, r2.xxxx, r4.xyzx
mov o0.w, l(1.000000)
dp3 r0.x, r5.xyzx, r8.xyzx
add r0.x, r0.x, r0.x
mad r4.xyz, r8.xyzx, -r0.xxxx, r5.xyzx
dp3_sat r0.x, r6.xyzx, r4.xyzx
log r0.x, r0.x
mul r2.w, r0.w, cb1[1].w
mad r0.w, r0.w, l(0.010000), cb1[1].w
div r0.w, r2.w, r0.w
max r0.w, r0.w, l(1.000000)
mul r2.w, r0.w, l(0.250000)
mul r0.x, r0.x, r2.w
exp r0.x, r0.x
mad r2.w, r0.w, l(0.125000), l(0.250000)
mul r0.x, r0.x, r2.w
mul r4.xyz, r0.xxxx, cb1[2].xyzx
mul r4.xyz, r2.zzzz, r4.xyzx
mul r4.xyz, r0.zzzz, r4.xyzx
dp3 r0.x, -r3.xyzx, -r3.xyzx
rsq r0.x, r0.x
mad r3.xyz, -r3.xyzx, r0.xxxx, r6.xyzx
dp3 r0.x, r3.xyzx, r3.xyzx
rsq r0.x, r0.x
mul r3.xyz, r0.xxxx, r3.xyzx
dp3_sat r0.x, r3.xyzx, r8.xyzx
log r0.x, r0.x
mul r0.x, r0.x, r0.w
exp r0.x, r0.x
mul r0.xzw, r0.xxxx, cb1[2].xxyz
mul r0.xzw, r3.wwww, r0.xxzw
mul r0.xzw, r2.zzzz, r0.xxzw
mul r0.xyz, r0.yyyy, r0.xzwx
mul r0.xyz, r2.wwww, r0.xyzx
movc r0.xyz, r2.yyyy, r0.xyzx, r4.xyzx
and r0.xyz, r0.xyzx, r1.wwww
mul r0.xyz, r1.xyzx, r0.xyzx
mul o1.xyz, r2.xxxx, r0.xyzx
mov o1.w, l(1.000000)
ret 
// Approximately 160 instruction slots used

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