//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.67 on Mon Jan 01 13:11:46 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 specColor;                  // Offset:  112 Size:    16 [unused]
//   float4 ControlData;                // Offset:  128 Size:    16 [unused]
//   float4 difColor;                   // Offset:  144 Size:    16 [unused]
//   float4 ambient;                    // Offset:  160 Size:    16 [unused]
//   float4 g_vDefLightDir;             // Offset:  176 Size:    16 [unused]
//   float4 g_vDefLightColor;           // Offset:  192 Size:    16 [unused]
//   float4 g_vDefSpecColor;            // Offset:  208 Size:    16 [unused]
//   uint CS_FRONT;                     // Offset:  224 Size:     4 [unused]
//      = 0x00000000 
//   uint CS_RIGHT;                     // Offset:  228 Size:     4 [unused]
//      = 0x00000001 
//   uint CS_BACK;                      // Offset:  232 Size:     4 [unused]
//      = 0x00000002 
//   uint CS_LEFT;                      // Offset:  236 Size:     4 [unused]
//      = 0x00000003 
//   uint CS_TOP;                       // Offset:  240 Size:     4 [unused]
//      = 0x00000004 
//   uint CS_BOTTOM;                    // Offset:  244 Size:     4 [unused]
//      = 0x00000005 
//   float4 g_vAmbientSettings;         // Offset:  256 Size:    16
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:  272
//       float4 vFogLayerPlane;         // Offset:  288
//       float4 vFogLayerColor;         // Offset:  304
//       float4 vFogLayerSettings;      // Offset:  320
//       float4 vFogColor;              // Offset:  336
//       float4 vFogDistance;           // Offset:  352
//
//   } g_FogDesc;                       // Offset:  272 Size:    96 [unused]
//   float4 g_vScreenDepthRect;         // Offset:  368 Size:    16 [unused]
//   float4 g_vKSettings;               // Offset:  384 Size:    16 [unused]
//   float4x4 g_mPrevObjViewProj;       // Offset:  400 Size:    64 [unused]
//   float4 BumpStrenght;               // Offset:  464 Size:    16 [unused]
//      = 0x3f800000 0x00000000 0x00000000 0x00000000 
//   float4x4 g_mViewProj;              // Offset:  480 Size:    64
//   float4x4 g_mView;                  // Offset:  544 Size:    64
//   float3 g_vCamPos;                  // Offset:  608 Size:    12
//   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   
// COLOR                    0   xyz         4     NONE   float   xyz 
// POSITION                 1   xyz         5     NONE   float   xyz 
// NORMAL                   1   xyz         6     NONE   float   xyz 
// COLOR                    1   xyz         7     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   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   xyzw        7     NONE   float   xyzw
// 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[53], 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_input v6.xyz
dcl_input v7.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyz
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_output o8.xyz
dcl_output o9.xyzw
dcl_output_siv o10.x, clip_distance
// dcl_temps updated : previous = dcl_temps 7
dcl_temps 10
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r8.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r9.x, r8.w
mov r9.y, r8.w
mov r9.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
add r0.xyz, -v0.xyzx, v5.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[30].xyzw
dp4 r7.x, r2.xyzw, cb0[30].xyzw
mul r0.x, r7.x, r9.x
// replacing matrix usage :dp4 r0.y, r2.xyzw, cb0[31].xyzw
dp4 r7.y, r2.xyzw, cb0[31].xyzw
mul r0.y, r7.y, r9.y
dp4 r3.z, r2.xyzw, cb0[32].xyzw
dp4 r0.w, r2.xyzw, cb0[33].xyzw
lt r0.z, l(0.500000), cb0[1].x
if_nz r0.z
  dp4 o10.x, cb0[0].xyzw, r2.xyzw
else 
  mov o10.x, l(1.000000)
endif 
dp4 o7.x, r2.xyzw, cb0[2].xyzw
dp4 r0.z, r2.xyzw, cb0[3].xyzw
dp4 o7.y, r2.xyzw, cb0[4].xyzw
add r0.z, r0.z, -cb0[6].x
mad_sat o7.z, -r0.z, cb0[6].y, l(1.000000)
add r0.z, r0.w, -cb0[52].x
mul_sat o7.w, r0.z, cb0[52].y
add r4.xyz, -v1.xyzx, v6.xyzx
mad r4.xyz, cb1[0].xxxx, r4.xyzx, v1.xyzx
dp3 r0.z, r4.xyzx, r4.xyzx
rsq r0.z, r0.z
mul r4.xyz, r0.zzzz, r4.xyzx
add r5.xyz, -v4.xyzx, v7.xyzx
mad r5.xyz, cb1[0].xxxx, r5.xyzx, v4.xyzx
mad r5.xyz, r5.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r0.z, r5.xyzx, r5.xyzx
rsq r0.z, r0.z
mul r5.xyz, r0.zzzz, r5.xyzx
dp3 r6.x, r4.xyzx, cb1[r1.x + 65].xyzx
dp3 r6.y, r4.xyzx, cb1[r1.y + 65].xyzx
dp3 r6.z, r4.xyzx, cb1[r1.z + 65].xyzx
dp3 r4.z, r5.xyzx, cb1[r1.x + 65].xyzx
dp3 r4.x, r5.xyzx, cb1[r1.y + 65].xyzx
dp3 r4.y, r5.xyzx, cb1[r1.z + 65].xyzx
dp3 r0.z, r6.xyzx, r6.xyzx
rsq r0.z, r0.z
mul r1.xyz, r0.zzzz, r6.xyzx
dp3 r0.z, r4.xyzx, r4.xyzx
rsq r0.z, r0.z
mul r4.xyz, r0.zzzz, r4.xyzx
mul r5.xyz, r1.zxyz, r4.xyzx
mad r5.xyz, r1.yzxy, r4.yzxy, -r5.xyzx
lt r0.z, l(0.500000), cb0[16].y
if_nz r0.z
// replacing matrix usage :  dp3 r6.x, r1.xyzx, cb0[34].xyzx
dp3 r7.x, r1.xyzx, cb0[34].xyzx
mul r6.x, r7.x, r9.x
// replacing matrix usage :  dp3 r6.y, r1.xyzx, cb0[35].xyzx
dp3 r7.y, r1.xyzx, cb0[35].xyzx
mul r6.y, r7.y, r9.y
  dp3 r6.z, r1.xyzx, cb0[36].xyzx
else 
  add r0.z, r0.w, r0.x
  mul r3.x, r0.z, l(0.500000)
  add r0.z, -r0.y, r0.w
  mul r3.y, r0.z, l(0.500000)
  mov r6.xyz, r3.xyzx
endif 
add r3.xyw, -r2.xyxz, cb0[38].xyxz
dp3 r0.z, r3.xywx, r3.xywx
rsq r0.z, r0.z
mul o8.xyz, r0.zzzz, r3.xywx
dp4 o6.x, r2.xyzw, cb0[45].xyzw
dp4 o6.y, r2.xyzw, cb0[46].xyzw
dp4 o6.z, r2.xyzw, cb0[47].xyzw
ftou r0.z, v3.x
add r3.xy, v2.xyxx, cb1[r0.z + 1].xyxx
mul o2.xy, r3.xyxx, l(64.000000, 64.000000, 0.000000, 0.000000)
ge r1.w, cb1[r0.z + 1].z, l(0.990000)
if_nz r1.w
  mov o0.xyzw, l(0,0,0,0)
else 
  mov o0.z, r3.z
  mov o0.xyw, r0.xyxw
endif 
mov o3.x, r5.x
mov o3.y, r4.z
mov o3.z, r1.x
mov o3.w, r2.x
mov o4.x, r5.y
mov o4.y, r4.x
mov o4.z, r1.y
mov o4.w, r2.y
mov o5.x, r5.z
mov o5.y, r4.y
mov o5.z, r1.z
mov o5.w, r2.z
mov r6.w, r0.w
mov o6.w, r6.w
mov o9.xyzw, r6.xyzw
mov o2.z, cb1[r0.z + 1].z
mov o1.xy, r3.xyxx
ret 
// Approximately 100 instruction slots used
