// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed cd976f0a7bb6677e-vs.txt
// 3DMigoto: cd976f0a7bb6677e |    Unity headers extracted from TMPro_SDF-Mobile.shader
//    Shader "TMPro/Mobile/Distance Field" {
//      Properties {
//       _FaceColor ("Face Color", Color) = (1.000000,1.000000,1.000000,1.000000)
//       _FaceDilate ("Face Dilate", Range(-1.000000,1.000000)) = 0.000000
//       _OutlineColor ("Outline Color", Color) = (0.000000,0.000000,0.000000,1.000000)
//       _OutlineWidth ("Outline Thickness", Range(0.000000,1.000000)) = 0.000000
//       _OutlineSoftness ("Outline Softness", Range(0.000000,1.000000)) = 0.000000
//       _UnderlayColor ("Border Color", Color) = (0.000000,0.000000,0.000000,0.500000)
//       _UnderlayOffsetX ("Border OffsetX", Range(-1.000000,1.000000)) = 0.000000
//       _UnderlayOffsetY ("Border OffsetY", Range(-1.000000,1.000000)) = 0.000000
//       _UnderlayDilate ("Border Dilate", Range(-1.000000,1.000000)) = 0.000000
//       _UnderlaySoftness ("Border Softness", Range(0.000000,1.000000)) = 0.000000
//       _WeightNormal ("Weight Normal", Float) = 0.000000
//       _WeightBold ("Weight Bold", Float) = 0.500000
//       _ShaderFlags ("Flags", Float) = 0.000000
//       _ScaleRatioA ("Scale RatioA", Float) = 1.000000
//       _ScaleRatioB ("Scale RatioB", Float) = 1.000000
//       _ScaleRatioC ("Scale RatioC", Float) = 1.000000
//       _MainTex ("Font Atlas", 2D) = "white" { }
//       _TextureWidth ("Texture Width", Float) = 512.000000
//       _TextureHeight ("Texture Height", Float) = 512.000000
//       _GradientScale ("Gradient Scale", Float) = 5.000000
//       _ScaleX ("Scale X", Float) = 1.000000
//       _ScaleY ("Scale Y", Float) = 1.000000
//       _PerspectiveFilter ("Perspective Correction", Range(0.000000,1.000000)) = 0.875000
//       _VertexOffsetX ("Vertex OffsetX", Float) = 0.000000
//       _VertexOffsetY ("Vertex OffsetY", Float) = 0.000000
//       _MaskTex ("Mask Texture", 2D) = "white" { }
//       _MaskCoord ("Mask Coordinates", Vector) = (0.000000,0.000000,100000.000000,100000.000000)
//       _MaskSoftnessX ("Mask SoftnessX", Float) = 0.000000
//       _MaskSoftnessY ("Mask SoftnessY", Float) = 0.000000
//       _StencilComp ("Stencil Comparison", Float) = 8.000000
//       _Stencil ("Stencil ID", Float) = 0.000000
//       _StencilOp ("Stencil Operation", Float) = 0.000000
//       _StencilWriteMask ("Stencil Write Mask", Float) = 255.000000
//       _StencilReadMask ("Stencil Read Mask", Float) = 255.000000
//      }
//      SubShader 1/1 {
//        Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
//        Pass 1/1 {
//          Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
//          ZTest [_ZTestMode]
//          ZWrite Off
//          Cull [_CullMode]
//          Stencil {
//             Ref [_Stencil]
//             ReadMask [_StencilReadMask]
//             WriteMask [_StencilWriteMask]
//             Comp [_StencilComp]
//             Pass [_StencilOp]
//            }
//          Blend One OneMinusSrcAlpha
//          GpuProgramID 7583
//          Program "vp" {
//            SubProgram "d3d11 " {
//              GpuProgramIndex 0
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from TMPro_SDF-Mobile.shader.decompressed:
//   API d3d11
//   Shader model vs_4_0
//   undeciphered1: 201510240 68 0 0
//   undeciphered2: 1 0 4 0 0 0
//   undeciphered3: 31 5 0 0 2 1 1 2 3 4 4 5
//   ConstBuffer "$Globals" 544
//   Vector 112 [_FaceColor]
//   Float 128 [_FaceDilate]
//   Float 132 [_OutlineSoftness]
//   Vector 144 [_OutlineColor]
//   Float 160 [_OutlineWidth]
//   Float 420 [_WeightNormal]
//   Float 424 [_WeightBold]
//   Float 428 [_ScaleRatioA]
//   Float 440 [_VertexOffsetX]
//   Float 444 [_VertexOffsetY]
//   Float 496 [_GradientScale]
//   Float 500 [_ScaleX]
//   Float 504 [_ScaleY]
//   Float 508 [_PerspectiveFilter]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 64 [_WorldSpaceCameraPos] 3
//   Vector 96 [_ScreenParams]
//   ConstBuffer "UnityPerDraw" 352
//   Matrix 0 [glstate_matrix_mvp]
//   Matrix 192 [unity_ObjectToWorld]
//   Matrix 256 [unity_WorldToObject]
//   ConstBuffer "UnityPerFrame" 272
//   Matrix 0 [glstate_matrix_projection]
//   BindCB "$Globals" 0
//   BindCB "UnityPerCamera" 1
//   BindCB "UnityPerDraw" 2
//   BindCB "UnityPerFrame" 3
//
// 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
// 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    y
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// COLOR                    1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
// TEXCOORD                 1   xyzw        4     NONE   float   xyzw
// TEXCOORD                 2   xyzw        5     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[32], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[22], immediateIndexed
dcl_constantbuffer cb3[4], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xy
dcl_input v4.y
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xy
dcl_output o4.xyzw
dcl_output o5.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 cd976f0a7bb6677e-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[27].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
mad r1.xyzw, cb2[3].xyzw, v0.wwww, r1.xyzw
mov o0.xyzw, r1.xyzw
mul r2.xyzw, v2.xyzw, cb0[7].xyzw
mul r2.xyz, r2.wwww, r2.xyzx
mov o1.xyzw, r2.xyzw
mul r1.xyz, r0.yyyy, cb2[13].xyzx
mad r1.xyz, cb2[12].xyzx, r0.xxxx, r1.xyzx
mov o5.xy, r0.xyxx
mad r0.xyz, cb2[14].xyzx, v0.zzzz, r1.xyzx
mad r0.xyz, cb2[15].xyzx, v0.wwww, r0.xyzx
add r0.xyz, -r0.xyzx, r5.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
mul r1.x, v1.x, cb2[16].x
mul r1.y, v1.x, cb2[17].x
mul r1.z, v1.x, cb2[18].x
mul r3.x, v1.y, cb2[16].y
mul r3.y, v1.y, cb2[17].y
mul r3.z, v1.y, cb2[18].y
add r1.xyz, r1.xyzx, r3.xyzx
mul r3.x, v1.z, cb2[16].z
mul r3.y, v1.z, cb2[17].z
mul r3.z, v1.z, cb2[18].z
add r1.xyz, r1.xyzx, r3.xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
dp3 r0.x, r1.xyzx, r0.xyzx
mul r0.yz, cb1[6].yyyy, cb3[1].xxyx
mad r0.yz, cb3[0].xxyx, cb1[6].xxxx, r0.yyzy
mul r0.yz, |r0.yyzy|, cb0[31].yyzy
div r0.yz, r1.wwww, r0.yyzy
dp2 r0.w, r0.yzyy, r0.yzyy
div o5.zw, l(0.000000, 0.000000, 0.500000, 0.500000), r0.yyyz
rsq r0.y, r0.w
mul r0.z, |v4.y|, cb0[31].x
mul r0.y, r0.y, r0.z
mul r0.z, r0.y, l(1.500000)
add r0.w, -cb0[31].w, l(1.000000)
mul r0.w, r0.w, r0.z
mad r0.y, r0.y, l(1.500000), -r0.w
mad r0.x, |r0.x|, r0.y, r0.w
eq r0.y, cb3[3].w, l(0.000000)
movc r0.x, r0.y, r0.x, r0.z
mul r0.yz, cb0[8].xxyx, cb0[26].wwww
mad r0.z, r0.z, r0.x, l(1.000000)
div r0.x, r0.x, r0.z
mul r0.z, cb0[10].x, cb0[26].w
mul r0.z, r0.z, l(0.500000)
mul r1.x, r0.x, r0.z
add r1.x, r1.x, r1.x
min r1.x, r1.x, l(1.000000)
sqrt r1.x, r1.x
mul r3.w, v2.w, cb0[9].w
mul r3.xyz, r3.wwww, cb0[9].xyzx
add r3.xyzw, -r2.xyzw, r3.xyzw
mad o2.xyzw, r1.xxxx, r3.xyzw, r2.xyzw
mov o3.xy, v3.xyxx
ge r1.x, l(0.000000), v4.y
and r1.x, r1.x, l(0x3f800000)
add r1.y, -cb0[26].y, cb0[26].z
mad r1.x, r1.x, r1.y, cb0[26].y
div r1.x, r1.x, cb0[31].x
mad r0.y, r0.y, l(0.500000), r1.x
add r0.y, -r0.y, l(0.500000)
mad r0.w, r0.y, r0.x, l(-0.500000)
mad o4.y, -r0.z, r0.x, r0.w
mad o4.z, r0.z, r0.x, r0.w
mov o4.xw, r0.xxxw
ret
// Approximately 0 instruction slots used