// MANUALLY DUMPED [ShaderRegexLightingPS1nospec] Screen space reflections 3 (medium).
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Thu Oct  7 21:15:48 2021
//
//
// Buffer Definitions:
//
// cbuffer fblock
// {
//
//   float4 renderpositiontoviewtexture;// Index:    0.xyzw           Components:     4
//   float4 ssrparm;                    // Index:    1.xyzw           Components:     4
//   float4 viewmatrixx;                // Index:    2.xyzw           Components:     4
//   float4 viewmatrixy;                // Index:    3.xyzw           Components:     4
//   float4 viewmatrixz;                // Index:    4.xyzw           Components:     4
//   float4 projectionmatrixx;          // Index:    5.xyzw           Components:     4
//   float4 projectionmatrixy;          // Index:    6.xyzw           Components:     4
//   float4 projectionmatrixz;          // Index:    7.xyzw           Components:     4
//   float4 projectionmatrixw;          // Index:    8.xyzw           Components:     4
//   float4 inverseviewprojectionmatrixx;// Index:    9.xyzw           Components:     4
//   float4 inverseviewprojectionmatrixy;// Index:   10.xyzw           Components:     4
//   float4 inverseviewprojectionmatrixz;// Index:   11.xyzw           Components:     4
//   float4 inverseviewprojectionmatrixw;// Index:   12.xyzw           Components:     4
//   float4 lightprepassinverseparams;  // Index:   13.xyzw           Components:     4
//   float4 prevviewposition;           // Index:   14.xyzw           Components:     4
//   float4 prevviewprojectionmatrixrcx;// Index:   15.xyzw           Components:     4
//   float4 prevviewprojectionmatrixrcy;// Index:   16.xyzw           Components:     4
//   float4 prevviewprojectionmatrixrcw;// Index:   17.xyzw           Components:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// viewstencil_samp_state            sampler      NA          NA    0        1
// viewdepthmap_samp_state           sampler      NA          NA    1        1
// packedgbuffer0main_samp_state     sampler      NA          NA    2        1
// roughnesstex_samp_state           sampler      NA          NA    3        1
// viewdepthmap4_samp_state          sampler      NA          NA    4        1
// viewdepthmapprev_samp_state       sampler      NA          NA    5        1
// viewcolormapprev_samp_state       sampler      NA          NA    6        1
// viewstencil_samp                  texture  float4          2d    0        1
// viewdepthmap_samp                 texture  float4          2d    1        1
// packedgbuffer0main_samp           texture  float4          2d    2        1
// roughnesstex_samp                 texture  float4          2d    3        1
// viewdepthmap4_samp                texture  float4          2d    4        1
// viewdepthmapprev_samp             texture  float4          2d    5        1
// viewcolormapprev_samp             texture  float4          2d    6        1
// fblock                            cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 1   xyzw        0     NONE   float   xyzw
// TEXCOORD                 2   xyzw        1     NONE   float   xyzw
// SV_Position              0   xyzw        2      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[18], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, 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_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_input_ps linear v0.xyzw
dcl_input_ps linear v1.xyzw
dcl_input_ps_siv linear noperspective v2.xy, position
dcl_output o0.xyzw
dcl_temps 21
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r7.xyzw, l(0, 0, 0, 0), t125.xyzw
mad r0.xy, v2.xyxx, cb0[0].zwzz, cb0[0].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r0.w, r0.xyxx, t0.yzwx, s0, l(0.000000)
mul r0.w, r0.w, l(255.000000)
ftou r0.w, r0.w
and r0.w, r0.w, l(4)
ine r0.w, r0.w, l(4)
if_nz r0.w
  discard_nz l(-1)
endif
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r0.xyxx, t1.yzxw, s1, l(0.000000)
eq r0.w, r0.z, l(1.000000)
if_nz r0.w
  discard_nz l(-1)
endif
sample_l_indexable(texture2d)(float,float,float,float) r1.xy, r0.xyxx, t2.xyzw, s2, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.w, r0.xyxx, t3.yzwx, s3, l(0.000000)
mad r0.w, r0.w, cb0[1].y, l(2.000000)
min r0.w, r0.w, l(1.000000)
ge r1.z, l(0.000000), r0.w
if_nz r1.z
  discard_nz l(-1)
endif

add r9.xyzw, v0.xyzw, -v1.xyzw
//Comment.
mad r9.xyzw, r0.zzzz, r9.xyzw, v1.xyzw
mov r8.xyzw, v0.xyzw
//mad r10.w, r7.y, r9.w, l(-1.0)

mad r10.w, l(0.0), r9.w, l(-1.0)

div r10.w, r10.w, r0.z
mul r10.x, r10.w, cb0[9].x
mul r10.y, r10.w, cb0[10].x
mul r10.z, r10.w, cb0[11].x
mad r8.xyz, r7.xxxx, r10.xyzx, r8.xyzx
add r2.xyzw, r8.xyzw, -v1.xyzw
mad r2.xyzw, r0.z, r2.xyzw, v1.xyzw

div r2.xyz, r2.xyzx, r2.wwww
dp3 r3.x, r2.xyzx, cb0[2].xyzx
dp3 r3.y, r2.xyzx, cb0[3].xyzx
dp3 r3.z, r2.xyzx, cb0[4].xyzx
mul r1.xy, r1.xyxx, l(65535.000000, 65535.000000, 0.000000, 0.000000)
ftou r1.xy, r1.xyxx
ubfe r1.xy, l(8, 8, 0, 0), l(8, 8, 0, 0), r1.xyxx
utof r1.xy, r1.xyxx
mad r1.xy, r1.xyxx, l(0.00784313772, 0.00784313772, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r2.xyz, -|r1.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
add r4.z, -|r1.y|, r2.x
ge r1.z, r4.z, l(0.000000)
ge r2.xw, r1.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r2.xw, r2.xxxw, l(1.000000,0,0,1.000000), l(-1.000000,0,0,-1.000000)
mul r2.xy, r2.xwxx, r2.yzyy
movc r4.xy, r1.zzzz, r1.xyxx, r2.xyxx
dp3 r1.x, r4.xyzx, r4.xyzx
rsq r1.x, r1.x
mul r1.xyz, r1.xxxx, r4.xyzx
mad r1.xyz, r1.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mad r1.xyz, r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
dp3 r2.x, r1.xyzx, cb0[2].xyzx
dp3 r2.y, r1.xyzx, cb0[3].xyzx
dp3 r2.z, r1.xyzx, cb0[4].xyzx
dp3 r1.x, r3.xyzx, r3.xyzx
rsq r1.x, r1.x
mul r1.xyz, r1.xxxx, r3.xyzx
dp3 r1.w, r2.xyzx, r2.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r2.xyzx
dp3 r1.w, r1.xyzx, r2.xyzx
add r1.w, r1.w, r1.w
mad r1.xyz, r2.xyzx, -r1.wwww, r1.xyzx
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
lt r1.w, -r1.z, l(0.000000)
discard_nz r1.w
add r1.w, r0.z, cb0[7].z
div r1.w, cb0[7].w, r1.w
mad r1.xyz, r1.xyzx, r1.wwww, r3.xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb0[5].xyzw
dp4 r2.y, r1.xyzw, cb0[6].xyzw
dp4 r2.z, r1.xyzw, cb0[7].xyzw
dp4 r1.x, r1.xyzw, cb0[8].xyzw

mad r2.x, r7.x, r1.x, r2.x

div r1.xyz, r2.xyzx, r1.xxxx
mad r1.xyz, r1.xyzx, l(0.500000, -0.500000, 1.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r1.xyz, -r0.xyzx, r1.xyzx
mul r1.xyw, r1.xyxz, l(0.062500, 0.062500, 0.000000, 0.062500)
ftou r2.xy, v2.xyxx
ubfe r2.z, l(1), l(1), r2.x
iadd r2.w, -r2.z, l(1)
imul null, r2.z, r2.z, l(0x596ad1e2)
imad r2.z, l(0x7b48f3c0), r2.w, r2.z
bfi r2.x, l(1), l(4), r2.x, l(0)
bfi r2.x, l(2), l(2), r2.y, r2.x
ushr r2.x, r2.z, r2.x
ftoi r2.y, cb0[1].w
iadd r2.x, r2.y, r2.x
and r2.x, r2.x, l(15)
utof r2.x, r2.x
mul r2.x, r2.x, l(0.0666666701)
add r2.y, |r1.w|, |r1.w|
max r2.y, r2.y, l(0.000100)
mov r3.yzw, l(0,0,0,0)
mov r4.yzw, r0.xxyz
mov r2.z, l(0)
mov r2.w, r2.x
mov r4.x, l(1)
loop
  uge r5.x, r4.x, l(16)
  breakc_nz r5.x
  mad r5.xyz, r2.wwww, r1.xywx, r0.xyzx
  lt r6.xy, r5.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
  lt r6.zw, l(0.000000, 0.000000, 1.000000, 1.000000), r5.xxxy
  or r5.w, r6.z, r6.x
  or r5.w, r6.y, r5.w
  or r5.w, r6.w, r5.w
  mov r3.yzw, r5.xxyz
  breakc_nz r5.w
  sample_l_indexable(texture2d)(float,float,float,float) r5.w, r5.xyxx, t4.yzwx, s4, l(0.000000)
  lt r6.x, r5.w, r5.z
  add r5.w, r2.y, r5.w
  ge r5.w, r5.w, r5.z
  and r5.w, r5.w, r6.x
  mov r3.yzw, r5.xxyz
  mov r2.z, r5.w
  breakc_nz r5.w
  add r2.w, r2.w, l(1.000000)
  mov r4.yzw, r5.xxyz
  iadd r4.x, r4.x, l(1)
  mov r3.yzw, r5.xxyz
  mov r2.z, l(0)
endloop
add r1.xyw, r3.yzyw, r4.yzyw
mul r1.xyw, r1.xyxw, l(0.500000, 0.500000, 0.000000, 0.500000)
sample_l_indexable(texture2d)(float,float,float,float) r0.x, r1.xyxx, t4.xyzw, s4, l(0.000000)
lt r0.y, r0.x, r1.w
add r0.x, r2.y, r0.x
ge r0.x, r0.x, r1.w
and r0.x, r0.x, r0.y
movc r4.xyz, r0.xxxx, r4.yzwy, r1.xywx
movc r1.xyw, r0.xxxx, r1.xyxw, r3.yzyw
add r5.xyz, r4.xyzx, r1.xywx
mul r5.xyz, r5.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.x, r5.xyxx, t4.xyzw, s4, l(0.000000)
lt r0.y, r0.x, r5.z
add r0.x, r2.y, r0.x
ge r0.x, r0.x, r5.z
and r0.x, r0.x, r0.y
movc r4.xyz, r0.xxxx, r4.xyzx, r5.xyzx
movc r1.xyw, r0.xxxx, r5.xyxz, r1.xyxw
add r5.xyz, r4.xyzx, r1.xywx
mul r5.xyz, r5.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.x, r5.xyxx, t4.xyzw, s4, l(0.000000)
lt r0.y, r0.x, r5.z
add r0.x, r2.y, r0.x
ge r0.x, r0.x, r5.z
and r0.x, r0.x, r0.y
movc r4.xyz, r0.xxxx, r4.xyzx, r5.xyzx
movc r1.xyw, r0.xxxx, r5.xyxz, r1.xyxw
add r4.xyz, r4.xyzx, r1.xywx
mul r4.xyz, r4.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.x, r4.xyxx, t4.xyzw, s4, l(0.000000)
lt r0.y, r0.x, r4.z
add r0.x, r2.y, r0.x
ge r2.x, r0.x, r4.z
and r0.y, r0.y, r2.x
movc r4.yzw, r0.yyyy, r4.xxyz, r1.xxyw
ge r4.x, r0.x, r4.w
mov r3.x, l(0)
movc r2.xyzw, r2.zzzz, r4.xyzw, r3.xyzw
not r0.x, r2.x
mad r1.xy, r2.yzyy, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)

//Sides of the screen.
mad r7.w, r7.y, r9.w, l(-1.0)
mad r1.x, r7.x, r7.w, r1.x

max r0.y, |r1.y|, |r1.x|
add r0.y, r0.y, l(-0.800000)
mul_sat r0.y, r0.y, l(5.00000048)
mad r1.x, r0.y, l(-2.000000), l(3.000000)
mul r0.y, r0.y, r0.y
mad r0.y, -r1.x, r0.y, l(1.000000)
add r0.z, -r0.z, r2.w
add r1.x, r1.z, l(1.000000012E-07)
div_sat r0.z, r0.z, r1.x
add r0.z, -r0.z, l(1.000000)
mul r1.w, r0.z, r0.y
mad r3.xyz, r2.yzwy, l(2.000000, -2.000000, 1.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mov r3.w, l(1.000000)
dp4 r4.x, r3.xyzw, cb0[9].xyzw
dp4 r4.y, r3.xyzw, cb0[10].xyzw
dp4 r4.z, r3.xyzw, cb0[11].xyzw
dp4 r0.y, r3.xyzw, cb0[12].xyzw
div r3.xyz, r4.xyzx, r0.yyyy
add r3.xyz, r3.xyzx, cb0[13].xyzx
add r3.xyz, r3.xyzx, -cb0[14].xyzx
mov r3.w, l(1.000000)
dp4 r4.x, r3.xyzw, cb0[15].xyzw
dp4 r4.y, r3.xyzw, cb0[16].xyzw
dp4 r0.y, r3.xyzw, cb0[17].xyzw
div r0.yz, r4.xxyx, r0.yyyy
mad r3.xy, r0.yzyy, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r0.y, r2.w, cb0[7].z
div r0.y, cb0[7].w, r0.y
add r3.z, -r3.y, l(1.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r3.xzxx, t5.yzxw, s5, l(0.000000)
add r0.z, r0.z, cb0[7].z
div r0.z, cb0[7].w, r0.z
add r0.y, -r0.z, r0.y
lt r0.y, l(20.000000), |r0.y|
and r0.y, r0.y, r2.x
discard_nz r0.y
sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r3.xzxx, t6.xyzw, s6, l(0.000000)
discard_nz r0.x
movc r1.xyzw, r2.xxxx, r1.xyzw, l(0,0,0,1.000000)
mul r0.x, r0.w, r0.w
mul r0.x, r0.x, r1.w
mul r0.x, r0.x, cb0[1].x
and o0.w, r0.x, r2.x
mov o0.xyz, r1.xyzx
ret
// Approximately 207 instruction slots used
