// asmtool.py -I ../.. --fix-unity-reflection --only-autofixed d257342839685df0-ps.txt
// 3DMigoto: d257342839685df0 |    Unity headers extracted from AF3978993F6264D4D25BA33EFB36DC99.shader
//    Shader "Hidden/UberShader/AF3978993F6264D4D25BA33EFB36DC99" {
//      Properties {
//       _UberShaderColorMask ("Uber color mask", Float) = 15
//       _UberShaderBlendModeDst ("Uber shader blend  mode dst", Float) = 10
//       _AdditiveLayerColor ("Additive Layer Color", Color) = (1,1,1,1)
//       _AdditiveLayerDistortColor ("Additive Layer Distort Color", Color) = (1,1,1,1)
//       _AdditiveLayerDistortDistortTexture ("Additive Layer Distort Distort Texture", 2D) = "white" { }
//       _AdditiveLayerDistortDistortTexture_US_ST ("Additive Layer Distort Distort Texture_US_ST", Vector) = (0,0,0,0)
//       _AdditiveLayerDistortMaskTexture ("Additive Layer Distort Mask Texture", 2D) = "white" { }
//       _AdditiveLayerDistortMaskTexture_US_ST ("Additive Layer Distort Mask Texture_US_ST", Vector) = (0,0,0,0)
//       _AdditiveLayerDistortStrength ("Additive Layer Distort Strength", Vector) = (0,0,0,0)
//       _AdditiveLayerDistortTexture ("Additive Layer Distort Texture", 2D) = "white" { }
//       _AdditiveLayerDistortTexture_Parralax ("Additive Layer Distort Texture_Parralax", Vector) = (0,0,0,0)
//       _AdditiveLayerDistortTexture_US_ST ("Additive Layer Distort Texture_US_ST", Vector) = (0,0,0,0)
//       _AdditiveLayerMaskTexture ("Additive Layer Mask Texture", 2D) = "white" { }
//       _AdditiveLayerMaskTexture_US_ST ("Additive Layer Mask Texture_US_ST", Vector) = (0,0,0,0)
//       _AdditiveLayerTexture ("Additive Layer Texture", 2D) = "white" { }
//       _AdditiveLayerTexture_US_ST ("Additive Layer Texture_US_ST", Vector) = (0,0,0,0)
//       _Color ("Color", Color) = (1,1,1,1)
//       _DepthFlipScreen ("Depth Flip Screen", Vector) = (0,0,0,0)
//       _MainTex ("Main Tex", 2D) = "white" { }
//       _MainTex_US_ATLAS ("Main Tex_US_ATLAS", Vector) = (0,0,1,1)
//       _MainTex_US_ATLAS_ST ("Main Tex_US_ATLAS_ST", Vector) = (0,0,1,1)
//       _MainTex_US_ST ("Main Tex_US_ST", Vector) = (0,0,0,0)
//       _Screen ("Screen", Vector) = (0,0,0,0)
//       _ScreenMask ("Screen Mask", Vector) = (0,0,0,0)
//      }
//      SubShader 1/1 {
//        Tags { "IGNOREPROJECTOR"="true" "RenderType"="TransparentCutout" "UberShaderShader"="true" }
//        Pass 1/1 {
//          Tags { "IGNOREPROJECTOR"="true" "RenderType"="TransparentCutout" "UberShaderShader"="true" }
//          ZTest Less
//          ZWrite Off
//          Cull Off
//          Blend SrcAlpha [_UberShaderBlendModeDst], One OneMinusSrcAlpha
//          ColorMask [_UberShaderColorMask]
//          GpuProgramID 55334
//          Program "fp" {
//            SubProgram "d3d11 " {
//              GpuProgramIndex 3
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from AF3978993F6264D4D25BA33EFB36DC99.shader.decompressed:
//   API d3d11
//   Shader model ps_4_0
//   undeciphered1: 201509030 23 6 0
//   undeciphered2: 1 6 2 6 0
//   undeciphered3: 0 0
//   ConstBuffer "$Globals" 656
//   Vector 112 [_DepthFlipScreen]
//   Vector 128 [_Screen]
//   Vector 144 [_ScreenMask]
//   Vector 320 [_MainTex_US_ATLAS]
//   Vector 336 [_MainTex_US_ATLAS_ST]
//   Vector 352 [_Color]
//   Vector 464 [_AdditiveLayerColor]
//   Vector 512 [_AdditiveLayerDistortTexture_Parralax]
//   Vector 624 [_AdditiveLayerDistortColor]
//   Vector 640 [_AdditiveLayerDistortStrength]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 64 [_WorldSpaceCameraPos] 3
//   SetTexture 0 [_MainTex] 2D 0
//   SetTexture 1 [_AdditiveLayerTexture] 2D 1
//   SetTexture 2 [_AdditiveLayerMaskTexture] 2D 2
//   SetTexture 3 [_AdditiveLayerDistortDistortTexture] 2D 5
//   SetTexture 4 [_AdditiveLayerDistortTexture] 2D 3
//   SetTexture 5 [_AdditiveLayerDistortMaskTexture] 2D 4
//   BindCB "$Globals" 0
//   BindCB "UnityPerCamera" 1
//
// 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.2 on Mon Jul 23 23:47:31 2018
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xy
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer cb0[41], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v4.xy
dcl_output o0.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 ../.. --fix-unity-reflection --only-autofixed d257342839685df0-ps.txt

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

sample r0.xyzw, v4.xyxx, t3.xyzw, s5
mad r0.xy, r0.zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mad r0.xy, r0.xyxx, cb0[40].xyxx, v3.xyxx
add r0.zw, -cb0[32].zzzw, r5.xxxy
mad r0.xy, r0.zwzz, cb0[32].xxxx, r0.xyxx
sample r0.xyzw, r0.xyxx, t4.xyzw, s3
mul r0.xyz, r0.xyzx, cb0[39].xyzx
sample r1.xyzw, v3.zwzz, t5.xyzw, s4
mul r0.xyz, r0.xyzx, r1.wwww
mul r0.xyz, r0.xyzx, cb0[39].wwww
mov_sat r1.xy, v1.yxyy
add r1.xy, r1.xyxx, -cb0[21].yxyy
div_sat r1.xy, r1.xyxx, cb0[21].wzww
mul r1.zw, r1.xxxy, cb0[7].yyyy
add r0.w, -cb0[7].y, l(1.000000)
mad r1.xy, r1.yxyy, r0.wwww, r1.zwzz
mad r1.xy, r1.xyxx, cb0[20].zwzz, cb0[20].xyxx
sample r1.xyzw, r1.xyxx, t0.xyzw, s0
dp4_sat r0.w, r1.xyzw, cb0[8].xyzw
mad r1.xyzw, r0.wwww, cb0[9].xyzw, r1.xyzw
div r1.xyz, r1.xyzx, r1.wwww
add r2.xyzw, cb0[22].xyzw, cb0[22].xyzw
mul r1.xyzw, r1.xyzw, r2.xyzw
sample r2.xyzw, v2.xyxx, t1.xyzw, s1
mul r2.xyz, r2.xyzx, cb0[29].xyzx
sample r3.xyzw, v2.zwzz, t2.xyzw, s2
mul r2.xyz, r2.xyzx, r3.wwww
mul r2.xyz, r2.xyzx, cb0[29].wwww
mad r1.xyz, r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r1.xyzx
mov o0.w, r1.w
mad o0.xyz, r0.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r1.xyzx
ret
// Approximately 0 instruction slots used