//
// 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
//   float4 ExPos[4];                   // Offset: 4112 Size:    64
//   float4 ExRad[4];                   // Offset: 4176 Size:    64 [unused]
//   float4 g_vExVolumeSettings;        // Offset: 4240 Size:    16 [unused]
//   float4 g_vExVolumeRect;            // Offset: 4256 Size:    16 [unused]
//   float4 specColor;                  // Offset: 4272 Size:    16 [unused]
//   float4 ControlData;                // Offset: 4288 Size:    16 [unused]
//   float4 difColor;                   // Offset: 4304 Size:    16 [unused]
//   float4 ambient;                    // Offset: 4320 Size:    16 [unused]
//   float4 lightCount;                 // Offset: 4336 Size:    16 [unused]
//   float4 g_avLightPos;               // Offset: 4352 Size:    16 [unused]
//   float4 g_avLightColor;             // Offset: 4368 Size:    16 [unused]
//   float4 g_avConeDir;                // Offset: 4384 Size:    16 [unused]
//   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
//   float4x4 g_mViewProj;              // Offset: 4512 Size:    64
//   float4x4 IView;                    // Offset: 4576 Size:    64
//   float3 g_vCamPos;                  // Offset: 4640 Size:    12
//   float4 vDiffColor;                 // Offset: 4656 Size:    16
//
// }
//
//
// 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 
// POSITION                 1   xyz         1     NONE   float   xyz 
// TEXCOORD                 0   xyzw        2     NONE   float   xyz 
// BLENDINDICES             0   x           3     NONE   float   x   
//
//
// 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
// COLOR                    0   xyzw        3     NONE   float   xyzw
//
vs_4_0
dcl_constantbuffer cb0[292], dynamicIndexed
dcl_input v0.xyz
dcl_input v1.xyz
dcl_input v2.xyz
dcl_input v3.x
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o2.xyzw
dcl_output o3.xyzw
// 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
mul r0.x, v3.x, l(3.000000)
ftou r0.x, r0.x
mov r1.xyz, v1.xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb0[r0.x + 65].xyzw
mad r0.yz, v3.xxxx, l(0.000000, 3.000000, 3.000000, 0.000000), l(0.000000, 1.000000, 2.000000, 0.000000)
ftou r0.yz, r0.yyzy
dp4 r2.y, r1.xyzw, cb0[r0.y + 65].xyzw
dp4 r2.z, r1.xyzw, cb0[r0.z + 65].xyzw
mov r1.x, cb0[r0.x + 65].z
mov r1.y, cb0[r0.y + 65].z
mov r1.z, cb0[r0.z + 65].z
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r1.w, r0.w
mul r1.xyz, r1.wwww, r1.xyzx
add r3.xyz, v0.xyzx, -v1.xyzx
mov r4.x, cb0[r0.x + 65].x
mov r4.y, cb0[r0.y + 65].x
mov r4.z, cb0[r0.z + 65].x
dp3 r1.w, r4.xyzx, r4.xyzx
sqrt r1.w, r1.w
mul r4.x, r1.w, r3.x
mov r5.x, cb0[r0.x + 65].y
mov r5.y, cb0[r0.y + 65].y
mov r5.z, cb0[r0.z + 65].y
dp3 r0.x, r5.xyzx, r5.xyzx
sqrt r0.x, r0.x
mul r4.y, r0.x, r3.y
sqrt r0.x, r0.w
mul r4.z, r0.x, r3.z
// replacing matrix usage :dp3 r0.x, r4.xyzx, cb0[286].xyzx
dp3 r6.x, r4.xyzx, cb0[286].xyzx
mul r0.x, r6.x, r8.x
// replacing matrix usage :dp3 r0.y, r4.xyzx, cb0[287].xyzx
dp3 r6.y, r4.xyzx, cb0[287].xyzx
mul r0.y, r6.y, r8.y
dp3 r0.z, r4.xyzx, cb0[288].xyzx
dp3 r0.w, r4.xyzx, cb0[289].xyzx
mov r2.w, l(1.000000)
dp4 r1.w, r2.xyzw, cb0[284].xyzw
add r3.xyz, r2.xyzx, -cb0[290].xyzx
dp3 r3.w, r3.xyzx, r3.xyzx
rsq r4.x, r3.w
mul r3.xyz, r3.xyzx, r4.xxxx
dp3 r1.x, r1.xyzx, r3.xyzx
max r1.x, r1.x, l(0.000000)
mul r1.y, r1.x, r1.x
mul r1.y, r1.y, r1.y
mad r1.x, -r1.x, r1.y, l(1.000000)
sqrt r1.z, r3.w
mul r1.z, r1.z, cb0[281].x
min r1.z, r1.z, l(1.000000)
dp4 r3.x, r2.xyzw, cb0[277].xyzw
add r3.yzw, -r2.xxyz, cb0[290].xxyz
ge r4.x, cb0[276].z, l(0.000000)
if_nz r4.x
  lt r4.x, r3.x, -cb0[279].y
  if_nz r4.x
    mov r3.x, -cb0[279].y
  endif 
  ge r4.x, r3.x, l(0.000000)
  if_nz r4.x
    mov o2.w, l(0)
    mov r4.xy, l(0,-1,0,0)
  else 
    dp3 r4.z, r3.yzwy, r3.yzwy
    rsq r4.z, r4.z
    mul r5.xyz, r3.yzwy, r4.zzzz
    dp3 r4.z, cb0[277].xyzx, r5.xyzx
    lt r4.w, l(0.000100), |r4.z|
    if_nz r4.w
      div r4.z, l(1.000000, 1.000000, 1.000000, 1.000000), r4.z
      add r4.w, -r3.x, cb0[276].z
      mul r5.x, r4.z, cb0[276].z
      mad r4.x, r4.w, r4.z, -r5.x
    else 
      mov r4.x, l(0)
    endif 
    lt r4.y, r4.x, l(0.000100)
    if_nz r4.y
      mov o2.w, l(0)
    endif 
  endif 
  if_z r4.y
    mul r4.x, r4.x, cb0[279].x
    mul r4.x, r4.x, l(1.44254541)
    exp r4.x, r4.x
    div r4.x, l(1.000000, 1.000000, 1.000000, 1.000000), r4.x
    add o2.w, -r4.x, l(1.000000)
  endif 
else 
  ge r3.x, r3.x, l(0.000000)
  if_nz r3.x
    dp3 r3.x, r3.yzwy, r3.yzwy
    rsq r3.x, r3.x
    mul r4.xyz, r3.xxxx, r3.yzwy
    dp3 r3.x, cb0[277].xyzx, r4.xyzx
    lt r4.x, l(0.000100), |r3.x|
    if_nz r4.x
      div r3.x, cb0[276].z, r3.x
    endif 
    lt r4.x, r3.x, l(0.000100)
    if_nz r4.x
      mov o2.w, l(0)
    endif 
  else 
    dp3 r3.y, r3.yzwy, r3.yzwy
    sqrt r3.x, r3.y
    mov r4.x, l(0)
  endif 
  if_z r4.x
    mul r3.x, r3.x, cb0[279].x
    mul r3.x, r3.x, l(1.44254541)
    exp r3.x, r3.x
    div r3.x, l(1.000000, 1.000000, 1.000000, 1.000000), r3.x
    add r3.x, r3.x, l(-1.000000)
    mov o2.w, -r3.x
  endif 
endif 
dp3 r3.x, cb0[280].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r3.x, l(0.001000), r3.x
lt r3.y, r1.z, cb0[276].x
if_nz r3.y
  mul r3.y, r1.z, cb0[276].y
  div r3.y, r3.y, cb0[276].x
else 
  add r3.zw, -cb0[276].yyyx, l(0.000000, 0.000000, 1.000000, 1.000000)
  add r4.x, r1.z, -cb0[276].x
  mul r3.z, r3.z, r4.x
  div r3.z, r3.z, r3.w
  add r3.y, r3.z, cb0[276].y
endif 
mul r3.yzw, r3.yyyy, cb0[280].xxyz
log r3.yzw, r3.yyzw
mul r3.yzw, r3.yyzw, cb0[280].wwww
exp r3.yzw, r3.yyzw
mul r3.yzw, r3.yyzw, l(0.000000, -1.442695, -1.442695, -1.442695)
exp r3.yzw, r3.yyzw
add r3.yzw, -r3.yyzw, l(0.000000, 1.000000, 1.000000, 1.000000)
lt r4.x, l(0.800000), r1.z
and r3.x, r3.x, r4.x
if_nz r3.x
  add r1.z, r1.z, l(-0.800000)
  mul r1.z, r1.z, l(5.000000)
  add r4.xyz, -r3.yzwy, l(1.000000, 1.000000, 1.000000, 0.000000)
  mad r3.yzw, r1.zzzz, r4.xxyz, r3.yyzw
endif 
add r1.z, cb0[281].w, l(-0.250000)
add r1.z, r1.z, r1.z
dp3 r3.x, r3.yzwy, l(0.333300, 0.333300, 0.333300, 0.000000)
add r4.xyz, -r3.yzwy, r3.xxxx
mad o2.xyz, r1.zzzz, r4.xyzx, r3.yzwy
ge r1.z, cb0[0].x, v2.z
if_nz r1.z
  add r2.xyzw, r0.xyzw, r2.xyzw
endif 
// replacing matrix usage :dp4 o0.x, r2.xyzw, cb0[282].xyzw
dp4 r6.x, r2.xyzw, cb0[282].xyzw
mul o0.x, r6.x, r8.x
// replacing matrix usage :dp4 o0.y, r2.xyzw, cb0[283].xyzw
dp4 r6.y, r2.xyzw, cb0[283].xyzw
mul o0.y, r6.y, r8.y
dp4 o0.z, r2.xyzw, cb0[284].xyzw
dp4 o0.w, r2.xyzw, cb0[285].xyzw
add r3.xyz, r2.xyzx, -cb0[290].xyzx
dp3 r1.z, r3.xyzx, r3.xyzx
sqrt r1.z, r1.z
mad r1.z, -r1.z, l(0.00333333341), l(1.000000)
max r1.xyz, r1.xxzx, l(0.000000, 0.100000, 0.000000, 0.000000)
add r2.w, -r1.z, l(1.000000)
mad r1.x, r1.x, r2.w, r1.z
mul r1.x, r1.y, r1.x
dp4 r0.x, r0.xyzw, r0.xyzw
sqrt r0.x, r0.x
mul r0.x, r0.x, l(0.707000)
lt r0.y, r1.w, r0.x
if_nz r0.y
  div r0.x, r1.w, r0.x
  mul r0.x, r0.x, r0.x
  mul r1.x, r0.x, r1.x
endif 
mad r0.x, -v2.z, l(0.950000), l(1.000000)
mul r0.w, r0.x, r1.x
mul r0.xyz, r0.wwww, cb0[291].xyzx
add r1.xyz, -r2.xyzx, cb0[290].xyzx
dp3 r1.x, r1.xyzx, r1.xyzx
sqrt r1.x, r1.x
add r1.y, r2.y, -cb0[257].y
mad_sat r1.y, -r1.y, cb0[257].x, l(1.000000)
mul r1.x, r1.x, l(0.005000)
min r1.x, r1.x, l(1.000000)
add r1.y, r1.y, l(-1.000000)
mad r1.x, r1.x, r1.y, l(1.000000)
mul o3.xyzw, r0.xyzw, r1.xxxx
mov o1.xy, v2.xyxx
ret 
// Approximately 188 instruction slots used
