// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed f87c287ffc546971-vs.txt
// 3DMigoto: f87c287ffc546971 | Matched 5 variants of 1 shaders: Kyoto/VFX/ShaderForge/S_Particle_Alpha
//
//        Unity headers extracted from S_Particle_Alpha.shader
//        Shader "Kyoto/VFX/ShaderForge/S_Particle_Alpha" {
//          Properties {
//           _node_1373 ("node_1373", 2D) = "white" { }
//           _Depth_Amount ("Depth_Amount", Range(0.000000,50.000000)) = 0.000000
//           _Texture_Amount ("Texture_Amount", Range(0.000000,50.000000)) = 0.000000
//          [HideInInspector]  _Cutoff ("Alpha cutoff", Range(0.000000,1.000000)) = 0.500000
//           _Color ("Color", Color) = (1.000000,1.000000,1.000000,1.000000)
//          }
//          SubShader 1/1 {
//            LOD 200
//            Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
//            Pass 1/1 {
//              Name "FORWARDBASE"
//              Tags { "LIGHTMODE"="ForwardBase" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "RenderType"="Transparent" }
//              ZWrite Off
//              Blend SrcAlpha OneMinusSrcAlpha
//              GpuProgramID 38529
//              Program "vp" {
//                SubProgram "d3d11 " {
// 01:              GpuProgramIndex 10
// 02:              GpuProgramIndex 11
// 04:              GpuProgramIndex 12
// 08:              GpuProgramIndex 13
// 10:              GpuProgramIndex 14
//                }
//              }
//            }
//          }
//        }
//
//     Unity 5.3 headers extracted from S_Particle_Alpha.shader.decompressed:
//       API d3d11
//       Shader model vs_4_0
//       undeciphered1: 201510240 132 0 0
// 01:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "ATMOSPHERICS_DEBUG" }
// 02:   Keywords { "DIRECTIONAL" "SHADOWS_OFF" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "ATMOSPHERICS_DEBUG" }
// 08:   Keywords { "DIRECTIONAL" "SHADOWS_OFF" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "VERTEXLIGHT_ON" "ATMOSPHERICS_DEBUG" }
// 04:   Keywords { "DIRECTIONAL" "SHADOWS_SCREEN" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "ATMOSPHERICS_DEBUG" }
// 10:   Keywords { "DIRECTIONAL" "SHADOWS_SCREEN" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "VERTEXLIGHT_ON" "ATMOSPHERICS_DEBUG" }
//       undeciphered2: 1 0 3 0 0 0
//       undeciphered3: 13 3 0 0 2 1 3 4
//       ConstBuffer "$Globals" 544
//       Vector 48 [unity_ColorSpaceLuminance]
//       ScalarInt 96 [u_AtmosphericsDebugMode]
//       Vector 100 [u_SunDirection] 3
//       Float 176 [u_WorldScaleExponent]
//       Float 180 [u_WorldNormalDistanceRcp]
//       Float 184 [u_WorldNearScatterPush]
//       Float 188 [u_WorldRayleighDensity]
//       Float 192 [u_WorldMieDensity]
//       Vector 196 [u_RayleighColorM20] 3
//       Vector 208 [u_RayleighColorM10] 3
//       Vector 224 [u_RayleighColorO00] 3
//       Vector 240 [u_RayleighColorP10] 3
//       Vector 256 [u_RayleighColorP20] 3
//       Vector 288 [u_MieColorM20] 3
//       Vector 304 [u_MieColorO00] 3
//       Vector 320 [u_MieColorP20] 3
//       Float 348 [u_HeightNormalDistanceRcp]
//       Float 352 [u_HeightNearScatterPush]
//       Float 356 [u_HeightRayleighDensity]
//       Float 360 [u_HeightMieDensity]
//       Float 364 [u_HeightSeaLevel]
//       Vector 368 [u_HeightPlaneShift] 3
//       Float 380 [u_HeightDistanceRcp]
//       Vector 400 [u_RayleighInScatterPct] 2
//       Float 428 [u_MiePhaseAnisotropy]
//       Float 432 [u_HeightExtinctionFactor]
//       Float 436 [u_RayleighExtinctionFactor]
//       Float 440 [u_MieExtinctionFactor]
//       Vector 448 [u_HeightRayleighColor]
//       Vector 464 [_DistanceFogColor] 3
//       Float 476 [_DistanceFogThickness]
//       ConstBuffer "UnityPerCamera" 144
//       Vector 64 [_WorldSpaceCameraPos] 3
//       Vector 80 [_ProjectionParams]
//       ConstBuffer "UnityPerDraw" 352
//       Matrix 0 [glstate_matrix_mvp]
//       Matrix 64 [glstate_matrix_modelview0]
//       Matrix 192 [unity_ObjectToWorld]
//       BindCB "$Globals" 0
//       BindCB "UnityPerCamera" 1
//       BindCB "UnityPerDraw" 2
//
// 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:12 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// COLOR                    0   xyzw        2     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 1   xyzw        3     NONE   float   xyzw
// TEXCOORD                 2   xyzw        4     NONE   float   xyzw
// TEXCOORD                 3   xyz         5     NONE   float   xyz
// TEXCOORD                 4   xyzw        6     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[30], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[22], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyz
dcl_output o6.xyzw
dcl_temps 9

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125
dcl_constantbuffer cb10[4], immediateIndexed

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


// Unity reflection/specular fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed f87c287ffc546971-vs.txt

mul r7.w, -r7.x, r7.y
mad r8.xyz, -r7.wwww, cb10[0].xyzw, cb1[4].xyzw

mul r0.xyzw, v0.yyyy, cb2[1].xyzw
mad r0.xyzw, cb2[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb2[2].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb2[3].xyzw, v0.wwww, r0.xyzw
mov o0.xyzw, r0.xyzw

// Automatic vertex shader halo fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed f87c287ffc546971-vs.txt
ne r7.w, r0.w, l(1.0)
if_nz r7.w
  add r7.w, r0.w, -r7.y
  mad r0.x, r7.w, r7.x, r0.x
endif

mov o1.xy, v1.xyxx
mov o2.xyzw, v2.xyzw
mul r0.y, r0.y, cb1[5].x
mul r1.xzw, r0.xxwy, l(0.500000, 0.000000, 0.500000, 0.500000)
mov o3.w, r0.w
add o3.xy, r1.zzzz, r1.xwxx
mul r0.x, v0.y, cb2[5].z
mad r0.x, cb2[4].z, v0.x, r0.x
mad r0.x, cb2[6].z, v0.z, r0.x
add r0.x, r0.x, cb2[7].z
mov o3.z, -r0.x
lt r0.xy, l(0.000000, 0.000000, 0.000000, 0.000000), r8.xzxx
lt r0.zw, r8.xxxz, l(0.000000, 0.000000, 0.000000, 0.000000)
iadd r0.xy, -r0.xyxx, r0.zwzz
itof r0.xy, r0.xyxx
log r0.zw, |r8.xxxz|
mul r0.zw, r0.zzzw, cb0[11].xxxx
exp r0.zw, r0.zzzw
mul r0.xz, r0.zzwz, r0.xxyx
mul r1.xyz, v0.yyyy, cb2[13].xyzx
mad r1.xyz, cb2[12].xyzx, v0.xxxx, r1.xyzx
mad r1.xyz, cb2[14].xyzx, v0.zzzz, r1.xyzx
mad r1.xyz, cb2[15].xyzx, v0.wwww, r1.xyzx
lt r2.xy, l(0.000000, 0.000000, 0.000000, 0.000000), r1.xzxx
lt r2.zw, r1.xxxz, l(0.000000, 0.000000, 0.000000, 0.000000)
iadd r2.xy, -r2.xyxx, r2.zwzz
itof r2.xy, r2.xyxx
log r2.zw, |r1.xxxz|
mul r2.zw, r2.zzzw, cb0[11].xxxx
exp r2.zw, r2.zzzw
mul r2.xz, r2.zzwz, r2.xxyx
mov r0.y, r8.y
mov r2.y, r1.y
add r0.xyz, -r0.xyzx, r2.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
sqrt r0.w, r0.w
div r1.w, r0.y, r0.w
dp3 r0.x, r0.xyzx, cb0[23].xyzx
add r0.x, -r0.x, r2.y
add r1.xyz, r1.xyzx, -r8.xyzx
add r0.x, r0.x, -cb0[22].w
mul r0.x, r0.x, cb0[23].w
mul r0.xy, r0.xwxx, l(-1.442695, 0.004000, 0.000000, 0.000000)
exp r0.x, r0.x
min r0.y, r0.y, l(1.000000)
mul r0.z, r0.y, r1.w
mad r2.xyzw, r1.wwww, r0.yyyy, l(-0.116000, 0.116000, 0.216000, 0.216000)
mul r2.xyzw, r2.xzwy, l(10.000000, 10.000000, 4.62962961, 8.620690)
mul r3.xy, r0.zzzz, l(4.62962961, 8.620690, 0.000000, 0.000000)
ge r4.xyz, r0.zzzz, l(0.116000, 0.000000, -0.116000, 0.000000)
add r5.xyz, -cb0[14].xyzx, cb0[15].xyzx
mad r3.yzw, r3.yyyy, r5.xxyz, cb0[14].xxyz
add r5.xyz, -cb0[13].xyzx, cb0[14].xyzx
mad r5.xyz, r2.wwww, r5.xyzx, cb0[13].xyzx
mov_sat r2.xyz, r2.xyzx
add r6.xyz, -cb0[12].yzwy, cb0[13].xyzx
mad r6.xyz, r2.yyyy, r6.xyzx, cb0[12].yzwy
movc r5.xyz, r4.zzzz, r5.xyzx, r6.xyzx
movc r3.yzw, r4.yyyy, r3.yyzw, r5.xxyz
add r5.xyz, -cb0[15].xyzx, cb0[16].xyzx
mad r2.xyw, r2.xxxx, r5.xyxz, cb0[15].xyxz
movc r2.xyw, r4.xxxx, r2.xyxw, r3.yzyw
mul r3.yzw, r2.xxyw, cb0[3].xxyz
add r0.yz, r3.zzwz, r3.yyyy
mul r0.z, r0.z, r3.z
mad r0.y, r2.w, cb0[3].z, r0.y
sqrt r0.z, r0.z
dp2 r0.z, cb0[3].wwww, r0.zzzz
add r0.y, r0.z, r0.y
add r2.xyw, -r0.yyyy, r2.xyxw
add r0.z, r0.w, cb0[11].z
max r0.z, r0.z, l(0.000000)
mul r3.yz, r0.zzzz, cb0[11].yywy
mul r0.z, r0.z, cb0[12].x
mul r0.z, r0.z, l(1.442695)
exp r0.z, r0.z
add r0.z, -r0.z, l(1.000000)
mov_sat r3.xy, r3.xyxx
mul r1.w, r3.z, l(1.442695)
exp r1.w, r1.w
add r1.w, -r1.w, l(1.000000)
mad r2.xyw, r3.yyyy, r2.xyxw, r0.yyyy
dp3 r0.y, r1.xyzx, r1.xyzx
rsq r0.y, r0.y
mul r1.xyz, r0.yyyy, r1.xyzx
dp3 r0.y, r1.xyzx, cb0[6].yzwy
mul r1.x, r0.y, r0.y
mad r1.x, r1.x, l(0.0596831031), l(0.0596831031)
mul r1.x, r1.x, l(12.000000)
min r1.x, r1.x, l(1.000000)
mul r1.x, r1.x, r1.w
mul r1.yzw, r2.xxyw, r1.xxxx
mad r1.x, -r1.x, cb0[27].y, l(1.000000)
add r2.xyw, -cb0[19].xyxz, cb0[20].xyxz
mad r2.xyw, r3.xxxx, r2.xyxw, cb0[19].xyxz
add r3.xyz, -cb0[18].xyzx, cb0[19].xyzx
mad r3.xyz, r2.zzzz, r3.xyzx, cb0[18].xyzx
movc r2.xyz, r4.yyyy, r2.xywx, r3.xyzx
mad r2.w, r0.y, r0.y, l(1.000000)
add r3.x, cb0[26].w, cb0[26].w
mad r3.yz, cb0[26].wwww, cb0[26].wwww, l(0.000000, 2.000000, 1.000000, 0.000000)
mad r0.y, -r3.x, r0.y, r3.z
log r0.y, r0.y
mul r0.y, r0.y, l(1.500000)
exp r0.y, r0.y
div r0.y, r2.w, r0.y
mad r2.w, -cb0[26].w, cb0[26].w, l(1.000000)
div r2.w, r2.w, r3.y
mul r0.y, r0.y, r2.w
mul r0.y, r0.y, l(0.119366206)
add r2.w, r0.w, cb0[22].x
mul_sat o6.w, r0.w, cb0[29].w
max r0.w, r2.w, l(0.000000)
mul r3.xy, r0.wwww, cb0[22].yzyy
mul_sat r0.w, r0.w, cb0[21].w
mul r3.xy, r3.xyxx, l(1.442695, 1.442695, 0.000000, 0.000000)
exp r3.xy, r3.xyxx
add r3.xy, -r3.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r3.xy, r0.xxxx, r3.xyxx
mul_sat r0.x, r0.y, r3.y
mul r0.y, r0.y, r0.z
mul r3.yzw, r2.xxyz, r0.xxxx
mad r2.xyz, r0.yyyy, r2.xyzx, r3.yzwy
mad r0.x, -r0.y, cb0[27].z, l(1.000000)
max r0.x, r0.x, l(0.000000)
mad r3.yzw, r1.yyzw, cb0[25].xxxx, r2.xxyz
mul r4.xyz, cb0[3].xyzx, cb0[28].xyzx
add r0.yz, r4.yyzy, r4.xxxx
mul r0.z, r0.z, r4.y
mad r0.y, cb0[28].z, cb0[3].z, r0.y
sqrt r0.z, r0.z
dp2 r0.z, cb0[3].wwww, r0.zzzz
add r0.y, r0.z, r0.y
add r4.xyz, -r0.yyyy, cb0[28].xyzx
mad r0.yzw, r0.wwww, r4.xxyz, r0.yyyy
mov_sat r2.w, r3.x
mad r1.x, -r3.x, cb0[27].x, r1.x
max r1.x, r1.x, l(0.000000)
mul o4.w, r0.x, r1.x
mul r0.xyz, r0.yzwy, r2.wwww
ieq r4.xyz, cb0[6].xxxx, l(4, 5, 6, 0)
movc r3.xyz, r4.zzzz, r0.xyzx, r3.yzwy
mad o5.xyz, r1.yzwy, cb0[25].yyyy, r0.xyzx
movc r0.xyz, r4.yyyy, r2.xyzx, r3.xyzx
movc o4.xyz, r4.xxxx, r1.yzwy, r0.xyzx
mov o6.xyz, cb0[29].xyzx
ret
// Approximately 0 instruction slots used