// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 9a0d0ecc792e41a3-vs.txt
// 3DMigoto: 9a0d0ecc792e41a3 | Matched 16 variants of 1 shaders: Kyoto/VFX/Transparent Diffuse Additive Lit
//
//          Unity headers extracted from TransparentDiffuseAdditiveLit.shader
//          Shader "Kyoto/VFX/Transparent Diffuse Additive Lit" {
//            Properties {
//            [HideInInspector]  _Mode ("__mode", Float) = 2.000000
//            [HideInInspector]  _SrcBlend ("__src", Float) = 1.000000
//            [HideInInspector]  _DstBlend ("__dst", Float) = 0.000000
//             _Color ("Color", Color) = (1.000000,1.000000,1.000000,1.000000)
//             _MainTex ("Albedo", 2D) = "white" { }
//             _DepthFeatherAmount ("Depth Feather", Range(0.000000,500.000000)) = 1.000000
//             _ShadowProjectionAlphaModulation ("Shadow Alpha Projection Offset", Range(1.000000,20.000000)) = 5.000000
//             _ShadowBias ("Shadow Bias", Range(0.000000,0.900000)) = 0.100000
//             _NormalDirectionalStrength ("Directional light NdotL strength", Range(0.000000,1.000000)) = 1.000000
//             _WorldSpaceNormalOverrideBias ("World Space Normal Override Bias", Range(0.000000,1.000000)) = 0.000000
//             _WorldSpaceNormalOverrideDir ("World Space Normal Direction", Vector) = (0.000000,1.000000,0.000000,1.000000)
//            }
//            Fallback Off
//            SubShader 1/1 {
//              Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" }
//              Pass 2/3 {
//                Name "FORWARD_DELTA"
//                Tags { "LIGHTMODE"="ForwardAdd" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" }
//                ZWrite Off
//                Cull Off
//                Blend SrcAlpha One
//                GpuProgramID 73056
//                Program "vp" {
//                  SubProgram "d3d11 " {
// 0001:              GpuProgramIndex 169
// 0002:              GpuProgramIndex 170
// 0004:              GpuProgramIndex 172
// 0008:              GpuProgramIndex 173
// 0010:              GpuProgramIndex 184
// 0020:              GpuProgramIndex 185
// 0040:              GpuProgramIndex 187
// 0080:              GpuProgramIndex 188
// 0100:              GpuProgramIndex 214
// 0200:              GpuProgramIndex 215
// 0400:              GpuProgramIndex 217
// 0800:              GpuProgramIndex 218
// 1000:              GpuProgramIndex 229
// 2000:              GpuProgramIndex 230
// 4000:              GpuProgramIndex 232
// 8000:              GpuProgramIndex 233
//                  }
//                }
//              }
//            }
//          }
//
//       Unity 5.3 headers extracted from TransparentDiffuseAdditiveLit.shader.decompressed:
//         API d3d11
//         Shader model vs_4_0
//         undeciphered1: 201510240 30 0 0
// 0100:   Keywords { "POINT" "SHADOWS_CUBE" "LIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 0001:   Keywords { "POINT" "SHADOWS_CUBE" "LIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" }
// 1000:   Keywords { "POINT" "SHADOWS_CUBE" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 0010:   Keywords { "POINT" "SHADOWS_CUBE" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" }
// 0400:   Keywords { "POINT" "SHADOWS_CUBE" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 0004:   Keywords { "POINT" "SHADOWS_CUBE" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" }
// 4000:   Keywords { "POINT" "SHADOWS_CUBE" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 0040:   Keywords { "POINT" "SHADOWS_CUBE" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" }
// 0200:   Keywords { "POINT_COOKIE" "SHADOWS_CUBE" "LIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 0002:   Keywords { "POINT_COOKIE" "SHADOWS_CUBE" "LIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" }
// 2000:   Keywords { "POINT_COOKIE" "SHADOWS_CUBE" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 0020:   Keywords { "POINT_COOKIE" "SHADOWS_CUBE" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" }
// 0800:   Keywords { "POINT_COOKIE" "SHADOWS_CUBE" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 0008:   Keywords { "POINT_COOKIE" "SHADOWS_CUBE" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" }
// 8000:   Keywords { "POINT_COOKIE" "SHADOWS_CUBE" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 0080:   Keywords { "POINT_COOKIE" "SHADOWS_CUBE" "SHADOWS_SOFT" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" }
//         undeciphered2: 1 0 5 0 0 0
//         undeciphered3: 15 4 0 0 2 1 1 2 3 4
//         ConstBuffer "$Globals" 288
//         Vector 224 [_MainTex_ST]
//         Matrix 96 [unity_WorldToLight]
//         ConstBuffer "UnityPerCamera" 144
//         Vector 64 [_WorldSpaceCameraPos] 3
//         Vector 80 [_ProjectionParams]
//         ConstBuffer "UnityPerCameraRare" 352
//         Matrix 288 [unity_CameraToWorld]
//         ConstBuffer "UnityLighting" 720
//         Vector 0 [_WorldSpaceLightPos0]
//         Vector 16 [_LightPositionRange]
//         ConstBuffer "UnityPerDraw" 352
//         Matrix 0 [glstate_matrix_mvp]
//         Matrix 64 [glstate_matrix_modelview0]
//         Matrix 192 [unity_ObjectToWorld]
//         BindCB "$Globals" 0
//         BindCB "UnityPerCamera" 1
//         BindCB "UnityPerCameraRare" 2
//         BindCB "UnityLighting" 3
//         BindCB "UnityPerDraw" 4
//
// 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:01 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz
// TEXCOORD                 0   xy          2     NONE   float   xy
// TEXCOORD                 1   xy          3     NONE   float
// TANGENT                  0   xyzw        4     NONE   float
// COLOR                    0   xyzw        5     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xyz         6     NONE   float   xyz
// TEXCOORD                 6   xyz         7     NONE   float   xyz
// TEXCOORD                 7   xyz         8     NONE   float   xyz
// TEXCOORD                 9   xyzw        9     NONE   float   xyzw
// TEXCOORD                10   xyzw       10     NONE   float   xyzw
// COLOR                    0   xyzw       11     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[15], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[22], immediateIndexed
dcl_constantbuffer cb3[2], immediateIndexed
dcl_constantbuffer cb4[22], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_input v5.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyz
dcl_output o7.xyz
dcl_output o8.xyz
dcl_output o9.xyzw
dcl_output o10.xyzw
dcl_output o11.xyzw
dcl_temps 5

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

ld_indexable(texture2d)(float,float,float,float) r3.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 9a0d0ecc792e41a3-vs.txt

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

mul r0.xyzw, v0.yyyy, cb4[1].xyzw
mad r0.xyzw, cb4[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb4[2].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb4[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 9a0d0ecc792e41a3-vs.txt
ne r3.w, r0.w, l(1.0)
if_nz r3.w
  add r3.w, r0.w, -r3.y
  mad r0.x, r3.w, r3.x, r0.x
endif

mul r1.xyzw, v0.xyzw, l(1.000000, 1.000000, -1.000000, 1.000000)
mul r2.xyz, r1.yyyy, cb2[19].xyzx
mad r2.xyz, cb2[18].xyzx, r1.xxxx, r2.xyzx
mad r1.xyz, cb2[20].xyzx, r1.zzzz, r2.xyzx
mad r1.xyz, cb2[21].xyzx, r1.wwww, r1.xyzx
add o1.xyz, r1.xyzx, -r4.xyzx
mul r1.w, r0.y, cb1[5].x
mul r2.w, r1.w, l(0.500000)
mul r2.xz, r0.xxwx, l(0.500000, 0.000000, 0.500000, 0.000000)
add r0.xy, r2.zzzz, r2.xwxx
mov o2.xyw, r0.xyxw
mov o10.xyzw, r0.xyzw
mul r0.x, v0.y, cb4[5].z
mad r0.x, cb4[4].z, v0.x, r0.x
mad r0.x, cb4[6].z, v0.z, r0.x
add r0.x, r0.x, cb4[7].z
mov o2.z, -r0.x
mad r0.xyz, -r1.xyzx, cb3[0].wwww, cb3[0].xyzx
mov o6.xyz, r1.xyzx
mov r0.w, l(0)
mov o3.xyzw, r0.wwwx
mov o4.xyzw, r0.wwwy
mov o5.w, r0.z
mov o5.xyz, v1.xyzx
mul r0.xyzw, v0.yyyy, cb4[13].xyzw
mad r0.xyzw, cb4[12].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb4[14].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb4[15].xyzw, v0.wwww, r0.xyzw
mul r1.xyz, r0.yyyy, cb0[7].xyzx
mad r1.xyz, cb0[6].xyzx, r0.xxxx, r1.xyzx
mad r1.xyz, cb0[8].xyzx, r0.zzzz, r1.xyzx
mad o7.xyz, cb0[9].xyzx, r0.wwww, r1.xyzx
add o8.xyz, r0.xyzx, -cb3[1].xyzx
mad o9.xy, v2.xyxx, cb0[14].xyxx, cb0[14].zwzz
mov o9.zw, l(0,0,0,0)
mov o11.xyzw, v5.xyzw
ret
// Approximately 0 instruction slots used