// CRC32: D684F54A |    Unity headers extracted from Illumin-Diffuse.shader
//    Shader "Legacy Shaders/Self-Illumin/Diffuse" {
//      Properties {
//       _Color ("Main Color", Color) = (1,1,1,1)
//       _MainTex ("Base (RGB)", 2D) = "white" { }
//       _Illum ("Illumin (A)", 2D) = "white" { }
//       _Emission ("Emission (Lightmapper)", Float) = 1
//      }
//      Fallback "Legacy Shaders/Self-Illumin/VertexLit"
//      SubShader 1/1 {
//        LOD 200
//        Tags { "RenderType"="Opaque" }
//        Pass 1/5 {
//          Name "FORWARD"
//          Tags { "LIGHTMODE"="ForwardBase" "SHADOWSUPPORT"="true" "RenderType"="Opaque" }
//          GpuProgramID 24951
//          Program "vp" {
//            SubProgram "d3d9 " {
//              GpuProgramIndex 3
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from Illumin-Diffuse.shader.decompressed:
//   API d3d9
//   Shader model vs_2_0
//   undeciphered1: 77 -1 -1
//   Keywords { "DIRECTIONAL" "SHADOWS_SCREEN" "LIGHTMAP_OFF" "DIRLIGHTMAP_OFF" "DYNAMICLIGHTMAP_OFF" "VERTEXLIGHT_ON" }
//   undeciphered3: 11 3 0 0 1 2 3 4 1
//   Vector 29 [_Illum_ST]
//   Vector 28 [_MainTex_ST]
//   Vector 14 [_ProjectionParams]
//   Vector 15 [_ScreenParams]
//   Vector 19 [unity_4LightAtten0]
//   Vector 16 [unity_4LightPosX0]
//   Vector 17 [unity_4LightPosY0]
//   Vector 18 [unity_4LightPosZ0]
//   Vector 27 [unity_ColorSpaceLuminance]
//   Vector 0 [unity_LightColor0]
//   Vector 1 [unity_LightColor1]
//   Vector 2 [unity_LightColor2]
//   Vector 3 [unity_LightColor3]
//   Vector 22 [unity_SHAb]
//   Vector 21 [unity_SHAg]
//   Vector 20 [unity_SHAr]
//   Vector 25 [unity_SHBb]
//   Vector 24 [unity_SHBg]
//   Vector 23 [unity_SHBr]
//   Vector 26 [unity_SHC]
//   Matrix 8 [_Object2World] 3
//   Matrix 11 [_World2Object] 3
//   Matrix 4 [glstate_matrix_mvp]
//
// 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:26:27 2016
//
//
// Parameters:
//
//   float4 _Illum_ST;
//   float4 _MainTex_ST;
//   row_major float4x4 _Object2World;
//   float4 _ProjectionParams;
//   float4 _ScreenParams;
//   row_major float4x4 _World2Object;
//   row_major float4x4 glstate_matrix_mvp;
//   float4 unity_4LightAtten0;
//   float4 unity_4LightPosX0;
//   float4 unity_4LightPosY0;
//   float4 unity_4LightPosZ0;
//   float4 unity_ColorSpaceLuminance;
//   float4 unity_LightColor[8];
//   float4 unity_SHAb;
//   float4 unity_SHAg;
//   float4 unity_SHAr;
//   float4 unity_SHBb;
//   float4 unity_SHBg;
//   float4 unity_SHBr;
//   float4 unity_SHC;
//
//
// Registers:
//
//   Name                      Reg   Size
//   ------------------------- ----- ----
//   unity_LightColor          c0       4
//   glstate_matrix_mvp        c4       4
//   _Object2World             c8       3
//   _World2Object             c11      3
//   _ProjectionParams         c14      1
//   _ScreenParams             c15      1
//   unity_4LightPosX0         c16      1
//   unity_4LightPosY0         c17      1
//   unity_4LightPosZ0         c18      1
//   unity_4LightAtten0        c19      1
//   unity_SHAr                c20      1
//   unity_SHAg                c21      1
//   unity_SHAb                c22      1
//   unity_SHBr                c23      1
//   unity_SHBg                c24      1
//   unity_SHBb                c25      1
//   unity_SHC                 c26      1
//   unity_ColorSpaceLuminance c27      1
//   _MainTex_ST               c28      1
//   _Illum_ST                 c29      1
//

    vs_3_0 // Converted from vs_2_0 with DarkStarSword's shadertool.py
dcl_fog o9 // Inserted by shadertool.py for fog compatibility on upgrade from vs_2_0 to vs_3_0
    def c30, 0, 1, 0.416666657, 0.5
    def c31, 1.05499995, -0.0549999997, 0, 0
    dcl_position v0
    dcl_normal v1
    dcl_texcoord v2

dcl_texcoord o0
dcl_texcoord1 o1
dcl_texcoord2 o2
dcl_texcoord3 o3
dcl_texcoord4 o4
dcl_position o5


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

    mad o0.xy, v2, c28, c28.zwzw
    mad o0.zw, v2.xyxy, c29.xyxy, c29
    mul r0.xyz, v1.y, c12
    mad r0.xyz, c11, v1.x, r0
    mad r0.xyz, c13, v1.z, r0
    nrm r1.xyz, r0
    mul r0.x, r1.y, r1.y
    mad r0.x, r1.x, r1.x, -r0.x
    mul r2, r1.yzzx, r1.xyzz
    dp4 r3.x, c23, r2
    dp4 r3.y, c24, r2
    dp4 r3.z, c25, r2
    mad r0.xyz, c26, r0.x, r3
    mov r1.w, c30.y
    dp4 r2.x, c20, r1
    dp4 r2.y, c21, r1
    dp4 r2.z, c22, r1
    add r0.xyz, r0, r2
    max r2.xyz, r0, c30.x
    mov r2.w, c30.z
    lit r3, r2.xxww
    mov r3.x, r3.z
    lit r4, r2.yyww
    lit r2, r2.zzww
    mov r3.z, r2.z
    mov r3.y, r4.z
    mad r2.xyz, r3, c31.x, c31.y
    max r2.xyz, r2, c30.x
    mul r0.w, c27.w, c27.w
    sge r0.w, -r0.w, r0.w
    lrp r3.xyz, r0.w, r2, r0
    max r0.xyz, r3, c30.x
    dp4 r2.y, c9, v0
    add r3, -r2.y, c17
    mul r4, r1.y, r3
    mul r3, r3, r3
    dp4 r2.x, c8, v0
    add r5, -r2.x, c16
    mad r4, r5, r1.x, r4
    mad r3, r5, r5, r3
    dp4 r2.z, c10, v0
    add r5, -r2.z, c18
    mov o2.xyz, r2
    mad r2, r5, r1.z, r4
    mov o1.xyz, r1
    mad r1, r5, r5, r3
    rsq r3.x, r1.x
    rsq r3.y, r1.y
    rsq r3.z, r1.z
    rsq r3.w, r1.w
    mov r4.y, c30.y
    mad r1, r1, c19, r4.y
    mul r2, r2, r3
    max r2, r2, c30.x
    rcp r3.x, r1.x
    rcp r3.y, r1.y
    rcp r3.z, r1.z
    rcp r3.w, r1.w
    mul r1, r2, r3
    mul r2.xyz, r1.y, c1
    mad r2.xyz, c0, r1.x, r2
    mad r1.xyz, c2, r1.z, r2
    mad r1.xyz, c3, r1.w, r1
    add o3.xyz, r0, r1
    dp4 r0.y, c5, v0
    mul r1.x, r0.y, c14.x
    mul r1.w, r1.x, c30.w
    dp4 r0.x, c4, v0
    dp4 r0.w, c7, v0

mov o5, r0 // Relocated from line 201 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\D684F54A.txt
texldl r31, c220.z, s3
add r31.w, r0.w, -r31.y
mad r0.x, r31.w, r31.x, r0.x

    mul r1.xz, r0.xyww, c30.w
    mad o4.xy, r1.z, c15.zwzw, r1.xwzw
    dp4 r0.z, c6, v0

//     mov o5, r0 // Relocated to line 198 with shadertool.py
mov o5.z, r0 // Inserted by shadertool.py

mov o9, r0.z // Inserted by shadertool.py for fog compatibility on upgrade from vs_2_0 to vs_3_0
    mov o4.zw, r0

// approximately 76 instruction slots used
