// Shadows Halo
cbuffer cb1 : register(b1)
{
  float4 cb1[4];
}

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




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


void main( 
  uint v0 : SV_VertexID0,
  float3 v1 : ATTRIBUTE0,
  out float4 o0 : TEXCOORD0,
  out float4 o1 : SV_POSITION0)
{
// Needs manual fix for instruction: 
// unknown dcl_: dcl_input_sgv v0.x, vertex_id
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = (uint)cb0[1].x;
  if (r0.x != 0) {
    r0.y = (uint)r0.x;
    r0.z = 3.14159274 / r0.y;
    r0.z = cos(r0.z);
    r0.z = 1 / r0.z;
    sincos(cb0[1].z, r1.x, r2.x);
    r0.w = cb0[1].w * r2.x;
    r1.x = r1.x / r2.x;
    r1.y = (uint)cb0[1].y;
    r1.z = (int)r0.x * (int)r1.y;
    r1.w = cmp((uint)v0.x < (uint)r1.z);
    if (r1.w != 0) {
      uiDest.x = (uint)v0.x / (uint)r0.x;
      r3.x = (uint)v0.x % (uint)r0.x;
      r2.x = uiDest.x;
      r1.w = (uint)r3.x << 1;
      r1.w = (uint)r1.w;
      r1.w = 3.14159274 * r1.w;
      r1.w = r1.w / r0.y;
      r2.x = (uint)r2.x;
      r2.x = r2.x * r0.w;
      r2.y = (int)r1.y + -1;
      r2.y = (uint)r2.y;
      r2.x = r2.x / r2.y;
      r2.y = r2.x * r1.x;
      r2.y = r2.y * r0.z;
      sincos(r1.w, r3.x, r4.x);
      r1.w = r3.x * r2.y;
      r2.y = r4.x * r2.y;
      r3.xyz = cb0[3].xyz * r1.www;
      r2.xzw = r2.xxx * cb0[2].xyz + r3.xyz;
      r2.xyz = r2.yyy * cb0[4].xyz + r2.xzw;
      r2.xyz = cb0[5].xyz + r2.xyz;
      r2.xyz = cb0[6].xyz + r2.xyz;
    } else {
      r0.w = r1.x * r0.w;
      r1.x = (int)-r1.z + (int)v0.x;
      uiDest.x = (uint)r1.x / (uint)r0.x;
      r1.x = (uint)r1.x % (uint)r0.x;
      r0.x = uiDest.x;
      r0.x = (uint)r0.x;
      r0.x = r0.w * r0.x;
      r0.w = (int)r1.y + -1;
      r0.w = (uint)r0.w;
      r0.x = r0.x / r0.w;
      r0.z = r0.x * r0.z;
      r0.x = r0.x * r0.x;
      r0.x = cb0[1].w * cb0[1].w + -r0.x;
      r0.x = sqrt(r0.x);
      r0.w = (uint)r1.x << 1;
      r0.w = (uint)r0.w;
      r0.w = 3.14159274 * r0.w;
      r0.y = r0.w / r0.y;
      sincos(r0.y, r1.x, r3.x);
      r0.y = r1.x * r0.z;
      r0.z = r3.x * r0.z;
      r1.xyz = cb0[3].xyz * r0.yyy;
      r0.xyw = r0.xxx * cb0[2].xyz + r1.xyz;
      r0.xyz = r0.zzz * cb0[4].xyz + r0.xyw;
      r0.xyz = cb0[5].xyz + r0.xyz;
      r2.xyz = cb0[6].xyz + r0.xyz;
    }
  } else {
    r2.xyz = v1.xyz * cb0[0].www + cb0[0].xyz;
  }
  r0.xyzw = cb1[1].xyzw * r2.yyyy;
  r0.xyzw = r2.xxxx * cb1[0].xyzw + r0.xyzw;
  r0.xyzw = r2.zzzz * cb1[2].xyzw + r0.xyzw;
  r0.xyzw = cb1[3].xyzw + r0.xyzw;
  
  o1.xyzw = r0.xyzw;
  
   float4 stereo = StereoParams.Load(0);
  if(r0.w != 1) {
  r0.x += stereo.x * (r0.w - stereo.y);
  }
  
  o0.xyzw = r0.xyzw;
  
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.65 on Wed Sep 20 21:08:16 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_VertexID              0   x           0   VERTID    uint   x   
// ATTRIBUTE                0   xyz         1     NONE   float   xyz 
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xyzw        0     NONE   float   xyzw
// SV_POSITION              0   xyzw        1      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[7], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_input_sgv v0.x, vertex_id
dcl_input v1.xyz
dcl_output o0.xyzw
dcl_output_siv o1.xyzw, position
dcl_temps 5
ftou r0.x, cb0[1].x
if_nz r0.x
  utof r0.y, r0.x
  div r0.z, l(3.14159274), r0.y
  sincos null, r0.z, r0.z
  div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z
  sincos r1.x, r2.x, cb0[1].z
  mul r0.w, r2.x, cb0[1].w
  div r1.x, r1.x, r2.x
  ftou r1.y, cb0[1].y
  imul null, r1.z, r0.x, r1.y
  ult r1.w, v0.x, r1.z
  if_nz r1.w
    udiv r2.x, r3.x, v0.x, r0.x
    ishl r1.w, r3.x, l(1)
    utof r1.w, r1.w
    mul r1.w, r1.w, l(3.14159274)
    div r1.w, r1.w, r0.y
    utof r2.x, r2.x
    mul r2.x, r0.w, r2.x
    iadd r2.y, r1.y, l(-1)
    utof r2.y, r2.y
    div r2.x, r2.x, r2.y
    mul r2.y, r1.x, r2.x
    mul r2.y, r0.z, r2.y
    sincos r3.x, r4.x, r1.w
    mul r1.w, r2.y, r3.x
    mul r2.y, r2.y, r4.x
    mul r3.xyz, r1.wwww, cb0[3].xyzx
    mad r2.xzw, r2.xxxx, cb0[2].xxyz, r3.xxyz
    mad r2.xyz, r2.yyyy, cb0[4].xyzx, r2.xzwx
    add r2.xyz, r2.xyzx, cb0[5].xyzx
    add r2.xyz, r2.xyzx, cb0[6].xyzx
  else 
    mul r0.w, r0.w, r1.x
    iadd r1.x, -r1.z, v0.x
    udiv r0.x, r1.x, r1.x, r0.x
    utof r0.x, r0.x
    mul r0.x, r0.x, r0.w
    iadd r0.w, r1.y, l(-1)
    utof r0.w, r0.w
    div r0.x, r0.x, r0.w
    mul r0.z, r0.z, r0.x
    mul r0.x, r0.x, r0.x
    mad r0.x, cb0[1].w, cb0[1].w, -r0.x
    sqrt r0.x, r0.x
    ishl r0.w, r1.x, l(1)
    utof r0.w, r0.w
    mul r0.w, r0.w, l(3.14159274)
    div r0.y, r0.w, r0.y
    sincos r1.x, r3.x, r0.y
    mul r0.y, r0.z, r1.x
    mul r0.z, r0.z, r3.x
    mul r1.xyz, r0.yyyy, cb0[3].xyzx
    mad r0.xyw, r0.xxxx, cb0[2].xyxz, r1.xyxz
    mad r0.xyz, r0.zzzz, cb0[4].xyzx, r0.xywx
    add r0.xyz, r0.xyzx, cb0[5].xyzx
    add r2.xyz, r0.xyzx, cb0[6].xyzx
  endif 
else 
  mad r2.xyz, v1.xyzx, cb0[0].wwww, cb0[0].xyzx
endif 
mul r0.xyzw, r2.yyyy, cb1[1].xyzw
mad r0.xyzw, r2.xxxx, cb1[0].xyzw, r0.xyzw
mad r0.xyzw, r2.zzzz, cb1[2].xyzw, r0.xyzw
add r0.xyzw, r0.xyzw, cb1[3].xyzw
mov o0.xyzw, r0.xyzw
mov o1.xyzw, r0.xyzw
ret 
// Approximately 0 instruction slots used

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