// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed aa0060f7f857b83a-vs.txt
// 3DMigoto: aa0060f7f857b83a | Matched 6 variants of 1 shaders: ProBuilder/Standard Vertex Color
//
//        Unity headers extracted from ProBuilder_Standard Vertex Color
//        Shader "ProBuilder/Standard Vertex Color" {
//          Fallback "Standard"
//          SubShader 1/1 {
//            Tags { "RenderType"="Opaque" }
//            Pass 2/3 {
//              Name "FORWARD_DELTA"
//              Tags { "LIGHTMODE"="FORWARDADD" "RenderType"="Opaque" "SHADOWSUPPORT"="true" }
//              Program "vp" {
//                SubProgram "d3d11" {
//                }
//              }
//            }
//          }
//        }
//
//     Unity 5.3 headers extracted from ProBuilder_Standard Vertex Color:
//       API d3d11
//       Shader model vs_4_0
//       undeciphered1: 201609010 35 0 0
//       undeciphered1a: 4
// 04:   Keywords { "DIRECTIONAL_COOKIE" "SHADOWS_SCREEN" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_OFF" "LIGHTMAP_OFF" }
// 08:   Keywords { "DIRECTIONAL_COOKIE" "SHADOWS_SCREEN" "DIRLIGHTMAP_COMBINED" "DYNAMICLIGHTMAP_ON" "LIGHTMAP_OFF" }
// 01:   Keywords { "DIRECTIONAL_COOKIE" "SHADOWS_SCREEN" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "LIGHTMAP_OFF" }
// 10:   Keywords { "DIRECTIONAL_COOKIE" "SHADOWS_SCREEN" "DYNAMICLIGHTMAP_OFF" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" }
// 02:   Keywords { "DIRECTIONAL_COOKIE" "SHADOWS_SCREEN" "DYNAMICLIGHTMAP_ON" "DIRLIGHTMAP_OFF" "LIGHTMAP_OFF" }
// 20:   Keywords { "DIRECTIONAL_COOKIE" "SHADOWS_SCREEN" "DYNAMICLIGHTMAP_ON" "LIGHTMAP_OFF" "DIRLIGHTMAP_SEPARATE" }
//       undeciphered2: 1 0 4 0 0 0
//       undeciphered3: 191 7 0 0 1 2 7 8 3 4 4 5 5 6 2 1
//       ConstBuffer "$Globals" 1200
//       Matrix 1056 [unity_WorldToLight]
//       ConstBuffer "UnityPerCamera" 144
//       Vector 80 [_ProjectionParams]
//       ConstBuffer "UnityPerDraw" 160
//       Matrix 0 [unity_ObjectToWorld]
//       Matrix 64 [unity_WorldToObject]
//       ConstBuffer "UnityPerFrame" 384
//       Matrix 272 [unity_MatrixVP]
//       BindCB "$Globals" 0
//       BindCB "UnityPerCamera" 1
//       BindCB "UnityPerDraw" 2
//       BindCB "UnityPerFrame" 3
//
// Headers extracted with DarkStarSword's extract_unity55_shaders.py
// https://github.com/DarkStarSword/3d-fixes

//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Sun Apr 21 18:00:13 2019
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz
// TANGENT                  0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
// TEXCOORD                 1   xy          4     NONE   float   xy
// TEXCOORD                 2   xy          5     NONE   float   xy
// COLOR                    0   xyzw        6     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
// TEXCOORD                 1     zw        1     NONE   float     zw
// TEXCOORD                 2   xy          2     NONE   float   xy
// TEXCOORD                 7     zw        2     NONE   float     zw
// TEXCOORD                 3   xyzw        3     NONE   float   xyzw
// TEXCOORD                 4   xyz         4     NONE   float   xyz
// TEXCOORD                 5   xyz         5     NONE   float   xyz
// TEXCOORD                 6   xyz         6     NONE   float   xyz
// COLOR                    0   xyzw        7     NONE   float   xyzw
// TEXCOORD                 8   xyzw        8     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[70], immediateIndexed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[7], immediateIndexed
dcl_constantbuffer cb3[21], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xy
dcl_input v4.xy
dcl_input v5.xy
dcl_input v6.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o1.zw
dcl_output o2.xy
dcl_output o2.zw
dcl_output o3.xyzw
dcl_output o4.xyz
dcl_output o5.xyz
dcl_output o6.xyz
dcl_output o7.xyzw
dcl_output o8.xyzw
dcl_temps 5

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125

ld_indexable(texture2d)(float,float,float,float) r4.xyzw, l(0, 0, 0, 0), t125.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
add r1.xyzw, r0.xyzw, cb2[3].xyzw
mad r0.xyzw, cb2[3].xyzw, v0.wwww, r0.xyzw
mul r2.xyzw, r1.yyyy, cb3[18].xyzw
mad r2.xyzw, cb3[17].xyzw, r1.xxxx, r2.xyzw
mad r2.xyzw, cb3[19].xyzw, r1.zzzz, r2.xyzw
mad r1.xyzw, cb3[20].xyzw, r1.wwww, r2.xyzw
mov o0.xyzw, r1.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 aa0060f7f857b83a-vs.txt
ne r4.w, r1.w, l(1.0)
if_nz r4.w
  add r4.w, r1.w, -r4.y
  mad r1.x, r4.w, r4.x, r1.x
endif

mov o1.xy, v3.xyxx
mov o1.zw, v4.xxxy
mul r2.xy, r0.yyyy, cb0[67].xyxx
mad r2.xy, cb0[66].xyxx, r0.xxxx, r2.xyxx
mad r2.xy, cb0[68].xyxx, r0.zzzz, r2.xyxx
mad o2.zw, cb0[69].xxxy, r0.wwww, r2.xxxy
mov o3.xyzw, r0.xyzw
mov o2.xy, v5.xyxx
dp3 r0.x, v1.xyzx, cb2[4].xyzx
dp3 r0.y, v1.xyzx, cb2[5].xyzx
dp3 r0.z, v1.xyzx, cb2[6].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mov o4.xyz, r0.xyzx
mul r2.xyz, v2.yyyy, cb2[1].xyzx
mad r2.xyz, cb2[0].xyzx, v2.xxxx, r2.xyzx
mad r2.xyz, cb2[2].xyzx, v2.zzzz, r2.xyzx
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r2.xyzx
mov o5.xyz, r2.xyzx
mul r3.xyz, r0.zxyz, r2.yzxy
mad r0.xyz, r0.yzxy, r2.zxyz, -r3.xyzx
mul r0.xyz, r0.xyzx, v2.wwww
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul o6.xyz, r0.wwww, r0.xyzx
mov o7.xyzw, v6.xyzw
mul r0.x, r1.y, cb1[5].x
mul r0.w, r0.x, l(0.500000)
mul r0.xz, r1.xxwx, l(0.500000, 0.000000, 0.500000, 0.000000)
mov o8.zw, r1.zzzw
add o8.xy, r0.zzzz, r0.xwxx
ret
// Approximately 0 instruction slots used