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

cbuffer ccbSceneParam : register(b0)
{
  float4 m_ElapsedTime : packoffset(c0);
  float4 m_CameraNearFar : packoffset(c1);
  float4 m_ParentMove : packoffset(c2);
  float4 m_ParentRot : packoffset(c3);
  float4 m_ParentScale : packoffset(c4);
  float4 m_ParentColor : packoffset(c5);
  int4 m_TexNumInfo : packoffset(c6);
  int4 m_EmitInfo : packoffset(c7);
  float4 m_MoveInterpolateWeight : packoffset(c8);
  float4 m_WanderingVisionResetTime : packoffset(c9);
  float4 m_WanderingVisionEmitInfo : packoffset(c10);
  float4 m_WanderingVisionVelocity : packoffset(c11);
  float4 m_WanderingVisionAddVelocity : packoffset(c12);
  float4 m_WanderingVisionInitScale : packoffset(c13);
  float4 m_WanderingVisionScaleVelocity : packoffset(c14);
  float4 m_WanderingVisionScaleAddVelocity : packoffset(c15);
  float4 m_WanderingVisionColor : packoffset(c16);
  int4 m_WanderingVisionCloneParam : packoffset(c17);
  float4 m_WanderingVisionForceRate : packoffset(c18);
  float4 m_WanderingVisionLongevity : packoffset(c19);
  float4 m_WanderingVisionEdgeParam : packoffset(c20);
  float4 m_WanderingVisionNormalVelocity : packoffset(c21);
  float4 m_WanderingVisionInitRotation : packoffset(c22);
  float4 m_WanderingVisionRotationVelocity : packoffset(c23);
  float4 m_WanderingVisionRotationAddVelocity : packoffset(c24);
  float4 m_WanderingVisionNoiseVelocityMin : packoffset(c25);
  float4 m_WanderingVisionNoiseVelocityMax : packoffset(c26);
  float4 m_WanderingVisionNoiseAddVelocityMin : packoffset(c27);
  float4 m_WanderingVisionNoiseAddVelocityMax : packoffset(c28);
  float4 m_WanderingVisionNoiseRotMin : packoffset(c29);
  float4 m_WanderingVisionNoiseRotMax : packoffset(c30);
  float4 m_WanderingVisionNoiseRotVelocityMin : packoffset(c31);
  float4 m_WanderingVisionNoiseRotVelocityMax : packoffset(c32);
  float4 m_WanderingVisionNoiseRotAddVelocityMin : packoffset(c33);
  float4 m_WanderingVisionNoiseRotAddVelocityMax : packoffset(c34);
  float4 m_WanderingVisionNoiseInitScaleMin : packoffset(c35);
  float4 m_WanderingVisionNoiseInitScaleMax : packoffset(c36);
  float4 m_WanderingVisionNoiseScaleVelocityMin : packoffset(c37);
  float4 m_WanderingVisionNoiseScaleVelocityMax : packoffset(c38);
  float4 m_WanderingVisionNoiseScaleAddVelocityMin : packoffset(c39);
  float4 m_WanderingVisionNoiseScaleAddVelocityMax : packoffset(c40);
  float4 m_WanderingVisionNoiseColorMin : packoffset(c41);
  float4 m_WanderingVisionNoiseColorMax : packoffset(c42);
  float4 m_vDepthComputeParam : packoffset(c43);
  int4 m_vDepthTexParam : packoffset(c44);
  int4 m_YurayuraParam : packoffset(c45);
  int4 m_HitParam : packoffset(c46);
  float4 m_UvCropInfo : packoffset(c47);
  float4 m_ParentWeight : packoffset(c48);
  int4 m_KeyBlendParam : packoffset(c49);
  float4x4 m_CameraMatrix : packoffset(c50);
  float4x4 m_ViewMatrix : packoffset(c54);
  float4x4 m_ProjMatrix : packoffset(c58);
  float4x4 m_ViewProjMatrix : packoffset(c62);
  float4 m_ForceUnevenness : packoffset(c66);
  int4 m_TraceInfo : packoffset(c67);
  float4 m_TraceParam : packoffset(c68);
}

cbuffer ccbForceFiledParam : register(b1)
{
  int4 m_CulcForceFiledDataNum : packoffset(c0);
  int4 m_ForceFiledType[8] : packoffset(c1);
  float4 m_ForceFiledStart[8] : packoffset(c9);
  float4 m_ForceFiledArea[8] : packoffset(c17);
  float4 m_ForcePower[8] : packoffset(c25);
  float4 m_ForceDir[8] : packoffset(c33);
  float4 m_ForceSpeedScale[8] : packoffset(c41);
  float4 m_ForceSizeScale[8] : packoffset(c49);
  int4 m_ForceShapeType[8] : packoffset(c57);
  float4 m_ForceColisionPosition[8] : packoffset(c65);
  float4 m_ForceColisionRadius[8] : packoffset(c73);
  float4 m_ForceColisionEndPosition[8] : packoffset(c81);
  float4 m_ForceExternalVector[8] : packoffset(c89);
  float4 m_ForceDownBurstParam[8] : packoffset(c97);
  float4x4 m_ForceColisionRotateMatrix[8] : packoffset(c105);
  float4 m_WaveScaleNoise[8] : packoffset(c137);
  int4 m_CulcColisionDataNum : packoffset(c145);
  int4 m_ShapeType[8] : packoffset(c146);
  float4 m_ColisionPosition[8] : packoffset(c154);
  float4 m_ColisionRadius[8] : packoffset(c162);
  float4 m_ColisionEndPosition[8] : packoffset(c170);
  float4 m_ColisionPlaneSize[8] : packoffset(c178);
  float4x4 m_ColisionRotateMatrix[8] : packoffset(c186);
}

StructuredBuffer<rVertMaxBuf> rVertMaxBuf : register(t1);


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


void main()
{
// Needs manual fix for instruction: 
// unknown dcl_: dcl_resource_structured t1, 4 
// Needs manual fix for instruction: 
// unknown dcl_: dcl_uav_structured u0, 48
// Needs manual fix for instruction: 
// unknown dcl_: dcl_uav_structured u1, 208
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16;
  uint4 bitmask, uiDest;
  float4 fDest;

// Needs manual fix for instruction: 
// unknown dcl_: dcl_thread_group 128, 1, 1
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.x, l(0), l(0), t1.xxxx
r0.x = rVertMaxBuf[]..swiz;
  r0.x = cmp((uint)vThreadID.x < (uint)r0.x);
  if (r0.x != 0) {
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r0.xyzw, vThreadID.x, l(0), u0.xyzw
  r0.x = rVertMaxBuf[]..swiz;
  r0.y = rVertMaxBuf[]..swiz;
  r0.z = rVertMaxBuf[]..swiz;
  r0.w = rVertMaxBuf[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r1.xyzw, vThreadID.x, l(16), u0.zxyw
  r1.x = rVertMaxBuf[]..swiz;
  r1.y = rVertMaxBuf[]..swiz;
  r1.z = rVertMaxBuf[]..swiz;
  r1.w = rVertMaxBuf[]..swiz;
  // Known bad code for instruction (needs manual fix):
    ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r2.xyzw, vThreadID.x, l(32), u0.xyzw
  r2.x = rVertMaxBuf[]..swiz;
  r2.y = rVertMaxBuf[]..swiz;
  r2.z = rVertMaxBuf[]..swiz;
  r2.w = rVertMaxBuf[]..swiz;
    r3.x = (int)vThreadID.x * 171;
    r3.x = (uint)r3.x;
    r3.x = m_ElapsedTime.y * 1319 + r3.x;
    r3.y = dot(r0.xyz, float3(157,77,61));
    r3.x = r3.x + r3.y;
    r2.x = m_ElapsedTime.x + r2.x;
    r3.y = cmp(m_WanderingVisionResetTime.x < r2.x);
    r3.y = r3.y ? 1 : r1.x;
    r3.z = m_ShapeType[0].x;
    r3.w = m_ShapeType[1].x;
    r4.x = m_ShapeType[2].x;
    r4.yz = float2(0,0);
    while (true) {
      r4.w = cmp((int)r4.z >= (int)m_CulcColisionDataNum.x);
      if (r4.w != 0) break;
      r5.xyzw = cmp((int4)r4.zzzz == int4(0,1,2,3));
      r6.xyzw = cmp((int4)r4.zzzz == int4(4,5,6,7));
      r4.w = r5.x ? r3.z : 0;
      r5.x = r5.y ? r3.w : 0;
      r4.w = (int)r4.w | (int)r5.x;
      r5.x = r5.z ? r4.x : 0;
      r4.w = (int)r4.w | (int)r5.x;
      r5.x = r5.w ? m_ShapeType[3].x : 0;
      r4.w = (int)r4.w | (int)r5.x;
      r5.x = r6.x ? m_ShapeType[4].x : 0;
      r4.w = (int)r4.w | (int)r5.x;
      r5.x = r6.y ? m_ShapeType[5].x : 0;
      r4.w = (int)r4.w | (int)r5.x;
      r5.x = r6.z ? m_ShapeType[6].x : 0;
      r4.w = (int)r4.w | (int)r5.x;
      r5.x = r6.w ? m_ShapeType[7].x : 0;
      r4.w = (int)r4.w | (int)r5.x;
      if (r4.w == 0) {
        r5.x = (int)r4.z + 1;
        r4.z = r5.x;
        continue;
      } else {
        r5.x = cmp((int)r4.w == 1);
        if (r5.x != 0) {
          r5.xyz = m_ColisionPosition[r4.z].xyz + -r0.xyz;
          r5.x = dot(r5.xyz, r5.xyz);
          r5.x = sqrt(r5.x);
          r5.x = cmp(r5.x < m_ColisionRadius[r4.z].x);
          r4.y = r5.x ? 1 : r4.y;
        } else {
          r5.x = cmp((int)r4.w == 3);
          if (r5.x != 0) {
            r5.x = (uint)r4.z << 2;
            r5.yzw = m_ColisionEndPosition[r4.z].xyz + m_ColisionPosition[r4.z].xyz;
            r6.xyz = m_ColisionEndPosition[r4.z].xyz + -m_ColisionPosition[r4.z].xyz;
            r6.xyz = float3(0.5,0.5,0.5) * abs(r6.xyz);
            r5.yzw = -r5.yzw * float3(0.5,0.5,0.5) + r0.xyz;
            r6.w = dot(r5.yzw, m_ColisionRotateMatrix[r5.x/4]._m00_m10_m20);
            r6.x = cmp(r6.x < abs(r6.w));
            r6.w = dot(r5.yzw, m_ColisionRotateMatrix[r5.x/4]._m01_m11_m21);
            r6.y = cmp(r6.y < abs(r6.w));
            r5.x = dot(r5.yzw, m_ColisionRotateMatrix[r5.x/4]._m02_m12_m22);
            r5.x = cmp(r6.z < abs(r5.x));
            r5.x = (int)r6.y | (int)r5.x;
            r5.x = (int)r6.x | (int)r5.x;
            r4.y = r5.x ? r4.y : 1;
          } else {
            r4.w = cmp((int)r4.w == 4);
            if (r4.w != 0) {
              r5.xyz = m_ColisionEndPosition[r4.z].xyz + -m_ColisionPosition[r4.z].xyz;
              r6.xyz = -m_ColisionPosition[r4.z].xyz + r0.xyz;
              r7.xyz = -m_ColisionEndPosition[r4.z].xyz + r0.xyz;
              r4.w = dot(r6.xyz, r5.xyz);
              r5.w = dot(r6.xyz, r6.xyz);
              r6.x = sqrt(r5.w);
              r6.y = cmp(0 < r4.w);
              r5.x = dot(r5.xyz, r5.xyz);
              r5.y = cmp(r4.w >= r5.x);
              r5.z = dot(r7.xyz, r7.xyz);
              r5.z = sqrt(r5.z);
              r4.w = r4.w * r4.w;
              r4.w = r4.w / r5.x;
              r4.w = r5.w + -r4.w;
              r4.w = sqrt(r4.w);
              r4.w = r5.y ? r5.z : r4.w;
              r4.w = r6.y ? r4.w : r6.x;
              r4.w = cmp(m_ColisionRadius[r4.z].x >= r4.w);
              r4.y = r4.w ? 1 : r4.y;
            }
          }
        }
      }
      r4.z = (int)r4.z + 1;
    }
    r3.z = cmp(0 < (int)r4.y);
    r4.x = r3.z ? 0 : r3.y;
    r3.y = trunc(r3.x);
    r3.y = r3.y + r0.x;
    r3.y = r3.y + r0.y;
    r3.y = r3.y + r0.z;
    r3.w = cmp(0 < (int)r4.x);
    r4.w = cmp(0 < (int)m_EmitInfo.y);
    r3.w = r3.w ? r4.w : 0;
    if (r3.w != 0) {
      r3.x = (int)r3.x;
      r5.xyzw = f32tof16(r0.wxyz);
      r6.xy = f32tof16(r1.yz);
      r6.x = mad((int)r6.x, 0x00010000, (int)r5.x);
      r3.w = mad(6389, (int)r3.x, 7381);
      r3.w = (int)r3.w & 0x000fffff;
      r4.w = (int)r3.w;
      r4.w = m_WanderingVisionLongevity.z * r4.w;
      r4.w = r4.w * 9.53674316e-007 + m_WanderingVisionLongevity.y;
      r4.w = m_WanderingVisionLongevity.x + r4.w;
      r4.w = f32tof16(r4.w);
      r6.z = mad((int)r4.w, 0x00010000, (int)r4.w);
      r7.xyzw = (int4)r3.xxxx + int4(100,1217,60,117);
      r8.xyzw = m_WanderingVisionNoiseVelocityMax.xyzw + -m_WanderingVisionNoiseVelocityMin.xyzw;
      r7.xyzw = mad(int4(6389,6389,6389,6389), (int4)r7.xyzw, int4(7381,7381,7381,7381));
      r7.xyzw = (int4)r7.xyzw & int4(0,0,0,0);
      r7.xyzw = (uint4)r7.xyzw % int4(1000,1000,1000,1000);
      r7.xyzw = (int4)r7.xyzw;
      r7.xyzw = float4(0.00100000005,0.00100000005,0.00100000005,0.00100000005) * r7.xyzw;
      r8.xyzw = r7.xxxx * r8.xyzw + m_WanderingVisionNoiseVelocityMin.xyzw;
      r8.xyzw = m_WanderingVisionVelocity.xyzw + r8.xyzw;
      r8.xyz = r8.xyz + r2.yzw;
      r1.x = r0.w;
      r9.xyz = m_WanderingVisionNormalVelocity.xxx * r1.xyz;
      r9.w = 0;
      r8.xyzw = r9.xyzw + r8.xyzw;
      r8.xyzw = f32tof16(r8.xyzw);
      r8.xy = mad((int2)r8.yw, int2(0,0), (int2)r8.xz);
      r9.xyz = r1.xyz * float3(0.00249999994,0.00249999994,0.00249999994) + r0.xyz;
      r2.yzw = f32tof16(m_WanderingVisionAddVelocity.xyz);
      r8.z = mad((int)r2.z, 0x00010000, (int)r2.y);
      r1.z = f32tof16(m_WanderingVisionNormalVelocity.z);
      r8.w = mad((int)r1.z, 0x00010000, (int)r2.w);
      r10.xyzw = m_WanderingVisionNoiseAddVelocityMax.xyzw + -m_WanderingVisionNoiseAddVelocityMin.xyzw;
      r10.xyzw = r7.yyyy * r10.xyzw + m_WanderingVisionNoiseAddVelocityMin.xyzw;
      r10.xyzw = f32tof16(r10.xyzw);
      r10.xy = mad((int2)r10.yw, int2(0,0), (int2)r10.xz);
      r11.xyzw = m_WanderingVisionNoiseRotMax.xyzw + -m_WanderingVisionNoiseRotMin.xyzw;
      r1.z = (uint)r3.w % 1000;
      r1.z = (int)r1.z;
      r1.z = 0.00100000005 * r1.z;
      r11.xyzw = r1.zzzz * r11.xyzw + m_WanderingVisionNoiseRotMin.xyzw;
      r11.xyzw = m_WanderingVisionInitRotation.xyzw + r11.xyzw;
      r11.xyzw = f32tof16(r11.xyzw);
      r11.xy = mad((int2)r11.yw, int2(0,0), (int2)r11.xz);
      r12.xyzw = m_WanderingVisionNoiseRotVelocityMax.xyzw + -m_WanderingVisionNoiseRotVelocityMin.xyzw;
      r12.xyzw = r1.zzzz * r12.xyzw + m_WanderingVisionNoiseRotVelocityMin.xyzw;
      r12.xyzw = m_WanderingVisionRotationVelocity.xyzw + r12.xyzw;
      r12.xyzw = f32tof16(r12.xyzw);
      r12.xy = mad((int2)r12.yw, int2(0,0), (int2)r12.xz);
      r13.xyzw = f32tof16(m_WanderingVisionRotationAddVelocity.xyzw);
      r12.zw = mad((int2)r13.yw, int2(0,0), (int2)r13.xz);
      r13.xyzw = m_WanderingVisionNoiseRotAddVelocityMax.xyzw + -m_WanderingVisionNoiseRotAddVelocityMin.xyzw;
      r13.xyzw = r7.yyyy * r13.xyzw + m_WanderingVisionNoiseRotAddVelocityMin.xyzw;
      r13.xyzw = f32tof16(r13.xyzw);
      r10.zw = mad((int2)r13.yw, int2(0,0), (int2)r13.xz);
      r13.xyzw = m_WanderingVisionNoiseInitScaleMax.xyzw + -m_WanderingVisionNoiseInitScaleMin.xyzw;
      r13.xyzw = r7.xxxx * r13.xyzw + m_WanderingVisionNoiseInitScaleMin.xyzw;
      r13.xyzw = m_WanderingVisionInitScale.xyzw + r13.xyzw;
      r13.xyzw = max(float4(0,0,0,0), r13.xyzw);
      r13.xyzw = f32tof16(r13.xyzw);
      r11.zw = mad((int2)r13.yw, int2(0,0), (int2)r13.xz);
      r13.xyzw = m_WanderingVisionNoiseScaleVelocityMax.xyzw + -m_WanderingVisionNoiseScaleVelocityMin.xyzw;
      r13.xyzw = r7.zzzz * r13.xyzw + m_WanderingVisionNoiseScaleVelocityMin.xyzw;
      r13.xyzw = m_WanderingVisionScaleVelocity.xyzw + r13.xyzw;
      r13.xyzw = f32tof16(r13.xyzw);
      r13.xy = mad((int2)r13.yw, int2(0,0), (int2)r13.xz);
      r14.xyzw = f32tof16(m_WanderingVisionScaleAddVelocity.xyzw);
      r13.zw = mad((int2)r14.yw, int2(0,0), (int2)r14.xz);
      r14.xyzw = m_WanderingVisionNoiseScaleAddVelocityMax.xyzw + -m_WanderingVisionNoiseScaleAddVelocityMin.xyzw;
      r7.xyzw = r7.wwww * r14.xyzw + m_WanderingVisionNoiseScaleAddVelocityMin.xyzw;
      r7.xyzw = f32tof16(r7.xyzw);
      r7.xy = mad((int2)r7.yw, int2(0,0), (int2)r7.xz);
      r14.xyzw = f32tof16(m_WanderingVisionColor.xyzw);
      r14.xy = mad((int2)r14.yw, int2(0,0), (int2)r14.xz);
      r1.z = (int)r3.x + 4817;
      r15.xyzw = m_WanderingVisionNoiseColorMax.xyzw + -m_WanderingVisionNoiseColorMin.xyzw;
      r1.z = mad(6389, (int)r1.z, 7381);
      r1.z = (int)r1.z & 0x000fffff;
      r1.z = (uint)r1.z % 1000;
      r1.z = (int)r1.z;
      r1.z = 0.00100000005 * r1.z;
      r15.xyzw = r1.zzzz * r15.xyzw + m_WanderingVisionNoiseColorMin.xyzw;
      r15.xyzw = f32tof16(r15.xyzw);
      r7.zw = mad((int2)r15.yw, int2(0,0), (int2)r15.xz);
      r2.yz = (int2)m_TexNumInfo.xy;
      r2.yz = float2(1,1) / r2.yz;
      r2.yz = f32tof16(r2.yz);
      r14.z = mad((int)r2.z, 0x00010000, (int)r2.y);
      r1.z = f32tof16(m_WanderingVisionEdgeParam.x);
      r15.w = (uint)r1.z << 16;
      r1.z = f32tof16(m_WanderingVisionForceRate.x);
      r16.x = mad((int)r5.y, 0x00010000, (int)r1.z);
      r16.y = mad((int)r5.w, 0x00010000, (int)r5.z);
      // Needs manual fix for instruction:
        imm_atomic_alloc r5.x, u1
      InterlockedExchange ?(dest, value, orig_value);
      r9.w = 1;
      [r5.x].0 = u1.xyzw;
      r6.w = 0;
      [r5.x].16 = u1.xyzw;
      [r5.x].32 = u1.xyzw;
      [r5.x].48 = u1.xyzw;
      [r5.x].64 = u1.xyzw;
      r14.w = 0;
      [r5.x].80 = u1.xyzw;
      r15.xyz = float3(0,0.00782680511,0);
      [r5.x].96 = u1.xyzw;
      r16.zw = float2(0,0);
      [r5.x].112 = u1.xyzw;
      [r5.x].128 = u1.xyzw;
      [r5.x].144 = u1.xyzw;
      [r5.x].160 = u1.xyzw;
      r1.y = 0;
      r1.x = m_TexNumInfo.z;
      [r5.x].176 = u1.xyzw;
      r0.w = 0;
      [r5.x].192 = u1.xyzw;
      r0.x = m_ElapsedTime.y * 31991 + r3.y;
      r0.x = (uint)r0.x;
      r0.x = mad(6389, (int)r0.x, 7381);
      r0.x = (int)r0.x & 0x000fffff;
      r0.x = (uint)r0.x % 1000;
      r0.x = (int)r0.x;
      r0.x = m_WanderingVisionResetTime.x * r0.x;
      r4.z = 0.00100000005 * r0.x;
      r4.xy = float2(0,0);
    } else {
      r0.x = m_ElapsedTime.y * 3319 + r3.y;
      r0.x = (uint)r0.x;
      r0.x = mad(6389, (int)r0.x, 7381);
      r0.x = (int)r0.x & 0x000fffff;
      r0.x = (uint)r0.x % 1000;
      r0.x = (int)r0.x;
      r0.x = m_WanderingVisionResetTime.x * r0.x;
      r0.x = 0.00100000005 * r0.x;
      r4.z = r3.z ? r0.x : r2.x;
      r4.y = r1.w;
    }
    [vThreadID.x].24 = u0.xyz;
  }
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Original ASM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//
// Buffer Definitions: 
//
// cbuffer ccbSceneParam
// {
//
//   float4 m_ElapsedTime;              // Offset:    0 Size:    16
//   float4 m_CameraNearFar;            // Offset:   16 Size:    16 [unused]
//   float4 m_ParentMove;               // Offset:   32 Size:    16 [unused]
//   float4 m_ParentRot;                // Offset:   48 Size:    16 [unused]
//   float4 m_ParentScale;              // Offset:   64 Size:    16 [unused]
//   float4 m_ParentColor;              // Offset:   80 Size:    16 [unused]
//   int4 m_TexNumInfo;                 // Offset:   96 Size:    16
//   int4 m_EmitInfo;                   // Offset:  112 Size:    16
//   float4 m_MoveInterpolateWeight;    // Offset:  128 Size:    16 [unused]
//   float4 m_WanderingVisionResetTime; // Offset:  144 Size:    16
//   float4 m_WanderingVisionEmitInfo;  // Offset:  160 Size:    16 [unused]
//   float4 m_WanderingVisionVelocity;  // Offset:  176 Size:    16
//   float4 m_WanderingVisionAddVelocity;// Offset:  192 Size:    16
//   float4 m_WanderingVisionInitScale; // Offset:  208 Size:    16
//   float4 m_WanderingVisionScaleVelocity;// Offset:  224 Size:    16
//   float4 m_WanderingVisionScaleAddVelocity;// Offset:  240 Size:    16
//   float4 m_WanderingVisionColor;     // Offset:  256 Size:    16
//   int4 m_WanderingVisionCloneParam;  // Offset:  272 Size:    16 [unused]
//   float4 m_WanderingVisionForceRate; // Offset:  288 Size:    16
//   float4 m_WanderingVisionLongevity; // Offset:  304 Size:    16
//   float4 m_WanderingVisionEdgeParam; // Offset:  320 Size:    16
//   float4 m_WanderingVisionNormalVelocity;// Offset:  336 Size:    16
//   float4 m_WanderingVisionInitRotation;// Offset:  352 Size:    16
//   float4 m_WanderingVisionRotationVelocity;// Offset:  368 Size:    16
//   float4 m_WanderingVisionRotationAddVelocity;// Offset:  384 Size:    16
//   float4 m_WanderingVisionNoiseVelocityMin;// Offset:  400 Size:    16
//   float4 m_WanderingVisionNoiseVelocityMax;// Offset:  416 Size:    16
//   float4 m_WanderingVisionNoiseAddVelocityMin;// Offset:  432 Size:    16
//   float4 m_WanderingVisionNoiseAddVelocityMax;// Offset:  448 Size:    16
//   float4 m_WanderingVisionNoiseRotMin;// Offset:  464 Size:    16
//   float4 m_WanderingVisionNoiseRotMax;// Offset:  480 Size:    16
//   float4 m_WanderingVisionNoiseRotVelocityMin;// Offset:  496 Size:    16
//   float4 m_WanderingVisionNoiseRotVelocityMax;// Offset:  512 Size:    16
//   float4 m_WanderingVisionNoiseRotAddVelocityMin;// Offset:  528 Size:    16
//   float4 m_WanderingVisionNoiseRotAddVelocityMax;// Offset:  544 Size:    16
//   float4 m_WanderingVisionNoiseInitScaleMin;// Offset:  560 Size:    16
//   float4 m_WanderingVisionNoiseInitScaleMax;// Offset:  576 Size:    16
//   float4 m_WanderingVisionNoiseScaleVelocityMin;// Offset:  592 Size:    16
//   float4 m_WanderingVisionNoiseScaleVelocityMax;// Offset:  608 Size:    16
//   float4 m_WanderingVisionNoiseScaleAddVelocityMin;// Offset:  624 Size:    16
//   float4 m_WanderingVisionNoiseScaleAddVelocityMax;// Offset:  640 Size:    16
//   float4 m_WanderingVisionNoiseColorMin;// Offset:  656 Size:    16
//   float4 m_WanderingVisionNoiseColorMax;// Offset:  672 Size:    16
//   float4 m_vDepthComputeParam;       // Offset:  688 Size:    16 [unused]
//   int4 m_vDepthTexParam;             // Offset:  704 Size:    16 [unused]
//   int4 m_YurayuraParam;              // Offset:  720 Size:    16 [unused]
//   int4 m_HitParam;                   // Offset:  736 Size:    16 [unused]
//   float4 m_UvCropInfo;               // Offset:  752 Size:    16 [unused]
//   float4 m_ParentWeight;             // Offset:  768 Size:    16 [unused]
//   int4 m_KeyBlendParam;              // Offset:  784 Size:    16 [unused]
//   float4x4 m_CameraMatrix;           // Offset:  800 Size:    64 [unused]
//   float4x4 m_ViewMatrix;             // Offset:  864 Size:    64 [unused]
//   float4x4 m_ProjMatrix;             // Offset:  928 Size:    64 [unused]
//   float4x4 m_ViewProjMatrix;         // Offset:  992 Size:    64 [unused]
//   float4 m_ForceUnevenness;          // Offset: 1056 Size:    16 [unused]
//   int4 m_TraceInfo;                  // Offset: 1072 Size:    16 [unused]
//   float4 m_TraceParam;               // Offset: 1088 Size:    16 [unused]
//
// }
//
// cbuffer ccbForceFiledParam
// {
//
//   int4 m_CulcForceFiledDataNum;      // Offset:    0 Size:    16 [unused]
//   int4 m_ForceFiledType[8];          // Offset:   16 Size:   128 [unused]
//   float4 m_ForceFiledStart[8];       // Offset:  144 Size:   128 [unused]
//   float4 m_ForceFiledArea[8];        // Offset:  272 Size:   128 [unused]
//   float4 m_ForcePower[8];            // Offset:  400 Size:   128 [unused]
//   float4 m_ForceDir[8];              // Offset:  528 Size:   128 [unused]
//   float4 m_ForceSpeedScale[8];       // Offset:  656 Size:   128 [unused]
//   float4 m_ForceSizeScale[8];        // Offset:  784 Size:   128 [unused]
//   int4 m_ForceShapeType[8];          // Offset:  912 Size:   128 [unused]
//   float4 m_ForceColisionPosition[8]; // Offset: 1040 Size:   128 [unused]
//   float4 m_ForceColisionRadius[8];   // Offset: 1168 Size:   128 [unused]
//   float4 m_ForceColisionEndPosition[8];// Offset: 1296 Size:   128 [unused]
//   float4 m_ForceExternalVector[8];   // Offset: 1424 Size:   128 [unused]
//   float4 m_ForceDownBurstParam[8];   // Offset: 1552 Size:   128 [unused]
//   float4x4 m_ForceColisionRotateMatrix[8];// Offset: 1680 Size:   512 [unused]
//   float4 m_WaveScaleNoise[8];        // Offset: 2192 Size:   128 [unused]
//   int4 m_CulcColisionDataNum;        // Offset: 2320 Size:    16
//   int4 m_ShapeType[8];               // Offset: 2336 Size:   128
//   float4 m_ColisionPosition[8];      // Offset: 2464 Size:   128
//   float4 m_ColisionRadius[8];        // Offset: 2592 Size:   128
//   float4 m_ColisionEndPosition[8];   // Offset: 2720 Size:   128
//   float4 m_ColisionPlaneSize[8];     // Offset: 2848 Size:   128 [unused]
//   float4x4 m_ColisionRotateMatrix[8];// Offset: 2976 Size:   512
//
// }
//
// Resource bind info for rVertMaxBuf
// {
//
//   uint $Element;                     // Offset:    0 Size:     4
//
// }
//
// Resource bind info for rwEmitterToParticleBuf
// {
//
//   struct GXWanderingVisionEmitter
//   {
//       
//       float3 position;               // Offset:    0
//       float3 normal;                 // Offset:   12
//       int2 isActive;                 // Offset:   24
//       float ActiveCounter;           // Offset:   32
//       float3 MoveVelocity;           // Offset:   36
//
//   } $Element;                        // Offset:    0 Size:    48
//
// }
//
// Resource bind info for appendEmitterToParticleBuf
// {
//
//   struct GXWanderingVisionParticleVS
//   {
//       
//       float4 Position;               // Offset:    0
//       uint2 Normal;                  // Offset:   16
//       uint2 Longevity;               // Offset:   24
//       uint2 Velocity;                // Offset:   32
//       uint2 AddVelocity;             // Offset:   40
//       uint2 Rotation;                // Offset:   48
//       uint2 NoneWeightScale;         // Offset:   56
//       uint2 ScaleVelocity;           // Offset:   64
//       uint2 ScaleAddVelocity;        // Offset:   72
//       uint2 NoneWeightColor;         // Offset:   80
//       uint2 UvCropInfo;              // Offset:   88
//       uint2 CurrentDiffuseUV;        // Offset:   96
//       uint2 BlendParam;              // Offset:  104
//       uint2 ForceRate;               // Offset:  112
//       uint2 ForceVelocity;           // Offset:  120
//       uint2 MoveBaseAddVelNoise;     // Offset:  128
//       uint2 RotBaseAddVelNoise;      // Offset:  136
//       uint2 ScaleBaseAddVelNoise;    // Offset:  144
//       uint2 ColorBaseNoise;          // Offset:  152
//       uint2 RotationVelocity;        // Offset:  160
//       uint2 RotationAddVelocity;     // Offset:  168
//       int4 UvOption;                 // Offset:  176
//       float4 OldModelVertex;         // Offset:  192
//
//   } $Element;                        // Offset:    0 Size:   208
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// rVertMaxBuf                       texture  struct         r/o    1        1
// rwEmitterToParticleBuf                UAV  struct         r/w    0        1
// appendEmitterToParticleBuf            UAV  struct      append    1        1
// ccbSceneParam                     cbuffer      NA          NA    0        1
// ccbForceFiledParam                cbuffer      NA          NA    1        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[43], immediateIndexed
dcl_constantbuffer cb1[218], dynamicIndexed
dcl_resource_structured t1, 4 
dcl_uav_structured u0, 48
dcl_uav_structured u1, 208
dcl_input vThreadID.x
dcl_temps 17
dcl_thread_group 128, 1, 1
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.x, l(0), l(0), t1.xxxx
ult r0.x, vThreadID.x, r0.x
if_nz r0.x
  ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r0.xyzw, vThreadID.x, l(0), u0.xyzw
  ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r1.xyzw, vThreadID.x, l(16), u0.zxyw
  ld_structured_indexable(structured_buffer, stride=48)(mixed,mixed,mixed,mixed) r2.xyzw, vThreadID.x, l(32), u0.xyzw
  imul null, r3.x, vThreadID.x, l(171)
  utof r3.x, r3.x
  mad r3.x, cb0[0].y, l(1319.000000), r3.x
  dp3 r3.y, r0.xyzx, l(157.000000, 77.000000, 61.000000, 0.000000)
  add r3.x, r3.y, r3.x
  add r2.x, r2.x, cb0[0].x
  lt r3.y, cb0[9].x, r2.x
  movc r3.y, r3.y, l(1), r1.x
  mov r3.z, cb1[146].x
  mov r3.w, cb1[147].x
  mov r4.x, cb1[148].x
  mov r4.yz, l(0,0,0,0)
  loop 
    ige r4.w, r4.z, cb1[145].x
    breakc_nz r4.w
    ieq r5.xyzw, r4.zzzz, l(0, 1, 2, 3)
    ieq r6.xyzw, r4.zzzz, l(4, 5, 6, 7)
    and r4.w, r3.z, r5.x
    and r5.x, r3.w, r5.y
    or r4.w, r4.w, r5.x
    and r5.x, r4.x, r5.z
    or r4.w, r4.w, r5.x
    and r5.x, r5.w, cb1[149].x
    or r4.w, r4.w, r5.x
    and r5.x, r6.x, cb1[150].x
    or r4.w, r4.w, r5.x
    and r5.x, r6.y, cb1[151].x
    or r4.w, r4.w, r5.x
    and r5.x, r6.z, cb1[152].x
    or r4.w, r4.w, r5.x
    and r5.x, r6.w, cb1[153].x
    or r4.w, r4.w, r5.x
    if_z r4.w
      iadd r5.x, r4.z, l(1)
      mov r4.z, r5.x
      continue 
    else 
      ieq r5.x, r4.w, l(1)
      if_nz r5.x
        add r5.xyz, -r0.xyzx, cb1[r4.z + 154].xyzx
        dp3 r5.x, r5.xyzx, r5.xyzx
        sqrt r5.x, r5.x
        lt r5.x, r5.x, cb1[r4.z + 162].x
        movc r4.y, r5.x, l(1), r4.y
      else 
        ieq r5.x, r4.w, l(3)
        if_nz r5.x
          ishl r5.x, r4.z, l(2)
          add r5.yzw, cb1[r4.z + 154].xxyz, cb1[r4.z + 170].xxyz
          add r6.xyz, -cb1[r4.z + 154].xyzx, cb1[r4.z + 170].xyzx
          mul r6.xyz, |r6.xyzx|, l(0.500000, 0.500000, 0.500000, 0.000000)
          mad r5.yzw, -r5.yyzw, l(0.000000, 0.500000, 0.500000, 0.500000), r0.xxyz
          dp3 r6.w, r5.yzwy, cb1[r5.x + 186].xyzx
          lt r6.x, r6.x, |r6.w|
          dp3 r6.w, r5.yzwy, cb1[r5.x + 187].xyzx
          lt r6.y, r6.y, |r6.w|
          dp3 r5.x, r5.yzwy, cb1[r5.x + 188].xyzx
          lt r5.x, r6.z, |r5.x|
          or r5.x, r6.y, r5.x
          or r5.x, r6.x, r5.x
          movc r4.y, r5.x, r4.y, l(1)
        else 
          ieq r4.w, r4.w, l(4)
          if_nz r4.w
            add r5.xyz, -cb1[r4.z + 154].xyzx, cb1[r4.z + 170].xyzx
            add r6.xyz, r0.xyzx, -cb1[r4.z + 154].xyzx
            add r7.xyz, r0.xyzx, -cb1[r4.z + 170].xyzx
            dp3 r4.w, r6.xyzx, r5.xyzx
            dp3 r5.w, r6.xyzx, r6.xyzx
            sqrt r6.x, r5.w
            lt r6.y, l(0.000000), r4.w
            dp3 r5.x, r5.xyzx, r5.xyzx
            ge r5.y, r4.w, r5.x
            dp3 r5.z, r7.xyzx, r7.xyzx
            sqrt r5.z, r5.z
            mul r4.w, r4.w, r4.w
            div r4.w, r4.w, r5.x
            add r4.w, -r4.w, r5.w
            sqrt r4.w, r4.w
            movc r4.w, r5.y, r5.z, r4.w
            movc r4.w, r6.y, r4.w, r6.x
            ge r4.w, cb1[r4.z + 162].x, r4.w
            movc r4.y, r4.w, l(1), r4.y
          endif 
        endif 
      endif 
    endif 
    iadd r4.z, r4.z, l(1)
  endloop 
  ilt r3.z, l(0), r4.y
  movc r4.x, r3.z, l(0), r3.y
  round_z r3.y, r3.x
  add r3.y, r0.x, r3.y
  add r3.y, r0.y, r3.y
  add r3.y, r0.z, r3.y
  ilt r3.w, l(0), r4.x
  ilt r4.w, l(0), cb0[7].y
  and r3.w, r3.w, r4.w
  if_nz r3.w
    ftoi r3.x, r3.x
    f32tof16 r5.xyzw, r0.wxyz
    f32tof16 r6.xy, r1.yzyy
    imad r6.x, r6.x, l(0x00010000), r5.x
    imad r3.w, l(6389), r3.x, l(7381)
    and r3.w, r3.w, l(0x000fffff)
    itof r4.w, r3.w
    mul r4.w, r4.w, cb0[19].z
    mad r4.w, r4.w, l(0.000001), cb0[19].y
    add r4.w, r4.w, cb0[19].x
    f32tof16 r4.w, r4.w
    imad r6.z, r4.w, l(0x00010000), r4.w
    iadd r7.xyzw, r3.xxxx, l(100, 1217, 60, 117)
    add r8.xyzw, -cb0[25].xyzw, cb0[26].xyzw
    imad r7.xyzw, l(6389, 6389, 6389, 6389), r7.xyzw, l(7381, 7381, 7381, 7381)
    and r7.xyzw, r7.xyzw, l(0x000fffff, 0x000fffff, 0x000fffff, 0x000fffff)
    udiv null, r7.xyzw, r7.xyzw, l(1000, 1000, 1000, 1000)
    itof r7.xyzw, r7.xyzw
    mul r7.xyzw, r7.xyzw, l(0.001000, 0.001000, 0.001000, 0.001000)
    mad r8.xyzw, r7.xxxx, r8.xyzw, cb0[25].xyzw
    add r8.xyzw, r8.xyzw, cb0[11].xyzw
    add r8.xyz, r2.yzwy, r8.xyzx
    mov r1.x, r0.w
    mul r9.xyz, r1.xyzx, cb0[21].xxxx
    mov r9.w, l(0)
    add r8.xyzw, r8.xyzw, r9.xyzw
    f32tof16 r8.xyzw, r8.xyzw
    imad r8.xy, r8.ywyy, l(0x00010000, 0x00010000, 0, 0), r8.xzxx
    mad r9.xyz, r1.xyzx, l(0.002500, 0.002500, 0.002500, 0.000000), r0.xyzx
    f32tof16 r2.yzw, cb0[12].xxyz
    imad r8.z, r2.z, l(0x00010000), r2.y
    f32tof16 r1.z, cb0[21].z
    imad r8.w, r1.z, l(0x00010000), r2.w
    add r10.xyzw, -cb0[27].xyzw, cb0[28].xyzw
    mad r10.xyzw, r7.yyyy, r10.xyzw, cb0[27].xyzw
    f32tof16 r10.xyzw, r10.xyzw
    imad r10.xy, r10.ywyy, l(0x00010000, 0x00010000, 0, 0), r10.xzxx
    add r11.xyzw, -cb0[29].xyzw, cb0[30].xyzw
    udiv null, r1.z, r3.w, l(1000)
    itof r1.z, r1.z
    mul r1.z, r1.z, l(0.001000)
    mad r11.xyzw, r1.zzzz, r11.xyzw, cb0[29].xyzw
    add r11.xyzw, r11.xyzw, cb0[22].xyzw
    f32tof16 r11.xyzw, r11.xyzw
    imad r11.xy, r11.ywyy, l(0x00010000, 0x00010000, 0, 0), r11.xzxx
    add r12.xyzw, -cb0[31].xyzw, cb0[32].xyzw
    mad r12.xyzw, r1.zzzz, r12.xyzw, cb0[31].xyzw
    add r12.xyzw, r12.xyzw, cb0[23].xyzw
    f32tof16 r12.xyzw, r12.xyzw
    imad r12.xy, r12.ywyy, l(0x00010000, 0x00010000, 0, 0), r12.xzxx
    f32tof16 r13.xyzw, cb0[24].xyzw
    imad r12.zw, r13.yyyw, l(0, 0, 0x00010000, 0x00010000), r13.xxxz
    add r13.xyzw, -cb0[33].xyzw, cb0[34].xyzw
    mad r13.xyzw, r7.yyyy, r13.xyzw, cb0[33].xyzw
    f32tof16 r13.xyzw, r13.xyzw
    imad r10.zw, r13.yyyw, l(0, 0, 0x00010000, 0x00010000), r13.xxxz
    add r13.xyzw, -cb0[35].xyzw, cb0[36].xyzw
    mad r13.xyzw, r7.xxxx, r13.xyzw, cb0[35].xyzw
    add r13.xyzw, r13.xyzw, cb0[13].xyzw
    max r13.xyzw, r13.xyzw, l(0.000000, 0.000000, 0.000000, 0.000000)
    f32tof16 r13.xyzw, r13.xyzw
    imad r11.zw, r13.yyyw, l(0, 0, 0x00010000, 0x00010000), r13.xxxz
    add r13.xyzw, -cb0[37].xyzw, cb0[38].xyzw
    mad r13.xyzw, r7.zzzz, r13.xyzw, cb0[37].xyzw
    add r13.xyzw, r13.xyzw, cb0[14].xyzw
    f32tof16 r13.xyzw, r13.xyzw
    imad r13.xy, r13.ywyy, l(0x00010000, 0x00010000, 0, 0), r13.xzxx
    f32tof16 r14.xyzw, cb0[15].xyzw
    imad r13.zw, r14.yyyw, l(0, 0, 0x00010000, 0x00010000), r14.xxxz
    add r14.xyzw, -cb0[39].xyzw, cb0[40].xyzw
    mad r7.xyzw, r7.wwww, r14.xyzw, cb0[39].xyzw
    f32tof16 r7.xyzw, r7.xyzw
    imad r7.xy, r7.ywyy, l(0x00010000, 0x00010000, 0, 0), r7.xzxx
    f32tof16 r14.xyzw, cb0[16].xyzw
    imad r14.xy, r14.ywyy, l(0x00010000, 0x00010000, 0, 0), r14.xzxx
    iadd r1.z, r3.x, l(4817)
    add r15.xyzw, -cb0[41].xyzw, cb0[42].xyzw
    imad r1.z, l(6389), r1.z, l(7381)
    and r1.z, r1.z, l(0x000fffff)
    udiv null, r1.z, r1.z, l(1000)
    itof r1.z, r1.z
    mul r1.z, r1.z, l(0.001000)
    mad r15.xyzw, r1.zzzz, r15.xyzw, cb0[41].xyzw
    f32tof16 r15.xyzw, r15.xyzw
    imad r7.zw, r15.yyyw, l(0, 0, 0x00010000, 0x00010000), r15.xxxz
    itof r2.yz, cb0[6].xxyx
    div r2.yz, l(1.000000, 1.000000, 1.000000, 1.000000), r2.yyzy
    f32tof16 r2.yz, r2.yyzy
    imad r14.z, r2.z, l(0x00010000), r2.y
    f32tof16 r1.z, cb0[20].x
    ishl r15.w, r1.z, l(16)
    f32tof16 r1.z, cb0[18].x
    imad r16.x, r5.y, l(0x00010000), r1.z
    imad r16.y, r5.w, l(0x00010000), r5.z
    imm_atomic_alloc r5.x, u1
    mov r9.w, l(1.000000)
    store_structured u1.xyzw, r5.x, l(0), r9.xyzw
    mov r6.w, l(0)
    store_structured u1.xyzw, r5.x, l(16), r6.xyzw
    store_structured u1.xyzw, r5.x, l(32), r8.xyzw
    store_structured u1.xyzw, r5.x, l(48), r11.xyzw
    store_structured u1.xyzw, r5.x, l(64), r13.xyzw
    mov r14.w, l(0)
    store_structured u1.xyzw, r5.x, l(80), r14.xyzw
    mov r15.xyz, l(0,0.007827,0,0)
    store_structured u1.xyzw, r5.x, l(96), r15.xyzw
    mov r16.zw, l(0,0,0,0)
    store_structured u1.xyzw, r5.x, l(112), r16.xyzw
    store_structured u1.xyzw, r5.x, l(128), r10.xyzw
    store_structured u1.xyzw, r5.x, l(144), r7.xyzw
    store_structured u1.xyzw, r5.x, l(160), r12.xyzw
    mov r1.y, l(0)
    mov r1.x, cb0[6].z
    store_structured u1.xyzw, r5.x, l(176), r1.yyxw
    mov r0.w, l(0)
    store_structured u1.xyzw, r5.x, l(192), r0.xyzw
    mad r0.x, cb0[0].y, l(31991.000000), r3.y
    ftou r0.x, r0.x
    imad r0.x, l(6389), r0.x, l(7381)
    and r0.x, r0.x, l(0x000fffff)
    udiv null, r0.x, r0.x, l(1000)
    itof r0.x, r0.x
    mul r0.x, r0.x, cb0[9].x
    mul r4.z, r0.x, l(0.001000)
    mov r4.xy, l(0,0,0,0)
  else 
    mad r0.x, cb0[0].y, l(3319.000000), r3.y
    ftou r0.x, r0.x
    imad r0.x, l(6389), r0.x, l(7381)
    and r0.x, r0.x, l(0x000fffff)
    udiv null, r0.x, r0.x, l(1000)
    itof r0.x, r0.x
    mul r0.x, r0.x, cb0[9].x
    mul r0.x, r0.x, l(0.001000)
    movc r4.z, r3.z, r0.x, r2.x
    mov r4.y, r1.w
  endif 
  store_structured u0.xyz, vThreadID.x, l(24), r4.xyzx
endif 
ret 
// Approximately 245 instruction slots used

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