//compass in map screen
// ---- Created with 3Dmigoto v1.2.67 on Thu Nov 30 12:58:03 2017
Texture2D<float4> t15 : register(t15);

cbuffer cb13 : register(b13)
{
  float4 cb13[192];
}

cbuffer cb12 : register(b12)
{
  float4 cb12[2];
}

cbuffer cb10 : register(b10)
{
  float4 cb10[192];
}

cbuffer cb5 : register(b5)
{
  float4 cb5[4];
}

cbuffer cb4 : register(b4)
{
  float4 cb4[15];
}

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

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

cbuffer cb1 : register(b1)
{
  float4 cb1[11];
}

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




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


void main(
  float4 v0 : POSITION0,
  uint4 v1 : NORMAL0,
  int4 v2 : TEXCOORD0,
  int2 v3 : TEXCOORD1,
  uint4 v4 : TANGENT0,
  uint4 v5 : TANGENT1,
  uint4 v6 : BLENDWEIGHT0,
  uint4 v7 : BLENDINDICES0,
  out float4 o0 : SV_Position0,
  out float4 o1 : TEXCOORD6,
  out float4 o2 : TEXCOORD7,
  out float4 o3 : TEXCOORD4,
  out float4 o4 : TEXCOORD5,
  out float4 o5 : COLOR0,
  out float4 o6 : COLOR1,
  out float3 o7 : TEXCOORD10,
  out float p7 : TEXCOORD11,
  out float4 o8 : TEXCOORD0,
  out float4 o9 : TEXCOORD1,
  out float4 o10 : TEXCOORD2,
  out float4 o11 : TEXCOORD3,
  out float3 o12 : TEXCOORD9)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xyz = (uint3)v1.xyz;
  r1.xyz = (uint3)v4.xyz;
  r2.xyz = (uint3)v5.xyz;
  r3.xy = (int2)v2.xy;
  r1.xyz = r1.xyz * float3(0.00784313772,0.00784313772,0.00784313772) + float3(-1,-1,-1);
  r2.xyz = r2.xyz * float3(0.00784313772,0.00784313772,0.00784313772) + float3(-1,-1,-1);
  r0.xyz = r0.xyz * float3(0.00784313772,0.00784313772,0.00784313772) + float3(-1,-1,-1);
  r4.xyzw = (uint4)v6.xyzw;
  r5.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r4.xyzw;
  r6.xy = cb4[13].xy * float2(255,255);
  r6.xy = (int2)r6.xy;
  r0.w = dot(float4(1,1,1,1), r5.xyzw);
  r7.x = 1 + -r0.w;
  r0.w = cmp((int)r6.x >= 0);
  if (r0.w != 0) {
    r8.xyzw = mad((int4)v7.xyzw, int4(3,3,3,3), (int4)r6.yyyy);
    r9.x = (int)r8.x & 255;
    r9.y = (uint)r8.x >> 8;
    r9.zw = float2(0,0);
    r9.xyzw = t15.Load(r9.xyz, int3(0, 0, 0)).xyzw;
    r7.y = 0;
    r9.xyzw = r9.xyzw * r5.xxxx + r7.xyyy;
    r6.xz = (int2)r8.xx + int2(1,2);
    r10.xy = (int2)r6.xz & int2(255,255);
    r11.xy = (uint2)r6.xz >> int2(8,8);
    r10.z = r11.x;
    r10.w = 0;
    r12.xyzw = t15.Load(r10.xzw, int3(0, 0, 0)).xyzw;
    r12.xyzw = r12.xyzw * r5.xxxx + r7.yxyy;
    r11.zw = r10.yw;
    r10.xyzw = t15.Load(r11.zyw, int3(0, 0, 0)).xyzw;
    r10.xyzw = r10.xyzw * r5.xxxx + r7.yyxy;
    r0.w = cmp(0.0254999995 < r4.y);
    if (r0.w != 0) {
      r11.x = (int)r8.y & 255;
      r11.y = (uint)r8.y >> 8;
      r11.zw = float2(0,0);
      r11.xyzw = t15.Load(r11.xyz, int3(0, 0, 0)).xyzw;
      r9.xyzw = r11.xyzw * r5.yyyy + r9.xyzw;
      r4.xy = (int2)r8.yy + int2(1,2);
      r11.xy = (int2)r4.xy & int2(255,255);
      r13.xy = (uint2)r4.xy >> int2(8,8);
      r11.z = r13.x;
      r11.w = 0;
      r14.xyzw = t15.Load(r11.xzw, int3(0, 0, 0)).xyzw;
      r12.xyzw = r14.xyzw * r5.yyyy + r12.xyzw;
      r13.zw = r11.yw;
      r11.xyzw = t15.Load(r13.zyw, int3(0, 0, 0)).xyzw;
      r10.xyzw = r11.xyzw * r5.yyyy + r10.xyzw;
      r0.w = cmp(0.0254999995 < r4.z);
      if (r0.w != 0) {
        r11.x = (int)r8.z & 255;
        r11.y = (uint)r8.z >> 8;
        r11.zw = float2(0,0);
        r11.xyzw = t15.Load(r11.xyz, int3(0, 0, 0)).xyzw;
        r9.xyzw = r11.xyzw * r5.zzzz + r9.xyzw;
        r4.xy = (int2)r8.zz + int2(1,2);
        r11.xy = (int2)r4.xy & int2(255,255);
        r13.xy = (uint2)r4.xy >> int2(8,8);
        r11.z = r13.x;
        r11.w = 0;
        r14.xyzw = t15.Load(r11.xzw, int3(0, 0, 0)).xyzw;
        r12.xyzw = r14.xyzw * r5.zzzz + r12.xyzw;
        r13.zw = r11.yw;
        r11.xyzw = t15.Load(r13.zyw, int3(0, 0, 0)).xyzw;
        r10.xyzw = r11.xyzw * r5.zzzz + r10.xyzw;
        r0.w = cmp(0.0254999995 < r4.w);
        if (r0.w != 0) {
          r4.x = (int)r8.w & 255;
          r4.y = (uint)r8.w >> 8;
          r4.zw = float2(0,0);
          r4.xyzw = t15.Load(r4.xyz, int3(0, 0, 0)).xyzw;
          r9.xyzw = r4.xyzw * r5.wwww + r9.xyzw;
          r4.xy = (int2)r8.ww + int2(1,2);
          r8.xy = (int2)r4.xy & int2(255,255);
          r4.xy = (uint2)r4.xy >> int2(8,8);
          r8.z = r4.x;
          r8.w = 0;
          r11.xyzw = t15.Load(r8.xzw, int3(0, 0, 0)).xyzw;
          r12.xyzw = r11.xyzw * r5.wwww + r12.xyzw;
          r4.zw = r8.yw;
          r4.xyzw = t15.Load(r4.zyw, int3(0, 0, 0)).xyzw;
          r10.xyzw = r4.xyzw * r5.wwww + r10.xyzw;
        }
      }
    }
  } else {
    r4.xyzw = (int4)v7.xyzw + (int4)-r6.yyyy;
    r6.xyzw = (int4)r4.xyzw * int4(3,3,3,3);
    r7.z = 0;
    r8.xyzw = cb10[r6.x+0].xyzw * r5.xxxx + r7.xzzz;
    r11.xyzw = mad((int4)r4.xxyy, int4(3,3,3,3), int4(1,2,1,2));
    r13.xyzw = cb10[r11.x+0].xyzw * r5.xxxx + r7.zxzz;
    r7.xyzw = cb10[r11.y+0].xyzw * r5.xxxx + r7.zzxz;
    r8.xyzw = cb10[r6.y+0].xyzw * r5.yyyy + r8.xyzw;
    r13.xyzw = cb10[r11.z+0].xyzw * r5.yyyy + r13.xyzw;
    r7.xyzw = cb10[r11.w+0].xyzw * r5.yyyy + r7.xyzw;
    r8.xyzw = cb10[r6.z+0].xyzw * r5.zzzz + r8.xyzw;
    r4.xyzw = mad((int4)r4.zzww, int4(3,3,3,3), int4(1,2,1,2));
    r11.xyzw = cb10[r4.x+0].xyzw * r5.zzzz + r13.xyzw;
    r7.xyzw = cb10[r4.y+0].xyzw * r5.zzzz + r7.xyzw;
    r9.xyzw = cb10[r6.w+0].xyzw * r5.wwww + r8.xyzw;
    r12.xyzw = cb10[r4.z+0].xyzw * r5.wwww + r11.xyzw;
    r10.xyzw = cb10[r4.w+0].xyzw * r5.wwww + r7.xyzw;
  }
  r4.x = dot(r9.xyzw, v0.xyzw);
  r4.y = dot(r12.xyzw, v0.xyzw);
  r4.z = dot(r10.xyzw, v0.xyzw);
  r5.x = dot(r9.xyz, r0.xyz);
  r5.y = dot(r12.xyz, r0.xyz);
  r5.z = dot(r10.xyz, r0.xyz);
  r0.x = dot(r5.xyz, r5.xyz);
  r0.x = rsqrt(r0.x);
  r0.xyz = r5.xyz * r0.xxx;
  r4.w = 1;
  r5.x = dot(r4.xyzw, cb4[4].xyzw);
  r5.y = dot(r4.xyzw, cb4[5].xyzw);
  r5.z = dot(r4.xyzw, cb4[6].xyzw);
  r6.xyzw = cb2[1].xyzw * r5.yyyy;
  r6.xyzw = cb2[0].xyzw * r5.xxxx + r6.xyzw;
  r6.xyzw = cb2[2].xyzw * r5.zzzz + r6.xyzw;
  r6.xyzw = cb2[3].xyzw + r6.xyzw;
  r7.x = dot(r4.xyzw, cb4[0].xyzw);
  r7.y = dot(r4.xyzw, cb4[1].xyzw);
  r7.z = dot(r4.xyzw, cb4[2].xyzw);
  r1.w = cb1[7].y + -r7.y;
  r1.w = saturate(0.5 + -r1.w);
  r1.w = r1.w * 0.899999976 + 0.100000001;
  r0.w = cb1[7].x * r1.w;
  r8.w = cb5[3].y * cb1[4].w;
  r11.x = dot(-r1.xyz, r9.xyz);
  r11.y = dot(-r1.xyz, r12.xyz);
  r11.z = dot(-r1.xyz, r10.xyz);
  r1.x = dot(r11.xyz, r11.xyz);
  r1.x = rsqrt(r1.x);
  r1.xyz = r11.xyz * r1.xxx;
  r9.x = dot(-r2.xyz, r9.xyz);
  r9.y = dot(-r2.xyz, r12.xyz);
  r9.z = dot(-r2.xyz, r10.xyz);
  r1.w = dot(r9.xyz, r9.xyz);
  r1.w = rsqrt(r1.w);
  r2.xyz = r9.xyz * r1.www;
  o5.w = dot(r4.xyzw, cb1[8].xyzw);
  r9.w = dot(r4.xyzw, cb1[9].xyzw);
  o3.w = dot(r4.xyzw, cb1[10].xyzw);
  o5.x = dot(r1.xyz, cb1[8].xyz);
  r9.x = dot(r1.xyz, cb1[9].xyz);
  o3.x = dot(r1.xyz, cb1[10].xyz);
  o5.y = dot(r2.xyz, cb1[8].xyz);
  r9.y = dot(r2.xyz, cb1[9].xyz);
  o3.y = dot(r2.xyz, cb1[10].xyz);
  o5.z = dot(r0.xyz, cb1[8].xyz);
  r9.z = dot(r0.xyz, cb1[9].xyz);
  o3.z = dot(r0.xyz, cb1[10].xyz);
  switch (cb1[3].x) {
    case 3 :    r3.w = dot(r5.xyz, r5.xyz);
    r3.w = sqrt(r3.w);
    r3.w = cb1[5].z + -r3.w;
    r3.w = r8.w * r3.w;
    r8.w = saturate(cb1[5].w * r3.w);
    r8.xyz = float3(0,0,0);
    r1.xyzw = r0.xyzw;
    r2.xyzw = r7.xyzy;
    break;
    case 4 :    r3.w = dot(r5.xyz, r5.xyz);
    r3.w = sqrt(r3.w);
    r4.w = -cb4[14].y + r7.y;
    r3.w = 9.99999975e-006 + r3.w;
    r7.w = abs(r4.w) / r3.w;
    r7.w = cb1[5].x * r7.w;
    r10.x = cmp(r7.w == 0.000000);
    r10.y = -28853.9004 * r7.w;
    r10.y = exp2(r10.y);
    r10.y = 1 + -r10.y;
    r7.w = r10.y / r7.w;
    r7.w = r10.x ? 20000 : r7.w;
    r10.x = min(cb4[14].y, r7.y);
    r10.x = -cb1[5].x * r10.x;
    r10.x = 1.44269502 * r10.x;
    r10.x = exp2(r10.x);
    r10.x = -cb1[5].y * r10.x;
    r7.w = r10.x * r7.w;
    r7.w = 1.44269502 * r7.w;
    r7.w = exp2(r7.w);
    r7.w = min(1, r7.w);
    r3.w = r4.w / r3.w;
    r3.w = cb0[8].z * r3.w;
    r4.w = cmp(r3.w == 0.000000);
    r10.x = -28853.9004 * r3.w;
    r10.x = exp2(r10.x);
    r10.x = 1 + -r10.x;
    r3.w = r10.x / r3.w;
    r3.w = r4.w ? 20000 : r3.w;
    r4.w = cb4[14].y + -cb0[8].x;
    r4.w = -cb0[8].z * r4.w;
    r4.w = 1.44269502 * r4.w;
    r4.w = exp2(r4.w);
    r4.w = -cb0[8].y * r4.w;
    r3.w = r4.w * r3.w;
    r3.w = 1.44269502 * r3.w;
    r3.w = exp2(r3.w);
    r3.w = min(1, r3.w);
    r3.w = r7.w * r3.w;
    r8.w = saturate(r8.w * r3.w);
    r8.xyz = float3(0,0,0);
    r1.xyzw = r0.xyzw;
    r2.xyzw = r7.xyzy;
    break;
    default :
    r8.xyz = float3(0,0,0);
    r1.xyzw = r0.xyzw;
    r2.xyzw = r7.xyzy;
    break;
  }
  o1.xyzw = r8.xyzw;
  o2.xyzw = r1.xyzw;
  o6.xyzw = r2.xyzw;
  r1.xy = cmp(float2(0,0) != cb2[6].xw);
  r5.w = 1;
  r2.x = dot(r5.xyzw, cb1[0].xyzw);
  r2.y = dot(r5.xyzw, cb1[1].xyzw);
  r2.z = dot(r5.xyzw, cb1[2].xyzw);
  r2.w = r5.z;
  r2.xyzw = r1.yyyy ? r6.xyzw : r2.xyzw;
  o4.xyzw = r1.xxxx ? r2.xyzw : 0;
  r1.x = dot(r0.xyz, cb4[4].xyz);
  r1.y = dot(r0.xyz, cb4[5].xyz);
  r1.z = dot(r0.xyz, cb4[6].xyz);
  r0.x = 1;
  r2.xyz = float3(0,0,0);
  r0.w = 0;
  while (true) {
    r1.w = cmp((int)r0.w >= asint(cb12[0].x));
    if (r1.w != 0) break;
    r1.w = (int)r0.w * 6;
    r7.xyz = cb13[r1.w+0].xyz + -r5.xyz;
    r1.w = dot(r7.xyz, r7.xyz);
    r1.w = sqrt(r1.w);
    r2.w = 9.99999975e-005 + r1.w;
    r7.xyz = r7.xyz / r2.www;
    r8.xyzw = mad((int4)r0.wwww, int4(6,6,6,6), int4(4,5,2,3));
    r2.w = -cb13[r8.x+0].x + r1.w;
    r0.y = max(0, r2.w);
    r0.z = r0.y * r0.y;
    r0.y = dot(cb13[r8.x+0].yzw, r0.xyz);
    r0.y = 9.99999975e-005 + r0.y;
    r0.y = 1 / r0.y;
    r0.y = saturate(r0.y);
    r0.z = -cb13[r8.y+0].x + r1.w;
    r0.z = saturate(cb13[r8.y+0].y * r0.z);
    r0.z = 1 + -r0.z;
    r0.y = r0.y * r0.z;
    r0.z = dot(r1.xyz, r7.xyz);
    r0.z = max(0, r0.z);
    r7.xyz = r0.zzz * cb13[r8.z+0].xyz + cb13[r8.w+0].xyz;
    r2.xyz = r7.xyz * r0.yyy + r2.xyz;
    r0.w = (int)r0.w + 1;
  }
  r0.x = asint(cb12[0].x) + asint(cb12[1].x);
  r7.x = 1;
  r8.xyz = r2.xyz;
  r0.y = r0.w;
  while (true) {
    r0.z = cmp((int)r0.y >= (int)r0.x);
    if (r0.z != 0) break;
    r0.z = (int)r0.y * 6;
    r10.xyz = cb13[r0.z+0].xyz + -r5.xyz;
    r0.z = dot(r10.xyz, r10.xyz);
    r0.z = sqrt(r0.z);
    r1.w = 9.99999975e-005 + r0.z;
    r10.xyz = r10.xyz / r1.www;
    r11.xyzw = mad((int4)r0.yyyy, int4(6,6,6,6), int4(4,5,2,3));
    r1.w = -cb13[r11.x+0].x + r0.z;
    r7.y = max(0, r1.w);
    r7.z = r7.y * r7.y;
    r1.w = dot(cb13[r11.x+0].yzw, r7.xyz);
    r1.w = 9.99999975e-005 + r1.w;
    r1.w = 1 / r1.w;
    r1.w = saturate(r1.w);
    r0.z = -cb13[r11.y+0].x + r0.z;
    r0.z = saturate(cb13[r11.y+0].y * r0.z);
    r0.z = 1 + -r0.z;
    r0.z = r1.w * r0.z;
    r1.w = mad((int)r0.y, 6, 1);
    r2.w = dot(-cb13[r1.w+0].xyz, r10.xyz);
    r1.w = -cb13[r1.w+0].w + r2.w;
    r1.w = saturate(cb13[r11.z+0].w * r1.w);
    r1.w = log2(r1.w);
    r1.w = cb13[r11.w+0].w * r1.w;
    r1.w = exp2(r1.w);
    r0.z = r1.w * r0.z;
    r1.w = dot(r1.xyz, r10.xyz);
    r1.w = max(0, r1.w);
    r7.yzw = r1.www * cb13[r11.z+0].xyz + cb13[r11.w+0].xyz;
    r8.xyz = r7.yzw * r0.zzz + r8.xyz;
    r0.y = (int)r0.y + 1;
  }
  o7.xyz = r8.xyz;
  r0.xyzw = cmp(cb4[11].xyzw < float4(0.5,0.5,0.5,0.5));
  r3.z = 1;
  r1.x = dot(r3.xyz, cb3[0].xyw);
  r1.z = dot(r3.xyz, cb3[1].xyw);
  r1.yw = r0.xx ? r1.xz : 0;
  r2.xy = r0.xx ? r1.yw : r1.xz;
  r0.x = dot(r3.xyz, cb3[2].xyw);
  r1.x = r0.y ? r0.x : 0;
  r1.y = dot(r3.xyz, cb3[3].xyw);
  r1.z = r0.y ? r1.y : 0;
  r2.w = r0.y ? r1.x : r0.x;
  r2.z = r0.y ? r1.z : r1.y;
  r0.x = dot(r3.xyz, cb3[4].xyw);
  r0.y = r0.z ? r0.x : 0;
  r1.x = dot(r3.xyz, cb3[5].xyw);
  r1.y = r0.z ? r1.x : 0;
  r5.x = r0.z ? r0.y : r0.x;
  r5.y = r0.z ? r1.y : r1.x;
  r0.x = dot(r3.xyz, cb3[6].xyw);
  r0.y = r0.w ? r0.x : 0;
  r0.z = dot(r3.xyz, cb3[7].xyw);
  r1.x = r0.w ? r0.z : 0;
  r5.w = r0.w ? r0.y : r0.x;
  r5.z = r0.w ? r1.x : r0.z;
  r0.xy = cmp(cb4[12].xy < float2(0.5,0.5));
  r0.z = dot(r3.xyz, cb3[8].xyw);
  r0.w = r0.x ? r0.z : 0;
  r1.x = dot(r3.xyz, cb3[9].xyw);
  r1.y = r0.x ? r1.x : 0;
  r7.x = r0.x ? r0.w : r0.z;
  r7.y = r0.x ? r1.y : r1.x;
  r0.x = dot(r3.xyz, cb3[10].xyw);
  r0.z = r0.y ? r0.x : 0;
  r0.w = dot(r3.xyz, cb3[11].xyw);
  r1.x = r0.y ? r0.w : 0;
  r7.w = r0.y ? r0.z : r0.x;
  r7.z = r0.y ? r1.x : r0.w;
  o8.xyzw = r2.xyzw;
  o9.xyzw = r5.xyzw;
  o10.xyzw = r7.xyzw;
  o11.xyzw = r9.xyzw;
  o0.xyzw = r6.xyzw;
  o12.xyz = r4.xyz;
  p7.x = cb1[7].z;

float4 params = IniParams.Load(0);
float4 stereo = StereoParams.Load(0);
float4 compass = IniParams.Load(int2(2, 0));

if(compass.x == 1){ 

if(o0.z > 0.289 && o0.z < 0.302)
{
o0.x -= stereo.x * (o0.w - stereo.y);
o0.x += stereo.x * params.z * 0.4;
}
}

  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.2.67 on Thu Nov 30 12:58:03 2017
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyzw        1     NONE    uint   xyz 
// TEXCOORD                 0   xy          2     NONE     int   xy  
// TEXCOORD                 1   xy          3     NONE     int       
// TANGENT                  0   xyzw        4     NONE    uint   xyz 
// TANGENT                  1   xyzw        5     NONE    uint   xyz 
// BLENDWEIGHT              0   xyzw        6     NONE    uint   xyzw
// BLENDINDICES             0   xyzw        7     NONE    uint   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 6   xyzw        1     NONE   float   xyzw
// TEXCOORD                 7   xyzw        2     NONE   float   xyzw
// TEXCOORD                 4   xyzw        3     NONE   float   xyzw
// TEXCOORD                 5   xyzw        4     NONE   float   xyzw
// COLOR                    0   xyzw        5     NONE   float   xyzw
// COLOR                    1   xyzw        6     NONE   float   xyzw
// TEXCOORD                10   xyz         7     NONE   float   xyz 
// TEXCOORD                11      w        7     NONE   float      w
// TEXCOORD                 0   xyzw        8     NONE   float   xyzw
// TEXCOORD                 1   xyzw        9     NONE   float   xyzw
// TEXCOORD                 2   xyzw       10     NONE   float   xyzw
// TEXCOORD                 3   xyzw       11     NONE   float   xyzw
// TEXCOORD                 9   xyz        12     NONE   float   xyz 
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[9], immediateIndexed
dcl_constantbuffer cb1[11], immediateIndexed
dcl_constantbuffer cb2[7], immediateIndexed
dcl_constantbuffer cb3[12], immediateIndexed
dcl_constantbuffer cb4[15], immediateIndexed
dcl_constantbuffer cb5[4], immediateIndexed
dcl_constantbuffer cb10[192], dynamicIndexed
dcl_constantbuffer cb12[2], immediateIndexed
dcl_constantbuffer cb13[192], dynamicIndexed
dcl_resource_texture2d (float,float,float,float) t15
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xy
dcl_input v4.xyz
dcl_input v5.xyz
dcl_input v6.xyzw
dcl_input v7.xyzw
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.xyz
dcl_output o7.w
dcl_output o8.xyzw
dcl_output o9.xyzw
dcl_output o10.xyzw
dcl_output o11.xyzw
dcl_output o12.xyz
dcl_temps 15
utof r0.xyz, v1.xyzx
utof r1.xyz, v4.xyzx
utof r2.xyz, v5.xyzx
itof r3.xy, v2.xyxx
mad r1.xyz, r1.xyzx, l(0.00784313772, 0.00784313772, 0.00784313772, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r2.xyz, r2.xyzx, l(0.00784313772, 0.00784313772, 0.00784313772, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r0.xyz, r0.xyzx, l(0.00784313772, 0.00784313772, 0.00784313772, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
utof r4.xyzw, v6.xyzw
mul r5.xyzw, r4.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886)
mul r6.xy, l(255.000000, 255.000000, 0.000000, 0.000000), cb4[13].xyxx
ftoi r6.xy, r6.xyxx
dp4 r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r5.xyzw
add r7.x, -r0.w, l(1.000000)
ige r0.w, r6.x, l(0)
if_nz r0.w
  imad r8.xyzw, v7.xyzw, l(3, 3, 3, 3), r6.yyyy
  and r9.x, r8.x, l(255)
  ushr r9.y, r8.x, l(8)
  mov r9.zw, l(0,0,0,0)
  ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r9.xyzw, r9.xyzw, t15.xyzw
  mov r7.y, l(0)
  mad r9.xyzw, r9.xyzw, r5.xxxx, r7.xyyy
  iadd r6.xz, r8.xxxx, l(1, 0, 2, 0)
  and r10.xy, r6.xzxx, l(255, 255, 0, 0)
  ushr r11.xy, r6.xzxx, l(8, 8, 0, 0)
  mov r10.z, r11.x
  mov r10.w, l(0)
  ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r12.xyzw, r10.xzww, t15.xyzw
  mad r12.xyzw, r12.xyzw, r5.xxxx, r7.yxyy
  mov r11.zw, r10.yyyw
  ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r10.xyzw, r11.zyww, t15.xyzw
  mad r10.xyzw, r10.xyzw, r5.xxxx, r7.yyxy
  lt r0.w, l(0.025500), r4.y
  if_nz r0.w
    and r11.x, r8.y, l(255)
    ushr r11.y, r8.y, l(8)
    mov r11.zw, l(0,0,0,0)
    ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r11.xyzw, r11.xyzw, t15.xyzw
    mad r9.xyzw, r11.xyzw, r5.yyyy, r9.xyzw
    iadd r4.xy, r8.yyyy, l(1, 2, 0, 0)
    and r11.xy, r4.xyxx, l(255, 255, 0, 0)
    ushr r13.xy, r4.xyxx, l(8, 8, 0, 0)
    mov r11.z, r13.x
    mov r11.w, l(0)
    ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r14.xyzw, r11.xzww, t15.xyzw
    mad r12.xyzw, r14.xyzw, r5.yyyy, r12.xyzw
    mov r13.zw, r11.yyyw
    ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r11.xyzw, r13.zyww, t15.xyzw
    mad r10.xyzw, r11.xyzw, r5.yyyy, r10.xyzw
    lt r0.w, l(0.025500), r4.z
    if_nz r0.w
      and r11.x, r8.z, l(255)
      ushr r11.y, r8.z, l(8)
      mov r11.zw, l(0,0,0,0)
      ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r11.xyzw, r11.xyzw, t15.xyzw
      mad r9.xyzw, r11.xyzw, r5.zzzz, r9.xyzw
      iadd r4.xy, r8.zzzz, l(1, 2, 0, 0)
      and r11.xy, r4.xyxx, l(255, 255, 0, 0)
      ushr r13.xy, r4.xyxx, l(8, 8, 0, 0)
      mov r11.z, r13.x
      mov r11.w, l(0)
      ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r14.xyzw, r11.xzww, t15.xyzw
      mad r12.xyzw, r14.xyzw, r5.zzzz, r12.xyzw
      mov r13.zw, r11.yyyw
      ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r11.xyzw, r13.zyww, t15.xyzw
      mad r10.xyzw, r11.xyzw, r5.zzzz, r10.xyzw
      lt r0.w, l(0.025500), r4.w
      if_nz r0.w
        and r4.x, r8.w, l(255)
        ushr r4.y, r8.w, l(8)
        mov r4.zw, l(0,0,0,0)
        ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r4.xyzw, r4.xyzw, t15.xyzw
        mad r9.xyzw, r4.xyzw, r5.wwww, r9.xyzw
        iadd r4.xy, r8.wwww, l(1, 2, 0, 0)
        and r8.xy, r4.xyxx, l(255, 255, 0, 0)
        ushr r4.xy, r4.xyxx, l(8, 8, 0, 0)
        mov r8.z, r4.x
        mov r8.w, l(0)
        ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r11.xyzw, r8.xzww, t15.xyzw
        mad r12.xyzw, r11.xyzw, r5.wwww, r12.xyzw
        mov r4.zw, r8.yyyw
        ld_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r4.xyzw, r4.zyww, t15.xyzw
        mad r10.xyzw, r4.xyzw, r5.wwww, r10.xyzw
      endif 
    endif 
  endif 
else 
  iadd r4.xyzw, v7.xyzw, -r6.yyyy
  imul null, r6.xyzw, r4.xyzw, l(3, 3, 3, 3)
  mov r7.z, l(0)
  mad r8.xyzw, cb10[r6.x + 0].xyzw, r5.xxxx, r7.xzzz
  imad r11.xyzw, r4.xxyy, l(3, 3, 3, 3), l(1, 2, 1, 2)
  mad r13.xyzw, cb10[r11.x + 0].xyzw, r5.xxxx, r7.zxzz
  mad r7.xyzw, cb10[r11.y + 0].xyzw, r5.xxxx, r7.zzxz
  mad r8.xyzw, cb10[r6.y + 0].xyzw, r5.yyyy, r8.xyzw
  mad r13.xyzw, cb10[r11.z + 0].xyzw, r5.yyyy, r13.xyzw
  mad r7.xyzw, cb10[r11.w + 0].xyzw, r5.yyyy, r7.xyzw
  mad r8.xyzw, cb10[r6.z + 0].xyzw, r5.zzzz, r8.xyzw
  imad r4.xyzw, r4.zzww, l(3, 3, 3, 3), l(1, 2, 1, 2)
  mad r11.xyzw, cb10[r4.x + 0].xyzw, r5.zzzz, r13.xyzw
  mad r7.xyzw, cb10[r4.y + 0].xyzw, r5.zzzz, r7.xyzw
  mad r9.xyzw, cb10[r6.w + 0].xyzw, r5.wwww, r8.xyzw
  mad r12.xyzw, cb10[r4.z + 0].xyzw, r5.wwww, r11.xyzw
  mad r10.xyzw, cb10[r4.w + 0].xyzw, r5.wwww, r7.xyzw
endif 
dp4 r4.x, r9.xyzw, v0.xyzw
dp4 r4.y, r12.xyzw, v0.xyzw
dp4 r4.z, r10.xyzw, v0.xyzw
dp3 r5.x, r9.xyzx, r0.xyzx
dp3 r5.y, r12.xyzx, r0.xyzx
dp3 r5.z, r10.xyzx, r0.xyzx
dp3 r0.x, r5.xyzx, r5.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, r5.xyzx
mov r4.w, l(1.000000)
dp4 r5.x, r4.xyzw, cb4[4].xyzw
dp4 r5.y, r4.xyzw, cb4[5].xyzw
dp4 r5.z, r4.xyzw, cb4[6].xyzw
mul r6.xyzw, r5.yyyy, cb2[1].xyzw
mad r6.xyzw, cb2[0].xyzw, r5.xxxx, r6.xyzw
mad r6.xyzw, cb2[2].xyzw, r5.zzzz, r6.xyzw
add r6.xyzw, r6.xyzw, cb2[3].xyzw
dp4 r7.x, r4.xyzw, cb4[0].xyzw
dp4 r7.y, r4.xyzw, cb4[1].xyzw
dp4 r7.z, r4.xyzw, cb4[2].xyzw
add r1.w, -r7.y, cb1[7].y
add_sat r1.w, -r1.w, l(0.500000)
mad r1.w, r1.w, l(0.900000), l(0.100000)
mul r0.w, r1.w, cb1[7].x
mul r8.w, cb1[4].w, cb5[3].y
dp3 r11.x, -r1.xyzx, r9.xyzx
dp3 r11.y, -r1.xyzx, r12.xyzx
dp3 r11.z, -r1.xyzx, r10.xyzx
dp3 r1.x, r11.xyzx, r11.xyzx
rsq r1.x, r1.x
mul r1.xyz, r1.xxxx, r11.xyzx
dp3 r9.x, -r2.xyzx, r9.xyzx
dp3 r9.y, -r2.xyzx, r12.xyzx
dp3 r9.z, -r2.xyzx, r10.xyzx
dp3 r1.w, r9.xyzx, r9.xyzx
rsq r1.w, r1.w
mul r2.xyz, r1.wwww, r9.xyzx
dp4 o5.w, r4.xyzw, cb1[8].xyzw
dp4 r9.w, r4.xyzw, cb1[9].xyzw
dp4 o3.w, r4.xyzw, cb1[10].xyzw
dp3 o5.x, r1.xyzx, cb1[8].xyzx
dp3 r9.x, r1.xyzx, cb1[9].xyzx
dp3 o3.x, r1.xyzx, cb1[10].xyzx
dp3 o5.y, r2.xyzx, cb1[8].xyzx
dp3 r9.y, r2.xyzx, cb1[9].xyzx
dp3 o3.y, r2.xyzx, cb1[10].xyzx
dp3 o5.z, r0.xyzx, cb1[8].xyzx
dp3 r9.z, r0.xyzx, cb1[9].xyzx
dp3 o3.z, r0.xyzx, cb1[10].xyzx
switch cb1[3].x
  case l(3)
  dp3 r3.w, r5.xyzx, r5.xyzx
  sqrt r3.w, r3.w
  add r3.w, -r3.w, cb1[5].z
  mul r3.w, r3.w, r8.w
  mul_sat r8.w, r3.w, cb1[5].w
  mov r8.xyz, l(0,0,0,0)
  mov r1.xyzw, r0.xyzw
  mov r2.xyzw, r7.xyzy
  break 
  case l(4)
  dp3 r3.w, r5.xyzx, r5.xyzx
  sqrt r3.w, r3.w
  add r4.w, r7.y, -cb4[14].y
  add r3.w, r3.w, l(0.000010)
  div r7.w, |r4.w|, r3.w
  mul r7.w, r7.w, cb1[5].x
  eq r10.x, r7.w, l(0.000000)
  mul r10.y, r7.w, l(-28853.900391)
  exp r10.y, r10.y
  add r10.y, -r10.y, l(1.000000)
  div r7.w, r10.y, r7.w
  movc r7.w, r10.x, l(20000.000000), r7.w
  min r10.x, r7.y, cb4[14].y
  mul r10.x, r10.x, -cb1[5].x
  mul r10.x, r10.x, l(1.442695)
  exp r10.x, r10.x
  mul r10.x, r10.x, -cb1[5].y
  mul r7.w, r7.w, r10.x
  mul r7.w, r7.w, l(1.442695)
  exp r7.w, r7.w
  min r7.w, r7.w, l(1.000000)
  div r3.w, r4.w, r3.w
  mul r3.w, r3.w, cb0[8].z
  eq r4.w, r3.w, l(0.000000)
  mul r10.x, r3.w, l(-28853.900391)
  exp r10.x, r10.x
  add r10.x, -r10.x, l(1.000000)
  div r3.w, r10.x, r3.w
  movc r3.w, r4.w, l(20000.000000), r3.w
  add r4.w, -cb0[8].x, cb4[14].y
  mul r4.w, r4.w, -cb0[8].z
  mul r4.w, r4.w, l(1.442695)
  exp r4.w, r4.w
  mul r4.w, r4.w, -cb0[8].y
  mul r3.w, r3.w, r4.w
  mul r3.w, r3.w, l(1.442695)
  exp r3.w, r3.w
  min r3.w, r3.w, l(1.000000)
  mul r3.w, r3.w, r7.w
  mul_sat r8.w, r3.w, r8.w
  mov r8.xyz, l(0,0,0,0)
  mov r1.xyzw, r0.xyzw
  mov r2.xyzw, r7.xyzy
  break 
  default 
  mov r8.xyz, l(0,0,0,0)
  mov r1.xyzw, r0.xyzw
  mov r2.xyzw, r7.xyzy
  break 
endswitch 
mov o1.xyzw, r8.xyzw
mov o2.xyzw, r1.xyzw
mov o6.xyzw, r2.xyzw
ne r1.xy, l(0.000000, 0.000000, 0.000000, 0.000000), cb2[6].xwxx
mov r5.w, l(1.000000)
dp4 r2.x, r5.xyzw, cb1[0].xyzw
dp4 r2.y, r5.xyzw, cb1[1].xyzw
dp4 r2.z, r5.xyzw, cb1[2].xyzw
mov r2.w, r5.z
movc r2.xyzw, r1.yyyy, r6.xyzw, r2.xyzw
and o4.xyzw, r1.xxxx, r2.xyzw
dp3 r1.x, r0.xyzx, cb4[4].xyzx
dp3 r1.y, r0.xyzx, cb4[5].xyzx
dp3 r1.z, r0.xyzx, cb4[6].xyzx
mov r0.x, l(1.000000)
mov r2.xyz, l(0,0,0,0)
mov r0.w, l(0)
loop 
  ige r1.w, r0.w, cb12[0].x
  breakc_nz r1.w
  imul null, r1.w, r0.w, l(6)
  add r7.xyz, -r5.xyzx, cb13[r1.w + 0].xyzx
  dp3 r1.w, r7.xyzx, r7.xyzx
  sqrt r1.w, r1.w
  add r2.w, r1.w, l(0.000100)
  div r7.xyz, r7.xyzx, r2.wwww
  imad r8.xyzw, r0.wwww, l(6, 6, 6, 6), l(4, 5, 2, 3)
  add r2.w, r1.w, -cb13[r8.x + 0].x
  max r0.y, r2.w, l(0.000000)
  mul r0.z, r0.y, r0.y
  dp3 r0.y, cb13[r8.x + 0].yzwy, r0.xyzx
  add r0.y, r0.y, l(0.000100)
  div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
  mov_sat r0.y, r0.y
  add r0.z, r1.w, -cb13[r8.y + 0].x
  mul_sat r0.z, r0.z, cb13[r8.y + 0].y
  add r0.z, -r0.z, l(1.000000)
  mul r0.y, r0.z, r0.y
  dp3 r0.z, r1.xyzx, r7.xyzx
  max r0.z, r0.z, l(0.000000)
  mad r7.xyz, r0.zzzz, cb13[r8.z + 0].xyzx, cb13[r8.w + 0].xyzx
  mad r2.xyz, r7.xyzx, r0.yyyy, r2.xyzx
  iadd r0.w, r0.w, l(1)
endloop 
iadd r0.x, cb12[0].x, cb12[1].x
mov r7.x, l(1.000000)
mov r8.xyz, r2.xyzx
mov r0.y, r0.w
loop 
  ige r0.z, r0.y, r0.x
  breakc_nz r0.z
  imul null, r0.z, r0.y, l(6)
  add r10.xyz, -r5.xyzx, cb13[r0.z + 0].xyzx
  dp3 r0.z, r10.xyzx, r10.xyzx
  sqrt r0.z, r0.z
  add r1.w, r0.z, l(0.000100)
  div r10.xyz, r10.xyzx, r1.wwww
  imad r11.xyzw, r0.yyyy, l(6, 6, 6, 6), l(4, 5, 2, 3)
  add r1.w, r0.z, -cb13[r11.x + 0].x
  max r7.y, r1.w, l(0.000000)
  mul r7.z, r7.y, r7.y
  dp3 r1.w, cb13[r11.x + 0].yzwy, r7.xyzx
  add r1.w, r1.w, l(0.000100)
  div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.w
  mov_sat r1.w, r1.w
  add r0.z, r0.z, -cb13[r11.y + 0].x
  mul_sat r0.z, r0.z, cb13[r11.y + 0].y
  add r0.z, -r0.z, l(1.000000)
  mul r0.z, r0.z, r1.w
  imad r1.w, r0.y, l(6), l(1)
  dp3 r2.w, -cb13[r1.w + 0].xyzx, r10.xyzx
  add r1.w, r2.w, -cb13[r1.w + 0].w
  mul_sat r1.w, r1.w, cb13[r11.z + 0].w
  log r1.w, r1.w
  mul r1.w, r1.w, cb13[r11.w + 0].w
  exp r1.w, r1.w
  mul r0.z, r0.z, r1.w
  dp3 r1.w, r1.xyzx, r10.xyzx
  max r1.w, r1.w, l(0.000000)
  mad r7.yzw, r1.wwww, cb13[r11.z + 0].xxyz, cb13[r11.w + 0].xxyz
  mad r8.xyz, r7.yzwy, r0.zzzz, r8.xyzx
  iadd r0.y, r0.y, l(1)
endloop 
mov o7.xyz, r8.xyzx
lt r0.xyzw, cb4[11].xyzw, l(0.500000, 0.500000, 0.500000, 0.500000)
mov r3.z, l(1.000000)
dp3 r1.x, r3.xyzx, cb3[0].xywx
dp3 r1.z, r3.xyzx, cb3[1].xywx
and r1.yw, r0.xxxx, r1.xxxz
movc r2.xy, r0.xxxx, r1.ywyy, r1.xzxx
dp3 r0.x, r3.xyzx, cb3[2].xywx
and r1.x, r0.x, r0.y
dp3 r1.y, r3.xyzx, cb3[3].xywx
and r1.z, r0.y, r1.y
movc r2.w, r0.y, r1.x, r0.x
movc r2.z, r0.y, r1.z, r1.y
dp3 r0.x, r3.xyzx, cb3[4].xywx
and r0.y, r0.x, r0.z
dp3 r1.x, r3.xyzx, cb3[5].xywx
and r1.y, r0.z, r1.x
movc r5.x, r0.z, r0.y, r0.x
movc r5.y, r0.z, r1.y, r1.x
dp3 r0.x, r3.xyzx, cb3[6].xywx
and r0.y, r0.x, r0.w
dp3 r0.z, r3.xyzx, cb3[7].xywx
and r1.x, r0.z, r0.w
movc r5.w, r0.w, r0.y, r0.x
movc r5.z, r0.w, r1.x, r0.z
lt r0.xy, cb4[12].xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
dp3 r0.z, r3.xyzx, cb3[8].xywx
and r0.w, r0.z, r0.x
dp3 r1.x, r3.xyzx, cb3[9].xywx
and r1.y, r0.x, r1.x
movc r7.x, r0.x, r0.w, r0.z
movc r7.y, r0.x, r1.y, r1.x
dp3 r0.x, r3.xyzx, cb3[10].xywx
and r0.z, r0.x, r0.y
dp3 r0.w, r3.xyzx, cb3[11].xywx
and r1.x, r0.w, r0.y
movc r7.w, r0.y, r0.z, r0.x
movc r7.z, r0.y, r1.x, r0.w
mov o8.xyzw, r2.xyzw
mov o9.xyzw, r5.xyzw
mov o10.xyzw, r7.xyzw
mov o11.xyzw, r9.xyzw
mov o0.xyzw, r6.xyzw
mov o12.xyz, r4.xyzx
mov o7.w, cb1[7].z
ret 
// Approximately 0 instruction slots used

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