// ---- Created with 3Dmigoto v1.2.57 on Fri Apr 28 13:22:29 2017
Texture2D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s3_s : register(s3);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

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

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

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 : TEXCOORD0,
  float4 v3 : TEXCOORD4,
  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;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = v1.xyz * v0.zxy;
  r0.xyz = v1.zxy * v0.xyz + -r0.xyz;
  r0.xyz = v1.www * r0.xyz;
  r1.xy = t2.Sample(s2_s, v2.xy).xy;
  r1.xy = r1.xy * float2(2,2) + float2(-1,-1);
  r0.w = dot(r1.xy, r1.xy);
  r0.w = 1 + -r0.w;
  r0.w = max(0, r0.w);
  r1.z = sqrt(r0.w);
  r2.xyz = float3(0,0,1) + -r1.xyz;
  r1.xyz = r2.xyz * float3(0.5,0.5,0.5) + r1.xyz;
  r1.xyz = r1.xyz * cb0[120].www + cb0[120].xyz;
  r0.w = dot(r1.xyz, r1.xyz);
  r0.w = rsqrt(r0.w);
  r1.xyz = r1.xyz * r0.www;
  r0.xyz = r1.yyy * r0.xyz;
  r0.xyz = r1.xxx * v0.yzx + r0.xyz;
  r0.xyz = r1.zzz * v1.yzx + r0.xyz;
  r0.w = dot(r0.xyz, r0.xyz);
  r0.w = rsqrt(r0.w);
  r0.xyz = r0.xyz * r0.www;
  r1.xyz = t3.Sample(s3_s, v2.xy).xyz;
  r1.xyz = cb3[3].xyz * r1.xyz;
  r1.xyz = saturate(float3(0.300000012,0.300000012,0.300000012) * r1.xyz);
  o2.z = cb0[121].y * 0.200000003 + cb0[121].x;
  r2.xyzw = t1.Sample(s1_s, v3.zw).xyzw;
  r3.xyzw = cb2[7].xyzw * float4(-0.5,-0.5,-0.5,-0.5) + float4(0.5,0.5,0.5,0.5);
  r2.xyzw = saturate(r2.xyzw * cb2[7].xyzw + r3.xyzw);
  r2.xyzw = r2.xyzw * r2.xyzw;
  o5.xyzw = cb2[6].xyzw * r2.xyzw;
  r2.xyz = r1.xyz * cb0[118].www + cb0[118].xyz;
  r3.xyz = cb0[119].www * float3(0.00079999998,0.00079999998,0.00079999998) + cb0[119].xyz;
  r4.xy = float2(1,0.5) * v3.xy;
  r4.zw = v3.xy * float2(1,0.5) + float2(0,0.5);
  r5.xyzw = t0.Sample(s0_s, r4.xy).xyzw;
  r4.xyzw = t0.Sample(s0_s, r4.zw).xyzw;
  r1.w = r4.w * 0.00392156886 + r5.w;
  r1.w = -0.00196078443 + r1.w;
  r1.w = r1.w * cb2[18].w + cb2[20].w;
  r5.xyz = r5.xyz * r5.xyz;
  r5.xyz = r5.xyz * cb2[18].xyz + cb2[20].xyz;
  r1.w = exp2(r1.w);
  r1.w = -0.0185813606 + r1.w;
  r4.xyzw = r4.xyzw * cb2[19].xyzw + cb2[21].xyzw;
  r0.w = 1;
  r0.w = dot(r4.xyzw, r0.xyzw);
  r0.w = max(0, r0.w);
  r0.w = r1.w * r0.w;
  r4.xyz = r0.www * r5.xyz;
  r4.xyz = cb0[138].xyz * r4.xyz;
  r0.w = dot(r4.xyz, float3(0.300000012,0.589999974,0.109999999));
  r5.xyz = r4.xyz * r2.xyz;
  r3.xyz = r3.xyz * float3(0.449999988,0.449999988,0.449999988) + r2.xyz;
  r2.xyz = -r4.xyz * r2.xyz + r3.xyz;
  r2.xyz = cb0[126].yyy * r2.xyz + r5.xyz;
  r3.xyz = max(float3(0,0,0), cb3[2].xyz);
  r1.w = cmp(0 < cb0[122].x);
  if (r1.w != 0) {
    r4.xyzw = cb0[37].xyzw * v4.yyyy;
    r4.xyzw = v4.xxxx * cb0[36].xyzw + r4.xyzw;
    r4.xyzw = v4.zzzz * cb0[38].xyzw + r4.xyzw;
    r4.xyzw = cb0[39].xyzw + r4.xyzw;
    r4.xyz = r4.xyz / r4.www;
	
	// Common SVPositionToTranslatedWorld fix:
float4 s = StereoParams.Load(0);
matrix TranslatedWorldToClip = MATRIX(cb0, 0);
matrix ClipToTranslatedWorld = MATRIX(cb0, 32);
float4 t = mul(r4.xyz, TranslatedWorldToClip);
t.x -= s.x * (t.w - s.y);
r4.xyz = mul(t, ClipToTranslatedWorld);
	
    r4.xyz = -cb0[56].xyz + r4.xyz;
    r5.xyz = -cb1[8].xyz + r4.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.w = dot(r4.xyz, float3(0.577000022,0.577000022,0.577000022));
    r2.w = 0.00200000009 * r2.w;
    r2.w = frac(r2.w);
    r2.w = cmp(0.5 < r2.w);
    r4.xyz = r2.www ? float3(0,1,1) : float3(1,1,0);
    r3.xyz = r1.www ? r4.xyz : r3.xyz;
  }
  o0.xyz = r3.xyz + r2.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.zxy * 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.00999999978,0.75686276);
  o3.xyz = r1.xyz;
  o4.xyzw = float4(0,0,0,0);
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.57 on Fri Apr 28 13:22:29 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                10   xyzw        0     NONE   float   xyz 
// TEXCOORD                11   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xyzw        2     NONE   float   xy  
// TEXCOORD                 4   xyzw        3     NONE   float   xyzw
// SV_Position              0   xyzw        4      POS   float   xyz 
// SV_IsFrontFace           0   x           5    FFACE    uint       
//
//
// 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[22], immediateIndexed
dcl_constantbuffer cb3[4], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, 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_input_ps linear centroid v0.xyz
dcl_input_ps linear centroid v1.xyzw
dcl_input_ps linear v2.xy
dcl_input_ps linear v3.xyzw
dcl_input_ps_siv linear noperspective v4.xyz, position
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 7
mul r0.xyz, v0.zxyz, v1.xyzx
mad r0.xyz, v1.zxyz, v0.xyzx, -r0.xyzx
mul r0.xyz, r0.xyzx, v1.wwww
sample_indexable(texture2d)(float,float,float,float) r1.xy, v2.xyxx, t2.xyzw, s2
mad r1.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
dp2 r0.w, r1.xyxx, r1.xyxx
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
sqrt r1.z, r0.w
add r2.xyz, -r1.xyzx, l(0.000000, 0.000000, 1.000000, 0.000000)
mad r1.xyz, r2.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r1.xyzx
mad r1.xyz, r1.xyzx, cb0[120].wwww, cb0[120].xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
mul r0.xyz, r0.xyzx, r1.yyyy
mad r0.xyz, r1.xxxx, v0.yzxy, r0.xyzx
mad r0.xyz, r1.zzzz, v1.yzxy, r0.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
sample_indexable(texture2d)(float,float,float,float) r1.xyz, v2.xyxx, t3.xyzw, s3
mul r1.xyz, r1.xyzx, cb3[3].xyzx
mul_sat r1.xyz, r1.xyzx, l(0.300000, 0.300000, 0.300000, 0.000000)
mad o2.z, cb0[121].y, l(0.200000), cb0[121].x
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, v3.zwzz, t1.xyzw, s1
mad r3.xyzw, cb2[7].xyzw, l(-0.500000, -0.500000, -0.500000, -0.500000), l(0.500000, 0.500000, 0.500000, 0.500000)
mad_sat r2.xyzw, r2.xyzw, cb2[7].xyzw, r3.xyzw
mul r2.xyzw, r2.xyzw, r2.xyzw
mul o5.xyzw, r2.xyzw, cb2[6].xyzw
mad r2.xyz, r1.xyzx, cb0[118].wwww, cb0[118].xyzx
mad r3.xyz, cb0[119].wwww, l(0.000800, 0.000800, 0.000800, 0.000000), cb0[119].xyzx
mul r4.xy, v3.xyxx, l(1.000000, 0.500000, 0.000000, 0.000000)
mad r4.zw, v3.xxxy, l(0.000000, 0.000000, 1.000000, 0.500000), l(0.000000, 0.000000, 0.000000, 0.500000)
sample_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t0.xyzw, s0
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r4.zwzz, t0.xyzw, s0
mad r1.w, r4.w, l(0.00392156886), r5.w
add r1.w, r1.w, l(-0.00196078443)
mad r1.w, r1.w, cb2[18].w, cb2[20].w
mul r5.xyz, r5.xyzx, r5.xyzx
mad r5.xyz, r5.xyzx, cb2[18].xyzx, cb2[20].xyzx
exp r1.w, r1.w
add r1.w, r1.w, l(-0.0185813606)
mad r4.xyzw, r4.xyzw, cb2[19].xyzw, cb2[21].xyzw
mov r0.w, l(1.000000)
dp4 r0.w, r4.xyzw, r0.xyzw
max r0.w, r0.w, l(0.000000)
mul r0.w, r0.w, r1.w
mul r4.xyz, r5.xyzx, r0.wwww
mul r4.xyz, r4.xyzx, cb0[138].xyzx
dp3 r0.w, r4.xyzx, l(0.300000, 0.590000, 0.110000, 0.000000)
mul r5.xyz, r2.xyzx, r4.xyzx
mad r3.xyz, r3.xyzx, l(0.450000, 0.450000, 0.450000, 0.000000), r2.xyzx
mad r2.xyz, -r4.xyzx, r2.xyzx, r3.xyzx
mad r2.xyz, cb0[126].yyyy, r2.xyzx, r5.xyzx
max r3.xyz, cb3[2].xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
lt r1.w, l(0.000000), cb0[122].x
if_nz r1.w
  mul r4.xyzw, v4.yyyy, cb0[37].xyzw
  mad r4.xyzw, v4.xxxx, cb0[36].xyzw, r4.xyzw
  mad r4.xyzw, v4.zzzz, cb0[38].xyzw, r4.xyzw
  add r4.xyzw, r4.xyzw, cb0[39].xyzw
  div r4.xyz, r4.xyzx, r4.wwww
  add r4.xyz, r4.xyzx, -cb0[56].xyzx
  add r5.xyz, r4.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.w, r4.xyzx, l(0.577000, 0.577000, 0.577000, 0.000000)
  mul r2.w, r2.w, l(0.002000)
  frc r2.w, r2.w
  lt r2.w, l(0.500000), r2.w
  movc r4.xyz, r2.wwww, l(0,1.000000,1.000000,0), l(1.000000,1.000000,0,0)
  movc r3.xyz, r1.wwww, r4.xyzx, r3.xyzx
endif 
add o0.xyz, r2.xyzx, r3.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.zxyz, 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.010000,0,0.756862760)
mov o3.xyz, r1.xyzx
mov o4.xyzw, l(0,0,0,0)
ret 
// Approximately 0 instruction slots used

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