// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed cd2fe3de8400ffc9-vs.txt
// 3DMigoto: cd2fe3de8400ffc9 | Matched 2 variants of 1 shaders: Hidden/Kyoto/KyotoDeferredReflections
//
//       Unity headers extracted from Kyoto-DeferredReflections.shader
//       Shader "Hidden/Kyoto/KyotoDeferredReflections" {
//         Properties {
//          _SrcBlend ("", Float) = 1.000000
//          _DstBlend ("", Float) = 1.000000
//         }
//         Fallback Off
//         SubShader 1/1 {
//           Pass 2/2 {
//             ZTest Always
//             ZWrite Off
//             Blend [_SrcBlend] [_DstBlend]
//             GpuProgramID 99870
//             Program "vp" {
//               SubProgram "d3d11 " {
// 1:              GpuProgramIndex 2
// 2:              GpuProgramIndex 3
//               }
//             }
//           }
//         }
//       }
//
//    Unity 5.3 headers extracted from Kyoto-DeferredReflections.shader.decompressed:
//      API d3d11
//      Shader model vs_4_0
//      undeciphered1: 201510240 8 0 0
// 2:   Keywords { "UNITY_HDR_ON" }
//      undeciphered2: 1 0 2 0 0 0
//      undeciphered3: 1 1 0 0
//      ConstBuffer "UnityPerCamera" 144
//      Vector 80 [_ProjectionParams]
//      ConstBuffer "UnityPerDraw" 352
//      Matrix 0 [glstate_matrix_mvp]
//      BindCB "UnityPerCamera" 0
//      BindCB "UnityPerDraw" 1
//
// 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:59:07 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy
// SV_POSITION              0   xyzw        1      POS   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[6], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_input v0.xyzw
dcl_output o0.xy
dcl_output_siv o1.xyzw, position
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
mad r0.xyzw, cb1[3].xyzw, v0.wwww, r0.xyzw

// Relocated to here with asmtool.py
mov o1.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 cd2fe3de8400ffc9-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

mul r1.x, r0.y, cb0[5].x
mul r1.w, r1.x, l(0.500000)
mul r1.xz, r0.xxwx, l(0.500000, 0.000000, 0.500000, 0.000000)

// mov o1.xyzw, r0.xyzw // Relocated from here with asmtool.py

add o0.xy, r1.zzzz, r1.xwxx
ret
// Approximately 0 instruction slots used