// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.63 on Sun Oct  9 13:50:46 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   xyzw
// 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 t14, 24
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) t60
dcl_resource_texture2d (float,float,float,float) t62
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.xyzw
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
frc r0.y, r0.z
add r0.y, -r0.y, l(0.500000)
add r0.y, -|r0.y|, l(0.500000)
mul r0.y, r0.y, l(3.33333325)
min r0.y, r0.y, l(1.000000)
mad r0.y, r0.y, l(3.14159274), l(-1.57079637)
sincos r0.y, null, r0.y
mad r0.y, r0.y, l(0.500000), l(0.500000)
ge r0.w, l(4.093169975E-21), r0.y
discard_nz r0.w
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.xy, cb2[76].w, l(340), t7.xyxx
eq r1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
and r0.w, r1.w, r1.z
if_z r0.w
  ftoi r2.xy, v0.xyxx
  mov r2.zw, l(0,0,0,0)
  ld_indexable(texture2d)(float,float,float,float) r1.zw, r2.xyzw, t21.zwxy
  mad r1.zw, r1.zzzw, l(0.000000, 0.000000, 8.000000, 8.000000), v0.xxxy
  mul r1.zw, r1.zzzw, cb3[32].zzzw
  sample_l_indexable(texture2d)(float,float,float,float) r0.w, r1.zwzz, t20.yzwx, s6, l(0.000000)
  add r0.w, r0.w, v4.z
  lt r1.z, l(0.000000), r1.y
  div r1.y, l(1.000000, 1.000000, 1.000000, 1.000000), r1.y
  and r1.y, r1.y, r1.z
  div r1.x, r0.w, r1.x
  min r1.x, |r1.x|, l(1.000000)
  mul r1.z, r1.x, r1.x
  mad r1.x, -r1.x, l(2.000000), l(3.000000)
  mul r1.x, r1.x, r1.z
  mul r0.w, r0.w, r1.y
  min r0.w, |r0.w|, l(1.000000)
  mul r1.y, r0.w, r0.w
  mad r0.w, -r0.w, l(2.000000), l(3.000000)
  mad r0.w, -r1.y, r0.w, l(1.000000)
  mul r0.w, r0.w, r1.x
else
  mov r0.w, l(1.000000)
endif
mul_sat r0.y, r0.w, r0.y
lt r0.w, r0.y, l(0.040450)
mul r1.x, r0.y, l(0.0773993805)
add r0.y, r0.y, l(0.055000)
mul r0.y, r0.y, l(0.947867334)
log r0.y, r0.y
mul r0.y, r0.y, l(2.400000)
exp r0.y, r0.y
movc r0.y, r0.w, r1.x, r0.y
ge r0.w, l(4.093169975E-21), r0.y
discard_nz r0.w
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.xyz, cb2[76].w, l(108), t7.xyzx
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r2.xyz, cb2[76].w, l(140), t7.xyzx
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r0.w, cb2[76].w, l(300), t7.xxxx
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.w, cb2[76].w, l(316), t7.xxxx
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r3.xyzw, cb2[76].w, l(412), t7.xyzw
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r4.xyzw, cb2[76].w, l(468), t7.xyzw
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r2.w, cb2[76].w, l(484), t7.xxxx
ftoi r5.xy, v5.xyxx
and r6.xyz, r0.wwww, l(4096, 512, 128, 0)
mad r7.xyzw, v7.zzzz, l(33.000000, 33.000000, 45.000000, 45.000000), v7.xxxx
movc r7.xyzw, r6.xxxx, r1.wwww, r7.xyzw
mad r7.xyzw, r7.xyzw, l(-0.300000, 0.500000, -0.300000, 2.000000), r0.xzxz
mov_sat r3.xyzw, r3.xyzw
mov r0.x, l(1.000000)
mov r0.w, v6.w
movc r8.xyzw, r6.yyyy, r0.xxxw, v6.xyzw
mul r8.w, r0.y, r8.w
mul r0.xyzw, r3.xyzw, r8.xyzw
mad r1.w, v7.z, l(2.000000), l(-1.000000)
switch r4.z
  case l(0)
  mov r3.x, l(0)
  break
  case l(1)
  mov r3.x, v7.y
  break
  case l(2)
  lt r3.y, l(0.000010), |r4.w|
  lt r3.z, l(0.000000), r4.w
  lt r3.w, r4.w, l(0.000000)
  iadd r3.z, -r3.z, r3.w
  itof r3.z, r3.z
  mul r3.z, r3.z, l(0.000100)
  movc r3.y, r3.y, r4.w, r3.z
  mul r3.z, r3.y, v7.y
  exp r3.z, r3.z
  exp r3.y, r3.y
  add r3.yz, r3.yyzy, l(0.000000, -1.000000, -1.000000, 0.000000)
  div r3.y, l(1.000000, 1.000000, 1.000000, 1.000000), r3.y
  mul r3.y, r3.y, r3.z
  max r3.x, r3.y, l(0.000000)
  break
  case l(3)
  add r3.y, |r4.w|, l(6.000000)
  add r3.z, -v7.y, l(0.500000)
  mul r3.y, r3.z, r3.y
  exp r3.y, r3.y
  add r3.y, r3.y, l(1.000000)
  div r3.x, l(1.000000, 1.000000, 1.000000, 1.000000), r3.y
  break
  default
  mov r3.x, l(0)
  break
endswitch
add r3.y, -r4.x, r4.y
mad r3.x, r3.x, r3.y, r4.x
lt r3.y, l(0.000000), r2.w
mul r2.w, r2.w, r3.x
mad r1.w, r2.w, r1.w, r3.x
movc r1.w, r3.y, r1.w, r3.x
utof r3.x, r5.x
mul r2.w, r1.x, r3.x
round_ni r3.y, r2.w
mad r3.yw, r7.xxxy, l(0.000000, 0.600000, 0.000000, 0.200000), r3.xxxy
mul r3.yw, r1.yyyz, r3.yyyw
sample_indexable(texture2d)(float,float,float,float) r2.w, r3.ywyy, t60.yzwx, s2
if_nz r6.z
  utof r4.x, r5.y
  mul r1.x, r1.x, r4.x
  round_ni r4.y, r1.x
  mad r3.yw, r7.xxxy, l(0.000000, 0.600000, 0.000000, 0.200000), r4.xxxy
  mul r1.xy, r1.yzyy, r3.ywyy
  sample_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t60.xyzw, s2
  add r1.x, -r2.w, r1.x
  mad r2.w, v5.z, r1.x, r2.w
endif
ne r1.x, r1.w, l(0.000000)
mul r1.y, r1.w, r2.w
exp r1.y, r1.y
exp r1.z, r1.w
add r1.yz, r1.yyzy, l(0.000000, -1.000000, -1.000000, 0.000000)
div r1.z, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z
mul r1.y, r1.z, r1.y
max r1.y, r1.y, l(0.000000)
movc r1.y, r1.x, r1.y, r2.w
mul r0.w, r0.w, r1.y
mul r1.y, r2.x, r3.x
round_ni r3.z, r1.y
mad r3.xy, r7.zwzz, l(0.300000, 0.200000, 0.000000, 0.000000), r3.xzxx
mul r3.xy, r2.yzyy, r3.xyxx
sample_indexable(texture2d)(float,float,float,float) r1.y, r3.xyxx, t62.yxzw, s2
if_nz r6.z
  utof r3.x, r5.y
  mul r2.x, r2.x, r3.x
  round_ni r3.y, r2.x
  mad r2.xw, r7.zzzw, l(0.300000, 0.000000, 0.000000, 0.200000), r3.xxxy
  mul r2.xy, r2.yzyy, r2.xwxx
  sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t62.xyzw, s2
  add r2.x, -r1.y, r2.x
  mad r1.y, v5.z, r2.x, r1.y
endif
mul r2.x, v7.w, v7.w
mul r2.x, r2.x, r2.x
mul r2.x, r2.x, v7.w
min r2.x, r2.x, l(0.999000)
add r1.y, r1.y, -r2.x
add r2.x, -r2.x, l(1.000000)
div_sat r1.y, r1.y, r2.x
mul r1.w, r1.w, r1.y
exp r1.w, r1.w
add r1.w, r1.w, l(-1.000000)
mul r1.z, r1.z, r1.w
max r1.z, r1.z, l(0.000000)
movc r1.x, r1.x, r1.z, r1.y
mul r0.w, r0.w, r1.x
ge r1.x, l(4.093169975E-21), r0.w
discard_nz r1.x
if_nz r6.y
  ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.x, cb2[76].w, l(1036), t7.xxxx
  ine r1.y, r1.x, l(-2)
  if_nz r1.y
    mov_sat r0.x, r0.x
    ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r2.xyzw, r1.x, l(0), t14.xyzw
    ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r3.xy, r1.x, l(16), t14.xyxx
    utof r1.x, r1.x
    add r1.x, r1.x, l(0.500000)
    mul r0.y, r1.x, l(0.000976562500)
    sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r0.xyxx, t16.xyzw, s0, l(0.000000)
    mov r3.z, r2.w
    mad r0.xyz, r2.xyzx, r1.xyzx, r3.zxyz
  else
    ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r0.xyz, cb2[76].w, l(1084), t7.xyzx
  endif
endif
ftou r1.xy, v0.xyxx
sqrt r2.xyzw, r0.xyzx
mul r0.xyz, r2.xywx, l(0.250000, 0.500000, -0.250000, 0.000000)
add r0.xy, r0.yyyy, r0.xzxx
mad r3.x, r2.z, l(0.250000), r0.x
dp2 r3.y, r2.wzww, l(0.500000, -0.500000, 0.000000, 0.000000)
mad r3.z, r2.z, l(-0.250000), r0.y
and r0.xy, r1.xyxx, l(1, 1, 0, 0)
ine r0.x, r0.y, r0.x
movc r0.xy, r0.xxxx, r3.xyxx, r3.xzxx
add o0.xy, r0.xyxx, l(0.000000, 0.498039216, 0.000000, 0.000000)
mov o0.z, l(0)
mov o0.w, r0.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, r0.w
mov o2.xyzw, l(1.000000,0,0.600000,0)
ret
// Approximately 0 instruction slots used
