// MANUALLY DUMPED [ShaderRegex\ShaderFixes\ShaderRegEx_UE4_UNIVERSAL2_C44.ini\_91_WaterSSR_1]
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Wed Jun 30 07:24:00 2021
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xyzw        0     NONE   float
// SV_POSITION              0   xyzw        1      POS   float   xy
//
//
// 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 cb0[39], immediateIndexed
dcl_constantbuffer cb1[209], 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_texture2d (float,float,float,float) t2
dcl_input_ps_siv linear noperspective v1.xy, position
dcl_output o0.xyzw
dcl_temps 15
dcl_indexableTemp x0[16], 4
dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
mov x0[0].xy, l(2,1,0,0)
mov x0[1].xy, l(1,2,0,0)
mov x0[2].xy, l(2,0,0,0)
mov x0[3].xy, l(0,1,0,0)
mov x0[4].xy, l(2,3,0,0)
mov x0[5].xy, l(3,2,0,0)
mov x0[6].xy, l(3,1,0,0)
mov x0[7].xy, l(0,3,0,0)
mov x0[8].xy, l(1,0,0,0)
mov x0[9].xy, l(1,1,0,0)
mov x0[10].xy, l(3,3,0,0)
mov x0[11].xy, l(0,0,0,0)
mov x0[12].xy, l(2,2,0,0)
mov x0[13].xy, l(1,3,0,0)
mov x0[14].xy, l(3,0,0,0)
mov x0[15].xy, l(0,2,0,0)
round_ni r0.xy, v1.xyxx
add r0.zw, r0.xxxy, l(0.000000, 0.000000, 0.500000, 0.500000)

mul r1.xy, r0.zwzz, cb1[123].zwzz

sample_l_indexable(texture2d)(float,float,float,float) r1.w, r1.xyxx, t0.yzwx, s0, l(0.000000)
mad r2.x, r1.w, cb1[57].x, cb1[57].y
mad r2.y, r1.w, cb1[57].z, -cb1[57].w
div r2.y, l(1.000000, 1.000000, 1.000000, 1.000000), r2.y
add r2.x, r2.y, r2.x
eq r1.w, r1.w, l(0.000000)
lt r2.x, cb0[36].x, r2.x
or r1.w, r1.w, r2.x
if_z r1.w
  mov r2.x, l(-1.000000)
else
  mov r2.x, l(1.000000)
endif
if_nz r1.w
  mul r0.zw, r0.zzzw, cb1[122].zzzw
  mad r0.z, r0.z, l(2.000000), l(-1.000000)
  mad r0.w, r0.w, l(-2.000000), l(1.000000)
  mul r3.xyz, r0.wwww, cb1[49].xyzx
  mad r3.xyz, r0.zzzz, cb1[48].xyzx, r3.xyzx
  add r3.xyz, r3.xyzx, cb1[50].xyzx
  ftoi r0.zw, v1.xxxy
  and r4.xy, r0.zwzz, l(0x80000000, 0x80000000, 0, 0)
  imax r0.zw, r0.zzzw, -r0.zzzw
  and r0.zw, r0.zzzw, l(0, 0, 3, 3)
  ineg r4.zw, r0.zzzw
  movc r0.zw, r4.xxxy, r4.zzzw, r0.zzzw
  mov r1.w, cb0[27].x
  mov r4.xy, x0[r1.w + 0].xyxx
  mul r3.xyz, r3.xyzx, l(10000000.000000, 10000000.000000, 10000000.000000, 0.000000)
  mul r5.xyz, r3.yyyy, cb0[29].xywx
  mad r5.xyz, r3.xxxx, cb0[28].xywx, r5.xyzx
  mad r5.xyz, r3.zzzz, cb0[30].xywx, r5.xyzx
  add r5.xyz, r5.xyzx, cb0[31].xywx
  div r4.zw, r5.xxxy, r5.zzzz
  mad r4.zw, r4.zzzw, l(0.000000, 0.000000, 0.500000, -0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
//skip this shader be cougth by another RegEx
//Shader Fix 1/1

//ld_indexable(texture2d)(float,float,float,float) r6.xyzw, l(0, 0, 0, 0), t125.xyzw
//ld_indexable(texture1d)(float,float,float,float) r11.xyzw, l(45, 0, 0, 0), t120.xyzw
//ieq r12.x, r11.x, l(1.0)
//if_nz r12.x
//mad r3.x, -r3.z, r6.x, r3.x
//endif
//if_z r12.x
//add r6.w, r3.z, -r6.y
//mad r3.x, -r6.w, r6.x, r3.x
//endif
////This line is for the SSR_SideFix RegEx
//mov r9.x, r3.z
//Shader Fix 1/1

  mul r5.xyz, r3.yyyy, cb0[33].xywx

//skip this shader be cougth by another RegEx
  mad r3.xyw, r3.xxxx, cb0[32].xyxw, r5.xyxz
  mad r3.xyz, r3.zzzz, cb0[34].xywx, r3.xywx
  add r3.xyz, r3.xyzx, cb0[35].xywx

  div r3.xy, r3.xyxx, r3.zzzz
  mad r3.xy, r3.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
  div r3.zw, cb0[37].xxxy, cb1[122].xxxy
  add r3.xy, -r4.zwzz, r3.xyxx
  div r5.xyzw, cb0[37].xyxy, cb1[123].xyxy
  mul r3.xy, r3.xyxx, r5.xyxx
  mad r3.xy, r1.xyxx, r3.zwzz, r3.xyxx
  ge r3.zw, r3.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
  and r1.w, r3.w, r3.z
  lt r3.zw, r3.xxxy, r5.zzzw
  and r1.w, r1.w, r3.z
  and r1.w, r3.w, r1.w
  if_nz r1.w
    add r3.zw, cb1[122].xxxy, l(0.000000, 0.000000, -2.000000, -2.000000)
    mul r3.zw, r3.zzzw, cb1[123].zzzy
    min r3.xy, r3.zwzz, r3.xyxx
    sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.xyxx, t2.xyzw, s1, l(0.000000)
    ge r1.w, r3.w, l(0.000000)
  else
    mov r2.y, l(0)
    mov r3.xyzw, r2.yyyx
    mov r1.w, l(0)
  endif
  ilt r2.y, l(0), cb0[38].x
  and r1.w, r1.w, r2.y
  ieq r0.zw, r0.zzzw, r4.xxxy
  and r0.z, r0.w, r0.z
  if_nz r0.z
    itof r0.zw, r4.xxxy
    add r0.xy, -r0.zwzz, r0.xyxx
    add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
    add r0.zw, cb1[122].xxxy, l(0.000000, 0.000000, -2.000000, -2.000000)
    mul r0.xyzw, r0.xyzw, cb1[123].zwzy
    min r0.xy, r0.zwzz, r0.xyxx
    ilt r0.w, l(0), cb1[208].w
    movc r0.w, r0.w, l(0.500000), l(1.000000)
    mul r0.z, r0.w, r0.y
    sample_l_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xzxx, t1.xyzw, s1, l(0.000000)
    add r4.xyzw, -r0.xyzw, r3.xyzw
    mad r4.xyzw, cb0[36].yyyy, r4.xyzw, r0.xyzw
    movc r0.xyzw, r1.wwww, r4.xyzw, r0.xyzw
    ge r1.w, r0.w, l(0.000000)
    mov o0.xyzw, r0.xyzw
  else
    mov o0.xyzw, r3.xyzw
  endif
  if_z r1.w
    ilt r0.x, l(0), cb1[208].w
    mul r1.z, r1.y, l(0.500000)
    movc r0.xy, r0.xxxx, r1.xzxx, r1.xyxx
    add r0.zw, cb1[122].xxxy, l(0.000000, 0.000000, -1.000000, -1.000000)
    mul r0.zw, r0.zzzw, cb1[123].zzzw
    mad r1.xy, -cb1[123].zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), r0.xyxx
    min r1.xy, r0.zwzz, r1.xyxx
    sample_l_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.xyxx, t1.xyzw, s1, l(0.000000)
    ge r2.y, r1.w, l(-0.010000)
    mul r3.xzw, cb1[123].zzzw, l(-2.000000, 0.000000, -2.000000, 2.000000)
    mov r3.y, l(0)
    add r3.xyzw, r0.xyxy, r3.xyzw
    min r3.xyzw, r0.zwzw, r3.xyzw
    sample_l_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t1.xyzw, s1, l(0.000000)
    ge r2.w, r4.w, l(-0.010000)
    and r2.yw, r2.yyyw, l(0, 0x3d9f6e3f, 0, 0x3dfc8da0)
    mul r4.xyzw, r2.wwww, r4.xyzw
    mad r1.xyzw, r1.xyzw, r2.yyyy, r4.xyzw
    add r2.y, r2.w, r2.y
    sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.zwzz, t1.xyzw, s1, l(0.000000)
    ge r2.w, r3.w, l(-0.010000)
    and r2.w, r2.w, l(0x3d9f6e3f)
    mad r1.xyzw, r3.xyzw, r2.wwww, r1.xyzw
    add r2.y, r2.w, r2.y
    mov r3.xz, l(0,0,0,0)
    mul r3.yw, cb1[123].wwww, l(0.000000, -2.000000, 0.000000, 2.000000)
    add r3.xyzw, r0.xyxy, r3.xyzw
    min r3.xyzw, r0.zwzw, r3.xyzw
    sample_l_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t1.xyzw, s1, l(0.000000)
    ge r2.w, r4.w, l(-0.010000)
    and r2.w, r2.w, l(0x3dfc8da0)
    mad r1.xyzw, r4.xyzw, r2.wwww, r1.xyzw
    add r2.y, r2.w, r2.y
    min r3.xy, r0.zwzz, r0.xyxx
    sample_l_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t1.xyzw, s1, l(0.000000)
    ge r2.w, r4.w, l(-0.010000)
    and r2.w, r2.w, l(0x3e4808c8)
    mad r1.xyzw, r4.xyzw, r2.wwww, r1.xyzw
    add r2.y, r2.w, r2.y
    sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.zwzz, t1.xyzw, s1, l(0.000000)
    ge r2.w, r3.w, l(-0.010000)
    and r2.w, r2.w, l(0x3dfc8da0)
    mad r1.xyzw, r3.xyzw, r2.wwww, r1.xyzw
    add r2.y, r2.w, r2.y
    mul r3.z, cb1[123].z, l(2.000000)
    mad r3.xy, cb1[123].zwzz, l(2.000000, -2.000000, 0.000000, 0.000000), r0.xyxx
    min r3.xy, r0.zwzz, r3.xyxx
    sample_l_indexable(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t1.xyzw, s1, l(0.000000)
    ge r2.w, r4.w, l(-0.010000)
    and r2.w, r2.w, l(0x3d9f6e3f)
    mad r1.xyzw, r4.xyzw, r2.wwww, r1.xyzw
    add r2.y, r2.w, r2.y
    mov r3.w, l(0)
    add r3.xy, r0.xyxx, r3.zwzz
    min r3.xy, r0.zwzz, r3.xyxx
    sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.xyxx, t1.xyzw, s1, l(0.000000)
    ge r2.w, r3.w, l(-0.010000)
    and r2.w, r2.w, l(0x3dfc8da0)
    mad r1.xyzw, r3.xyzw, r2.wwww, r1.xyzw
    add r2.y, r2.w, r2.y
    mad r0.xy, cb1[123].zwzz, l(2.000000, 2.000000, 0.000000, 0.000000), r0.xyxx
    min r0.xy, r0.zwzz, r0.xyxx
    sample_l_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xyxx, t1.xyzw, s1, l(0.000000)
    ge r2.w, r0.w, l(-0.010000)
    and r2.w, r2.w, l(0x3d9f6e3f)
    mad r0.xyzw, r0.xyzw, r2.wwww, r1.xyzw
    add r1.x, r2.w, r2.y
    max r1.y, r1.x, l(0.001000)
    div r0.xyzw, r0.xyzw, r1.yyyy
    lt r1.x, l(0.000000), r1.x
    movc o0.xyzw, r1.xxxx, r0.xyzw, l(0,0,0,1.000000)
  endif
else
  mov r2.z, l(0)
  mov o0.xyzw, r2.zzzx
endif
ret
// Approximately 0 instruction slots used
