// asmtool.py -I ../.. --fix-unity-lighting-ps --only-autofixed c8729203fd076dce-ps.txt
// 3DMigoto: c8729203fd076dce | Matched 4 variants of 1 shaders: Hidden/Kyoto/KyotoDeferredShading
//
//       Unity headers extracted from KyotoDeferredShading.shader
//       Shader "Hidden/Kyoto/KyotoDeferredShading" {
//         Properties {
//         [HideInInspector]  _LightTexture0 ("", any) = "" { }
//         [HideInInspector]  _LightTextureB0 ("", 2D) = "" { }
//         [HideInInspector]  _ShadowMapTexture ("", any) = "" { }
//         [HideInInspector]  _SrcBlend ("", Float) = 1.000000
//         [HideInInspector]  _DstBlend ("", Float) = 1.000000
//          _SkinDiffusionProfile ("Skin Diffusion Lookup", 2D) = "gray" { }
//         }
//         Fallback Off
//         SubShader 1/1 {
//           Pass 1/2 {
//             Tags { "SHADOWSUPPORT"="true" }
//             ZWrite Off
//             Blend [_SrcBlend] [_DstBlend]
//             GpuProgramID 15946
//             Program "fp" {
//               SubProgram "d3d11 " {
// 5:              GpuProgramIndex 375
// a:              GpuProgramIndex 376
//               }
//             }
//           }
//         }
//       }
//
//    Unity 5.3 headers extracted from KyotoDeferredShading.shader.decompressed:
//      API d3d11
//      Shader model ps_4_0
//      undeciphered1: 201510240 356 5 9
// a:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "KYOTO_TEXEL_DENSITY" }
// 5:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "SHADOWS_SOFT" "KYOTO_TEXEL_DENSITY" }
//      undeciphered2: 1 6 4 6 0 0
//      undeciphered3: 0 0
//      ConstBuffer "$Globals" 368
//      Vector 48 [unity_ColorSpaceLuminance]
//      Vector 112 [_LightDir]
//      Vector 144 [_LightColor]
//      Vector 256 [_ShadowMapTexture_TexelSize]
//      Vector 336 [_ShadowColor]
//      ScalarInt 356 [_TexelDensityViewEnabled]
//      ConstBuffer "UnityPerCamera" 144
//      Vector 64 [_WorldSpaceCameraPos] 3
//      Vector 80 [_ProjectionParams]
//      Vector 112 [_ZBufferParams]
//      ConstBuffer "UnityPerCameraRare" 352
//      Matrix 288 [unity_CameraToWorld]
//      ConstBuffer "UnityShadows" 416
//      Vector 96 [_LightSplitsNear]
//      Vector 112 [_LightSplitsFar]
//      Vector 384 [_LightShadowData]
//      Vector 400 [unity_ShadowFadeCenterAndType]
//      Matrix 128 [unity_WorldToShadow0]
//      Matrix 192 [unity_WorldToShadow1]
//      Matrix 256 [unity_WorldToShadow2]
//      Matrix 320 [unity_WorldToShadow3]
//      SetTexture 0 [_CameraGBufferTexture0] 2D 2
//      SetTexture 1 [_CameraGBufferTexture1] 2D 3
//      SetTexture 2 [_CameraGBufferTexture2] 2D 4
//      SetTexture 3 [_CameraDepthTexture] 2D 0
//      SetTexture 4 [_SkinDiffusionProfile] 2D 5
//      SetTexture 5 [_ShadowMapTexture] 2D 1
//      BindCB "$Globals" 0
//      BindCB "UnityPerCamera" 1
//      BindCB "UnityPerCameraRare" 2
//      BindCB "UnityShadows" 3
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://github.com/DarkStarSword/3d-fixes

//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.12 on Thu Dec 06 16:59:06 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xy w
// TEXCOORD                 1   xyz         2     NONE   float   xyz
// TEXCOORD                 3      w        2     NONE   float      w
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer cb0[23], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[22], immediateIndexed
dcl_constantbuffer cb3[26], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_comparison
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_resource_texture2d (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_resource_texture2d (float,float,float,float) t5
dcl_input_ps linear v1.xyw
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw
dcl_temps 21

// New input from vertex shader with unity_CameraInvProjection[0].x:
dcl_input_ps linear v2.w
dcl_constantbuffer cb10[4], immediateIndexed

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125

ld_indexable(texture2d)(float,float,float,float) r16.xyzw, l(0, 0, 0, 0), t125.xyzw


// Unity reflection/specular fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -I ../.. --fix-unity-lighting-ps --only-autofixed c8729203fd076dce-ps.txt

mul r16.w, -r16.x, r16.y
ne r18.x, l(0.0, 0.0, 0.0, 0.0), v2.w
if_nz r18.x
  mul r16.w, r16.w, v2.w
  mad r17.xyz, -r16.wwww, cb2[18].xyzw, cb1[4].xyzw
else
  mad r17.xyz, -r16.wwww, cb10[0].xyzw, cb1[4].xyzw
endif

ilt r0.x, l(0), cb0[22].y
if_nz r0.x
  div r0.xy, v1.xyxx, v1.wwww
  sample r0.xyzw, r0.xyxx, t0.xyzw, s2
  mov o0.xyzw, r0.xyzw
  ret
endif
div r0.xy, v1.xyxx, v1.wwww
sample r1.xyzw, r0.xyxx, t0.xyzw, s2
sample r2.xyzw, r0.xyxx, t1.xyzw, s3
sample r3.xyzw, r0.xyxx, t2.xyzw, s4
div r0.z, cb1[5].z, v2.z
mul r4.xyz, r0.zzzz, v2.xyzx
sample r0.xyzw, r0.xyxx, t3.xyzw, s0
mad r0.x, cb1[7].x, r0.x, cb1[7].y
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mul r0.yzw, r0.xxxx, r4.xxyz

// copy depth from r0.w to r19.x:
mov r19.x, r0.w


// Unity light/shadow fix (pixel shader stage) inserted with DarkStarSword's asmtool.py:
// asmtool.py -I ../.. --fix-unity-lighting-ps --only-autofixed c8729203fd076dce-ps.txt

add r20.x, r19.x, -r16.y
mul r20.x, r16.x, r20.x
ne r16.w, l(0.0, 0.0, 0.0, 0.0), v2.w
if_nz r16.w
  mad r0.y, -r20.x, v2.w, r0.y
endif

mul r4.xyw, r0.zzzz, cb2[19].xyxz
mad r4.xyw, cb2[18].xyxz, r0.yyyy, r4.xyxw
mad r4.xyw, cb2[20].xyxz, r0.wwww, r4.xyxw
add r4.xyw, r4.xyxw, cb2[21].xyxz

if_z r16.w
  mad r4.xyw, -r20.xxxx, cb10[0].xyxz, r4.xyzw
endif

add r5.xyz, r4.xywx, -cb3[25].xyzx
dp3 r0.y, r5.xyzx, r5.xyzx
sqrt r0.y, r0.y
mad r0.y, -r4.z, r0.x, r0.y
mad r0.y, cb3[25].w, r0.y, r0.w
mad_sat r0.y, r0.y, cb3[24].z, cb3[24].w
ge r5.xyzw, r0.wwww, cb3[6].xyzw
and r5.xyzw, r5.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
lt r6.xyzw, r0.wwww, cb3[7].xyzw
and r6.xyzw, r6.xyzw, l(0x3f800000, 0x3f800000, 0x3f800000, 0x3f800000)
mul r5.xyzw, r5.xyzw, r6.xyzw
mul r6.xyz, r4.yyyy, cb3[9].xyzx
mad r6.xyz, cb3[8].xyzx, r4.xxxx, r6.xyzx
mad r6.xyz, cb3[10].xyzx, r4.wwww, r6.xyzx
add r6.xyz, r6.xyzx, cb3[11].xyzx
mul r7.xyz, r4.yyyy, cb3[13].xyzx
mad r7.xyz, cb3[12].xyzx, r4.xxxx, r7.xyzx
mad r7.xyz, cb3[14].xyzx, r4.wwww, r7.xyzx
add r7.xyz, r7.xyzx, cb3[15].xyzx
mul r8.xyz, r4.yyyy, cb3[17].xyzx
mad r8.xyz, cb3[16].xyzx, r4.xxxx, r8.xyzx
mad r8.xyz, cb3[18].xyzx, r4.wwww, r8.xyzx
add r8.xyz, r8.xyzx, cb3[19].xyzx
mul r9.xyz, r4.yyyy, cb3[21].xyzx
mad r9.xyz, cb3[20].xyzx, r4.xxxx, r9.xyzx
mad r9.xyz, cb3[22].xyzx, r4.wwww, r9.xyzx
add r9.xyz, r9.xyzx, cb3[23].xyzx
mul r10.xyz, r5.yyyy, r7.xyzx
mad r6.xyz, r6.xyzx, r5.xxxx, r10.xyzx
mad r6.xyz, r8.xyzx, r5.zzzz, r6.xyzx
mad r6.xyz, r9.xyzx, r5.wwww, r6.xyzx
mad r6.xy, r6.xyxx, cb0[16].zwzz, l(0.500000, 0.500000, 0.000000, 0.000000)
round_ni r10.xy, r6.xyxx
add r10.xy, r10.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
frc r6.xy, r6.xyxx
mul r0.z, r6.x, l(3.000000)
mad r10.zw, -r6.xxxy, l(0.000000, 0.000000, 3.000000, 3.000000), l(0.000000, 0.000000, 4.000000, 4.000000)
mad r11.xy, r6.xyxx, l(3.000000, 3.000000, 0.000000, 0.000000), l(1.000000, 1.000000, 0.000000, 0.000000)
mad r11.zw, -r6.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, 3.000000, 3.000000)
div r11.zw, r11.zzzw, r10.zzzw
add r12.xy, r11.zwzz, l(-2.000000, -2.000000, 0.000000, 0.000000)
add r11.zw, r6.xxxy, l(0.000000, 0.000000, 3.000000, 3.000000)
mul r13.xy, r11.zwzz, cb0[16].xyxx
div r6.xy, r6.xyxx, r11.xyxx
add r6.xy, r6.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000)
mov r12.z, r13.x
mov r12.w, r6.x
mov r14.xz, cb0[16].xxxx
mov r14.y, l(0.142857149)
mul r14.xyz, r12.xzwx, r14.xyzx
mov r13.z, r12.y
mov r13.w, r6.y
mov r12.xz, cb0[16].yyyy
mov r12.y, l(0.142857149)
mul r12.xyw, r12.xyxz, r13.zyzw
mad r13.xz, r0.zzzz, l(-1.000000, 0.000000, 1.000000, 0.000000), l(4.000000, 0.000000, 1.000000, 0.000000)
mov r13.y, l(7.000000)
mul r6.xyw, r10.wwww, r13.xyxz
mov r14.w, r12.x
mad r15.xyzw, r10.xyxy, cb0[16].xyxy, r14.xwyw
sample_c_lz r0.z, r15.xyxx, t5.xxxx, s1, r6.z
sample_c_lz r7.w, r15.zwzz, t5.xxxx, s1, r6.z
mul r6.y, r6.y, r7.w
mad r0.z, r6.x, r0.z, r6.y
mad r6.xy, r10.xyxx, cb0[16].xyxx, r14.zwzz
sample_c_lz r6.x, r6.xyxx, t5.xxxx, s1, r6.z
mad r0.z, r6.w, r6.x, r0.z
mul r6.xy, r13.xzxx, l(7.000000, 7.000000, 0.000000, 0.000000)
mov r12.z, r14.x
mad r15.xyzw, r10.xyxy, cb0[16].xyxy, r12.zyzw
sample_c_lz r6.w, r15.xyxx, t5.xxxx, s1, r6.z
mad r0.z, r6.x, r6.w, r0.z
mov r12.xz, r14.yyzy
mad r14.xyzw, r10.xyxy, cb0[16].xyxy, r12.xyzy
sample_c_lz r6.x, r14.xyxx, t5.xxxx, s1, r6.z
mad r0.z, r6.x, l(49.000000), r0.z
sample_c_lz r6.x, r14.zwzz, t5.xxxx, s1, r6.z
mad r0.z, r6.y, r6.x, r0.z
mul r6.xyw, r11.yyyy, r13.xyxz
sample_c_lz r7.w, r15.zwzz, t5.xxxx, s1, r6.z
mad r0.z, r6.x, r7.w, r0.z
mad r10.xyzw, r10.xyxy, cb0[16].xyxy, r12.xwzw
sample_c_lz r6.x, r10.xyxx, t5.xxxx, s1, r6.z
mad r0.z, r6.y, r6.x, r0.z
sample_c_lz r6.x, r10.zwzz, t5.xxxx, s1, r6.z
mad r0.z, r6.w, r6.x, r0.z
mul r0.z, r0.z, l(0.00694444450)
add r6.x, -cb3[24].x, l(1.000000)
mad r0.z, r0.z, r6.x, cb3[24].x
mad r10.xyzw, r4.zzzz, r0.xxxx, -cb3[6].xyzw
add r11.xyzw, -cb3[6].xyzw, cb3[7].xyzw
div r10.xyzw, r10.xyzw, r11.xyzw
mul r10.xyzw, r5.xyzw, r10.xyzw
dp4 r0.x, r10.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
lt r4.z, l(0.900000), r0.x
if_nz r4.z
  add r0.x, r0.x, l(-0.900000)
  mul r0.x, r0.x, l(10.000000)
  mul r6.yzw, r5.yyyy, r8.xxyz
  mad r5.xyw, r7.xyxz, r5.xxxx, r6.yzyw
  mad r5.xyz, r9.xyzx, r5.zzzz, r5.xywx
  mad r5.xy, r5.xyxx, cb0[16].zwzz, l(0.500000, 0.500000, 0.000000, 0.000000)
  round_ni r6.yz, r5.xxyx
  add r6.yz, r6.yyzy, l(0.000000, -0.500000, -0.500000, 0.000000)
  frc r5.xy, r5.xyxx
  mad r7.xy, -r5.yxyy, l(2.000000, 2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
  mad r7.zw, r5.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, 1.000000, 1.000000)
  add r8.xy, -r5.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000)
  div r8.xy, r8.xyxx, r7.yxyy
  add r8.xy, r8.xyxx, l(-1.000000, -1.000000, 0.000000, 0.000000)
  div r5.xy, r5.xyxx, r7.zwzz
  add r8.zw, r5.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000)
  mul r8.xyzw, r8.xzyw, cb0[16].xxyy
  mul r4.z, r7.w, r7.z
  mad r9.xyzw, r6.yzyz, cb0[16].xyxy, r8.ywxz
  sample_c_lz r5.x, r9.xyxx, t5.xxxx, s1, r5.z
  mul r5.y, r7.x, r7.y
  sample_c_lz r5.w, r9.zwzz, t5.xxxx, s1, r5.z
  mul r5.y, r5.w, r5.y
  mad r4.z, r4.z, r5.x, r5.y
  mul r5.xy, r7.xyxx, r7.zwzz
  mad r7.xyzw, r6.yzyz, cb0[16].xyxy, r8.yzxw
  sample_c_lz r5.w, r7.xyxx, t5.xxxx, s1, r5.z
  mad r4.z, r5.x, r5.w, r4.z
  sample_c_lz r5.x, r7.zwzz, t5.xxxx, s1, r5.z
  mad r4.z, r5.y, r5.x, r4.z
  mul r4.z, r4.z, l(0.062500)
  mad r4.z, r4.z, r6.x, cb3[24].x
  add r4.z, -r0.z, r4.z
  mad r0.z, r0.x, r4.z, r0.z
endif
mad_sat r0.x, r0.w, cb3[24].z, cb3[24].w
add r0.x, r0.x, r0.z
add_sat r0.x, r0.y, r0.x
mad r0.yzw, r3.xxyz, l(0.000000, 2.000000, 2.000000, 2.000000), l(0.000000, -1.000000, -1.000000, -1.000000)
dp3 r3.x, r0.yzwy, r0.yzwy
rsq r3.x, r3.x
mul r0.yzw, r0.yyzw, r3.xxxx
eq r3.x, r3.w, l(1.000000)
if_nz r3.x
  add r3.x, -r1.w, l(1.000000)
  mad r3.xyz, -cb0[21].xyzx, r3.xxxx, cb0[9].xyzx
  mul r5.xyz, r1.wwww, cb0[21].xyzx
  mad r3.xyz, -cb0[21].xyzx, r1.wwww, r3.xyzx
  mad r3.xyz, r0.xxxx, r3.xyzx, r5.xyzx
  add r5.xyz, r4.xywx, -r17.xyzx
  dp3 r4.z, r5.xyzx, r5.xyzx
  rsq r4.z, r4.z
  mul r6.xyz, r4.zzzz, r5.xyzx
  add r7.xyzw, -r2.wxyz, l(1.000000, 1.000000, 1.000000, 1.000000)
  mad r5.xyz, -r5.xyzx, r4.zzzz, -cb0[7].xyzx
  dp3 r4.z, r5.xyzx, r5.xyzx
  max r4.z, r4.z, l(0.001000)
  rsq r4.z, r4.z
  mul r5.xyz, r4.zzzz, r5.xyzx
  dp3 r4.z, r0.yzwy, -r6.xyzx
  lt r5.w, r4.z, l(0.000000)
  add r4.z, -r4.z, l(0.000010)
  mad r8.xyz, -r6.xyzx, r4.zzzz, r0.yzwy
  movc r8.xyz, r5.wwww, r8.xyzx, r0.yzwy
  dp3 r4.z, r8.xyzx, -cb0[7].xyzx
  max r4.z, r4.z, l(0.000000)
  dp3 r5.w, r8.xyzx, r5.xyzx
  dp3 r6.x, r8.xyzx, -r6.xyzx
  max r6.x, r6.x, l(0.000000)
  dp3 r5.x, -cb0[7].xyzx, r5.xyzx
  max r5.xw, r5.xxxw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r5.y, r7.x, r7.x
  mad r5.z, -r7.x, r7.x, l(1.000000)
  mad r6.y, r6.x, r5.z, r5.y
  mad r5.z, r4.z, r5.z, r5.y
  mul r5.z, r5.z, r6.x
  mad r5.z, r4.z, r6.y, r5.z
  add r5.z, r5.z, l(0.000010)
  div r5.z, l(2.000000), r5.z
  mul r6.x, r5.y, r5.y
  mul r5.w, r5.w, r5.w
  mad r5.y, r5.y, r5.y, l(-1.000000)
  mad r5.y, r5.w, r5.y, l(1.000000)
  mul r5.w, r5.y, l(3.14159274)
  mad r5.y, r5.w, r5.y, l(1.000000012E-007)
  div r5.y, r6.x, r5.y
  mul r5.y, r5.y, r5.z
  mul r5.y, r5.y, l(0.785398185)
  eq r5.z, cb0[3].w, l(0.000000)
  max r5.w, r5.y, l(0.000100)
  sqrt r5.w, r5.w
  movc r5.y, r5.z, r5.w, r5.y
  mul r5.y, r4.z, r5.y
  max r5.y, r5.y, l(0.000000)
  mul r6.xyz, r3.xyzx, r4.zzzz
  mul r3.xyz, r3.xyzx, r5.yyyy
  add r4.z, -r5.x, l(1.000000)
  mul r5.x, r4.z, r4.z
  mul r5.x, r5.x, r5.x
  mul r4.z, r4.z, r5.x
  mad r5.xyz, r7.yzwy, r4.zzzz, r2.xyzx
  mul r3.xyz, r3.xyzx, r5.xyzx
  mad r3.xyz, r1.xyzx, r6.xyzx, r3.xyzx
  min r5.xyz, r3.xyzx, l(8.000000, 8.000000, 8.000000, 0.000000)
else
  lt r3.x, l(0.600000), r3.w
  if_nz r3.x
    add r3.x, -r1.w, l(1.000000)
    mad r3.xyz, -cb0[21].xyzx, r3.xxxx, cb0[9].xyzx
    mul r6.xyz, r1.wwww, cb0[21].xyzx
    mad r3.xyz, -cb0[21].xyzx, r1.wwww, r3.xyzx
    mad r3.xyz, r0.xxxx, r3.xyzx, r6.xyzx
    add r6.xyz, r4.xywx, -r17.xyzx
    dp3 r4.z, r6.xyzx, r6.xyzx
    rsq r4.z, r4.z
    mul r7.xyz, r4.zzzz, r6.xyzx
    dp3 r6.w, r0.yzwy, -cb0[7].xyzx
    max r7.w, r6.w, l(0.000000)
    mad r8.x, r6.w, l(0.500000), l(0.500000)
    mov r8.y, r2.y
    sample_l r8.xyzw, r8.xyxx, t4.xyzw, s5, l(0.000000)
    add r9.xy, -r2.wxww, l(1.000000, 1.000000, 0.000000, 0.000000)
    mad r6.xyz, -r6.xyzx, r4.zzzz, -cb0[7].xyzx
    dp3 r4.z, r6.xyzx, r6.xyzx
    rsq r4.z, r4.z
    mul r6.xyz, r4.zzzz, r6.xyzx
    dp3 r4.z, r0.yzwy, r6.xyzx
    max r4.z, r4.z, l(0.000000)
    dp3 r6.w, r0.yzwy, -r7.xyzx
    dp3 r6.x, -cb0[7].xyzx, r6.xyzx
    max r6.xw, r6.xxxw, l(0.000000, 0.000000, 0.000000, 0.000000)
    mul r6.y, r9.x, r9.x
    mul r6.z, r6.y, l(0.500000)
    mad r7.x, -r6.y, l(0.500000), l(1.000000)
    mad r7.y, r7.w, r7.x, r6.z
    mad r6.z, r6.w, r7.x, r6.z
    mad r6.z, r7.y, r6.z, l(0.000010)
    div r6.z, l(1.000000, 1.000000, 1.000000, 1.000000), r6.z
    mul r6.w, r6.y, r6.y
    mul r4.z, r4.z, r4.z
    mad r6.y, r6.y, r6.y, l(-1.000000)
    mad r4.z, r4.z, r6.y, l(1.000000)
    mul r6.y, r4.z, l(3.14159274)
    mad r4.z, r6.y, r4.z, l(1.000000012E-007)
    div r4.z, r6.w, r4.z
    mul r4.z, r4.z, r6.z
    mul r4.z, r7.w, r4.z
    eq r6.y, cb0[3].w, l(0.000000)
    movc r6.y, r6.y, l(0.616850257), l(0.785398185)
    mul r4.z, r4.z, r6.y
    max r4.z, r4.z, l(0.000000)
    mul r6.yzw, r1.xxyz, r3.xxyz
    mul r3.xyz, r3.xyzx, r4.zzzz
    add r4.z, -r6.x, l(1.000000)
    mul r6.x, r4.z, r4.z
    mul r6.x, r6.x, r6.x
    mul r4.z, r4.z, r6.x
    mad r4.z, r9.y, r4.z, r2.x
    mul r3.xyz, r3.xyzx, r4.zzzz
    mad r5.xyz, r6.yzwy, r8.xyzx, r3.xyzx
  else
    lt r3.x, l(0.300000), r3.w
    if_nz r3.x
      add r3.x, -r1.w, l(1.000000)
      mad r3.xyz, -cb0[21].xyzx, r3.xxxx, cb0[9].xyzx
      mul r6.xyz, r1.wwww, cb0[21].xyzx
      mad r3.xyz, -cb0[21].xyzx, r1.wwww, r3.xyzx
      mad r3.xyz, r0.xxxx, r3.xyzx, r6.xyzx
      add r6.xyz, r4.xywx, -r17.xyzx
      dp3 r3.w, r6.xyzx, r6.xyzx
      rsq r3.w, r3.w
      mul r7.xyz, r3.wwww, r6.xyzx
      max r4.z, r2.y, r2.x
      max r4.z, r2.z, r4.z
      mad r6.xyz, -r6.xyzx, r3.wwww, -cb0[7].xyzx
      dp3 r3.w, r6.xyzx, r6.xyzx
      rsq r3.w, r3.w
      mul r6.xyz, r3.wwww, r6.xyzx
      dp3_sat r3.w, r6.xyzx, -r7.xyzx
      dp3 r6.w, r0.yzwy, r6.xyzx
      max r6.w, r6.w, l(0.000000)
      min r6.w, r6.w, l(0.999999)
      mul r7.w, r6.w, r6.w
      dp3_sat r7.x, r0.yzwy, -r7.xyzx
      dp3_sat r7.y, r0.yzwy, -cb0[7].xyzx
      add r7.z, -r2.w, l(1.000000)
      add r8.x, -r4.z, l(1.000000)
      add r3.w, -r3.w, l(1.000000)
      mul r8.y, r3.w, r3.w
      mul r8.y, r8.y, r8.y
      mul r3.w, r3.w, r8.y
      mad r3.w, r8.x, r3.w, r4.z
      mad r4.z, -r6.w, r6.w, l(1.000000)
      div r6.w, r7.w, r4.z
      mul r4.z, r4.z, r4.z
      mad r7.w, r7.z, r7.z, l(0.000001)
      mad r8.x, r7.w, l(4.000000), l(1.000000)
      mul r8.x, r8.x, l(3.14159274)
      div r8.x, l(1.000000, 1.000000, 1.000000, 1.000000), r8.x
      div r6.w, -r6.w, r7.w
      mul r6.w, r6.w, l(1.442695)
      exp r6.w, r6.w
      mul r6.w, r6.w, l(4.000000)
      div r4.z, r6.w, r4.z
      add r4.z, r4.z, l(1.000000)
      mul r4.z, r4.z, r8.x
      add r6.w, r7.x, r7.y
      mad r6.w, -r7.y, r7.x, r6.w
      mul r6.w, r6.w, l(4.000000)
      div r6.w, l(1.000000, 1.000000, 1.000000, 1.000000), r6.w
      mul r3.w, r3.w, r4.z
      mul r3.w, r6.w, r3.w
      min r3.w, r3.w, l(4.000000)
      mul r3.w, r7.y, r3.w
      dp3_sat r4.z, -cb0[7].xyzx, r6.xyzx
      add r6.x, -r7.y, l(1.000000)
      mul r6.y, r6.x, r6.x
      mul r6.y, r6.y, r6.y
      mul r6.x, r6.x, r6.y
      add r6.y, -r7.x, l(1.000000)
      mul r6.z, r6.y, r6.y
      mul r6.z, r6.z, r6.z
      mul r6.y, r6.y, r6.z
      add r6.z, r4.z, r4.z
      mul r4.z, r4.z, r6.z
      mad r4.z, r4.z, r7.z, l(-0.500000)
      mad r6.x, r4.z, r6.x, l(1.000000)
      mad r4.z, r4.z, r6.y, l(1.000000)
      mul r4.z, r4.z, r6.x
      mul r4.z, r7.y, r4.z
      mul r6.xyz, r3.xyzx, r4.zzzz
      mul r7.xzw, r2.xxyz, r3.wwww
      mul r3.xyz, r3.xyzx, r7.xzwx
      mul r3.xyz, r7.yyyy, r3.xyzx
      mad r5.xyz, r6.xyzx, r1.xyzx, r3.xyzx
    else
      add r3.x, -r1.w, l(1.000000)
      mad r3.xyz, -cb0[21].xyzx, r3.xxxx, cb0[9].xyzx
      mul r6.xyz, r1.wwww, cb0[21].xyzx
      mad r3.xyz, -cb0[21].xyzx, r1.wwww, r3.xyzx
      mad r3.xyz, r0.xxxx, r3.xyzx, r6.xyzx
      add r6.xyzw, -r2.wxyz, l(1.000000, 1.000000, 1.000000, 1.000000)
      add r4.xyz, r4.xywx, -r17.xyzx
      dp3 r0.x, r4.xyzx, r4.xyzx
      rsq r0.x, r0.x
      mul r7.xyz, r0.xxxx, r4.xyzx
      dp3 r1.w, r0.yzwy, -cb0[7].xyzx
      max r1.w, r1.w, l(0.000000)
      mad r4.xyz, -r4.xyzx, r0.xxxx, -cb0[7].xyzx
      dp3 r0.x, r4.xyzx, r4.xyzx
      max r0.x, r0.x, l(0.001000)
      rsq r0.x, r0.x
      mul r4.xyz, r0.xxxx, r4.xyzx
      dp3 r0.x, r0.yzwy, r4.xyzx
      dp3 r0.y, r0.yzwy, -r7.xyzx
      dp3 r0.z, -cb0[7].xyzx, r4.xyzx
      max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
      max r0.w, r6.x, l(0.010000)
      mul r2.w, r0.w, r0.w
      mad r0.w, -r0.w, r0.w, l(1.000000)
      mad r3.w, r0.y, r0.w, r2.w
      mad r0.w, r1.w, r0.w, r2.w
      mul r0.xy, r0.xwxx, r0.xyxx
      mad r0.y, r1.w, r3.w, r0.y
      add r0.y, r0.y, l(0.000010)
      div r0.y, l(2.000000), r0.y
      mul r0.w, r2.w, r2.w
      mad r2.w, r2.w, r2.w, l(-1.000000)
      mad r0.x, r0.x, r2.w, l(1.000000)
      mul r2.w, r0.x, l(3.14159274)
      mad r0.x, r2.w, r0.x, l(1.000000012E-007)
      div r0.x, r0.w, r0.x
      mul r0.x, r0.x, r0.y
      mul r0.x, r0.x, l(0.785398185)
      mul r0.x, r1.w, r0.x
      max r0.x, r0.x, l(0.000000)
      mul r1.xyz, r1.xyzx, r3.xyzx
      add r0.y, -r0.z, l(1.000000)
      mul r0.z, r0.y, r0.y
      mul r0.z, r0.z, r0.z
      mul r0.y, r0.y, r0.z
      mad r0.yzw, r6.yyzw, r0.yyyy, r2.xxyz
      mul r0.yzw, r0.yyzw, r3.xxyz
      mul r0.xyz, r0.xxxx, r0.yzwy
      mad r5.xyz, r1.xyzx, r1.wwww, r0.xyzx
    endif
  endif
endif
mov r5.w, l(1.000000)
exp o0.xyzw, -r5.xyzw
ret
// Approximately 0 instruction slots used