//whats this
// MANUALLY DUMPED [ShaderRegex\ShaderFixes\ShaderRegEx_UE4_UNIVERSAL2_C44.ini\_09_Lights2CS][ShaderRegex\ShaderFixes\ShaderRegEx_UE4_UNIVERSAL2_C44.ini\_17_LightPosFix3CS]
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Thu Sep 23 17:04:34 2021
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[21], immediateIndexed
dcl_constantbuffer cb1[63], immediateIndexed
dcl_constantbuffer cb2[256], dynamicIndexed
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_uav_typed_texture3d (float,float,float,float) u0
dcl_input vThreadID.xy
dcl_temps 20
dcl_indexableTemp x0[11], 4
dcl_thread_group 8, 8, 1
dcl_resource_texture2d (float,float,float,float) t125
mov r0.xy, vThreadID.xyxx
mov r0.zw, l(0,0,2,2)
ld_indexable(texture2d)(float,float,float,float) r1.x, r0.xyww, t0.xyzw
ld_indexable(texture2d)(float,float,float,float) r1.z, r0.xyww, t1.zyxw
iadd r2.xy, -cb0[19].xyxx, cb0[19].zwzz
utof r2.xy, r2.xyxx
mul r2.zw, r2.xxxy, l(0.000000, 0.000000, 0.062500, 0.062500)
utof r3.xy, vThreadID.xyxx
mad r3.xy, r2.xyxx, l(0.062500, 0.062500, 0.000000, 0.000000), -r3.xyxx
mul r4.y, r2.z, cb1[24].x
mul r4.x, r2.w, -cb1[25].y
mad r4.zw, cb1[26].xxxy, r2.zzzw, r3.xxxy
add r3.xyzw, -r4.yzxw, l(0.000000, 1.000000, 0.000000, 1.000000)
mov r5.w, -r1.x
dp2 r1.w, r3.xyxx, r3.xyxx
sqrt r1.w, r1.w
rcp r1.w, r1.w
mul r2.zw, r1.wwww, r3.xxxy
dp2 r1.w, r4.yzyy, r4.yzyy
sqrt r1.w, r1.w
rcp r1.w, r1.w
mul r3.xy, r1.wwww, r4.yzyy
dp2 r1.w, r3.zwzz, r3.zwzz
sqrt r1.w, r1.w
rcp r1.w, r1.w
mul r3.zw, r1.wwww, r3.zzzw
dp2 r1.w, r4.xwxx, r4.xwxx
sqrt r1.w, r1.w
rcp r1.w, r1.w
mul r4.xy, r1.wwww, r4.xwxx
lt r1.w, cb1[27].w, l(1.000000)
movc r1.x, r1.w, r1.x, l(1.000000)
movc r1.w, r1.w, r1.z, l(1.000000)
ishl r6.xyzw, vThreadID.xyxy, l(3, 3, 3, 3)
utof r7.zw, r6.xxxy
iadd r4.zw, r6.zzzw, l(0, 0, 8, 8)
utof r7.xy, r4.zwzz
div r6.xyzw, r7.zwxw, r2.xyxy


ld_indexable(texture2d)(float,float,float,float) r15.xyzw, l(0, 0, 0, 0), t125.xyzw
//add r16.x, r1.x, -r15.y
mad r6.x, l(0.5), r15.x, r6.x


mad r6.xyzw, r6.xyzw, l(2.000000, -2.000000, 2.000000, -2.000000), l(-1.000000, 1.000000, -1.000000, 1.000000)



mul r8.xyzw, r1.xxxx, r6.xyzw
mul r6.xyzw, r1.wwww, r6.xyzw



mul r9.xyzw, r8.yyyy, cb1[45].xyzw
mad r9.xyzw, r8.xxxx, cb1[44].xyzw, r9.xyzw
mad r9.xyzw, r1.xxxx, cb1[46].xyzw, r9.xyzw
add r9.xyzw, r9.xyzw, cb1[47].xyzw
mul r10.xyz, r6.yyyy, cb1[45].xyzx
mad r10.xyz, r6.xxxx, cb1[44].xyzx, r10.xyzx
mad r10.xyz, r1.wwww, cb1[46].xyzx, r10.xyzx
add r10.xyz, r10.xyzx, cb1[47].xyzx
div r9.xyz, r9.xyzx, r9.wwww
div r10.xyz, r10.xyzx, r9.wwww
add r10.xyz, r9.xyzx, r10.xyzx


mul r11.xyzw, r8.wwww, cb1[45].xyzw
mad r8.xyzw, r8.zzzz, cb1[44].xyzw, r11.xyzw
mad r8.xyzw, r1.xxxx, cb1[46].xyzw, r8.xyzw
add r8.xyzw, r8.xyzw, cb1[47].xyzw
mul r6.xyw, r6.wwww, cb1[45].xyxz
mad r6.xyz, r6.zzzz, cb1[44].xyzx, r6.xywx
mad r6.xyz, r1.wwww, cb1[46].xyzx, r6.xyzx
add r6.xyz, r6.xyzx, cb1[47].xyzx
div r8.xyz, r8.xyzx, r8.wwww
div r6.xyz, r6.xyzx, r8.wwww


add r8.xyz, r8.xyzx, r10.xyzx
add r6.xyz, r6.xyzx, r8.xyzx
div r7.xyzw, r7.zyxy, r2.xyxy
mad r7.xyzw, r7.xyzw, l(2.000000, -2.000000, 2.000000, -2.000000), l(-1.000000, 1.000000, -1.000000, 1.000000)
mul r8.xyzw, r1.xxxx, r7.xyzw
mul r7.xyzw, r1.wwww, r7.xyzw

//StartLineForRemove
//Shader Fix 1/1

ld_indexable(texture2d)(float,float,float,float) r12.xyzw, l(0, 0, 0, 0), t125.xyzw
add r13.x, r1.x, -r12.y
mad r8.x, -r13.x, r12.x, r8.x
//Shader Fix 1/1

mul r10.xyzw, r8.yyyy, cb1[45].xyzw
mad r10.xyzw, r8.xxxx, cb1[44].xyzw, r10.xyzw
mad r10.xyzw, r1.xxxx, cb1[46].xyzw, r10.xyzw
add r10.xyzw, r10.xyzw, cb1[47].xyzw
mul r11.xyz, r7.yyyy, cb1[45].xyzx
mad r11.xyz, r7.xxxx, cb1[44].xyzx, r11.xyzx
mad r11.xyz, r1.wwww, cb1[46].xyzx, r11.xyzx
add r11.xyz, r11.xyzx, cb1[47].xyzx
div r10.xyz, r10.xyzx, r10.wwww
div r11.xyz, r11.xyzx, r10.wwww
add r6.xyz, r6.xyzx, r10.xyzx
add r6.xyz, r11.xyzx, r6.xyzx

mul r10.xyzw, r8.wwww, cb1[45].xyzw
mad r8.xyzw, r8.zzzz, cb1[44].xyzw, r10.xyzw
mad r8.xyzw, r1.xxxx, cb1[46].xyzw, r8.xyzw
add r8.xyzw, r8.xyzw, cb1[47].xyzw
mul r7.xyw, r7.wwww, cb1[45].xyxz
mad r7.xyz, r7.zzzz, cb1[44].xyzx, r7.xywx
mad r7.xyz, r1.wwww, cb1[46].xyzx, r7.xyzx
add r7.xyz, r7.xyzx, cb1[47].xyzx
div r8.xyz, r8.xyzx, r8.wwww
div r7.xyz, r7.xyzx, r8.wwww



add r6.xyz, r6.xyzx, r8.xyzx
add r6.xyz, r7.xyzx, r6.xyzx
mad r7.xyz, r6.xyzx, l(0.125000, 0.125000, 0.125000, 0.000000), -r9.xyzx
dp3 r1.x, r7.xyzx, r7.xyzx
sqrt r1.x, r1.x
mov r1.w, l(0)
mov r2.x, l(0)
loop
  uge r2.y, r2.x, cb0[20].x
  breakc_nz r2.y
  div r2.y, l(1.000000, 1.000000, 1.000000, 1.000000), cb2[r2.x + 0].w
  mad r7.xyz, -r6.xyzx, l(0.125000, 0.125000, 0.125000, 0.000000), cb2[r2.x + 0].xyzx
  dp3 r4.z, r7.xyzx, r7.xyzx
  sqrt r4.z, r4.z
  add r4.w, r1.x, r2.y
  lt r4.z, r4.w, r4.z
  if_nz r4.z
    iadd r4.z, r2.x, l(1)
    mov r2.x, r4.z
    continue
  endif
  add r7.xyz, cb1[62].xyzx, cb2[r2.x + 0].xyzx
  



ld_indexable(texture2d)(float,float,float,float) r12.xyzw, l(0, 0, 0, 0), t125.xyzw




  mul r8.xyz, r7.yyyy, cb1[9].xyzx
  mad r7.xyw, r7.xxxx, cb1[8].xyxz, r8.xyxz
  mad r7.xyz, r7.zzzz, cb1[10].xyzx, r7.xywx
  add r5.xyz, r7.xyzx, cb1[11].xyzx

//clipping fix
add r13.x, r5.z, -r12.y
mul r13.x, r5.z l(0.8)
mad r5.x, r13.x, r12.x, r5.x


  dp2 r4.z, r2.zwzz, r5.xzxx
  dp2 r4.w, r3.xyxx, r5.xzxx
  ge r4.zw, r4.zzzw, -r2.yyyy
  and r4.z, r4.w, r4.z
  dp2 r4.w, r3.zwzz, r5.yzyy
  ge r4.w, r4.w, -r2.y
  and r4.z, r4.w, r4.z
  dp2 r4.w, r4.xyxx, r5.yzyy
  ge r4.w, r4.w, -r2.y
  and r4.z, r4.w, r4.z
  if_nz r4.z
    dp2 r4.z, l(1.000000, 1.000000, 0.000000, 0.000000), r5.zwzz
    ge r4.z, r4.z, -r2.y
    mov r1.y, r5.z
    dp2 r1.y, l(-1.000000, 1.000000, 0.000000, 0.000000), r1.yzyy
    ge r1.y, r1.y, -r2.y
    and r1.y, r1.y, r4.z
    if_nz r1.y
      mov x0[r1.w + 0].x, r2.x
      iadd r1.w, r1.w, l(1)
    endif
  endif
  iadd r2.x, r2.x, l(1)
endloop
umin r1.xy, r1.wwww, l(11, 3, 0, 0)
utof r1.z, r1.x
mul r2.x, r1.z, l(0.00392156886)
ult r1.z, l(0), r1.y
mov r1.w, x0[0].x
utof r1.w, r1.w
mul r3.x, r1.w, l(0.00392156886)
mov r3.yw, l(0,1,0,2)
movc r4.xy, r1.zzzz, r3.xyxx, l(1.000000,0,0,0)
ult r1.z, r4.y, r1.y
mov r1.w, x0[1].x
utof r1.w, r1.w
mul r3.z, r1.w, l(0.00392156886)
mov r4.z, l(1.000000)
movc r3.xy, r1.zzzz, r3.zwzz, r4.zyzz
ult r1.y, r3.y, r1.y
and r1.y, r1.y, r1.z
mov r1.z, x0[2].x
utof r1.z, r1.z
mul r1.z, r1.z, l(0.00392156886)
movc r2.w, r1.y, r1.z, l(1.000000)
mov r5.xy, vThreadID.xyxx
mov r5.zw, l(0,0,0,0)
mov r2.y, r4.x
mov r2.z, r3.x
store_uav_typed u0.xyzw, r5.xyzw, r2.xyzw
uge r1.y, l(3), r1.x
if_nz r1.y
  ret
endif
iadd r1.y, r1.x, l(-3)
umin r1.y, r1.y, l(4)
ult r1.z, l(0), r1.y
mov r1.w, x0[3].x
utof r1.w, r1.w
mul r2.x, r1.w, l(0.00392156886)
mov r2.yw, l(0,1,0,2)
movc r3.xy, r1.zzzz, r2.xyxx, l(1.000000,0,0,0)
ult r1.z, r3.y, r1.y
mov r1.w, x0[4].x
utof r1.w, r1.w
mul r2.z, r1.w, l(0.00392156886)
mov r3.z, l(1.000000)
movc r2.xy, r1.zzzz, r2.wzww, r3.yzyy
ult r1.w, r2.x, r1.y
and r1.z, r1.w, r1.z
mov r1.w, x0[5].x
utof r1.w, r1.w
mul r4.x, r1.w, l(0.00392156886)
mov r4.yzw, l(0,3,1,1)
mov r2.z, l(1.000000)
movc r2.xz, r1.zzzz, r4.yyxy, r2.xxzx
ult r1.y, r2.x, r1.y
and r1.y, r1.y, r1.z
mov r1.z, x0[6].x
utof r1.z, r1.z
mul r1.z, r1.z, l(0.00392156886)
movc r2.w, r1.y, r1.z, l(1.000000)
mov r4.xy, vThreadID.xyxx
mov r2.x, r3.x
store_uav_typed u0.xyzw, r4.xyzw, r2.xyzw
uge r1.y, l(7), r1.x
if_nz r1.y
  ret
endif
iadd r1.x, r1.x, l(-7)
umin r1.x, r1.x, l(4)
ult r1.y, l(0), r1.x
mov r1.z, x0[7].x
utof r1.z, r1.z
mul r2.x, r1.z, l(0.00392156886)
mov r2.yw, l(0,1,0,2)
movc r3.xy, r1.yyyy, r2.xyxx, l(1.000000,0,0,0)
ult r1.y, r3.y, r1.x
mov r1.z, x0[8].x
utof r1.z, r1.z
mul r2.z, r1.z, l(0.00392156886)
mov r3.z, l(1.000000)
movc r2.xy, r1.yyyy, r2.wzww, r3.yzyy
ult r1.z, r2.x, r1.x
and r1.y, r1.z, r1.y
mov r1.z, x0[9].x
utof r1.z, r1.z
mul r4.x, r1.z, l(0.00392156886)
mov r4.y, l(3)
mov r2.z, l(1.000000)
movc r2.xz, r1.yyyy, r4.yyxy, r2.xxzx
ult r1.x, r2.x, r1.x
and r1.x, r1.x, r1.y
mov r1.y, x0[10].x
utof r1.y, r1.y
mul r1.y, r1.y, l(0.00392156886)
movc r2.w, r1.x, r1.y, l(1.000000)
mov r2.x, r3.x
store_uav_typed u0.xyzw, r0.xyzw, r2.xyzw
ret
// Approximately 0 instruction slots used
