// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.181 on Thu Jan  4 23:59:24 2024
//
//
// Buffer Definitions:
//
// cbuffer CommonBlock
// {
//
//   row_major float4x4 cTrapezoidalShadowTransformScreen;// Index:    0 1 2 3          Components:    16 [unused]
//   float cAlphaRef;                   // Index:    4.x              Components:     1 [unused]
//   float4 cConstantColor;             // Index:    5.xyzw           Components:     4
//   float4 cFogParams;                 // Index:    6.xyzw           Components:     4
//   float3 cFogColor;                  // Index:    7.xyz            Components:     3 [unused]
//   float3 cView;                      // Index:    8.xyz            Components:     3 [unused]
//   float3 cLightDirection;            // Index:    9.xyz            Components:     3 [unused]
//   float3 cAmbientLightColor;         // Index:   10.xyz            Components:     3 [unused]
//   float3 cLightColor;                // Index:   11.xyz            Components:     3 [unused]
//   float2 cShadowBias;                // Index:   12.xy             Components:     2 [unused]
//   float2 cShadowDetailDistanceRamp;  // Index:   13.xy             Components:     2 [unused]
//   row_major float4x4 cTrapezoidalShadowTransformTexture;// Index:   14 15 16 17       Components:    16 [unused]
//   row_major float4x4 cTrapezoidalShadowTransformTexture2;// Index:   18 19 20 21       Components:    16 [unused]
//   float cSelfIllumScale;             // Index:   22.x              Components:     1 [unused]
//   float2 cShadowMapSize;             // Index:   23.xy             Components:     2 [unused]
//   float4 cClipPlane0;                // Index:   24.xyzw           Components:     4 [unused]
//
// }
//
// cbuffer UIBlock
// {
//
//   float4 cScreenCenter;              // Index:    0.xyzw           Components:     4 [unused]
//   float4 cClipping;                  // Index:    1.xyzw           Components:     4 [unused]
//   row_major float2x4 cTextureTransform;// Index:    2 3              Components:     8
//
// }
//
// cbuffer MiscBlock
// {
//
//   row_major float2x4 cTextureTransform2;// Index:    0 1              Components:     8 [unused]
//   row_major float2x4 cTextureTransform3;// Index:    2 3              Components:     8 [unused]
//   float3 cLightDirectionInertial;    // Index:    4.xyz            Components:     3 [unused]
//   float3 cLight1Direction;           // Index:    5.xyz            Components:     3
//   float3 cLight1DirectionInertial;   // Index:    6.xyz            Components:     3 [unused]
//   float3 cLight2Direction;           // Index:    7.xyz            Components:     3
//   float3 cLight2DirectionInertial;   // Index:    8.xyz            Components:     3 [unused]
//   float3 cLight3Direction;           // Index:    9.xyz            Components:     3
//   float3 cLight3DirectionInertial;   // Index:   10.xyz            Components:     3 [unused]
//   float4 cWater;                     // Index:   11.xyzw           Components:     4 [unused]
//   float3 cAmbientLightColorTimesConstantColor;// Index:   12.xyz            Components:     3
//   float3 cLightColorTimesConstantColor;// Index:   13.xyz            Components:     3 [unused]
//   float3 cOmniLightColor;            // Index:   14.xyz            Components:     3 [unused]
//   float3 cOmniLightColorTimesConstantColor;// Index:   15.xyz            Components:     3 [unused]
//   float3 cLight1Color;               // Index:   16.xyz            Components:     3 [unused]
//   float3 cLight1ColorTimesConstantColor;// Index:   17.xyz            Components:     3
//   float3 cLight2Color;               // Index:   18.xyz            Components:     3 [unused]
//   float3 cLight2ColorTimesConstantColor;// Index:   19.xyz            Components:     3
//   float3 cLight3Color;               // Index:   20.xyz            Components:     3 [unused]
//   float3 cLight3ColorTimesConstantColor;// Index:   21.xyz            Components:     3
//   row_major float3x4 cObjectToLight; // Index:   22 23 24          Components:    12 [unused]
//   row_major float2x4 cObjectToVolume;// Index:   25 26             Components:     8 [unused]
//   float cSpecularExponent;           // Index:   27.x              Components:     1 [unused]
//   float2 cClipPlanes;                // Index:   28.xy             Components:     2 [unused]
//   float2 cPixelSize;                 // Index:   29.xy             Components:     2 [unused]
//   float2 cColorScale;                // Index:   30.xy             Components:     2 [unused]
//   float4 cDOFPlanes;                 // Index:   31.xyzw           Components:     4 [unused]
//   float4 cDOFPeripheral;             // Index:   32.xyzw           Components:     4 [unused]
//   float3 cDecalTransformDir;         // Index:   33.xyz            Components:     3 [unused]
//   float cBloomIntensity;             // Index:   34.x              Components:     1 [unused]
//   float3 cContrastAndExposure;       // Index:   35.xyz            Components:     3 [unused]
//   float cBrightPassThreshold;        // Index:   36.x              Components:     1 [unused]
//   float4 cMaterialVariable0;         // Index:   37.xyzw           Components:     4 [unused]
//   float4 cMaterialVariable1;         // Index:   38.xyzw           Components:     4 [unused]
//   float4 cMaterialVariable2;         // Index:   39.xyzw           Components:     4 [unused]
//   float4 cMaterialVariable3;         // Index:   40.xyzw           Components:     4 [unused]
//   float4 cMaterialVariable4;         // Index:   41.xyzw           Components:     4 [unused]
//   float4 cMaterialVariable5;         // Index:   42.xyzw           Components:     4 [unused]
//   float4 cMaterialVariable6;         // Index:   43.xyzw           Components:     4 [unused]
//   float4 cMaterialVariable7;         // Index:   44.xyzw           Components:     4 [unused]
//   float4 cMemExportOffset;           // Index:   45.xyzw           Components:     4 [unused]
//   float4 cTextureSize;               // Index:   46.xyzw           Components:     4 [unused]
//   float4 cMetaBallConstants;         // Index:   47.xyzw           Components:     4 [unused]
//   float4 cMetaBallConstantsA;        // Index:   48.xyzw           Components:     4 [unused]
//   float4 cMetaBallConstantsB;        // Index:   49.xyzw           Components:     4 [unused]
//   float4 cMetaBallConstantsC;        // Index:   50.xyzw           Components:     4 [unused]
//   row_major float3x4 cDecalTransform;// Index:   51 52 53          Components:    12 [unused]
//   float4 cRadialBlurCenterStartWidth;// Index:   54.xyzw           Components:     4 [unused]
//   row_major float4x4 cProjectionInverse;// Index:   55 56 57 58       Components:    16 [unused]
//   float4 cDebugVSVariables;          // Index:   59.xyzw           Components:     4 [unused]
//   float4 cDebugPSVariables;          // Index:   60.xyzw           Components:     4 [unused]
//   float4 cSampleOffsets[16];         // Index:   61-76             Components:    64 [unused]
//   float4 cSampleWeights[16];         // Index:   77-92             Components:    64 [unused]
//
// }
//
// cbuffer TransformBlock
// {
//
//   row_major float4x4 cObjectToView;  // Index:    0 1 2 3          Components:    16
//   row_major float3x4 cObjectToWorld; // Index:    4 5 6            Components:    12 [unused]
//   row_major float4x4 cObjectToSpot;  // Index:    7 8 9 10         Components:    16 [unused]
//   float4 cOmni0PosRad;               // Index:   11.xyzw           Components:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// StereoParams                      texture  float4          2d  125        1
// CommonBlock                       cbuffer      NA          NA    1        1
// UIBlock                           cbuffer      NA          NA    2        1
// MiscBlock                         cbuffer      NA          NA    4        1
// TransformBlock                    cbuffer      NA          NA    5        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz
// TEXCOORD                 0   xy          2     NONE   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// Sv_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// FOG                      0     z         1     NONE   float     z
// COLOR                    0   xyzw        2     NONE   float   xyzw
// P                        0   x           3  RTINDEX    uint   x
//
vs_5_0
dcl_output_siv o3.x, rendertarget_array_index
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB1[7], immediateIndexed
dcl_constantbuffer CB2[4], immediateIndexed
dcl_constantbuffer CB4[22], immediateIndexed
dcl_constantbuffer CB5[4], immediateIndexed
dcl_resource_buffer (float,float,float,float) t125
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
dcl_output o1.z
dcl_output o2.xyzw
dcl_temps 4
ld_indexable(buffer)(float,float,float,float) r3.xyzw, l(0, 0, 0, 0), t125.xyzw
mov o3.x, r3.z
ld_indexable(buffer)(float,float,float,float) r0.xy, l(0, 0, 0, 0), t125.xyzw
mul r0.x, r0.y, r0.x
dp4 r0.y, cb5[0].xyzw, v0.xyzw
mad r1.x, r0.x, l(0.996875), r0.y
dp4 r1.y, cb5[1].xyzw, v0.xyzw
dp4 r1.w, cb5[3].xyzw, v0.xyzw
dp4 r0.x, cb5[2].xyzw, v0.xyzw
mov r1.z, r0.x
mad r0.x, r0.x, cb1[6].x, cb1[6].y
max r0.x, r0.x, cb1[6].w
min o1.z, r0.x, l(1.000000)
dp2 r0.x, cb2[2].xyxx, v2.xyxx
add o1.x, r0.x, cb2[2].w
dp2 r0.x, cb2[3].xyxx, v2.xyxx
add o1.y, r0.x, cb2[3].w
dp3 r0.x, cb4[5].xyzx, v1.xyzx
mad r0.xyz, r0.xxxx, cb4[17].xyzx, cb4[12].xyzx
dp3 r0.w, cb4[7].xyzx, v1.xyzx
mad r0.xyz, r0.wwww, cb4[19].xyzx, r0.xyzx
dp3 r0.w, cb4[9].xyzx, v1.xyzx
mad o2.xyz, r0.wwww, cb4[21].xyzx, r0.xyzx
mov o2.w, cb1[5].w
add r2.x, -r3.y, r1.w
mul r2.y, r3.x, r3.w
mad r2.x, r2.x, r2.y, r1.x
ne r2.y, l(1.000000), r1.w
movc r1.x, r2.y, r2.x, r1.x
mov o0.xyzw, r1.xyzw
ret
// Approximately 23 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v0.6.181 on Thu Jan  4 23:59:24 2024
//
// cbuffer CommonBlock : register(b1)
// {
//   row_major float4x4 cTrapezoidalShadowTransformScreen : packoffset(c0);
//   float cAlphaRef : packoffset(c4);
//   float4 cConstantColor : packoffset(c5);
//   float4 cFogParams : packoffset(c6);
//   float3 cFogColor : packoffset(c7);
//   float3 cView : packoffset(c8);
//   float3 cLightDirection : packoffset(c9);
//   float3 cAmbientLightColor : packoffset(c10);
//   float3 cLightColor : packoffset(c11);
//   float2 cShadowBias : packoffset(c12);
//   float2 cShadowDetailDistanceRamp : packoffset(c13);
//   row_major float4x4 cTrapezoidalShadowTransformTexture : packoffset(c14);
//   row_major float4x4 cTrapezoidalShadowTransformTexture2 : packoffset(c18);
//   float cSelfIllumScale : packoffset(c22);
//   float2 cShadowMapSize : packoffset(c23);
//   float4 cClipPlane0 : packoffset(c24);
// }
//
// cbuffer UIBlock : register(b2)
// {
//   float4 cScreenCenter : packoffset(c0);
//   float4 cClipping : packoffset(c1);
//   row_major float2x4 cTextureTransform : packoffset(c2);
// }
//
// cbuffer MiscBlock : register(b4)
// {
//   row_major float2x4 cTextureTransform2 : packoffset(c0);
//   row_major float2x4 cTextureTransform3 : packoffset(c2);
//   float3 cLightDirectionInertial : packoffset(c4);
//   float3 cLight1Direction : packoffset(c5);
//   float3 cLight1DirectionInertial : packoffset(c6);
//   float3 cLight2Direction : packoffset(c7);
//   float3 cLight2DirectionInertial : packoffset(c8);
//   float3 cLight3Direction : packoffset(c9);
//   float3 cLight3DirectionInertial : packoffset(c10);
//   float4 cWater : packoffset(c11);
//   float3 cAmbientLightColorTimesConstantColor : packoffset(c12);
//   float3 cLightColorTimesConstantColor : packoffset(c13);
//   float3 cOmniLightColor : packoffset(c14);
//   float3 cOmniLightColorTimesConstantColor : packoffset(c15);
//   float3 cLight1Color : packoffset(c16);
//   float3 cLight1ColorTimesConstantColor : packoffset(c17);
//   float3 cLight2Color : packoffset(c18);
//   float3 cLight2ColorTimesConstantColor : packoffset(c19);
//   float3 cLight3Color : packoffset(c20);
//   float3 cLight3ColorTimesConstantColor : packoffset(c21);
//   row_major float3x4 cObjectToLight : packoffset(c22);
//   row_major float2x4 cObjectToVolume : packoffset(c25);
//   float cSpecularExponent : packoffset(c27);
//   float2 cClipPlanes : packoffset(c28);
//   float2 cPixelSize : packoffset(c29);
//   float2 cColorScale : packoffset(c30);
//   float4 cDOFPlanes : packoffset(c31);
//   float4 cDOFPeripheral : packoffset(c32);
//   float3 cDecalTransformDir : packoffset(c33);
//   float cBloomIntensity : packoffset(c34);
//   float3 cContrastAndExposure : packoffset(c35);
//   float cBrightPassThreshold : packoffset(c36);
//   float4 cMaterialVariable0 : packoffset(c37);
//   float4 cMaterialVariable1 : packoffset(c38);
//   float4 cMaterialVariable2 : packoffset(c39);
//   float4 cMaterialVariable3 : packoffset(c40);
//   float4 cMaterialVariable4 : packoffset(c41);
//   float4 cMaterialVariable5 : packoffset(c42);
//   float4 cMaterialVariable6 : packoffset(c43);
//   float4 cMaterialVariable7 : packoffset(c44);
//   float4 cMemExportOffset : packoffset(c45);
//   float4 cTextureSize : packoffset(c46);
//   float4 cMetaBallConstants : packoffset(c47);
//   float4 cMetaBallConstantsA : packoffset(c48);
//   float4 cMetaBallConstantsB : packoffset(c49);
//   float4 cMetaBallConstantsC : packoffset(c50);
//   row_major float3x4 cDecalTransform : packoffset(c51);
//   float4 cRadialBlurCenterStartWidth : packoffset(c54);
//   row_major float4x4 cProjectionInverse : packoffset(c55);
//   float4 cDebugVSVariables : packoffset(c59);
//   float4 cDebugPSVariables : packoffset(c60);
//   float4 cSampleOffsets[16] : packoffset(c61);
//   float4 cSampleWeights[16] : packoffset(c77);
// }
//
// cbuffer TransformBlock : register(b5)
// {
//   row_major float4x4 cObjectToView : packoffset(c0);
//   row_major float3x4 cObjectToWorld : packoffset(c4);
//   row_major float4x4 cObjectToSpot : packoffset(c7);
//   float4 cOmni0PosRad : packoffset(c11);
// }
//
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Buffer<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : POSITION0,
//   float3 v1 : NORMAL0,
//   float2 v2 : TEXCOORD0,
//   out float4 o0 : Sv_Position0,
//   out float2 o1 : TEXCOORD0,
//   out float p1 : FOG0,
//   out float4 o2 : COLOR0,
//   out uint o3 : P0)
// {
//   float4 r0,r1,r2,r3;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r3.xyzw = StereoParams.Load(float4(0,0,0,0)).xyzw;
//   o3.x = r3.z;
//   r0.xy = StereoParams.Load(float4(0,0,0,0)).xy;
//   r0.x = r0.x * r0.y;
//   r0.y = dot(cObjectToView._m00_m01_m02_m03, v0.xyzw);
//   r1.x = r0.x * 0.996874988 + r0.y;
//   r1.y = dot(cObjectToView._m10_m11_m12_m13, v0.xyzw);
//   r1.w = dot(cObjectToView._m30_m31_m32_m33, v0.xyzw);
//   r0.x = dot(cObjectToView._m20_m21_m22_m23, v0.xyzw);
//   r1.z = r0.x;
//   r0.x = r0.x * cFogParams.x + cFogParams.y;
//   r0.x = max(cFogParams.w, r0.x);
//   p1.x = min(1, r0.x);
//   r0.x = dot(cTextureTransform._m00_m01, v2.xy);
//   o1.x = cTextureTransform._m03 + r0.x;
//   r0.x = dot(cTextureTransform._m10_m11, v2.xy);
//   o1.y = cTextureTransform._m13 + r0.x;
//   r0.x = dot(cLight1Direction.xyz, v1.xyz);
//   r0.xyz = r0.xxx * cLight1ColorTimesConstantColor.xyz + cAmbientLightColorTimesConstantColor.xyz;
//   r0.w = dot(cLight2Direction.xyz, v1.xyz);
//   r0.xyz = r0.www * cLight2ColorTimesConstantColor.xyz + r0.xyz;
//   r0.w = dot(cLight3Direction.xyz, v1.xyz);
//   o2.xyz = r0.www * cLight3ColorTimesConstantColor.xyz + r0.xyz;
//   o2.w = cConstantColor.w;
//   r2.x = r1.w + -r3.y;
//   r2.y = r3.w * r3.x;
//   r2.x = r2.x * r2.y + r1.x;
//   r2.y = cmp(1.000000 != r1.w);
//   r1.x = r2.y ? r2.x : r1.x;
//   o0.xyzw = r1.xyzw;
//   return;
// }
/////////////////////////////////////////////////////////////////////////////
