// AUTOMATICALLY CONVERTED FROM SHADER FIXES 
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v0.6.63 on Sun Oct  9 13:50:44 2022
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyz
// VERT_ID                  0   x           1     NONE    uint   x
// TEXCOORD                 0   xy          2     NONE   float   xy
// NORMAL                   0   xyz         3     NONE   float
// TEXCOORD                 5   xyzw        4     NONE   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB1[3], immediateIndexed
dcl_constantbuffer CB2[38], immediateIndexed
dcl_sampler s2, mode_default
dcl_sampler s5, mode_default
dcl_resource_structured t5, 64
dcl_resource_texture2darray (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t13
dcl_input_ps_siv linear noperspective v0.xyz, position
dcl_input_ps constant v1.x
dcl_input_ps linear v2.xy
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
and r0.x, v1.x, l(0x00ffffff)
ne r0.y, l(1.000000), cb1[2].w
if_nz r0.y
  if_z cb2[36].x
    ne r0.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[37].x
    if_z r0.y
      ftoi r0.yz, v0.xxyx
      iadd r0.w, r0.x, l(1)
      and r0.w, r0.w, l(7)
      imad r0.yz, r0.wwww, l(0, 7, 7, 0), r0.yyzy
      and r1.xy, r0.yzyy, l(63, 63, 0, 0)
      and r1.z, l(7), cb2[37].z
      mov r1.w, l(0)
      ld_indexable(texture2darray)(float,float,float,float) r0.y, r1.xyzw, t6.yxzw
    else
      mov r0.y, l(0)
    endif
  else
    mov r0.y, l(0)
  endif
  ge r0.y, r0.y, cb1[2].w
  discard_nz r0.y
endif
mul r0.yz, v0.xxyx, cb2[32].zzwz
mad r0.yz, r0.yyzy, l(0.000000, 2.000000, -2.000000, 0.000000), l(0.000000, -1.000000, 1.000000, 0.000000)
mad r0.w, v0.z, cb2[35].z, cb2[35].w
rcp r0.w, r0.w
mov r1.z, -r0.w
mul r1.xy, r0.yzyy, r1.zzzz
mov r1.w, l(1.000000)
add r40.w, r1.z, -r40.y
mad r1.x, -r40.x, r40.w, r1.x
dp4 r2.x, r1.xyzw, cb2[12].xyzw
dp4 r2.y, r1.xyzw, cb2[13].xyzw
dp4 r2.z, r1.xyzw, cb2[14].xyzw
ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r1.xyzw, l(0), l(0), t5.xyzw
ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r3.xyzw, l(0), l(16), t5.xyzw
ld_structured_indexable(structured_buffer, stride=64)(mixed,mixed,mixed,mixed) r4.xyzw, l(0), l(48), t5.xyzw
mov r2.w, l(1.000000)
dp4 r1.x, r2.xyzw, r1.xyzw
dp4 r1.y, r2.xyzw, r3.xyzw
dp4 r0.y, r2.xyzw, r4.xyzw
div r0.yz, r1.xxyx, r0.yyyy
sample_indexable(texture2d)(float,float,float,float) r0.w, v2.xyxx, t9.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r0.y, r0.yzyy, t13.yxzw, s5
mov_sat r0.w, r0.w
mul r0.z, r0.w, r0.y
lt r0.z, r0.z, l(0.500000)
mad r0.y, -r0.y, r0.w, l(1.000000)
mad_sat r0.y, -r0.y, l(2.000000), l(1.000000)
movc r0.y, r0.z, l(0), r0.y
if_z cb2[36].x
  ne r0.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[37].x
  if_z r0.z
    ftoi r0.zw, v0.xxxy
    iadd r0.x, r0.x, cb2[37].z
    imul null, r0.x, r0.x, l(4099)
    and r0.x, r0.x, l(63)
    iadd r0.xz, r0.xxxx, r0.zzwz
    utof r0.xz, r0.xxzx
    mul r0.xz, r0.xxzx, l(0.0671105608, 0.000000, 0.00583714992, 0.000000)
    add r0.x, r0.z, r0.x
    frc r0.x, r0.x
    mul r0.x, r0.x, l(52.982918)
    frc r0.x, r0.x
  else
    mov r0.x, l(0)
  endif
else
  mov r0.x, l(0)
endif
ge r0.x, r0.x, r0.y
discard_nz r0.x
ge r0.x, l(0.000000), r0.y
discard_nz r0.x
ret
// Approximately 0 instruction slots used
