// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.63 on Sun Oct  9 13:51:20 2022
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy
// POSITION                 0   xyz         1     NONE   float
// NORMAL                   0   xyz         2     NONE   float   xyz
// TEXCOORD                 0   xy          3     NONE   float
// TEXCOORD                 1   xyz         4     NONE   float     z
// COLOR                    0   xyzw        5     NONE   float   xyz
// COLOR                    1   xyzw        6     NONE   float   xyzw
// TEXCOORD                 2   xyzw        7     NONE   float   xyz
// TEXCOORD                 3   x           8     NONE    uint
// TEXCOORD                 4    y          8     NONE    uint    y
// TEXCOORD                 7   xyz         9     NONE   float
// TEXCOORD                 8   xyz        10     NONE   float
// TEXCOORD                 9   xyz        11     NONE   float
// TEXCOORD                10   xyz        12     NONE   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
// SV_Target                2   xyzw        2   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB2[77], immediateIndexed
dcl_constantbuffer CB3[33], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s2, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_resource_structured t7, 1100
dcl_resource_structured t9, 64
dcl_resource_structured t13, 8
dcl_resource_structured t14, 24
dcl_resource_texture2d (float,float,float,float) t15
dcl_resource_texture2d (float,float,float,float) t16
dcl_resource_texture2d (float,float,float,float) t20
dcl_resource_texture2d (float,float,float,float) t21
dcl_resource_texture2d (float,float,float,float) t22
dcl_resource_texture2d (float,float,float,float) t63
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v2.xyz
dcl_input_ps linear v4.z
dcl_input_ps constant v5.xyz
dcl_input_ps linear v6.xyzw
dcl_input_ps linear v7.xyz
dcl_input_ps constant v8.y
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_temps 50
dcl_resource_buffer (float,float,float,float) t125
ld_indexable(buffer)(float,float,float,float) r40.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r0.xyzw, v8.y, l(0), t9.xyzw
ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r1.xyzw, v8.y, l(16), t9.xyzw
ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r2.xyzw, v8.y, l(32), t9.xyzw
mul r3.xy, v0.xyxx, cb3[32].zwzz
mad r4.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r3.z, r3.xyxx, t22.yzxw, s5
mov r4.z, -r4.y
mul r3.xy, r3.zzzz, r4.xzxx
mov r3.w, l(1.000000)
add r40.w, r3.z, -r40.y
mad r3.x, -r40.x, r40.w, r3.x
dp4 r4.x, r3.xyzw, cb3[12].xyzw
dp4 r4.y, r3.xyzw, cb3[13].xyzw
dp4 r4.z, r3.xyzw, cb3[14].xyzw
mov r4.w, l(1.000000)
dp4 r0.x, r4.xyzw, r0.xyzw
dp4 r0.y, r4.xyzw, r1.xyzw
dp4 r0.z, r4.xyzw, r2.xyzw
add r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
lt r1.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
or r0.w, r1.y, r1.x
lt r1.xyw, l(1.000000, 1.000000, 0.000000, 1.000000), r0.xyxz
or r0.y, r0.w, r1.x
or r0.y, r1.y, r0.y
or r0.y, r1.w, r0.y
or r0.y, r1.z, r0.y
discard_nz r0.y
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.xyz, cb2[76].w, l(156), t7.xyzx
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r0.y, cb2[76].w, l(300), t7.xxxx
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r0.w, cb2[76].w, l(316), t7.xxxx
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.w, cb2[76].w, l(1028), t7.xxxx
ftoi r2.x, v5.x
and r2.yz, r0.yyyy, l(0, 4096, 128, 0)
mad r2.w, v7.z, l(100.000000), v7.x
movc r0.w, r2.y, r0.w, r2.w
mad r2.yw, r0.wwww, l(0.000000, -0.000000, 0.000000, 1.000000), r0.xxxz
utof r3.x, r2.x
mul r0.w, r1.x, r3.x
round_ni r3.y, r0.w
mad r3.xy, r2.ywyy, l(0.300000, 0.300000, 0.000000, 0.000000), r3.xyxx
mul r3.xy, r1.yzyy, r3.xyxx
sample_indexable(texture2d)(float,float,float,float) r3.xy, r3.xyxx, t63.xyzw, s2
if_nz r2.z
  ftoi r0.w, v5.y
  utof r4.x, r0.w
  mul r0.w, r1.x, r4.x
  round_ni r4.y, r0.w
  mad r2.xy, r2.ywyy, l(0.300000, 0.300000, 0.000000, 0.000000), r4.xyxx
  mul r1.xy, r1.yzyy, r2.xyxx
  sample_indexable(texture2d)(float,float,float,float) r1.xy, r1.xyxx, t63.xyzw, s2
  add r1.xy, -r3.xyxx, r1.xyxx
  mad r3.xy, v5.zzzz, r1.xyxx, r3.xyxx
endif
mad r1.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r1.xy, r1.xyxx, l(-0.300000, 0.300000, 0.000000, 0.000000)
ieq r2.xy, r1.wwww, l(-2, -3, 0, 0)
or r0.w, r2.y, r2.x
if_z r0.w
  ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r2.yz, r1.w, l(0), t13.xxyx
  utof r0.w, r1.w
  add r0.w, r0.w, l(0.500000)
  mul r3.y, r0.w, l(0.000244140625)
  mov r3.x, v7.y
  sample_l_indexable(texture2d)(float,float,float,float) r0.w, r3.xyxx, t15.yzwx, s0, l(0.000000)
  mad r0.w, r2.y, r0.w, r2.z
else
  ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.z, cb2[76].w, l(1076), t7.xxxx
  f16tof32 r1.w, r1.z
  ushr r1.z, r1.z, l(16)
  f16tof32 r1.z, r1.z
  mov_sat r2.y, v7.y
  add r1.z, -r1.w, r1.z
  mad r1.z, r2.y, r1.z, r1.w
  movc r0.w, r2.x, r1.w, r1.z
endif
mad r0.xz, r1.xxyx, r0.wwww, r0.xxzx
frc r0.xz, r0.xxzx
mad r0.xz, r0.xxzx, l(2.000000, 0.000000, 2.000000, 0.000000), l(-1.000000, 0.000000, -1.000000, 0.000000)
dp2 r0.x, r0.xzxx, r0.xzxx
sqrt r0.x, r0.x
add r0.x, -r0.x, l(0.934082)
ge r0.z, l(2.865218942E-21), r0.x
discard_nz r0.z
mul r0.x, r0.x, l(1.42857146)
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r0.zw, cb2[76].w, l(340), t7.xxxy
eq r1.xy, r0.zwzz, l(0.000000, 0.000000, 0.000000, 0.000000)
and r1.x, r1.y, r1.x
if_z r1.x
  ftoi r1.xy, v0.xyxx
  mov r1.zw, l(0,0,0,0)
  ld_indexable(texture2d)(float,float,float,float) r1.xy, r1.xyzw, t21.xyzw
  mad r1.xy, r1.xyxx, l(8.000000, 8.000000, 0.000000, 0.000000), v0.xyxx
  mul r1.xy, r1.xyxx, cb3[32].zwzz
  sample_l_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t20.xyzw, s6, l(0.000000)
  add r1.x, r1.x, v4.z
  lt r1.y, l(0.000000), r0.w
  div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
  and r0.w, r0.w, r1.y
  div r0.z, r1.x, r0.z
  min r0.z, |r0.z|, l(1.000000)
  mul r1.y, r0.z, r0.z
  mad r0.z, -r0.z, l(2.000000), l(3.000000)
  mul r0.zw, r0.zzzw, r1.yyyx
  min r0.w, |r0.w|, l(1.000000)
  mul r1.x, r0.w, r0.w
  mad r0.w, -r0.w, l(2.000000), l(3.000000)
  mad r0.w, -r1.x, r0.w, l(1.000000)
  mul r0.z, r0.w, r0.z
else
  mov r0.z, l(1.000000)
endif
mul_sat r0.x, r0.z, r0.x
lt r0.z, r0.x, l(0.040450)
mul r0.w, r0.x, l(0.0773993805)
add r0.x, r0.x, l(0.055000)
mul r0.x, r0.x, l(0.947867334)
log r0.x, r0.x
mul r0.x, r0.x, l(2.400000)
exp r0.x, r0.x
movc r0.x, r0.z, r0.w, r0.x
ge r0.z, l(4.093169975E-21), r0.x
discard_nz r0.z
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.xyzw, cb2[76].w, l(412), t7.xyzw
mov_sat r1.xyzw, r1.xyzw
and r0.y, r0.y, l(512)
mov r2.x, l(1.000000)
mov r2.w, v6.w
movc r2.xyzw, r0.yyyy, r2.xxxw, v6.xyzw
mul r2.w, r0.x, r2.w
mul r1.xyzw, r1.xyzw, r2.xyzw
ge r0.x, l(4.093169975E-21), r1.w
discard_nz r0.x
if_nz r0.y
  ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r0.x, cb2[76].w, l(1036), t7.xxxx
  ine r0.y, r0.x, l(-2)
  if_nz r0.y
    mov_sat r1.x, r1.x
    ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r2.xyzw, r0.x, l(0), t14.xyzw
    ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r3.xy, r0.x, l(16), t14.xyxx
    utof r0.x, r0.x
    add r0.x, r0.x, l(0.500000)
    mul r1.y, r0.x, l(0.000976562500)
    sample_l_indexable(texture2d)(float,float,float,float) r0.xyz, r1.xyxx, t16.xyzw, s0, l(0.000000)
    mov r3.z, r2.w
    mad r1.xyz, r2.xyzx, r0.xyzx, r3.zxyz
  else
    ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.xyz, cb2[76].w, l(1084), t7.xyzx
  endif
endif
ftou r0.xy, v0.xyxx
sqrt r2.xyzw, r1.xyzx
mul r1.xyz, r2.xywx, l(0.250000, 0.500000, -0.250000, 0.000000)
add r0.zw, r1.yyyy, r1.xxxz
mad r1.x, r2.z, l(0.250000), r0.z
dp2 r1.y, r2.wzww, l(0.500000, -0.500000, 0.000000, 0.000000)
mad r1.z, r2.z, l(-0.250000), r0.w
and r0.xy, r0.xyxx, l(1, 1, 0, 0)
ine r0.x, r0.y, r0.x
movc r0.xy, r0.xxxx, r1.xyxx, r1.xzxx
add o0.xy, r0.xyxx, l(0.000000, 0.498039216, 0.000000, 0.000000)
mov o0.z, l(0)
mov o0.w, r1.w
mad o1.xyz, v2.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mov o1.w, r1.w
mov o2.xyzw, l(1.000000,0,0.353000,0)
ret
// Approximately 0 instruction slots used
