// asmtool.py -I ../.. --auto-fix-vertex-halo --fix-unusual-halo-with-inconsistent-w-optimisation --fix-unity-reflection --fix-unity-frustum-world --only-autofixed f6ce52b484f4ee6d-vs.txt
// 3DMigoto: f6ce52b484f4ee6d | Matched 5 variants of 1 shaders: TMPro/Distance Field (Surface)
//
//        Unity headers extracted from TMPro_SDF-Surface.shader
//        Shader "TMPro/Distance Field (Surface)" {
//          Properties {
//           _FaceTex ("Fill Texture", 2D) = "white" { }
//           _FaceUVSpeedX ("Face UV Speed X", Range(-5.000000,5.000000)) = 0.000000
//           _FaceUVSpeedY ("Face UV Speed Y", Range(-5.000000,5.000000)) = 0.000000
//           _FaceColor ("Fill 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)
//           _OutlineTex ("Outline Texture", 2D) = "white" { }
//           _OutlineUVSpeedX ("Outline UV Speed X", Range(-5.000000,5.000000)) = 0.000000
//           _OutlineUVSpeedY ("Outline UV Speed Y", Range(-5.000000,5.000000)) = 0.000000
//           _OutlineWidth ("Outline Thickness", Range(0.000000,1.000000)) = 0.000000
//           _OutlineSoftness ("Outline Softness", Range(0.000000,1.000000)) = 0.000000
//           _Bevel ("Bevel", Range(0.000000,1.000000)) = 0.500000
//           _BevelOffset ("Bevel Offset", Range(-0.500000,0.500000)) = 0.000000
//           _BevelWidth ("Bevel Width", Range(-0.500000,0.500000)) = 0.000000
//           _BevelClamp ("Bevel Clamp", Range(0.000000,1.000000)) = 0.000000
//           _BevelRoundness ("Bevel Roundness", Range(0.000000,1.000000)) = 0.000000
//           _BumpMap ("Normalmap", 2D) = "bump" { }
//           _BumpOutline ("Bump Outline", Range(0.000000,1.000000)) = 0.500000
//           _BumpFace ("Bump Face", Range(0.000000,1.000000)) = 0.500000
//           _ReflectFaceColor ("Face Color", Color) = (0.000000,0.000000,0.000000,1.000000)
//           _ReflectOutlineColor ("Outline Color", Color) = (0.000000,0.000000,0.000000,1.000000)
//           _Cube ("Reflection Cubemap", CUBE) = "black" { }
//           _EnvMatrixRotation ("Texture Rotation", Vector) = (0.000000,0.000000,0.000000,0.000000)
//           _SpecColor ("Specular Color", Color) = (0.000000,0.000000,0.000000,1.000000)
//           _FaceShininess ("Face Shininess", Range(0.000000,1.000000)) = 0.000000
//           _OutlineShininess ("Outline Shininess", Range(0.000000,1.000000)) = 0.000000
//           _GlowColor ("Color", Color) = (0.000000,1.000000,0.000000,0.500000)
//           _GlowOffset ("Offset", Range(-1.000000,1.000000)) = 0.000000
//           _GlowInner ("Inner", Range(0.000000,1.000000)) = 0.050000
//           _GlowOuter ("Outer", Range(0.000000,1.000000)) = 0.050000
//           _GlowPower ("Falloff", Range(1.000000,0.000000)) = 0.750000
//           _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
//          }
//          SubShader 1/1 {
//            LOD 300
//            Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
//            Pass 2/3 {
//              Name "FORWARD"
//              Tags { "LIGHTMODE"="ForwardAdd" "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" }
//              ZWrite Off
//              Cull [_CullMode]
//              Blend SrcAlpha One
//              ColorMask RGB
//              GpuProgramID 92919
//              Program "vp" {
//                SubProgram "d3d11 " {
// 01:              GpuProgramIndex 3
// 02:              GpuProgramIndex 4
// 04:              GpuProgramIndex 5
// 08:              GpuProgramIndex 6
// 10:              GpuProgramIndex 7
//                }
//              }
//            }
//          }
//        }
//
//     Unity 5.3 headers extracted from TMPro_SDF-Surface.shader.decompressed:
//       API d3d11
//       Shader model vs_4_0
//       undeciphered1: 201510240 73 0 0
// 02:   Keywords { "DIRECTIONAL" }
// 10:   Keywords { "DIRECTIONAL_COOKIE" }
// 01:   Keywords { "POINT" }
// 08:   Keywords { "POINT_COOKIE" }
// 04:   Keywords { "SPOT" }
//       undeciphered2: 1 0 4 0 0 0
//       undeciphered3: 159 6 0 0 2 1 1 2 3 4 4 5 7 8
//       ConstBuffer "$Globals" 672
//       Float 240 [_FaceDilate]
//       Float 532 [_WeightNormal]
//       Float 536 [_WeightBold]
//       Float 540 [_ScaleRatioA]
//       Float 552 [_VertexOffsetX]
//       Float 556 [_VertexOffsetY]
//       Float 608 [_GradientScale]
//       Float 612 [_ScaleX]
//       Float 616 [_ScaleY]
//       Float 620 [_PerspectiveFilter]
//       Vector 640 [_MainTex_ST]
//       Vector 656 [_FaceTex_ST]
//       Matrix 352 [_EnvMatrix]
//       ConstBuffer "UnityPerCamera" 144
//       Vector 64 [_WorldSpaceCameraPos] 3
//       Vector 96 [_ScreenParams]
//       ConstBuffer "UnityPerDraw" 352
//       Vector 336 [unity_WorldTransformParams]
//       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:11 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TANGENT                  0   xyzw        1     NONE   float   xyzw
// NORMAL                   0   xyz         2     NONE   float   xyz
// TEXCOORD                 0   xyzw        3     NONE   float   xy
// TEXCOORD                 1   xyzw        4     NONE   float   xy
// TEXCOORD                 2   xyzw        5     NONE   float
// TEXCOORD                 3   xyzw        6     NONE   float
// COLOR                    0   xyzw        7     NONE   float   xyzw
//
//
// 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   xyz         2     NONE   float   xyz
// TEXCOORD                 2   xyz         3     NONE   float   xyz
// TEXCOORD                 3   xyz         4     NONE   float   xyz
// TEXCOORD                 4   xyz         5     NONE   float   xyz
// COLOR                    0   xyzw        6     NONE   float   xyzw
// TEXCOORD                 5   xy          7     NONE   float   xy
// TEXCOORD                 6   xyz         8     NONE   float   xyz
//
vs_4_0
dcl_constantbuffer cb0[42], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[22], immediateIndexed
dcl_constantbuffer cb3[2], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyzw
dcl_input v2.xyz
dcl_input v3.xy
dcl_input v4.xy
dcl_input v7.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_output o3.xyz
dcl_output o4.xyz
dcl_output o5.xyz
dcl_output o6.xyzw
dcl_output o7.xy
dcl_output o8.xyz
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 f6ce52b484f4ee6d-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[34].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 o0.xyzw, r1.xyzw, cb2[3].xyzw
round_ni r0.w, v4.x
mul r1.z, r0.w, cb0[41].x
frc r0.w, v4.x
mul r1.w, r0.w, cb0[41].y
mad o1.zw, r1.zzzw, l(0.000000, 0.000000, 0.00122070313, 5.000000), cb0[41].zzzw
mad o1.xy, v3.xyxx, cb0[40].xyxx, cb0[40].zwzz
mul r1.xyz, r5.yyyy, cb2[17].xyzx
mad r1.xyz, cb2[16].xyzx, r5.xxxx, r1.xyzx
mad r1.xyz, cb2[18].xyzx, r5.zzzz, r1.xyzx
add r1.xyz, r1.xyzx, cb2[19].xyzx
mov r0.z, v0.z
add r1.xyz, -r0.xyzx, r1.xyzx
dp3 r0.z, v2.xyzx, r1.xyzx
lt r0.w, l(0.000000), r0.z
lt r0.z, r0.z, l(0.000000)
iadd r0.z, -r0.w, r0.z
itof r0.z, r0.z
mul r1.xyz, r0.zzzz, v2.xyzx
mov r2.y, cb2[16].y
mov r2.z, cb2[17].y
mov r2.x, cb2[18].y
mul r2.xyz, r1.yyyy, r2.xyzx
mov r3.y, cb2[16].x
mov r3.z, cb2[17].x
mov r3.x, cb2[18].x
mad r1.xyw, r3.xyxz, r1.xxxx, r2.xyxz
mov r2.y, cb2[16].z
mov r2.z, cb2[17].z
mov r2.x, cb2[18].z
mad r1.xyz, r2.xyzx, r1.zzzz, r1.xywx
dp3 r0.z, r1.xyzx, r1.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r1.xyzx
mov o2.z, r1.y
mul r2.xyz, v1.yyyy, cb2[13].yzxy
mad r2.xyz, cb2[12].yzxy, v1.xxxx, r2.xyzx
mad r2.xyz, cb2[14].yzxy, v1.zzzz, r2.xyzx
dp3 r0.z, r2.xyzx, r2.xyzx
rsq r0.z, r0.z
mul r2.xyz, r0.zzzz, r2.xyzx
mul r3.xyz, r1.xyzx, r2.xyzx
mad r3.xyz, r1.zxyz, r2.yzxy, -r3.xyzx
mul r0.z, v1.w, cb2[21].w
mul r3.xyz, r0.zzzz, r3.xyzx
mov o2.y, r3.x
mov o2.x, r2.z
mov o3.x, r2.x
mov o4.x, r2.y
mov o3.z, r1.z
mov o3.y, r3.y
mov o4.y, r3.z
mov o4.z, r1.x
mul r2.xyz, r0.yyyy, cb2[13].xyzx
mad r2.xyz, cb2[12].xyzx, r0.xxxx, r2.xyzx
mad r2.xyz, cb2[14].xyzx, v0.zzzz, r2.xyzx
mad r2.xyz, cb2[15].xyzx, v0.wwww, r2.xyzx
mov o5.xyz, r2.xyzx
add r2.xyz, -r2.xyzx, r5.xyzx
mov o6.xyzw, v7.xyzw
mul r0.y, r0.y, cb2[1].w
mad r0.x, cb2[0].w, r0.x, r0.y
mad r0.x, cb2[2].w, v0.z, r0.x
mad r0.x, cb2[3].w, v0.w, r0.x
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[38].yyzy
div r0.xy, r0.xxxx, r0.yzyy
dp2 r0.x, r0.xyxx, r0.xyxx
rsq r0.x, r0.x
mul r0.y, |v4.y|, cb0[38].x
mul r0.x, r0.x, r0.y
mul r0.y, r0.x, l(1.500000)
add r0.z, -cb0[38].w, l(1.000000)
mul r0.y, r0.z, r0.y
mad r0.x, r0.x, l(1.500000), -r0.y
dp3 r0.z, r2.xyzx, r2.xyzx
rsq r0.z, r0.z
mul r3.xyz, r0.zzzz, r2.xyzx
dp3 r0.z, r1.yzxy, r3.xyzx
mad o7.y, |r0.z|, r0.x, r0.y
ge r0.x, l(0.000000), v4.y
and r0.x, r0.x, l(0x3f800000)
add r0.y, -cb0[33].y, cb0[33].z
mad r0.x, r0.x, r0.y, cb0[33].y
div r0.x, r0.x, cb0[38].x
mul r0.y, cb0[15].x, cb0[33].w
mad o7.x, r0.y, l(0.500000), r0.x
mul r0.xyz, r2.yyyy, cb0[23].xyzx
mad r0.xyz, cb0[22].xyzx, r2.xxxx, r0.xyzx
mad o8.xyz, cb0[24].xyzx, r2.zzzz, r0.xyzx
ret
// Approximately 0 instruction slots used