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