// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v0.6.181 on Sun Dec 31 20:52:23 2023
//
//
// 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 [unused]
//   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 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 [unused]
//   float3 cLight1DirectionInertial;   // Index:    6.xyz            Components:     3 [unused]
//   float3 cLight2Direction;           // Index:    7.xyz            Components:     3 [unused]
//   float3 cLight2DirectionInertial;   // Index:    8.xyz            Components:     3 [unused]
//   float3 cLight3Direction;           // Index:    9.xyz            Components:     3 [unused]
//   float3 cLight3DirectionInertial;   // Index:   10.xyz            Components:     3 [unused]
//   float4 cWater;                     // Index:   11.xyzw           Components:     4 [unused]
//   float3 cAmbientLightColorTimesConstantColor;// Index:   12.xyz            Components:     3 [unused]
//   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 [unused]
//   float3 cLight2Color;               // Index:   18.xyz            Components:     3 [unused]
//   float3 cLight2ColorTimesConstantColor;// Index:   19.xyz            Components:     3 [unused]
//   float3 cLight3Color;               // Index:   20.xyz            Components:     3 [unused]
//   float3 cLight3ColorTimesConstantColor;// Index:   21.xyz            Components:     3 [unused]
//   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
//   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
//   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]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// tex_sampler_s                     sampler      NA          NA    0        1
// maskTex_sampler_s                 sampler      NA          NA    1        1
// tex                               texture  float4          2d    0        1
// maskTex                           texture  float4          2d    1        1
// StereoParams                      texture  float4          2d  125        1
// CommonBlock                       cbuffer      NA          NA    1        1
// MiscBlock                         cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xy          1     NONE   float   xy
// COLOR                    0   xyzw        2     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB1[6], immediateIndexed
dcl_constantbuffer CB4[55], 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_resource_buffer (float,float,float,float) t125
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw
dcl_temps 6
mad r0.xyzw, cb4[54].wwww, l(0.0833333358, 0.166666672, 0.250000, 0.333333343), cb4[54].zzzz
ld_indexable(buffer)(float,float,float,float) r1.x, l(0, 0, 0, 0), t125.xyzw
mad r2.x, r1.x, l(0.500000), cb4[54].x
mad r1.x, -r1.x, l(0.500000), v1.x
div r1.zw, l(1.000000, 1.000000, 1.000000, 1.000000), cb4[46].xxxy
mad r1.zw, r1.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), v1.xxxy
mov r2.y, cb4[54].y
add r1.zw, r1.zzzw, -r2.xxxy
mad r3.xyzw, r1.zwzw, r0.xxyy, r2.xyxy
mad r0.xyzw, r1.zwzw, r0.zzww, r2.xyxy
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.zwzz, t0.xyzw, s0
mad r2.zw, r1.zzzw, cb4[54].zzzz, r2.xxxy
sample_indexable(texture2d)(float,float,float,float) r5.xyzw, r2.zwzz, t0.xyzw, s0
add r4.xyzw, r4.xyzw, r5.xyzw
add r3.xyzw, r3.xyzw, r4.xyzw
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r0.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.zwzz, t0.xyzw, s0
add r3.xyzw, r3.xyzw, r4.xyzw
add r0.xyzw, r0.xyzw, r3.xyzw
mad r3.xyzw, cb4[54].wwww, l(0.416666657, 0.500000, 0.583333313, 0.666666687), cb4[54].zzzz
mad r4.xyzw, r1.zwzw, r3.xxyy, r2.xyxy
mad r3.xyzw, r1.zwzw, r3.zzww, r2.xyxy
sample_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t0.xyzw, s0
add r0.xyzw, r0.xyzw, r5.xyzw
add r0.xyzw, r4.xyzw, r0.xyzw
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.zwzz, t0.xyzw, s0
add r0.xyzw, r0.xyzw, r4.xyzw
add r0.xyzw, r3.xyzw, r0.xyzw
mad r3.xyz, cb4[54].wwww, l(0.750000, 0.833333313, 0.916666687, 0.000000), cb4[54].zzzz
mad r4.xyzw, r1.zwzw, r3.xxyy, r2.xyxy
mad r1.zw, r1.zzzw, r3.zzzz, r2.xxxy
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r1.zwzz, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r4.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t0.xyzw, s0
add r0.xyzw, r0.xyzw, r3.xyzw
add r0.xyzw, r4.xyzw, r0.xyzw
add r0.xyzw, r2.xyzw, r0.xyzw
mul r0.xyz, r0.xyzx, v2.xyzx
mul r0.w, r0.w, cb1[5].w
mul o0.w, r0.w, l(0.0833333358)
sample_indexable(texture2d)(float,float,float,float) r2.xyz, v1.xyxx, t0.xyzw, s0
mad r0.xyz, r0.xyzx, l(0.0833333358, 0.0833333358, 0.0833333358, 0.000000), -r2.xyzx
mov r1.y, v1.y
sample_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t1.yzwx, s1
mad r0.xyz, r0.wwww, r0.xyzx, r2.xyzx
mul o0.xyz, r0.xyzx, cb1[5].xyzx
ret
// Approximately 50 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v0.6.181 on Sun Dec 31 20:52:23 2023
//
// 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 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);
// }
//
// SamplerState tex_sampler_s_s : register(s0);
// SamplerState maskTex_sampler_s_s : register(s1);
// Texture2D<float4> tex : register(t0);
// Texture2D<float4> maskTex : register(t1);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Buffer<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : SV_Position0,
//   float2 v1 : TEXCOORD0,
//   float4 v2 : COLOR0,
//   out float4 o0 : SV_Target0)
// {
//   float4 r0,r1,r2,r3,r4,r5;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.xyzw = cRadialBlurCenterStartWidth.wwww * float4(0.0833333358,0.166666672,0.25,0.333333343) + cRadialBlurCenterStartWidth.zzzz;
//   r1.x = StereoParams.Load(float4(0,0,0,0)).x;
//   r2.x = r1.x * 0.5 + cRadialBlurCenterStartWidth.x;
//   r1.x = -r1.x * 0.5 + v1.x;
//   r1.zw = float2(1,1) / cTextureSize.xy;
//   r1.zw = r1.zw * float2(0.5,0.5) + v1.xy;
//   r2.y = cRadialBlurCenterStartWidth.y;
//   r1.zw = -r2.xy + r1.zw;
//   r3.xyzw = r1.zwzw * r0.xxyy + r2.xyxy;
//   r0.xyzw = r1.zwzw * r0.zzww + r2.xyxy;
//   r4.xyzw = tex.Sample(tex_sampler_s_s, r3.xy).xyzw;
//   r3.xyzw = tex.Sample(tex_sampler_s_s, r3.zw).xyzw;
//   r2.zw = r1.zw * cRadialBlurCenterStartWidth.zz + r2.xy;
//   r5.xyzw = tex.Sample(tex_sampler_s_s, r2.zw).xyzw;
//   r4.xyzw = r5.xyzw + r4.xyzw;
//   r3.xyzw = r4.xyzw + r3.xyzw;
//   r4.xyzw = tex.Sample(tex_sampler_s_s, r0.xy).xyzw;
//   r0.xyzw = tex.Sample(tex_sampler_s_s, r0.zw).xyzw;
//   r3.xyzw = r4.xyzw + r3.xyzw;
//   r0.xyzw = r3.xyzw + r0.xyzw;
//   r3.xyzw = cRadialBlurCenterStartWidth.wwww * float4(0.416666657,0.5,0.583333313,0.666666687) + cRadialBlurCenterStartWidth.zzzz;
//   r4.xyzw = r1.zwzw * r3.xxyy + r2.xyxy;
//   r3.xyzw = r1.zwzw * r3.zzww + r2.xyxy;
//   r5.xyzw = tex.Sample(tex_sampler_s_s, r4.xy).xyzw;
//   r4.xyzw = tex.Sample(tex_sampler_s_s, r4.zw).xyzw;
//   r0.xyzw = r5.xyzw + r0.xyzw;
//   r0.xyzw = r0.xyzw + r4.xyzw;
//   r4.xyzw = tex.Sample(tex_sampler_s_s, r3.xy).xyzw;
//   r3.xyzw = tex.Sample(tex_sampler_s_s, r3.zw).xyzw;
//   r0.xyzw = r4.xyzw + r0.xyzw;
//   r0.xyzw = r0.xyzw + r3.xyzw;
//   r3.xyz = cRadialBlurCenterStartWidth.www * float3(0.75,0.833333313,0.916666687) + cRadialBlurCenterStartWidth.zzz;
//   r4.xyzw = r1.zwzw * r3.xxyy + r2.xyxy;
//   r1.zw = r1.zw * r3.zz + r2.xy;
//   r2.xyzw = tex.Sample(tex_sampler_s_s, r1.zw).xyzw;
//   r3.xyzw = tex.Sample(tex_sampler_s_s, r4.xy).xyzw;
//   r4.xyzw = tex.Sample(tex_sampler_s_s, r4.zw).xyzw;
//   r0.xyzw = r3.xyzw + r0.xyzw;
//   r0.xyzw = r0.xyzw + r4.xyzw;
//   r0.xyzw = r0.xyzw + r2.xyzw;
//   r0.xyz = v2.xyz * r0.xyz;
//   r0.w = cConstantColor.w * r0.w;
//   o0.w = 0.0833333358 * r0.w;
//   r2.xyz = tex.Sample(tex_sampler_s_s, v1.xy).xyz;
//   r0.xyz = r0.xyz * float3(0.0833333358,0.0833333358,0.0833333358) + -r2.xyz;
//   r1.y = v1.y;
//   r0.w = maskTex.Sample(maskTex_sampler_s_s, r1.xy).x;
//   r0.xyz = r0.www * r0.xyz + r2.xyz;
//   o0.xyz = cConstantColor.xyz * r0.xyz;
//   return;
// }
/////////////////////////////////////////////////////////////////////////////
