// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.63 on Sun Oct  9 13:48:45 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    yzw
// 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.yzw
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) r0.yw, cb2[76].w, l(340), t7.xxxy
eq r1.xy, r0.ywyy, 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.y, r1.x, r0.y
  min r0.y, |r0.y|, l(1.000000)
  mul r1.y, r0.y, r0.y
  mad r0.y, -r0.y, l(2.000000), l(3.000000)
  mul r0.yw, r0.yyyw, 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.y, r0.w, r0.y
else
  mov r0.y, l(1.000000)
endif
mov_sat r0.y, 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) r3.xyzw, cb2[76].w, l(412), t7.xyzw
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r5.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
ftoi r6.xy, v5.xyxx
mov_sat r3.xyzw, r3.xyzw
and r6.zw, r0.wwww, l(0, 0, 512, 128)
mov r7.x, l(1.000000)
mov r7.w, v6.w
movc r7.xyzw, r6.zzzz, r7.xxxw, v6.xyzw
mul r7.w, r0.y, r7.w
mul r3.xyzw, r3.xyzw, r7.xyzw
mad r0.y, v7.z, l(2.000000), l(-1.000000)
switch r5.z
  case l(0)
  mov r0.w, l(0)
  break
  case l(1)
  mov r0.w, v7.y
  break
  case l(2)
  lt r2.w, l(0.000010), |r5.w|
  lt r4.w, l(0.000000), r5.w
  lt r5.z, r5.w, l(0.000000)
  iadd r4.w, -r4.w, r5.z
  itof r4.w, r4.w
  mul r4.w, r4.w, l(0.000100)
  movc r2.w, r2.w, r5.w, r4.w
  mul r4.w, r2.w, v7.y
  exp r4.w, r4.w
  add r4.w, r4.w, 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, r4.w
  max r0.w, r2.w, l(0.000000)
  break
  case l(3)
  add r2.w, |r5.w|, l(6.000000)
  add r4.w, -v7.y, l(0.500000)
  mul r2.w, r2.w, r4.w
  exp r2.w, r2.w
  add r2.w, r2.w, l(1.000000)
  div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
  break
  default
  mov r0.w, l(0)
  break
endswitch
add r2.w, -r5.x, r5.y
mad r0.w, r0.w, r2.w, r5.x
lt r2.w, l(0.000000), r1.w
mul r1.w, r1.w, r0.w
mad r0.y, r1.w, r0.y, r0.w
movc r0.y, r2.w, r0.y, r0.w
utof r5.x, r6.x
mul r0.w, r1.x, r5.x
round_ni r5.y, r0.w
add r5.yw, r0.xxxz, r5.xxxy
mul r5.yw, r1.yyyz, r5.yyyw
sample_indexable(texture2d)(float,float,float,float) r0.w, r5.ywyy, t60.yzwx, s2
if_nz r6.w
  utof r7.x, r6.y
  mul r1.x, r1.x, r7.x
  round_ni r7.y, r1.x
  add r1.xw, r0.xxxz, r7.xxxy
  mul r1.xy, r1.yzyy, r1.xwxx
  sample_indexable(texture2d)(float,float,float,float) r1.x, r1.xyxx, t60.xyzw, s2
  add r1.x, -r0.w, r1.x
  mad r0.w, v5.z, r1.x, r0.w
endif
ne r1.x, r0.y, l(0.000000)
mul r1.y, r0.y, r0.w
exp r1.y, r1.y
exp r1.z, r0.y
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 r0.w, r1.x, r1.y, r0.w
mul r0.w, r0.w, r3.w
mul r1.y, r2.x, r5.x
round_ni r5.z, r1.y
add r1.yw, r0.xxxz, r5.xxxz
mul r1.yw, r2.yyyz, r1.yyyw
sample_indexable(texture2d)(float,float,float,float) r1.y, r1.ywyy, t62.yxzw, s2
if_nz r6.w
  utof r5.x, r6.y
  mul r1.w, r2.x, r5.x
  round_ni r5.y, r1.w
  add r2.xw, r0.xxxz, r5.xxxy
  mul r2.xy, r2.yzyy, r2.xwxx
  sample_indexable(texture2d)(float,float,float,float) r1.w, r2.xyxx, t62.yzwx, s2
  add r1.w, -r1.y, r1.w
  mad r1.y, v5.z, r1.w, r1.y
endif
log r1.w, v7.w
mul r1.w, r1.w, l(4.468710)
exp r1.w, r1.w
min r1.w, r1.w, l(0.999000)
add r1.y, -r1.w, r1.y
add r1.w, -r1.w, l(1.000000)
div_sat r1.y, r1.y, r1.w
mul r0.y, r0.y, r1.y
exp r0.y, r0.y
add r0.y, r0.y, l(-1.000000)
mul r0.y, r1.z, r0.y
max r0.y, r0.y, l(0.000000)
movc r0.y, r1.x, r0.y, r1.y
mul r0.y, r0.y, r0.w
ge r0.w, l(4.093169975E-21), r0.y
discard_nz r0.w
if_nz r6.z
  ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r0.w, cb2[76].w, l(1036), t7.xxxx
  ine r1.x, r0.w, l(-2)
  if_nz r1.x
    mov_sat r3.x, r3.x
    ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r1.xyzw, r0.w, l(0), t14.xyzw
    ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r2.xy, r0.w, l(16), t14.xyxx
    utof r0.w, r0.w
    add r0.w, r0.w, l(0.500000)
    mul r3.y, r0.w, l(0.000976562500)
    sample_l_indexable(texture2d)(float,float,float,float) r5.xyz, r3.xyxx, t16.xyzw, s0, l(0.000000)
    mov r2.z, r1.w
    mad r3.xyz, r1.xyzx, r5.xyzx, r2.zxyz
  else
    ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r3.xyz, cb2[76].w, l(1084), t7.xyzx
  endif
endif
mad r1.xy, r0.xzxx, 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.830994, 0.830994, 0.000000, 0.000000)
dp2 r0.w, r1.xyxx, r1.xyxx
sqrt r0.w, r0.w
sqrt r0.w, r0.w
add r1.z, -r0.w, l(1.000000)
mov r1.w, -r1.y
dp3 r0.w, r1.xzwx, r1.xzwx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xwzx
deriv_rtx_coarse r2.xyz, r4.yzxy
deriv_rty_coarse r4.xyz, r4.zxyz
mul r5.xyz, r2.xyzx, r4.yzxy
mad r5.xyz, r2.zxyz, r4.zxyz, -r5.xyzx
mul r6.xyz, r4.xyzx, r5.zxyz
mad r4.xyz, r4.zxyz, r5.xyzx, -r6.xyzx
mul r6.xyz, r2.xyzx, r5.xyzx
mad r2.xyz, r5.zxyz, r2.yzxy, -r6.xyzx
deriv_rtx_coarse r5.xy, r0.xzxx
deriv_rty_coarse r0.xz, r0.xxzx
mul r6.xyz, r2.xyzx, r0.xxxx
mad r5.xzw, r5.xxxx, r4.xxyz, r6.xxyz
dp3 r0.x, r5.xzwx, r5.xzwx
rsq r0.x, r0.x
mul r5.xzw, r0.xxxx, r5.xxzw
mul r0.xzw, r2.xxyz, r0.zzzz
mad r0.xzw, r5.yyyy, r4.xxyz, r0.xxzw
dp3 r1.w, r0.xzwx, r0.xzwx
rsq r1.w, r1.w
mul r0.xzw, r0.xxzw, r1.wwww
mul r0.xzw, -r0.xxzw, r1.yyyy
mad r0.xzw, r1.xxxx, r5.xxzw, r0.xxzw
mad r0.xzw, r1.zzzz, v2.xxyz, r0.xxzw
dp3 r1.x, r0.xzwx, r0.xzwx
rsq r1.x, r1.x
mul r0.xzw, r0.xxzw, r1.xxxx
ftou r1.xy, v0.xyxx
sqrt r2.xyzw, r3.xyzx
mul r3.xyz, r2.xywx, l(0.250000, 0.500000, -0.250000, 0.000000)
add r1.zw, r3.yyyy, r3.xxxz
mad r3.x, r2.z, l(0.250000), r1.z
dp2 r3.y, r2.wzww, l(0.500000, -0.500000, 0.000000, 0.000000)
mad r3.z, r2.z, l(-0.250000), r1.w
and r1.xy, r1.xyxx, l(1, 1, 0, 0)
ine r1.x, r1.y, r1.x
movc r1.xy, r1.xxxx, r3.xyxx, r3.xzxx
add o0.xy, r1.xyxx, l(0.000000, 0.498039216, 0.000000, 0.000000)
mad o1.xyz, r0.xzwx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mov o0.z, l(0)
mov o0.w, r0.y
mov o1.w, r0.y
mov o2.xyzw, l(1.000000,0,0.353000,0)
ret
// Approximately 0 instruction slots used
