// MANUALLY DUMPED [ShaderRegexLightingPS1nospec] Exception. Distant objects in fog of chapter 10.
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Wed Oct  6 21:35:26 2021
//
//
// Buffer Definitions:
//
// cbuffer fblock
// {
//
//   float4 renderpositiontoviewtexture;// Index:    0.xyzw           Components:     4
//   float4 lightprepassinverseparams;  // Index:    1.xyzw           Components:     4
//   float4 prevviewposition;           // Index:    2.xyzw           Components:     4
//   float4 prevviewprojectionmatrixrcx;// Index:    3.xyzw           Components:     4
//   float4 prevviewprojectionmatrixrcy;// Index:    4.xyzw           Components:     4
//   float4 prevviewprojectionmatrixrcw;// Index:    5.xyzw           Components:     4
//   float4 texsize;                    // Index:    6.xyzw           Components:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// viewdepthmap_samp_state           sampler      NA          NA    0        1
// tex3_samp_state                   sampler      NA          NA    1        1
// tex0_samp_state                   sampler      NA          NA    2        1
// tex1_samp_state                   sampler      NA          NA    3        1
// viewdepthmap_samp                 texture  float4          2d    0        1
// tex3_samp                         texture  float4          2d    1        1
// tex0_samp                         texture  float4          2d    2        1
// tex1_samp                         texture  float4          2d    3        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[7], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, 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_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 26
dcl_resource_texture2d (float,float,float,float) t125
dcl_constantbuffer cb13[10], immediateIndexed
mad r0.xy, v2.xyxx, cb0[0].zwzz, cb0[0].xyxx
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r0.xyxx, t0.yzxw, s0, l(0.000000)
ld_indexable(texture2d)(float,float,float,float) r12.xyzw, l(0, 0, 0, 0), t125.xyzw
add r14.xyzw, v0.xyzw, -v1.xyzw
//Comment.
mad r14.xyzw, r0.zzzz, r14.xyzw, v1.xyzw
mov r13.xyzw, v0.xyzw
mad r15.w, r12.y, r14.w, l(-1.0)
div r15.w, r15.w, r0.z
mul r15.x, r15.w, cb13[0].x
mul r15.y, r15.w, cb13[1].x
mul r15.z, r15.w, cb13[2].x
mad r13.xyz, r12.xxxx, r15.xyzx, r13.xyzx
add r1.xyzw, r13.xyzw, -v1.xyzw
mad r1.xyzw, r0.z, r1.xyzw, v1.xyzw

div r21.xyz, r14.xyzx, r14.wwww
add r21.xyz, r21.xyzx, cb0[1].xyzx
add r21.xyz, r21.xyzx, -cb0[2].xyzx
mov r21.w, l(1.000000)

div r1.xyz, r1.xyzx, r1.wwww
add r1.xyz, r1.xyzx, cb0[1].xyzx
add r1.xyz, r1.xyzx, -cb0[2].xyzx
mov r1.w, l(1.000000)
dp4 r2.x, r21.xyzw, cb0[3].xyzw
dp4 r2.y, r21.xyzw, cb0[4].xyzw
dp4 r0.w, r21.xyzw, cb0[5].xyzw
div r1.xy, r2.xyxx, r0.wwww
mad r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r2.xy, r0.xyxx, t1.xyzw, s1, l(0.000000)
lt r0.w, r2.x, l(1.000000)
add r1.z, -r1.y, l(1.000000)
add r1.xy, r0.xyxx, -r1.xzxx
movc r1.xy, r0.wwww, r2.xyxx, r1.xyxx
ne r1.zw, r1.xxxy, r1.xxxy
or r0.w, r1.w, r1.z
and r1.zw, r1.xxxy, l(0, 0, 0x7fffffff, 0x7fffffff)
ieq r1.zw, r1.zzzw, l(0, 0, 0x7f800000, 0x7f800000)
or r0.w, r0.w, r1.z
or r0.w, r1.w, r0.w
sample_l_indexable(texture2d)(float,float,float,float) r2.xyz, r0.xyxx, t2.xyzw, s2, l(0.000000)
dp3 r1.z, r2.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r1.z, r1.z, l(4.000000), l(4.000000)
div_sat r2.xyz, r2.xyzx, r1.zzzz
movc r1.xy, r0.wwww, l(-0.000000,-0.000000,0,0), -r1.xyxx
add r1.xy, r0.xyxx, r1.xyxx
mad r1.zw, r1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
ge r1.zw, |r1.zzzw|, l(0.000000, 0.000000, 1.000000, 1.000000)
or r0.w, r1.w, r1.z
ge r0.z, r0.z, l(1.000000)
or r0.z, r0.z, r0.w
mul r3.xyz, r2.xyzx, l(4.000000, 4.000000, 4.000000, 0.000000)
dp3 r0.w, r2.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.w, -r0.w, l(4.000000), l(1.000000)
div r3.xyz, r3.xyzx, r0.wwww
mov o0.xyz, r3.xyzx
mov o0.w, l(0)
retc_nz r0.z
movc r3.xyz, r0.zzzz, r3.xyzx, r2.xyzx
sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t3.xyzw, s3, l(0.000000)
dp3 r0.z, r1.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.z, r0.z, l(4.000000), l(4.000000)
div_sat r1.xyz, r1.xyzx, r0.zzzz
add r0.zw, r0.xxxy, -cb0[6].zzzw
sample_l_indexable(texture2d)(float,float,float,float) r4.xyz, r0.zwzz, t2.xyzw, s2, l(0.000000)
dp3 r0.z, r4.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.z, r0.z, l(4.000000), l(4.000000)
div_sat r4.xyz, r4.xyzx, r0.zzzz
mad r5.xyzw, cb0[6].zwzw, l(0.000000, -1.000000, 1.000000, -1.000000), r0.xyxy
sample_l_indexable(texture2d)(float,float,float,float) r6.xyz, r5.xyxx, t2.xyzw, s2, l(0.000000)
dp3 r0.z, r6.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.z, r0.z, l(4.000000), l(4.000000)
div_sat r6.xyz, r6.xyzx, r0.zzzz
sample_l_indexable(texture2d)(float,float,float,float) r5.xyz, r5.zwzz, t2.xyzw, s2, l(0.000000)
dp3 r0.z, r5.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.z, r0.z, l(4.000000), l(4.000000)
div_sat r5.xyz, r5.xyzx, r0.zzzz
mad r7.xyzw, cb0[6].zwzw, l(-1.000000, 0.000000, 1.000000, 0.000000), r0.xyxy
sample_l_indexable(texture2d)(float,float,float,float) r8.xyz, r7.xyxx, t2.xyzw, s2, l(0.000000)
dp3 r0.z, r8.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.z, r0.z, l(4.000000), l(4.000000)
div_sat r8.xyz, r8.xyzx, r0.zzzz
sample_l_indexable(texture2d)(float,float,float,float) r7.xyz, r7.zwzz, t2.xyzw, s2, l(0.000000)
dp3 r0.z, r7.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.z, r0.z, l(4.000000), l(4.000000)
div_sat r7.xyz, r7.xyzx, r0.zzzz
mad r9.xyzw, cb0[6].zwzw, l(-1.000000, 1.000000, 0.000000, 1.000000), r0.xyxy
sample_l_indexable(texture2d)(float,float,float,float) r10.xyz, r9.xyxx, t2.xyzw, s2, l(0.000000)
dp3 r0.z, r10.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.z, r0.z, l(4.000000), l(4.000000)
div_sat r10.xyz, r10.xyzx, r0.zzzz
sample_l_indexable(texture2d)(float,float,float,float) r9.xyz, r9.zwzz, t2.xyzw, s2, l(0.000000)
dp3 r0.z, r9.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.z, r0.z, l(4.000000), l(4.000000)
div_sat r9.xyz, r9.xyzx, r0.zzzz
add r0.xy, r0.xyxx, cb0[6].zwzz
sample_l_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t2.xyzw, s2, l(0.000000)
dp3 r0.w, r0.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.w, r0.w, l(4.000000), l(4.000000)
div_sat r0.xyz, r0.xyzx, r0.wwww
min r11.xyz, r4.xyzx, r6.xyzx
min r11.xyz, r5.xyzx, r11.xyzx
min r11.xyz, r8.xyzx, r11.xyzx
min r11.xyz, r2.xyzx, r11.xyzx
min r11.xyz, r7.xyzx, r11.xyzx
min r11.xyz, r10.xyzx, r11.xyzx
min r11.xyz, r9.xyzx, r11.xyzx
min r11.xyz, r0.xyzx, r11.xyzx
max r4.xyz, r4.xyzx, r6.xyzx
max r4.xyz, r5.xyzx, r4.xyzx
max r4.xyz, r8.xyzx, r4.xyzx
max r4.xyz, r2.xyzx, r4.xyzx
max r4.xyz, r7.xyzx, r4.xyzx
max r4.xyz, r10.xyzx, r4.xyzx
max r4.xyz, r9.xyzx, r4.xyzx
max r0.xyz, r0.xyzx, r4.xyzx
min r4.xyz, r6.xyzx, r8.xyzx
min r4.xyz, r2.xyzx, r4.xyzx
min r4.xyz, r4.xyzx, r7.xyzx
min r4.xyz, r4.xyzx, r9.xyzx
max r5.xyz, r6.xyzx, r8.xyzx
max r2.xyz, r2.xyzx, r5.xyzx
max r2.xyz, r2.xyzx, r7.xyzx
max r2.xyz, r2.xyzx, r9.xyzx
add r4.xyz, r4.xyzx, r11.xyzx
mul r4.xyz, r4.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
add r0.xyz, r0.xyzx, r2.xyzx
mad r2.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r4.xyzx
mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), -r4.xyzx
mul r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
mad r4.xyz, -r2.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r1.xyzx
div r0.xyz, r4.xyzx, r0.xyzx
max r0.y, |r0.z|, |r0.y|
max r0.x, r0.y, |r0.x|
lt r0.y, l(1.000000), r0.x
div r0.xzw, r4.xxyz, r0.xxxx
mad r0.xzw, r2.xxyz, l(0.500000, 0.000000, 0.500000, 0.500000), r0.xxzw
movc r0.xyz, r0.yyyy, r0.xzwx, r1.xyzx
add r0.xyz, -r3.xyzx, r0.xyzx
mad r0.xyz, r0.xyzx, l(0.750000, 0.750000, 0.750000, 0.000000), r3.xyzx
mul r1.xyz, r0.xyzx, l(4.000000, 4.000000, 4.000000, 0.000000)
dp3 r0.x, r0.xyzx, l(0.212600, 0.715200, 0.072200, 0.000000)
mad r0.x, -r0.x, l(4.000000), l(1.000000)
div r0.xyz, r1.xyzx, r0.xxxx
ne r1.xyz, r0.xyzx, r0.xyzx
or r0.w, r1.y, r1.x
or r0.w, r1.z, r0.w
and r1.xyz, r0.xyzx, l(0x7fffffff, 0x7fffffff, 0x7fffffff, 0)
ieq r1.xyz, r1.xyzx, l(0x7f800000, 0x7f800000, 0x7f800000, 0)
or r0.w, r0.w, r1.x
or r0.w, r1.y, r0.w
or r0.w, r1.z, r0.w
movc r0.xyz, r0.wwww, l(0,0,0,0), r0.xyzx
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min o0.xyz, r0.xyzx, l(1024.000000, 1024.000000, 1024.000000, 0.000000)
mov o0.w, l(0.750000)
ret
// Approximately 141 instruction slots used
