//
// 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
// {
//
//   float4 g_vParams;                  // Offset:    0 Size:    16
//   float4 g_aUVShiftData[64];         // Offset:   16 Size:  1024 [unused]
//   float4 bones[192];                 // Offset: 1040 Size:  3072
//   
//   struct
//   {
//       
//       float4 vPlane;                 // Offset: 4112
//       float4 vSettings;              // Offset: 4128
//
//   } g_ClipPlane;                     // Offset: 4112 Size:    32
//   float4x4 g_mCloudsShadowsSpace;    // Offset: 4144 Size:    64
//   float4 g_vCloudsShadowDesc;        // Offset: 4208 Size:    16
//   float4 specColor;                  // Offset: 4224 Size:    16 [unused]
//   float4 ControlData;                // Offset: 4240 Size:    16 [unused]
//   float4 difColor;                   // Offset: 4256 Size:    16
//   float4 ambient;                    // Offset: 4272 Size:    16 [unused]
//   float4 lightCount;                 // Offset: 4288 Size:    16
//   float4 g_avLightPos[2];            // Offset: 4304 Size:    32
//   float4 g_avLightColor[2];          // Offset: 4336 Size:    32
//   float4 g_avConeDir[2];             // Offset: 4368 Size:    32
//   float4 g_vAmbientSettings;         // Offset: 4400 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset: 4416
//       float4 vFogLayerPlane;         // Offset: 4432
//       float4 vFogLayerColor;         // Offset: 4448
//       float4 vFogLayerSettings;      // Offset: 4464
//       float4 vFogColor;              // Offset: 4480
//       float4 vFogDistance;           // Offset: 4496
//
//   } g_FogDesc;                       // Offset: 4416 Size:    96 [unused]
//   float4x4 g_mViewProj;              // Offset: 4512 Size:    64
//   float4 g_vCamPos;                  // Offset: 4576 Size:    16
//   float4 g_vSkyColor;                // Offset: 4592 Size:    16 [unused]
//   float4 g_vFogK;                    // Offset: 4608 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   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   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// TEXCOORD                 3   xyz         4     NONE   float   xyz 
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// COLOR                    0   xyzw        6     NONE   float   xyzw
// COLOR                    1   xyzw        7     NONE   float   xyzw
// SV_ClipDistance          0   x           8  CLIPDST   float   x   
//
vs_4_0
dcl_constantbuffer cb0[287], 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.xyzw
dcl_output o3.xyz
dcl_output o4.xyz
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_output_siv o8.x, clip_distance
// dcl_temps updated : previous = dcl_temps 10
dcl_temps 13
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r11.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r12.x, r11.w
mov r12.y, r11.w
mov r12.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
add r0.xyz, -v0.xyzx, v4.xyzx
mad r0.xyz, cb0[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, cb0[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, cb0[r1.y + 65].xyzw
dp4 r2.z, r0.xyzw, cb0[r1.z + 65].xyzw
mov r2.w, l(1.000000)
// replacing matrix usage :dp4 o0.x, r2.xyzw, cb0[282].xyzw
dp4 r10.x, r2.xyzw, cb0[282].xyzw
mul o0.x, r10.x, r12.x
// replacing matrix usage :dp4 o0.y, r2.xyzw, cb0[283].xyzw
dp4 r10.y, r2.xyzw, cb0[283].xyzw
mul o0.y, r10.y, r12.y
dp4 o0.z, r2.xyzw, cb0[284].xyzw
dp4 o0.w, r2.xyzw, cb0[285].xyzw
lt r0.x, l(0.500000), cb0[258].x
if_nz r0.x
  dp4 o8.x, cb0[257].xyzw, r2.xyzw
else 
  mov o8.x, l(1.000000)
endif 
dp4 o3.x, r2.xyzw, cb0[259].xyzw
dp4 r0.x, r2.xyzw, cb0[260].xyzw
dp4 o3.y, r2.xyzw, cb0[261].xyzw
add r0.x, r0.x, -cb0[263].x
mad_sat o3.z, -r0.x, cb0[263].y, l(1.000000)
add r0.xyz, -v1.xyzx, v5.xyzx
mad r0.xyz, cb0[0].xxxx, r0.xyzx, v1.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r3.x, r0.xyzx, cb0[r1.x + 65].xyzx
dp3 r3.y, r0.xyzx, cb0[r1.y + 65].xyzx
dp3 r3.z, r0.xyzx, cb0[r1.z + 65].xyzx
dp3 r0.x, r3.xyzx, r3.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, r3.xyzx
mov r3.x, cb0[r1.x + 65].w
mov r3.y, cb0[r1.y + 65].w
mov r3.z, cb0[r1.z + 65].w
add r1.xyz, r2.xyzx, -r3.xyzx
mov r1.w, l(1.000000)
dp4 r0.w, r1.xyzw, r1.xyzw
sqrt o5.w, r0.w
mul r3.xyz, r0.zxyz, r1.yzxy
mad r1.xyz, r0.yzxy, r1.zxyz, -r3.xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul o5.xyz, r0.wwww, r1.xyzx
add r1.xyz, -r2.xyzx, cb0[286].xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r1.xyzx
ftoi r1.w, cb0[268].x
mov r4.xyzw, l(0,0,0,0)
mov r5.xyz, l(0,0,0,0)
mov r6.xyz, l(0,0,0,0)
mov r2.w, l(0)
loop 
  ige r3.w, r2.w, r1.w
  breakc_nz r3.w
  ge r7.xy, cb0[r2.w + 271].xyxx, l(100.000000, 100.000000, 0.000000, 0.000000)
  if_nz r7.x
    add r3.w, l(-100.000000), cb0[r2.w + 271].x
  else 
    mov r3.w, cb0[r2.w + 271].x
  endif 
  if_nz r7.y
    add r5.w, l(-100.000000), cb0[r2.w + 271].y
  else 
    mov r5.w, cb0[r2.w + 271].y
  endif 
  lt r6.w, l(1.000000), cb0[r2.w + 269].w
  if_nz r6.w
    add r7.xyz, -r2.xyzx, cb0[r2.w + 269].xyzx
    dp3 r6.w, r7.xyzx, r7.xyzx
    sqrt r7.w, r6.w
    div r7.xyz, r7.xyzx, r7.wwww
    mad r6.w, r6.w, cb0[r2.w + 271].w, l(1.000000)
    div r6.w, l(1.000000, 1.000000, 1.000000, 1.000000), r6.w
    add r6.w, r6.w, l(-0.100000)
    mul_sat r6.w, r6.w, l(1.11111116)
    lt r8.x, l(2.000000), cb0[r2.w + 269].w
    if_nz r8.x
      add r8.x, l(-3.000000), cb0[r2.w + 269].w
      dp3 r8.y, r7.xyzx, cb0[r2.w + 273].xyzx
      add r8.z, -|r8.y|, l(1.000000)
      sqrt r8.z, r8.z
      mad r8.w, |r8.y|, l(-0.0187292993), l(0.074261)
      mad r8.w, r8.w, |r8.y|, l(-0.212114394)
      mad r8.w, r8.w, |r8.y|, l(1.57072878)
      mul r9.x, r8.z, r8.w
      mad r9.x, r9.x, l(-2.000000), l(3.14159274)
      lt r8.y, r8.y, -r8.y
      and r8.y, r8.y, r9.x
      mad r8.y, r8.w, r8.z, r8.y
      lt r8.z, r8.y, r8.x
      if_nz r8.z
        frc r8.z, cb0[r2.w + 273].w
        div r8.x, r8.y, r8.x
        add r8.x, -r8.z, r8.x
        add r8.y, -r8.z, l(1.000000)
        div_sat r8.x, r8.x, r8.y
        add r8.x, -r8.x, l(1.000000)
      else 
        mov r8.x, l(0)
      endif 
      mul r6.w, r6.w, r8.x
    endif 
  else 
    mov r7.xyz, -cb0[r2.w + 269].xyzx
    mov r6.w, l(1.000000)
  endif 
  dp3 r8.x, r7.xyzx, r0.xyzx
  max r8.x, r8.x, l(0.000000)
  mul r9.x, r3.w, r8.x
  mul r9.y, r5.w, r8.x
  mul r9.z, r8.x, cb0[r2.w + 271].z
  mul r8.xyz, r6.wwww, r9.xyzx
  if_z r2.w
    sqrt r7.w, r6.w
    mov r4.xyzw, r7.xyzw
    mov r5.xyz, r8.xyzx
  else 
    mad r6.xyz, r9.xyzx, r6.wwww, r6.xyzx
  endif 
  iadd r2.w, r2.w, l(1)
endloop 
mov o6.xyz, r5.xyzx
mov o7.xyz, r6.xyzx
dp3 r1.w, r3.xyzx, r0.xyzx
mul r2.x, cb0[266].x, l(40.000000)
log r1.w, r1.w
mul r1.w, r1.w, r2.x
exp r1.w, r1.w
min o6.w, r1.w, l(1.000000)
mad r1.xyz, r1.xyzx, r0.wwww, r4.xyzx
mul r1.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul o2.xyz, r0.wwww, r1.xyzx
mov o2.w, r4.w
mov o7.w, l(0)
mov o4.xyz, r0.xyzx
mov o1.xy, v2.xyxx
ret 
// Approximately 146 instruction slots used
