//Rain drops haloing PS.
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Sat Apr 10 16:26:09 2021
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 1   xy          0     NONE   float   xy
// TEXCOORD                 2     zw        0     NONE   float     zw
// TEXCOORD                 3   xyz         1     NONE   float     z
// TEXCOORD                 4      w        1     NONE   float      w
// TEXCOORD                 5   x           2     NONE   float   x
// TEXCOORD                 6    y          2     NONE   float    y
// TEXCOORD                 8     z         2     NONE   float     z
// TEXCOORD                 7   xyz         3     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 cb9[2], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_ps linear v0.xy
dcl_input_ps linear v0.zw
dcl_input_ps linear v1.z
dcl_input_ps linear v1.w
dcl_input_ps linear v2.x
dcl_input_ps linear v2.y
dcl_input_ps linear v2.z
dcl_input_ps linear v3.xyz
dcl_output o0.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
dp2 r0.x, v0.xyxx, v0.xyxx
add r0.x, -r0.x, l(1.000000)
lt r0.y, r0.x, l(0.000000)
sqrt r0.x, r0.x
discard_nz r0.y
add r0.y, r0.x, l(-1.000000)
add r0.z, -r0.y, l(1.000000)
sample_indexable(texture2d)(float,float,float,float) r1.xyz, v0.zwzz, t1.xywz, s1
mad r2.z, r1.z, r0.z, r0.y
add r0.yz, r1.xxyx, l(0.000000, -0.500000, -0.500000, 0.000000)
add r0.w, r2.z, l(-0.001000)
lt r0.w, r0.w, l(0.000000)
discard_nz r0.w
add r1.xy, -r0.yzyy, v0.xyxx
mad r2.xy, r0.xxxx, r1.xyxx, r0.yzyy
dp3 r0.x, r2.xyzx, r2.xyzx
rsq r0.x, r0.x
mad r0.y, r2.z, r0.x, l(-0.400000)
mul r0.xzw, r0.xxxx, r2.xxyz
mul_sat r0.y, r0.y, l(100.000099)
mad r1.x, r0.y, l(-2.000000), l(3.000000)
mul r0.y, r0.y, r0.y
mul r0.y, r0.y, r1.x

mov r23.xyz, v3.xyzx
add r25.w, r23.z, -r25.y
mul r25.w, r25.w, l(0.5)
mad r23.x, r25.x, r25.w, r23.x

div r1.xy, r23.xyxx, r23.zzzz
sample_indexable(texture2d)(float,float,float,float) r1.z, r1.xyxx, t3.xywz, s3
add r1.z, r1.z, v1.z
mul r2.xy, |r1.zzzz|, l(0.400000, 0.200000, 0.000000, 0.000000)
add r1.zw, |r1.zzzz|, l(0.000000, 0.000000, 0.400000, 0.200000)
div r2.xy, r2.xyxx, r1.zwzz
mov r2.zw, -r2.xxxy
mad r1.zw, r0.xxxz, r2.yyyw, r1.xxxy
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r1.zwzz, t3.xyzw, s3
mul r3.xyz, r0.yyyy, r3.xyzx
mul r3.xyz, r3.xyzx, cb9[1].yyyy
mul r0.xy, r0.wwww, r0.xzxx
add r0.z, -|r0.w|, l(1.000000)
mad r0.xy, r0.xyxx, r2.zxzz, r1.xyxx
sample_indexable(texture2d)(float,float,float,float) r0.xyw, r0.xyxx, t3.xywz, s3
mul r0.xyz, r0.zzzz, r0.xywx
mad r0.xyz, r0.xyzx, cb9[1].xxxx, r3.xyzx
mov_sat r0.w, v2.z
mul r1.x, r0.w, v1.w
mul r0.xyz, r0.xyzx, r1.xxxx
mul r0.xyz, r0.xyzx, cb9[0].xyzx
min_sat r1.x, v2.y, v2.x
mad r1.yzw, r0.xxyz, r1.xxxx, cb9[1].zzzz
mul r0.xyz, r0.xyzx, r1.xxxx
mul r0.xyz, r0.xyzx, cb9[1].zzzz
div o0.xyz, r0.xyzx, r1.yzwy
add r0.x, l(-1.000000), cb9[0].w
mul r0.x, r0.x, v1.w
mad o0.w, r0.w, r0.x, l(1.000000)
ret
// Approximately 0 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Sat Apr 10 16:26:09 2021
// Texture2D<float4> t3 : register(t3);
//
// Texture2D<float4> t1 : register(t1);
//
// SamplerState s3_s : register(s3);
//
// SamplerState s1_s : register(s1);
//
// cbuffer cb9 : register(b9)
// {
//   float4 cb9[2];
// }
//
//
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main(
//   float2 v0 : TEXCOORD1,
//   float2 w0 : TEXCOORD2,
//   float3 v1 : TEXCOORD3,
//   float w1 : TEXCOORD4,
//   float v2 : TEXCOORD5,
//   float w2 : TEXCOORD6,
//   float w2 : TEXCOORD8,
//   float3 v3 : TEXCOORD7,
//   out float4 o0 : SV_Target0)
// {
//   float4 r0,r1,r2,r3;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
//   r0.x = dot(v0.xy, v0.xy);
//   r0.x = 1 + -r0.x;
//   r0.y = cmp(r0.x < 0);
//   r0.x = sqrt(r0.x);
//   if (r0.y != 0) discard;
//   r0.y = -1 + r0.x;
//   r0.z = 1 + -r0.y;
//   r1.xyz = t1.Sample(s1_s, w0.xy).xyw;
//   r2.z = r1.z * r0.z + r0.y;
//   r0.yz = float2(-0.5,-0.5) + r1.xy;
//   r0.w = -0.00100000005 + r2.z;
//   r0.w = cmp(r0.w < 0);
//   if (r0.w != 0) discard;
//   r1.xy = v0.xy + -r0.yz;
//   r2.xy = r0.xx * r1.xy + r0.yz;
//   r0.x = dot(r2.xyz, r2.xyz);
//   r0.x = rsqrt(r0.x);
//   r0.y = r2.z * r0.x + -0.400000006;
//   r0.xzw = r2.xyz * r0.xxx;
//   r0.y = saturate(100.000099 * r0.y);
//   r1.x = r0.y * -2 + 3;
//   r0.y = r0.y * r0.y;
//   r0.y = r1.x * r0.y;
//   r1.xy = v3.xy / v3.zz;
//   r1.z = t3.Sample(s3_s, r1.xy).w;
//   r1.z = v1.z + r1.z;
//   r2.xy = float2(0.400000006,0.200000003) * abs(r1.zz);
//   r1.zw = float2(0.400000006,0.200000003) + abs(r1.zz);
//   r2.xy = r2.xy / r1.zw;
//   r2.zw = -r2.xy;
//   r1.zw = r0.xz * r2.yw + r1.xy;
//   r3.xyz = t3.Sample(s3_s, r1.zw).xyz;
//   r3.xyz = r3.xyz * r0.yyy;
//   r3.xyz = cb9[1].yyy * r3.xyz;
//   r0.xy = r0.xz * r0.ww;
//   r0.z = 1 + -abs(r0.w);
//   r0.xy = r0.xy * r2.zx + r1.xy;
//   r0.xyw = t3.Sample(s3_s, r0.xy).xyz;
//   r0.xyz = r0.xyw * r0.zzz;
//   r0.xyz = r0.xyz * cb9[1].xxx + r3.xyz;
//   r0.w = saturate(w2.x);
//   r1.x = w1.x * r0.w;
//   r0.xyz = r1.xxx * r0.xyz;
//   r0.xyz = cb9[0].xyz * r0.xyz;
//   r1.x = saturate(min(v2.x, w2.x));
//   r1.yzw = r0.xyz * r1.xxx + cb9[1].zzz;
//   r0.xyz = r1.xxx * r0.xyz;
//   r0.xyz = cb9[1].zzz * r0.xyz;
//   o0.xyz = r0.xyz / r1.yzw;
//   r0.x = cb9[0].w + -1;
//   r0.x = w1.x * r0.x;
//   o0.w = r0.w * r0.x + 1;
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// E:\SteamLibrary\steamapps\common\Yakuza Kiwami 2\ShaderFixes\c4914924769ebe35-ps_replace.txt(31,9-10): error X3003: redefinition of 'w2'
/////////////////////////////////////////////////////////////////////////////
