//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.67 on Mon Jan 01 13:11:46 2018
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float4 g_avPSDD[64];               // Offset:    0 Size:  1024
//   float4 g_vWaveDesc;                // Offset: 1024 Size:    16
//      = 0x3ca3d70a 0x3f000000 0x3f800000 0x42000000 
//   float4 specColor;                  // Offset: 1040 Size:    16 [unused]
//   float4 ControlData;                // Offset: 1056 Size:    16 [unused]
//   float4 difColor;                   // Offset: 1072 Size:    16 [unused]
//   float4 ambient;                    // Offset: 1088 Size:    16 [unused]
//   float4 g_vDefLightDir;             // Offset: 1104 Size:    16 [unused]
//   float4 g_vDefLightColor;           // Offset: 1120 Size:    16 [unused]
//   float4 g_vDefSpecColor;            // Offset: 1136 Size:    16 [unused]
//   uint CS_FRONT;                     // Offset: 1152 Size:     4 [unused]
//      = 0x00000000 
//   uint CS_RIGHT;                     // Offset: 1156 Size:     4 [unused]
//      = 0x00000001 
//   uint CS_BACK;                      // Offset: 1160 Size:     4 [unused]
//      = 0x00000002 
//   uint CS_LEFT;                      // Offset: 1164 Size:     4 [unused]
//      = 0x00000003 
//   uint CS_TOP;                       // Offset: 1168 Size:     4 [unused]
//      = 0x00000004 
//   uint CS_BOTTOM;                    // Offset: 1172 Size:     4 [unused]
//      = 0x00000005 
//   float4 g_vAmbientSettings;         // Offset: 1184 Size:    16 [unused]
//   
//   struct
//   {
//       
//       float4x4 mLightSpaceInverse;   // Offset: 1200
//       float4x4 mLightSpace;          // Offset: 1264
//       float4 vShadowBias;            // Offset: 1328
//       float4 vBiasDir;               // Offset: 1344
//       float4 vSmoothOffs;            // Offset: 1360
//       float4 vShadowsDesc;           // Offset: 1376
//       float4 avCPlane[8];            // Offset: 1392
//       float4 avCascadeZ[2];          // Offset: 1520
//       float4 avUVTransform[8];       // Offset: 1552
//       float4 avZTransformZF[8];      // Offset: 1680
//
//   } g_ShadSettings;                  // Offset: 1200 Size:   608
//   
//   struct
//   {
//       
//       float4 vDesc;                  // Offset: 1808
//       float4 vFogLayerPlane;         // Offset: 1824
//       float4 vFogLayerColor;         // Offset: 1840
//       float4 vFogLayerSettings;      // Offset: 1856
//       float4 vFogColor;              // Offset: 1872
//       float4 vFogDistance;           // Offset: 1888
//
//   } g_FogDesc;                       // Offset: 1808 Size:    96
//   float4x4 g_mCloudsShadowsSpace;    // Offset: 1904 Size:    64
//   float4 g_vCloudsShadowDesc;        // Offset: 1968 Size:    16 [unused]
//   float4 g_vSettings;                // Offset: 1984 Size:    16 [unused]
//   float4 g_vDesc;                    // Offset: 2000 Size:    16
//   float4x4 viewproj;                 // Offset: 2016 Size:    64
//   float4 Origin;                     // Offset: 2080 Size:    16
//   float4 FogK;                       // Offset: 2096 Size:    16 [unused]
//      = 0x3fc00000 0x3fe66666 0x4019999a 0x3f800000 
//   float4 g_vWindDir;                 // Offset: 2112 Size:    16
//      = 0xbf800000 0x00000000 0x00000000 0x00000000 
//   float4 g_vAnim;                    // Offset: 2128 Size:    16
//   float4 g_vBlockDesc;               // Offset: 2144 Size:    16
//   float4 g_vBlockOrigin;             // Offset: 2160 Size:    16
//   float4 g_vSideStep;                // Offset: 2176 Size:    16
//   float4 g_vQuadOrigin;              // Offset: 2192 Size:    16
//   float4 g_vTexTransform;            // Offset: 2208 Size:    16
//   float4 g_vSpecColor;               // Offset: 2224 Size:    16 [unused]
//      = 0x3f800000 0x3f800000 0x3f800000 0x42a00000 
//   float4 g_vDeepCoords;              // Offset: 2240 Size:    16 [unused]
//   float4 g_vMaskCoords;              // Offset: 2256 Size:    16 [unused]
//   float4 g_vFoamScale;               // Offset: 2272 Size:    16
//   float4 g_vChunkTCoords;            // Offset: 2288 Size:    16
//   float4 g_vWaterDesc;               // Offset: 2304 Size:    16 [unused]
//   float4 g_vGridOffset;              // Offset: 2320 Size:    16
//   float4 g_aGridData[81];            // Offset: 2336 Size:  1296
//   float4 g_aGridHeightOffset[21];    // Offset: 3632 Size:   336
//   float4 g_vTrailTransform0;         // Offset: 3968 Size:    16 [unused]
//   float4 g_vTrailTransform1;         // Offset: 3984 Size:    16 [unused]
//   float4 g_avMask[4];                // Offset: 4000 Size:    64
//      = 0x3f800000 0x00000000 0x00000000 0x00000000 
//        0x00000000 0x3f800000 0x00000000 0x00000000 
//        0x00000000 0x00000000 0x3f800000 0x00000000 
//        0x00000000 0x00000000 0x00000000 0x3f800000 
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   x           0     NONE   float   x   
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyz         2     NONE   float   xyz 
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// TEXCOORD                 3   xyzw        4     NONE   float   xyzw
// TEXCOORD                 4   xy          5     NONE   float   xy  
// TEXCOORD                 5   xyzw        6     NONE   float   xyzw
// TEXCOORD                 6   xyzw        7     NONE   float   xyzw
// TEXCOORD                 7   xyzw        8     NONE   float   xyzw
// TEXCOORD                 8   xyzw        9     NONE   float   xyzw
// COLOR                    0   xyzw       10     NONE   float   xyzw
//
vs_4_1
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[254], dynamicIndexed
dcl_input v0.x
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyz
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xy
dcl_output o6.xyzw
dcl_output o7.xyzw
dcl_output o8.xyzw
dcl_output o9.xyzw
dcl_output o10.xyzw
// dcl_temps updated : previous = dcl_temps 10
dcl_temps 13
// added 3dmigoto declaration
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture1d)(float,float,float,float) r11.xyzw, l(0, 0, 0, 0), t120.xyzw
mov r12.x, r11.w
mov r12.y, r11.w
mov r12.zw, l(1.0, 1.0)
// end of 3dmigoto declaration
add r0.xy, cb0[134].xxxx, l(1.000000, -0.500000, 0.000000, 0.000000)
div r0.z, v0.x, r0.x
add r0.z, r0.z, l(0.000100)
round_ni r0.z, r0.z
mad r0.x, -r0.z, r0.x, v0.x
add r0.x, r0.x, l(0.000100)
round_ni r0.x, r0.x
lt r0.w, r0.y, r0.z
if_nz r0.w
  div r0.w, r0.x, cb0[136].x
  add r0.w, r0.w, l(0.500000)
  round_ni r0.w, r0.w
  mul r0.x, r0.w, cb0[136].x
else 
  lt r0.w, r0.z, l(0.500000)
  if_nz r0.w
    div r0.w, r0.x, cb0[136].z
    round_ni r0.w, r0.w
    mul r0.x, r0.w, cb0[136].z
  endif 
endif 
lt r0.y, r0.y, r0.x
if_nz r0.y
  div r0.y, r0.z, cb0[136].y
  add r0.y, r0.y, l(0.500000)
  round_ni r0.y, r0.y
  mul r0.z, r0.y, cb0[136].y
else 
  lt r0.y, r0.x, l(0.500000)
  if_nz r0.y
    div r0.y, r0.z, cb0[136].w
    round_ni r0.y, r0.y
    mul r0.z, r0.y, cb0[136].w
  endif 
endif 
div r0.x, r0.x, cb0[134].x
mad r1.x, r0.x, cb0[135].w, cb0[135].x
div r0.x, r0.z, cb0[134].x
mad r1.z, r0.x, cb0[135].w, cb0[135].z
mov r1.y, cb0[135].y
add r0.xyz, r1.xyzx, -cb0[130].xyzx
dp3 r0.x, r0.xyzx, r0.xyzx
sqrt r0.y, r0.x
mul r1.w, r0.y, l(0.011000)
sqrt r1.w, r1.w
exp r1.w, r1.w
mul r1.w, r1.w, cb0[134].y
mul r0.x, r1.w, l(0.100000)
mul r1.w, cb0[134].y, l(0.100000)
lt r2.x, r0.x, r1.w
if_nz r2.x
  mov r0.x, r1.w
endif 
add r2.xy, r1.xzxx, -cb0[137].xzxx
mul r2.zw, r2.xxxy, cb0[64].xxxx
add r3.xy, r2.xyxx, -cb0[145].xyxx
div r3.xy, r3.xyxx, cb0[145].zzzz
lt r3.zw, r3.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
if_nz r3.z
  mov r3.x, l(0)
endif 
if_nz r3.w
  mov r3.y, l(0)
endif 
ge r1.w, r3.x, l(9.000000)
if_nz r1.w
  mov r3.x, l(8.999000)
endif 
ge r1.w, r3.y, l(9.000000)
if_nz r1.w
  mov r3.y, l(8.999000)
endif 
ftoi r1.w, r3.x
ftoi r3.z, r3.y
imad r3.w, r3.z, l(9), r1.w
iadd r4.x, r3.w, l(1)
ishr r4.y, r4.x, l(2)
and r4.z, r4.x, l(3)
dp4 r4.y, cb0[r4.y + 227].xyzw, cb0[r4.z + 250].xyzw
iadd r3.z, r3.z, l(1)
imad r1.w, r3.z, l(9), r1.w
iadd r3.z, r1.w, l(1)
ishr r4.z, r1.w, l(2)
and r4.w, r1.w, l(3)
dp4 r4.z, cb0[r4.z + 227].xyzw, cb0[r4.w + 250].xyzw
frc r3.xy, r3.xyxx
add r5.xyzw, -cb0[r3.w + 146].xyzw, cb0[r4.x + 146].xyzw
mad r5.xyzw, r3.xxxx, r5.xyzw, cb0[r3.w + 146].xyzw
add r6.xyzw, -cb0[r1.w + 146].xyzw, cb0[r3.z + 146].xyzw
mad r6.xyzw, r3.xxxx, r6.xyzw, cb0[r1.w + 146].xyzw
add r6.xyzw, -r5.xyzw, r6.xyzw
mad r5.xyzw, r3.yyyy, r6.xyzw, r5.xyzw
add r1.w, -r3.y, l(1.000000)
lt r4.x, r3.x, r1.w
if_nz r4.x
  ishr r4.x, r3.w, l(2)
  and r3.w, r3.w, l(3)
  dp4 r3.w, cb0[r4.x + 227].xyzw, cb0[r3.w + 250].xyzw
  add r4.x, -r3.w, r4.y
  mad r4.x, r4.x, r3.x, r3.w
  add r3.w, -r3.w, r4.z
  mad r3.y, r3.w, r3.y, r4.x
else 
  ishr r3.w, r3.z, l(2)
  and r3.z, r3.z, l(3)
  dp4 r3.z, cb0[r3.w + 227].xyzw, cb0[r3.z + 250].xyzw
  add r3.w, -r4.z, r3.z
  mad r3.x, r3.w, r3.x, r4.z
  add r3.z, -r3.z, r4.y
  mad r3.y, r3.z, r1.w, r3.x
endif 
lt r1.w, r5.z, l(0.990000)
lt r3.x, l(0.010000), r5.z
and r1.w, r1.w, r3.x
if_nz r1.w
  mad r3.xz, r2.zzwz, cb0[143].zzzz, cb0[143].xxyx
  mul r3.xz, r3.xxzx, l(6.280000, 0.000000, 6.280000, 0.000000)
  sincos r1.w, null, r3.x
  mad r1.w, r1.w, l(0.300000), cb0[133].y
  sincos null, r3.x, r3.z
  mad r1.w, r3.x, l(0.300000), r1.w
  frc r1.w, r1.w
  dp2 r3.x, r5.xyxx, cb0[132].xyxx
  dp2 r3.z, r5.xyxx, -cb0[132].xyxx
  mul r3.z, r3.z, l(0.500000)
  max r3.xz, r3.xxzx, l(0.000000, 0.000000, 0.000000, 0.000000)
  add r3.x, r3.z, r3.x
  min r3.x, r3.x, l(1.000000)
  add r3.z, cb0[133].y, l(-0.900000)
  lt r3.w, r3.z, l(-0.500000)
  if_nz r3.w
    add r3.z, cb0[133].y, l(0.100000)
  endif 
  add r3.w, r5.z, l(-0.850000)
  mad r3.w, -|r3.w|, l(15.000000), l(1.000000)
  max r3.w, r3.w, l(0.000000)
  mul r3.w, r3.w, r3.x
  mad r3.z, -|r3.z|, l(5.000000), l(1.000000)
  max r3.z, r3.z, l(0.000000)
  mul r3.z, r3.z, r3.w
  add r4.x, r5.z, -cb0[133].y
  lt r4.y, r4.x, l(0.000000)
  if_nz r4.y
    add r4.x, r4.x, l(1.000000)
  endif 
  mul_sat r4.x, r4.x, l(6.000000)
  lt r4.y, l(0.010000), r4.x
  lt r4.z, r4.x, l(0.990000)
  and r4.y, r4.z, r4.y
  if_nz r4.y
    add r4.y, r5.z, l(-0.800000)
    mad_sat r4.y, -r4.y, l(5.000000), l(1.000000)
    mul r4.y, r4.y, r5.z
    mul r4.y, r3.x, r4.y
    add r4.z, r4.y, r4.y
    mul r4.w, r4.z, r4.z
    add r6.x, r4.x, l(-0.700000)
    mad r6.x, -|r6.x|, l(3.33333325), l(1.000000)
    max r6.x, r6.x, l(0.000000)
    mul r4.w, r4.w, r6.x
    mad r3.z, r4.w, l(0.300000), r3.z
    lt r4.w, l(0.500000), r4.x
    if_nz r4.w
      add r4.w, r4.x, l(-0.500000)
      mad r6.x, r4.y, l(2.000000), l(1.000000)
      mad r4.w, r4.w, r6.x, l(0.500000)
      min r4.x, r4.w, l(1.000000)
    endif 
    mad r4.x, r4.x, l(6.280000), l(-1.570000)
    mad r4.w, r4.y, l(2.000000), l(1.000000)
    sincos r4.x, r6.x, r4.x
    mad r4.x, r4.x, l(0.500000), l(0.500000)
    log r4.x, r4.x
    mul r4.z, r4.x, r4.z
    exp r4.z, r4.z
    mul r4.xz, r4.xxzx, r4.wwww
    mul r4.z, r6.x, r4.z
    mul r4.z, r4.z, l(0.500000)
    exp r4.x, r4.x
    mul r4.zw, r4.zzzz, -r5.xxxy
    mul r6.xz, r4.yyyy, r4.zzwz
    mov r6.y, l(1.000000)
    dp3 r4.z, r6.xyzx, r6.xyzx
    rsq r4.z, r4.z
    mul r4.zw, r4.zzzz, r6.xxxz
    mul r4.x, r4.y, r4.x
  else 
    mov r4.xzw, l(0,0,0,0)
  endif 
  add r4.y, r1.w, l(-0.900000)
  lt r6.x, r4.y, l(-0.500000)
  if_nz r6.x
    add r4.y, r1.w, l(0.100000)
  endif 
  mad r4.y, -|r4.y|, l(5.000000), l(1.000000)
  max r4.y, r4.y, l(0.000000)
  mul r3.w, r3.w, r4.y
  add r1.w, -r1.w, r5.z
  lt r4.y, r1.w, l(0.000000)
  if_nz r4.y
    add r1.w, r1.w, l(1.000000)
  endif 
  mul_sat r1.w, r1.w, l(6.000000)
  lt r4.y, l(0.010000), r1.w
  lt r6.x, r1.w, l(0.990000)
  and r4.y, r4.y, r6.x
  if_nz r4.y
    add r4.y, r5.z, l(-0.800000)
    mad_sat r4.y, -r4.y, l(5.000000), l(1.000000)
    mul r4.y, r4.y, r5.z
    mul r3.x, r3.x, r4.y
    add r4.y, r3.x, r3.x
    mul r6.x, r4.y, r4.y
    add r6.y, r1.w, l(-0.700000)
    mad r6.y, -|r6.y|, l(3.33333325), l(1.000000)
    max r6.y, r6.y, l(0.000000)
    mul r6.x, r6.y, r6.x
    mad r3.w, r6.x, l(0.300000), r3.w
    lt r6.x, l(0.500000), r1.w
    if_nz r6.x
      add r6.x, r1.w, l(-0.500000)
      mad r6.y, r3.x, l(2.000000), l(1.000000)
      mad r6.x, r6.x, r6.y, l(0.500000)
      min r1.w, r6.x, l(1.000000)
    endif 
    mad r1.w, r1.w, l(6.280000), l(-1.570000)
    mad r6.x, r3.x, l(2.000000), l(1.000000)
    sincos r7.x, r8.x, r1.w
    mad r1.w, r7.x, l(0.500000), l(0.500000)
    log r1.w, r1.w
    mul r4.y, r1.w, r4.y
    exp r4.y, r4.y
    mul r4.y, r4.y, r6.x
    mul r4.y, r8.x, r4.y
    mul r4.y, r4.y, l(0.500000)
    mul r1.w, r1.w, r6.x
    exp r1.w, r1.w
    mul r6.xy, r4.yyyy, -r5.xyxx
    mul r6.xz, r3.xxxx, r6.xxyx
    mov r6.y, l(1.000000)
    dp3 r4.y, r6.xyzx, r6.xyzx
    rsq r4.y, r4.y
    mul r6.xy, r4.yyyy, r6.xzxx
    mul r1.w, r3.x, r1.w
  else 
    mov r6.xy, l(0,0,0,0)
    mov r1.w, l(0)
  endif 
  add r6.xy, r4.zwzz, r6.xyxx
  add r3.x, r3.w, r3.z
  min r3.x, r3.x, l(1.000000)
  add r1.w, r1.w, r4.x
else 
  mov r3.x, l(0)
  mov r1.w, l(0)
  mov r6.xy, l(0,0,0,0)
endif 
add r3.z, cb0[64].x, cb0[64].x
mul r3.w, r0.y, r3.z
sqrt r3.w, r3.w
add r3.w, -r3.w, cb0[64].w
add r3.w, r3.w, l(0.500000)
round_ni r3.w, r3.w
ftoi r3.w, r3.w
ilt r4.x, r3.w, l(4)
if_nz r4.x
  mov r3.w, l(4)
endif 
mad r2.xy, r2.xyxx, r3.zzzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
ishl r3.z, r3.w, l(1)
mov r4.xz, l(0,0,0,0)
mov r3.w, l(0)
mov r4.y, cb0[63].w
loop 
  ige r4.w, r3.w, r3.z
  breakc_nz r4.w
  iadd r7.xy, r3.wwww, l(1, 2, 0, 0)
  mul r4.w, cb0[133].w, cb0[r3.w + 0].y
  sincos r8.x, r9.x, r4.w
  mul r7.zw, r8.xxxx, cb0[r7.x + 0].yyyx
  mad r4.w, cb0[r7.x + 0].x, r9.x, -r7.z
  mad r6.w, cb0[r7.x + 0].y, r9.x, r7.w
  dp2 r7.x, cb0[r3.w + 0].zwzz, r2.xyxx
  mad r7.x, r7.x, l(6.28318548), cb0[r3.w + 0].x
  mad r7.x, cb0[r3.w + 0].y, cb0[133].w, r7.x
  sincos r7.x, r8.x, r7.x
  mul r7.z, r6.w, r7.x
  mad r7.z, r4.w, r8.x, -r7.z
  mul r6.w, r6.w, r8.x
  mad r4.w, r4.w, r7.x, r6.w
  add r4.y, r4.y, r7.z
  dp2 r6.w, cb0[r3.w + 0].zwzz, cb0[r3.w + 0].zwzz
  rsq r6.w, r6.w
  mul r7.xz, r6.wwww, cb0[r3.w + 0].wwzw
  mad r4.xz, r7.zzxz, r4.wwww, r4.xxzx
  mov r3.w, r7.y
endloop 
add r2.x, -r4.y, l(0.500000)
mul r3.zw, r4.xxxz, cb0[64].yyyy
mad r2.x, r2.x, cb0[64].z, cb0[138].w
add r4.xy, -r5.zwzz, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r7.xz, r3.zzwz, r4.xxxx
mad r1.w, r1.w, l(3.000000), r3.y
mad r7.w, r2.x, r4.x, r1.w
mul r2.xy, cb0[125].xxxx, l(0.800000, 0.200000, 0.000000, 0.000000)
div r1.w, r0.y, r2.x
mul r2.x, r1.w, r1.w
mad_sat r1.w, -r1.w, r2.x, l(1.000000)
mul r4.xzw, r1.wwww, r7.xxwz
mul r4.xyz, r4.yyyy, r4.xzwx
max r4.w, r3.y, r4.y
add r1.xyz, r1.xyzx, r4.xwzx
mov r6.z, l(1.000000)
dp3 r2.x, r6.xyzx, r6.xyzx
rsq r2.x, r2.x
mul r3.yzw, r2.xxxx, r6.xxzy
mad r2.x, -r6.z, r2.x, l(1.000000)
mul r2.x, r2.x, l(16.000000)
dp2 r4.x, r6.xyxx, r6.xyxx
rsq r4.x, r4.x
mul r4.xy, r4.xxxx, r6.xyxx
dp2 r4.z, r5.xyxx, r5.xyxx
rsq r4.z, r4.z
mul r4.zw, r4.zzzz, r5.xxxy
dp2 r4.x, r4.xyxx, r4.zwzz
max r4.x, r4.x, l(0.000000)
mad r2.x, r2.x, r4.x, r3.x
min o4.w, r2.x, l(1.000000)
add r4.xy, r1.xzxx, -cb0[137].xzxx
mul o1.xy, r4.xyxx, cb0[64].xxxx
mad o1.zw, r1.xxxz, cb0[138].zzzz, cb0[138].xxxy
mad o6.zw, r1.xxxz, cb0[142].zzzz, cb0[142].xxxy
add r4.xyz, r1.xyzx, -cb0[130].xyzx
mov r1.w, l(1.000000)
// replacing matrix usage :dp4 r5.x, r1.xyzw, cb0[126].xyzw
dp4 r10.x, r1.xyzw, cb0[126].xyzw
mul r5.x, r10.x, r12.x
// replacing matrix usage :dp4 r5.y, r1.xyzw, cb0[127].xyzw
dp4 r10.y, r1.xyzw, cb0[127].xyzw
mul r5.y, r10.y, r12.y
dp4 r5.z, r1.xyzw, cb0[128].xyzw
dp4 r5.w, r1.xyzw, cb0[129].xyzw
add r2.x, r5.w, -cb0[86].x
mul r2.x, r2.x, cb0[86].y
mov_sat o10.xyz, r2.xxxx
mad r2.x, -cb0[125].x, l(0.800000), r0.y
div r2.x, r2.x, r2.y
add_sat o10.w, -r2.x, l(1.000000)
dp4 o5.x, r1.xyzw, cb0[119].xyzw
dp4 o5.y, r1.xyzw, cb0[121].xyzw
dp4 o9.x, r1.xyzw, cb0[79].xyzw
dp4 o9.y, r1.xyzw, cb0[80].xyzw
dp4 o9.z, r1.xyzw, cb0[81].xyzw
mul r6.xyz, r5.xwyx, l(0.500000, 0.500000, -0.500000, 0.000000)
add o7.xy, r6.yyyy, r6.xzxx
dp3 r2.x, r4.xyzx, r4.xyzx
sqrt r2.x, r2.x
mul r2.x, r2.x, cb0[118].x
min r2.x, r2.x, l(1.000000)
dp4 r1.w, r1.xyzw, cb0[114].xyzw
add r6.xyz, -r1.xyzx, cb0[130].xyzx
ge r1.y, cb0[113].z, l(0.000000)
if_nz r1.y
  lt r1.y, r1.w, -cb0[116].y
  if_nz r1.y
    mov r1.w, -cb0[116].y
  endif 
  ge r1.y, r1.w, l(0.000000)
  if_nz r1.y
    mov o8.w, l(0)
    mov r1.y, l(0)
    mov r2.y, l(-1)
  else 
    dp3 r3.x, r6.xyzx, r6.xyzx
    rsq r3.x, r3.x
    mul r7.xyz, r3.xxxx, r6.xyzx
    dp3 r3.x, cb0[114].xyzx, r7.xyzx
    lt r4.w, l(0.000100), |r3.x|
    if_nz r4.w
      div r3.x, l(1.000000, 1.000000, 1.000000, 1.000000), r3.x
      add r4.w, -r1.w, cb0[113].z
      mul r6.w, r3.x, cb0[113].z
      mad r1.y, r4.w, r3.x, -r6.w
    else 
      mov r1.y, l(0)
    endif 
    lt r2.y, r1.y, l(0.000100)
    if_nz r2.y
      mov o8.w, l(0)
    endif 
  endif 
  if_z r2.y
    mul r1.y, r1.y, cb0[116].x
    mul r1.y, r1.y, l(1.44254541)
    exp r1.y, r1.y
    div r1.y, l(1.000000, 1.000000, 1.000000, 1.000000), r1.y
    add o8.w, -r1.y, l(1.000000)
  endif 
else 
  ge r1.y, r1.w, l(0.000000)
  if_nz r1.y
    dp3 r1.y, r6.xyzx, r6.xyzx
    rsq r1.y, r1.y
    mul r7.xyz, r1.yyyy, r6.xyzx
    dp3 r1.y, cb0[114].xyzx, r7.xyzx
    lt r1.w, l(0.000100), |r1.y|
    if_nz r1.w
      div r1.y, cb0[113].z, r1.y
    endif 
    lt r1.w, r1.y, l(0.000100)
    if_nz r1.w
      mov o8.w, l(0)
    endif 
  else 
    dp3 r2.y, r6.xyzx, r6.xyzx
    sqrt r1.y, r2.y
    mov r1.w, l(0)
  endif 
  if_z r1.w
    mul r1.y, r1.y, cb0[116].x
    mul r1.y, r1.y, l(1.44254541)
    exp r1.y, r1.y
    div r1.y, l(1.000000, 1.000000, 1.000000, 1.000000), r1.y
    add r1.y, r1.y, l(-1.000000)
    mov o8.w, -r1.y
  endif 
endif 
dp3 r1.y, cb0[117].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r1.y, l(0.001000), r1.y
lt r1.w, r2.x, cb0[113].x
if_nz r1.w
  mul r1.w, r2.x, cb0[113].y
  div r1.w, r1.w, cb0[113].x
else 
  add r6.xy, -cb0[113].yxyy, l(1.000000, 1.000000, 0.000000, 0.000000)
  add r2.y, r2.x, -cb0[113].x
  mul r2.y, r2.y, r6.x
  div r2.y, r2.y, r6.y
  add r1.w, r2.y, cb0[113].y
endif 
mul r6.xyz, r1.wwww, cb0[117].xyzx
log r6.xyz, r6.xyzx
mul r6.xyz, r6.xyzx, cb0[117].wwww
exp r6.xyz, r6.xyzx
mul r6.xyz, r6.xyzx, l(-1.442695, -1.442695, -1.442695, 0.000000)
exp r6.xyz, r6.xyzx
add r6.xyz, -r6.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
lt r1.w, l(0.800000), r2.x
and r1.y, r1.y, r1.w
if_nz r1.y
  add r1.y, r2.x, l(-0.800000)
  mul r1.y, r1.y, l(5.000000)
  add r7.xyz, -r6.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
  mad r6.xyz, r1.yyyy, r7.xyzx, r6.xyzx
endif 
add r1.y, cb0[118].w, l(-0.250000)
add r1.y, r1.y, r1.y
dp3 r1.w, r6.xyzx, l(0.333300, 0.333300, 0.333300, 0.000000)
add r7.xyz, -r6.xyzx, r1.wwww
mad o8.xyz, r1.yyyy, r7.xyzx, r6.xyzx
mov o0.xyzw, r5.xyzw
mov r0.zw, r1.xxxz
mov o3.xyzw, r0.zwxy
mov o4.xyz, r3.yzwy
mov o6.xy, r2.zwzz
mov o7.zw, r5.zzzw
mov o9.w, r5.w
mov o2.xyz, r4.xyzx
ret 
// Approximately 465 instruction slots used
