//Red jewel PS.
// ---- Created with 3Dmigoto v1.3.14 on Fri Feb 08 18:42:01 2019
//
//cbuffer SceneInfo : register(b0)
//{
//  row_major float4x4 viewProjMat : packoffset(c0);
//  row_major float3x4 transposeViewMat : packoffset(c4);
//  row_major float3x4 transposeViewInvMat : packoffset(c7);
//  float4 projElement[2] : packoffset(c10);
//  float4 projInvElements[2] : packoffset(c12);
//  row_major float4x4 viewProjInvMat : packoffset(c14);
//  row_major float4x4 prevViewProjMat : packoffset(c18);
//  float3 ZToLinear : packoffset(c22);
//  float subdivisionLevel : packoffset(c22.w);
//  float2 screenSize : packoffset(c23);
//  float2 screenInverseSize : packoffset(c23.z);
//  float2 cullingHelper : packoffset(c24);
//  float cameraNearPlane : packoffset(c24.z);
//  float cameraFarPlane : packoffset(c24.w);
//  float4 viewFrustum[6] : packoffset(c25);
//  float4 clipplane : packoffset(c31);
//}
//
//cbuffer GBufferType : register(b1)
//{
//  float gbufferTypeFlag : packoffset(c0);
//  float gbufferTypeReserve0 : packoffset(c0.y);
//  float gbufferTypeReserve1 : packoffset(c0.z);
//  float gbufferTypeReserve2 : packoffset(c0.w);
//}
//
//cbuffer UserMaterial : register(b2)
//{
//  float4 VAR_JewelryColor : packoffset(c0);
//  float VAR_Metallic : packoffset(c1);
//  float VAR_Roughness : packoffset(c1.y);
//  float VAR_Brightness : packoffset(c1.z);
//  float CAPCOM_MATERIAL_RESERVE : packoffset(c1.w);
//}
//
//SamplerState BilinearWrap_s : register(s0);
//Texture2D<float4> InnerNormalMap : register(t0);
//Texture2D<float4> RefractSphereMap : register(t1);
//
//
//// 3Dmigoto declarations
//#define cmp -
//Texture1D<float4> IniParams : register(t120);
//Texture2D<float4> StereoParams : register(t125);
//
//
//void main(
//  float4 v0 : SV_POSITION0,
//  float4 v1 : INTERPOLATOR0,
//  float4 v2 : INTERPOLATOR1,
//  float4 v3 : INTERPOLATOR2,
//  float v4 : INTERPOLATOR3,
//  out float4 o0 : SV_TARGET0,
//  out float4 o1 : SV_TARGET1,
//  out float4 o2 : SV_TARGET2,
//  out float4 o3 : SV_TARGET3)
//{
//  float4 r0,r1,r2,r3,r4,r5;
//  uint4 bitmask, uiDest;
//  float4 fDest;
//
//  r0.x = 0.00100000005 * screenSize.x;
//  r0.x = r0.x / v0.w;
//  r1.xyzw = screenInverseSize.xyxy * v0.xyxy;
//  r1.xyzw = r1.xyzw * float4(2,-2,8,8) + float4(-1,1,-0.5,-0.5);
//  r0.xy = r1.zw / r0.xx;
//  r0.xy = float2(0.5,0.5) + r0.xy;
//  r0.xyz = InnerNormalMap.SampleLevel(BilinearWrap_s, r0.xy, 0).xyz;
//  r0.xyz = float3(-0.501960814,-0.501960814,-1) + r0.xyz;
//  r0.xyz = r0.xyz * float3(0.150000006,0.150000006,0.150000006) + float3(0.501960814,0.501960814,1);
//  r0.xyz = r0.xyz * float3(2,2,2) + float3(-1,-1,-1);
//  r0.w = cmp(v2.z < 0);
//  r2.y = v1.w;
//  r2.xz = v2.yx;
//  r1.z = dot(r2.xyz, r2.xyz);
//  r1.z = rsqrt(r1.z);
//  r2.xyz = r2.xyz * r1.zzz;
//  r1.z = dot(v1.xyz, v1.xyz);
//  r1.z = rsqrt(r1.z);
//  r3.xyz = v1.xzy * r1.zzz;
//  r4.xyz = r3.zyx * r2.yzx;
//  r4.xyz = r3.xzy * r2.zxy + -r4.xyz;
//  r4.xyz = r0.www ? -r4.xyz : r4.xyz;
//  r0.w = dot(r4.xyz, r4.xyz);
//  r0.w = rsqrt(r0.w);
//  r4.xyz = r4.xyz * r0.www;
//  r4.xyz = r4.xyz * r0.yyy;
//  r0.xyw = r0.xxx * r2.xyz + r4.xyz;
//  r0.xyz = r0.zzz * r3.yxz + r0.xyw;
//  r0.w = dot(r0.xyz, r0.xyz);
//  r0.w = rsqrt(r0.w);
//  r0.xyz = r0.xyz * r0.www;
//  r2.x = -transposeViewInvMat._m03;
//  r2.y = -transposeViewInvMat._m13;
//  r2.z = -transposeViewInvMat._m23;
//  r4.x = v2.w;
//  r4.yz = v3.xy;
//  r2.xyz = r4.xyz + r2.xyz;
//  r0.w = dot(r2.xyz, r2.xyz);
//  r0.w = rsqrt(r0.w);
//  r2.xyz = r2.xyz * r0.www;
//  r0.w = dot(r2.zxy, r0.xyz);
//  r1.z = -r0.w * r0.w + 1;
//  r1.zw = -r1.zz * float2(0.722500026,4) + float2(1,1);
//  r4.xy = sqrt(r1.zw);
//  r1.zw = cmp(r1.zw >= float2(0,0));
//  r2.w = r0.w * 0.850000024 + r4.x;
//  r0.w = r0.w * 2 + r4.y;
//  r4.xyz = r2.www * r0.xyz;
//  r4.xyz = r2.zxy * float3(0.850000024,0.850000024,0.850000024) + -r4.xyz;
//  r4.xyz = r1.zzz ? r4.xyz : 0;
//  r1.z = max(abs(r4.x), abs(r4.y));
//  r1.z = 1 / r1.z;
//  r2.w = min(abs(r4.x), abs(r4.y));
//  r1.z = r2.w * r1.z;
//  r2.w = r1.z * r1.z;
//  r3.w = r2.w * 0.0208350997 + -0.0851330012;
//  r3.w = r2.w * r3.w + 0.180141002;
//  r3.w = r2.w * r3.w + -0.330299497;
//  r2.w = r2.w * r3.w + 0.999866009;
//  r3.w = r2.w * r1.z;
//  r3.w = r3.w * -2 + 1.57079637;
//  r4.w = cmp(abs(r4.y) < abs(r4.x));
//  r3.w = r4.w ? r3.w : 0;
//  r1.z = r1.z * r2.w + r3.w;
//  r5.xy = cmp(r4.yz < -r4.yz);
//  r2.w = r5.x ? -3.141593 : 0;
//  r1.z = r2.w + r1.z;
//  r2.w = min(r4.x, r4.y);
//  r2.w = cmp(r2.w < -r2.w);
//  r3.w = max(r4.x, r4.y);
//  r3.w = cmp(r3.w >= -r3.w);
//  r2.w = r2.w ? r3.w : 0;
//  r1.z = r2.w ? -r1.z : r1.z;
//  r1.z = r1.z * 0.159154937 + 0.5;
//  r4.x = frac(r1.z);
//  r1.z = abs(r4.z) * -0.0187292993 + 0.0742610022;
//  r1.z = r1.z * abs(r4.z) + -0.212114394;
//  r1.z = r1.z * abs(r4.z) + 1.57072878;
//  r2.w = 1 + -abs(r4.z);
//  r2.w = sqrt(r2.w);
//  r3.w = r2.w * r1.z;
//  r3.w = r3.w * -2 + 3.14159274;
//  r3.w = r5.y ? r3.w : 0;
//  r1.z = r1.z * r2.w + r3.w;
//  r4.y = 0.318309873 * r1.z;
//  r4.xyz = RefractSphereMap.SampleLevel(BilinearWrap_s, r4.xy, 0).xyz;
//  r5.xyz = r2.zxy + r2.zxy;
//  r1.z = dot(r3.xzy, -r2.xyz);
//  r0.xyz = -r0.www * r0.xyz + r5.xyz;
//  r0.xyz = r1.www ? r0.xyz : 0;
//  r0.w = max(abs(r0.x), abs(r0.y));
//  r0.w = 1 / r0.w;
//  r1.w = min(abs(r0.x), abs(r0.y));
//  r0.w = r1.w * r0.w;
//  r1.w = r0.w * r0.w;
//  r2.x = r1.w * 0.0208350997 + -0.0851330012;
//  r2.x = r1.w * r2.x + 0.180141002;
//  r2.x = r1.w * r2.x + -0.330299497;
//  r1.w = r1.w * r2.x + 0.999866009;
//  r2.x = r1.w * r0.w;
//  r2.x = r2.x * -2 + 1.57079637;
//  r2.y = cmp(abs(r0.y) < abs(r0.x));
//  r2.x = r2.y ? r2.x : 0;
//  r0.w = r0.w * r1.w + r2.x;
//  r2.xy = cmp(r0.yz < -r0.yz);
//  r1.w = r2.x ? -3.141593 : 0;
//  r0.w = r1.w + r0.w;
//  r1.w = min(r0.x, r0.y);
//  r1.w = cmp(r1.w < -r1.w);
//  r0.x = max(r0.x, r0.y);
//  r0.x = cmp(r0.x >= -r0.x);
//  r0.x = r0.x ? r1.w : 0;
//  r0.x = r0.x ? -r0.w : r0.w;
//  r0.x = r0.x * 0.159154937 + 0.5;
//  r0.x = frac(r0.x);
//  r0.w = abs(r0.z) * -0.0187292993 + 0.0742610022;
//  r0.w = r0.w * abs(r0.z) + -0.212114394;
//  r0.w = r0.w * abs(r0.z) + 1.57072878;
//  r0.z = 1 + -abs(r0.z);
//  r0.z = sqrt(r0.z);
//  r1.w = r0.w * r0.z;
//  r1.w = r1.w * -2 + 3.14159274;
//  r1.w = r2.y ? r1.w : 0;
//  r0.z = r0.w * r0.z + r1.w;
//  r0.y = 0.318309873 * r0.z;
//  r0.xyz = RefractSphereMap.SampleLevel(BilinearWrap_s, r0.xy, 0).xyz;
//  r2.xyz = r4.xyz + -r0.xyz;
//  r4.xy = float2(-0.680000007,-0.889999986) + r1.zz;
//  r1.z = saturate(r1.z);
//  r4.xy = saturate(float2(-2.77777767,-100.000099) * r4.xy);
//  r4.zw = r4.xy * float2(-2,-2) + float2(3,3);
//  r4.xy = r4.xy * r4.xy;
//  r4.xy = r4.zw * r4.xy;
//  r0.xyz = r4.yyy * r2.xyz + r0.xyz;
//  r0.w = 0.649999976 * r4.x;
//  r1.w = r1.z * -2 + 3;
//  r1.z = r1.z * r1.z;
//  r1.z = r1.w * r1.z;
//  r2.xyz = float3(1,1,1) + -VAR_JewelryColor.xyz;
//  r2.xyz = r2.xyz * r1.zzz + r0.www;
//  r0.xyz = -r2.xyz + r0.xyz;
//  o0.xyz = VAR_Brightness * r0.xyz;
//  o0.w = 0;
//  o1.w = max(0.0399999991, VAR_Metallic);
//  o1.xyz = float3(0,0,0);
//  r0.x = abs(r3.x) + abs(r3.y);
//  r0.x = r0.x + abs(r3.z);
//  r0.x = 1 / r0.x;
//  r0.xy = r3.xy * r0.xx;
//  r0.z = cmp(0 >= r3.z);
//  r1.zw = float2(1,1) + -abs(r0.yx);
//  r2.xy = cmp(r0.xy >= float2(0,0));
//  r1.zw = r2.xy ? r1.zw : -r1.zw;
//  r0.xy = r0.zz ? r1.zw : r0.xy;
//  o2.xy = r0.xy * float2(0.5,0.5) + float2(0.5,0.5);
//  o2.z = VAR_Roughness;
//  o2.w = gbufferTypeFlag * 0.333333343 + 0.666666985;
//  r0.xy = v3.zw / v4.xx;
//  o3.yz = r0.xy + -r1.xy;
//  o3.xw = float2(1,1);
//  return;
//}
//
///*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.14 on Fri Feb 08 18:42:01 2019
//
//
// Buffer Definitions:
//
// cbuffer SceneInfo
// {
//
//   row_major float4x4 viewProjMat;    // Offset:    0 Size:    64 [unused]
//   row_major float3x4 transposeViewMat;// Offset:   64 Size:    48 [unused]
//   row_major float3x4 transposeViewInvMat;// Offset:  112 Size:    48
//   float4 projElement[2];             // Offset:  160 Size:    32 [unused]
//   float4 projInvElements[2];         // Offset:  192 Size:    32 [unused]
//   row_major float4x4 viewProjInvMat; // Offset:  224 Size:    64 [unused]
//   row_major float4x4 prevViewProjMat;// Offset:  288 Size:    64 [unused]
//   float3 ZToLinear;                  // Offset:  352 Size:    12 [unused]
//   float subdivisionLevel;            // Offset:  364 Size:     4 [unused]
//   float2 screenSize;                 // Offset:  368 Size:     8
//   float2 screenInverseSize;          // Offset:  376 Size:     8
//   float2 cullingHelper;              // Offset:  384 Size:     8 [unused]
//   float cameraNearPlane;             // Offset:  392 Size:     4 [unused]
//   float cameraFarPlane;              // Offset:  396 Size:     4 [unused]
//   float4 viewFrustum[6];             // Offset:  400 Size:    96 [unused]
//   float4 clipplane;                  // Offset:  496 Size:    16 [unused]
//
// }
//
// cbuffer GBufferType
// {
//
//   float gbufferTypeFlag;             // Offset:    0 Size:     4
//   float gbufferTypeReserve0;         // Offset:    4 Size:     4 [unused]
//   float gbufferTypeReserve1;         // Offset:    8 Size:     4 [unused]
//   float gbufferTypeReserve2;         // Offset:   12 Size:     4 [unused]
//
// }
//
// cbuffer UserMaterial
// {
//
//   float4 VAR_JewelryColor;           // Offset:    0 Size:    16
//   float VAR_Metallic;                // Offset:   16 Size:     4
//   float VAR_Roughness;               // Offset:   20 Size:     4
//   float VAR_Brightness;              // Offset:   24 Size:     4
//   float CAPCOM_MATERIAL_RESERVE;     // Offset:   28 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// BilinearWrap                      sampler      NA          NA    0        1
// InnerNormalMap                    texture  float4          2d    0        1
// RefractSphereMap                  texture  float4          2d    1        1
// SceneInfo                         cbuffer      NA          NA    0        1
// GBufferType                       cbuffer      NA          NA    1        1
// UserMaterial                      cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xy w
// INTERPOLATOR             0   xyzw        1     NONE   float   xyzw
// INTERPOLATOR             1   xyzw        2     NONE   float   xyzw
// INTERPOLATOR             2   xyzw        3     NONE   float   xyzw
// INTERPOLATOR             3   x           4     NONE   float   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
// SV_TARGET                1   xyzw        1   TARGET   float   xyzw
// SV_TARGET                2   xyzw        2   TARGET   float   xyzw
// SV_TARGET                3   xyzw        3   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[24], immediateIndexed
dcl_constantbuffer cb1[1], immediateIndexed
dcl_constantbuffer cb2[2], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input_ps_siv linear noperspective v0.xyw, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xyzw
dcl_input_ps linear v4.x
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_temps 38
dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture2d)(float,float,float,float) r21.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_indexable(texture1d)(float,float,float,float) r20.xyzw, l(0, 0, 0, 0), t120.xyzw

mov r22.xyzw, v1.xyzw
add r21.w, r22.w, -r21.y
mul r21.w, r21.w, r20.x
mad r22.x, r21.x, r21.w, r22.x

mul r0.x, cb0[23].x, l(0.001000)
div r0.x, r0.x, v0.w
mul r1.xyzw, v0.xyxy, cb0[23].zwzw
mad r1.xyzw, r1.xyzw, l(2.000000, -2.000000, 8.000000, 8.000000), l(-1.000000, 1.000000, -0.500000, -0.500000)
div r0.xy, r1.zwzz, r0.xxxx
add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t0.xyzw, s0, l(0.000000)
add r0.xyz, r0.xyzx, l(-0.501960814, -0.501960814, -1.000000, 0.000000)
mad r0.xyz, r0.xyzx, l(0.150000, 0.150000, 0.150000, 0.000000), l(0.501960814, 0.501960814, 1.000000, 0.000000)
mad r0.xyz, r0.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
lt r0.w, v2.z, l(0.000000)
mov r2.y, v1.w
mov r2.xz, v2.yyxy
dp3 r1.z, r2.xyzx, r2.xyzx
rsq r1.z, r1.z
mul r2.xyz, r1.zzzz, r2.xyzx
dp3 r1.z, v1.xyzx, v1.xyzx
rsq r1.z, r1.z
mul r3.xyz, r1.zzzz, v1.xzyx
mul r4.xyz, r2.yzxy, r3.zyxz
mad r4.xyz, r3.xzyx, r2.zxyz, -r4.xyzx
movc r4.xyz, r0.wwww, -r4.xyzx, r4.xyzx
dp3 r0.w, r4.xyzx, r4.xyzx
rsq r0.w, r0.w

//Fix here.


mul r4.xyz, r0.wwww, r4.xyzx

//mad r0.x, -r21.x, r0.z, r0.x

mul r4.xyz, r0.yyyy, r4.xyzx
mad r0.xyw, r0.xxxx, r2.xyxz, r4.xyxz
mad r0.xyz, r0.zzzz, r3.yxzy, r0.xywx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx



mov r2.x, -cb0[7].w
mov r2.y, -cb0[8].w
mov r2.z, -cb0[9].w
mov r4.x, v2.w
mov r4.yz, v3.xxyx
add r2.xyz, r2.xyzx, r4.xyzx
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r2.xyzx

//add r21.w, r2.z, -r21.y
//mul r21.w, r21.w, r20.x
//mad r2.x, r21.x, r21.w, r2.x

dp3 r0.w, r2.zxyz, r0.xyzx
mad r1.z, -r0.w, r0.w, l(1.000000)
mad r1.zw, -r1.zzzz, l(0.000000, 0.000000, 0.722500, 4.000000), l(0.000000, 0.000000, 1.000000, 1.000000)
sqrt r4.xy, r1.zwzz
ge r1.zw, r1.zzzw, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r2.w, r0.w, l(0.850000), r4.x
mad r0.w, r0.w, l(2.000000), r4.y
mul r4.xyz, r0.xyzx, r2.wwww
mad r4.xyz, r2.zxyz, l(0.850000, 0.850000, 0.850000, 0.000000), -r4.xyzx
and r4.xyz, r1.zzzz, r4.xyzx
max r1.z, |r4.y|, |r4.x|
div r1.z, l(1.000000, 1.000000, 1.000000, 1.000000), r1.z
min r2.w, |r4.y|, |r4.x|
mul r1.z, r1.z, r2.w
mul r2.w, r1.z, r1.z
mad r3.w, r2.w, l(0.0208350997), l(-0.085133)
mad r3.w, r2.w, r3.w, l(0.180141)
mad r3.w, r2.w, r3.w, l(-0.330299497)
mad r2.w, r2.w, r3.w, l(0.999866)
mul r3.w, r1.z, r2.w
mad r3.w, r3.w, l(-2.000000), l(1.57079637)
lt r4.w, |r4.y|, |r4.x|
and r3.w, r3.w, r4.w
mad r1.z, r1.z, r2.w, r3.w
lt r5.xy, r4.yzyy, -r4.yzyy
and r2.w, r5.x, l(0xc0490fdb)
add r1.z, r1.z, r2.w
min r2.w, r4.y, r4.x
lt r2.w, r2.w, -r2.w
max r3.w, r4.y, r4.x
ge r3.w, r3.w, -r3.w
and r2.w, r2.w, r3.w
movc r1.z, r2.w, -r1.z, r1.z
mad r1.z, r1.z, l(0.159154937), l(0.500000)
frc r4.x, r1.z
mad r1.z, |r4.z|, l(-0.0187292993), l(0.074261)
mad r1.z, r1.z, |r4.z|, l(-0.212114394)
mad r1.z, r1.z, |r4.z|, l(1.57072878)
add r2.w, -|r4.z|, l(1.000000)
sqrt r2.w, r2.w
mul r3.w, r1.z, r2.w
mad r3.w, r3.w, l(-2.000000), l(3.14159274)
and r3.w, r5.y, r3.w
mad r1.z, r1.z, r2.w, r3.w
mul r4.y, r1.z, l(0.318309873)
sample_l_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t1.xyzw, s0, l(0.000000)
add r5.xyz, r2.zxyz, r2.zxyz
dp3 r1.z, r3.xzyx, -r2.xyzx
mad r0.xyz, -r0.wwww, r0.xyzx, r5.xyzx
and r0.xyz, r0.xyzx, r1.wwww
max r0.w, |r0.y|, |r0.x|
div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
min r1.w, |r0.y|, |r0.x|
mul r0.w, r0.w, r1.w
mul r1.w, r0.w, r0.w
mad r2.x, r1.w, l(0.0208350997), l(-0.085133)
mad r2.x, r1.w, r2.x, l(0.180141)
mad r2.x, r1.w, r2.x, l(-0.330299497)
mad r1.w, r1.w, r2.x, l(0.999866)
mul r2.x, r0.w, r1.w
mad r2.x, r2.x, l(-2.000000), l(1.57079637)
lt r2.y, |r0.y|, |r0.x|
and r2.x, r2.y, r2.x
mad r0.w, r0.w, r1.w, r2.x
lt r2.xy, r0.yzyy, -r0.yzyy
and r1.w, r2.x, l(0xc0490fdb)
add r0.w, r0.w, r1.w
min r1.w, r0.y, r0.x
lt r1.w, r1.w, -r1.w
max r0.x, r0.y, r0.x
ge r0.x, r0.x, -r0.x
and r0.x, r0.x, r1.w
movc r0.x, r0.x, -r0.w, r0.w
mad r0.x, r0.x, l(0.159154937), l(0.500000)
frc r0.x, r0.x
mad r0.w, |r0.z|, l(-0.0187292993), l(0.074261)
mad r0.w, r0.w, |r0.z|, l(-0.212114394)
mad r0.w, r0.w, |r0.z|, l(1.57072878)
add r0.z, -|r0.z|, l(1.000000)
sqrt r0.z, r0.z
mul r1.w, r0.z, r0.w
mad r1.w, r1.w, l(-2.000000), l(3.14159274)
and r1.w, r2.y, r1.w
mad r0.z, r0.w, r0.z, r1.w
mul r0.y, r0.z, l(0.318309873)
sample_l_indexable(texture2d)(float,float,float,float) r0.xyz, r0.xyxx, t1.xyzw, s0, l(0.000000)
add r2.xyz, -r0.xyzx, r4.xyzx
add r4.xy, r1.zzzz, l(-0.680000, -0.890000, 0.000000, 0.000000)
mov_sat r1.z, r1.z
mul_sat r4.xy, r4.xyxx, l(-2.77777767, -100.000099, 0.000000, 0.000000)
mad r4.zw, r4.xxxy, l(0.000000, 0.000000, -2.000000, -2.000000), l(0.000000, 0.000000, 3.000000, 3.000000)
mul r4.xy, r4.xyxx, r4.xyxx
mul r4.xy, r4.xyxx, r4.zwzz
mad r0.xyz, r4.yyyy, r2.xyzx, r0.xyzx
mul r0.w, r4.x, l(0.650000)
mad r1.w, r1.z, l(-2.000000), l(3.000000)
mul r1.z, r1.z, r1.z
mul r1.z, r1.z, r1.w
add r2.xyz, -cb2[0].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mad r2.xyz, r2.xyzx, r1.zzzz, r0.wwww
add r0.xyz, r0.xyzx, -r2.xyzx
mul o0.xyz, r0.xyzx, cb2[1].zzzz
mov o0.w, l(0)
max o1.w, cb2[1].x, l(0.040000)
mov o1.xyz, l(0,0,0,0)
add r0.x, |r3.y|, |r3.x|
add r0.x, |r3.z|, r0.x
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mul r0.xy, r0.xxxx, r3.xyxx
ge r0.z, l(0.000000), r3.z
add r1.zw, -|r0.yyyx|, l(0.000000, 0.000000, 1.000000, 1.000000)
ge r2.xy, r0.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r1.zw, r2.xxxy, r1.zzzw, -r1.zzzw
movc r0.xy, r0.zzzz, r1.zwzz, r0.xyxx
mad o2.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
mov o2.z, cb2[1].y
mad o2.w, cb1[0].x, l(0.333333343), l(0.666667)
div r0.xy, v3.zwzz, v4.xxxx
add o3.yz, -r1.xxyx, r0.xxyx
mov o3.xw, l(1.000000,0,0,1.000000)
ret
// Approximately 161 instruction slots used
