// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 419a867e1bbfb9f9-vs.txt
// 3DMigoto: 419a867e1bbfb9f9 | Matched 2 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 " {
// 1:              GpuProgramIndex 151
// 2:              GpuProgramIndex 196
//               }
//             }
//           }
//         }
//       }
//
//    Unity 5.3 headers extracted from TransparentDiffuseAdditiveLit.shader.decompressed:
//      API d3d11
//      Shader model vs_4_0
//      undeciphered1: 201510240 33 0 0
// 2:   Keywords { "SPOT" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" }
// 1:   Keywords { "SPOT" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" }
//      undeciphered2: 1 0 6 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]
//      ConstBuffer "UnityShadows" 416
//      Matrix 128 [unity_WorldToShadow0]
//      Matrix 192 [unity_WorldToShadow1]
//      Matrix 256 [unity_WorldToShadow2]
//      Matrix 320 [unity_WorldToShadow3]
//      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 "UnityShadows" 4
//      BindCB "UnityPerDraw" 5
//
// 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:49 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
// COLOR                    0   xyzw        4     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   xyzw        7     NONE   float   xyzw
// TEXCOORD                 7   xyzw        8     NONE   float   xyzw
// 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[1], immediateIndexed
dcl_constantbuffer cb4[12], immediateIndexed
dcl_constantbuffer cb5[22], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_input v4.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.xyzw
dcl_output o8.xyzw
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 419a867e1bbfb9f9-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, cb5[1].xyzw
mad r0.xyzw, cb5[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb5[2].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb5[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 419a867e1bbfb9f9-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, cb5[5].z
mad r0.x, cb5[4].z, v0.x, r0.x
mad r0.x, cb5[6].z, v0.z, r0.x
add r0.x, r0.x, cb5[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, cb5[13].xyzw
mad r0.xyzw, cb5[12].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb5[14].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb5[15].xyzw, v0.wwww, r0.xyzw
mul r1.xyzw, r0.yyyy, cb0[7].xyzw
mad r1.xyzw, cb0[6].xyzw, r0.xxxx, r1.xyzw
mad r1.xyzw, cb0[8].xyzw, r0.zzzz, r1.xyzw
mad o7.xyzw, cb0[9].xyzw, r0.wwww, r1.xyzw
mul r1.xyzw, r0.yyyy, cb4[9].xyzw
mad r1.xyzw, cb4[8].xyzw, r0.xxxx, r1.xyzw
mad r1.xyzw, cb4[10].xyzw, r0.zzzz, r1.xyzw
mad o8.xyzw, cb4[11].xyzw, r0.wwww, r1.xyzw
mad o9.xy, v2.xyxx, cb0[14].xyxx, cb0[14].zwzz
mov o9.zw, l(0,0,0,0)
mov o11.xyzw, v4.xyzw
ret
// Approximately 0 instruction slots used