// asmtool.py -I ../.. --fix-unity-lighting-ps --only-autofixed 3b40522a05d25b8d-ps.txt
// 3DMigoto: 3b40522a05d25b8d | 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 552
// a:              GpuProgramIndex 642
//               }
//             }
//           }
//         }
//       }
//
//    Unity 5.3 headers extracted from KyotoDeferredShading.shader.decompressed:
//      API d3d11
//      Shader model ps_4_0
//      undeciphered1: 201510240 284 5 6
// a:   Keywords { "SPOT" "SHADOWS_DEPTH" "SHADOWS_SOFT" "SHADOWS_SPLIT_SPHERES" "UNITY_HDR_ON" }
// 5:   Keywords { "SPOT" "SHADOWS_DEPTH" "SHADOWS_SOFT" "UNITY_HDR_ON" }
//      undeciphered2: 1 8 4 8 0 0
//      undeciphered3: 0 0
//      ConstBuffer "$Globals" 400
//      Vector 48 [unity_ColorSpaceLuminance]
//      Vector 128 [_LightPos]
//      Vector 144 [_LightColor]
//      Vector 240 [_ShadowOffsets0]
//      Vector 256 [_ShadowOffsets1]
//      Vector 272 [_ShadowOffsets2]
//      Vector 288 [_ShadowOffsets3]
//      Vector 368 [_ShadowColor]
//      Matrix 176 [unity_WorldToLight]
//      ConstBuffer "UnityPerCamera" 144
//      Vector 64 [_WorldSpaceCameraPos] 3
//      Vector 80 [_ProjectionParams]
//      Vector 112 [_ZBufferParams]
//      ConstBuffer "UnityPerCameraRare" 352
//      Matrix 288 [unity_CameraToWorld]
//      ConstBuffer "UnityShadows" 416
//      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 4
//      SetTexture 1 [_CameraGBufferTexture1] 2D 5
//      SetTexture 2 [_CameraGBufferTexture2] 2D 6
//      SetTexture 3 [_CameraDepthTexture] 2D 0
//      SetTexture 4 [_LightTexture0] 2D 2
//      SetTexture 5 [_LightTextureB0] 2D 1
//      SetTexture 6 [_SkinDiffusionProfile] 2D 7
//      SetTexture 7 [_ShadowMapTexture] 2D 3
//      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:58:48 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[24], 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_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_comparison
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, 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_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_input_ps linear v1.xyw
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw
dcl_temps 17

// 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) r12.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 3b40522a05d25b8d-ps.txt

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

div r0.xy, v1.xyxx, v1.wwww
sample r1.xyzw, r0.xyxx, t0.xyzw, s4
sample r2.xyzw, r0.xyxx, t1.xyzw, s5
sample r3.xyzw, r0.xyxx, t2.xyzw, s6
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 r15.x:
mov r15.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 3b40522a05d25b8d-ps.txt

add r16.x, r15.x, -r12.y
mul r16.x, r12.x, r16.x
ne r12.w, l(0.0, 0.0, 0.0, 0.0), v2.w
if_nz r12.w
  mad r0.y, -r16.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 r12.w
  mad r4.xyw, -r16.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.x, -r4.z, r0.x, r0.y
mad r0.x, cb3[25].w, r0.x, r0.w
add r0.yzw, -r4.xxyw, cb0[8].xxyz
dp3 r4.z, r0.yzwy, r0.yzwy
rsq r5.x, r4.z
mul r5.yzw, r0.yyzw, r5.xxxx
mul r6.xyz, r4.yyyy, cb0[12].xywx
mad r6.xyz, cb0[11].xywx, r4.xxxx, r6.xyzx
mad r6.xyz, cb0[13].xywx, r4.wwww, r6.xyzx
add r6.xyz, r6.xyzx, cb0[14].xywx
div r6.xy, r6.xyxx, r6.zzzz
sample_b r7.xyzw, r6.xyxx, t4.xyzw, s2, l(-8.000000)
lt r6.x, r6.z, l(0.000000)
and r6.x, r6.x, l(0x3f800000)
mul r6.x, r6.x, r7.w
mul r4.z, r4.z, cb0[8].w
sample r7.xyzw, r4.zzzz, t5.xyzw, s1
mul r4.z, r6.x, r7.x
mad_sat r0.x, r0.x, cb3[24].z, cb3[24].w
mul r6.xyzw, r4.yyyy, cb3[9].xyzw
mad r6.xyzw, cb3[8].xyzw, r4.xxxx, r6.xyzw
mad r6.xyzw, cb3[10].xyzw, r4.wwww, r6.xyzw
add r6.xyzw, r6.xyzw, cb3[11].xyzw
div r6.xyz, r6.xyzx, r6.wwww
add r7.xyz, r6.xyzx, cb0[15].xyzx
sample_c_lz r7.x, r7.xyxx, t7.xxxx, s3, r7.z
add r8.xyz, r6.xyzx, cb0[16].xyzx
sample_c_lz r7.y, r8.xyxx, t7.xxxx, s3, r8.z
add r8.xyz, r6.xyzx, cb0[17].xyzx
sample_c_lz r7.z, r8.xyxx, t7.xxxx, s3, r8.z
add r6.xyz, r6.xyzx, cb0[18].xyzx
sample_c_lz r7.w, r6.xyxx, t7.xxxx, s3, r6.z
add r6.x, -cb3[24].x, l(1.000000)
mad r6.xyzw, r7.xyzw, r6.xxxx, cb3[24].xxxx
dp4 r6.x, r6.xyzw, l(0.250000, 0.250000, 0.250000, 0.250000)
add_sat r0.x, r0.x, r6.x
mad r3.xyz, r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r6.x, r3.xyzx, r3.xyzx
rsq r6.x, r6.x
mul r3.xyz, r3.xyzx, r6.xxxx
eq r6.x, r3.w, l(1.000000)
if_nz r6.x
  add r6.x, -r1.w, l(1.000000)
  mad r6.xyz, -cb0[23].xyzx, r6.xxxx, cb0[9].xyzx
  mul r7.xyz, r1.wwww, cb0[23].xyzx
  mad r6.xyz, -cb0[23].xyzx, r1.wwww, r6.xyzx
  mad r6.xyz, r0.xxxx, r6.xyzx, r7.xyzx
  mul r6.xyz, r4.zzzz, r6.xyzx
  add r7.xyz, r4.xywx, -r13.xyzx
  dp3 r6.w, r7.xyzx, r7.xyzx
  rsq r6.w, r6.w
  mul r7.xyz, r6.wwww, r7.xyzx
  add r8.xyzw, -r2.wxyz, l(1.000000, 1.000000, 1.000000, 1.000000)
  mad r9.xyz, r0.yzwy, r5.xxxx, -r7.xyzx
  dp3 r6.w, r9.xyzx, r9.xyzx
  max r6.w, r6.w, l(0.001000)
  rsq r6.w, r6.w
  mul r9.xyz, r6.wwww, r9.xyzx
  dp3 r6.w, r3.xyzx, -r7.xyzx
  lt r7.w, r6.w, l(0.000000)
  add r6.w, -r6.w, l(0.000010)
  mad r10.xyz, -r7.xyzx, r6.wwww, r3.xyzx
  movc r10.xyz, r7.wwww, r10.xyzx, r3.xyzx
  dp3 r6.w, r10.xyzx, r5.yzwy
  max r6.w, r6.w, l(0.000000)
  dp3 r7.w, r10.xyzx, r9.xyzx
  dp3 r7.x, r10.xyzx, -r7.xyzx
  dp3 r7.y, r5.yzwy, r9.xyzx
  max r7.xyw, r7.xyxw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r7.z, r8.x, r8.x
  mad r8.x, -r8.x, r8.x, l(1.000000)
  mad r9.x, r7.x, r8.x, r7.z
  mad r8.x, r6.w, r8.x, r7.z
  mul r7.x, r7.x, r8.x
  mad r7.x, r6.w, r9.x, r7.x
  add r7.x, r7.x, l(0.000010)
  div r7.x, l(2.000000), r7.x
  mul r8.x, r7.z, r7.z
  mul r7.w, r7.w, r7.w
  mad r7.z, r7.z, r7.z, l(-1.000000)
  mad r7.z, r7.w, r7.z, l(1.000000)
  mul r7.w, r7.z, l(3.14159274)
  mad r7.z, r7.w, r7.z, l(1.000000012E-007)
  div r7.z, r8.x, r7.z
  mul r7.x, r7.z, r7.x
  mul r7.x, r7.x, l(0.785398185)
  eq r7.z, cb0[3].w, l(0.000000)
  max r7.w, r7.x, l(0.000100)
  sqrt r7.w, r7.w
  movc r7.x, r7.z, r7.w, r7.x
  mul r7.x, r6.w, r7.x
  max r7.x, r7.x, l(0.000000)
  mul r9.xyz, r6.wwww, r6.xyzx
  mul r6.xyz, r6.xyzx, r7.xxxx
  add r6.w, -r7.y, l(1.000000)
  mul r7.x, r6.w, r6.w
  mul r7.x, r7.x, r7.x
  mul r6.w, r6.w, r7.x
  mad r7.xyz, r8.yzwy, r6.wwww, r2.xyzx
  mul r6.xyz, r6.xyzx, r7.xyzx
  mad r6.xyz, r1.xyzx, r9.xyzx, r6.xyzx
  min r6.xyz, r6.xyzx, l(8.000000, 8.000000, 8.000000, 0.000000)
else
  lt r6.w, l(0.600000), r3.w
  if_nz r6.w
    add r6.w, -r1.w, l(1.000000)
    mad r7.xyz, -cb0[23].xyzx, r6.wwww, cb0[9].xyzx
    mul r8.xyz, r1.wwww, cb0[23].xyzx
    mad r7.xyz, -cb0[23].xyzx, r1.wwww, r7.xyzx
    mad r7.xyz, r0.xxxx, r7.xyzx, r8.xyzx
    mul r7.xyz, r4.zzzz, r7.xyzx
    add r8.xyz, r4.xywx, -r13.xyzx
    dp3 r6.w, r8.xyzx, r8.xyzx
    rsq r6.w, r6.w
    mul r8.xyz, r6.wwww, r8.xyzx
    dp3 r6.w, r3.xyzx, r5.yzwy
    max r7.w, r6.w, l(0.000000)
    mad r9.x, r6.w, l(0.500000), l(0.500000)
    mov r9.y, r2.y
    sample_l r9.xyzw, r9.xyxx, t6.xyzw, s7, l(0.000000)
    add r10.xy, -r2.wxww, l(1.000000, 1.000000, 0.000000, 0.000000)
    mad r11.xyz, r0.yzwy, r5.xxxx, -r8.xyzx
    dp3 r6.w, r11.xyzx, r11.xyzx
    rsq r6.w, r6.w
    mul r11.xyz, r6.wwww, r11.xyzx
    dp3 r6.w, r3.xyzx, r11.xyzx
    max r6.w, r6.w, l(0.000000)
    dp3 r8.x, r3.xyzx, -r8.xyzx
    dp3 r8.y, r5.yzwy, r11.xyzx
    max r8.xy, r8.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
    mul r8.z, r10.x, r10.x
    mul r8.w, r8.z, l(0.500000)
    mad r9.w, -r8.z, l(0.500000), l(1.000000)
    mad r10.x, r7.w, r9.w, r8.w
    mad r8.x, r8.x, r9.w, r8.w
    mad r8.x, r10.x, r8.x, l(0.000010)
    div r8.x, l(1.000000, 1.000000, 1.000000, 1.000000), r8.x
    mul r8.w, r8.z, r8.z
    mul r6.w, r6.w, r6.w
    mad r8.z, r8.z, r8.z, l(-1.000000)
    mad r6.w, r6.w, r8.z, l(1.000000)
    mul r8.z, r6.w, l(3.14159274)
    mad r6.w, r8.z, r6.w, l(1.000000012E-007)
    div r6.w, r8.w, r6.w
    mul r6.w, r6.w, r8.x
    mul r6.w, r7.w, r6.w
    eq r7.w, cb0[3].w, l(0.000000)
    movc r7.w, r7.w, l(0.616850257), l(0.785398185)
    mul r6.w, r6.w, r7.w
    max r6.w, r6.w, l(0.000000)
    mul r8.xzw, r1.xxyz, r7.xxyz
    mul r7.xyz, r7.xyzx, r6.wwww
    add r6.w, -r8.y, l(1.000000)
    mul r7.w, r6.w, r6.w
    mul r7.w, r7.w, r7.w
    mul r6.w, r6.w, r7.w
    mad r6.w, r10.y, r6.w, r2.x
    mul r7.xyz, r6.wwww, r7.xyzx
    mad r6.xyz, r8.xzwx, r9.xyzx, r7.xyzx
  else
    lt r3.w, l(0.300000), r3.w
    if_nz r3.w
      add r3.w, -r1.w, l(1.000000)
      mad r7.xyz, -cb0[23].xyzx, r3.wwww, cb0[9].xyzx
      mul r8.xyz, r1.wwww, cb0[23].xyzx
      mad r7.xyz, -cb0[23].xyzx, r1.wwww, r7.xyzx
      mad r7.xyz, r0.xxxx, r7.xyzx, r8.xyzx
      mul r7.xyz, r4.zzzz, r7.xyzx
      add r8.xyz, r4.xywx, -r13.xyzx
      dp3 r3.w, r8.xyzx, r8.xyzx
      rsq r3.w, r3.w
      mul r8.xyz, r3.wwww, r8.xyzx
      max r3.w, r2.y, r2.x
      max r3.w, r2.z, r3.w
      mad r9.xyz, r0.yzwy, r5.xxxx, -r8.xyzx
      dp3 r6.w, r9.xyzx, r9.xyzx
      rsq r6.w, r6.w
      mul r9.xyz, r6.wwww, r9.xyzx
      dp3_sat r6.w, r9.xyzx, -r8.xyzx
      dp3 r7.w, r3.xyzx, r9.xyzx
      max r7.w, r7.w, l(0.000000)
      min r7.w, r7.w, l(0.999999)
      mul r8.w, r7.w, r7.w
      dp3_sat r8.x, r3.xyzx, -r8.xyzx
      dp3_sat r8.y, r3.xyzx, r5.yzwy
      add r8.z, -r2.w, l(1.000000)
      add r9.w, -r3.w, l(1.000000)
      add r6.w, -r6.w, l(1.000000)
      mul r10.x, r6.w, r6.w
      mul r10.x, r10.x, r10.x
      mul r6.w, r6.w, r10.x
      mad r3.w, r9.w, r6.w, r3.w
      mad r6.w, -r7.w, r7.w, l(1.000000)
      div r7.w, r8.w, r6.w
      mul r6.w, r6.w, r6.w
      mad r8.w, r8.z, r8.z, l(0.000001)
      mad r9.w, r8.w, l(4.000000), l(1.000000)
      mul r9.w, r9.w, l(3.14159274)
      div r9.w, l(1.000000, 1.000000, 1.000000, 1.000000), r9.w
      div r7.w, -r7.w, r8.w
      mul r7.w, r7.w, l(1.442695)
      exp r7.w, r7.w
      mul r7.w, r7.w, l(4.000000)
      div r6.w, r7.w, r6.w
      add r6.w, r6.w, l(1.000000)
      mul r6.w, r6.w, r9.w
      add r7.w, r8.x, r8.y
      mad r7.w, -r8.y, r8.x, r7.w
      mul r7.w, r7.w, l(4.000000)
      div r7.w, l(1.000000, 1.000000, 1.000000, 1.000000), r7.w
      mul r3.w, r3.w, r6.w
      mul r3.w, r7.w, r3.w
      min r3.w, r3.w, l(4.000000)
      mul r3.w, r8.y, r3.w
      dp3_sat r6.w, r5.yzwy, r9.xyzx
      add r7.w, -r8.y, l(1.000000)
      mul r8.w, r7.w, r7.w
      mul r8.w, r8.w, r8.w
      mul r7.w, r7.w, r8.w
      add r8.x, -r8.x, l(1.000000)
      mul r8.w, r8.x, r8.x
      mul r8.w, r8.w, r8.w
      mul r8.x, r8.x, r8.w
      mul r6.w, r6.w, r6.w
      dp2 r6.w, r6.wwww, r8.zzzz
      add r6.w, r6.w, l(-0.500000)
      mad r7.w, r6.w, r7.w, l(1.000000)
      mad r6.w, r6.w, r8.x, l(1.000000)
      mul r6.w, r6.w, r7.w
      mul r6.w, r8.y, r6.w
      mul r8.xzw, r7.xxyz, r6.wwww
      mul r9.xyz, r2.xyzx, r3.wwww
      mul r7.xyz, r7.xyzx, r9.xyzx
      mul r7.xyz, r8.yyyy, r7.xyzx
      mad r6.xyz, r8.xzwx, r1.xyzx, r7.xyzx
    else
      add r3.w, -r1.w, l(1.000000)
      mad r7.xyz, -cb0[23].xyzx, r3.wwww, cb0[9].xyzx
      mul r8.xyz, r1.wwww, cb0[23].xyzx
      mad r7.xyz, -cb0[23].xyzx, r1.wwww, r7.xyzx
      mad r7.xyz, r0.xxxx, r7.xyzx, r8.xyzx
      mul r7.xyz, r4.zzzz, r7.xyzx
      add r8.xyzw, -r2.wxyz, l(1.000000, 1.000000, 1.000000, 1.000000)
      add r4.xyz, r4.xywx, -r13.xyzx
      dp3 r0.x, r4.xyzx, r4.xyzx
      rsq r0.x, r0.x
      mul r4.xyz, r0.xxxx, r4.xyzx
      dp3 r0.x, r3.xyzx, r5.yzwy
      mad r0.yzw, r0.yyzw, r5.xxxx, -r4.xxyz
      dp3 r1.w, r0.yzwy, r0.yzwy
      max r1.w, r1.w, l(0.001000)
      rsq r1.w, r1.w
      mul r0.yzw, r0.yyzw, r1.wwww
      dp3 r1.w, r3.xyzx, r0.yzwy
      max r1.w, r1.w, l(0.000000)
      dp3 r2.w, r3.xyzx, -r4.xyzx
      max r2.w, r2.w, l(0.000000)
      dp3 r0.y, r5.yzwy, r0.yzwy
      max r0.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
      max r0.z, r8.x, l(0.010000)
      mul r0.w, r0.z, r0.z
      mad r0.z, -r0.z, r0.z, l(1.000000)
      mad r3.x, r2.w, r0.z, r0.w
      mad r0.z, r0.x, r0.z, r0.w
      mul r0.z, r0.z, r2.w
      mad r0.z, r0.x, r3.x, r0.z
      add r0.z, r0.z, l(0.000010)
      div r0.z, l(2.000000), r0.z
      mul r2.w, r0.w, r0.w
      mul r1.w, r1.w, r1.w
      mad r0.w, r0.w, r0.w, l(-1.000000)
      mad r0.w, r1.w, r0.w, l(1.000000)
      mul r1.w, r0.w, l(3.14159274)
      mad r0.w, r1.w, r0.w, l(1.000000012E-007)
      div r0.w, r2.w, r0.w
      mul r0.z, r0.w, r0.z
      mul r0.z, r0.z, l(0.785398185)
      mul r0.z, r0.x, r0.z
      max r0.z, r0.z, l(0.000000)
      mul r1.xyz, r1.xyzx, r7.xyzx
      add r0.y, -r0.y, l(1.000000)
      mul r0.w, r0.y, r0.y
      mul r0.w, r0.w, r0.w
      mul r0.y, r0.y, r0.w
      mad r2.xyz, r8.yzwy, r0.yyyy, r2.xyzx
      mul r2.xyz, r2.xyzx, r7.xyzx
      mul r0.yzw, r0.zzzz, r2.xxyz
      mad r6.xyz, r1.xyzx, r0.xxxx, r0.yzwy
    endif
  endif
endif
mov o0.xyz, r6.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 0 instruction slots used