//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.31 on Wed Mar 02 08:07:16 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
//   float4x4 ViewProjectionMatrix;     // Offset:  256 Size:    64 [unused]
//   float4x4 ViewRotProjectionMatrix;  // Offset:  320 Size:    64
//   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 [unused]
//   float4 FogSHG;                     // Offset:  592 Size:    16 [unused]
//   float4 FogSHR;                     // Offset:  608 Size:    16 [unused]
//   float4 HeightFogParams;            // Offset:  624 Size:    16 [unused]
//   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 [unused]
//
// }
//
// 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 CSplineShaderParameterProvider
// {
//
//   float4x4 WorldMatrix;              // Offset:    0 Size:    64
//   float4 BoundingSphere;             // Offset:   64 Size:    16 [unused]
//   float4 MeshDecompression;          // Offset:   80 Size:    16
//   float4 NormalizedXYBBox;           // Offset:   96 Size:    16 [unused]
//   float3 WorldPositionFractions;     // Offset:  112 Size:    12 [unused]
//
// }
//
// cbuffer CWaterReflectionParameterProvider
// {
//
//   float4x4 WaterReflectionTransform; // Offset:    0 Size:    64 [unused]
//   float4 WaterReflectionPlane;       // Offset:   64 Size:    16 [unused]
//   float4 WaterReflectionTexCoordRange;// Offset:   80 Size:    16 [unused]
//   float WaterLevelAdjustment;        // Offset:   96 Size:     4
//
// }
//
// cbuffer WaterRiver
// {
//
//   float4 Extinctions;                // Offset:    0 Size:    16 [unused]
//   float4 MaterialPickingID;          // Offset:   16 Size:    16 [unused]
//   float4 RefractionWaveInfo;         // Offset:   32 Size:    16 [unused]
//   float4 Specular;                   // Offset:   48 Size:    16 [unused]
//   float4 WaterColor;                 // Offset:   64 Size:    16 [unused]
//   float4 WaterColorModulation;       // Offset:   80 Size:    16 [unused]
//   float3 LayerBlendCff;              // Offset:   96 Size:    12
//   float CausticsIntensity;           // Offset:  108 Size:     4 [unused]
//   float3 LayerSpeed;                 // Offset:  112 Size:    12
//   float CausticsScale;               // Offset:  124 Size:     4 [unused]
//   float2 BaseTiling;                 // Offset:  128 Size:     8
//   float2 CenterDir;                  // Offset:  136 Size:     8
//   float2 CenterTiling1;              // Offset:  144 Size:     8
//   float2 DiffuseTiling;              // Offset:  152 Size:     8
//   float DiffuseSpeedFactor;          // Offset:  160 Size:     4
//   float NormalModifier;              // Offset:  164 Size:     4 [unused]
//   float NormalOffsetScale;           // Offset:  168 Size:     4 [unused]
//   float ReflectionColorOffset;       // Offset:  172 Size:     4 [unused]
//   float ReflectionColorScale;        // Offset:  176 Size:     4 [unused]
//   float ReflectionNormalOffsetScale; // Offset:  180 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CGlobalShaderParameterProvider    cbuffer      NA          NA    1        1
// CSplineShaderParameterProvider    cbuffer      NA          NA    2        1
// CWaterReflectionParameterProvider    cbuffer      NA          NA    3        1
// WaterRiver                        cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// position                 0   xyzw        0     NONE     int   xyz 
// texcoord                 0   xy          1     NONE     int   xy  
// normal                   0   xyzw        2     NONE   float       
// color                    0   xyzw        3     NONE   float      w
// fog                      0   xyzw        4     NONE   float       
// psize                    0   xyzw        5     NONE   float       
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyz         4     NONE   float   xyz 
// TEXCOORD                 4   xyz         5     NONE   float   xyz 
// TEXCOORD                 5   xyzw        6     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[43], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_constantbuffer cb2[6], immediateIndexed
dcl_constantbuffer cb3[7], immediateIndexed
dcl_constantbuffer cb4[11], immediateIndexed
dcl_input v0.xyz
dcl_input v1.xy
dcl_input v3.w
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyz
dcl_output o5.xyz
dcl_output o6.xyzw
dcl_temps 5

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

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

add r0.w, cb2[2].w, cb3[6].x
mov r0.xyz, cb2[2].xyzx
itof r1.xyz, v0.xyzx
mad r1.xyz, r1.xyzx, cb2[5].yyyy, cb2[5].xxxx
mov r1.w, l(1.000000)
dp4 r0.z, r1.xyzw, r0.xyzw
dp4 r0.x, r1.xyzw, cb2[0].xyzw
dp4 r0.y, r1.xyzw, cb2[1].xyzw
add r1.xyz, r0.xyzx, -cb0[42].xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb0[20].xyzw
dp4 r2.y, r1.xyzw, cb0[21].xyzw
dp4 r2.w, r1.xyzw, cb0[23].xyzw
dp4 o0.z, r1.xyzw, cb0[22].xyzw
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 c5c13e806a7c9b65-vs.txt
ne r4.w, r2.w, l(1.0)
if_nz r4.w
  add r4.w, r2.w, -r4.y
  mad r2.x, r4.w, r4.x, r2.x
endif

mul r1.xyzw, r2.xyww, cb0[34].xyzw
add o5.xy, r1.zwzz, r1.xyxx
itof r1.xy, v1.xyxx
mad r1.xy, r1.xyxx, cb2[5].wwww, cb2[5].zzzz
mad r2.xyz, cb4[7].xyzx, cb1[8].yyyy, r1.yyyy
mul r2.xyz, r2.xyzx, cb4[8].yyyy
mul r3.xyz, r2.xyzx, cb4[9].yyyy
mul r1.z, r1.x, cb4[8].x
mul r3.w, r1.z, cb4[9].x
mul o1.xyzw, r3.xyzw, l(-0.991000, -0.989000, -1.014000, -1.000000)
add r1.z, r1.x, l(-0.500000)
add r1.w, |r1.z|, |r1.z|
mad r1.z, -|r1.z|, l(2.000000), l(1.000000)
max r1.z, r1.z, l(0.001000)
log r1.z, r1.z
mul r2.xyz, r1.zzzz, cb4[6].xyzx
exp o3.xyz, r2.xyzx
mul r1.z, v3.w, l(5.000000)
mad o2.w, -r1.z, r1.w, r1.z
mov r0.w, l(1.000000)
dp4 o2.x, r0.xyzw, cb0[12].xyzw
dp4 o2.y, r0.xyzw, cb0[13].xyzw
dp4 o2.z, r0.xyzw, cb0[14].xyzw
mov o4.xyz, r0.xyzx
mul r0.x, r2.w, l(4.000000)
mov o5.z, r2.w
max r0.x, r0.x, l(1.000000)
div o3.w, l(60.000000), r0.x
mul r0.xy, cb4[8].zwzz, cb4[10].xxxx
mad r0.xy, -r0.xyxx, cb1[8].yyyy, r1.xyxx
mul r0.xy, r0.xyxx, cb4[8].xyxx
mul o6.zw, r0.xxxy, cb4[9].zzzw
mov o6.xy, l(0,0,0,0)
ret 
// Approximately 49 instruction slots used