//Lighting CS 1.
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Sat May 22 10:29:38 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[3], immediateIndexed
dcl_constantbuffer cb1[81], immediateIndexed
dcl_constantbuffer cb2[11], immediateIndexed
dcl_sampler s0, 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_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
iadd r0.xy, vThreadID.xyxx, -cb0[0].xyxx
itof r0.xy, r0.xyxx
add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
iadd r0.zw, cb0[0].zzzw, -cb0[0].xxxy
itof r0.zw, r0.zzzw
div r0.xy, r0.xyxx, r0.zwzz
add r0.xy, r0.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
add r0.zw, cb1[26].xxxy, -cb1[59].xxxy
mad r0.xy, r0.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), r0.zwzz

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

mul r21.xyzw, r0.yyyy, cb1[33].xyzw
mad r20.xyzw, r0.xxxx, cb1[32].xyzw, r1.xyzw
mov r21.xy, vThreadID.xyxx
mov r21.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r21.x, r21.xyzw, t0.xyzw
mul r21.x, r21.x, r21.x
mad r20.xyzw, r21.xxxx, cb1[34].xyzw, r20.xyzw
add r20.xyzw, r20.xyzw, cb1[35].xyzw

add r0.x, -r25.x, r0.x
mul r25.w, r20.w, r25.y
mad r0.x, r25.x, r25.w, r0.x

mul r1.xyzw, r0.yyyy, cb1[33].xyzw
mad r0.xyzw, r0.xxxx, cb1[32].xyzw, r1.xyzw
mov r1.xy, vThreadID.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.x, r1.xyzw, t0.xyzw
mul r1.x, r1.x, r1.x
mad r0.xyzw, r1.xxxx, cb1[34].xyzw, r0.xyzw
add r0.xyzw, r0.xyzw, cb1[35].xyzw
mul r1.xyz, r0.wwww, cb2[10].xyzx
mov r1.w, l(0)
add r0.xyzw, r0.xyzw, r1.xyzw
mul r1.xyz, r0.yyyy, cb1[78].xywx
mad r1.xyz, r0.xxxx, cb1[77].xywx, r1.xyzx
mad r0.xyz, r0.zzzz, cb1[79].xywx, r1.xyzx
mad r0.xyz, r0.wwww, cb1[80].xywx, r0.xyzx

//mad r0.x, r25.x, r0.z, r0.x

div r0.xy, r0.xyxx, r0.zzzz
mad r0.xy, r0.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
mov_sat r0.zw, r0.xxxy
eq r0.zw, r0.zzzw, r0.xxxy
mad r0.xy, r0.xyxx, cb0[1].xyxx, cb0[1].zwzz
sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r0.xyxx, t2.xyzw, s0, l(0.000000)
and r0.x, r0.w, r0.z
ishl r2.xy, vThreadID.xyxx, l(1, 1, 0, 0)
mov r2.zw, l(0,0,0,0)
ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r0.yzw, r2.xyww, t1.wxyz
min r0.yzw, -r0.yyzw, l(0.000000, -9.999999960E-013, -9.999999960E-013, -9.999999960E-013)
ld_aoffimmi_indexable(1,0,0)(texture2d)(float,float,float,float) r3.xyz, r2.xyww, t1.xyzw
min r3.xyz, -r3.xyzx, l(-9.999999960E-013, -9.999999960E-013, -9.999999960E-013, 0.000000)
min r4.xyz, -r0.yzwy, -r3.xyzx
ld_aoffimmi_indexable(1,1,0)(texture2d)(float,float,float,float) r5.xyz, r2.xyww, t1.xyzw
ld_aoffimmi_indexable(0,1,0)(texture2d)(float,float,float,float) r2.xyz, r2.xyzw, t1.xyzw
min r2.xyz, -r2.xyzx, l(-9.999999960E-013, -9.999999960E-013, -9.999999960E-013, 0.000000)
min r5.xyz, -r5.xyzx, l(-9.999999960E-013, -9.999999960E-013, -9.999999960E-013, 0.000000)
min r6.xyz, -r2.xyzx, -r5.xyzx
min r4.xyz, r4.xyzx, r6.xyzx
max r6.xyz, r1.xyzx, r4.xyzx
max r7.xyz, -r0.yzwy, -r3.xyzx
mul r3.xyz, r3.xyzx, l(-0.250000, -0.250000, -0.250000, 0.000000)
mad r0.yzw, r0.yyzw, l(0.000000, -0.250000, -0.250000, -0.250000), r3.xxyz
mad r0.yzw, r5.xxyz, l(0.000000, -0.250000, -0.250000, -0.250000), r0.yyzw
max r3.xyz, -r2.xyzx, -r5.xyzx
mad r0.yzw, r2.xxyz, l(0.000000, -0.250000, -0.250000, -0.250000), r0.yyzw
max r2.xyz, r3.xyzx, r7.xyzx
min r3.xyz, r2.xyzx, r6.xyzx
add r3.xyz, -r1.xyzx, r3.xyzx
mad r1.xyz, r1.xyzx, cb0[2].xxxx, -r0.yzwy
dp3 r1.w, r3.xyzx, r3.xyzx
lt r1.w, r1.w, l(0.000100)
and r0.x, r0.x, r1.w
and r0.x, r0.x, l(0x3f400000)
mad r0.xyz, r0.xxxx, r1.xyzx, r0.yzwy
max r0.xyz, r4.xyzx, r0.xyzx
min r0.xyz, r2.xyzx, r0.xyzx
bfi r0.w, l(2), l(2), vThreadID.y, l(0)
bfi r0.w, l(2), l(0), vThreadID.x, r0.w
uge r1.x, r0.w, l(8)
bfi r0.w, l(3), l(2), r0.w, l(0)
movc r1.x, r1.x, l(-1561935455715328.000000), l(183712671068922260000000000000000000000.000000)
ushr r0.w, r1.x, r0.w
and r0.w, r0.w, l(15)
iadd r0.w, r0.w, l(30)
and r0.w, r0.w, l(15)
utof r0.w, r0.w
add r0.w, r0.w, l(0.500000)
mad r0.w, r0.w, l(0.062500), l(-0.500000)
mad r0.xyz, r0.wwww, l(0.00390625000, 0.00390625000, 0.00390625000, 0.000000), r0.xyzx
mov r0.w, l(1.000000)
store_uav_typed u1.xyzw, vThreadID.xyyy, r0.xyzw
ige r1.xy, vThreadID.xyxx, cb0[0].xyxx
ilt r1.zw, vThreadID.xxxy, cb0[0].zzzw
and r1.xy, r1.zwzz, r1.xyxx
and r0.w, r1.y, r1.x
and r0.xyzw, r0.xyzx, r0.wwww
store_uav_typed u0.xyzw, vThreadID.xyyy, r0.xyzw
ret
// Approximately 0 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.16 on Sat May 22 10:29:38 2021
// Texture2D<float4> t2 : register(t2);
//
// Texture2D<float4> t1 : register(t1);
//
// Texture2D<float4> t0 : register(t0);
//
// SamplerState s0_s : register(s0);
//
// cbuffer cb2 : register(b2)
// {
//   float4 cb2[11];
// }
//
// cbuffer cb1 : register(b1)
// {
//   float4 cb1[81];
// }
//
// cbuffer cb0 : register(b0)
// {
//   float4 cb0[3];
// }
//
//
//
//
// // 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,r6,r7;
//   uint4 bitmask, uiDest;
//   float4 fDest;
//
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_thread_group 8, 8, 1
//   r0.xy = (int2)vThreadID.xy + asint(-cb0[0].xy);
//   r0.xy = (int2)r0.xy;
//   r0.xy = float2(0.5,0.5) + r0.xy;
//   r0.zw = asint(cb0[0].zw) + asint(-cb0[0].xy);
//   r0.zw = (int2)r0.zw;
//   r0.xy = r0.xy / r0.zw;
//   r0.xy = float2(-0.5,-0.5) + r0.xy;
//   r0.zw = -cb1[59].xy + cb1[26].xy;
//   r0.xy = r0.xy * float2(2,-2) + r0.zw;
//   r1.xyzw = cb1[33].xyzw * r0.yyyy;
//   r0.xyzw = r0.xxxx * cb1[32].xyzw + r1.xyzw;
//   r1.xy = vThreadID.xy;
//   r1.zw = float2(0,0);
//   r1.x = t0.Load(r1.xyz).x;
//   r1.x = r1.x * r1.x;
//   r0.xyzw = r1.xxxx * cb1[34].xyzw + r0.xyzw;
//   r0.xyzw = cb1[35].xyzw + r0.xyzw;
//   r1.xyz = cb2[10].xyz * r0.www;
//   r1.w = 0;
//   r0.xyzw = r1.xyzw + r0.xyzw;
//   r1.xyz = cb1[78].xyw * r0.yyy;
//   r1.xyz = r0.xxx * cb1[77].xyw + r1.xyz;
//   r0.xyz = r0.zzz * cb1[79].xyw + r1.xyz;
//   r0.xyz = r0.www * cb1[80].xyw + r0.xyz;
//   r0.xy = r0.xy / r0.zz;
//   r0.xy = r0.xy * float2(0.5,-0.5) + float2(0.5,0.5);
//   r0.zw = saturate(r0.xy);
//   r0.zw = cmp(r0.zw == r0.xy);
//   r0.xy = r0.xy * cb0[1].xy + cb0[1].zw;
//   r1.xyz = t2.SampleLevel(s0_s, r0.xy, 0).xyz;
//   r0.x = r0.w ? r0.z : 0;
//   r2.xy = (uint2)vThreadID.xy << int2(1,1);
//   r2.zw = float2(0,0);
//   r0.yzw = t1.Load(r2.xyw, int3(0, 0, 0)).xyz;
//   r0.yzw = min(float3(-9.99999996e-013,-9.99999996e-013,-9.99999996e-013), -r0.yzw);
//   r3.xyz = t1.Load(r2.xyw, int3(0, 0, 0)).xyz;
//   r3.xyz = min(float3(-9.99999996e-013,-9.99999996e-013,-9.99999996e-013), -r3.xyz);
//   r4.xyz = min(-r3.xyz, -r0.yzw);
//   r5.xyz = t1.Load(r2.xyw, int3(0, 0, 0)).xyz;
//   r2.xyz = t1.Load(r2.xyz, int3(0, 0, 0)).xyz;
//   r2.xyz = min(float3(-9.99999996e-013,-9.99999996e-013,-9.99999996e-013), -r2.xyz);
//   r5.xyz = min(float3(-9.99999996e-013,-9.99999996e-013,-9.99999996e-013), -r5.xyz);
//   r6.xyz = min(-r5.xyz, -r2.xyz);
//   r4.xyz = min(r6.xyz, r4.xyz);
//   r6.xyz = max(r4.xyz, r1.xyz);
//   r7.xyz = max(-r3.xyz, -r0.yzw);
//   r3.xyz = float3(-0.25,-0.25,-0.25) * r3.xyz;
//   r0.yzw = r0.yzw * float3(-0.25,-0.25,-0.25) + r3.xyz;
//   r0.yzw = r5.xyz * float3(-0.25,-0.25,-0.25) + r0.yzw;
//   r3.xyz = max(-r5.xyz, -r2.xyz);
//   r0.yzw = r2.xyz * float3(-0.25,-0.25,-0.25) + r0.yzw;
//   r2.xyz = max(r7.xyz, r3.xyz);
//   r3.xyz = min(r6.xyz, r2.xyz);
//   r3.xyz = r3.xyz + -r1.xyz;
//   r1.xyz = r1.xyz * cb0[2].xxx + -r0.yzw;
//   r1.w = dot(r3.xyz, r3.xyz);
//   r1.w = cmp(r1.w < 9.99999975e-005);
//   r0.x = r1.w ? r0.x : 0;
//   r0.x = (int)r0.x & 0x3f400000;
//   r0.xyz = r0.xxx * r1.xyz + r0.yzw;
//   r0.xyz = max(r0.xyz, r4.xyz);
//   r0.xyz = min(r0.xyz, r2.xyz);
//   bitmask.w = ((~(-1 << 2)) << 2) & 0xffffffff;  r0.w = (((uint)vThreadID.y << 2) & bitmask.w) | ((uint)0 & ~bitmask.w);
//   bitmask.w = ((~(-1 << 2)) << 0) & 0xffffffff;  r0.w = (((uint)vThreadID.x << 0) & bitmask.w) | ((uint)r0.w & ~bitmask.w);
//   r1.x = cmp((uint)r0.w >= 8);
//   bitmask.w = ((~(-1 << 3)) << 2) & 0xffffffff;  r0.w = (((uint)r0.w << 2) & bitmask.w) | ((uint)0 & ~bitmask.w);
//   r1.x = r1.x ? -1.56193546e+015 : 1.83712671e+038;
//   r0.w = (uint)r1.x >> (uint)r0.w;
//   r0.w = (int)r0.w & 15;
//   r0.w = (int)r0.w + 30;
//   r0.w = (int)r0.w & 15;
//   r0.w = (uint)r0.w;
//   r0.w = 0.5 + r0.w;
//   r0.w = r0.w * 0.0625 + -0.5;
//   r0.xyz = r0.www * float3(0.00390625,0.00390625,0.00390625) + r0.xyz;
//   r0.w = 1;
// // No code for instruction (needs manual fix):
// store_uav_typed u1.xyzw, vThreadID.xyyy, r0.xyzw
//   r1.xy = cmp((int2)vThreadID.xy >= asint(cb0[0].xy));
//   r1.zw = cmp((int2)vThreadID.xy < asint(cb0[0].zw));
//   r1.xy = r1.zw ? r1.xy : 0;
//   r0.w = r1.y ? r1.x : 0;
//   r0.xyzw = (int4)r0.xyzx & (int4)r0.wwww;
// // No code for instruction (needs manual fix):
// store_uav_typed u0.xyzw, vThreadID.xyyy, r0.xyzw
//   return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// F:\SteamLibrary\steamapps\common\Days Gone\BendGame\Binaries\Win64\ShaderFixes\25dd503ee3eecb8d-cs_replace.txt(34,10): error X3000: syntax error: unexpected token ')'
/////////////////////////////////////////////////////////////////////////////
