// ---- Created with 3Dmigoto v1.2.35 on Tue Apr 26 22:30:27 2016

cbuffer CBDofParam : register(b0)
{
  float4 g_vDepthComputeParam : packoffset(c0);
  float4 g_vNearFarParam : packoffset(c1);
  float4 g_vScreenSize : packoffset(c2);
  float4 g_vLensParam : packoffset(c3);
  float4 g_vNoBlurDist : packoffset(c4);
  float4 g_vVelomapParam : packoffset(c5);
  float4 g_vClipCoC : packoffset(c6);
  float4 g_vSampleScale : packoffset(c7);
  float4 g_vDebugMode : packoffset(c8);
}

SamplerState SS_ClampLinear_s : register(s3);
Texture2D<float4> g_SourceTex : register(t0);
Texture2D<float4> g_CoCTex : register(t2);


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


void main( 
  float4 v0 : SV_Position0,
  float2 v1 : TEXCOORD0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = g_CoCTex.Sample(SS_ClampLinear_s, v1.xy).xyw;
  r0.xy = min(g_vClipCoC.xy, r0.xy);
  r0.y = r0.y * r0.z;
  r0.x = max(r0.x, r0.y);
  r0.x = g_vSampleScale.x * r0.x;
  r0.xyzw = g_vScreenSize.zwzw * r0.xxxx;
  r1.xyzw = r0.zwzw * float4(0,1,0.382683426,0.923879504) + v1.xyxy;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r1.xy).xyzw;
  r1.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r1.zw).xyzw;
  r1.xyzw = r2.xyzw + r1.xyzw;
  r2.xyzw = r0.zwzw * float4(0.707106769,0.707106769,0.923879504,0.382683426) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(1,0,0.923879504,-0.382683426) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(0.707106769,-0.707106769,0.382683426,-0.923879504) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(0,-1,-0.382683426,-0.923879504) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(-0.707106769,-0.707106769,-0.923879504,-0.382683426) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(-1,0,-0.923879504,0.382683426) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(-0.707106769,0.707106769,-0.382683426,0.923879504) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(0,0.5,0.353553385,0.353553385) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(0.5,0,0.353553385,-0.353553385) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = r0.zwzw * float4(0,-0.5,-0.353553385,-0.353553385) + v1.xyxy;
  r0.xyzw = r0.xyzw * float4(-0.5,0,-0.353553385,0.353553385) + v1.xyxy;
  r3.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.xy).xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r2.zw).xyzw;
  r1.xyzw = r3.xyzw + r1.xyzw;
  r1.xyzw = r1.xyzw + r2.xyzw;
  r2.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r0.xy).xyzw;
  r0.xyzw = g_SourceTex.Sample(SS_ClampLinear_s, r0.zw).xyzw;
  r1.xyzw = r2.xyzw + r1.xyzw;
  r0.xyzw = r1.xyzw + r0.xyzw;
  o0.xyzw = float4(0.0416666679,0.0416666679,0.0416666679,0.0416666679) * r0.xyzw;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer CBDofParam
// {
//
//   float4 g_vDepthComputeParam;       // Offset:    0 Size:    16 [unused]
//   float4 g_vNearFarParam;            // Offset:   16 Size:    16 [unused]
//   float4 g_vScreenSize;              // Offset:   32 Size:    16
//   float4 g_vLensParam;               // Offset:   48 Size:    16 [unused]
//   float4 g_vNoBlurDist;              // Offset:   64 Size:    16 [unused]
//   float4 g_vVelomapParam;            // Offset:   80 Size:    16 [unused]
//   float4 g_vClipCoC;                 // Offset:   96 Size:    16
//   float4 g_vSampleScale;             // Offset:  112 Size:    16
//   float4 g_vDebugMode;               // Offset:  128 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_ClampLinear                    sampler      NA          NA    3        1
// g_SourceTex                       texture  float4          2d    0        1
// g_CoCTex                          texture  float4          2d    2        1
// CBDofParam                        cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[8], immediateIndexed
dcl_sampler s3, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t2
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 4
sample_indexable(texture2d)(float,float,float,float) r0.xyz, v1.xyxx, t2.xywz, s3
min r0.xy, r0.xyxx, cb0[6].xyxx
mul r0.y, r0.z, r0.y
max r0.x, r0.y, r0.x
mul r0.x, r0.x, cb0[7].x
mul r0.xyzw, r0.xxxx, cb0[2].zwzw
mad r1.xyzw, r0.zwzw, l(0.000000, 1.000000, 0.382683, 0.923880), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r1.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r2.xyzw
mad r2.xyzw, r0.zwzw, l(0.707107, 0.707107, 0.923880, 0.382683), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(1.000000, 0.000000, 0.923880, -0.382683), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(0.707107, -0.707107, 0.382683, -0.923880), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(0.000000, -1.000000, -0.382683, -0.923880), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(-0.707107, -0.707107, -0.923880, -0.382683), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(-1.000000, 0.000000, -0.923880, 0.382683), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(-0.707107, 0.707107, -0.382683, 0.923880), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(0.000000, 0.500000, 0.353553, 0.353553), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(0.500000, 0.000000, 0.353553, -0.353553), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
mad r2.xyzw, r0.zwzw, l(0.000000, -0.500000, -0.353553, -0.353553), v1.xyxy
mad r0.xyzw, r0.xyzw, l(-0.500000, 0.000000, -0.353553, 0.353553), v1.xyxy
sample_indexable(texture2d)(float,float,float,float) r3.xyzw, r2.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r2.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r3.xyzw
add r1.xyzw, r2.xyzw, r1.xyzw
sample_indexable(texture2d)(float,float,float,float) r2.xyzw, r0.xyxx, t0.xyzw, s3
sample_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.zwzz, t0.xyzw, s3
add r1.xyzw, r1.xyzw, r2.xyzw
add r0.xyzw, r0.xyzw, r1.xyzw
mul o0.xyzw, r0.xyzw, l(0.041667, 0.041667, 0.041667, 0.041667)
ret 
// Approximately 67 instruction slots used

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