// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 1a0e5b90bcf1b64b-vs.txt
// 3DMigoto: 1a0e5b90bcf1b64b | Matched 12 variants of 2 shaders: Kyoto/VFX/Transparent Diffuse Additive Lit, Kyoto/VFX/Transparent Diffuse Lit
//
// 03f:    Unity headers extracted from TransparentDiffuseAdditiveLit.shader
// fc0:    Unity headers extracted from TransparentDiffuseLit.shader
// 03f:    Shader "Kyoto/VFX/Transparent Diffuse Additive Lit" {
// fc0:    Shader "Kyoto/VFX/Transparent Diffuse 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" }
// fc0:        Pass 1/2 {
// 03f:        Pass 1/3 {
//               Name "FORWARD"
//               Tags { "LIGHTMODE"="ForwardBase" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" }
//               ZWrite Off
//               Cull Off
//               Blend SrcAlpha OneMinusSrcAlpha
// 03f:          GpuProgramID 32712
// fc0:          GpuProgramID 58409
//               Program "vp" {
//                 SubProgram "d3d11 " {
// 041:              GpuProgramIndex 10
// 082:              GpuProgramIndex 25
// 104:              GpuProgramIndex 40
// 208:              GpuProgramIndex 55
// 410:              GpuProgramIndex 70
// 820:              GpuProgramIndex 85
//                 }
//               }
//             }
//           }
//         }
//
// 03f: Unity 5.3 headers extracted from TransparentDiffuseAdditiveLit.shader.decompressed:
// fc0: Unity 5.3 headers extracted from TransparentDiffuseLit.shader.decompressed:
//        API d3d11
//        Shader model vs_4_0
//        undeciphered1: 201510240 139 0 0
// 082:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" "ATMOSPHERICS_DEBUG" }
// 410:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" "ATMOSPHERICS_DEBUG" }
// 104:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" "ATMOSPHERICS_DEBUG" }
// 820:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" "ATMOSPHERICS_DEBUG" }
// 041:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "ATMOSPHERICS_DEBUG" }
// 208:   Keywords { "DIRECTIONAL" "SHADOWS_DEPTH" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "UNITY_HDR_ON" "ATMOSPHERICS_DEBUG" }
//        undeciphered2: 1 0 4 0 0 0
//        undeciphered3: 15 4 0 0 2 1 1 2 3 4
//        ConstBuffer "$Globals" 720
//        Vector 48 [unity_ColorSpaceLuminance]
//        ScalarInt 228 [u_AtmosphericsDebugMode]
//        Vector 240 [u_SunDirection] 3
//        Float 320 [u_WorldScaleExponent]
//        Float 324 [u_WorldNormalDistanceRcp]
//        Float 328 [u_WorldNearScatterPush]
//        Float 332 [u_WorldRayleighDensity]
//        Float 336 [u_WorldMieDensity]
//        Vector 340 [u_RayleighColorM20] 3
//        Vector 352 [u_RayleighColorM10] 3
//        Vector 368 [u_RayleighColorO00] 3
//        Vector 384 [u_RayleighColorP10] 3
//        Vector 400 [u_RayleighColorP20] 3
//        Vector 432 [u_MieColorM20] 3
//        Vector 448 [u_MieColorO00] 3
//        Vector 464 [u_MieColorP20] 3
//        Float 492 [u_HeightNormalDistanceRcp]
//        Float 496 [u_HeightNearScatterPush]
//        Float 500 [u_HeightRayleighDensity]
//        Float 504 [u_HeightMieDensity]
//        Float 508 [u_HeightSeaLevel]
//        Vector 512 [u_HeightPlaneShift] 3
//        Float 524 [u_HeightDistanceRcp]
//        Vector 544 [u_RayleighInScatterPct] 2
//        Float 572 [u_MiePhaseAnisotropy]
//        Float 576 [u_HeightExtinctionFactor]
//        Float 580 [u_RayleighExtinctionFactor]
//        Float 584 [u_MieExtinctionFactor]
//        Vector 592 [u_HeightRayleighColor]
//        Vector 608 [_DistanceFogColor] 3
//        Float 620 [_DistanceFogThickness]
//        Vector 656 [_MainTex_ST]
//        ConstBuffer "UnityPerCamera" 144
//        Vector 64 [_WorldSpaceCameraPos] 3
//        Vector 80 [_ProjectionParams]
//        ConstBuffer "UnityPerCameraRare" 352
//        Matrix 288 [unity_CameraToWorld]
//        ConstBuffer "UnityPerDraw" 352
//        Matrix 0 [glstate_matrix_mvp]
//        Matrix 64 [glstate_matrix_modelview0]
//        BindCB "$Globals" 0
//        BindCB "UnityPerCamera" 1
//        BindCB "UnityPerCameraRare" 2
//        BindCB "UnityPerDraw" 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:44 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   xyzw        6     NONE   float   xyzw
// TEXCOORD                 6   xyz         7     NONE   float   xyz
// TEXCOORD                 7   xyzw        8     NONE   float   xyzw
// TEXCOORD                 8   xyzw        9     NONE   float   xyzw
// TEXCOORD                 9   xyz        10     NONE   float   xyz
// TEXCOORD                10   xyzw       11     NONE   float   xyzw
// TEXCOORD                11   xyzw       12     NONE   float   xyzw
// TEXCOORD                12   xyzw       13     NONE   float   xyzw
// COLOR                    0   xyzw       14     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[42], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[22], immediateIndexed
dcl_constantbuffer cb3[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.xyzw
dcl_output o7.xyz
dcl_output o8.xyzw
dcl_output o9.xyzw
dcl_output o10.xyz
dcl_output o11.xyzw
dcl_output o12.xyzw
dcl_output o13.xyzw
dcl_output o14.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 1a0e5b90bcf1b64b-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, cb3[1].xyzw
mad r0.xyzw, cb3[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb3[2].xyzw, v0.zzzz, r0.xyzw
mad r0.xyzw, cb3[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 1a0e5b90bcf1b64b-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

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 r2.xyz, cb2[20].xyzx, r1.zzzz, r2.xyzx
mad r2.xyz, cb2[21].xyzx, r1.wwww, r2.xyzx
add r3.xyz, r2.xyzx, -r8.xyzx
mov o1.xyz, r3.xyzx
mul r2.w, r0.y, cb1[5].x
mul r4.w, r2.w, l(0.500000)
mul r4.xz, r0.xxwx, l(0.500000, 0.000000, 0.500000, 0.000000)
add r0.xy, r4.zzzz, r4.xwxx
mov o2.xyw, r0.xyxw
mov o13.xyzw, r0.xyzw
mul r0.x, v0.y, cb3[5].z
mad r0.x, cb3[4].z, v0.x, r0.x
mad r0.x, cb3[6].z, v0.z, r0.x
add r0.x, r0.x, cb3[7].z
mov o2.z, -r0.x
mov o3.xyzw, l(0,0,0,0)
mov o4.xyzw, l(0,0,0,0)
mov o5.xyz, v1.xyzx
mov o5.w, l(0)
mov o6.xyzw, l(0,0,0,0)
mov o7.xyz, r2.xyzx
mul r0.xyzw, r1.yyyy, cb2[19].xyzw
mad r0.xyzw, cb2[18].xyzw, r1.xxxx, r0.xyzw
mad r0.xyzw, cb2[20].xyzw, r1.zzzz, r0.xyzw
mad o8.xyzw, cb2[21].xyzw, r1.wwww, r0.xyzw
lt r0.xy, l(0.000000, 0.000000, 0.000000, 0.000000), r2.xzxx
lt r0.zw, r2.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, |r2.xxxz|
mul r0.zw, r0.zzzw, cb0[20].xxxx
exp r0.zw, r0.zzzw
mul r2.xz, r0.zzwz, r0.xxyx
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[20].xxxx
exp r0.zw, r0.zzzw
mul r0.xz, r0.zzwz, r0.xxyx
mov r0.y, r8.y
add r0.xyz, -r0.xyzx, r2.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
sqrt r0.w, r0.w
div r1.x, r0.y, r0.w
dp3 r0.x, r0.xyzx, cb0[32].xyzx
add r0.x, -r0.x, r2.y
add r0.x, r0.x, -cb0[31].w
mul r0.x, r0.x, cb0[32].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.x
mad r1.xyzw, r1.xxxx, r0.yyyy, l(-0.116000, 0.116000, 0.216000, 0.216000)
mul r1.xyzw, r1.xzwy, l(10.000000, 10.000000, 4.62962961, 8.620690)
mul r2.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[23].xyzx, cb0[24].xyzx
mad r2.yzw, r2.yyyy, r5.xxyz, cb0[23].xxyz
add r5.xyz, -cb0[22].xyzx, cb0[23].xyzx
mad r5.xyz, r1.wwww, r5.xyzx, cb0[22].xyzx
mov_sat r1.xyz, r1.xyzx
add r6.xyz, -cb0[21].yzwy, cb0[22].xyzx
mad r6.xyz, r1.yyyy, r6.xyzx, cb0[21].yzwy
movc r5.xyz, r4.zzzz, r5.xyzx, r6.xyzx
movc r2.yzw, r4.yyyy, r2.yyzw, r5.xxyz
add r5.xyz, -cb0[24].xyzx, cb0[25].xyzx
mad r1.xyw, r1.xxxx, r5.xyxz, cb0[24].xyxz
movc r1.xyw, r4.xxxx, r1.xyxw, r2.yzyw
mul r2.yzw, r1.xxyw, cb0[3].xxyz
add r0.yz, r2.zzwz, r2.yyyy
mul r0.z, r0.z, r2.z
mad r0.y, r1.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 r1.xyw, -r0.yyyy, r1.xyxw
add r0.z, r0.w, cb0[20].z
max r0.z, r0.z, l(0.000000)
mul r2.yz, r0.zzzz, cb0[20].yywy
mul r0.z, r0.z, cb0[21].x
mul r0.z, r0.z, l(1.442695)
exp r0.z, r0.z
add r0.z, -r0.z, l(1.000000)
mov_sat r2.xy, r2.xyxx
mul r2.z, r2.z, l(1.442695)
exp r2.z, r2.z
add r2.z, -r2.z, l(1.000000)
mad r1.xyw, r2.yyyy, r1.xyxw, r0.yyyy
dp3 r0.y, r3.xyzx, r3.xyzx
rsq r0.y, r0.y
mul r3.xyz, r0.yyyy, r3.xyzx
dp3 r0.y, r3.xyzx, cb0[15].xyzx
mul r2.y, r0.y, r0.y
mad r2.y, r2.y, l(0.0596831031), l(0.0596831031)
mul r2.y, r2.y, l(12.000000)
min r2.y, r2.y, l(1.000000)
mul r2.y, r2.y, r2.z
mul r1.xyw, r1.xyxw, r2.yyyy
mad r2.y, -r2.y, cb0[36].y, l(1.000000)
add r3.xyz, -cb0[28].xyzx, cb0[29].xyzx
mad r2.xzw, r2.xxxx, r3.xxyz, cb0[28].xxyz
add r3.xyz, -cb0[27].xyzx, cb0[28].xyzx
mad r3.xyz, r1.zzzz, r3.xyzx, cb0[27].xyzx
movc r2.xzw, r4.yyyy, r2.xxzw, r3.xxyz
mad r1.z, r0.y, r0.y, l(1.000000)
add r3.x, cb0[35].w, cb0[35].w
mad r3.yz, cb0[35].wwww, cb0[35].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, r1.z, r0.y
mad r1.z, -cb0[35].w, cb0[35].w, l(1.000000)
div r1.z, r1.z, r3.y
mul r0.y, r0.y, r1.z
mul r0.y, r0.y, l(0.119366206)
add r1.z, r0.w, cb0[31].x
mul_sat o11.w, r0.w, cb0[38].w
max r0.w, r1.z, l(0.000000)
mul r3.xy, r0.wwww, cb0[31].yzyy
mul_sat r0.w, r0.w, cb0[30].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.xxzw, r0.xxxx
mad r2.xzw, r0.yyyy, r2.xxzw, r3.yyzw
mad r0.x, -r0.y, cb0[36].z, l(1.000000)
max r0.x, r0.x, l(0.000000)
mad r3.yzw, r1.xxyw, cb0[34].xxxx, r2.xxzw
mul r4.xyz, cb0[3].xyzx, cb0[37].xyzx
add r0.yz, r4.yyzy, r4.xxxx
mul r0.z, r0.z, r4.y
mad r0.y, cb0[37].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[37].xyzx
mad r0.yzw, r0.wwww, r4.xxyz, r0.yyyy
mov_sat r1.z, r3.x
mad r2.y, -r3.x, cb0[36].x, r2.y
max r2.y, r2.y, l(0.000000)
mul o9.w, r0.x, r2.y
mul r0.xyz, r0.yzwy, r1.zzzz
ieq r4.xyz, cb0[14].yyyy, l(4, 5, 6, 0)
movc r3.xyz, r4.zzzz, r0.xyzx, r3.yzwy
mad o10.xyz, r1.xywx, cb0[34].yyyy, r0.xyzx
movc r0.xyz, r4.yyyy, r2.xzwx, r3.xyzx
movc o9.xyz, r4.xxxx, r1.xywx, r0.xyzx
mov o11.xyz, cb0[38].xyzx
mad o12.xy, v2.xyxx, cb0[41].xyxx, cb0[41].zwzz
mov o12.zw, l(0,0,0,0)
mov o14.xyzw, v4.xyzw
ret
// Approximately 0 instruction slots used