//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.31 on Wed Mar 02 08:06:57 2016
//
//
// Buffer Definitions: 
//
// cbuffer CViewportShaderParameterProvider
// {
//
//   float4x4 InvProjectionMatrix;      // Offset:    0 Size:    64 [unused]
//   float4x4 InvViewMatrix;            // Offset:   64 Size:    64 [unused]
//   float4x4 ProjectionMatrix;         // Offset:  128 Size:    64 [unused]
//   float4x4 ViewMatrix;               // Offset:  192 Size:    64 [unused]
//   float4x4 ViewProjectionMatrix;     // Offset:  256 Size:    64
//   float4x4 ViewRotProjectionMatrix;  // Offset:  320 Size:    64 [unused]
//   float4x4 ViewRotProjectionMatrix_Previous;// Offset:  384 Size:    64 [unused]
//   float4 AmbientSHR;                 // Offset:  448 Size:    16 [unused]
//   float4 AmbientSHG;                 // Offset:  464 Size:    16 [unused]
//   float4 AmbientSHB;                 // Offset:  480 Size:    16 [unused]
//   float4 CameraDistances;            // Offset:  496 Size:    16 [unused]
//   float4 CameraNearPlaneSize;        // Offset:  512 Size:    16 [unused]
//   float4 DepthScale;                 // Offset:  528 Size:    16 [unused]
//   float4 DepthTextureScaleOffset;    // Offset:  544 Size:    16
//   float4 FogParams;                  // Offset:  560 Size:    16 [unused]
//   float4 FogSHB;                     // Offset:  576 Size:    16
//   float4 FogSHG;                     // Offset:  592 Size:    16
//   float4 FogSHR;                     // Offset:  608 Size:    16
//   float4 HeightFogParams;            // Offset:  624 Size:    16
//   float4 ViewportSize;               // Offset:  640 Size:    16 [unused]
//   float3 ViewPoint;                  // Offset:  656 Size:    12 [unused]
//   float3 CameraPosition;             // Offset:  672 Size:    12
//   float3 CameraPosition_Previous;    // Offset:  688 Size:    12 [unused]
//   float3 CameraPositionFractions;    // Offset:  704 Size:    12 [unused]
//   float3 CameraPositionFractions_Previous;// Offset:  720 Size:    12 [unused]
//   float3 CameraRight;                // Offset:  736 Size:    12 [unused]
//   float3 CameraUp;                   // Offset:  752 Size:    12 [unused]
//   float3 CameraDirection;            // Offset:  768 Size:    12 [unused]
//   float3 EnvironmentMapColorOffset;  // Offset:  784 Size:    12 [unused]
//   float3 EnvironmentMapColorScale;   // Offset:  800 Size:    12 [unused]
//   float3 AmbientOcclusionRanges;     // Offset:  816 Size:    12 [unused]
//   float3 DepthTextureRcpSize;        // Offset:  832 Size:    12 [unused]
//   float2 MotionVectorOffsets;        // Offset:  848 Size:     8 [unused]
//   float2 DepthRangeCompression;      // Offset:  856 Size:     8 [unused]
//   float ShadowProjDepthMinValue;     // Offset:  864 Size:     4 [unused]
//   float DistanceScale;               // Offset:  868 Size:     4 [unused]
//   float WorldSpaceZOffset;           // Offset:  872 Size:     4 [unused]
//   float WorldSpaceZOffset_Previous;  // Offset:  876 Size:     4 [unused]
//   float CameraFOVDeg;                // Offset:  880 Size:     4 [unused]
//   float EffectsEmissiveEVBias;       // Offset:  884 Size:     4 [unused]
//   float ShadowCSMLastSliceIndex;     // Offset:  888 Size:     4 [unused]
//   float UseNormalization;            // Offset:  892 Size:     4 [unused]
//   float FogUndergroundColorScale;    // Offset:  896 Size:     4
//
// }
//
// cbuffer CGlobalShaderParameterProvider
// {
//
//   float4 BurnColor;                  // Offset:    0 Size:    16 [unused]
//   float4 BurnParams;                 // Offset:   16 Size:    16 [unused]
//   float4 BurnParams2;                // Offset:   32 Size:    16 [unused]
//   float4 BurnParams3;                // Offset:   48 Size:    16 [unused]
//   float4 CascadedShadowScaleOffsetTile0;// Offset:   64 Size:    16 [unused]
//   float4 CascadedShadowScaleOffsetTile1;// Offset:   80 Size:    16 [unused]
//   float4 WindSimParamsX;             // Offset:   96 Size:    16 [unused]
//   float4 WindSimParamsY;             // Offset:  112 Size:    16 [unused]
//   float VistaNoiseIntensity;         // Offset:  128 Size:     4 [unused]
//   float Time;                        // Offset:  132 Size:     4
//   float WindFactor;                  // Offset:  136 Size:     4 [unused]
//   float FireGlowEV;                  // Offset:  140 Size:     4 [unused]
//   float BurnSpeedScale;              // Offset:  144 Size:     4 [unused]
//   float BurnlineMaskScale;           // Offset:  148 Size:     4 [unused]
//   float BurnlineMaskInfluence;       // Offset:  152 Size:     4 [unused]
//   float WorldSpaceProgressionMaskScale;// Offset:  156 Size:     4 [unused]
//   float WorldSpaceProgressionMaskInfluence;// Offset:  160 Size:     4 [unused]
//   float MaskTransitionSpeedModifier; // Offset:  164 Size:     4 [unused]
//   float GlowMaskScale;               // Offset:  168 Size:     4 [unused]
//   float FireGlowMaskInfluence;       // Offset:  172 Size:     4 [unused]
//   float CenterBurnlineWidth;         // Offset:  176 Size:     4 [unused]
//   float TransitionToBurnlineWidth;   // Offset:  180 Size:     4 [unused]
//   float DissolveCutoffPoint;         // Offset:  184 Size:     4 [unused]
//   float DissolveBlendDistance;       // Offset:  188 Size:     4 [unused]
//   float EyeGlossinessScale;          // Offset:  192 Size:     4 [unused]
//   float EyeSpecIntensityScale;       // Offset:  196 Size:     4 [unused]
//   float EyeIrisGlossinessScale;      // Offset:  200 Size:     4 [unused]
//   float EyeIrisSpecIntensityScale;   // Offset:  204 Size:     4 [unused]
//   float EyeReflectionBoostScale;     // Offset:  208 Size:     4 [unused]
//   bool EyeReflectionMaskEnable;      // Offset:  212 Size:     4 [unused]
//   float4 BurnParams4;                // Offset:  224 Size:    16 [unused]
//   float4 BurnParams5;                // Offset:  240 Size:    16 [unused]
//
// }
//
// cbuffer CSceneTerrainSkyOcclusionAtlasPrivateData
// {
//
//   float4 SectorOcclusion_OffsetScale;// Offset:    0 Size:    16
//   float3 SectorOcclusion_DistanceFade;// Offset:   16 Size:    12
//   float2 SectorOcclusion_HeightOffsetScale;// Offset:   32 Size:     8
//
// }
//
// cbuffer CAmbientProvider
// {
//
//   float4 CascadeDistanceScales[5];   // Offset:    0 Size:    80 [unused]
//   float4 CascadeNearFarSnappedOffsetCamera[5];// Offset:   80 Size:    80 [unused]
//   float4 CascadeNearFarRcpUVSize[5]; // Offset:  160 Size:    80 [unused]
//   float4 UndergroundSHR;             // Offset:  240 Size:    16
//   float4 UndergroundSHG;             // Offset:  256 Size:    16
//   float4 UndergroundSHB;             // Offset:  272 Size:    16
//   float InvUndergroundBlendEndHeight;// Offset:  288 Size:     4
//   float IndirectLightingScale;       // Offset:  292 Size:     4 [unused]
//
// }
//
// cbuffer ShangrilaOcean
// {
//
//   float4 FoamLayer1Params;           // Offset:    0 Size:    16 [unused]
//   float4 FoamLayer2Params;           // Offset:   16 Size:    16 [unused]
//   float4 FoamParams;                 // Offset:   32 Size:    16 [unused]
//   float4 FoamSettings;               // Offset:   48 Size:    16 [unused]
//   float4 MaterialPickingID;          // Offset:   64 Size:    16 [unused]
//   float4 NormalMapParams1;           // Offset:   80 Size:    16
//   float4 NormalMapParams2;           // Offset:   96 Size:    16
//   float4 NormalMapParams3;           // Offset:  112 Size:    16
//   float4 NormalMapParams4;           // Offset:  128 Size:    16
//   float4 NormalsMaskParams;          // Offset:  144 Size:    16
//   float4 Octave1Params;              // Offset:  160 Size:    16 [unused]
//   float4 Octave2Params;              // Offset:  176 Size:    16 [unused]
//   float4 Octave3Params;              // Offset:  192 Size:    16 [unused]
//   float4 Octave4Params;              // Offset:  208 Size:    16 [unused]
//   float4 Octave5Params;              // Offset:  224 Size:    16 [unused]
//   float4 Octave6Params;              // Offset:  240 Size:    16 [unused]
//   float4 Octave7Params;              // Offset:  256 Size:    16 [unused]
//   float4 Octave8Params;              // Offset:  272 Size:    16 [unused]
//   float4 WavesCrestWeights;          // Offset:  288 Size:    16 [unused]
//   float3 ConstantReflectanceFactor;  // Offset:  304 Size:    12 [unused]
//   float DampingFadeOut;              // Offset:  316 Size:     4 [unused]
//   float3 DisplacementParams;         // Offset:  320 Size:    12 [unused]
//   float DepthDistanceCff;            // Offset:  332 Size:     4 [unused]
//   float3 NormalIncidenceReflectance; // Offset:  336 Size:    12 [unused]
//   float HighNormalsScale;            // Offset:  348 Size:     4 [unused]
//   float3 OceanColorDeep;             // Offset:  352 Size:    12 [unused]
//   float NormalsScale;                // Offset:  364 Size:     4 [unused]
//   float3 OceanColorShallow;          // Offset:  368 Size:    12 [unused]
//   float RimLightIntensity;           // Offset:  380 Size:     4 [unused]
//   float2 CausticsDepthFade;          // Offset:  384 Size:     8 [unused]
//   float2 CausticsParams;             // Offset:  392 Size:     8 [unused]
//   float2 CausticsRcpDepthFade;       // Offset:  400 Size:     8 [unused]
//   float2 Octave1Dir;                 // Offset:  408 Size:     8 [unused]
//   float2 Octave2Dir;                 // Offset:  416 Size:     8 [unused]
//   float2 Octave3Dir;                 // Offset:  424 Size:     8 [unused]
//   float2 Octave4Dir;                 // Offset:  432 Size:     8 [unused]
//   float2 Octave5Dir;                 // Offset:  440 Size:     8 [unused]
//   float2 Octave6Dir;                 // Offset:  448 Size:     8 [unused]
//   float2 Octave7Dir;                 // Offset:  456 Size:     8 [unused]
//   float2 Octave8Dir;                 // Offset:  464 Size:     8 [unused]
//   float2 Smoothness;                 // Offset:  472 Size:     8 [unused]
//   float2 WavesFade;                  // Offset:  480 Size:     8 [unused]
//   float2 WavesHiResFade;             // Offset:  488 Size:     8 [unused]
//   float RimLightWidth;               // Offset:  496 Size:     4 [unused]
//   float ShallowWaterDepth;           // Offset:  500 Size:     4 [unused]
//   float TexGeoWavesBlendCff;         // Offset:  504 Size:     4
//
// }
//
// cbuffer COceanDampingProvider
// {
//
//   float4 HideOceanDampingTexelOffset;// Offset:    0 Size:    16 [unused]
//   float4 WorldScaleAndOffset;        // Offset:   16 Size:    16
//
// }
//
// cbuffer COceanParameterProvider
// {
//
//   float4 WavesAmpHDir_ampVDirOverWL[8];// Offset:    0 Size:   128 [unused]
//   float4 WavesDir_oneOverWL_ampHWL[8];// Offset:  128 Size:   128 [unused]
//   float4 WavesParameters[8];         // Offset:  256 Size:   128 [unused]
//   float4 CornerPointsWS[4];          // Offset:  384 Size:    64
//   float WavesCrestWeightsNorm[4];    // Offset:  448 Size:    52 [unused]
//   float4 OceanParameters;            // Offset:  512 Size:    16
//   float4 SkyParameters;              // Offset:  528 Size:    16 [unused]
//   float4 VertexAdjustments;          // Offset:  544 Size:    16 [unused]
//   float2 GridSize;                   // Offset:  560 Size:     8 [unused]
//   float OneOverWavesFade;            // Offset:  568 Size:     4 [unused]
//   float OneOverWavesHiResFade;       // Offset:  572 Size:     4 [unused]
//   float WaterLevel;                  // Offset:  576 Size:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SectorHemiMapSamplerStateLinear    sampler      NA          NA    0        1
// DampingTexture__SampObj__         sampler      NA          NA    1        1
// SectorOcclusion_HeightTexture__TexObj__    texture  float4          2d    0        1
// DampingTexture__TexObj__          texture  float4          2d    1        1
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CGlobalShaderParameterProvider    cbuffer      NA          NA    1        1
// CSceneTerrainSkyOcclusionAtlasPrivateData    cbuffer      NA          NA    2        1
// CAmbientProvider                  cbuffer      NA          NA    3        1
// ShangrilaOcean                    cbuffer      NA          NA    4        1
// COceanDampingProvider             cbuffer      NA          NA    5        1
// COceanParameterProvider           cbuffer      NA          NA    6        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// position                 0   xyzw        0     NONE   float   xy  
//
//
// 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   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xyz         3     NONE   float   xyz 
// TEXCOORD                 3   xyz         4     NONE   float   xyz 
// TEXCOORD                 4   xyz         5     NONE   float   xyz 
// TEXCOORD                 5   xyz         6     NONE   float   xyz 
// TEXCOORD                 6   xyz         7     NONE   float   xyz 
// TEXCOORD                 7   xyzw        8     NONE   float   xyzw
// TEXCOORD                 8   xyzw        9     NONE   float   xyzw
// TEXCOORD                 9   xyzw       10     NONE   float   xyzw
// TEXCOORD                10   xy         11     NONE   float   xy  
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[57], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_constantbuffer cb3[19], immediateIndexed
dcl_constantbuffer cb4[32], immediateIndexed
dcl_constantbuffer cb5[2], immediateIndexed
dcl_constantbuffer cb6[37], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input v0.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xyz
dcl_output o3.xyz
dcl_output o4.xyz
dcl_output o5.xyz
dcl_output o6.xyz
dcl_output o7.xyz
dcl_output o8.xyzw
dcl_output o9.xyzw
dcl_output o10.xyzw
dcl_output o11.xy
dcl_temps 7

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125

ld_indexable(texture2d)(float,float,float,float) r6.xyzw, l(0, 0, 0, 0), t125.xyzw

log r0.x, |v0.y|
mul r0.x, r0.x, cb6[32].x
exp r0.x, r0.x
add r0.y, -r0.x, l(1.000000)
add r0.z, -v0.x, l(1.000000)
mul r1.xyz, r0.zzzz, cb6[24].xywx
mad r1.xyz, v0.xxxx, cb6[25].xywx, r1.xyzx
mul r2.xyz, r0.zzzz, cb6[26].xywx
mad r2.xyz, v0.xxxx, cb6[27].xywx, r2.xyzx
mul r0.xzw, r0.xxxx, r2.xxyz
mad r0.xyz, r0.yyyy, r1.xyzx, r0.xzwx
div r0.xy, r0.xyxx, r0.zzzz
add r1.xy, r0.xyxx, cb5[1].zwzz
mul r1.xy, r1.xyxx, cb5[1].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t1.yxzw, s1, l(0.000000)
mul r1.y, cb1[8].y, cb4[5].y
mul r1.yz, r1.yyyy, cb4[5].zzwz
mad o8.xy, r0.xyxx, cb4[5].xxxx, r1.yzyy
mul r1.y, cb1[8].y, cb4[6].y
mul r1.yz, r1.yyyy, cb4[6].zzwz
mad o8.zw, r0.xxxy, cb4[6].xxxx, r1.yyyz
mul r1.y, cb1[8].y, cb4[7].y
mul r1.yz, r1.yyyy, cb4[7].zzwz
mad o9.xy, r0.xyxx, cb4[7].xxxx, r1.yzyy
mul r1.y, cb1[8].y, cb4[8].y
mul r1.yz, r1.yyyy, cb4[8].zzwz
mad o9.zw, r0.xxxy, cb4[8].xxxx, r1.yyyz
mul r1.y, cb1[8].y, cb4[9].y
mul r1.yz, r1.yyyy, cb4[9].zzwz
mad o10.xy, r0.xyxx, cb4[9].xxxx, r1.yzyy
div o2.z, l(1.000000, 1.000000, 1.000000, 1.000000), cb4[31].z
mov r0.z, cb6[36].x
add o3.xyz, -r0.xyzx, cb0[42].xyzx
mov r0.w, l(1.000000)
dp4 r2.x, r0.xyzw, cb0[16].xyzw
dp4 r2.y, r0.xyzw, cb0[17].xyzw
dp4 o0.z, r0.xyzw, cb0[18].xyzw
dp4 r2.w, r0.xyzw, cb0[19].xyzw

// Relocated to here with asmtool.py
mov o0.xyw, r2.xyxw

// Automatic vertex shader halo fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -i --auto-fix-vertex-halo --only-autofixed 83c9a60688724db8-vs.txt
ne r6.w, r2.w, l(1.0)
if_nz r6.w
  add r6.w, r2.w, -r6.y
  mad r2.x, r6.w, r6.x, r2.x
endif

mul r3.xyzw, r2.xyww, cb0[34].xyzw
add o4.xy, r3.zwzz, r3.xyxx
lt r1.yz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[39].zzwz
and r0.w, r1.z, r1.y
if_nz r0.w
  mov o1.xyz, l(0,0,0,0)
else 
  add r1.yzw, r0.yyzx, -cb0[42].yyzx
  dp3 r0.w, r1.yzwy, r1.yzwy
  rsq r0.w, r0.w
  mul r3.yzw, r0.wwww, r1.yyzw
  mov r3.x, l(1.000000)
  dp4 r4.x, cb0[38].xyzw, r3.xyzw
  dp4 r4.y, cb0[37].xyzw, r3.xyzw
  dp4 r4.z, cb0[36].xyzw, r3.xyzw
  max r4.xyz, r4.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  mad r5.xy, r0.yxyy, cb2[0].yxyy, cb2[0].wzww
  sample_l_indexable(texture2d)(float,float,float,float) r0.w, r5.xyxx, t0.xzwy, s0, l(0.000000)
  mad r0.w, r0.w, cb2[2].x, cb2[2].y
  add r0.w, -r0.w, cb6[36].x
  mul_sat r0.w, -r0.w, cb3[18].x
  sqrt r0.w, r0.w
  dp2 r1.y, r1.ywyy, r1.ywyy
  mad r1.y, cb2[1].x, r1.y, cb2[1].y
  mul_sat r1.y, r1.y, l(3.000000)
  mul r0.w, r0.w, r1.y
  dp4 r5.x, cb3[15].xyzw, r3.xyzw
  dp4 r5.y, cb3[16].xyzw, r3.xyzw
  dp4 r5.z, cb3[17].xyzw, r3.xyzw
  max r1.yzw, r5.xxyz, l(0.000000, 0.000000, 0.000000, 0.000000)
  mad r1.yzw, r1.yyzw, cb0[56].xxxx, -r4.xxyz
  mad o1.xyz, r0.wwww, r1.yzwy, r4.xyzx
endif 
add r1.yz, -r2.xxyx, r2.wwww
mul r3.yz, r1.yyzy, l(0.000000, 0.500000, 0.500000, 0.000000)
add r0.w, r2.x, r2.w
mul r3.x, r0.w, l(0.500000)

// mov o0.xyw, r2.xyxw // Relocated from here with asmtool.py

mov o10.zw, l(0,0,0,0)
mov o2.xy, l(0,0,0,0)
mov r3.w, r2.w
mov o4.z, r3.w
mov o5.xyz, r3.yzwy
mov o6.xyz, r3.xzwx
mov o7.xyz, r0.xyzx
mov o11.x, r1.x
mov o11.y, l(1.000000)
ret 
// Approximately 86 instruction slots used