//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Sat May 22 13:57:46 2021
//
//
// 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[1], immediateIndexed
dcl_constantbuffer cb1[52], immediateIndexed
dcl_constantbuffer cb2[60], immediateIndexed
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_uav_typed_texture2d (float,float,float,float) u1
dcl_input vThreadID.xy
dcl_temps 40
dcl_resource_texture2d (float,float,float,float) t125
dcl_thread_group 8, 8, 1

ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw

imad r0.xy, vThreadID.xyxx, cb0[0].xyxx, cb0[0].zwzz
mov r1.zw, l(0,0,0,0)
mov r2.xyz, l(0,0,0,0)
mov r3.w, l(0)
mov r0.z, l(0)
loop
  ige r0.w, r0.z, l(3)
  breakc_nz r0.w
  mov r4.y, r0.z
  mov r5.xyz, r2.xyzx
  mov r0.w, r3.w
  mov r2.w, l(0)
  loop
    ige r4.z, r2.w, l(2)
    breakc_nz r4.z
    mov r4.x, r2.w
    iadd r1.xy, r0.xyxx, r4.xyxx
    ld_indexable(texture2d)(float,float,float,float) r4.xzw, r1.xyww, t0.xwyz
    ld_indexable(texture2d)(float,float,float,float) r1.x, r1.xyzw, t1.xyzw
	
    add r4.xzw, r4.xxzw, l(1.000000, 0.000000, 1.000000, 1.000000)
    log r4.xzw, r4.xxzw
    add r5.xyz, r4.xzwx, r5.xyzx
    max r0.w, r0.w, r1.x
    iadd r2.w, r2.w, l(1)
  endloop
  mov r2.xyz, r5.xyzx
  mov r3.w, r0.w
  iadd r0.z, r0.z, l(1)
endloop

//mad r2.x, r25.x, l(2560.0), r2.x

mul r0.xyz, r2.xyzx, l(0.166666672, 0.166666672, 0.166666672, 0.000000)
exp r0.xyz, r0.xyzx
add r0.xyz, r0.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
mul r1.xyz, r0.xyzx, l(0.250000, 0.250000, 0.250000, 0.000000)
dp3 r0.w, r0.xzyx, l(0.062500, 0.062500, 0.125000, 0.000000)
add r0.w, r0.w, l(1.000000)
rcp r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
sqrt r3.xyz, r1.xyzx
store_uav_typed u1.xyzw, vThreadID.xyyy, r3.xyzw
mul r0.w, r3.w, r3.w
mad r0.w, r0.w, cb1[51].z, -cb1[51].w
div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
mad r0.w, r0.w, cb2[59].w, l(1.000000)
div r0.w, cb2[59].z, r0.w
add r0.w, r0.w, -cb2[59].z
add_sat r0.w, r0.w, l(1.000000)
max r0.w, r0.w, l(0.010000)
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx

//mad r1.x, r25.x, l(2560.0), r1.x

mul r1.xyz, r0.xyzx, l(0.250000, 0.250000, 0.250000, 0.000000)
dp3 r0.x, r0.xzyx, l(0.062500, 0.062500, 0.125000, 0.000000)
add r0.x, r0.x, l(1.000000)
rcp r0.x, r0.x
mul r0.xyz, r0.xxxx, r1.xyzx
sqrt r3.xyz, r0.xyzx
store_uav_typed u0.xyzw, vThreadID.xyyy, r3.xyzw
ret
// Approximately 0 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Sat May 22 13:57:46 2021
// Texture2D<float4> t1 : register(t1);
//
// Texture2D<float4> t0 : register(t0);
//
// cbuffer cb2 : register(b2)
// {
//   float4 cb2[60];
// }
//
// cbuffer cb1 : register(b1)
// {
//   float4 cb1[52];
// }
//
// cbuffer cb0 : register(b0)
// {
//   float4 cb0[1];
// }
//
//
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main)
// {
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u0
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_uav_typed_texture2d (float,float,float,float) u1
//   float4 r0,r1,r2,r3,r4,r5;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_thread_group 8, 8, 1
//   r0.xy = mad((int2)vThreadID.xy, asint(cb0[0].xy), asint(cb0[0].zw));
//   r1.zw = float2(0,0);
//   r2.xyz = float3(0,0,0);
//   r3.w = 0;
//   r0.z = 0;
//   while (true) {
//     r0.w = cmp((int)r0.z >= 3);
//     if (r0.w != 0) break;
//     r4.y = r0.z;
//     r5.xyz = r2.xyz;
//     r0.w = r3.w;
//     r2.w = 0;
//     while (true) {
//       r4.z = cmp((int)r2.w >= 2);
//       if (r4.z != 0) break;
//       r4.x = r2.w;
//       r1.xy = (int2)r0.xy + (int2)r4.xy;
//       r4.xzw = t0.Load(r1.xyw).xyz;
//       r1.x = t1.Load(r1.xyz).x;
//       r4.xzw = float3(1,1,1) + r4.xzw;
//       r4.xzw = log2(r4.xzw);
//       r5.xyz = r5.xyz + r4.xzw;
//       r0.w = max(r1.x, r0.w);
//       r2.w = (int)r2.w + 1;
//     }
//     r2.xyz = r5.xyz;
//     r3.w = r0.w;
//     r0.z = (int)r0.z + 1;
//   }
//   r0.xyz = float3(0.166666672,0.166666672,0.166666672) * r2.xyz;
//   r0.xyz = exp2(r0.xyz);
//   r0.xyz = float3(-1,-1,-1) + r0.xyz;
//   r1.xyz = float3(0.25,0.25,0.25) * r0.xyz;
//   r0.w = dot(r0.xzy, float3(0.0625,0.0625,0.125));
//   r0.w = 1 + r0.w;
//   r0.w = rcp(r0.w);
//   r1.xyz = r1.xyz * r0.www;
//   r3.xyz = sqrt(r1.xyz);
// // No code for instruction (needs manual fix):
// store_uav_typed u1.xyzw, vThreadID.xyyy, r3.xyzw
//   r0.w = r3.w * r3.w;
//   r0.w = r0.w * cb1[51].z + -cb1[51].w;
//   r0.w = 1 / r0.w;
//   r0.w = r0.w * cb2[59].w + 1;
//   r0.w = cb2[59].z / r0.w;
//   r0.w = -cb2[59].z + r0.w;
//   r0.w = saturate(1 + r0.w);
//   r0.w = max(0.00999999978, r0.w);
//   r0.w = rsqrt(r0.w);
//   r0.xyz = r0.xyz * r0.www;
//   r1.xyz = float3(0.25,0.25,0.25) * r0.xyz;
//   r0.x = dot(r0.xzy, float3(0.0625,0.0625,0.125));
//   r0.x = 1 + r0.x;
//   r0.x = rcp(r0.x);
//   r0.xyz = r1.xyz * r0.xxx;
//   r3.xyz = sqrt(r0.xyz);
// // No code for instruction (needs manual fix):
// store_uav_typed u0.xyzw, vThreadID.xyyy, r3.xyzw
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// F:\SteamLibrary\steamapps\common\Days Gone\BendGame\Binaries\Win64\ShaderFixes\1c190c1e98c744f9-cs_replace.txt(30,10): error X3000: syntax error: unexpected token ')'
/////////////////////////////////////////////////////////////////////////////
