//King Crimson 2D effect rejecting attack PS.
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Mon Sep 05 20:32:02 2022
//
//
// Buffer Definitions:
//
// cbuffer perMaterialBuffer
// {
//
//   float4 g_commonParam;              // Index:    0.xyzw           Components:     4
//   float4 g_fogColor;                 // Index:    1.xyzw           Components:     4
//   float4 g_fogParam;                 // Index:    2.xyzw           Components:     4 [unused]
//   float4 g_ambientColor;             // Index:    3.xyzw           Components:     4 [unused]
//   row_major float4x4 g_matWorldViewProj;// Index:    4 5 6 7          Components:    16 [unused]
//   float4 g_uvOffset0;                // Index:    8.xyzw           Components:     4 [unused]
//   float4 g_uvOffset1;                // Index:    9.xyzw           Components:     4 [unused]
//   float4 g_blendRate;                // Index:   10.xyzw           Components:     4 [unused]
//   float4 g_blendType;                // Index:   11.xyzw           Components:     4 [unused]
//   float4 g_multColor;                // Index:   12.xyzw           Components:     4 [unused]
//   float4 g_ScreenToUV;               // Index:   13.xyzw           Components:     4
//   float4 g_uvOffset3;                // Index:   14.xyzw           Components:     4
//   float4 g_uvOffsetScreen;           // Index:   15.xyzw           Components:     4
//   float4 g_uvScaleScreen;            // Index:   16.xyzw           Components:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// g_sampler0                        sampler      NA          NA    0        1
// g_samplerScreen0                  sampler      NA          NA    1        1
// g_texture0                        texture  float4          2d    0        1
// g_texture2                        texture  float4          2d    1        1
// perMaterialBuffer                 cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// COLOR                    0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xy          2     NONE   float   xy
// TEXCOORD                 1     z         2     NONE   float     z
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer cb0[17], 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_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_input_ps linear v2.z
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_temps 35
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r20.xyzw, l(4, 0, 0, 0), t120.xyzw
sample r0.xyzw, v2.xyxx, t0.xyzw, s0
mul r1.xyzw, r0.xyzw, v1.xyzw
ge r0.w, cb0[0].x, r1.w
discard_nz r0.w
mov r0.w, cb0[16].x
mul r2.x, cb0[13].y, cb0[16].y
mul r3.x, r0.w, cb0[13].x
mul r3.y, r2.x, v0.y
mul r2.xy, cb0[15].xyxx, cb0[16].xyxx
mov r4.x, v0.x
mov r4.y, l(-1.000000)
mad r2.xy, r3.xyxx, r4.xyxx, r2.xyxx
add r2.z, -r2.y, l(1.000000)

ieq r21.x, r20.x, l(2.0)
if_z r21.x
div r26.x, r25.y, v0.w
add r26.x, l(1.0), -r26.x
mul r26.x, r26.x, l(15.0)
mad r2.x, -r25.x, r26.x, r2.x
else
mad r2.x, -r25.x, l(12.5), r2.x
endif

sample r2.xyzw, r2.xzxx, t1.xyzw, s1
mul r0.w, r2.w, cb0[14].x
mad r0.xyz, -r0.xyzx, v1.xyzx, r2.xyzx
mad r0.xyz, r0.wwww, r0.xyzx, r1.xyzx
mul r0.w, r1.w, cb0[0].y
add r0.xyz, r0.xyzx, -cb0[1].xyzx
mad o0.xyz, v2.zzzz, r0.xyzx, cb0[1].xyzx
mov o0.w, r0.w
mov o1.xy, cb0[0].wzww
mov o1.z, l(0.990000)
mov o1.w, r0.w
ret
// Approximately 25 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Mon Sep 05 20:32:02 2022
//
// cbuffer perMaterialBuffer : register(b0)
// {
//   float4 g_commonParam : packoffset(c0);
//   float4 g_fogColor : packoffset(c1);
//   float4 g_fogParam : packoffset(c2);
//   float4 g_ambientColor : packoffset(c3);
//   row_major float4x4 g_matWorldViewProj : packoffset(c4);
//   float4 g_uvOffset0 : packoffset(c8);
//   float4 g_uvOffset1 : packoffset(c9);
//   float4 g_blendRate : packoffset(c10);
//   float4 g_blendType : packoffset(c11);
//   float4 g_multColor : packoffset(c12);
//   float4 g_ScreenToUV : packoffset(c13);
//   float4 g_uvOffset3 : packoffset(c14);
//   float4 g_uvOffsetScreen : packoffset(c15);
//   float4 g_uvScaleScreen : packoffset(c16);
// }
//
// SamplerState g_sampler0_s : register(s0);
// SamplerState g_samplerScreen0_s : register(s1);
// Texture2D<float4> g_texture0 : register(t0);
// Texture2D<float4> g_texture2 : register(t1);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : SV_Position0,
//   float4 v1 : COLOR0,
//   float2 v2 : TEXCOORD0,
//   float w2 : TEXCOORD1,
//   out float4 o0 : SV_Target0,
//   out float4 o1 : SV_Target1)
// {
//   float4 r0,r1,r2,r3,r4;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.xyzw = g_texture0.Sample(g_sampler0_s, v2.xy).xyzw;
//   r1.xyzw = v1.xyzw * r0.xyzw;
//   r0.w = cmp(g_commonParam.x >= r1.w);
//   if (r0.w != 0) discard;
//   r0.w = g_uvScaleScreen.x;
//   r2.x = g_uvScaleScreen.y * g_ScreenToUV.y;
//   r3.x = g_ScreenToUV.x * r0.w;
//   r3.y = v0.y * r2.x;
//   r2.xy = g_uvScaleScreen.xy * g_uvOffsetScreen.xy;
//   r4.x = v0.x;
//   r4.y = -1;
//   r2.xy = r3.xy * r4.xy + r2.xy;
//   r2.z = 1 + -r2.y;
//   r2.xyzw = g_texture2.Sample(g_samplerScreen0_s, r2.xz).xyzw;
//   r0.w = g_uvOffset3.x * r2.w;
//   r0.xyz = -r0.xyz * v1.xyz + r2.xyz;
//   r0.xyz = r0.www * r0.xyz + r1.xyz;
//   r0.w = g_commonParam.y * r1.w;
//   r0.xyz = -g_fogColor.xyz + r0.xyz;
//   o0.xyz = w2.xzz * r0.xyz + g_fogColor.xyz;
//   o0.w = r0.w;
//   o1.xy = g_commonParam.wz;
//   o1.z = 0.99000001;
//   o1.w = r0.w;
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// F:\SteamLibrary\steamapps\common\JoJo's Bizarre Adventure All-Star Battle R\ShaderFixes\d52d5035e9fbb283-ps_replace.txt(64,12-17): error X3018: invalid subscript 'xzz'
/////////////////////////////////////////////////////////////////////////////
