// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.63 on Sun Oct  9 13:50:34 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
// TEXCOORD                 0   xy          3     NONE   float   xy
// 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                 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
//
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 s6, mode_default
dcl_resource_structured t7, 1100
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) t59
dcl_resource_texture2d (float,float,float,float) t62
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v3.xy
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_output o0.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=1100)(mixed,mixed,mixed,mixed) r0.xyz, cb2[76].w, l(156), 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.x, cb2[76].w, l(316), t7.xxxx
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r1.y, cb2[76].w, l(1028), t7.xxxx
ftoi r1.zw, v5.xxxy
and r2.xy, r0.wwww, l(4096, 128, 0, 0)
mad r2.z, v7.z, l(100.000000), v7.x
movc r1.x, r2.x, r1.x, r2.z
mad r2.xz, r1.xxxx, l(-0.000000, 0.000000, 0.100000, 0.000000), v3.xxyx
utof r3.x, r1.z
mul r1.x, r0.x, r3.x
round_ni r3.y, r1.x
mad r1.xz, r2.xxzx, l(0.100000, 0.000000, 0.100000, 0.000000), r3.xxyx
mul r1.xz, r0.yyzy, r1.xxzx
sample_indexable(texture2d)(float,float,float,float) r1.xz, r1.xzxx, t62.xzyw, s2
if_nz r2.y
  utof r4.x, r1.w
  mul r0.x, r0.x, r4.x
  round_ni r4.y, r0.x
  mad r2.xz, r2.xxzx, l(0.100000, 0.000000, 0.100000, 0.000000), r4.xxyx
  mul r0.xy, r0.yzyy, r2.xzxx
  sample_indexable(texture2d)(float,float,float,float) r0.xy, r0.xyxx, t62.xyzw, s2
  add r0.xy, -r1.xzxx, r0.xyxx
  mad r1.xz, v5.zzzz, r0.xxyx, r1.xxzx
endif
ieq r0.xy, r1.yyyy, l(-2, -3, 0, 0)
or r0.y, r0.y, r0.x
if_z r0.y
  ld_structured_indexable(structured_buffer, stride=8)(mixed,mixed,mixed,mixed) r0.yz, r1.y, l(0), t13.xxyx
  utof r1.y, r1.y
  add r1.y, r1.y, l(0.500000)
  mul r4.y, r1.y, l(0.000244140625)
  mov r4.x, v7.y
  sample_l_indexable(texture2d)(float,float,float,float) r1.y, r4.xyxx, t15.yxzw, s0, l(0.000000)
  mad r0.y, r0.y, r1.y, r0.z
else
  ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r0.z, cb2[76].w, l(1076), t7.xxxx
  f16tof32 r1.y, r0.z
  ushr r0.z, r0.z, l(16)
  f16tof32 r0.z, r0.z
  mov_sat r2.x, v7.y
  add r0.z, -r1.y, r0.z
  mad r0.z, r2.x, r0.z, r1.y
  movc r0.y, r0.x, r1.y, r0.z
endif
frc r0.xz, v3.xxyx
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(1.000000)
ge r0.z, l(1.227951033E-21), r0.x
discard_nz r0.z
mul r0.x, r0.x, l(3.33333325)
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r2.xz, cb2[76].w, l(340), t7.xxyx
eq r3.yw, r2.xxxz, l(0.000000, 0.000000, 0.000000, 0.000000)
and r0.z, r3.w, r3.y
if_z r0.z
  ftoi r4.xy, v0.xyxx
  mov r4.zw, l(0,0,0,0)
  ld_indexable(texture2d)(float,float,float,float) r3.yw, r4.xyzw, t21.zxwy
  mad r3.yw, r3.yyyw, l(0.000000, 8.000000, 0.000000, 8.000000), v0.xxxy
  mul r3.yw, r3.yyyw, cb3[32].zzzw
  sample_l_indexable(texture2d)(float,float,float,float) r30.z, r3.ywyy, t20.yzxw, s6, l(0.000000)
  div r40.w, -r40.y, r30.z
  add r40.w, r40.w, l(1.000000)
  mul r40.w, r40.w, l(0.500000)
  mad r3.y, r40.x, r40.w, r3.y
  sample_l_indexable(texture2d)(float,float,float,float) r0.z, r3.ywyy, t20.yzxw, s6, l(0.000000)
  add r0.z, r0.z, v4.z
  lt r1.y, l(0.000000), r2.z
  div r2.z, l(1.000000, 1.000000, 1.000000, 1.000000), r2.z
  and r1.y, r1.y, r2.z
  div r2.x, r0.z, 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 r0.z, r0.z, r1.y
  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)
  mad r0.z, -r1.y, r0.z, l(1.000000)
  mul r0.z, r0.z, r2.x
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 r1.y, 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, r1.y, 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) r2.xzw, cb2[76].w, l(108), t7.xxyz
ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r4.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) r0.z, cb2[76].w, l(484), t7.xxxx
mad r1.xy, r1.xzxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r1.xy, r0.yyyy, r1.xyxx
mad r1.xy, r1.xyxx, l(-0.500000, 0.500000, 0.000000, 0.000000), v3.xyxx
mov_sat r4.xyzw, r4.xyzw
and r0.y, r0.w, l(512)
mov r6.x, l(1.000000)
mov r6.w, v6.w
movc r6.xyzw, r0.yyyy, r6.xxxw, v6.xyzw
mul r6.w, r0.x, r6.w
mul r4.xyzw, r4.xyzw, r6.xyzw
mad r0.x, 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 r1.z, l(0.000010), |r5.w|
  lt r3.y, l(0.000000), r5.w
  lt r3.w, r5.w, l(0.000000)
  iadd r3.y, -r3.y, r3.w
  itof r3.y, r3.y
  mul r3.y, r3.y, l(0.000100)
  movc r1.z, r1.z, r5.w, r3.y
  mul r3.y, r1.z, v7.y
  exp r3.y, r3.y
  add r3.y, r3.y, l(-1.000000)
  exp r1.z, r1.z
  add r1.z, r1.z, l(-1.000000)
  div r1.z, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z
  mul r1.z, r1.z, r3.y
  max r0.w, r1.z, l(0.000000)
  break
  case l(3)
  add r1.z, |r5.w|, l(6.000000)
  add r3.y, -v7.y, l(0.500000)
  mul r1.z, r1.z, r3.y
  exp r1.z, r1.z
  add r1.z, r1.z, l(1.000000)
  div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z
  break
  default
  mov r0.w, l(0)
  break
endswitch
add r1.z, -r5.x, r5.y
mad r0.w, r0.w, r1.z, r5.x
lt r1.z, l(0.000000), r0.z
mul r0.z, r0.z, r0.w
mad r0.x, r0.z, r0.x, r0.w
movc r0.x, r1.z, r0.x, r0.w
mul r0.z, r2.x, r3.x
round_ni r3.z, r0.z
add r0.zw, r1.xxxy, r3.xxxz
mul r0.zw, r2.zzzw, r0.zzzw
sample_indexable(texture2d)(float,float,float,float) r0.z, r0.zwzz, t59.yzxw, s2
if_nz r2.y
  utof r3.x, r1.w
  mul r0.w, r2.x, r3.x
  round_ni r3.y, r0.w
  add r1.xy, r1.xyxx, r3.xyxx
  mul r1.xy, r2.zwzz, r1.xyxx
  sample_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t59.yzwx, s2
  add r0.w, -r0.z, r0.w
  mad r0.z, v5.z, r0.w, r0.z
endif
ne r0.w, r0.x, l(0.000000)
mul r1.x, r0.x, r0.z
exp r1.x, r1.x
add r1.x, r1.x, l(-1.000000)
exp r0.x, r0.x
add r0.x, r0.x, l(-1.000000)
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mul r0.x, r0.x, r1.x
max r0.x, r0.x, l(0.000000)
movc r0.x, r0.w, r0.x, r0.z
mul r4.w, r0.x, r4.w
ge r0.x, l(4.093169975E-21), r4.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 r4.x, r4.x
    ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r1.xyzw, r0.x, l(0), t14.xyzw
    ld_structured_indexable(structured_buffer, stride=24)(mixed,mixed,mixed,mixed) r2.xy, r0.x, l(16), t14.xyxx
    utof r0.x, r0.x
    add r0.x, r0.x, l(0.500000)
    mul r4.y, r0.x, l(0.000976562500)
    sample_l_indexable(texture2d)(float,float,float,float) r0.xyz, r4.xyxx, t16.xyzw, s0, l(0.000000)
    mov r2.z, r1.w
    mad r4.xyz, r1.xyzx, r0.xyzx, r2.zxyz
  else
    ld_structured_indexable(structured_buffer, stride=1100)(mixed,mixed,mixed,mixed) r4.xyz, cb2[76].w, l(1084), t7.xyzx
  endif
endif
mov o0.xyzw, r4.xyzw
ret
// Approximately 0 instruction slots used
