//
// 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
//   float4x4 g_mCloudsShadowsSpace;    // Offset:   32 Size:    64
//   float4 g_vCloudsShadowDesc;        // Offset:   96 Size:    16
//   float4 g_vKSettings;               // Offset:  112 Size:    16 [unused]
//   float4x4 g_mPrevObjViewProj;       // Offset:  128 Size:    64 [unused]
//   float4 specColor;                  // Offset:  192 Size:    16 [unused]
//   float4 ControlData;                // Offset:  208 Size:    16 [unused]
//   float4 difColor;                   // Offset:  224 Size:    16 [unused]
//   float4 ambient;                    // Offset:  240 Size:    16 [unused]
//   float4 g_vDefLightDir;             // Offset:  256 Size:    16 [unused]
//   float4 g_vDefLightColor;           // Offset:  272 Size:    16 [unused]
//   float4 g_vDefSpecColor;            // Offset:  288 Size:    16 [unused]
//   uint CS_FRONT;                     // Offset:  304 Size:     4 [unused]
//      = 0x00000000 
//   uint CS_RIGHT;                     // Offset:  308 Size:     4 [unused]
//      = 0x00000001 
//   uint CS_BACK;                      // Offset:  312 Size:     4 [unused]
//      = 0x00000002 
//   uint CS_LEFT;                      // Offset:  316 Size:     4 [unused]
//      = 0x00000003 
//   uint CS_TOP;                       // Offset:  320 Size:     4 [unused]
//      = 0x00000004 
//   uint CS_BOTTOM;                    // Offset:  324 Size:     4 [unused]
//      = 0x00000005 
//   float4 g_vAmbientSettings;         // Offset:  336 Size:    16
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:  352
//       float4 vFogLayerPlane;         // Offset:  368
//       float4 vFogLayerColor;         // Offset:  384
//       float4 vFogLayerSettings;      // Offset:  400
//       float4 vFogColor;              // Offset:  416
//       float4 vFogDistance;           // Offset:  432
//
//   } g_FogDesc;                       // Offset:  352 Size:    96 [unused]
//   float4 g_vScreenDepthRect;         // Offset:  448 Size:    16 [unused]
//   float4x4 g_mViewProj;              // Offset:  464 Size:    64
//   float4x4 g_mView;                  // Offset:  528 Size:    64
//   float3 g_vCamPos;                  // Offset:  592 Size:    12
//   float4 g_vMirrorRect;              // Offset:  608 Size:    16 [unused]
//   float4 g_vSkyColor;                // Offset:  624 Size:    16 [unused]
//   float4 g_vFogK;                    // Offset:  640 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4x4 mLightSpaceInverse;   // Offset:  656
//       float4x4 mLightSpace;          // Offset:  720
//       float4 vShadowBias;            // Offset:  784
//       float4 vBiasDir;               // Offset:  800
//       float4 vSmoothOffs;            // Offset:  816
//       float4 vShadowsDesc;           // Offset:  832
//       float4 avCPlane[8];            // Offset:  848
//       float4 avCascadeZ[2];          // Offset:  976
//       float4 avUVTransform[8];       // Offset: 1008
//       float4 avZTransformZF[8];      // Offset: 1136
//
//   } g_ShadSettings;                  // Offset:  656 Size:   608
//
// }
//
// cbuffer CBBones
// {
//
//   float4 g_vParams;                  // Offset:    0 Size:    16
//   float4 g_aUVShiftData[64];         // Offset:   16 Size:  1024
//   float4 bones[192];                 // Offset: 1040 Size:  3072
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
// CBBones                           cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// NORMAL                   0   xyz         1     NONE   float   xyz 
// TEXCOORD                 0   xy          2     NONE   float   xy  
// BLENDINDICES             0   x           3     NONE   float   x   
// POSITION                 1   xyz         4     NONE   float   xyz 
// NORMAL                   1   xyz         5     NONE   float   xyz 
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyz         5     NONE   float   xyz 
// TEXCOORD                 5   xyz         6     NONE   float   xyz 
// TEXCOORD                 6   xyz         7     NONE   float   xyz 
// TEXCOORD                 7   xyz         8     NONE   float   xyz 
// TEXCOORD                 8   xyzw        9     NONE   float   xyzw
// SV_ClipDistance          0   x          10  CLIPDST   float   x   
//
vs_4_1
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[48], immediateIndexed
dcl_constantbuffer cb1[257], dynamicIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xy
dcl_input v3.x
dcl_input v4.xyz
dcl_input v5.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyz
dcl_output o3.xyz
dcl_output o4.xyzw
dcl_output o5.xyz
dcl_output o6.xyz
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 5
dcl_temps 8
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r6.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r7.x, r6.w
mov r7.y, r6.w
mov r7.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
add r0.xyz, -v0.xyzx, v4.xyzx
mad r0.xyz, cb1[0].xxxx, r0.xyzx, v0.xyzx
mul r1.x, v3.x, l(3.000000)
ftou r1.x, r1.x
mov r0.w, l(1.000000)
dp4 r2.x, r0.xyzw, cb1[r1.x + 65].xyzw
mad r1.yz, v3.xxxx, l(0.000000, 3.000000, 3.000000, 0.000000), l(0.000000, 1.000000, 2.000000, 0.000000)
ftou r1.yz, r1.yyzy
dp4 r2.y, r0.xyzw, cb1[r1.y + 65].xyzw
dp4 r2.z, r0.xyzw, cb1[r1.z + 65].xyzw
mov r2.w, l(1.000000)
// replacing matrix usage :dp4 r0.x, r2.xyzw, cb0[29].xyzw
dp4 r5.x, r2.xyzw, cb0[29].xyzw
mul r0.x, r5.x, r7.x
// replacing matrix usage :dp4 r0.y, r2.xyzw, cb0[30].xyzw
dp4 r5.y, r2.xyzw, cb0[30].xyzw
mul r0.y, r5.y, r7.y
dp4 r0.z, r2.xyzw, cb0[32].xyzw
lt r0.w, l(0.500000), cb0[1].x
if_nz r0.w
  dp4 o10.x, cb0[0].xyzw, r2.xyzw
else 
  mov o10.x, l(1.000000)
endif 
dp4 o5.x, r2.xyzw, cb0[2].xyzw
dp4 r0.w, r2.xyzw, cb0[3].xyzw
dp4 o5.y, r2.xyzw, cb0[4].xyzw
add r0.w, r0.w, -cb0[6].x
mad_sat o5.z, -r0.w, cb0[6].y, l(1.000000)
dp4 o4.x, r2.xyzw, cb0[45].xyzw
dp4 o4.y, r2.xyzw, cb0[46].xyzw
dp4 o4.z, r2.xyzw, cb0[47].xyzw
add r3.xyz, -v1.xyzx, v5.xyzx
mad r3.xyz, cb1[0].xxxx, r3.xyzx, v1.xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r3.xyzx
dp3 r4.x, r3.xyzx, cb1[r1.x + 65].xyzx
dp3 r4.y, r3.xyzx, cb1[r1.y + 65].xyzx
dp3 r4.z, r3.xyzx, cb1[r1.z + 65].xyzx
dp3 r0.w, r4.xyzx, r4.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r4.xyzx
lt r0.w, l(0.500000), cb0[21].y
if_nz r0.w
// replacing matrix usage :  dp3 r3.x, r1.xyzx, cb0[33].xyzx
dp3 r5.x, r1.xyzx, cb0[33].xyzx
mul r3.x, r5.x, r7.x
// replacing matrix usage :  dp3 r3.y, r1.xyzx, cb0[34].xyzx
dp3 r5.y, r1.xyzx, cb0[34].xyzx
mul r3.y, r5.y, r7.y
  dp3 r3.z, r1.xyzx, cb0[35].xyzx
else 
  dp4 r3.z, r2.xyzw, cb0[31].xyzw
  add r0.w, r0.z, r0.x
  mul r3.x, r0.w, l(0.500000)
  add r0.w, -r0.y, r0.z
  mul r3.y, r0.w, l(0.500000)
endif 
add r4.xyz, -r2.xyzx, cb0[37].xyzx
dp3 r0.w, -r4.xyzx, r1.xyzx
add r0.w, r0.w, r0.w
mad o3.xyz, r1.xyzx, -r0.wwww, -r4.xyzx
dp3 r0.w, r4.xyzx, r4.xyzx
rsq r0.w, r0.w
mul o7.xyz, r0.wwww, r4.xyzx
ftou r0.w, v3.x
add r4.xy, v2.xyxx, cb1[r0.w + 1].xyxx
mul o2.xy, r4.xyxx, l(64.000000, 64.000000, 0.000000, 0.000000)
ge r1.w, cb1[r0.w + 1].z, l(0.990000)
if_nz r1.w
  mov o0.xyzw, l(0,0,0,0)
else 
  mov o0.xyzw, r0.xyzz
endif 
mov r3.w, r0.z
mov o4.w, r3.w
mov o9.xyzw, r3.xyzw
mov o2.z, cb1[r0.w + 1].z
mov o6.xyz, r1.xyzx
mov o8.xyz, r2.xyzx
mov o1.xy, r4.xyxx
ret 
// Approximately 75 instruction slots used
