// CRC32: 18EC1684 |    Unity headers extracted from DecalAlphaTestFactionColor.shader
//    Shader "Amplitude/Environment/Terrain/DecalAlphaTestFactionColor" {
//      Properties {
//       _Shininess ("Shininess", Range(0.01,1)) = 0.078125
//       _AltitudeGammaCorrectionFactor ("Altitude Gamma Correction", Float) = 0.25
//       _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" { }
//       _SpecularTex ("GlossColor", 2D) = "black" { }
//       _NormalTex ("Normal", 2D) = "bump" { }
//       _IllumTex ("Illum", 2D) = "black" { }
//       _FactionMaskMap ("FactionMask Map", 2D) = "white" { }
//       _HexaGridTexture ("Hexa Grid Tex", 2D) = "black" { }
//       _Intensity ("Intensity", Float) = 0.5
//       _ViewSensitivity ("3D, Battle, 2D, Empire", Vector) = (1,0,0,0)
//       _WinterSensitivity ("Summer, Winter, WinterIntensity, Fow intensity", Vector) = (1,1,1,1)
//       _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
//       _VisibilityStatus ("Visible at date1, date1, visible at date0, date0", Vector) = (1,0,1,-1)
//      }
//      Fallback Off
//      SubShader 1/1 {
//        Tags { "QUEUE"="Geometry-5" "RenderType"="Opaque" }
//        Pass 5/5 {
//          Name "SHADOWCASTER"
//          Tags { "LIGHTMODE"="SHADOWCASTER" "QUEUE"="Geometry-5" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
//          GpuProgramID 265252
//          Program "vp" {
//            SubProgram "d3d9 " {
//              GpuProgramIndex 40
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from DecalAlphaTestFactionColor.shader.decompressed:
//   API d3d9
//   Shader model vs_3_0
//   undeciphered1: 65 2 -1
//   Keywords { "SHADOWS_DEPTH" "DEFAULT_RENDERER" }
//   undeciphered3: 15 4 0 0 2 1 1 2 3 4 1
//   Vector 17 [_CameraPos]
//   Vector 19 [_MainTex_ST]
//   Vector 18 [_RegionColorAndNeutralMap_TexelSize]
//   Vector 16 [_WorldSize]
//   Vector 14 [_WorldSpaceLightPos0]
//   Vector 15 [unity_LightShadowBias]
//   Matrix 8 [_Object2World] 3
//   Matrix 11 [_World2Object] 3
//   Matrix 0 [glstate_matrix_mvp]
//   Matrix 4 [unity_MatrixVP]
//   SetTexture 0 [_RegionColorAndNeutralMap] 2D 0
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py

//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//   using 3Dmigoto command line v1.2.38 on Sun Oct 16 02:25:08 2016
//
//
// Parameters:
//
//   float4 _CameraPos;
//   float4 _MainTex_ST;
//   row_major float4x4 _Object2World;
//   sampler2D _RegionColorAndNeutralMap;
//   float4 _RegionColorAndNeutralMap_TexelSize;
//   row_major float4x4 _World2Object;
//   float4 _WorldSize;
//   float4 _WorldSpaceLightPos0;
//   row_major float4x4 glstate_matrix_mvp;
//   float4 unity_LightShadowBias;
//   row_major float4x4 unity_MatrixVP;
//
//
// Registers:
//
//   Name                                Reg   Size
//   ----------------------------------- ----- ----
//   glstate_matrix_mvp                  c0       4
//   unity_MatrixVP                      c4       4
//   _Object2World                       c8       3
//   _World2Object                       c11      3
//   _WorldSpaceLightPos0                c14      1
//   unity_LightShadowBias               c15      1
//   _WorldSize                          c16      1
//   _CameraPos                          c17      1
//   _RegionColorAndNeutralMap_TexelSize c18      1
//   _MainTex_ST                         c19      1
//   _RegionColorAndNeutralMap           s0       1
//

    vs_3_0
    def c20, -5, 0.0500000007, 1, 0.5
    def c21, 1, 0.5, 0.166666672, 0
    def c22, 255, 65280, 0, 0
    dcl_position v0
    dcl_normal v1
    dcl_texcoord v2
    dcl_color v3
    dcl_2d s0
    dcl_texcoord o0
    dcl_position o1
    dcl_texcoord1 o2.xy
    dcl_texcoord2 o3.xyz
    dcl_texcoord3 o4
    dcl_texcoord4 o5.xyz

def c220, 0, 1, 0.0625, 0.5
dcl_2d s3

    dp4 r0.x, c8, v0
    dp4 r0.y, c10, v0
    rcp r1.x, c16.x
    rcp r1.y, c16.y
    mul o3.xy, r0, r1
    mul r0.xy, r0, c16.zwzw
    mul r0.xy, r1, r0
    mad o5.xy, r0, c21, c21.yzzw
    mov r0.xw, c20
    add r0.x, r0.x, c17.y
    mul_sat r0.x, r0.x, c20.y
    add o5.z, r0.x, c20.z
    mul r0.xy, c22, v3.wzzw
    add r0.x, r0.y, r0.x
    mul r0.x, r0.x, c18.x
    frc r0.z, r0.x
    add r0.z, -r0.z, r0.x
    mul r0.y, r0.z, c18.y
    mad r0.xy, c18, r0.w, r0
    mov r0.zw, c21.w
    texldl o4, r0, s0
    mad o2.xy, v2, c19, c19.zwzw
    abs r0.x, c15.z
    slt r0.x, -r0.x, r0.x
    mul r0.yzw, c12.xxyz, v1.y
    mad r0.yzw, c11.xxyz, v1.x, r0
    mad r0.yzw, c13.xxyz, v1.z, r0
    nrm r1.xyz, r0.yzww
    mad r2, v0.xyzx, c21.xxxw, c21.wwwx
    dp4 r3.x, c8, r2
    dp4 r3.y, c9, r2
    dp4 r3.z, c10, r2
    mad r0.yzw, r3.xxyz, -c14.w, c14.xxyz
    nrm r4.xyz, r0.yzww
    dp3 r0.y, r1, r4
    mad r0.y, r0.y, -r0.y, c20.z
    rsq r0.y, r0.y
    rcp r0.y, r0.y
    mul r0.y, r0.y, c15.z
    mad r1.xyz, r1, -r0.y, r3
    mov r1.w, c20.z
    dp4 r3.x, c4, r1
    dp4 r3.y, c5, r1
    dp4 r3.z, c6, r1
    dp4 r3.w, c7, r1
    dp4 r1.x, c0, r2
    dp4 r1.y, c1, r2
    dp4 r1.z, c2, r2
    dp4 r1.w, c3, r2
    lrp r2, r0.x, r3, r1

mov o1, r2 // Relocated from line 163 with shadertool.py

// Automatic vertex shader halo fix inserted with DarkStarSword's shadertool.py:
// shadertool.py -i --fix-unity-reflection --auto-fix-vertex-halo --add-fog-on-sm3-update --stereo-sampler-vs s3 --only-autofixed --ignore-parse-errors --ignore-register-errors --ignore-other-errors dumps\allshaders\vertexshader\18EC1684.txt
texldl r31, c220.z, s3
add r31.w, r2.w, -r31.y
mad r2.x, r31.w, r31.x, r2.x

    rcp r0.x, r2.w
    mul_sat r0.x, r0.x, c15.x
    add r0.x, r0.x, r2.z
    max r0.y, r0.x, c21.w
    lrp r2.z, c15.y, r0.y, r0.x
    mov o0, r2

//     mov o1, r2 // Relocated to line 157 with shadertool.py
mov o1.z, r2 // Inserted by shadertool.py

    mov o3.z, v0.y

// approximately 63 instruction slots used (2 texture, 61 arithmetic)
