//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.7 on Thu Nov 12 18:22:04 2015
//
//
// 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[4], immediateIndexed
dcl_constantbuffer cb12[30], immediateIndexed
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) t4
dcl_resource_structured t6, 48 
dcl_resource_structured t7, 512 
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_uav_typed_texture2d (float,float,float,float) u1
dcl_resource_texture2d (float,float,float,float) t125
dcl_input vThreadGroupID.xy
dcl_input vThreadIDInGroup.xy
//dcl_temps 22
dcl_temps 28

dcl_thread_group 8, 8, 1
ftou r0.x, cb0[2].z
imad r0.x, vThreadGroupID.y, r0.x, vThreadGroupID.x
imad r0.yz, vThreadGroupID.xxyx, l(0, 8, 8, 0), vThreadIDInGroup.xxyx
ld_structured_indexable(structured_buffer, stride=512)(mixed,mixed,mixed,mixed) r0.w, r0.x, l(0), t7.xxxx
mul r1.x, cb0[2].y, l(0.333333343)
umin r1.y, r0.w, l(127)
sincos r2.xy, r3.xy, cb12[29].yxyy
mov r4.x, l(0)
mov r5.w, l(0)
mov r6.zw, l(0,0,0,0)
mov r7.w, l(1.000000)
mov r8.w, l(0)
mov r4.y, l(0)
loop 
  uge r1.z, r4.y, l(1)
  breakc_nz r1.z
  iadd r6.xy, r0.yzyy, r4.xyxx
  if_nz r0.w
    ld_indexable(texture2d)(float,float,float,float) r1.z, r6.xyww, t0.yzxw
    ge r1.w, l(0.010000), r1.z
    if_nz r1.w
      mul r7.z, r1.z, l(100.000000)
      mov r9.xyzw, cb12[24].xyzw
      mov r10.xyzw, cb12[25].xyzw
      mov r11.xyzw, cb12[26].xyzw
      mov r12.xyzw, cb12[27].xyzw
    else 
      mad r7.z, r1.z, l(1.010000), l(-0.010000)
      mov r9.xyzw, cb12[20].xyzw
      mov r10.xyzw, cb12[21].xyzw
      mov r11.xyzw, cb12[22].xyzw
      mov r12.xyzw, cb12[23].xyzw
    endif 
    utof r1.zw, r6.xxxy
    mul r13.x, r1.z, cb0[3].x
    mad r13.z, -cb0[3].y, r1.w, l(1.000000)
    mad r7.xy, r13.xzxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
    dp4 r9.x, r9.xyzw, r7.xyzw
    dp4 r9.y, r10.xyzw, r7.xyzw
    dp4 r9.z, r11.xyzw, r7.xyzw
    dp4 r1.z, r12.xyzw, r7.xyzw
    div r7.xyz, r9.xyzx, r1.zzzz

ld_indexable(texture2d)(float,float,float,float) r28.xyzw, l(0, 0, 0, 0), t125.xyzw
add r28.w, r7.z, -r28.y
mul r28.w, r28.w, r28.x
mul r28.w, r28.w, cb12[20].x
add r7.x, r7.x, -r28.w

    ld_indexable(texture2d)(float,float,float,float) r1.zw, r6.xyww, t2.zwxy
    mad r1.zw, r1.zzzw, l(0.000000, 0.000000, 4.000000, 4.000000), l(0.000000, 0.000000, -2.000000, -2.000000)
    dp2 r2.z, r1.zwzz, r1.zwzz
    mad r2.zw, -r2.zzzz, l(0.000000, 0.000000, 0.250000, 0.500000), l(0.000000, 0.000000, 1.000000, 1.000000)
    sqrt r2.z, r2.z
    mul r9.xy, r1.zwzz, r2.zzzz
    mov r9.z, -r2.w
    dp3 r1.z, -r7.xyzx, -r7.xyzx
    rsq r1.z, r1.z
    mul r10.xyz, r1.zzzz, -r7.xyzx
    ld_indexable(texture2d)(float,float,float,float) r11.xyzw, r6.xyww, t4.xyzw
    add r1.w, -r11.x, l(1.000000)
    mul r2.z, r11.y, l(3.14159274)
    mad r3.zw, r11.wwwx, l(0.000000, 0.000000, 255.000000, 10.000000), l(0.000000, 0.000000, -1.000000, 1.000000)
    lt r2.w, |r3.z|, l(0.250000)
    ld_indexable(texture2d)(float,float,float,float) r3.z, r6.xyzw, t1.xywz
    exp r3.w, r3.w
    dp3 r4.z, r11.xyzx, r10.xyzx
    mul r4.w, r4.z, r4.z
    min r4.w, r4.w, l(1.000000)
    add r4.w, -r4.w, l(1.000000)
    sqrt r4.w, r4.w
    dp3 r9.w, r9.xyzx, r10.xyzx
    mad r12.xyz, -r9.xyzx, r9.wwww, r10.xyzx
    mad r10.w, -r9.w, r9.w, l(1.000000)
    mov_sat r11.w, r9.w
    add r12.w, r3.w, l(2.000000)
    mul r12.w, r12.w, l(0.159154937)
    div r13.x, l(1.000000, 1.000000, 1.000000, 1.000000), r11.w
    add r13.y, -r11.w, l(1.000000)
    log r13.y, r13.y
    mul r13.y, r13.y, l(0.010000)
    exp r13.y, r13.y
    mov r14.xyz, l(0,0,0,0)
    mov r8.xyz, l(0,0,0,0)
    mov r13.z, l(0)
    loop 
      uge r13.w, r13.z, r1.y
      breakc_nz r13.w
      ishl r13.w, r13.z, l(2)
      iadd r13.w, r13.w, l(4)
      ld_structured_indexable(structured_buffer, stride=512)(mixed,mixed,mixed,mixed) r13.w, r0.x, r13.w, t7.xxxx
      ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r15.xyzw, r13.w, l(0), t6.xyzw
      ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r16.xyzw, r13.w, l(16), t6.yzwx
      ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r17.xyz, r13.w, l(32), t6.xyzx
      add r15.yzw, -r7.xxyz, r15.yyzw
      dp3 r13.w, r15.yzwy, r15.yzwy
      and r14.w, r15.x, l(8)
      if_z r14.w
        and r14.w, r15.x, l(4)
        rsq r17.w, r13.w
        mul r15.yzw, r15.yyzw, r17.wwww
        dp3 r17.w, r9.xyzx, r15.yzwy
        max r18.x, r17.w, l(0.000000)
        min r18.yzw, r18.xxxx, l(0.000000, 1.000000, 1.000000, 1.000000)
        if_nz r2.w
          dp3 r19.x, r11.xyzx, r15.yzwy
          mul r19.y, r19.x, r19.x
          min r19.y, r19.y, l(1.000000)
          add r19.y, -r19.y, l(1.000000)
          sqrt r19.y, r19.y
          mul r19.z, r2.x, r19.y
          mad r19.z, -r19.x, r3.x, -r19.z
          mad r19.w, -r19.z, r19.z, l(1.000000)
          sqrt r19.w, r19.w
          mul r19.w, r4.w, r19.w
          mad r19.z, r19.z, r4.z, r19.w
          max r19.z, r19.z, l(0.000000)
          log r19.z, r19.z
          mul r19.z, r19.z, cb12[28].w
          exp r19.z, r19.z
          mad_sat r19.z, cb12[28].z, r19.z, r18.x
          min r19.z, r3.z, r19.z
          mul r20.xyz, r16.xyzx, r19.zzzz
          and r19.z, r15.x, l(16)
          if_nz r19.z
            mul r19.y, r2.y, r19.y
            mad r19.x, -r19.x, r3.y, -r19.y
            mad r19.y, -r19.x, r19.x, l(1.000000)
            sqrt r19.y, r19.y
            mul r19.y, r4.w, r19.y
            mad r19.x, r19.x, r4.z, r19.y
            max r19.x, r19.x, l(0.000000)
            log r19.x, r19.x
            mul r19.x, r19.x, cb12[28].y
            exp r19.x, r19.x
            mul r19.x, r19.x, cb12[28].x
            mul r19.xyz, r16.xyzx, r19.xxxx
            mul r19.xyz, r18.yzwy, r19.xyzx
          else 
            mov r19.xyz, l(0,0,0,0)
          endif 
        else 
          and r21.xy, r15.xxxx, l(2, 16, 0, 0)
          movc r15.x, r21.x, l(0), r1.w
          ne r19.w, r15.x, l(0.000000)
          if_nz r19.w
            mad r21.xzw, -r9.xxyz, r17.wwww, r15.yyzw
            dp3 r19.w, r12.xyzx, r21.xzwx
            mul r20.w, r15.x, r15.x
            mad r21.xz, r15.xxxx, r15.xxxx, l(0.570000, 0.000000, 0.090000, 0.000000)
            div r21.xz, r20.wwww, r21.xxzx
            mul r15.x, r21.z, l(0.450000)
            mad r20.w, -r21.x, l(0.500000), l(1.000000)
            mad r21.x, -r17.w, r17.w, l(1.000000)
            mul_sat r21.x, r10.w, r21.x
            sqrt r21.x, r21.x
            max r17.w, r9.w, r17.w
            div r17.w, r21.x, r17.w
            max r19.w, r19.w, l(0.000000)
            mul r15.x, r15.x, r19.w
            mad r15.x, r15.x, r17.w, r20.w
            mul r21.xzw, r15.xxxx, r18.xxxx
          else 
            mov r21.xzw, r18.yyzw
          endif 
          mul r20.xyz, r16.xyzx, r21.xzwx
          if_nz r21.y
            mad r18.xyz, -r7.xyzx, r1.zzzz, r15.yzwy
            dp3 r15.x, r18.xyzx, r18.xyzx
            rsq r15.x, r15.x
            mul r18.xyz, r15.xxxx, r18.xyzx
            dp3_sat r15.x, r10.xyzx, r18.xyzx
            dp3_sat r17.w, r18.xyzx, r9.xyzx
            log r18.x, r17.w
            mul r18.x, r3.w, r18.x
            exp r18.x, r18.x
            mul r18.x, r12.w, r18.x
            max r18.y, r15.x, l(1.192092896E-007)
            min r18.z, r11.w, r18.w
            add r17.w, r17.w, r17.w
            mul r19.w, r17.w, r18.z
            ge r19.w, r18.y, r19.w
            eq r18.z, r11.w, r18.z
            div r20.w, r18.w, r11.w
            movc r18.z, r18.z, l(1.000000), r20.w
            mul r17.w, r17.w, r18.z
            div r17.w, r17.w, r18.y
            movc r17.w, r19.w, r17.w, r13.x
            add r15.x, -r15.x, l(1.000000)
            mul r18.y, r15.x, r15.x
            mul r18.y, r18.y, r18.y
            mul r18.z, r15.x, r18.y
            mad r15.x, -r15.x, r18.y, l(1.000000)
            mad r15.x, r15.x, l(0.200000), r18.z
            min r15.x, r15.x, l(1.000000)
            mul r15.x, r17.w, r15.x
            mul r15.x, r18.x, r15.x
            mul r15.x, r15.x, l(0.250000)
            min r15.x, r15.x, l(15.000000)
            mul r15.x, r2.z, r15.x
            mul r18.xyz, r15.xxxx, r16.xyzx
            mul r19.xyz, r18.wwww, r18.xyzx
          else 
            mov r19.xyz, l(0,0,0,0)
          endif 
        endif 
        if_z r14.w
          dp3_sat r14.w, r10.xyzx, -r15.yzwy
          mul r14.w, r13.y, r14.w
          mul r14.w, r18.w, r14.w
          mul r14.w, r1.w, r14.w
          mad r16.xyz, r16.xyzx, r14.wwww, r20.xyzx
        else 
          mov r16.xyz, r20.xyzx
        endif 
      else 
        mov r19.xyz, l(0,0,0,0)
      endif 
      sqrt r13.w, r13.w
      div_sat r13.w, r13.w, r16.w
      log r13.w, r13.w
      mul r13.w, r13.w, r17.z
      exp r13.w, r13.w
      mad_sat r13.w, r17.y, r13.w, r17.x
      add r13.w, -r13.w, l(1.000000)
      log r13.w, r13.w
      mul r13.w, r13.w, l(2.200000)
      exp r13.w, r13.w
      mad r14.xyz, r16.xyzx, r13.wwww, r14.xyzx
      mad r8.xyz, r19.xyzx, r13.wwww, r8.xyzx
      iadd r13.z, r13.z, l(1)
    endloop 
  else 
    mov r14.xyz, l(0,0,0,0)
    mov r8.xyz, l(0,0,0,0)
  endif 
  mul r5.xyz, r1.xxxx, r14.xyzx
  store_uav_typed u0.xyzw, r6.xyyy, r5.xyzw
  store_uav_typed u1.xyzw, r6.xyyy, r8.xyzw
  iadd r4.y, r4.y, l(1)
endloop 
ret 
// Approximately 0 instruction slots used
