// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:31:11 2016

cbuffer cbMtdParam : register(b3)
{
  float4 FC_DifMapMulCol : packoffset(c0);
  float4 FC_SpcMapMulCol : packoffset(c1);
  float4 FC_SpcParam : packoffset(c2);
  float4 FC_SSAOParam : packoffset(c3);
  float3 FC_CDRFParam : packoffset(c4);
  float4 FC_AlphaRef : packoffset(c5);
  float FC_BloodAmount : packoffset(c6);
  float4 old_FC_ParallaxParam : packoffset(c7);
  float FC_IOR : packoffset(c8);
  float4 FC_GlowScale : packoffset(c9);
  float4 FC_GhostEdgeColor : packoffset(c10);
  float4 FC_GhostEdgeParam : packoffset(c11);
  float4 FC_BmpBlendParam0 : packoffset(c12);
  float4 FC_BmpBlendParam1 : packoffset(c13);
  float FC_UNUSED_SSS_ID : packoffset(c14);
  float4 FC_Falloff_InsideColor : packoffset(c15);
  float4 FC_Falloff_OutsideColor : packoffset(c16);
  float4 FC_Falloff_Offset : packoffset(c17);
  float4 FC_Falloff_EdgePower : packoffset(c18);
  float4 FC_Falloff_HeightFade : packoffset(c19);
  float4 FC_HairSpecularParam0 : packoffset(c20);
  float4 FC_HairSpecularParam1 : packoffset(c21);
  float4 FC_HairSpecularParam2 : packoffset(c22);
  float4 FC_RimLightingParam : packoffset(c23);
  float4 FC_SAT_DUMMMY_P7_8 : packoffset(c24);
  float4 FC_SAT_DUMMMY_P7_9 : packoffset(c25);
  float4 FC_SAT_DUMMMY_P7_10 : packoffset(c26);
}

cbuffer cbInstanceData : register(b4)
{

  struct
  {
    float4x3 mWorld;
    float4 atlasUvScaleOffset;
    float4 userClipPlane;
    uint4 matricesData;
    uint envData;
    bool dynamicLightDisable;
    uint2 envPad;
    float4 mulCol;
    float4 aSh[3];
    float4 ShLightMask;
    float4 vDominantRotateParam;
    float4 parallaxCorrectedCubemapOrigin_envMapInterpRatio;
    float4 parallaxCorrectedCubemapAabbMin_envMapColorScale0;
    float4 parallaxCorrectedCubemapAabbMax_envMapColorScale1;
    float ditherFadeAlpha;
  } VC_InstanceData[2] : packoffset(c0);

}

cbuffer cbModelParam : register(b7)
{
  float4 FC_DifColMul : packoffset(c0);
  float FC_EnvMapInterpRatio : packoffset(c1);
  float FC_EnvMapColorScale0 : packoffset(c1.y);
  float FC_EnvMapColorScale1 : packoffset(c1.z);
  float FC_DitherEnable : packoffset(c2);
  float FC_FROZEN_RATE : packoffset(c2.w);
  float FC_Perlin_Freq : packoffset(c3);
  float FC_Perlin_Amp : packoffset(c3.y);
  float FC_Perlin_Lacunarity : packoffset(c3.z);
  float FC_Perlin_Gain : packoffset(c3.w);
  float FC_SnowRate : packoffset(c4);
  float FC_SnowMinDot : packoffset(c4.y);
  float FC_SnowMaxDot : packoffset(c4.z);
  float FC_SparkleExponent : packoffset(c5);
  float FC_SparkleThreshold : packoffset(c5.y);
  float FC_SparkleMul : packoffset(c5.z);
  float FC_SparkleMaskExponent : packoffset(c5.w);
  float4 FC_SkinMatchColor : packoffset(c6);
  int FC_EnvId : packoffset(c7);
  float4 FC_ParallaxCorrectedCubemapOriginA : packoffset(c8);
  float4 FC_ParallaxCorrectedCubemapOriginB : packoffset(c9);
  float4x4 FC_ParallaxCorrectedCubemapObbA : packoffset(c10);
  float4x4 FC_ParallaxCorrectedCubemapInvObbA : packoffset(c14);
  float4x4 FC_ParallaxCorrectedCubemapObbB : packoffset(c18);
  float4x4 FC_ParallaxCorrectedCubemapInvObbB : packoffset(c22);
  float FC_ParallaxCorrectedCubemapObbAEnable : packoffset(c26);
  float FC_ParallaxCorrectedCubemapObbBEnable : packoffset(c26.y);
}



// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main( 
  float4 v0 : SV_POSITION0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float4 v3 : TEXCOORD2,
  float2 v4 : TEXCOORD3,
  out float4 o0 : SV_TARGET0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = cmp(VC_InstanceData[0].mulCol.x == 0.000000);
  r0.y = cmp(1 < FC_AlphaRef.x);
  r0.x = (int)r0.y | (int)r0.x;
  if (r0.x != 0) discard;
  r0.xy = v1.xy / v1.ww;
  r0.zw = v2.xy / v2.ww;
  r0.xy = r0.xy + -r0.zw;
  r0.xy = FC_DifColMul.xy * r0.xy;
  o0.xy = saturate(r0.xy * float2(0.5,0.5) + float2(0.5,0.5));
  r0.x = 10 + v1.w;
  o0.z = v1.w / r0.x;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbMtdParam
// {
//
//   float4 FC_DifMapMulCol;            // Offset:    0 Size:    16 [unused]
//   float4 FC_SpcMapMulCol;            // Offset:   16 Size:    16 [unused]
//   float4 FC_SpcParam;                // Offset:   32 Size:    16 [unused]
//   float4 FC_SSAOParam;               // Offset:   48 Size:    16 [unused]
//   float3 FC_CDRFParam;               // Offset:   64 Size:    12 [unused]
//   float4 FC_AlphaRef;                // Offset:   80 Size:    16
//   float FC_BloodAmount;              // Offset:   96 Size:     4 [unused]
//   float4 old_FC_ParallaxParam;       // Offset:  112 Size:    16 [unused]
//   float FC_IOR;                      // Offset:  128 Size:     4 [unused]
//   float4 FC_GlowScale;               // Offset:  144 Size:    16 [unused]
//   float4 FC_GhostEdgeColor;          // Offset:  160 Size:    16 [unused]
//   float4 FC_GhostEdgeParam;          // Offset:  176 Size:    16 [unused]
//   float4 FC_BmpBlendParam0;          // Offset:  192 Size:    16 [unused]
//   float4 FC_BmpBlendParam1;          // Offset:  208 Size:    16 [unused]
//   float FC_UNUSED_SSS_ID;            // Offset:  224 Size:     4 [unused]
//   float4 FC_Falloff_InsideColor;     // Offset:  240 Size:    16 [unused]
//   float4 FC_Falloff_OutsideColor;    // Offset:  256 Size:    16 [unused]
//   float4 FC_Falloff_Offset;          // Offset:  272 Size:    16 [unused]
//   float4 FC_Falloff_EdgePower;       // Offset:  288 Size:    16 [unused]
//   float4 FC_Falloff_HeightFade;      // Offset:  304 Size:    16 [unused]
//   float4 FC_HairSpecularParam0;      // Offset:  320 Size:    16 [unused]
//   float4 FC_HairSpecularParam1;      // Offset:  336 Size:    16 [unused]
//   float4 FC_HairSpecularParam2;      // Offset:  352 Size:    16 [unused]
//   float4 FC_RimLightingParam;        // Offset:  368 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_8;         // Offset:  384 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_9;         // Offset:  400 Size:    16 [unused]
//   float4 FC_SAT_DUMMMY_P7_10;        // Offset:  416 Size:    16 [unused]
//
// }
//
// cbuffer cbInstanceData
// {
//
//   struct PerInstanceData
//   {
//       
//       float4x3 mWorld;               // Offset:    0
//       float4 atlasUvScaleOffset;     // Offset:   48
//       float4 userClipPlane;          // Offset:   64
//       uint4 matricesData;            // Offset:   80
//       uint envData;                  // Offset:   96
//       bool dynamicLightDisable;      // Offset:  100
//       uint2 envPad;                  // Offset:  104
//       float4 mulCol;                 // Offset:  112
//       float4 aSh[3];                 // Offset:  128
//       float4 ShLightMask;            // Offset:  176
//       float4 vDominantRotateParam;   // Offset:  192
//       float4 parallaxCorrectedCubemapOrigin_envMapInterpRatio;// Offset:  208
//       float4 parallaxCorrectedCubemapAabbMin_envMapColorScale0;// Offset:  224
//       float4 parallaxCorrectedCubemapAabbMax_envMapColorScale1;// Offset:  240
//       float ditherFadeAlpha;         // Offset:  256
//
//   } VC_InstanceData[2];              // Offset:    0 Size:   532
//
// }
//
// cbuffer cbModelParam
// {
//
//   float4 FC_DifColMul;               // Offset:    0 Size:    16
//   float FC_EnvMapInterpRatio;        // Offset:   16 Size:     4 [unused]
//   float FC_EnvMapColorScale0;        // Offset:   20 Size:     4 [unused]
//   float FC_EnvMapColorScale1;        // Offset:   24 Size:     4 [unused]
//   float FC_DitherEnable;             // Offset:   32 Size:     4 [unused]
//   float FC_FROZEN_RATE;              // Offset:   44 Size:     4 [unused]
//   float FC_Perlin_Freq;              // Offset:   48 Size:     4 [unused]
//   float FC_Perlin_Amp;               // Offset:   52 Size:     4 [unused]
//   float FC_Perlin_Lacunarity;        // Offset:   56 Size:     4 [unused]
//   float FC_Perlin_Gain;              // Offset:   60 Size:     4 [unused]
//   float FC_SnowRate;                 // Offset:   64 Size:     4 [unused]
//   float FC_SnowMinDot;               // Offset:   68 Size:     4 [unused]
//   float FC_SnowMaxDot;               // Offset:   72 Size:     4 [unused]
//   float FC_SparkleExponent;          // Offset:   80 Size:     4 [unused]
//   float FC_SparkleThreshold;         // Offset:   84 Size:     4 [unused]
//   float FC_SparkleMul;               // Offset:   88 Size:     4 [unused]
//   float FC_SparkleMaskExponent;      // Offset:   92 Size:     4 [unused]
//   float4 FC_SkinMatchColor;          // Offset:   96 Size:    16 [unused]
//   int FC_EnvId;                      // Offset:  112 Size:     4 [unused]
//   float4 FC_ParallaxCorrectedCubemapOriginA;// Offset:  128 Size:    16 [unused]
//   float4 FC_ParallaxCorrectedCubemapOriginB;// Offset:  144 Size:    16 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapObbA;// Offset:  160 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapInvObbA;// Offset:  224 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapObbB;// Offset:  288 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapInvObbB;// Offset:  352 Size:    64 [unused]
//   float FC_ParallaxCorrectedCubemapObbAEnable;// Offset:  416 Size:     4 [unused]
//   float FC_ParallaxCorrectedCubemapObbBEnable;// Offset:  420 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbMtdParam                        cbuffer      NA          NA    3        1
// cbInstanceData                    cbuffer      NA          NA    4        1
// cbModelParam                      cbuffer      NA          NA    7        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float       
// TEXCOORD                 0   xyzw        1     NONE   float   xy w
// TEXCOORD                 1   xyzw        2     NONE   float   xy w
// TEXCOORD                 2   xyz         3     NONE   float       
// TEXCOORD                 3   xy          4     NONE   float       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb3[6], immediateIndexed
dcl_constantbuffer cb4[8], immediateIndexed
dcl_constantbuffer cb7[1], immediateIndexed
dcl_input_ps linear v1.xyw
dcl_input_ps linear v2.xyw
dcl_output o0.xyzw
dcl_temps 1
eq r0.x, cb4[7].x, l(0.000000)
lt r0.y, l(1.000000), cb3[5].x
or r0.x, r0.y, r0.x
discard_nz r0.x
div r0.xy, v1.xyxx, v1.wwww
div r0.zw, v2.xxxy, v2.wwww
add r0.xy, -r0.zwzz, r0.xyxx
mul r0.xy, r0.xyxx, cb7[0].xyxx
mad_sat o0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r0.x, v1.w, l(10.000000)
div o0.z, v1.w, r0.x
mov o0.w, l(1.000000)
ret 
// Approximately 13 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
