// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 2bd2be142599844d-vs.txt
// 3DMigoto: 2bd2be142599844d | Matched 2 variants of 2 shaders: Kyoto/VFX/ShaderForge/S_FlipGeo_ParticleDoubleSide, Kyoto/VFX/ShaderForge/Shader_Forge_Flipbook
//
// 1:    Unity headers extracted from S_FlipGeo_ParticleDoubleSide.shader
// 2:    Unity headers extracted from Shader_Forge_Flipbook.shader
// 1:    Shader "Kyoto/VFX/ShaderForge/S_FlipGeo_ParticleDoubleSide" {
// 2:    Shader "Kyoto/VFX/ShaderForge/Shader_Forge_Flipbook" {
//         Properties {
//          _SeqSettings ("SeqSettings", Vector) = (0.000000,0.000000,0.000000,0.000000)
//          _node_4387 ("node_4387", 2D) = "white" { }
//          _Texture_Amount ("Texture_Amount", Range(0.000000,150.000000)) = 0.000000
// 2:       _Depth_Blend ("Depth_Blend", Range(0.000000,150.000000)) = 0.000000
// 1:       _Depth_Blend ("Depth_Blend", Range(0.000000,500.000000)) = 0.000000
//          _COLOR ("COLOR", Color) = (1.000000,1.000000,1.000000,1.000000)
//         [HideInInspector]  _Cutoff ("Alpha cutoff", Range(0.000000,1.000000)) = 0.500000
//         }
//         SubShader 1/1 {
//           LOD 200
//           Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
//           Pass 2/2 {
//             Name "SHADOWCASTER"
//             Tags { "LIGHTMODE"="SHADOWCASTER" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "RenderType"="Transparent" }
//             Offset 1.000000, 1.000000
// 2:          GpuProgramID 125571
// 1:          GpuProgramID 88202
//             Program "vp" {
//               SubProgram "d3d11 " {
//                 GpuProgramIndex 8
//               }
//             }
//           }
//         }
//       }
//
// 1: Unity 5.3 headers extracted from S_FlipGeo_ParticleDoubleSide.shader.decompressed:
// 2: Unity 5.3 headers extracted from Shader_Forge_Flipbook.shader.decompressed:
//      API d3d11
//      Shader model vs_4_0
//      undeciphered1: 201510240 12 0 0
//      Keywords { "SHADOWS_DEPTH" }
//      undeciphered2: 1 0 2 0 0 0
//      undeciphered3: 9 2 0 0 3 4
//      ConstBuffer "UnityShadows" 416
//      Vector 80 [unity_LightShadowBias]
//      ConstBuffer "UnityPerDraw" 352
//      Matrix 0 [glstate_matrix_mvp]
//      BindCB "UnityShadows" 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:58:46 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 1   xy          1     NONE   float   xy
// TEXCOORD                 2   xyzw        2     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[6], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
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 r1.xyzw, r0.xyzw, cb1[3].xyzw
mad o2.xyzw, cb1[3].xyzw, v0.wwww, r0.xyzw

// Relocated to here with asmtool.py
mov o0.xyw, r1.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 2bd2be142599844d-vs.txt
ne r2.w, r1.w, l(1.0)
if_nz r2.w
  add r2.w, r1.w, -r2.y
  mad r1.x, r2.w, r2.x, r1.x
endif

div r0.x, cb0[5].x, r1.w
max r0.x, r0.x, l(-1.000000)
min r0.x, r0.x, l(0.000000)
add r0.x, r0.x, r1.z
min r0.y, r1.w, r0.x

// mov o0.xyw, r1.xyxw // Relocated from here with asmtool.py

add r0.y, -r0.x, r0.y
mad o0.z, cb0[5].y, r0.y, r0.x
mov o1.xy, v1.xyxx
ret
// Approximately 0 instruction slots used