// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 06574aef11a5b70c-vs.txt
// 3DMigoto: 06574aef11a5b70c | Matched 2 variants of 2 shaders: Hidden/UberShader/903A4D0CE38C0B82B6662688246EE5F6, Hidden/UberShader/D11B611BDE29C6A083D401FAD3CAAA87
//
// 1:    Unity headers extracted from 903A4D0CE38C0B82B6662688246EE5F6.shader
// 2:    Unity headers extracted from D11B611BDE29C6A083D401FAD3CAAA87.shader
// 1:    Shader "Hidden/UberShader/903A4D0CE38C0B82B6662688246EE5F6" {
// 2:    Shader "Hidden/UberShader/D11B611BDE29C6A083D401FAD3CAAA87" {
//         Properties {
//          _UberShaderColorMask ("Uber color mask", Float) = 15
//          _Color ("Color", Color) = (1,1,1,1)
//          _DepthFlipScreen ("Depth Flip Screen", Vector) = (0,0,0,0)
//          _DistortionMaskTex ("Distortion Mask Tex", 2D) = "white" { }
//          _DistortionMaskTex_US_ST ("Distortion Mask Tex_US_ST", Vector) = (0,0,0,0)
//          _DistortionSettings ("Distortion Settings", Vector) = (0,0,0,0)
//          _DistortionTex ("Distortion Tex", 2D) = "white" { }
//          _DistortionTex_US_ST ("Distortion Tex_US_ST", Vector) = (0,0,0,0)
//          _MainTex ("Main Tex", 2D) = "white" { }
//          _MainTex_US_ATLAS ("Main Tex_US_ATLAS", Vector) = (0,0,1,1)
//          _MainTex_US_ATLAS_ST ("Main Tex_US_ATLAS_ST", Vector) = (0,0,1,1)
//          _MainTex_US_ST ("Main Tex_US_ST", Vector) = (0,0,0,0)
//          _Screen ("Screen", Vector) = (0,0,0,0)
//          _ScreenMask ("Screen Mask", Vector) = (0,0,0,0)
//         }
//         SubShader 1/1 {
//           Tags { "IGNOREPROJECTOR"="true" "RenderType"="TransparentCutout" "UberShaderShader"="true" }
//           Pass 1/1 {
//             Tags { "IGNOREPROJECTOR"="true" "RenderType"="TransparentCutout" "UberShaderShader"="true" }
//             ZTest Less
//             ZWrite Off
//             Cull Off
//             Blend DstColor SrcColor, Zero OneMinusSrcAlpha
//             ColorMask [_UberShaderColorMask]
//             GpuProgramID 23247
//             Program "vp" {
//               SubProgram "d3d11 " {
//                 GpuProgramIndex 1
//               }
//             }
//           }
//         }
//       }
//
// 1: Unity 5.3 headers extracted from 903A4D0CE38C0B82B6662688246EE5F6.shader.decompressed:
// 2: Unity 5.3 headers extracted from D11B611BDE29C6A083D401FAD3CAAA87.shader.decompressed:
//      API d3d11
//      Shader model vs_4_0
//      undeciphered1: 201509030 45 0 0
//      undeciphered2: 1 0 2 0 0
//      undeciphered3: 9 2 0 0 3 4
//      ConstBuffer "$Globals" 432
//      Float 96 [_GameTime]
//      Float 104 [_GlobalDebugScale]
//      Vector 112 [_DepthFlipScreen]
//      Vector 272 [_MainTex_ST]
//      Vector 288 [_MainTex_US_ST]
//      Vector 368 [_DistortionTex_ST]
//      Vector 384 [_DistortionTex_US_ST]
//      Vector 400 [_DistortionMaskTex_ST]
//      Vector 416 [_DistortionMaskTex_US_ST]
//      ConstBuffer "UnityPerDraw" 352
//      Matrix 0 [glstate_matrix_mvp]
//      Matrix 192 [_Object2World]
//      BindCB "$Globals" 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.2 on Mon Jul 23 23:41:55 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[27], immediateIndexed
dcl_constantbuffer cb1[16], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
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

add r0.x, cb0[7].x, l(200.000000)
mul r0.x, r0.x, l(0.000833333354)
add r0.y, cb0[6].z, l(1.000000)
mul r0.yz, r0.yyyy, v0.xxyx
mul r1.xyz, r0.zzzz, cb1[1].xywx
mad r0.yzw, cb1[0].xxyw, r0.yyyy, r1.xxyz
mad r0.yzw, cb1[2].xxyw, v0.zzzz, r0.yyzw
mad r1.xyw, cb1[3].xyxw, v0.wwww, r0.yzyw

// Relocated to here with asmtool.py
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 06574aef11a5b70c-vs.txt
ne r3.w, r1.w, l(1.0)
if_nz r3.w
  add r3.w, r1.w, -r3.y
  mad r1.x, r3.w, r3.x, r1.x
endif

mul r1.z, r0.x, r1.w

// mov o0.xyzw, r1.xyzw // Relocated from here with asmtool.py
mov o0.z, r1.z

mov o3.zw, r1.zzzw
mul r0.xyz, r1.xwyx, l(0.500000, 0.500000, -0.500000, 0.000000)
add o3.xy, r0.yyyy, r0.xzxx
mov o1.zw, l(0,0,0,0)
mul r0.xy, v0.yyyy, cb1[13].yxyy
mad r0.xy, cb1[12].yxyy, v0.xxxx, r0.xyxx
mad r0.xy, cb1[14].yxyy, v0.zzzz, r0.xyxx
mad r0.xy, cb1[15].yxyy, v0.wwww, r0.xyxx
add r0.xy, r0.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
mad r0.z, cb0[18].w, cb0[6].x, cb0[18].z
sincos r1.x, r2.x, r0.z
mul r0.zw, r0.xxxy, r1.xxxx
mad r0.z, r0.y, r2.x, -r0.z
mad r0.w, r0.x, r2.x, r0.w
add r0.zw, r0.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000)
mad r0.w, r0.w, cb0[17].y, cb0[17].w
mad o1.y, cb0[18].y, cb0[6].x, r0.w
mad r0.z, r0.z, cb0[17].x, cb0[17].z
mad o1.x, cb0[18].x, cb0[6].x, r0.z
mad r0.z, cb0[24].w, cb0[6].x, cb0[24].z
sincos r1.x, r2.x, r0.z
mul r0.zw, r0.xxxy, r1.xxxx
mad r0.y, r0.y, r2.x, -r0.z
mad r0.x, r0.x, r2.x, r0.w
add r0.x, r0.x, l(0.500000)
mad r0.x, r0.x, cb0[23].y, cb0[23].w
mad o2.y, cb0[24].y, cb0[6].x, r0.x
add r0.x, r0.y, l(0.500000)
mad r0.x, r0.x, cb0[23].x, cb0[23].z
mad o2.x, cb0[24].x, cb0[6].x, r0.x
mad r0.x, cb0[26].w, cb0[6].x, cb0[26].z
sincos r0.x, r1.x, r0.x
add r0.yz, v1.yyxy, l(0.000000, -0.500000, -0.500000, 0.000000)
mul r0.xw, r0.xxxx, r0.yyyz
mad r0.x, r0.z, r1.x, -r0.x
mad r0.y, r0.y, r1.x, r0.w
add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mad r0.y, r0.y, cb0[25].y, cb0[25].w
mad o2.w, cb0[26].y, cb0[6].x, r0.y
mad r0.x, r0.x, cb0[25].x, cb0[25].z
mad o2.z, cb0[26].x, cb0[6].x, r0.x
ret
// Approximately 0 instruction slots used