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

cbuffer cbMatrixWVP : register(b0)
{
  row_major float4x4 VC_View_MatrixCamera : packoffset(c0);
  float4x4 VC_View_MatrixViewProj : packoffset(c4);
  float4 VC_ViewFrustumPlanes[4] : packoffset(c8);
}

cbuffer cbTessScene : register(b5)
{
  float4x4 g_f4x4ViewProjection : packoffset(c0);
  float4 g_f4Eye : packoffset(c4);
  float4 g_f4ViewVector : packoffset(c5);
  float4 g_f4GUIParams2 : packoffset(c6);
  float4 g_f4ViewFrustumPlanes[4] : packoffset(c7);
  float g_fGlobalTime : packoffset(c11);
}

cbuffer cbPNTriangles : register(b6)
{
  float4 g_f4TessFactors : packoffset(c0);
  float4 g_f4GUIParams1 : packoffset(c1);
  float2 g_fDetailTessellationHeightParam : packoffset(c2);
}



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


void main( 
  float3 v0 : POSITION0,
  float4 v1 : NORMAL0,
  float4 v2 : TANGENT0,
  float4 v3 : TANGENT1,
  float4 v4 : TANGENT2,
  float3 v5 : NORMAL1,
  float2 v6 : TEXCOORD0,
  float2 w6 : TEXCOORD1,
  float2 v7 : TEXCOORD2,
  float2 w7 : TEXCOORD3,
  int4 v8 : TEXCOORD4,
  float4 v9 : COLOR1,
  out float3 o0 : POSITION0,
  out float4 o1 : NORMAL0,
  out float4 o2 : TANGENT0,
  out float4 o3 : TANGENT1,
  out float4 o4 : TANGENT2,
  out float2 o5 : TEXCOORD0,
  out float2 p5 : TEXCOORD1,
  out float2 o6 : TEXCOORD2,
  out float2 p6 : TEXCOORD3,
  out float3 o7 : TEXCOORD4,
  out float4 o8 : COLOR1)
{
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer cbMatrixWVP
// {
//
//   row_major float4x4 VC_View_MatrixCamera;// Offset:    0 Size:    64
//   float4x4 VC_View_MatrixViewProj;   // Offset:   64 Size:    64 [unused]
//   float4 VC_ViewFrustumPlanes[4];    // Offset:  128 Size:    64
//
// }
//
// cbuffer cbTessScene
// {
//
//   float4x4 g_f4x4ViewProjection;     // Offset:    0 Size:    64 [unused]
//   float4 g_f4Eye;                    // Offset:   64 Size:    16
//   float4 g_f4ViewVector;             // Offset:   80 Size:    16 [unused]
//   float4 g_f4GUIParams2;             // Offset:   96 Size:    16
//   float4 g_f4ViewFrustumPlanes[4];   // Offset:  112 Size:    64 [unused]
//   float g_fGlobalTime;               // Offset:  176 Size:     4 [unused]
//
// }
//
// cbuffer cbPNTriangles
// {
//
//   float4 g_f4TessFactors;            // Offset:    0 Size:    16
//   float4 g_f4GUIParams1;             // Offset:   16 Size:    16
//   float2 g_fDetailTessellationHeightParam;// Offset:   32 Size:     8
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// cbMatrixWVP                       cbuffer      NA          NA    0        1
// cbTessScene                       cbuffer      NA          NA    5        1
// cbPNTriangles                     cbuffer      NA          NA    6        1
//
//
//
// Patch Constant signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TessFactor            0   x           0  TRIEDGE   float   x   
// POSITION                 3    yzw        0     NONE   float    yzw
// SV_TessFactor            1   x           1  TRIEDGE   float   x   
// POSITION                 4    yzw        1     NONE   float    yzw
// SV_TessFactor            2   x           2  TRIEDGE   float   x   
// POSITION                 5    yzw        2     NONE   float    yzw
// SV_InsideTessFactor      0   x           3   TRIINT   float   x   
// POSITION                 6    yzw        3     NONE   float    yzw
// POSITION                 7   xyz         4     NONE   float   xyz 
// POSITION                 8   xyz         5     NONE   float   xyz 
// CENTER                   0   xyz         6     NONE   float   xyz 
// NORMAL                   3   xyz         7     NONE   float   xyz 
// NORMAL                   4   xyz         8     NONE   float   xyz 
// NORMAL                   5   xyz         9     NONE   float   xyz 
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// NORMAL                   0   xyzw        1     NONE   float   xyzw
// TANGENT                  0   xyzw        2     NONE   float   xyzw
// TANGENT                  1   xyzw        3     NONE   float   xyzw
// TANGENT                  2   xyzw        4     NONE   float   xyzw
// NORMAL                   1   xyz         5     NONE   float   xyz 
// TEXCOORD                 0   xy          6     NONE   float   xy  
// TEXCOORD                 1     zw        6     NONE   float     zw
// TEXCOORD                 2   xy          7     NONE   float   xy  
// TEXCOORD                 3     zw        7     NONE   float       
// TEXCOORD                 4   xyzw        8     NONE     int   x   
// COLOR                    1   xyzw        9     NONE   float   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyz         0     NONE   float   xyz 
// NORMAL                   0   xyzw        1     NONE   float   xyzw
// TANGENT                  0   xyzw        2     NONE   float   xyzw
// TANGENT                  1   xyzw        3     NONE   float   xyzw
// TANGENT                  2   xyzw        4     NONE   float   xyzw
// TEXCOORD                 0   xy          5     NONE   float   xy  
// TEXCOORD                 1     zw        5     NONE   float     zw
// TEXCOORD                 2   xy          6     NONE   float   xy  
// TEXCOORD                 3     zw        6     NONE   float     zw
// TEXCOORD                 4   xyz         7     NONE   float   xyz 
// COLOR                    1   xyzw        8     NONE   float   xyzw
//
// Tessellation Domain   # of control points
// -------------------- --------------------
// Triangle                                3
//
// Tessellation Output Primitive  Partitioning Type 
// ------------------------------ ------------------
// Clockwise Triangles            Odd Fractional    
//
hs_5_0
hs_decls 
dcl_input_control_point_count 3
dcl_output_control_point_count 3
dcl_tessellator_domain domain_tri
dcl_tessellator_partitioning partitioning_fractional_odd
dcl_tessellator_output_primitive output_triangle_cw
dcl_hs_max_tessfactor l(64.000000)
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[12], immediateIndexed
dcl_constantbuffer cb5[7], immediateIndexed
dcl_constantbuffer cb6[3], immediateIndexed
hs_control_point_phase 
dcl_input vOutputControlPointID
dcl_input v[3][0].xyz
dcl_input v[3][1].xyzw
dcl_input v[3][2].xyzw
dcl_input v[3][3].xyzw
dcl_input v[3][4].xyzw
dcl_input v[3][5].xyz
dcl_input v[3][6].xy
dcl_input v[3][6].zw
dcl_input v[3][7].xy
dcl_input v[3][8].x
dcl_input v[3][9].xyzw
dcl_output o0.xyz
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xy
dcl_output o5.zw
dcl_output o6.xy
dcl_output o6.zw
dcl_output o7.xyz
dcl_output o8.xyzw
dcl_temps 1
mov r0.x, vOutputControlPointID
mov o0.xyz, v[r0.x + 0][0].xyzx
mov o1.xyzw, v[r0.x + 0][1].xyzw
mov o2.xyzw, v[r0.x + 0][2].xyzw
mov o3.xyzw, v[r0.x + 0][3].xyzw
mov o4.xyzw, v[r0.x + 0][4].xyzw
mov o5.xyzw, v[r0.x + 0][6].xyzw
mov o6.zw, l(0,0,0,0)
mov o6.xy, v[r0.x + 0][7].xyxx
iadd r0.y, vOutputControlPointID, l(1)
udiv null, r0.y, r0.y, l(3)
and r0.y, v[r0.y + 0][8].x, v[r0.x + 0][8].x
or r0.y, r0.y, v[r0.x + 0][8].x
movc o7.xyz, r0.yyyy, v[r0.x + 0][5].xyzx, v[r0.x + 0][1].xyzx
mov o8.xyzw, v[r0.x + 0][9].xyzw
ret 
hs_fork_phase 
dcl_input vicp[3][0].xyz
dcl_input vicp[3][1].xyz
dcl_input vicp[3][2].xyz
dcl_input vicp[3][3].xyz
dcl_input vicp[3][4].xyz
dcl_input vicp[3][5].xyz
dcl_input vicp[3][8].xyz
dcl_output_siv o0.x, finalTriUeq0EdgeTessFactor
dcl_output o0.yzw
dcl_output_siv o1.x, finalTriVeq0EdgeTessFactor
dcl_output o1.yzw
dcl_output_siv o2.x, finalTriWeq0EdgeTessFactor
dcl_output o2.yzw
dcl_output_siv o3.x, finalTriInsideTessFactor
dcl_output o3.yzw
dcl_output o4.xyz
dcl_output o5.xyz
dcl_output o6.xyz
dcl_output o7.xyz
dcl_output o8.xyz
dcl_output o9.xyz
dcl_temps 19
dcl_indexrange vicp[3][0].xyz 6
mov r0.xyz, vicp[0][0].xyzx
mov r0.w, l(1.000000)
dp4 r1.x, r0.xyzw, cb0[8].xyzw
lt r1.x, -cb6[2].x, r1.x
mov r2.xyz, vicp[1][0].xyzx
mov r2.w, l(1.000000)
dp4 r1.y, r2.xyzw, cb0[8].xyzw
lt r1.y, -cb6[2].x, r1.y
and r1.xy, r1.xyxx, l(0x3f800000, 0x3f800000, 0, 0)
add r1.x, r1.y, r1.x
mov r3.xyz, vicp[2][0].xyzx
mov r3.w, l(1.000000)
dp4 r1.y, r3.xyzw, cb0[8].xyzw
lt r1.y, -cb6[2].x, r1.y
and r1.y, r1.y, l(0x3f800000)
dp4 r1.z, r0.xyzw, cb0[9].xyzw
lt r1.z, -cb6[2].x, r1.z
dp4 r1.w, r2.xyzw, cb0[9].xyzw
lt r1.w, -cb6[2].x, r1.w
and r1.zw, r1.zzzw, l(0, 0, 0x3f800000, 0x3f800000)
add r1.xz, r1.yywy, r1.xxzx
dp4 r1.w, r3.xyzw, cb0[9].xyzw
lt r1.w, -cb6[2].x, r1.w
and r1.w, r1.w, l(0x3f800000)
add r1.y, r1.w, r1.z
dp4 r1.z, r0.xyzw, cb0[10].xyzw
lt r1.z, -cb6[2].x, r1.z
dp4 r1.w, r2.xyzw, cb0[10].xyzw
lt r1.w, -cb6[2].x, r1.w
and r1.zw, r1.zzzw, l(0, 0, 0x3f800000, 0x3f800000)
add r1.z, r1.w, r1.z
dp4 r1.w, r3.xyzw, cb0[10].xyzw
lt r1.w, -cb6[2].x, r1.w
and r1.w, r1.w, l(0x3f800000)
add r4.x, r1.w, r1.z
dp4 r0.x, r0.xyzw, cb0[11].xyzw
lt r0.x, -cb6[2].x, r0.x
dp4 r0.y, r2.xyzw, cb0[11].xyzw
lt r0.y, -cb6[2].x, r0.y
and r0.xy, r0.xyxx, l(0x3f800000, 0x3f800000, 0, 0)
add r0.x, r0.y, r0.x
dp4 r0.y, r3.xyzw, cb0[11].xyzw
lt r0.y, -cb6[2].x, r0.y
and r0.y, r0.y, l(0x3f800000)
add r4.y, r0.y, r0.x
mul r0.xy, r1.xyxx, r4.xyxx
mul r0.x, r0.y, r0.x
add r0.yzw, vicp[0][1].xxyz, vicp[2][1].xxyz
mul r1.xyz, r0.yzwy, l(0.500000, 0.500000, 0.500000, 0.000000)
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
dp3 r1.x, r1.xyzx, -cb0[2].xyzx
add r1.yzw, vicp[1][1].xxyz, vicp[0][1].xxyz
mul r2.xyz, r1.yzwy, l(0.500000, 0.500000, 0.500000, 0.000000)
dp3 r2.w, r2.xyzx, r2.xyzx
rsq r2.w, r2.w
mul r2.xyz, r2.wwww, r2.xyzx
dp3 r2.x, r2.xyzx, -cb0[2].xyzx
add r2.yzw, vicp[2][1].xxyz, vicp[1][1].xxyz
mul r3.xyz, r2.yzwy, l(0.500000, 0.500000, 0.500000, 0.000000)
dp3 r3.w, r3.xyzx, r3.xyzx
rsq r3.w, r3.w
mul r3.xyz, r3.wwww, r3.xyzx
dp3 r3.x, r3.xyzx, -cb0[2].xyzx
lt r3.y, -cb6[1].x, r1.x
lt r3.z, -cb6[1].x, r2.x
lt r3.w, -cb6[1].x, r3.x
ne r0.x, r0.x, l(0.000000)
or r3.z, r3.w, r3.z
or r3.y, r3.z, r3.y
and r0.x, r0.x, r3.y
mul r3.y, cb6[0].w, cb6[1].z
add r4.xyz, vicp[0][0].xyzx, vicp[2][0].xyzx
mad r4.xyz, r4.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), -cb5[4].xyzx
dp3 r3.z, r4.xyzx, r4.xyzx
sqrt r3.z, r3.z
add r3.z, r3.z, -cb6[0].z
div_sat r3.z, r3.z, r3.y
add r4.x, -r3.z, l(1.000000)
add r5.xyz, vicp[1][0].xyzx, vicp[0][0].xyzx
mad r6.xyz, r5.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), -cb5[4].xyzx
dp3 r3.z, r6.xyzx, r6.xyzx
sqrt r3.z, r3.z
add r3.z, r3.z, -cb6[0].z
div_sat r3.z, r3.z, r3.y
add r4.y, -r3.z, l(1.000000)
add r6.xyz, vicp[2][0].xyzx, vicp[1][0].xyzx
mad r6.xyz, r6.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), -cb5[4].xyzx
dp3 r3.z, r6.xyzx, r6.xyzx
sqrt r3.z, r3.z
add r3.z, r3.z, -cb6[0].z
div_sat r3.y, r3.z, r3.y
add r4.z, -r3.y, l(1.000000)
mul r3.yzw, r4.xxyz, cb5[6].xxxx
add r1.x, -|r1.x|, l(1.000000)
add r1.x, r1.x, -cb6[1].y
add r4.x, -cb6[1].y, l(1.000000)
div_sat r1.x, r1.x, r4.x
add r4.y, -cb6[0].y, cb6[0].x
mad r1.x, r1.x, r4.y, cb6[0].y
add r2.x, -|r2.x|, -cb6[1].y
add r2.x, r2.x, l(1.000000)
div_sat r2.x, r2.x, r4.x
mad r2.x, r2.x, r4.y, cb6[0].y
add r3.x, -|r3.x|, -cb6[1].y
add r3.x, r3.x, l(1.000000)
div_sat r3.x, r3.x, r4.x
mad r3.x, r3.x, r4.y, cb6[0].y
add r1.x, r1.x, l(-1.000000)
mad r4.x, r3.y, r1.x, l(1.000000)
add r1.x, r2.x, l(-1.000000)
mad r4.y, r3.z, r1.x, l(1.000000)
add r1.x, r3.x, l(-1.000000)
mad r4.z, r3.w, r1.x, l(1.000000)
and r1.x, l(1), vicp[0][8].x
if_nz r1.x
  mov r1.x, l(1)
else 
  mov r1.x, l(0)
endif 
and r2.x, l(2), vicp[1][8].x
if_nz r2.x
  mov r2.x, l(1)
else 
  mov r2.x, l(0)
endif 
and r3.x, l(4), vicp[2][8].x
if_nz r3.x
  mov r3.x, l(1)
else 
  mov r3.x, l(0)
endif 
mad r3.yzw, vicp[0][0].xxyz, l(0.000000, 2.000000, 2.000000, 2.000000), vicp[1][0].xxyz
add r6.xyz, -vicp[0][0].xyzx, vicp[1][0].xyzx
ishl r1.x, r1.x, l(2)
dp3 r4.w, r6.xyzx, vicp[0][r1.x + 1].xyzx
mad r3.yzw, -r4.wwww, vicp[0][r1.x + 1].xxyz, r3.yyzw
mul r7.xyz, r3.yzwy, l(0.333333, 0.333333, 0.333333, 0.000000)
mad r8.xyz, vicp[1][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), vicp[0][0].xyzx
add r9.xyz, -vicp[1][0].xyzx, vicp[0][0].xyzx
dp3 r4.w, r9.xyzx, vicp[1][r1.x + 1].xyzx
mad r8.xyz, -r4.wwww, vicp[1][r1.x + 1].xyzx, r8.xyzx
mul r8.xyz, r8.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000)
mad r9.xyz, vicp[1][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), vicp[2][0].xyzx
add r10.xyz, -vicp[1][0].xyzx, vicp[2][0].xyzx
ishl r1.x, r2.x, l(2)
dp3 r2.x, r10.xyzx, vicp[1][r1.x + 1].xyzx
mad r9.xyz, -r2.xxxx, vicp[1][r1.x + 1].xyzx, r9.xyzx
mul r11.xyz, r9.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000)
mad r12.xyz, vicp[2][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), vicp[1][0].xyzx
add r13.xyz, -vicp[2][0].xyzx, vicp[1][0].xyzx
dp3 r2.x, r13.xyzx, vicp[2][r1.x + 1].xyzx
mad r12.xyz, -r2.xxxx, vicp[2][r1.x + 1].xyzx, r12.xyzx
mul r13.xyz, r12.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000)
mad r14.xyz, vicp[2][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), vicp[0][0].xyzx
add r15.xyz, -vicp[2][0].xyzx, vicp[0][0].xyzx
ishl r1.x, r3.x, l(2)
dp3 r2.x, r15.xyzx, vicp[2][r1.x + 1].xyzx
mad r14.xyz, -r2.xxxx, vicp[2][r1.x + 1].xyzx, r14.xyzx
mul r16.xyz, r14.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000)
mad r17.xyz, vicp[0][0].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), vicp[2][0].xyzx
add r18.xyz, -vicp[0][0].xyzx, vicp[2][0].xyzx
dp3 r2.x, r18.xyzx, vicp[0][r1.x + 1].xyzx
mad r17.xyz, -r2.xxxx, vicp[0][r1.x + 1].xyzx, r17.xyzx
mul r18.xyz, r17.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000)
mad r3.xyz, r3.yzwy, l(0.333333, 0.333333, 0.333333, 0.000000), r8.xyzx
mad r3.xyz, r9.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000), r3.xyzx
mad r3.xyz, r12.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000), r3.xyzx
mad r3.xyz, r14.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000), r3.xyzx
mad r3.xyz, r17.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000), r3.xyzx
mul r3.xyz, r3.xyzx, l(0.166667, 0.166667, 0.166667, 0.000000)
add r5.xyz, r5.xyzx, vicp[2][0].xyzx
mad r5.xyz, -r5.xyzx, l(0.333333, 0.333333, 0.333333, 0.000000), r3.xyzx
mad r3.xyz, r5.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r3.xyzx
dp3 r1.x, r6.xyzx, r1.yzwy
add r1.x, r1.x, r1.x
dp3 r2.x, r6.xyzx, r6.xyzx
div r1.x, r1.x, r2.x
mad r1.xyz, -r1.xxxx, r6.xyzx, r1.yzwy
dp3 r1.w, r1.xyzx, r1.xyzx
rsq r1.w, r1.w
mul r1.xyz, r1.wwww, r1.xyzx
dp3 r1.w, r10.xyzx, r2.yzwy
add r1.w, r1.w, r1.w
dp3 r2.x, r10.xyzx, r10.xyzx
div r1.w, r1.w, r2.x
mad r2.xyz, -r1.wwww, r10.xyzx, r2.yzwy
dp3 r1.w, r2.xyzx, r2.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r2.xyzx
dp3 r1.w, r15.xyzx, r0.yzwy
add r1.w, r1.w, r1.w
dp3 r2.w, r15.xyzx, r15.xyzx
div r1.w, r1.w, r2.w
mad r0.yzw, -r1.wwww, r15.xxyz, r0.yyzw
dp3 r1.w, r0.yzwy, r0.yzwy
rsq r1.w, r1.w
mul r0.yzw, r0.yyzw, r1.wwww
and r4.xyz, r0.xxxx, r4.xyzx
and o0.yzw, r0.xxxx, r7.xxyz
and o1.yzw, r0.xxxx, r8.xxyz
and o2.yzw, r0.xxxx, r11.xxyz
and o3.yzw, r0.xxxx, r13.xxyz
and o4.xyz, r0.xxxx, r16.xyzx
and o5.xyz, r0.xxxx, r18.xyzx
and o6.xyz, r0.xxxx, r3.xyzx
and o7.xyz, r0.xxxx, r1.xyzx
and o8.xyz, r0.xxxx, r2.xyzx
and o9.xyz, r0.yzwy, r0.xxxx
add r0.x, r4.y, r4.x
add r0.x, r4.z, r0.x
mul r4.w, r0.x, l(0.333333)
min r0.xyzw, r4.xyzw, l(64.000000, 64.000000, 64.000000, 64.000000)
mov o0.x, r0.x
mov o1.x, r0.y
mov o2.x, r0.z
mov o3.x, r0.w
ret 
// Approximately 235 instruction slots used

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