// Reflections
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.65 on Wed Sep 20 21:35:17 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[5], immediateIndexed
dcl_constantbuffer cb1[170], immediateIndexed
dcl_constantbuffer cb2[4], immediateIndexed
dcl_constantbuffer cb3[1023], dynamicIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_buffer (uint,uint,uint,uint) t7
dcl_resource_buffer (uint,uint,uint,uint) t8
dcl_resource_texturecubearray (float,float,float,float) t9
dcl_resource_texture2d (float,float,float,float) t10
dcl_resource_texture2d (float,float,float,float) t11
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_input vThreadID.xy
//dcl_temps 13

dcl_temps 36

dcl_thread_group 8, 8, 1

dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r36.xyzw, l(0, 0, 0, 0), t125.xyzw

iadd r0.xy, vThreadID.xyxx, cb0[4].xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.xyww, t1.xyzw
mul r1.w, r1.w, l(255.000000)
round_ne r1.w, r1.w
ftou r1.w, r1.w
and r2.x, r1.w, l(15)
ine r2.yz, r2.xxxx, l(0, 0, 7, 0)
and r2.y, r2.z, r2.y
if_nz r2.y
  utof r2.yz, vThreadID.xxyx
  add r2.yz, r2.yyzy, l(0.000000, 0.500000, 0.500000, 0.000000)
  iadd r3.xy, -cb0[4].xyxx, cb0[4].zwzz
  utof r3.xy, r3.xyxx
  div r2.yz, r2.yyzy, r3.xxyx
  mad r2.yz, r2.yyzy, l(0.000000, 2.000000, -2.000000, 0.000000), l(0.000000, -1.000000, 1.000000, 0.000000)
  ld_indexable(texture2d)(float,float,float,float) r2.w, r0.xyww, t4.yzwx
  mad r3.x, r2.w, cb1[53].x, cb1[53].y
  mad r2.w, r2.w, cb1[53].z, -cb1[53].w
  div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
  add r2.w, r2.w, r3.x
  ld_indexable(texture2d)(float,float,float,float) r3.xyz, r0.xyww, t0.xyzw
  ld_indexable(texture2d)(float,float,float,float) r4.xyzw, r0.xyww, t2.xyzw
  ld_indexable(texture2d)(float,float,float,float) r5.xy, r0.xyww, t3.xyzw
  ftou r3.w, cb1[135].x
  iadd r5.z, r0.y, r0.x
  iadd r3.w, r3.w, r5.z
  and r3.w, r3.w, l(1)
  mad r3.xyz, r3.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
  dp3 r5.z, r3.xyzx, r3.xyzx
  rsq r5.z, r5.z
  mul r6.xyz, r3.xyzx, r5.zzzz
  mad r4.w, r4.w, l(16.000000), l(-8.000000)
  exp r4.w, r4.w
  add r4.w, r4.w, l(-0.00390625000)
  and r1.w, r1.w, l(16)
  movc r5.xy, r1.wwww, l(0,0,0,0), r5.xyxx
  mul r1.w, r1.y, l(0.080000)
  mad r4.xyz, -r1.yyyy, l(0.080000, 0.080000, 0.080000, 0.000000), r4.xyzx
  mad r4.xyz, r1.xxxx, r4.xyzx, r1.wwww
  ieq r7.xy, r2.xxxx, l(5, 4, 0, 0)
  lt r1.w, l(0.000000), cb1[139].x
  lt r2.x, l(0.000000), cb1[169].w
  and r1.w, r1.w, r2.x
  movc r2.x, r3.w, l(0), l(1.000000)
  mul r8.xyz, r2.xxxx, r4.xyzx
  movc r8.xyz, r1.wwww, r8.xyzx, r4.xyzx
  movc r4.xyz, r7.xxxx, r8.xyzx, r4.xyzx
  mad r4.xyz, r4.xyzx, cb1[121].wwww, cb1[121].xyzx
  utof r7.xz, r0.xxyx
  add r7.xz, r7.xxzx, l(0.500000, 0.000000, 0.500000, 0.000000)
  mul r7.xz, r7.xxzx, cb1[118].zzwz
  sample_l_indexable(texture2d)(float,float,float,float) r1.w, r7.xzxx, t5.yzwx, s0, l(0.000000)
  mul r2.xy, r2.wwww, r2.yzyy
  
  // Fix
  add r36.w, r2.w, -r36.y
  mad r2.x, -r36.w, r36.x, r2.x
  
  mul r8.xyzw, r2.yyyy, cb1[41].xyzw
  mad r8.xyzw, r2.xxxx, cb1[40].xyzw, r8.xyzw
  mad r8.xyzw, r2.wwww, cb1[42].xyzw, r8.xyzw
  add r8.xyzw, r8.xyzw, cb1[43].xyzw
  div r2.xyz, r8.xyzx, r8.wwww
  add r7.xzw, r2.xxyz, -cb1[55].xxyz
  dp3 r3.w, r7.xzwx, r7.xzwx
  rsq r3.w, r3.w
  mul r7.xzw, r3.wwww, r7.xxzw
  dp3 r1.x, -r7.xzwx, r6.xyzx
  add r3.w, r1.x, r1.x
  mad r7.xzw, r3.wwww, r6.xxyz, r7.xxzw
  mov_sat r1.x, r1.x
  mul r3.w, r1.z, r1.z
  mad r5.w, -r1.z, r1.z, l(1.000000)
  sqrt r6.w, r5.w
  mad r6.w, r1.z, r1.z, r6.w
  mul r5.w, r5.w, r6.w
  mad r3.xyz, -r3.xyzx, r5.zzzz, r7.xzwx
  mad r3.xyz, r5.wwww, r3.xyzx, r6.xyzx
  ld_indexable(texture2d)(float,float,float,float) r6.xyzw, r0.xyww, t10.xyzw
  add r5.z, -r6.w, l(1.000000)
  mad r8.xyzw, r6.xyzw, l(1.000000, 1.000000, 1.000000, -1.000000), l(0.000000, 0.000000, 0.000000, 1.000000)
  add r9.xyzw, -r8.xyzw, l(0.000000, 0.000000, 0.000000, 1.000000)
  mad r9.xyzw, r5.xxxx, r9.xyzw, r8.xyzw
  movc r8.xyzw, r7.yyyy, r9.xyzw, r8.xyzw
  add r5.w, r1.w, r1.x
  log r5.w, r5.w
  mul r3.w, r3.w, r5.w
  exp r3.w, r3.w
  add r1.w, r1.w, r3.w
  add_sat r1.w, r1.w, l(-1.000000)
  mul r3.w, r1.w, r8.w
  mad r2.w, r2.w, cb2[3].x, cb2[3].y
  log r2.w, r2.w
  mul r2.w, r2.w, cb2[3].z
  max r2.w, r2.w, l(0.000000)
  ftou r2.w, r2.w
  iadd r5.w, cb2[1].z, l(-1)
  umin r2.w, r2.w, r5.w
  ushr r9.xy, vThreadID.xyxx, cb2[2].xxxx
  imad r2.w, r2.w, cb2[1].y, r9.y
  imad r2.w, r2.w, cb2[1].x, r9.x
  iadd r2.w, r2.w, cb2[0].w
  ishl r5.w, r2.w, l(1)
  ld_indexable(buffer)(uint,uint,uint,uint) r5.w, r5.wwww, t7.yzwx
  bfi r2.w, l(31), l(1), r2.w, l(1)
  ld_indexable(buffer)(uint,uint,uint,uint) r2.w, r2.wwww, t7.yzwx
  log r6.w, r1.z
  mad r6.w, -r6.w, l(1.200000), l(1.000000)
  add r8.w, cb1[158].z, l(-1.000000)
  add r6.w, -r6.w, r8.w
  mov r9.xyz, l(0,0,0,0)
  mov r9.w, r3.w
  mov r10.xyz, l(0,1.000000,0,0)
  loop 
    uge r10.w, r10.z, r5.w
    breakc_nz r10.w
    lt r10.w, r9.w, l(0.001000)
    if_nz r10.w
      break 
    endif 
    iadd r10.w, r2.w, r10.z
    ld_indexable(buffer)(uint,uint,uint,uint) r10.w, r10.wwww, t8.yzwx
    add r11.xyz, r2.xyzx, -cb3[r10.w + 0].xyzx
    dp3 r11.w, r11.xyzx, r11.xyzx
    sqrt r12.x, r11.w
    lt r12.y, r12.x, cb3[r10.w + 0].w
    if_nz r12.y
      div_sat r12.x, r12.x, cb3[r10.w + 0].w
      dp3 r12.y, r3.xyzx, r11.xyzx
      mad r11.w, -cb3[r10.w + 0].w, cb3[r10.w + 0].w, r11.w
      mad r11.w, r12.y, r12.y, -r11.w
      ge r12.z, r11.w, l(0.000000)
      sqrt r11.w, r11.w
      add r11.w, -r12.y, r11.w
      mad r11.xyz, r11.wwww, r3.xyzx, r11.xyzx
      add r11.xyz, r11.xyzx, -cb3[r10.w + 682].xyzx
      mad r11.w, r12.x, l(2.500000), l(-1.500000)
      max r11.w, r11.w, l(0.000000)
      mul r12.x, r11.w, r11.w
      mad r11.w, -r11.w, l(2.000000), l(3.000000)
      mad r11.w, -r12.x, r11.w, l(1.000000)
      movc r12.xyz, r12.zzzz, r11.xyzx, r3.xyzx
      mov r12.w, cb3[r10.w + 341].y
      sample_l_indexable(texturecubearray)(float,float,float,float) r12.xyzw, r12.xyzw, t9.xyzw, s2, r6.w
      mul r11.xyz, r12.xyzx, cb3[r10.w + 341].xxxx
      mul r11.xyz, r11.wwww, r11.xyzx
      mad r9.xyz, r11.xyzx, r9.wwww, r9.xyzx
      mad r11.x, -r12.w, r11.w, l(1.000000)
      mul r9.w, r9.w, r11.x
      mul r10.w, r11.w, cb3[r10.w + 682].w
      mad r10.x, r10.w, r10.y, r10.x
      add r10.w, -r11.w, l(1.000000)
      mul r10.y, r10.w, r10.y
    endif 
    iadd r10.z, r10.z, l(1)
  endloop 
  mad_sat r3.x, r1.z, cb1[159].z, cb1[159].w
  mad r3.y, r3.x, l(-2.000000), l(3.000000)
  mul r3.x, r3.x, r3.x
  mul r3.x, r3.x, r3.y
  max r3.y, r10.x, l(0.000100)
  div r3.y, r4.w, r3.y
  add r3.y, r3.y, l(-1.000000)
  mad r3.x, r3.x, r3.y, l(1.000000)
  mad r3.xyz, r9.xyzx, r3.xxxx, r8.xyzx
  if_nz r7.y
    mov r1.y, r1.z
    sample_l_indexable(texture2d)(float,float,float,float) r8.xy, r1.xyxx, t6.xyzw, s1, l(0.000000)
    mul_sat r1.y, r4.y, l(50.000000)
    mul r1.y, r1.y, r8.y
    add r3.w, -r5.x, l(1.000000)
    mul r1.y, r1.y, r3.w
    mad r8.xyz, r4.xyzx, r8.xxxx, r1.yyyy
    mul r8.xyz, r3.xyzx, r8.xyzx
    add r1.y, -r1.x, l(1.000000)
    mul r3.w, r1.y, r1.y
    mul r3.w, r3.w, r3.w
    mul r6.w, r1.y, r3.w
    mad r1.y, -r3.w, r1.y, l(1.000000)
    mad r1.y, r1.y, l(0.040000), r6.w
    mul r3.w, r5.x, r1.y
    mad r1.y, -r1.y, r5.x, l(1.000000)
    mul r6.xyz, r3.wwww, r6.xyzx
    mad r6.xyz, r8.xyzx, r1.yyyy, r6.xyzx
    mul r1.y, r5.z, r3.w
    mul r1.y, r1.w, r1.y
    log r1.w, r5.y
    mad r1.w, -r1.w, l(1.200000), l(1.000000)
    add r1.w, -r1.w, r8.w
    mov r8.xyz, l(0,0,0,0)
    mov r3.w, r1.y
    mov r5.xz, l(0,0,1.000000,0)
    mov r6.w, l(0)
    loop 
      uge r7.y, r6.w, r5.w
      breakc_nz r7.y
      lt r7.y, r3.w, l(0.001000)
      if_nz r7.y
        break 
      endif 
      iadd r7.y, r2.w, r6.w
      ld_indexable(buffer)(uint,uint,uint,uint) r7.y, r7.yyyy, t8.yxzw
      add r9.xyz, r2.xyzx, -cb3[r7.y + 0].xyzx
      dp3 r8.w, r9.xyzx, r9.xyzx
      sqrt r9.w, r8.w
      lt r10.x, r9.w, cb3[r7.y + 0].w
      if_nz r10.x
        div_sat r9.w, r9.w, cb3[r7.y + 0].w
        dp3 r10.x, r7.xzwx, r9.xyzx
        mad r8.w, -cb3[r7.y + 0].w, cb3[r7.y + 0].w, r8.w
        mad r8.w, r10.x, r10.x, -r8.w
        ge r10.y, r8.w, l(0.000000)
        sqrt r8.w, r8.w
        add r8.w, -r10.x, r8.w
        mad r9.xyz, r8.wwww, r7.xzwx, r9.xyzx
        add r9.xyz, r9.xyzx, -cb3[r7.y + 682].xyzx
        mad r8.w, r9.w, l(2.500000), l(-1.500000)
        max r8.w, r8.w, l(0.000000)
        mul r9.w, r8.w, r8.w
        mad r8.w, -r8.w, l(2.000000), l(3.000000)
        mad r8.w, -r9.w, r8.w, l(1.000000)
        movc r9.xyz, r10.yyyy, r9.xyzx, r7.xzwx
        mov r9.w, cb3[r7.y + 341].y
        sample_l_indexable(texturecubearray)(float,float,float,float) r9.xyzw, r9.xyzw, t9.xyzw, s2, r1.w
        mul r9.xyz, r9.xyzx, cb3[r7.y + 341].xxxx
        mul r9.xyz, r8.wwww, r9.xyzx
        mad r8.xyz, r9.xyzx, r3.wwww, r8.xyzx
        mad r9.x, -r9.w, r8.w, l(1.000000)
        mul r3.w, r3.w, r9.x
        mul r7.y, r8.w, cb3[r7.y + 682].w
        mad r5.x, r7.y, r5.z, r5.x
        add r7.y, -r8.w, l(1.000000)
        mul r5.z, r5.z, r7.y
      endif 
      iadd r6.w, r6.w, l(1)
    endloop 
    mad_sat r1.y, r5.y, cb1[159].z, cb1[159].w
    mad r1.w, r1.y, l(-2.000000), l(3.000000)
    mul r1.y, r1.y, r1.y
    mul r1.y, r1.y, r1.w
    max r1.w, r5.x, l(0.000100)
    div r1.w, r4.w, r1.w
    add r1.w, r1.w, l(-1.000000)
    mad r1.y, r1.y, r1.w, l(1.000000)
    mad r2.xyz, r8.xyzx, r1.yyyy, r6.xyzx
  else 
    sample_l_indexable(texture2d)(float,float,float,float) r1.xy, r1.xzxx, t6.xyzw, s1, l(0.000000)
    mul_sat r1.z, r4.y, l(50.000000)
    mul r1.y, r1.y, r1.z
    mad r1.xyz, r4.xyzx, r1.xxxx, r1.yyyy
    mul r2.xyz, r1.xyzx, r3.xyzx
  endif 
else 
  mov r2.xyz, l(0,0,0,0)
endif 
ult r1.xy, vThreadID.xyxx, cb0[4].zwzz
and r1.x, r1.y, r1.x
if_nz r1.x
  min r1.xyz, -r2.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  mov r1.xyz, -r1.xyzx
  ld_indexable(texture2d)(float,float,float,float) r2.xyzw, r0.xyzw, t11.xyzw
  mov r1.w, l(0)
  add r1.xyzw, r1.xyzw, r2.xyzw
  store_uav_typed u0.xyzw, r0.xyyy, r1.xyzw
endif 
ret 
// Approximately 0 instruction slots used
