//
// 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 specColor;                  // Offset:    0 Size:    16 [unused]
//   float4 ControlData;                // Offset:   16 Size:    16 [unused]
//   float4 difColor;                   // Offset:   32 Size:    16 [unused]
//   float4 ambient;                    // Offset:   48 Size:    16 [unused]
//   float4 lightCount;                 // Offset:   64 Size:    16 [unused]
//   float4 g_avLightPos;               // Offset:   80 Size:    16 [unused]
//   float4 g_avLightColor;             // Offset:   96 Size:    16 [unused]
//   float4 g_avConeDir;                // Offset:  112 Size:    16 [unused]
//   float4 g_vAmbientSettings;         // Offset:  128 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:  144
//       float4 vFogLayerPlane;         // Offset:  160
//       float4 vFogLayerColor;         // Offset:  176
//       float4 vFogLayerSettings;      // Offset:  192
//       float4 vFogColor;              // Offset:  208
//       float4 vFogDistance;           // Offset:  224
//
//   } g_FogDesc;                       // Offset:  144 Size:    96
//   float4 g_vDitherSettings;          // Offset:  240 Size:    16 [unused]
//   float4 g_vKSettings;               // Offset:  256 Size:    16 [unused]
//   float4x4 g_mPrevObjViewProj;       // Offset:  272 Size:    64 [unused]
//   float4 LightPos0;                  // Offset:  336 Size:    16
//   float4x4 g_mViewProj;              // Offset:  352 Size:    64
//   float4 Settings;                   // Offset:  416 Size:    16
//      = 0x3f000000 0x41200000 0x00000000 0x00000000 
//   float4 TexScale;                   // Offset:  432 Size:    16
//   float4 Gray;                       // Offset:  448 Size:    16
//   float4 GrayColor;                  // Offset:  464 Size:    16
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 
//
// }
//
//
// 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 
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// COLOR                    0   xyzw        1     NONE   float   xyzw
// COLOR                    1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy  
// TEXCOORD                 1     zw        3     NONE   float     zw
// TEXCOORD                 2   xy          4     NONE   float   xy  
// TEXCOORD                 3     zw        4     NONE   float     zw
// TEXCOORD                 4   xyz         5     NONE   float   xyz 
// TEXCOORD                 5   xyzw        6     NONE   float   xyzw
// TEXCOORD                 6   xyz         7     NONE   float   xyz 
//
vs_4_0
dcl_constantbuffer cb0[30], immediateIndexed
dcl_input v0.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xy
dcl_output o3.zw
dcl_output o4.xy
dcl_output o4.zw
dcl_output o5.xyz
dcl_output o6.xyzw
dcl_output o7.xyz
// 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.xyz, v0.xyzx, l(100.000000, 100.000000, 100.000000, 0.000000)
mul r1.xyz, v0.xyzx, l(100.000000, 100.000000, 100.000000, 0.000000)
mov r1.w, l(1.000000)
// replacing matrix usage :dp4 r2.x, r1.xyzw, cb0[22].xyzw
dp4 r6.x, r1.xyzw, cb0[22].xyzw
mul r2.x, r6.x, r8.x
// replacing matrix usage :dp4 r2.y, r1.xyzw, cb0[23].xyzw
dp4 r6.y, r1.xyzw, cb0[23].xyzw
mul r2.y, r6.y, r8.y
dp4 r2.z, r1.xyzw, cb0[24].xyzw
dp4 r2.w, r1.xyzw, cb0[25].xyzw
mul r1.xyz, r2.xwyx, l(0.500000, 0.500000, -0.500000, 0.000000)
add o6.xy, r1.yyyy, r1.xzxx
lt r0.w, cb0[21].y, l(0.000000)
if_nz r0.w
  add r0.w, cb0[21].y, cb0[21].y
  max r0.w, r0.w, l(-1.000000)
else 
  mov r0.w, cb0[21].y
endif 
add r1.x, -|r0.w|, l(1.000000)
sqrt r1.x, r1.x
mad r1.y, |r0.w|, l(-0.0187292993), l(0.074261)
mad r1.y, r1.y, |r0.w|, l(-0.212114394)
mad r1.y, r1.y, |r0.w|, l(1.57072878)
mul r1.z, r1.x, r1.y
mad r1.z, r1.z, l(-2.000000), l(3.14159274)
lt r0.w, r0.w, -r0.w
and r0.w, r0.w, r1.z
mad r0.w, r1.y, r1.x, r0.w
add r0.w, -r0.w, l(3.14159632)
mul_sat r1.x, r0.w, l(0.318310)
mad_sat r0.w, -v0.y, l(0.500000), l(0.500000)
log r0.w, r0.w
mul r0.w, r0.w, cb0[26].w
exp r1.yw, r0.wwww
mad r1.xyz, r1.xywx, cb0[27].zwwz, cb0[27].xyyx
dp3 r0.w, cb0[21].xyzx, v0.xyzx
max r1.w, r0.w, l(0.000000)
log r3.x, r1.w
mul r3.x, r3.x, cb0[26].y
exp r3.x, r3.x
mul r3.x, r3.x, cb0[26].x
mul o1.x, r1.x, r3.x
add r0.w, r0.w, l(1.000000)
mul o1.y, r0.w, l(0.500000)
mul r3.xyzw, cb0[28].xxxx, cb0[29].xyzw
mad r0.w, v0.y, l(0.500000), l(0.500000)
sqrt r0.w, r0.w
add r0.w, -r0.w, l(1.000000)
mad r0.w, -cb0[28].y, r0.w, l(1.000000)
mul o2.xyzw, r0.wwww, r3.xyzw
add o4.xyzw, r1.xzxz, l(0.000000, 0.500000, 0.500000, 0.500000)
lt r0.w, l(0.000000), cb0[10].w
if_nz r0.w
  mov o5.xyz, l(0,0,0,0)
else 
  mul r0.w, -cb0[10].w, cb0[12].z
  min r0.w, r0.w, l(1.000000)
  mul r3.xyz, v0.xyzx, l(100000.000000, 100000.000000, 100000.000000, 0.000000)
  dp3 r3.w, r3.xyzx, r3.xyzx
  sqrt r3.w, r3.w
  mul r3.w, r3.w, cb0[14].x
  min o5.x, r3.w, l(1.000000)
  mul r4.xyz, v0.xyzx, l(100000.000000, 100000.000000, 100000.000000, 0.000000)
  mov r4.w, l(1.000000)
  dp4 r3.w, r4.xyzw, cb0[10].xyzw
  ge r4.x, cb0[9].z, l(0.000000)
  if_nz r4.x
    lt r4.x, r3.w, -cb0[12].y
    if_nz r4.x
      mov r3.w, -cb0[12].y
    endif 
    ge r4.x, r3.w, l(0.000000)
    if_nz r4.x
      mov r4.xyz, l(0,0,-1,0)
    else 
      dp3 r4.w, -r3.xyzx, -r3.xyzx
      rsq r4.w, r4.w
      mul r5.xyz, -r3.xyzx, r4.wwww
      dp3 r4.w, cb0[10].xyzx, r5.xyzx
      lt r5.x, l(0.000100), |r4.w|
      if_nz r5.x
        div r4.w, l(1.000000, 1.000000, 1.000000, 1.000000), r4.w
        add r5.x, -r3.w, cb0[9].z
        mul r5.y, r4.w, cb0[9].z
        mad r4.y, r5.x, r4.w, -r5.y
      else 
        mov r4.y, l(0)
      endif 
      lt r4.z, r4.y, l(0.000100)
      if_nz r4.z
        mov r4.x, l(0)
      endif 
    endif 
    if_z r4.z
      mul r4.y, r4.y, cb0[12].x
      mul r4.y, r4.y, l(1.44254541)
      exp r4.y, r4.y
      div r4.y, l(1.000000, 1.000000, 1.000000, 1.000000), r4.y
      add r4.x, -r4.y, l(1.000000)
    endif 
  else 
    ge r3.w, r3.w, l(0.000000)
    if_nz r3.w
      dp3 r3.w, -r3.xyzx, -r3.xyzx
      rsq r3.w, r3.w
      mul r4.yzw, r3.wwww, -r3.xxyz
      dp3 r3.w, cb0[10].xyzx, r4.yzwy
      lt r4.y, l(0.000100), |r3.w|
      if_nz r4.y
        div r3.w, cb0[9].z, r3.w
      endif 
      lt r4.y, r3.w, l(0.000100)
      if_nz r4.y
        mov r4.x, l(0)
      endif 
    else 
      dp3 r3.x, -r3.xyzx, -r3.xyzx
      sqrt r3.w, r3.x
      mov r4.y, l(0)
    endif 
    if_z r4.y
      mul r3.x, r3.w, cb0[12].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 r4.x, r3.x, l(-1.000000)
      mov r4.x, -r4.x
    endif 
  endif 
  lt r3.x, r4.x, l(0.000000)
  if_nz r3.x
    mov r4.x, -r4.x
  endif 
  mul o5.z, r0.w, r4.x
  mov o5.y, cb0[14].w
endif 
mov o0.xyzw, r2.xyzw
mov o1.w, l(1.000000)
mov o1.z, r1.w
add o3.z, r1.x, l(0.500000)
mov o3.xyw, r1.xyxz
mov o6.zw, r2.zzzw
mov o7.xyz, r0.xyzx
ret 
// Approximately 142 instruction slots used
