//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.15 on Mon Mar 11 09:54:17 2019
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   int nDecalClstPtch[2];             // Offset:    0 Size:    20
//   float4 vDecalClstZPrm;             // Offset:   32 Size:    16
//   float dcFade;                      // Offset:   48 Size:     4
//   row_major float4x4 mV2W;           // Offset:   64 Size:    64
//   row_major float4x4 mP2W;           // Offset:  128 Size:    64
//   row_major float4x4 mW2V;           // Offset:  192 Size:    64
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// __smpsDecalAlbedoArray            sampler      NA          NA    1        1
// __smpsDecalNormalArray            sampler      NA          NA    2        1
// __smpsDecalReflectanceLinearRoughnessArray    sampler      NA          NA    3        1
// __smpsDecalOcclusionArray         sampler      NA          NA    4        1
// __smpsDecalEmissiveArray          sampler      NA          NA    5        1
// __smpsDepth                       sampler      NA          NA    6        1
// __smpsGBuf0                       sampler      NA          NA    7        1
// __smpsGBuf1                       sampler      NA          NA    8        1
// __smpsGBuf2                       sampler      NA          NA    9        1
// __smpsGBuf3                       sampler      NA          NA   10        1
// sEmiAutoHDRScaleExposure          texture  float4          2d    0        1
// sDecalAlbedoArray                 texture  float4     2darray    1        1
// sDecalNormalArray                 texture  float4     2darray    2        1
// sDecalReflectanceLinearRoughnessArray    texture  float4     2darray    3        1
// sDecalOcclusionArray              texture  float4     2darray    4        1
// sDecalEmissiveArray               texture  float4     2darray    5        1
// sDepth                            texture  float4          2d    6        1
// sGBuf0                            texture  float4          2d    7        1
// sGBuf1                            texture  float4     2darray    8        1
// sGBuf2                            texture  float4          2d    9        1
// sGBuf3                            texture  float4     2darray   10        1
// tCdlDecalIndices                  texture    uint         buf   17        1
// tCdlDecalAttributes               texture  float4         buf   19        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xy
// TEXCOORD                 0   xyzw        1     NONE   float   xy
//
//
// 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
// SV_Target                3   xyzw        3   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[15], immediateIndexed
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_sampler s8, mode_default
dcl_sampler s9, mode_default
dcl_sampler s10, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2darray (float,float,float,float) t1
dcl_resource_texture2darray (float,float,float,float) t2
dcl_resource_texture2darray (float,float,float,float) t3
dcl_resource_texture2darray (float,float,float,float) t4
dcl_resource_texture2darray (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_resource_texture2darray (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_texture2darray (float,float,float,float) t10
dcl_resource_buffer (uint,uint,uint,uint) t17
dcl_resource_buffer (float,float,float,float) t19
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_temps 39

dcl_resource_texture2d (float,float,float,float) t121
ld_indexable(texture2d)(float,float,float,float) r37.xyzw, l(0, 0, 0, 0), t121.xyzw

mad r0.xy, v1.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.z, r0.xyxx, t6.yzxw, s6, l(0.000000)
// mP2W
mul r1.xyzw, v1.yyyy, cb0[9].xyzw
mad r1.xyzw, v1.xxxx, cb0[8].xyzw, r1.xyzw
mad r1.xyzw, r0.zzzz, cb0[10].xyzw, r1.xyzw
add r1.xyzw, r1.xyzw, cb0[11].xyzw
div r2.xyz, r1.xyzx, r1.wwww

// I don't have mW2P handy, but I can get the linear depth via mW2V instead:
mul r38.xyzw,  r2.xxxx, cb0[12].xyzw
mad r38.xyzw,  r2.yyyy, cb0[13].xyzw, r38.xyzw
mad r38.xyzw,  r2.zzzz, cb0[14].xyzw, r38.xyzw
add r38.xyzw, r38.xyzw, cb0[15].xyzw

// r38.z is now *negative* linear depth

// I also don't have the projection matrix handy to do a view-space adjustment,
// but that's okay. Calculate the adjustment magnitude in clip space:
add r37.w, -r38.z, -r37.y
mul r38.x, -r37.w, r37.x

// Now use mP2W to convert (clip_adjustment, 0, 0, 0) to world space:
mul r38.xyzw, r38.xxxx, cb0[8].xyzw

// And adjust the original world-space coord:
add r2.xyz, r2.xyz, r38.xyz

// Correction must be applied to r1 as well, as it is used again further on:
mul r1.xyz, r2.xyzw, r1.wwww

deriv_rtx_coarse r3.xyz, r2.xyzx
deriv_rty_coarse r2.xyz, r2.xyzx
mad r0.z, r0.z, cb0[2].x, cb0[2].y
log r0.z, r0.z
mad r0.z, r0.z, cb0[2].z, cb0[2].w
max r0.z, r0.z, l(0.000000)
ftou r0.z, r0.z
ult r0.w, r0.z, l(16)
if_nz r0.w
  round_ni r4.xy, v0.xyxx
  add r4.xy, r4.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
  mul r4.xy, r4.xyxx, l(0.015625, 0.015625, 0.000000, 0.000000)
  ftou r4.xy, r4.xyxx
  imul null, r0.w, r4.y, cb0[0].x
  imad r0.z, cb0[1].x, r0.z, r0.w
  iadd r0.z, r4.x, r0.z
  imul null, r0.w, r0.z, l(3)
  ld_indexable(buffer)(uint,uint,uint,uint) r0.w, r0.wwww, t17.yzwx
  imad r4.xy, l(3, 3, 0, 0), r0.zzzz, l(1, 2, 0, 0)
  ld_indexable(buffer)(uint,uint,uint,uint) r0.z, r4.xxxx, t17.yzxw
  ishl r0.z, r0.z, l(16)
  or r0.z, r0.z, r0.w
  ld_indexable(buffer)(uint,uint,uint,uint) r0.w, r4.yyyy, t17.yzwx
else
  mov r0.zw, l(0,0,0,0)
endif
sample_l_indexable(texture2d)(float,float,float,float) r4.xyzw, r0.xyxx, t7.xyzw, s7, l(0.000000)
mad r5.xy, v1.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
mov r5.z, l(0)
sample_l_indexable(texture2darray)(float,float,float,float) r6.xyzw, r5.xyzx, t8.xyzw, s8, l(0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r7.xyzw, r0.xyxx, t9.xyzw, s9, l(0.000000)
sample_l_indexable(texture2darray)(float,float,float,float) r5.xyzw, r5.xyzx, t10.xyzw, s10, l(0.000000)
mad r0.xy, r7.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
add r8.xyz, -|r0.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
add r9.z, -|r0.y|, r8.x
ge r2.w, r9.z, l(0.000000)
ge r7.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r7.xy, r7.xyxx, l(1.000000,1.000000,0,0), l(-1.000000,-1.000000,0,0)
mul r7.xy, r7.xyxx, r8.yzyy
movc r9.xy, r2.wwww, r0.xyxx, r7.xyxx
dp3 r0.x, r9.xyzx, r9.xyzx
rsq r0.x, r0.x
mul r8.xyz, r0.xxxx, r9.xyzx
mul r9.xyz, r8.yyyy, cb0[5].xyzx
mad r8.xyw, r8.xxxx, cb0[4].xyxz, r9.xyxz
mad r8.xyz, r8.zzzz, cb0[6].xyzx, r8.xywx
mul r0.x, r7.w, l(65535.000000)
ftou r0.x, r0.x
ushr r0.y, r0.x, l(8)
utof r0.y, r0.y
and r0.x, r0.x, l(255)
utof r7.y, r0.x
mul r7.x, r0.y, l(0.00784313772)
if_nz r0.w
  mad r9.xy, v1.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
  mov r9.z, l(2.000000)
  sample_l_indexable(texture2darray)(float,float,float,float) r9.xyzw, r9.xyzx, t8.xyzw, s8, l(0.000000)
  div r1.xyzw, r1.xyzw, r1.wwww
  mad r9.xyzw, r9.xyzw, l(2.000000, 2.000000, 2.000000, 2.000000), l(-1.000000, -1.000000, -1.000000, -1.000000)
  add r10.xyz, -|r9.xyxx|, l(1.000000, 1.000000, 1.000000, 0.000000)
  add r11.z, -|r9.y|, r10.x
  ge r0.x, r11.z, l(0.000000)
  ge r12.xyzw, r9.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  movc r12.xyzw, r12.xyzw, l(1.000000,1.000000,1.000000,1.000000), l(-1.000000,-1.000000,-1.000000,-1.000000)
  mul r10.xy, r10.yzyy, r12.xyxx
  movc r11.xy, r0.xxxx, r9.xyxx, r10.xyxx
  dp3 r0.x, r11.xyzx, r11.xyzx
  rsq r0.x, r0.x
  mul r10.xyz, r0.xxxx, r11.xyzx
  add r13.xyz, -|r9.zwzz|, l(1.000000, 1.000000, 1.000000, 0.000000)
  add r14.z, -|r9.w|, r13.x
  ge r0.y, r14.z, l(0.000000)
  mul r9.xy, r12.zwzz, r13.yzyy
  movc r14.xy, r0.yyyy, r9.zwzz, r9.xyxx
  dp3 r0.y, r14.xyzx, r14.xyzx
  rsq r0.y, r0.y
  mul r9.xyz, r0.yyyy, r14.xyzx
  mul r12.xyz, r8.yzxy, r9.zxyz
  mad r12.xyz, r9.yzxy, r8.zxyz, -r12.xyzx
  dp3 r0.y, r9.xyzx, r10.xyzx
  mad r13.xyz, -r0.yyyy, r10.xyzx, r9.xyzx
  dp3 r0.y, r13.xyzx, r13.xyzx
  rsq r0.y, r0.y
  mul r13.xyz, r0.yyyy, r13.xyzx
  mul r14.xyz, r10.yzxy, r13.zxyz
  mad r14.yzw, r13.yyzx, r10.zzxy, -r14.xxyz
  add r3.xyz, r3.xyzx, r1.xyzx
  add r2.xyz, r2.xyzx, r1.xyzx
  ld_indexable(texture2d)(float,float,float,float) r0.y, l(0, 0, 0, 0), t0.yxzw
  max r0.y, r0.y, l(1.000000012E-007)
  div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
  mov r15.xyz, l(0,1.000000,0,0)
  mov r3.w, r1.w
  mov r2.w, r3.w
  mov r16.w, l(1.000000)
  mov r17.yz, l(0,0,-1,0)
  mov r18.xyz, r4.xyzx
  mov r19.xyz, r6.xyzx
  mov r20.xyz, r8.xyzx
  mov r21.xyz, r9.xyzx
  mov r22.xyz, r12.xyzx
  mov r23.xyz, r5.xyzx
  mov r7.w, r7.x
  mov r24.x, r4.w
  mov r8.w, l(0)
  loop
    uge r9.w, r8.w, r0.w
    breakc_nz r9.w
    iadd r9.w, r0.z, r8.w
    ld_indexable(buffer)(uint,uint,uint,uint) r9.w, r9.wwww, t17.yzwx
    ishl r10.w, r9.w, l(3)
    ld_indexable(buffer)(float,float,float,float) r25.xyzw, r10.wwww, t19.xyzw
    bfi r26.xyz, l(29, 29, 29, 0), l(3, 3, 3, 0), r9.wwww, l(1, 2, 7, 0)
    ld_indexable(buffer)(float,float,float,float) r27.xyzw, r26.xxxx, t19.xyzw
    ld_indexable(buffer)(float,float,float,float) r28.xyzw, r26.yyyy, t19.xyzw
    ld_indexable(buffer)(float,float,float,float) r26.xyzw, r26.zzzz, t19.xyzw
    and r10.w, r26.w, l(15)
    if_z r10.w
      dp4 r29.x, r25.xyzw, r1.xyzw
      dp4 r29.y, r27.xyzw, r1.xyzw
      dp4 r29.z, r28.xyzw, r1.xyzw
    else
      add r30.xyzw, -r25.xyzw, r27.xyzw
      add r31.xy, -r25.xyxx, r25.zwzz
      add r30.zw, -r30.xxxy, r30.zzzw
      add r31.zw, -r1.xxxz, r25.xxxy
      mul r11.w, r30.z, r30.y
      mad r11.w, r30.x, r30.w, -r11.w
      mul r12.w, r30.y, r31.x
      mad r12.w, r30.x, r31.y, -r12.w
      mad r12.w, r31.z, r30.w, r12.w
      mad r12.w, -r31.w, r30.z, r12.w
      mul r13.w, r31.x, r31.w
      mad r13.w, r31.z, r31.y, -r13.w
      mul r17.w, r11.w, r13.w
      mul r17.w, r17.w, l(4.000000)
      mad r17.w, r12.w, r12.w, -r17.w
      ge r18.w, r17.w, l(0.000000)
      sqrt r17.w, r17.w
      lt r19.w, |r11.w|, l(0.100000)
      div r13.w, -r13.w, r12.w
      add r12.w, -r12.w, r17.w
      add r11.w, r11.w, r11.w
      div r11.w, r12.w, r11.w
      movc r32.z, r19.w, r13.w, r11.w
      mad r30.zw, r32.zzzz, r30.zzzw, r31.xxxy
      lt r11.w, |r30.w|, |r30.z|
      mad r30.xy, -r32.zzzz, r30.xyxx, -r31.zwzz
      div r30.xy, r30.xyxx, r30.zwzz
      movc r32.x, r11.w, r30.x, r30.y
      add r11.w, r1.y, -r28.x
      div r32.y, r11.w, r28.y
      add r30.xyz, r32.xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000)
      movc r29.xyz, r18.wwww, r30.xyzx, l(-1.000000,-1.000000,-1.000000,0)
    endif
    ge r30.xyz, |r29.xyzx|, l(0.500000, 0.500000, 0.500000, 0.000000)
    or r11.w, r30.y, r30.x
    or r11.w, r30.z, r11.w
    if_z r11.w
      add r29.xz, r29.xxzx, l(0.500000, 0.000000, 0.500000, 0.000000)
      if_z r10.w
        dp4 r30.x, r25.xyzw, r3.xyzw
        dp4 r30.y, r28.xyzw, r3.xyzw
        dp4 r31.x, r25.xyzw, r2.xyzw
        dp4 r31.y, r28.xyzw, r2.xyzw
      else
        add r32.xyzw, -r25.xyzw, r27.xyzw
        add r25.zw, -r25.xxxy, r25.zzzw
        add r28.xy, -r32.xyxx, r32.zwzz
        add r30.zw, -r3.xxxz, r25.xxxy
        mul r11.w, r28.x, r32.y
        mad r11.w, r32.x, r28.y, -r11.w
        mul r12.w, r25.z, r32.y
        mad r12.w, r32.x, r25.w, -r12.w
        mad r13.w, r30.z, r28.y, r12.w
        mad r13.w, -r30.w, r28.x, r13.w
        mul r17.w, r25.z, r30.w
        mad r17.w, r30.z, r25.w, -r17.w
        mul r18.w, r11.w, l(4.000000)
        mul r19.w, r17.w, r18.w
        mad r19.w, r13.w, r13.w, -r19.w
        ge r20.w, r19.w, l(0.000000)
        sqrt r19.w, r19.w
        lt r21.w, |r11.w|, l(0.100000)
        div r17.w, -r17.w, r13.w
        add r13.w, -r13.w, r19.w
        add r11.w, r11.w, r11.w
        div r13.w, r13.w, r11.w
        movc r33.y, r21.w, r17.w, r13.w
        mad r31.zw, r33.yyyy, r28.xxxy, r25.zzzw
        lt r13.w, |r31.w|, |r31.z|
        mad r30.zw, -r33.yyyy, r32.xxxy, -r30.zzzw
        div r30.zw, r30.zzzw, r31.zzzw
        movc r33.x, r13.w, r30.z, r30.w
        add r30.zw, r33.xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
        movc r30.xy, r20.wwww, r30.zwzz, l(-1.000000,-1.000000,0,0)
        add r25.xy, -r2.xzxx, r25.xyxx
        mad r12.w, r25.x, r28.y, r12.w
        mad r12.w, -r25.y, r28.x, r12.w
        mul r13.w, r25.z, r25.y
        mad r13.w, r25.x, r25.w, -r13.w
        mul r17.w, r13.w, r18.w
        mad r17.w, r12.w, r12.w, -r17.w
        ge r18.w, r17.w, l(0.000000)
        sqrt r17.w, r17.w
        div r13.w, -r13.w, r12.w
        add r12.w, -r12.w, r17.w
        div r11.w, r12.w, r11.w
        movc r33.y, r21.w, r13.w, r11.w
        mad r25.zw, r33.yyyy, r28.xxxy, r25.zzzw
        lt r11.w, |r25.w|, |r25.z|
        mad r25.xy, -r33.yyyy, r32.xyxx, -r25.xyxx
        div r25.xy, r25.xyxx, r25.zwzz
        movc r33.x, r11.w, r25.x, r25.y
        add r25.xy, r33.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
        movc r31.xy, r18.wwww, r25.xyxx, l(-1.000000,-1.000000,0,0)
      endif
      dp3 r11.w, r27.xyzx, r27.xyzx
      rsq r11.w, r11.w
      mul r16.xyz, r11.wwww, r27.xyzx
      mad r15.w, r28.w, r29.z, r28.z
      movc r25.xyzw, r10.wwww, r15.xyzw, r16.xyzw
      dp3 r10.w, r10.xyzx, r25.xyzx
      lt r11.w, r26.x, r10.w
      if_nz r11.w
        bfi r27.xyzw, l(29, 29, 29, 29), l(3, 3, 3, 3), r9.wwww, l(3, 4, 5, 6)
        ld_indexable(buffer)(float,float,float,float) r28.xyzw, r27.xxxx, t19.xyzw
        ld_indexable(buffer)(float,float,float,float) r32.xyzw, r27.yyyy, t19.xyzw
        ld_indexable(buffer)(float,float,float,float) r16.xyz, r27.zzzz, t19.xyzw
        ld_indexable(buffer)(float,float,float,float) r27.xyzw, r27.wwww, t19.xyzw
        ubfe r9.w, l(4), l(4), r26.w
        mad r33.xy, r27.xyxx, r29.xzxx, r27.zwzz
        add r25.xyz, r30.xyxx, l(0.500000, 0.500000, 0.500000, 0.000000)
        mad r25.xyz, r27.xyxx, r25.xyzx, r27.zwzz
        add r29.xzw, r31.xxyx, l(0.500000, 0.000000, 0.500000, 0.500000)
        mad r27.xyz, r27.xyxx, r29.xzwx, r27.zwzz
        add r25.xyz, -r33.xyxx, r25.xyzx
        add r27.xyz, -r33.xyxx, r27.xyzx
        lt r11.w, r26.z, l(0.500000)
        add_sat r12.w, -r26.z, |r29.y|
        add r13.w, -r26.z, l(0.500000)
        div r12.w, -r12.w, r13.w
        add r12.w, r12.w, l(1.000000)
        mul r12.w, r12.w, r25.w
        movc r11.w, r11.w, r12.w, r25.w
        mov r33.zw, |r28.xxxy|
        sample_d_indexable(texture2darray)(float,float,float,float) r29.xyzw, r33.xyzx, t1.xyzw, s1, r25.zyzz, r27.zyzz
        sample_d_indexable(texture2darray)(float,float,float,float) r30.xyz, r33.xywx, t2.xyzw, s2, r25.zyzz, r27.zyzz
        mov r28.xy, r33.xyxx
        mov r28.zw, |r28.zzzw|
        sample_d_indexable(texture2darray)(float,float,float,float) r31.xyzw, r28.xyzx, t3.xyzw, s3, r25.zyzz, r27.zyzz
        sample_d_indexable(texture2darray)(float,float,float,float) r12.w, r28.xywx, t4.yzwx, s4, r25.zyzz, r27.zyzz
        add r30.xyz, r30.xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000)
        dp3 r13.w, r30.xyzx, r30.xyzx
        rsq r13.w, r13.w
        mul r33.xyz, r13.wwww, r30.xyzx
        lt r15.w, r26.x, r26.y
        add r10.w, -r26.y, r10.w
        min r10.w, r10.w, l(0.000000)
        add r17.w, -r26.y, r26.x
        div r10.w, -r10.w, r17.w
        add r10.w, r10.w, l(1.000000)
        movc r10.w, r15.w, r10.w, l(1.000000)
        mul r15.w, r32.x, r29.w
        mul r15.w, r15.w, cb0[3].x
        mul r11.w, r11.w, r15.w
        mul r17.x, r10.w, r11.w
        ieq r26.xy, r9.wwww, l(0, 4, 0, 0)
        or r10.w, r26.y, r26.x
        if_nz r10.w
          lt r10.w, l(0.000000), r32.z
          lt r34.xyz, r18.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
          dp2 r11.w, r29.xxxx, r18.xxxx
          add r35.xyz, -r18.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
          add r35.xyz, r35.xyzx, r35.xyzx
          add r36.xyz, -r29.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
          mad r35.xyz, -r35.xyzx, r36.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
          movc r36.x, r34.x, r11.w, r35.x
          dp2 r11.w, r29.yyyy, r18.yyyy
          movc r36.y, r34.y, r11.w, r35.y
          dp2 r11.w, r29.zzzz, r18.zzzz
          movc r36.z, r34.z, r11.w, r35.z
          add r34.xyz, -r29.xyzx, r36.xyzx
          mad r34.xyz, r32.zzzz, r34.xyzx, r29.xyzx
          movc r29.xyz, r10.wwww, r34.xyzx, r29.xyzx
          lt r10.w, l(0.000000), r16.y
          if_nz r10.w
            ubfe r10.w, l(1), l(8), r26.w
            mov r28.z, |r16.z|
            sample_d_indexable(texture2darray)(float,float,float,float) r25.xyz, r28.xyzx, t5.xyzw, s5, r25.xyzx, r27.xyzx
            mad r25.xyz, r25.xyzx, r16.yyyy, -r23.xyzx
            mad r23.xyz, r17.xxxx, r25.xyzx, r23.xyzx
            if_nz r10.w
              mul r23.xyz, r0.yyyy, r23.xyzx
            endif
          endif
        endif
        if_z r9.w
          mul r25.xy, r32.ywyy, r17.xxxx
          mov r10.w, r25.x
          mov r11.w, r25.y
          mov r25.x, r17.x
          mov r25.z, l(0)
        else
          ieq r15.w, r9.w, l(5)
          if_nz r15.w
            mov r10.w, r17.x
            mov r11.w, r17.x
            mov r25.xy, r17.xxxx
            mov r25.z, l(0)
          else
            if_nz r26.y
              mul r25.xy, r32.ywyy, r17.xxxx
              lt r15.w, l(0.000000), r17.x
              lt r16.y, r16.x, l(1.000000)
              and r15.w, r15.w, r16.y
              if_nz r15.w
                mad r26.xyz, -r11.xyzx, r0.xxxx, r20.xyzx
                mad r16.xyz, r16.xxxx, r26.xyzx, r10.xyzx
                dp3 r15.w, r16.xyzx, r16.xyzx
                rsq r15.w, r15.w
                mul r20.xyz, r15.wwww, r16.xyzx
                dp3 r15.w, r21.xyzx, r20.xyzx
                mad r16.xyz, -r15.wwww, r20.xyzx, r21.xyzx
                dp3 r15.w, r16.xyzx, r16.xyzx
                rsq r15.w, r15.w
                mul r21.xyz, r15.wwww, r16.xyzx
                mul r16.xyz, r20.yzxy, r21.zxyz
                mad r22.xyz, r21.yzxy, r20.zxyz, -r16.xyzx
              endif
              mad r16.xyz, r30.xyzx, r13.wwww, l(-0.000000, -0.000000, -1.000000, 0.000000)
              mad r16.xyz, r32.wwww, r16.xyzx, l(0.000000, 0.000000, 1.000000, 0.000000)
              dp3 r13.w, r16.xyzx, r16.xyzx
              rsq r13.w, r13.w
              mul r33.xyz, r13.wwww, r16.xyzx
              mov r10.w, r25.x
              mov r11.w, r17.x
              mov r25.x, r17.x
              mov r25.z, l(-1)
            else
              ieq r16.yz, r9.wwww, l(0, 2, 1, 0)
              and r16.x, r17.x, r16.z
              or r9.w, r16.y, r16.z
              and r11.w, r17.x, r9.w
              movc r25.xyz, r16.yyyy, r17.yxzy, r16.xxzx
              mov r10.w, l(0)
              mov r17.x, l(0)
            endif
          endif
        endif
        add r9.w, r12.w, l(-1.000000)
        mad_sat r22.w, r9.w, r25.y, r24.x
        add r9.w, -r24.x, r12.w
        mad r14.x, r25.y, r9.w, r24.x
        movc r16.xyz, r25.zzzz, r20.xyzx, r10.xyzx
        movc r26.xyz, r25.zzzz, r21.xyzx, r13.xyzx
        movc r24.xyzw, r25.zzzz, r22.wxyz, r14.xyzw
        mul r25.yzw, r33.yyyy, r26.xxyz
        mad r24.yzw, r24.yyzw, r33.xxxx, r25.yyzw
        mad r16.xyz, r16.xyzx, r33.zzzz, r24.yzwy
        add r24.yzw, -r18.xxyz, r29.xxyz
        mad r18.xyz, r10.wwww, r24.yzwy, r18.xyzx
        add r16.xyz, -r20.xyzx, r16.xyzx
        mad r16.xyz, r11.wwww, r16.xyzx, r20.xyzx
        dp3 r9.w, r16.xyzx, r16.xyzx
        rsq r9.w, r9.w
        mul r20.xyz, r9.wwww, r16.xyzx
        add r16.xyz, -r19.xyzx, r31.xyzx
        mad r19.xyz, r17.xxxx, r16.xyzx, r19.xyzx
        mad r9.w, r31.w, l(2.000000), -r7.w
        mad r7.w, r25.x, r9.w, r7.w
      endif
    endif
    iadd r8.w, r8.w, l(1)
  endloop
  mov r4.xyz, r18.xyzx
  mov r6.xyz, r19.xyzx
  mov r8.xyz, r20.xyzx
  mov r5.xyz, r23.xyzx
  mov r7.x, r7.w
  mov r4.w, r24.x
endif
mul r0.xy, r7.xyxx, l(127.500000, 1.000000, 0.000000, 0.000000)
ftou r0.xy, r0.xyxx
bfi r0.x, l(24), l(8), r0.x, r0.y
utof r0.x, r0.x
mul o2.w, r0.x, l(0.0000152590219)
mul r0.xyz, r8.yyyy, cb0[13].zxyz
mad r0.xyz, r8.xxxx, cb0[12].zxyz, r0.xyzx
mad r0.xyz, r8.zzzz, cb0[14].zxyz, r0.xyzx
add r0.w, |r0.z|, |r0.y|
add r0.w, |r0.x|, r0.w
div r0.xyz, r0.xyzx, r0.wwww
add r1.xy, -|r0.zyzz|, l(1.000000, 1.000000, 0.000000, 0.000000)
ge r2.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r0.xw, r2.yyyz, l(1.000000,0,0,1.000000), l(-1.000000,0,0,-1.000000)
mul r0.xw, r0.xxxw, r1.xxxy
movc r0.xy, r2.xxxx, r0.yzyy, r0.xwxx
mad o2.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
mov o1.xyzw, r6.xyzw
mov o2.z, r7.z
mov o3.xyzw, r5.xyzw
mov o0.xyzw, r4.xyzw
ret
// Approximately 411 instruction slots used
