//
// 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
//   float4 g_vCamPos;                  // Offset:  592 Size:    16
//   float4 g_vSkyColor;                // Offset:  608 Size:    16 [unused]
//   float4 g_vFogK;                    // Offset:  624 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4x4 mLightSpaceInverse;   // Offset:  640
//       float4x4 mLightSpace;          // Offset:  704
//       float4 vShadowBias;            // Offset:  768
//       float4 vBiasDir;               // Offset:  784
//       float4 vSmoothOffs;            // Offset:  800
//       float4 vShadowsDesc;           // Offset:  816
//       float4 avCPlane[8];            // Offset:  832
//       float4 avCascadeZ[2];          // Offset:  960
//       float4 avUVTransform[8];       // Offset:  992
//       float4 avZTransformZF[8];      // Offset: 1120
//
//   } g_ShadSettings;                  // Offset:  640 Size:   608
//
// }
//
// cbuffer CBBones
// {
//
//   float4 g_avBones[75];              // Offset:    0 Size:  1200
//
// }
//
//
// 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 
// POSITION                 1   xyz         1     NONE   float   xyz 
// POSITION                 2   xyz         2     NONE   float   xyz 
// NORMAL                   0   xyz         3     NONE   float   xyz 
// NORMAL                   1   xyz         4     NONE   float   xyz 
// NORMAL                   2   xyz         5     NONE   float   xyz 
// COLOR                    0   xyz         6     NONE   float   xyz 
// TEXCOORD                 0   xy          7     NONE   float   xy  
// BLENDINDICES             0   xyzw        8     NONE   float   xyzw
// BLENDINDICES             1   xyzw        9     NONE   float   xy  
//
//
// 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   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 5   xyz         6     NONE   float   xyz 
// TEXCOORD                 6   xyzw        7     NONE   float   xyzw
// TEXCOORD                 7   xyzw        8     NONE   float   xyzw
// SV_ClipDistance          0   x           9  CLIPDST   float   x   
//
vs_4_1
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[52], immediateIndexed
dcl_constantbuffer cb1[75], dynamicIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyz
dcl_input v3.xyz
dcl_input v4.xyz
dcl_input v5.xyz
dcl_input v6.xyz
dcl_input v7.xy
dcl_input v8.xyzw
dcl_input v9.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyz
dcl_output o7.xyzw
dcl_output o8.xyzw
dcl_output_siv o9.x, clip_distance
// dcl_temps updated : previous = dcl_temps 8
dcl_temps 11
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r9.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r10.x, r9.w
mov r10.y, r9.w
mov r10.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
mul r0.xy, v8.xzxx, l(3.000000, 3.000000, 0.000000, 0.000000)
mul r0.z, v9.x, l(3.000000)
ftou r0.x, r0.x
mov r1.xyz, v0.xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb1[r0.x + 0].xyzw
mad r3.xy, v8.xxxx, l(3.000000, 3.000000, 0.000000, 0.000000), l(1.000000, 2.000000, 0.000000, 0.000000)
ftou r3.xy, r3.xyxx
dp4 r2.y, r1.xyzw, cb1[r3.x + 0].xyzw
dp4 r2.z, r1.xyzw, cb1[r3.y + 0].xyzw
ne r0.w, v8.w, l(0.000000)
if_nz r0.w
  ftou r1.x, r0.y
  mov r4.xyz, v1.xyzx
  mov r4.w, l(1.000000)
  dp4 r1.x, r4.xyzw, cb1[r1.x + 0].xyzw
  mad r3.zw, v8.zzzz, l(0.000000, 0.000000, 3.000000, 3.000000), l(0.000000, 0.000000, 1.000000, 2.000000)
  ftou r3.zw, r3.zzzw
  dp4 r1.y, r4.xyzw, cb1[r3.z + 0].xyzw
  dp4 r1.z, r4.xyzw, cb1[r3.w + 0].xyzw
else 
  mov r1.xyz, l(0,0,0,0)
endif 
ne r1.w, v9.y, l(0.000000)
if_nz r1.w
  ftou r2.w, r0.z
  mov r4.xyz, v2.xyzx
  mov r4.w, l(1.000000)
  dp4 r5.x, r4.xyzw, cb1[r2.w + 0].xyzw
  mad r3.zw, v9.xxxx, l(0.000000, 0.000000, 3.000000, 3.000000), l(0.000000, 0.000000, 1.000000, 2.000000)
  ftou r3.zw, r3.zzzw
  dp4 r5.y, r4.xyzw, cb1[r3.z + 0].xyzw
  dp4 r5.z, r4.xyzw, cb1[r3.w + 0].xyzw
else 
  mov r5.xyz, l(0,0,0,0)
endif 
mul r4.xyz, r1.xyzx, v8.wwww
mad r2.xyz, r2.xyzx, v8.yyyy, r4.xyzx
mad r2.xyz, r5.xyzx, v9.yyyy, r2.xyzx
mov r2.w, l(1.000000)
// replacing matrix usage :dp4 r4.x, r2.xyzw, cb0[29].xyzw
dp4 r8.x, r2.xyzw, cb0[29].xyzw
mul r4.x, r8.x, r10.x
// replacing matrix usage :dp4 r4.y, r2.xyzw, cb0[30].xyzw
dp4 r8.y, r2.xyzw, cb0[30].xyzw
mul r4.y, r8.y, r10.y
dp4 r6.z, r2.xyzw, cb0[31].xyzw
dp4 r4.w, r2.xyzw, cb0[32].xyzw
dp4 o7.x, r2.xyzw, cb0[2].xyzw
dp4 r3.z, r2.xyzw, cb0[3].xyzw
dp4 o7.y, r2.xyzw, cb0[4].xyzw
add r3.z, r3.z, -cb0[6].x
mad_sat o7.z, -r3.z, cb0[6].y, l(1.000000)
add r3.z, r4.w, -cb0[51].x
mul_sat o7.w, r3.z, cb0[51].y
add r7.xyz, -r2.xyzx, cb0[37].xyzx
dp3 r3.z, r7.xyzx, r7.xyzx
rsq r3.z, r3.z
mul o6.xyz, r3.zzzz, r7.xyzx
lt r3.z, l(0.500000), cb0[1].x
if_nz r3.z
  dp4 o9.x, cb0[0].xyzw, r2.xyzw
else 
  mov o9.x, l(1.000000)
endif 
dp4 o2.x, r2.xyzw, cb0[44].xyzw
dp4 o2.y, r2.xyzw, cb0[45].xyzw
dp4 o2.z, r2.xyzw, cb0[46].xyzw
dp3 r7.x, v3.xyzx, cb1[r0.x + 0].xyzx
dp3 r7.y, v3.xyzx, cb1[r3.x + 0].xyzx
dp3 r7.z, v3.xyzx, cb1[r3.y + 0].xyzx
if_nz r0.w
  ftou r0.y, r0.y
  dp3 r1.x, v4.xyzx, cb1[r0.y + 0].xyzx
  mad r0.yw, v8.zzzz, l(0.000000, 3.000000, 0.000000, 3.000000), l(0.000000, 1.000000, 0.000000, 2.000000)
  ftou r0.yw, r0.yyyw
  dp3 r1.y, v4.xyzx, cb1[r0.y + 0].xyzx
  dp3 r1.z, v4.xyzx, cb1[r0.w + 0].xyzx
endif 
if_nz r1.w
  ftou r0.y, r0.z
  dp3 r5.x, v5.xyzx, cb1[r0.y + 0].xyzx
  mad r0.yz, v9.xxxx, l(0.000000, 3.000000, 3.000000, 0.000000), l(0.000000, 1.000000, 2.000000, 0.000000)
  ftou r0.yz, r0.yyzy
  dp3 r5.y, v5.xyzx, cb1[r0.y + 0].xyzx
  dp3 r5.z, v5.xyzx, cb1[r0.z + 0].xyzx
endif 
mul r0.yzw, r1.xxyz, v8.wwww
mad r0.yzw, r7.xxyz, v8.yyyy, r0.yyzw
mad r0.yzw, r5.xxyz, v9.yyyy, r0.yyzw
dp3 r1.x, r0.yzwy, r0.yzwy
rsq r1.x, r1.x
mul r0.yzw, r0.yyzw, r1.xxxx
mad r1.xyz, v6.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r5.x, r1.xyzx, cb1[r0.x + 0].xyzx
dp3 r5.y, r1.xyzx, cb1[r3.x + 0].xyzx
dp3 r5.z, r1.xyzx, cb1[r3.y + 0].xyzx
mul r1.xyz, r0.zwyz, r5.xyzx
mad r1.xyz, r0.yzwy, r5.yzxy, -r1.xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.x, r0.x
mul r1.xyz, r0.xxxx, r1.xyzx
mul r3.xyz, r0.zwyz, r1.xyzx
mad r3.xyz, r1.zxyz, r0.wyzw, -r3.xyzx
lt r0.x, l(0.500000), cb0[21].y
if_nz r0.x
// replacing matrix usage :  dp3 r5.x, r0.yzwy, cb0[33].xyzx
dp3 r8.x, r0.yzwy, cb0[33].xyzx
mul r5.x, r8.x, r10.x
// replacing matrix usage :  dp3 r5.y, r0.yzwy, cb0[34].xyzx
dp3 r8.y, r0.yzwy, cb0[34].xyzx
mul r5.y, r8.y, r10.y
  dp3 r5.z, r0.yzwy, cb0[35].xyzx
else 
  add r0.x, r4.w, r4.x
  mul r6.x, r0.x, l(0.500000)
  add r0.x, -r4.y, r4.w
  mul r6.y, r0.x, l(0.500000)
  mov r5.xyz, r6.xyzx
endif 
mov o0.z, r6.z
mov o0.xyw, r4.xyxw
mov r5.w, r4.w
mov o2.w, r5.w
mov o3.x, r1.y
mov o3.y, r3.x
mov o3.z, r0.y
mov o3.w, r2.x
mov o4.x, r1.z
mov o4.y, r3.y
mov o4.z, r0.z
mov o4.w, r2.y
mov o5.x, r1.x
mov o5.y, r3.z
mov o5.z, r0.w
mov o5.w, r2.z
mov o8.xyzw, r5.xyzw
mov o1.xy, v7.xyxx
ret 
// Approximately 131 instruction slots used
