// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed d57ca488783a4cca-vs.txt
// 3DMigoto: d57ca488783a4cca |    Unity headers extracted from Hidden_Internal-MotionVectors
//    Shader "Hidden/Internal-MotionVectors" {
//      SubShader 1/1 {
//        Pass 1/3 {
//          Tags { "LIGHTMODE"="MOTIONVECTORS" }
//          ZWrite Off
//          Program "vp" {
//            SubProgram "d3d11" {
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from Hidden_Internal-MotionVectors:
//   API d3d11
//   Shader model vs_4_0
//   undeciphered1: 201609010 22 0 0
//   undeciphered1a: 3
//   undeciphered2: 1 0 3 0 0 0
//   undeciphered3: 3 2 0 0 1 2
//   ConstBuffer "$Globals" 240
//   ScalarBool 224 [_HasLastPositionData]
//   Float 232 [_MotionVectorDepthBias]
//   Matrix 32 [_NonJitteredVP]
//   Matrix 96 [_PreviousVP]
//   Matrix 160 [_PreviousM]
//   ConstBuffer "UnityPerDraw" 160
//   Matrix 0 [unity_ObjectToWorld]
//   ConstBuffer "UnityPerFrame" 384
//   Matrix 272 [unity_MatrixVP]
//   BindCB "$Globals" 0
//   BindCB "UnityPerDraw" 1
//   BindCB "UnityPerFrame" 2
//
// 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:02:36 2019
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 1   xyzw        1     NONE   float   xyzw
// SV_POSITION              0   xyzw        2      POS   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[15], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb2[21], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output_siv o2.xyzw, position
dcl_temps 4

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

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

mul r0.xyzw, v0.yyyy, cb1[1].xyzw
mad r0.xyzw, cb1[0].xyzw, v0.xxxx, r0.xyzw
mad r0.xyzw, cb1[2].xyzw, v0.zzzz, r0.xyzw
mad r1.xyzw, cb1[3].xyzw, v0.wwww, r0.xyzw
add r0.xyzw, r0.xyzw, cb1[3].xyzw
mul r2.xyzw, r1.yyyy, cb0[3].xyzw
mad r2.xyzw, cb0[2].xyzw, r1.xxxx, r2.xyzw
mad r2.xyzw, cb0[4].xyzw, r1.zzzz, r2.xyzw
mad o0.xyzw, cb0[5].xyzw, r1.wwww, r2.xyzw
mov r1.xyz, v1.xyzx
mov r1.w, l(1.000000)
movc r1.xyzw, cb0[14].xxxx, r1.xyzw, v0.xyzw
mul r2.xyzw, r1.yyyy, cb0[11].xyzw
mad r2.xyzw, cb0[10].xyzw, r1.xxxx, r2.xyzw
mad r2.xyzw, cb0[12].xyzw, r1.zzzz, r2.xyzw
mad r1.xyzw, cb0[13].xyzw, r1.wwww, r2.xyzw
mul r2.xyzw, r1.yyyy, cb0[7].xyzw
mad r2.xyzw, cb0[6].xyzw, r1.xxxx, r2.xyzw
mad r2.xyzw, cb0[8].xyzw, r1.zzzz, r2.xyzw
mad o1.xyzw, cb0[9].xyzw, r1.wwww, r2.xyzw
mul r1.xyzw, r0.yyyy, cb2[18].xyzw
mad r1.xyzw, cb2[17].xyzw, r0.xxxx, r1.xyzw
mad r1.xyzw, cb2[19].xyzw, r0.zzzz, r1.xyzw
mad r0.xyzw, cb2[20].xyzw, r0.wwww, r1.xyzw

// Relocated to here with asmtool.py
mov o2.xyw, r0.xyxw

// 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 d57ca488783a4cca-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

mad o2.z, -cb0[14].z, r0.w, r0.z

// mov o2.xyw, r0.xyxw // Relocated from here with asmtool.py

ret
// Approximately 0 instruction slots used