//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.31 on Wed Mar 02 08:06:22 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 [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
//   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
//   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
//   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 CSceneTransformParameterProvider
// {
//
//   float4x4 WorldMatrix;              // Offset:    0 Size:    64
//   float3 WorldPositionFractions;     // Offset:   64 Size:    12 [unused]
//
// }
//
// cbuffer CSceneGeometry
// {
//
//   float4 GeometryPickingID;          // Offset:    0 Size:    16 [unused]
//   float4 MeshDecompression;          // Offset:   16 Size:    16
//   float4 NormalizedXYBBox;           // Offset:   32 Size:    16 [unused]
//
// }
//
// cbuffer InkAndPaint
// {
//
//   float4 BehindObjectColor;          // Offset:    0 Size:    16 [unused]
//   float4 InkAndPaintParams;          // Offset:   16 Size:    16
//   float4 InteriorColor;              // Offset:   32 Size:    16 [unused]
//   float4 MaterialPickingID;          // Offset:   48 Size:    16 [unused]
//   float4 OutlineColor;               // Offset:   64 Size:    16 [unused]
//   float2 OutlineShapePatternTiling;  // Offset:   80 Size:     8 [unused]
//   float2 OutlineVisualTiling;        // Offset:   88 Size:     8 [unused]
//   bool AlphaInRedChannel;            // Offset:   96 Size:     4 [unused]
//   float HuntingInvestigationLerpFactor;// Offset:  100 Size:     4 [unused]
//   float HuntingInvestigationWorldSpaceZOffset;// Offset:  104 Size:     4
//   float ShowThroughWallsAlpha;       // Offset:  108 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CSceneTransformParameterProvider    cbuffer      NA          NA    1        1
// CSceneGeometry                    cbuffer      NA          NA    2        1
// InkAndPaint                       cbuffer      NA          NA    3        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// position                 0   xyzw        0     NONE     int   xyz 
// texcoord                 0   xy          1     NONE     int       
// normal                   0   xyzw        2     NONE   float   xyz 
// color                    0   xyzw        3     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   x           3     NONE   float   x   
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[49], immediateIndexed
dcl_constantbuffer cb1[3], immediateIndexed
dcl_constantbuffer cb2[2], immediateIndexed
dcl_constantbuffer cb3[7], immediateIndexed
dcl_input v0.xyz
dcl_input v2.xyz
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.x
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

mov r0.x, cb1[0].w
mov r0.y, cb1[1].w
mov r0.z, cb1[2].w
add r1.xyz, r0.xyzx, -cb0[42].xyzx
add r1.xyz, r1.xyzx, -cb0[44].xyzx
itof r2.xyz, v0.xyzx
mad r2.xyz, r2.xyzx, cb2[1].yyyy, cb2[1].xxxx
dp3 r3.x, r2.xyzx, cb1[0].xyzx
dp3 r3.y, r2.xyzx, cb1[1].xyzx
dp3 r3.z, r2.xyzx, cb1[2].xyzx
add r1.xyz, r1.xyzx, r3.xyzx
add r0.xyz, r0.xyzx, r3.xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r1.xyzx
mad r1.xyz, r2.xyzx, -cb3[6].zzzz, r1.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 02e6f6056a438e26-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
mov o2.z, r2.w
add o2.xy, r1.zwzz, r1.xyxx
add r1.xyz, r0.xyzx, -cb0[42].xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
mad r0.xyz, r1.xyzx, -cb3[6].zzzz, r0.xyzx
add r0.xyz, r0.xyzx, -cb0[42].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
sqrt r0.w, r0.w
div r1.xyz, r0.xyzx, r0.wwww
dp3 r0.x, cb0[48].xyzx, r0.xyzx
mul o3.x, r0.x, cb0[31].w
mad r0.xyz, v2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r2.x, r0.xyzx, cb1[0].xyzx
dp3 r2.y, r0.xyzx, cb1[1].xyzx
dp3 r2.z, r0.xyzx, cb1[2].xyzx
dp3 r0.x, r2.xyzx, r2.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, r2.xyzx
dp3 o1.w, r0.xyzx, r1.xyzx
mov o1.xyz, l(0,0,0,0)
mul r0.x, cb3[1].y, l(0.500000)
div o2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
ret 
// Approximately 48 instruction slots used