// Reflections
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.65 on Wed Sep 20 22:55:10 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_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, 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_texturecube (float,float,float,float) t7
dcl_resource_texturecube (float,float,float,float) t8
dcl_resource_texture2d (float,float,float,float) t9
dcl_resource_buffer (uint,uint,uint,uint) t10
dcl_resource_buffer (uint,uint,uint,uint) t11
dcl_resource_texturecubearray (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t14
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_input vThreadID.xy
//dcl_temps 14
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
utof r1.xy, vThreadID.xyxx
add r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
iadd r1.zw, -cb0[4].xxxy, cb0[4].zzzw
utof r1.zw, r1.zzzw
div r1.xy, r1.xyxx, r1.zwzz
mad r1.xy, r1.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r2.xyz, r0.xyww, t0.xyzw
ld_indexable(texture2d)(float,float,float,float) r3.xyzw, r0.xyww, t1.xyzw
ld_indexable(texture2d)(float,float,float,float) r4.xyzw, r0.xyww, t2.xyzw
mad r2.xyz, r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r1.z, r2.xyzx, r2.xyzx
rsq r1.z, r1.z
mul r5.xyz, r1.zzzz, r2.xyzx
mul r1.w, r3.w, l(255.000000)
round_ne r1.w, r1.w
ftou r1.w, r1.w
and r2.w, r1.w, l(15)
mad r3.w, r4.w, l(16.000000), l(-8.000000)
exp r3.w, r3.w
add r3.w, r3.w, l(-0.00390625000)
lt r6.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[0].yzyy
and r4.w, r6.y, r6.x
if_nz r4.w
  mad r6.yz, r1.xxyx, cb1[54].xxyx, cb1[54].wwzw
  sample_l_indexable(texture2d)(float,float,float,float) r6.yzw, r6.yzyy, t9.wxyz, s4, l(0.000000)
  dp3 r4.w, r6.yzwy, r6.yzwy
  sqrt r4.w, r4.w
  mov r5.w, l(1.000000)
  dp4 r7.x, cb1[151].xyzw, r5.xyzw
  dp4 r7.y, cb1[152].xyzw, r5.xyzw
  dp4 r7.z, cb1[153].xyzw, r5.xyzw
  mul r8.xyzw, r5.yzzx, r5.xyzz
  dp4 r9.x, cb1[154].xyzw, r8.xyzw
  dp4 r9.y, cb1[155].xyzw, r8.xyzw
  dp4 r9.z, cb1[156].xyzw, r8.xyzw
  mul r5.w, r5.y, r5.y
  mad r5.w, r5.x, r5.x, -r5.w
  add r6.yzw, r7.xxyz, r9.xxyz
  mad r6.yzw, cb1[157].xxyz, r5.wwww, r6.yyzw
  max r6.yzw, r6.yyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
  mul r6.yzw, r6.yyzw, cb1[150].xxyz
  dp3 r5.w, r6.yzwy, l(0.300000, 0.590000, 0.110000, 0.000000)
  mad r3.w, r5.w, r4.w, r3.w
endif 
ine r6.yz, r2.wwww, l(0, 0, 7, 0)
and r4.w, r6.z, r6.y
if_nz r4.w
  ld_indexable(texture2d)(float,float,float,float) r4.w, r0.xyww, t4.yzwx
  mad r5.w, r4.w, cb1[53].x, cb1[53].y
  mad r4.w, r4.w, cb1[53].z, -cb1[53].w
  div r4.w, l(1.000000, 1.000000, 1.000000, 1.000000), r4.w
  add r4.w, r4.w, r5.w
  ld_indexable(texture2d)(float,float,float,float) r6.yz, r0.xyww, t3.zxyw
  ftou r5.w, cb1[135].x
  iadd r6.w, r0.y, r0.x
  iadd r5.w, r5.w, r6.w
  and r5.w, r5.w, l(1)
  and r1.w, r1.w, l(16)
  movc r6.yz, r1.wwww, l(0,0,0,0), r6.yyzy
  mul r1.w, r3.y, l(0.080000)
  mad r4.xyz, -r3.yyyy, l(0.080000, 0.080000, 0.080000, 0.000000), r4.xyzx
  mad r4.xyz, r3.xxxx, r4.xyzx, r1.wwww
  ieq r7.xy, r2.wwww, l(5, 4, 0, 0)
  lt r1.w, l(0.000000), cb1[139].x
  lt r2.w, l(0.000000), cb1[169].w
  and r1.w, r1.w, r2.w
  movc r2.w, r5.w, l(0), l(1.000000)
  mul r8.xyz, r2.wwww, 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 r1.xy, r1.xyxx, r4.wwww
  
  // Fix
  add r36.w, r4.w, -r36.y
  mad r1.x, -r36.w, r36.x, r1.x
  
  mul r8.xyzw, r1.yyyy, cb1[41].xyzw
  mad r8.xyzw, r1.xxxx, cb1[40].xyzw, r8.xyzw
  mad r8.xyzw, r4.wwww, cb1[42].xyzw, r8.xyzw
  add r8.xyzw, r8.xyzw, cb1[43].xyzw
  div r7.xzw, r8.xxyz, r8.wwww
  add r8.xyz, r7.xzwx, -cb1[55].xyzx
  dp3 r1.x, r8.xyzx, r8.xyzx
  rsq r1.x, r1.x
  mul r8.xyz, r1.xxxx, r8.xyzx
  dp3 r3.x, -r8.xyzx, r5.xyzx
  add r1.x, r3.x, r3.x
  mad r8.xyz, r1.xxxx, r5.xyzx, r8.xyzx
  mov_sat r3.x, r3.x
  mul r1.x, r3.z, r3.z
  mad r1.y, -r3.z, r3.z, l(1.000000)
  sqrt r2.w, r1.y
  mad r2.w, r3.z, r3.z, r2.w
  mul r1.y, r1.y, r2.w
  mad r2.xyz, -r2.xyzx, r1.zzzz, r8.xyzx
  mad r2.xyz, r1.yyyy, r2.xyzx, r5.xyzx
  ld_indexable(texture2d)(float,float,float,float) r5.xyzw, r0.xyww, t13.xyzw
  add r1.y, -r5.w, l(1.000000)
  mad r9.xyzw, r5.xyzw, l(1.000000, 1.000000, 1.000000, -1.000000), l(0.000000, 0.000000, 0.000000, 1.000000)
  add r10.xyzw, -r9.xyzw, l(0.000000, 0.000000, 0.000000, 1.000000)
  mad r10.xyzw, r6.yyyy, r10.xyzw, r9.xyzw
  movc r9.xyzw, r7.yyyy, r10.xyzw, r9.xyzw
  add r1.z, r1.w, r3.x
  log r1.z, r1.z
  mul r1.x, r1.z, r1.x
  exp r1.x, r1.x
  add r1.x, r1.w, r1.x
  add_sat r1.x, r1.x, l(-1.000000)
  mul r1.z, r1.x, r9.w
  mad r1.w, r4.w, cb2[3].x, cb2[3].y
  log r1.w, r1.w
  mul r1.w, r1.w, cb2[3].z
  max r1.w, r1.w, l(0.000000)
  ftou r1.w, r1.w
  iadd r2.w, cb2[1].z, l(-1)
  umin r1.w, r1.w, r2.w
  ushr r10.xy, vThreadID.xyxx, cb2[2].xxxx
  imad r1.w, r1.w, cb2[1].y, r10.y
  imad r1.w, r1.w, cb2[1].x, r10.x
  iadd r1.w, r1.w, cb2[0].w
  ishl r2.w, r1.w, l(1)
  ld_indexable(buffer)(uint,uint,uint,uint) r2.w, r2.wwww, t10.yzwx
  bfi r1.w, l(31), l(1), r1.w, l(1)
  ld_indexable(buffer)(uint,uint,uint,uint) r1.w, r1.wwww, t10.yzwx
  log r4.w, r3.z
  mad r4.w, -r4.w, l(1.200000), l(1.000000)
  add r5.w, cb1[158].z, l(-1.000000)
  add r6.w, -r4.w, r5.w
  mov r8.w, r1.z
  mov r10.xyzw, l(0,0,0,0)
  mov r9.w, l(1.000000)
  mov r11.x, l(0)
  loop 
    uge r11.y, r11.x, r2.w
    breakc_nz r11.y
    lt r11.y, r8.w, l(0.001000)
    if_nz r11.y
      break 
    endif 
    iadd r11.y, r1.w, r11.x
    ld_indexable(buffer)(uint,uint,uint,uint) r11.y, r11.yyyy, t11.yxzw
    add r12.xyz, r7.xzwx, -cb3[r11.y + 0].xyzx
    dp3 r11.z, r12.xyzx, r12.xyzx
    sqrt r11.w, r11.z
    lt r12.w, r11.w, cb3[r11.y + 0].w
    if_nz r12.w
      div_sat r11.w, r11.w, cb3[r11.y + 0].w
      dp3 r12.w, r2.xyzx, r12.xyzx
      mad r11.z, -cb3[r11.y + 0].w, cb3[r11.y + 0].w, r11.z
      mad r11.z, r12.w, r12.w, -r11.z
      ge r13.x, r11.z, l(0.000000)
      sqrt r11.z, r11.z
      add r11.z, -r12.w, r11.z
      mad r12.xyz, r11.zzzz, r2.xyzx, r12.xyzx
      add r12.xyz, r12.xyzx, -cb3[r11.y + 682].xyzx
      mad r11.z, r11.w, l(2.500000), l(-1.500000)
      max r11.z, r11.z, l(0.000000)
      mul r11.w, r11.z, r11.z
      mad r11.z, -r11.z, l(2.000000), l(3.000000)
      mad r11.z, -r11.w, r11.z, l(1.000000)
      movc r12.xyz, r13.xxxx, r12.xyzx, r2.xyzx
      mov r12.w, cb3[r11.y + 341].y
      sample_l_indexable(texturecubearray)(float,float,float,float) r12.xyzw, r12.xyzw, t12.xyzw, s5, r6.w
      mul r12.xyz, r12.xyzx, cb3[r11.y + 341].xxxx
      mul r12.xyz, r11.zzzz, r12.xyzx
      mad r10.xyz, r12.xyzx, r8.wwww, r10.xyzx
      mad r11.w, -r12.w, r11.z, l(1.000000)
      mul r8.w, r8.w, r11.w
      mul r11.y, r11.z, cb3[r11.y + 682].w
      mad r10.w, r11.y, r9.w, r10.w
      add r11.y, -r11.z, l(1.000000)
      mul r9.w, r9.w, r11.y
    endif 
    iadd r11.x, r11.x, l(1)
  endloop 
  if_nz r6.x
    add r1.z, -r4.w, cb0[0].x
    add r1.z, r1.z, l(-1.000000)
    sample_l_indexable(texturecube)(float,float,float,float) r11.xyz, r2.xyzx, t7.xyzw, s2, r1.z
    mul r11.xyz, r11.xyzx, cb1[150].xyzx
    lt r4.w, l(0.000000), cb0[0].w
    if_nz r4.w
      sample_l_indexable(texturecube)(float,float,float,float) r2.xyz, r2.xyzx, t8.xyzw, s3, r1.z
      mad r2.xyz, r2.xyzx, cb1[150].xyzx, -r11.xyzx
      mad r11.xyz, cb0[0].wwww, r2.xyzx, r11.xyzx
    endif 
    lt r1.z, cb0[0].z, l(1.000000)
    mad r12.xyz, r8.wwww, r11.xyzx, r10.xyzx
    mad r12.w, cb0[1].x, r9.w, r10.w
    movc r2.xyz, r1.zzzz, l(0,0,0,0), r11.xyzx
    movc r10.xyzw, r1.zzzz, r12.xyzw, r10.xyzw
  else 
    mov r2.xyz, l(0,0,0,0)
  endif 
  mad_sat r1.z, r3.z, cb1[159].z, cb1[159].w
  mad r4.w, r1.z, l(-2.000000), l(3.000000)
  mul r1.z, r1.z, r1.z
  mul r1.z, r1.z, r4.w
  max r4.w, r10.w, l(0.000100)
  div r4.w, r3.w, r4.w
  add r4.w, r4.w, l(-1.000000)
  mad r1.z, r1.z, r4.w, l(1.000000)
  mul r2.xyz, r2.xyzx, r8.wwww
  mad r2.xyz, r10.xyzx, r1.zzzz, r2.xyzx
  add r2.xyz, r2.xyzx, r9.xyzx
  if_nz r7.y
    mov r3.y, r3.z
    sample_l_indexable(texture2d)(float,float,float,float) r9.xy, r3.xyxx, t6.xyzw, s1, l(0.000000)
    mul_sat r1.z, r4.y, l(50.000000)
    mul r1.z, r1.z, r9.y
    add r3.y, -r6.y, l(1.000000)
    mul r1.z, r1.z, r3.y
    mad r9.xyz, r4.xyzx, r9.xxxx, r1.zzzz
    mul r9.xyz, r2.xyzx, r9.xyzx
    add r1.z, -r3.x, l(1.000000)
    mul r3.y, r1.z, r1.z
    mul r3.y, r3.y, r3.y
    mul r4.w, r1.z, r3.y
    mad r1.z, -r3.y, r1.z, l(1.000000)
    mad r1.z, r1.z, l(0.040000), r4.w
    mul r3.y, r6.y, r1.z
    mad r1.z, -r1.z, r6.y, l(1.000000)
    mul r5.xyz, r3.yyyy, r5.xyzx
    mad r5.xyz, r9.xyzx, r1.zzzz, r5.xyzx
    mul r1.y, r1.y, r3.y
    mul r1.x, r1.x, r1.y
    log r1.y, r6.z
    mad r1.y, -r1.y, l(1.200000), l(1.000000)
    add r1.z, -r1.y, r5.w
    mov r3.y, r1.x
    mov r9.xyzw, l(0,0,0,0)
    mov r4.w, l(1.000000)
    mov r5.w, l(0)
    loop 
      uge r6.y, r5.w, r2.w
      breakc_nz r6.y
      lt r6.y, r3.y, l(0.001000)
      if_nz r6.y
        break 
      endif 
      iadd r6.y, r1.w, r5.w
      ld_indexable(buffer)(uint,uint,uint,uint) r6.y, r6.yyyy, t11.yxzw
      add r10.xyz, r7.xzwx, -cb3[r6.y + 0].xyzx
      dp3 r6.w, r10.xyzx, r10.xyzx
      sqrt r7.y, r6.w
      lt r8.w, r7.y, cb3[r6.y + 0].w
      if_nz r8.w
        div_sat r7.y, r7.y, cb3[r6.y + 0].w
        dp3 r8.w, r8.xyzx, r10.xyzx
        mad r6.w, -cb3[r6.y + 0].w, cb3[r6.y + 0].w, r6.w
        mad r6.w, r8.w, r8.w, -r6.w
        ge r10.w, r6.w, l(0.000000)
        sqrt r6.w, r6.w
        add r6.w, -r8.w, r6.w
        mad r10.xyz, r6.wwww, r8.xyzx, r10.xyzx
        add r10.xyz, r10.xyzx, -cb3[r6.y + 682].xyzx
        mad r6.w, r7.y, l(2.500000), l(-1.500000)
        max r6.w, r6.w, l(0.000000)
        mul r7.y, r6.w, r6.w
        mad r6.w, -r6.w, l(2.000000), l(3.000000)
        mad r6.w, -r7.y, r6.w, l(1.000000)
        movc r10.xyz, r10.wwww, r10.xyzx, r8.xyzx
        mov r10.w, cb3[r6.y + 341].y
        sample_l_indexable(texturecubearray)(float,float,float,float) r10.xyzw, r10.xyzw, t12.xyzw, s5, r1.z
        mul r10.xyz, r10.xyzx, cb3[r6.y + 341].xxxx
        mul r10.xyz, r6.wwww, r10.xyzx
        mad r9.xyz, r10.xyzx, r3.yyyy, r9.xyzx
        mad r7.y, -r10.w, r6.w, l(1.000000)
        mul r3.y, r3.y, r7.y
        mul r6.y, r6.w, cb3[r6.y + 682].w
        mad r9.w, r6.y, r4.w, r9.w
        add r6.y, -r6.w, l(1.000000)
        mul r4.w, r4.w, r6.y
      endif 
      iadd r5.w, r5.w, l(1)
    endloop 
    if_nz r6.x
      add r1.x, -r1.y, cb0[0].x
      add r1.x, r1.x, l(-1.000000)
      sample_l_indexable(texturecube)(float,float,float,float) r1.yzw, r8.xyzx, t7.wxyz, s2, r1.x
      mul r1.yzw, r1.yyzw, cb1[150].xxyz
      lt r2.w, l(0.000000), cb0[0].w
      if_nz r2.w
        sample_l_indexable(texturecube)(float,float,float,float) r6.xyw, r8.xyzx, t8.xywz, s3, r1.x
        mad r6.xyw, r6.xyxw, cb1[150].xyxz, -r1.yzyw
        mad r1.yzw, cb0[0].wwww, r6.xxyw, r1.yyzw
      endif 
      lt r1.x, cb0[0].z, l(1.000000)
      mad r7.xyz, r3.yyyy, r1.yzwy, r9.xyzx
      mad r7.w, cb0[1].x, r4.w, r9.w
      movc r1.yzw, r1.xxxx, l(0,0,0,0), r1.yyzw
      movc r9.xyzw, r1.xxxx, r7.xyzw, r9.xyzw
    else 
      mov r1.yzw, l(0,0,0,0)
    endif 
    mad_sat r1.x, r6.z, cb1[159].z, cb1[159].w
    mad r2.w, r1.x, l(-2.000000), l(3.000000)
    mul r1.x, r1.x, r1.x
    mul r1.x, r1.x, r2.w
    max r2.w, r9.w, l(0.000100)
    div r2.w, r3.w, r2.w
    add r2.w, r2.w, l(-1.000000)
    mad r1.x, r1.x, r2.w, l(1.000000)
    mul r1.yzw, r1.yyzw, r3.yyyy
    mad r1.xyz, r9.xyzx, r1.xxxx, r1.yzwy
    add r1.xyz, r1.xyzx, r5.xyzx
  else 
    sample_l_indexable(texture2d)(float,float,float,float) r3.xy, r3.xzxx, t6.xyzw, s1, l(0.000000)
    mul_sat r1.w, r4.y, l(50.000000)
    mul r1.w, r3.y, r1.w
    mad r3.xyz, r4.xyzx, r3.xxxx, r1.wwww
    mul r1.xyz, r2.xyzx, r3.xyzx
  endif 
else 
  mov r1.xyz, l(0,0,0,0)
endif 
ult r2.xy, vThreadID.xyxx, cb0[4].zwzz
and r1.w, r2.y, r2.x
if_nz r1.w
  min r1.xyz, -r1.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, t14.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
