// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed ee53d3c01eaa2021-vs.txt
// 3DMigoto: ee53d3c01eaa2021 |    Unity headers extracted from Decal_DecalShader Diffuse+Normals
//    Shader "Decal/DecalShader Diffuse+Normals" {
//      SubShader 1/1 {
//        Pass 1/1 {
//          ZWrite Off
//          Program "vp" {
//            SubProgram "d3d11" {
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from Decal_DecalShader Diffuse+Normals:
//   API d3d11
//   Shader model vs_4_0
//   undeciphered1: 201609010 33 0 0
//   undeciphered1a: 2
//   undeciphered2: 1 0 3 0 0 0
//   undeciphered3: 1 1 0 0
//   ConstBuffer "UnityPerCamera" 144
//   Vector 80 [_ProjectionParams]
//   ConstBuffer "UnityPerDraw" 160
//   Matrix 0 [unity_ObjectToWorld]
//   ConstBuffer "UnityPerFrame" 384
//   Matrix 144 [unity_MatrixV]
//   Matrix 272 [unity_MatrixVP]
//   BindCB "UnityPerCamera" 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:03:57 2019
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz
//
//
// 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   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyz         3     NONE   float   xyz
// TEXCOORD                 3   xyz         4     NONE   float   xyz
// TEXCOORD                 4   xyz         5     NONE   float   xyz
// TEXCOORD                 5   xyz         6     NONE   float   xyz
//
vs_4_0
dcl_constantbuffer cb0[6], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb2[21], immediateIndexed
dcl_input v0.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_output o3.xyz
dcl_output o4.xyz
dcl_output o5.xyz
dcl_output o6.xyz
dcl_temps 3

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

ld_indexable(texture2d)(float,float,float,float) r2.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
add r0.xyzw, r0.xyzw, cb1[3].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
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 ee53d3c01eaa2021-vs.txt
ne r2.w, r0.w, l(1.0)
if_nz r2.w
  add r2.w, r0.w, -r2.y
  mad r0.x, r2.w, r2.x, r0.x
endif

add o1.xy, v0.xzxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mul r0.y, r0.y, cb0[5].x
mul r1.xzw, r0.xxwy, l(0.500000, 0.000000, 0.500000, 0.500000)
mov o2.zw, r0.zzzw
add o2.xy, r1.zzzz, r1.xwxx
mul r0.xyz, cb1[1].yyyy, cb2[10].xyzx
mad r0.xyz, cb2[9].xyzx, cb1[1].xxxx, r0.xyzx
mad r0.xyz, cb2[11].xyzx, cb1[1].zzzz, r0.xyzx
mad r0.xyz, cb2[12].xyzx, cb1[1].wwww, r0.xyzx
mul r0.xyz, r0.xyzx, v0.yyyy
mul r1.xyz, cb1[0].yyyy, cb2[10].xyzx
mad r1.xyz, cb2[9].xyzx, cb1[0].xxxx, r1.xyzx
mad r1.xyz, cb2[11].xyzx, cb1[0].zzzz, r1.xyzx
mad r1.xyz, cb2[12].xyzx, cb1[0].wwww, r1.xyzx
mad r0.xyz, r1.xyzx, v0.xxxx, r0.xyzx
mul r1.xyz, cb1[2].yyyy, cb2[10].xyzx
mad r1.xyz, cb2[9].xyzx, cb1[2].xxxx, r1.xyzx
mad r1.xyz, cb2[11].xyzx, cb1[2].zzzz, r1.xyzx
mad r1.xyz, cb2[12].xyzx, cb1[2].wwww, r1.xyzx
mad r0.xyz, r1.xyzx, v0.zzzz, r0.xyzx
mul r1.xyz, cb1[3].yyyy, cb2[10].xyzx
mad r1.xyz, cb2[9].xyzx, cb1[3].xxxx, r1.xyzx
mad r1.xyz, cb2[11].xyzx, cb1[3].zzzz, r1.xyzx
mad r1.xyz, cb2[12].xyzx, cb1[3].wwww, r1.xyzx
add r0.xyz, r0.xyzx, r1.xyzx
mul o3.xyz, r0.xyzx, l(-1.000000, -1.000000, 1.000000, 0.000000)
mov o4.xyz, cb1[1].xyzx
mov o5.xyz, cb1[0].xyzx
mov o6.xyz, cb1[2].xyzx
ret
// Approximately 0 instruction slots used