// DLC - Light
Texture2D<float4> t8 : register(t8);

Texture2D<float4> t7 : register(t7);

Texture2D<float4> t6 : register(t6);

Texture2D<float4> t5 : register(t5);

Texture2D<float4> t4 : register(t4);

Texture2D<float4> t3 : register(t3);

Texture3D<float4> t2 : register(t2);

Texture3D<float4> t1 : register(t1);

Texture3D<float4> t0 : register(t0);

SamplerState s8_s : register(s8);

SamplerState s7_s : register(s7);

SamplerState s6_s : register(s6);

SamplerState s5_s : register(s5);

SamplerState s4_s : register(s4);

SamplerState s3_s : register(s3);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb4 : register(b4)
{
  float4 cb4[10];
}

cbuffer cb3 : register(b3)
{
  float4 cb3[2];
}

cbuffer cb2 : register(b2)
{
  float4 cb2[6];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[12];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[139];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);
#include "matrix.hlsl"

void main( 
  linear centroid float4 v0 : TEXCOORD10,
  linear centroid float4 v1 : TEXCOORD11,
  float4 v2 : COLOR0,
  float2 v3 : TEXCOORD0,
  float4 v4 : SV_Position0,
  uint v5 : SV_IsFrontFace0,
  out float4 o0 : SV_Target0,
  out float4 o1 : SV_Target1,
  out float4 o2 : SV_Target2,
  out float4 o3 : SV_Target3,
  out float4 o4 : SV_Target4,
  out float4 o5 : SV_Target5)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v1.zxy * v0.yzx;
  r0.xyz = v1.yzx * v0.zxy + -r0.xyz;
  r0.xyz = v1.www * r0.xyz;
  r1.xyzw = cb0[37].xyzw * v4.yyyy;
  r1.xyzw = v4.xxxx * cb0[36].xyzw + r1.xyzw;
  r1.xyzw = v4.zzzz * cb0[38].xyzw + r1.xyzw;
  r1.xyzw = cb0[39].xyzw + r1.xyzw;
  r1.xyz = r1.xyz / r1.www;
  
  // Common SVPositionToTranslatedWorld fix:
float4 s = StereoParams.Load(0);
matrix TranslatedWorldToClip = MATRIX(cb0, 0);
matrix ClipToTranslatedWorld = MATRIX(cb0, 32);
float4 t = mul(r1.xyz, TranslatedWorldToClip);
t.x -= s.x * (t.w - s.y);
r1.xyz = mul(t, ClipToTranslatedWorld);
  
  r2.xyz = -cb0[56].xyz + r1.xyz;
  r0.w = dot(-r1.xyz, -r1.xyz);
  r0.w = rsqrt(r0.w);
  r1.xyz = -r1.xyz * r0.www;
  r0.w = cb1[9].w * cb0[123].w;
  r1.w = v5.x ? 1 : -1;
  r0.w = r1.w * r0.w;
  r3.xy = t3.Sample(s3_s, v3.xy).xy;
  r3.xy = r3.xy * float2(2,2) + float2(-1,-1);
  r1.w = dot(r3.xy, r3.xy);
  r1.w = 1 + -r1.w;
  r1.w = max(0, r1.w);
  r3.z = sqrt(r1.w);
  r3.xyz = r3.xyz * cb0[120].www + cb0[120].xyz;
  r3.xyz = r3.xyz * r0.www;
  r0.w = dot(r3.xyz, r3.xyz);
  r0.w = rsqrt(r0.w);
  r3.xyz = r3.xyz * r0.www;
  r0.xyz = r3.yyy * r0.xyz;
  r0.xyz = r3.xxx * v0.xyz + r0.xyz;
  r0.xyz = r3.zzz * v1.xyz + r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r0.w = dot(r0.xyz, r1.xyz);
  r0.w = max(0, r0.w);
  r0.w = 1 + -r0.w;
  r0.w = max(9.99999997e-007, abs(r0.w));
  r0.w = log2(r0.w);
  r0.w = cb4[9].x * r0.w;
  r0.w = exp2(r0.w);
  r0.w = cb4[9].y * r0.w;
  r1.xyz = t4.Sample(s4_s, v3.xy).xyz;
  r3.xyz = t5.Sample(s5_s, v3.xy).xyz;
  r4.xy = t6.Sample(s6_s, v3.xy).xy;
  r4.zw = cmp(r4.xy >= float2(0.00999999978,0.00999999978));
  r5.xy = r4.zw ? float2(1,1) : 0;
  r6.xyz = float3(-1,-1,-1) + cb4[6].xyz;
  r5.xzw = r5.xxx * r6.xyz + float3(1,1,1);
  r1.w = r4.w ? -1 : -0;
  r1.w = r4.x * r1.w + r5.y;
  r6.xyz = cb4[8].xyz + -r5.xzw;
  r5.xyz = r1.www * r6.xyz + r5.xzw;
  r1.w = max(r4.x, r4.y);
  r4.xy = cb4[9].zz * v3.xy;
  r2.w = t7.Sample(s7_s, r4.xy).y;
  r2.w = 1 / r2.w;
  r1.w = saturate(r2.w * r1.w);
  r2.w = r1.w * -2 + 3;
  r1.w = r1.w * r1.w;
  r1.w = r2.w * r1.w;
  r4.xyz = r3.xyz * r5.xyz + -r3.xyz;
  r3.xyz = r1.www * r4.xyz + r3.xyz;
  r4.xyz = cb3[1].xyz + -r3.xyz;
  r3.xyz = cb3[0].xxx * r4.xyz + r3.xyz;
  r1.xyz = r0.www * r1.xyz + r3.xyz;
  r1.xyz = saturate(cb4[3].xyz * r1.xyz);
  r0.w = t8.Sample(s8_s, v3.xy).x;
  r0.w = r1.w * -r0.w + r0.w;
  r1.w = 1 + -r0.w;
  r0.w = saturate(cb3[0].x * r1.w + r0.w);
  o2.z = r0.w * cb0[121].y + cb0[121].x;
  r0.w = cmp(0 < cb1[11].y);
  o5.x = r0.w ? cb2[5].x : 1;
  r3.xyz = r1.xyz * cb0[118].www + cb0[118].xyz;
  r4.xyz = cb0[119].www * float3(0.0399999991,0.0399999991,0.0399999991) + cb0[119].xyz;
  r5.xyz = r2.xyz * cb2[1].xyz + cb2[0].xyz;
  r5.xyz = max(cb2[2].xyz, r5.xyz);
  r5.xyz = min(cb2[3].xyz, r5.xyz);
  r6.xyzw = t0.Sample(s0_s, r5.xyz).xyzw;
  r7.xyzw = t1.Sample(s1_s, r5.xyz).xyzw;
  r5.xyzw = t2.Sample(s2_s, r5.xyz).xyzw;
  r8.yzw = float3(-1.02332771,1.02332771,-1.02332771) * r0.yzx;
  r9.xw = r6.xw;
  r9.y = r7.x;
  r9.z = r5.x;
  r8.x = 0.886227548;
  r9.x = dot(r9.xyzw, r8.xyzw);
  r10.x = r6.y;
  r10.yw = r7.yw;
  r10.z = r5.y;
  r9.y = dot(r10.xyzw, r8.xyzw);
  r5.x = r6.z;
  r5.y = r7.z;
  r9.z = dot(r5.xyzw, r8.xyzw);
  r5.xyz = max(float3(0,0,0), r9.xyz);
  r5.xyz = cb0[138].xyz * r5.xyz;
  r5.xyz = float3(0.318309873,0.318309873,0.318309873) * r5.xyz;
  r0.w = dot(r5.xyz, float3(0.300000012,0.589999974,0.109999999));
  r6.xyz = r5.xyz * r3.xyz;
  r4.xyz = r4.xyz * float3(0.449999988,0.449999988,0.449999988) + r3.xyz;
  r3.xyz = -r5.xyz * r3.xyz + r4.xyz;
  r3.xyz = cb0[126].yyy * r3.xyz + r6.xyz;
  r4.xyz = max(float3(0,0,0), cb4[2].xyz);
  r1.w = cmp(0 < cb0[122].x);
  if (r1.w != 0) {
    r5.xyz = -cb1[8].xyz + r2.xyz;
    r6.xyz = float3(1,1,1) + cb1[9].xyz;
    r5.xyz = cmp(r6.xyz < abs(r5.xyz));
    r1.w = (int)r5.y | (int)r5.x;
    r1.w = (int)r5.z | (int)r1.w;
    r2.x = dot(r2.xyz, float3(0.577000022,0.577000022,0.577000022));
    r2.x = 0.00200000009 * r2.x;
    r2.x = frac(r2.x);
    r2.x = cmp(0.5 < r2.x);
    r2.xyz = r2.xxx ? float3(0,1,1) : float3(1,1,0);
    r4.xyz = r1.www ? r2.xyz : r4.xyz;
  }
  o0.xyz = r4.xyz + r3.xyz;
  r2.xyz = float3(0.0078125,0.0078125,0.0078125) * v4.xyx;
  r2.xyz = frac(r2.xyz);
  r2.xyz = r2.xyz * float3(128,128,128) + float3(-64.3406219,-72.4656219,-64.3406219);
  r2.xyz = r2.xyz * r2.xyy;
  r1.w = dot(r2.xyz, float3(20.390625,60.703125,2.42812085));
  r1.w = frac(r1.w);
  r1.w = -0.5 + r1.w;
  o1.xyz = r0.xyz * float3(0.5,0.5,0.5) + float3(0.5,0.5,0.5);
  r0.x = 0.00390625 + r0.w;
  r0.x = log2(r0.x);
  r0.x = r0.x * 0.0625 + 0.5;
  o3.w = r1.w * 0.00392156886 + r0.x;
  o0.w = 0;
  o1.w = cb1[11].x;
  o2.xyw = float3(0,0.5,0.75686276);
  o3.xyz = r1.xyz;
  o4.xyzw = float4(0,0,0,0);
  o5.yzw = float3(1,1,1);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.57 on Fri Jul 07 18:36:30 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                10   xyzw        0     NONE   float   xyz 
// TEXCOORD                11   xyzw        1     NONE   float   xyzw
// COLOR                    0   xyzw        2     NONE   float       
// TEXCOORD                 0   xy          3     NONE   float   xy  
// SV_Position              0   xyzw        4      POS   float   xyz 
// SV_IsFrontFace           0   x           5    FFACE    uint   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
// SV_Target                2   xyzw        2   TARGET   float   xyzw
// SV_Target                3   xyzw        3   TARGET   float   xyzw
// SV_Target                4   xyzw        4   TARGET   float   xyzw
// SV_Target                5   xyzw        5   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[139], immediateIndexed
dcl_constantbuffer cb1[12], immediateIndexed
dcl_constantbuffer cb2[6], immediateIndexed
dcl_constantbuffer cb3[2], immediateIndexed
dcl_constantbuffer cb4[10], immediateIndexed
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_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_sampler s8, mode_default
dcl_resource_texture3d (float,float,float,float) t0
dcl_resource_texture3d (float,float,float,float) t1
dcl_resource_texture3d (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_texture2d (float,float,float,float) t7
dcl_resource_texture2d (float,float,float,float) t8
dcl_input_ps linear centroid v0.xyz
dcl_input_ps linear centroid v1.xyzw
dcl_input_ps linear v3.xy
dcl_input_ps_siv linear noperspective v4.xyz, position
dcl_input_ps_sgv v5.x, is_front_face
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_temps 11
mul r0.xyz, v0.yzxy, v1.zxyz
mad r0.xyz, v1.yzxy, v0.zxyz, -r0.xyzx
mul r0.xyz, r0.xyzx, v1.wwww
mul r1.xyzw, v4.yyyy, cb0[37].xyzw
mad r1.xyzw, v4.xxxx, cb0[36].xyzw, r1.xyzw
mad r1.xyzw, v4.zzzz, cb0[38].xyzw, r1.xyzw
add r1.xyzw, r1.xyzw, cb0[39].xyzw
div r1.xyz, r1.xyzx, r1.wwww
add r2.xyz, r1.xyzx, -cb0[56].xyzx
dp3 r0.w, -r1.xyzx, -r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, -r1.xyzx
mul r0.w, cb0[123].w, cb1[9].w
movc r1.w, v5.x, l(1.000000), l(-1.000000)
mul r0.w, r0.w, r1.w
sample_indexable(texture2d)(float,float,float,float) r3.xy, v3.xyxx, t3.xyzw, s3
mad r3.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r1.w, r3.xyxx, r3.xyxx
add r1.w, -r1.w, l(1.000000)
max r1.w, r1.w, l(0.000000)
sqrt r3.z, r1.w
mad r3.xyz, r3.xyzx, cb0[120].wwww, cb0[120].xyzx
mul r3.xyz, r0.wwww, r3.xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r3.xyzx
mul r0.xyz, r0.xyzx, r3.yyyy
mad r0.xyz, r3.xxxx, v0.xyzx, r0.xyzx
mad r0.xyz, r3.zzzz, v1.xyzx, r0.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
dp3 r0.w, r0.xyzx, r1.xyzx
max r0.w, r0.w, l(0.000000)
add r0.w, -r0.w, l(1.000000)
max r0.w, |r0.w|, l(0.000001)
log r0.w, r0.w
mul r0.w, r0.w, cb4[9].x
exp r0.w, r0.w
mul r0.w, r0.w, cb4[9].y
sample_indexable(texture2d)(float,float,float,float) r1.xyz, v3.xyxx, t4.xyzw, s4
sample_indexable(texture2d)(float,float,float,float) r3.xyz, v3.xyxx, t5.xyzw, s5
sample_indexable(texture2d)(float,float,float,float) r4.xy, v3.xyxx, t6.xyzw, s6
ge r4.zw, r4.xxxy, l(0.000000, 0.000000, 0.010000, 0.010000)
and r5.xy, r4.zwzz, l(0x3f800000, 0x3f800000, 0, 0)
add r6.xyz, cb4[6].xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r5.xzw, r5.xxxx, r6.xxyz, l(1.000000, 0.000000, 1.000000, 1.000000)
movc r1.w, r4.w, l(-1.000000), l(-0.000000)
mad r1.w, r4.x, r1.w, r5.y
add r6.xyz, -r5.xzwx, cb4[8].xyzx
mad r5.xyz, r1.wwww, r6.xyzx, r5.xzwx
max r1.w, r4.y, r4.x
mul r4.xy, v3.xyxx, cb4[9].zzzz
sample_indexable(texture2d)(float,float,float,float) r2.w, r4.xyxx, t7.xzwy, s7
div r2.w, l(1.000000, 1.000000, 1.000000, 1.000000), r2.w
mul_sat r1.w, r1.w, r2.w
mad r2.w, r1.w, l(-2.000000), l(3.000000)
mul r1.w, r1.w, r1.w
mul r1.w, r1.w, r2.w
mad r4.xyz, r3.xyzx, r5.xyzx, -r3.xyzx
mad r3.xyz, r1.wwww, r4.xyzx, r3.xyzx
add r4.xyz, -r3.xyzx, cb3[1].xyzx
mad r3.xyz, cb3[0].xxxx, r4.xyzx, r3.xyzx
mad r1.xyz, r0.wwww, r1.xyzx, r3.xyzx
mul_sat r1.xyz, r1.xyzx, cb4[3].xyzx
sample_indexable(texture2d)(float,float,float,float) r0.w, v3.xyxx, t8.yzwx, s8
mad r0.w, r1.w, -r0.w, r0.w
add r1.w, -r0.w, l(1.000000)
mad_sat r0.w, cb3[0].x, r1.w, r0.w
mad o2.z, r0.w, cb0[121].y, cb0[121].x
lt r0.w, l(0.000000), cb1[11].y
movc o5.x, r0.w, cb2[5].x, l(1.000000)
mad r3.xyz, r1.xyzx, cb0[118].wwww, cb0[118].xyzx
mad r4.xyz, cb0[119].wwww, l(0.040000, 0.040000, 0.040000, 0.000000), cb0[119].xyzx
mad r5.xyz, r2.xyzx, cb2[1].xyzx, cb2[0].xyzx
max r5.xyz, r5.xyzx, cb2[2].xyzx
min r5.xyz, r5.xyzx, cb2[3].xyzx
sample_indexable(texture3d)(float,float,float,float) r6.xyzw, r5.xyzx, t0.xyzw, s0
sample_indexable(texture3d)(float,float,float,float) r7.xyzw, r5.xyzx, t1.xyzw, s1
sample_indexable(texture3d)(float,float,float,float) r5.xyzw, r5.xyzx, t2.xyzw, s2
mul r8.yzw, r0.yyzx, l(0.000000, -1.02332771, 1.02332771, -1.02332771)
mov r9.xw, r6.xxxw
mov r9.y, r7.x
mov r9.z, r5.x
mov r8.x, l(0.886227548)
dp4 r9.x, r9.xyzw, r8.xyzw
mov r10.x, r6.y
mov r10.yw, r7.yyyw
mov r10.z, r5.y
dp4 r9.y, r10.xyzw, r8.xyzw
mov r5.x, r6.z
mov r5.y, r7.z
dp4 r9.z, r5.xyzw, r8.xyzw
max r5.xyz, r9.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r5.xyz, r5.xyzx, cb0[138].xyzx
mul r5.xyz, r5.xyzx, l(0.318309873, 0.318309873, 0.318309873, 0.000000)
dp3 r0.w, r5.xyzx, l(0.300000, 0.590000, 0.110000, 0.000000)
mul r6.xyz, r3.xyzx, r5.xyzx
mad r4.xyz, r4.xyzx, l(0.450000, 0.450000, 0.450000, 0.000000), r3.xyzx
mad r3.xyz, -r5.xyzx, r3.xyzx, r4.xyzx
mad r3.xyz, cb0[126].yyyy, r3.xyzx, r6.xyzx
max r4.xyz, cb4[2].xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
lt r1.w, l(0.000000), cb0[122].x
if_nz r1.w
  add r5.xyz, r2.xyzx, -cb1[8].xyzx
  add r6.xyz, cb1[9].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  lt r5.xyz, r6.xyzx, |r5.xyzx|
  or r1.w, r5.y, r5.x
  or r1.w, r5.z, r1.w
  dp3 r2.x, r2.xyzx, l(0.577000, 0.577000, 0.577000, 0.000000)
  mul r2.x, r2.x, l(0.002000)
  frc r2.x, r2.x
  lt r2.x, l(0.500000), r2.x
  movc r2.xyz, r2.xxxx, l(0,1.000000,1.000000,0), l(1.000000,1.000000,0,0)
  movc r4.xyz, r1.wwww, r2.xyzx, r4.xyzx
endif 
add o0.xyz, r3.xyzx, r4.xyzx
mul r2.xyz, v4.xyxx, l(0.00781250000, 0.00781250000, 0.00781250000, 0.000000)
frc r2.xyz, r2.xyzx
mad r2.xyz, r2.xyzx, l(128.000000, 128.000000, 128.000000, 0.000000), l(-64.340622, -72.465622, -64.340622, 0.000000)
mul r2.xyz, r2.xyyx, r2.xyzx
dp3 r1.w, r2.xyzx, l(20.390625, 60.703125, 2.42812085, 0.000000)
frc r1.w, r1.w
add r1.w, r1.w, l(-0.500000)
mad o1.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
add r0.x, r0.w, l(0.00390625000)
log r0.x, r0.x
mad r0.x, r0.x, l(0.062500), l(0.500000)
mad o3.w, r1.w, l(0.00392156886), r0.x
mov o0.w, l(0)
mov o1.w, cb1[11].x
mov o2.xyw, l(0,0.500000,0,0.756862760)
mov o3.xyz, r1.xyzx
mov o4.xyzw, l(0,0,0,0)
mov o5.yzw, l(0,1.000000,1.000000,1.000000)
ret 
// Approximately 0 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
