// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed 4cf95268011fa855-vs.txt
// 3DMigoto: 4cf95268011fa855 | Matched 2 variants of 2 shaders: TextMeshPro/Distance Field, TextMeshPro/Distance Field Overlay
//
// 2:    Unity headers extracted from TextMeshPro_Distance Field
// 1:    Unity headers extracted from TextMeshPro_Distance Field Overlay
// 1:    Shader "TextMeshPro/Distance Field Overlay" {
// 2:    Shader "TextMeshPro/Distance Field" {
//         CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
//         Fallback "TextMeshPro/Mobile/Distance Field"
//         SubShader 1/1 {
// 1:        Tags { "IGNOREPROJECTOR"="true" "QUEUE"="Overlay" "RenderType"="Transparent" }
// 2:        Tags { "IGNOREPROJECTOR"="true" "QUEUE"="Transparent" "RenderType"="Transparent" }
//           Pass 1/1 {
// 1:          Tags { "IGNOREPROJECTOR"="true" "QUEUE"="Overlay" "RenderType"="Transparent" }
// 2:          Tags { "IGNOREPROJECTOR"="true" "QUEUE"="Transparent" "RenderType"="Transparent" }
//             ZWrite Off
//             Program "vp" {
//               SubProgram "d3d11" {
//               }
//             }
//           }
//         }
//       }
//
// 1: Unity 5.3 headers extracted from TextMeshPro_Distance Field Overlay:
// 2: Unity 5.3 headers extracted from TextMeshPro_Distance Field:
//      API d3d11
//      Shader model vs_4_0
//      undeciphered1: 201609010 64 0 0
//      undeciphered1a: 4
//      undeciphered2: 1 0 4 0 0 0
//      undeciphered3: 31 5 0 0 1 2 2 1 3 4 4 5
//      ConstBuffer "$Globals" 496
//      Float 64 [_FaceDilate]
//      Float 68 [_OutlineSoftness]
//      Float 96 [_OutlineWidth]
//      Float 356 [_WeightNormal]
//      Float 360 [_WeightBold]
//      Float 364 [_ScaleRatioA]
//      Float 376 [_VertexOffsetX]
//      Float 380 [_VertexOffsetY]
//      Vector 416 [_ClipRect]
//      Float 432 [_MaskSoftnessX]
//      Float 436 [_MaskSoftnessY]
//      Float 448 [_GradientScale]
//      Float 452 [_ScaleX]
//      Float 456 [_ScaleY]
//      Float 460 [_PerspectiveFilter]
//      Vector 464 [_FaceTex_ST]
//      Vector 480 [_OutlineTex_ST]
//      Matrix 176 [_EnvMatrix]
//      ConstBuffer "UnityPerCamera" 144
//      Vector 64 [_WorldSpaceCameraPos] 3
//      Vector 96 [_ScreenParams]
//      ConstBuffer "UnityPerDraw" 160
//      Matrix 0 [unity_ObjectToWorld]
//      Matrix 64 [unity_WorldToObject]
//      ConstBuffer "UnityPerFrame" 384
//      Matrix 80 [glstate_matrix_projection]
//      Matrix 272 [unity_MatrixVP]
//      BindCB "$Globals" 0
//      BindCB "UnityPerCamera" 1
//      BindCB "UnityPerDraw" 2
//      BindCB "UnityPerFrame" 3
//
// 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 17:55:15 2019
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
// TEXCOORD                 1   xy          4     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy
// TEXCOORD                 1   xyzw        3     NONE   float   xyzw
// TEXCOORD                 2   xyzw        4     NONE   float   xyzw
// TEXCOORD                 3   xyz         5     NONE   float   xyz
// TEXCOORD                 5   xyzw        6     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[31], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[7], immediateIndexed
dcl_constantbuffer cb3[24], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xy
dcl_input v4.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xy
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyz
dcl_output o6.xyzw
dcl_temps 6
dcl_constantbuffer cb10[4], immediateIndexed

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

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


// Unity reflection/specular 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 4cf95268011fa855-vs.txt

mul r4.w, -r4.x, r4.y
mad r5.xyz, -r4.wwww, cb10[0].xyzw, cb1[4].xyzw

add r0.xy, v0.xyxx, cb0[23].zwzz
mul r1.xyzw, r0.yyyy, cb2[1].xyzw
mad r1.xyzw, cb2[0].xyzw, r0.xxxx, r1.xyzw
mad r1.xyzw, cb2[2].xyzw, v0.zzzz, r1.xyzw
add r2.xyzw, r1.xyzw, cb2[3].xyzw
mad r1.xyz, cb2[3].xyzx, v0.wwww, r1.xyzx
add r1.xyz, -r1.xyzx, r5.xyzx
mul r3.xyzw, r2.yyyy, cb3[18].xyzw
mad r3.xyzw, cb3[17].xyzw, r2.xxxx, r3.xyzw
mad r3.xyzw, cb3[19].xyzw, r2.zzzz, r3.xyzw
mad r2.xyzw, cb3[20].xyzw, r2.wwww, r3.xyzw
mov o0.xyzw, r2.xyzw
mov o1.xyzw, v2.xyzw
mov o2.xy, v3.xyxx
dp3 r2.x, v1.xyzx, cb2[4].xyzx
dp3 r2.y, v1.xyzx, cb2[5].xyzx
dp3 r2.z, v1.xyzx, cb2[6].xyzx
dp3 r0.z, r2.xyzx, r2.xyzx
rsq r0.z, r0.z
mul r2.xyz, r0.zzzz, r2.xyzx
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r3.xyz, r0.zzzz, r1.xyzx
dp3 r0.z, r2.xyzx, r3.xyzx
mul r2.xy, cb1[6].yyyy, cb3[6].xyxx
mad r2.xy, cb3[5].xyxx, cb1[6].xxxx, r2.xyxx
mul r2.xy, |r2.xyxx|, cb0[28].yzyy
div r2.xy, r2.wwww, r2.xyxx
dp2 r0.w, r2.xyxx, r2.xyxx
mad r2.xy, cb0[27].xyxx, l(0.250000, 0.250000, 0.000000, 0.000000), r2.xyxx
div o4.zw, l(0.000000, 0.000000, 0.250000, 0.250000), r2.xxxy
rsq r0.w, r0.w
mul r1.w, |v4.y|, cb0[28].x
mul r0.w, r0.w, r1.w
mul r1.w, r0.w, l(1.500000)
add r2.x, -cb0[28].w, l(1.000000)
mul r2.x, |r1.w|, r2.x
mad r0.w, r0.w, l(1.500000), -r2.x
mad r0.z, |r0.z|, r0.w, r2.x
eq r0.w, cb3[8].w, l(0.000000)
movc r2.y, r0.w, r0.z, r1.w
ge r0.z, l(0.000000), v4.y
and r0.z, r0.z, l(0x3f800000)
add r0.w, -cb0[22].y, cb0[22].z
mad r0.z, r0.z, r0.w, cb0[22].y
mad r0.z, r0.z, l(0.250000), cb0[4].x
mul r0.z, r0.z, cb0[22].w
mul r2.w, r0.z, l(0.500000)
mov o3.yw, r2.yyyw
div r0.w, l(0.500000), r2.y
mad r1.w, -cb0[6].x, cb0[22].w, l(1.000000)
mad r1.w, -cb0[4].y, cb0[22].w, r1.w
mad r1.w, r1.w, l(0.500000), -r0.w
mad o3.x, -r0.z, l(0.500000), r1.w
mad r0.z, -r0.z, l(0.500000), l(0.500000)
add o3.z, r0.w, r0.z
max r2.xyzw, cb0[26].xyzw, l(-20000000000.000000, -20000000000.000000, -20000000000.000000, -20000000000.000000)
min r2.xyzw, r2.xyzw, l(20000000000.000000, 20000000000.000000, 20000000000.000000, 20000000000.000000)
mad r0.xy, r0.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), -r2.xyxx
add o4.xy, -r2.zwzz, r0.xyxx
mul r0.xyz, r1.yyyy, cb0[12].xyzx
mad r0.xyz, cb0[11].xyzx, r1.xxxx, r0.xyzx
mad o5.xyz, cb0[13].xyzx, r1.zzzz, r0.xyzx
mul r0.x, v4.x, l(0.000244140625)
round_ni r0.z, r0.x
mad r0.w, -r0.z, l(4096.000000), v4.x
mul r0.xy, r0.zwzz, l(0.00195312500, 0.00195312500, 0.000000, 0.000000)
mad o6.xy, r0.xyxx, cb0[29].xyxx, cb0[29].zwzz
mad o6.zw, r0.xxxy, cb0[30].xxxy, cb0[30].zzzw
ret
// Approximately 0 instruction slots used