//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.67 on Mon Jan 01 13:11:45 2018
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   struct
//   {
//       
//       float4 vPlane;                 // Offset:    0
//       float4 vSettings;              // Offset:   16
//
//   } g_ClipPlane;                     // Offset:    0 Size:    32
//   float4 specColor;                  // Offset:   32 Size:    16 [unused]
//   float4 ControlData;                // Offset:   48 Size:    16 [unused]
//   float4 difColor;                   // Offset:   64 Size:    16 [unused]
//   float4 ambient;                    // Offset:   80 Size:    16 [unused]
//   float4 g_vDefLightDir;             // Offset:   96 Size:    16 [unused]
//   float4 g_vDefLightColor;           // Offset:  112 Size:    16 [unused]
//   float4 g_vDefSpecColor;            // Offset:  128 Size:    16 [unused]
//   uint CS_FRONT;                     // Offset:  144 Size:     4 [unused]
//      = 0x00000000 
//   uint CS_RIGHT;                     // Offset:  148 Size:     4 [unused]
//      = 0x00000001 
//   uint CS_BACK;                      // Offset:  152 Size:     4 [unused]
//      = 0x00000002 
//   uint CS_LEFT;                      // Offset:  156 Size:     4 [unused]
//      = 0x00000003 
//   uint CS_TOP;                       // Offset:  160 Size:     4 [unused]
//      = 0x00000004 
//   uint CS_BOTTOM;                    // Offset:  164 Size:     4 [unused]
//      = 0x00000005 
//   float4 g_vAmbientSettings;         // Offset:  176 Size:    16
//   
//   struct
//   {
//       
//       float4x4 mLightSpaceInverse;   // Offset:  192
//       float4x4 mLightSpace;          // Offset:  256
//       float4 vShadowBias;            // Offset:  320
//       float4 vBiasDir;               // Offset:  336
//       float4 vSmoothOffs;            // Offset:  352
//       float4 vShadowsDesc;           // Offset:  368
//       float4 avCPlane[8];            // Offset:  384
//       float4 avCascadeZ[2];          // Offset:  512
//       float4 avUVTransform[8];       // Offset:  544
//       float4 avZTransformZF[8];      // Offset:  672
//
//   } g_ShadSettings;                  // Offset:  192 Size:   608
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:  800
//       float4 vFogLayerPlane;         // Offset:  816
//       float4 vFogLayerColor;         // Offset:  832
//       float4 vFogLayerSettings;      // Offset:  848
//       float4 vFogColor;              // Offset:  864
//       float4 vFogDistance;           // Offset:  880
//
//   } g_FogDesc;                       // Offset:  800 Size:    96
//   float4x4 g_mCloudsShadowsSpace;    // Offset:  896 Size:    64
//   float4 g_vCloudsShadowDesc;        // Offset:  960 Size:    16
//   float4 g_vScreenDepthRect;         // Offset:  976 Size:    16 [unused]
//   float4 g_vKSettings;               // Offset:  992 Size:    16 [unused]
//   float4x4 g_mPrevObjViewProj;       // Offset: 1008 Size:    64 [unused]
//   float4x4 g_mViewProj;              // Offset: 1072 Size:    64
//   float4x4 g_mView;                  // Offset: 1136 Size:    64
//   float4 g_vCamPos;                  // Offset: 1200 Size:    16
//   float4 g_vParams;                  // Offset: 1216 Size:    16
//   float4x4 g_mWorld;                 // Offset: 1232 Size:    64
//   float4 g_vAlphaMask;               // Offset: 1296 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyz 
// NORMAL                   0   xyz         1     NONE   float   xyz 
// TEXCOORD                 0   xy          2     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz 
// TEXCOORD                 1   xy          2     NONE   float   xy  
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xyzw        6     NONE   float   xyzw
// TEXCOORD                 6   xyz         7     NONE   float   xyz 
// TEXCOORD                 7   xyz         8     NONE   float   xyz 
// COLOR                    0   xyzw        9     NONE   float   xyzw
// SV_ClipDistance          0   x          10  CLIPDST   float   x   
//
vs_4_1
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[80], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xy
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyz
dcl_output o8.xyz
dcl_output o9.xyzw
dcl_output_siv o10.x, clip_distance
// dcl_temps updated : previous = dcl_temps 6
dcl_temps 9
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r7.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r8.x, r7.w
mov r8.y, r7.w
mov r8.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
mov r0.xyz, v0.xyzx
mov r0.w, l(1.000000)
dp4 r1.x, r0.xyzw, cb0[77].xyzw
dp4 r1.y, r0.xyzw, cb0[78].xyzw
dp4 r1.z, r0.xyzw, cb0[79].xyzw
add r0.xyz, r1.xyzx, -cb0[75].xyzx
dp3 r0.x, r0.xyzx, r0.xyzx
sqrt r0.x, r0.x
mul r0.y, r0.x, cb0[55].x
min r0.y, r0.y, l(1.000000)
mov r1.w, l(1.000000)
dp4 r0.z, r1.xyzw, cb0[51].xyzw
add r2.xyz, -r1.xyzx, cb0[75].xyzx
ge r0.w, cb0[50].z, l(0.000000)
if_nz r0.w
  lt r0.w, r0.z, -cb0[53].y
  if_nz r0.w
    mov r0.z, -cb0[53].y
  endif 
  ge r0.w, r0.z, l(0.000000)
  if_nz r0.w
    mov o3.w, l(0)
    mov r0.w, l(0)
    mov r2.w, l(-1)
  else 
    dp3 r3.x, r2.xyzx, r2.xyzx
    rsq r3.x, r3.x
    mul r3.xyz, r2.xyzx, r3.xxxx
    dp3 r3.x, cb0[51].xyzx, r3.xyzx
    lt r3.y, l(0.000100), |r3.x|
    if_nz r3.y
      div r3.x, l(1.000000, 1.000000, 1.000000, 1.000000), r3.x
      add r3.y, -r0.z, cb0[50].z
      mul r3.z, r3.x, cb0[50].z
      mad r0.w, r3.y, r3.x, -r3.z
    else 
      mov r0.w, l(0)
    endif 
    lt r2.w, r0.w, l(0.000100)
    if_nz r2.w
      mov o3.w, l(0)
    endif 
  endif 
  if_z r2.w
    mul r0.w, r0.w, cb0[53].x
    mul r0.w, r0.w, l(1.44254541)
    exp r0.w, r0.w
    div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
    add o3.w, -r0.w, l(1.000000)
  endif 
else 
  ge r0.z, r0.z, l(0.000000)
  if_nz r0.z
    dp3 r0.z, r2.xyzx, r2.xyzx
    rsq r0.z, r0.z
    mul r3.xyz, r0.zzzz, r2.xyzx
    dp3 r0.z, cb0[51].xyzx, r3.xyzx
    lt r0.w, l(0.000100), |r0.z|
    if_nz r0.w
      div r0.z, cb0[50].z, r0.z
    endif 
    lt r0.w, r0.z, l(0.000100)
    if_nz r0.w
      mov o3.w, l(0)
    endif 
  else 
    dp3 r2.w, r2.xyzx, r2.xyzx
    sqrt r0.z, r2.w
    mov r0.w, l(0)
  endif 
  if_z r0.w
    mul r0.z, r0.z, cb0[53].x
    mul r0.z, r0.z, l(1.44254541)
    exp r0.z, r0.z
    div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z
    add r0.z, r0.z, l(-1.000000)
    mov o3.w, -r0.z
  endif 
endif 
dp3 r0.z, cb0[54].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r0.w, r0.y, cb0[50].x
if_nz r0.w
  mul r0.w, r0.y, cb0[50].y
  div r0.w, r0.w, cb0[50].x
else 
  add r3.xy, -cb0[50].yxyy, l(1.000000, 1.000000, 0.000000, 0.000000)
  add r2.w, r0.y, -cb0[50].x
  mul r2.w, r2.w, r3.x
  div r2.w, r2.w, r3.y
  add r0.w, r2.w, cb0[50].y
endif 
mul r3.xyz, r0.wwww, cb0[54].xyzx
log r3.xyz, r3.xyzx
mul r3.xyz, r3.xyzx, cb0[54].wwww
exp r3.xyz, r3.xyzx
mul r3.xyz, r3.xyzx, l(-1.442695, -1.442695, -1.442695, 0.000000)
exp r3.xyz, r3.xyzx
add r3.xyz, -r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r0.zw, l(0.000000, 0.000000, 0.001000, 0.800000), r0.zzzy
and r0.z, r0.z, r0.w
if_nz r0.z
  add r0.y, r0.y, l(-0.800000)
  mul r0.y, r0.y, l(5.000000)
  add r4.xyz, -r3.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mad r3.xyz, r0.yyyy, r4.xyzx, r3.xyzx
endif 
add r0.y, cb0[55].w, l(-0.250000)
add r0.y, r0.y, r0.y
dp3 r0.z, r3.xyzx, l(0.333300, 0.333300, 0.333300, 0.000000)
add r4.xyz, -r3.xyzx, r0.zzzz
mad o3.xyz, r0.yyyy, r4.xyzx, r3.xyzx
dp4 o5.x, r1.xyzw, cb0[56].xyzw
dp4 r0.y, r1.xyzw, cb0[57].xyzw
dp4 o5.y, r1.xyzw, cb0[58].xyzw
add r0.y, r0.y, -cb0[60].x
mad_sat o5.z, -r0.y, cb0[60].y, l(1.000000)
// replacing matrix usage :dp4 r3.x, r1.xyzw, cb0[67].xyzw
dp4 r6.x, r1.xyzw, cb0[67].xyzw
mul r3.x, r6.x, r8.x
// replacing matrix usage :dp4 r3.y, r1.xyzw, cb0[68].xyzw
dp4 r6.y, r1.xyzw, cb0[68].xyzw
mul r3.y, r6.y, r8.y
dp4 r4.z, r1.xyzw, cb0[69].xyzw
dp4 r3.w, r1.xyzw, cb0[70].xyzw
lt r0.y, l(0.500000), cb0[1].x
if_nz r0.y
  dp4 o10.x, cb0[0].xyzw, r1.xyzw
else 
  mov o10.x, l(1.000000)
endif 
dp4 o4.x, r1.xyzw, cb0[16].xyzw
dp4 o4.y, r1.xyzw, cb0[17].xyzw
dp4 o4.z, r1.xyzw, cb0[18].xyzw
dp3 r5.x, v1.xyzx, cb0[77].xyzx
dp3 r5.y, v1.xyzx, cb0[78].xyzx
dp3 r5.z, v1.xyzx, cb0[79].xyzx
dp3 r0.y, r2.xyzx, r2.xyzx
rsq r0.y, r0.y
mul o8.xyz, r0.yyyy, r2.xyzx
lt r0.y, l(0.500000), cb0[11].y
if_nz r0.y
// replacing matrix usage :  dp3 r2.x, r5.xyzx, cb0[71].xyzx
dp3 r6.x, r5.xyzx, cb0[71].xyzx
mul r2.x, r6.x, r8.x
// replacing matrix usage :  dp3 r2.y, r5.xyzx, cb0[72].xyzx
dp3 r6.y, r5.xyzx, cb0[72].xyzx
mul r2.y, r6.y, r8.y
  dp3 r2.z, r5.xyzx, cb0[73].xyzx
else 
  add r0.y, r3.w, r3.x
  mul r4.x, r0.y, l(0.500000)
  add r0.y, -r3.y, r3.w
  mul r4.y, r0.y, l(0.500000)
  mov r2.xyz, r4.xyzx
endif 
add r0.y, -r0.x, cb0[76].x
mul r0.y, r0.y, cb0[76].y
mov_sat o9.xyzw, r0.yyyy
add r0.x, r0.x, -cb0[23].x
mul_sat o5.w, r0.x, cb0[23].y
mov o0.z, r4.z
mov o0.xyw, r3.xyxw
mov r2.w, r3.w
mov o4.w, r2.w
mov o6.xyzw, r2.xyzw
mov o1.xyz, r5.xyzx
mov o7.xyz, r1.xyzx
mov o2.xy, v2.xyxx
ret 
// Approximately 161 instruction slots used
