//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.67 on Mon Jan 01 13:12:15 2018
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float4x4 g_mCloudsShadowsSpace;    // Offset:    0 Size:    64 [unused]
//   float4 g_vCloudsShadowDesc;        // Offset:   64 Size:    16 [unused]
//   float4 g_vKSettings;               // Offset:   80 Size:    16 [unused]
//   float4x4 g_mPrevObjViewProj;       // Offset:   96 Size:    64 [unused]
//   
//   struct
//   {
//       
//       float4x4 mLightSpaceInverse;   // Offset:  160
//       float4x4 mLightSpace;          // Offset:  224
//       float4 vShadowBias;            // Offset:  288
//       float4 vBiasDir;               // Offset:  304
//       float4 vSmoothOffs;            // Offset:  320
//       float4 vShadowsDesc;           // Offset:  336
//       float4 avCPlane[8];            // Offset:  352
//       float4 avCascadeZ[2];          // Offset:  480
//       float4 avUVTransform[8];       // Offset:  512
//       float4 avZTransformZF[8];      // Offset:  640
//
//   } g_ShadSettings;                  // Offset:  160 Size:   608 [unused]
//   float4 specColor;                  // Offset:  768 Size:    16 [unused]
//   float4 ControlData;                // Offset:  784 Size:    16 [unused]
//   float4 difColor;                   // Offset:  800 Size:    16 [unused]
//   float4 ambient;                    // Offset:  816 Size:    16 [unused]
//   float4 g_vDefLightDir;             // Offset:  832 Size:    16 [unused]
//   float4 g_vDefLightColor;           // Offset:  848 Size:    16 [unused]
//   float4 g_vDefSpecColor;            // Offset:  864 Size:    16 [unused]
//   uint CS_FRONT;                     // Offset:  880 Size:     4 [unused]
//      = 0x00000000 
//   uint CS_RIGHT;                     // Offset:  884 Size:     4 [unused]
//      = 0x00000001 
//   uint CS_BACK;                      // Offset:  888 Size:     4 [unused]
//      = 0x00000002 
//   uint CS_LEFT;                      // Offset:  892 Size:     4 [unused]
//      = 0x00000003 
//   uint CS_TOP;                       // Offset:  896 Size:     4 [unused]
//      = 0x00000004 
//   uint CS_BOTTOM;                    // Offset:  900 Size:     4 [unused]
//      = 0x00000005 
//   float4 g_vAmbientSettings;         // Offset:  912 Size:    16 [unused]
//   float4 g_vScreenDepthRect;         // Offset:  928 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset:  944
//       float4 vFogLayerPlane;         // Offset:  960
//       float4 vFogLayerColor;         // Offset:  976
//       float4 vFogLayerSettings;      // Offset:  992
//       float4 vFogColor;              // Offset: 1008
//       float4 vFogDistance;           // Offset: 1024
//
//   } g_FogDesc;                       // Offset:  944 Size:    96 [unused]
//   float4 g_vForestPlaneThreshold;    // Offset: 1040 Size:    16 [unused]
//      = 0x44a28000 0x3b03126f 0x00000000 0x00000000 
//   float4 LowDeepColor;               // Offset: 1056 Size:    16 [unused]
//      = 0x3e99999a 0x3ecccccd 0x3ecccccd 0x00000000 
//   float4 SeaColor;                   // Offset: 1072 Size:    16 [unused]
//      = 0x3dcccccd 0x3e99999a 0x3e99999a 0x00000000 
//   float4 DetailScale;                // Offset: 1088 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 
//   float4 g_vIceScale;                // Offset: 1104 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 
//   float4 g_vSpecSettings;            // Offset: 1120 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 
//   float4 g_vSeaCorrection;           // Offset: 1136 Size:    16 [unused]
//   float4 g_vSeaDesc;                 // Offset: 1152 Size:    16 [unused]
//      = 0x3ecccccd 0x3f19999a 0x40800000 0x3f7ae148 
//   float4 g_vSeaHarmonics;            // Offset: 1168 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 
//   float4 g_vWaterDesc;               // Offset: 1184 Size:    16 [unused]
//      = 0x3ecccccd 0x3f19999a 0x40800000 0x3f7ae148 
//   float4 g_vWaterColor;              // Offset: 1200 Size:    16 [unused]
//      = 0x3f800000 0x00000000 0x00000000 0x00000000 
//   float4 g_vWaterSpecColor;          // Offset: 1216 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x42a00000 
//   float4 Anim;                       // Offset: 1232 Size:    16 [unused]
//   float4 g_vAsyncTextureSize;        // Offset: 1248 Size:    16
//      = 0x3f800000 0x3f800000 0x00000000 0x00000000 
//   float4 g_vRTTexSize;               // Offset: 1264 Size:    16 [unused]
//   float4 g_vAnisotropy;              // Offset: 1280 Size:    16 [unused]
//   float2 TexelOffs[9];               // Offset: 1296 Size:   136 [unused]
//      = 0x00000000 0x00000000 0x00000000 0x00000000 
//        0xba800000 0x00000000 0x00000000 0x00000000 
//        0x3a800000 0x00000000 0x00000000 0x00000000 
//        0x00000000 0xba800000 0x00000000 0x00000000 
//        0x00000000 0x3a800000 0x00000000 0x00000000 
//        0xbb000000 0xbb000000 0x00000000 0x00000000 
//        0x3b000000 0xbb000000 0x00000000 0x00000000 
//        0x3b000000 0x3b000000 0x00000000 0x00000000 
//        0xbb000000 0x3b000000 
//   float4 g_avGroundColor[9];         // Offset: 1440 Size:   144 [unused]
//   float4x4 g_mWorldViewProjection;   // Offset: 1584 Size:    64
//   float4x4 g_mView;                  // Offset: 1648 Size:    64 [unused]
//   float4x4 g_mWorldView;             // Offset: 1712 Size:    64 [unused]
//   float3 chunkColor;                 // Offset: 1776 Size:    12 [unused]
//   float3 g_deltaCam;                 // Offset: 1792 Size:    12
//   float4 mapSize;                    // Offset: 1808 Size:    16 [unused]
//   float4 skirtInfo;                  // Offset: 1824 Size:    16
//   float4x4 g_textureRotation;        // Offset: 1840 Size:    64 [unused]
//   float3 textureCoordsP1;            // Offset: 1904 Size:    12
//   float3 textureCoordsP2;            // Offset: 1920 Size:    12
//   float3 chunkInSectorCoords;        // Offset: 1936 Size:    12
//   float4 chunkInfo;                  // Offset: 1952 Size:    16
//   float4 g_vSettings;                // Offset: 1968 Size:    16 [unused]
//   float4 g_vPlaneSettings;           // Offset: 1984 Size:    16 [unused]
//   float4 g_vPlaneOffset;             // Offset: 2000 Size:    16 [unused]
//   float3 GrayK;                      // Offset: 2016 Size:    12 [unused]
//      = 0x3eaa7efa 0x3eaa7efa 0x3eaa7efa 
//   float4 g_vForestFarSettings;       // Offset: 2032 Size:    16 [unused]
//   float4 g_vWindDir;                 // Offset: 2048 Size:    16 [unused]
//      = 0x3f800000 0x00000000 0x00000000 0x00000000 
//   float4 DetailOffset;               // Offset: 2064 Size:    16 [unused]
//   float4 DetailSectorOffset;         // Offset: 2080 Size:    16 [unused]
//   float4 DetailSettings;             // Offset: 2096 Size:    16 [unused]
//   float4 ParalaxSettings;            // Offset: 2112 Size:    16 [unused]
//      = 0x3e19999a 0x3f800000 0x43480000 0x00000000 
//   float4 DetailH[64];                // Offset: 2128 Size:  1024 [unused]
//   float4 DetailRTCoords;             // Offset: 3152 Size:    16 [unused]
//   float4 g_vPRTSettings;             // Offset: 3168 Size:    16 [unused]
//      = 0x00000000 0x00000000 0x42480000 0x3a000000 
//   float4 g_avMask[4];                // Offset: 3184 Size:    64 [unused]
//      = 0x3f800000 0x00000000 0x00000000 0x00000000 
//        0x00000000 0x3f800000 0x00000000 0x00000000 
//        0x00000000 0x00000000 0x3f800000 0x00000000 
//        0x00000000 0x00000000 0x00000000 0x3f800000 
//   float4 g_avPRTMask[4];             // Offset: 3248 Size:    64 [unused]
//      = 0x3f800000 0x00000000 0x00000000 0x00000000 
//        0x00000000 0x3f800000 0x00000000 0x00000000 
//        0x00000000 0x00000000 0x3f800000 0x00000000 
//        0x00000000 0x00000000 0x00000000 0x3f800000 
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR                    0   xy          0     NONE   float   xy  
// SV_VertexID              0   x           1   VERTID    uint   x   
// SV_InstanceID            0   x           2   INSTID    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyz         1     NONE   float   xyz 
// TEXCOORD                 1   xy          2     NONE   float   xy  
// TEXCOORD                 2     zw        2     NONE   float     zw
//
vs_4_0
dcl_constantbuffer cb0[123], immediateIndexed
dcl_input v0.xy
dcl_input_sgv v1.x, vertex_id
dcl_input_sgv v2.x, instance_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xy
dcl_output o2.zw
// dcl_temps updated : previous = dcl_temps 3
dcl_temps 6
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r4.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r5.x, r4.w
mov r5.y, r4.w
mov r5.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
mad r0.xy, v0.yxyy, l(255.000000, 255.000000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
ftou r0.xy, r0.xyxx
ishl r0.x, r0.x, l(8)
iadd r0.x, r0.x, r0.y
ige r0.y, r0.x, l(0x00008000)
if_nz r0.y
  iadd r0.x, r0.x, l(0xffff0000)
endif 
itof r0.x, r0.x
ftoi r0.y, cb0[114].x
ige r0.z, v1.x, r0.y
if_nz r0.z
  iadd r1.xyz, r0.yyyy, l(16, 32, 48, 0)
  ilt r0.zw, v1.xxxx, r1.xxxy
  if_nz r0.z
    iadd r0.z, v1.x, -r0.y
    itof r0.z, r0.z
    mul r0.z, r0.z, cb0[114].y
    mad r2.y, r0.z, l(50.000000), cb0[114].w
    mov r2.x, cb0[114].z
  else 
    mov r2.xy, l(0,0,0,0)
  endif 
  ige r0.z, v1.x, r1.x
  and r0.z, r0.w, r0.z
  if_nz r0.z
    iadd r0.z, v1.x, l(-16)
    iadd r0.w, r0.z, -r0.y
    itof r0.w, r0.w
    mul r0.w, r0.w, cb0[114].y
    mad r2.x, r0.w, l(50.000000), cb0[114].z
    mov r2.y, cb0[114].w
  else 
    mov r0.z, v1.x
  endif 
  ige r0.w, r0.z, r1.z
  if_nz r0.w
    iadd r0.z, r0.z, l(-48)
    iadd r0.w, r0.z, -r0.y
    itof r0.w, r0.w
    mul r0.w, r0.w, cb0[114].y
    mad r2.y, r0.w, l(50.000000), cb0[114].w
    mad r0.w, cb0[114].y, l(800.000000), cb0[114].z
    add r2.x, r0.w, -cb0[114].y
  endif 
  ige r0.w, r0.z, r1.y
  ilt r1.x, r0.z, r1.z
  and r0.w, r0.w, r1.x
  if_nz r0.w
    iadd r0.z, r0.z, l(-32)
    iadd r0.y, r0.z, -r0.y
    itof r0.y, r0.y
    mul r0.y, r0.y, cb0[114].y
    mad r2.x, r0.y, l(50.000000), cb0[114].z
    mad r0.y, cb0[114].y, l(800.000000), cb0[114].w
    add r2.y, r0.y, -cb0[114].y
  endif 
else 
  xor r0.y, v1.x, l(257)
  imax r0.z, v1.x, -v1.x
  udiv r0.z, null, r0.z, l(257)
  ineg r0.w, r0.z
  and r0.y, r0.y, l(0x80000000)
  movc r0.y, r0.y, r0.w, r0.z
  itof r1.y, r0.y
  imad r0.y, r0.y, l(-257), v1.x
  itof r1.x, r0.y
  mul r2.xy, r1.xyxx, l(50.000000, 50.000000, 0.000000, 0.000000)
endif 
mul r2.z, r0.x, cb0[122].z
add r0.xyz, r2.xzyx, cb0[112].xyzx
utof r1.x, v2.x
mul r1.x, r1.x, cb0[122].w
mul r1.x, r1.x, l(0.500000)
max r1.x, r1.x, l(0.100000)
add r0.y, r0.y, r1.x
mov r0.w, l(1.000000)
// replacing matrix usage :dp4 o0.x, r0.xyzw, cb0[99].xyzw
dp4 r3.x, r0.xyzw, cb0[99].xyzw
mul o0.x, r3.x, r5.x
// replacing matrix usage :dp4 o0.y, r0.xyzw, cb0[100].xyzw
dp4 r3.y, r0.xyzw, cb0[100].xyzw
mul o0.y, r3.y, r5.y
dp4 o0.z, r0.xyzw, cb0[101].xyzw
dp4 o0.w, r0.xyzw, cb0[102].xyzw
add r1.xy, r2.xyxx, -cb0[121].xyxx
div r1.xy, r1.xyxx, cb0[122].xyxx
add r1.zw, -cb0[119].xxxy, cb0[120].xxxy
mad o2.xy, r1.xyxx, r1.zwzz, cb0[119].xyxx
mul r0.w, r2.y, cb0[78].x
mad r1.x, -r2.x, l(0.0000781249983), l(1.000000)
mul r1.z, r0.w, l(0.0000781249983)
mul r1.w, r1.x, cb0[78].y
add o2.zw, r1.zzzw, cb0[78].zzzw
mov o1.xyz, r0.xyzx
ret 
// Approximately 92 instruction slots used
