// Lights 2

cbuffer g_CameraPS_CB : register(b0)
{

  struct
  {
    float4 fs_projection_params;
    float4 fs_inverse_projection_xy;
    float4 fs_customPixelClipPlane;
    float4 fs_viewportScaleBias;
  } g_CameraPS : packoffset(c0);

}

cbuffer g_MaterialPS_CB : register(b1)
{

  struct
  {
    float4 fs_layer0_diffuse;
    float4 fs_layer1_diffuse;
    float4 fs_layer2_diffuse;
    float4 fs_layer3_diffuse;
    float4 fs_specular_specular;
    float4 fs_specular2_specular;
    float4 fs_specular_params;
    float4 fs_surface_params;
    float4 fs_surface_params2;
    float4 fs_incandescentGlow;
    float4 fs_rimLightColour;
    float4 fs_fresnel_params;
    float4 fs_ambientColor;
    float4 fs_envmap_params;
    float4 fs_diffenv_params;
    float4 fs_refraction_color;
    float4 fs_refraction_kIndex;
    float4 fs_lego_params;
    float4 fs_vtf_kNormal;
    float4 fs_carpaint_params;
    float4 fs_brdf_params;
    float4 fs_fractal_params;
    float4 fs_carpaint_tints0;
    float4 fs_carpaint_tints1;
    float4 fs_specular4_specular;
    float4 fs_perLayerUVScale;
    float4 fs_specular3_specular;
    float4 fs_lego_brdf_fudge;
  } g_MaterialPS : packoffset(c0);

}

cbuffer g_MiscGroupPS_CB : register(b2)
{

  struct
  {
    float4 fs_fog_color;
    float4 fs_liveCubemapReflectionPlane;
    float4 fs_envRotation0;
    float4 fs_envRotation1;
    float4 fs_envRotation2;
    float4 fs_exposure;
    float4 fs_screenSize;
    float4 fs_time;
    float4 fs_exposure2;
    float4 fs_fog_color2;
    float4 fs_per_pixel_fade_pos;
    float4 fs_per_pixel_fade_col;
    float4 fs_per_pixel_fade_rot;
    float4 fs_fog_params1;
    float4 fs_fog_params2;
    float4 fs_fog_params3;
    float4 fs_fog_params4;
    float4 fs_fog_params5;
  } g_MiscGroupPS : packoffset(c0);

}

cbuffer g_Light_CB : register(b3)
{

  struct
  {
    float4 posDirRadius;
    float4 color;
    float4 params1;
    float4 params2;
    float4 params3;
    float4 projectedTexCoordUAxis;
    float4 projectedTexCoordVAxis;
    float4 fadeColor;
    row_major float4x4 spotViewProj;
  } g_Light : packoffset(c0);

}

cbuffer g_ShadowCommon_CB : register(b4)
{

  struct
  {
    float4 shadowFactors;
    float4 lightDirPos;
    float4 params;
  } g_ShadowCommon : packoffset(c0);

}

cbuffer g_ShadowSpot_CB : register(b5)
{

  struct
  {
    row_major float4x4 eye2shadowMapUVMtx;
    float4 params;
    float4 light2UVScaleOffset;
    float4 softShadowParams;
    float4 softShadowParams1;
  } g_ShadowSpot : packoffset(c0);

}

SamplerState layer0_sampler_ss_s : register(s5);
SamplerState g_AttenuationTex_ss_s : register(s12);
SamplerState g_ProjectedTex_ss_s : register(s13);
SamplerComparisonState g_ShadowMapTexPCF_ss_s : register(s15);
Texture2D<float4> layer0_sampler : register(t5);
Texture2D<float4> g_AttenuationTex : register(t12);
Texture2D<float4> g_ProjectedTex : register(t13);
Texture2D<float4> g_ShadowMapTexPCF : register(t15);


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


void main(
  float4 v0 : SV_Position0,
  float4 v1 : TEXCOORD0,
  float4 v2 : TEXCOORD1,
  float4 v3 : TEXCOORD2,
  float v4 : COLOR0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = -g_ShadowCommon.shadowFactors.y + v2.w;
  r0.x = saturate(g_ShadowCommon.shadowFactors.z * r0.x);
  r0.x = 1 + -r0.x;
  r0.yz = g_CameraPS.fs_inverse_projection_xy.zw * v2.ww;
  r1.xy = v3.wz * g_CameraPS.fs_inverse_projection_xy.xy + r0.yz;
  
  float4 stereo = StereoParams.Load(0);
  r1.x -= stereo.x * (v2.w - stereo.y) * g_CameraPS.fs_inverse_projection_xy.x;
  
  r2.xyzw = g_Light.spotViewProj._m10_m11_m12_m13 * r1.yyyy;
  r2.xyzw = r1.xxxx * g_Light.spotViewProj._m00_m01_m02_m03 + r2.xyzw;
  r2.xyzw = v2.wwww * g_Light.spotViewProj._m20_m21_m22_m23 + r2.xyzw;
  r2.xyzw = g_Light.spotViewProj._m30_m31_m32_m33 + r2.xyzw;
  r0.yzw = r2.xyz / r2.www;
  r1.w = -g_Light.color.w + r2.w;
  r2.x = g_Light.params1.z * r1.w;
  r3.xy = r0.yz * g_ShadowSpot.light2UVScaleOffset.xy + g_ShadowSpot.light2UVScaleOffset.zw;
  r1.w = -g_ShadowSpot.params.w + r3.y;
  r1.w = cmp(0.125 < abs(r1.w));
  r1.w = r1.w ? 0 : 1;
  r3.z = r0.w;
  r3.xyw = r3.xyz * r1.www;
  r0.w = g_ShadowCommon.shadowFactors.w * r3.w;
  r2.zw = float2(8192,2048) * r3.yx;
  r0.w = min(0.99000001, r0.w);
  r3.xy = floor(r2.wz);
  r2.zw = frac(r2.zw);
  r3.xy = float2(0.00048828125,0.000122070313) * r3.xy;
  r4.xyzw = g_ShadowMapTexPCF.GatherCmp(g_ShadowMapTexPCF_ss_s, r3.xy, r0.w, int2(0,0)).xyzw;
  r3.xy = float2(1,1) + -r2.wz;
  r5.xz = r3.xy * r2.zw;
  r5.w = r3.x * r3.y;
  r5.y = r2.w * r2.z;
  r0.w = dot(r4.xyzw, r5.xyzw);
  r0.w = g_ShadowCommon.shadowFactors.x * r0.w;
  r0.x = -r0.w * r0.x + 1;
  r2.zw = r0.yz * float2(0.5,-0.5) + float2(0.5,0.5);
  r4.xyzw = g_ProjectedTex.Sample(g_ProjectedTex_ss_s, r2.zw).xyzw;
  r4.xyzw = float4(-1,-1,-1,-1) + r4.xyzw;
  r4.xyzw = g_Light.params3.zzzz * r4.xyzw + float4(1,1,1,1);
  r0.w = dot(r0.yz, r0.yz);
  r0.w = 1 + -r0.w;
  r0.w = max(0, r0.w);
  r1.w = r4.w + -r0.w;
  r0.w = g_Light.params3.z * r1.w + r0.w;
  r0.x = r0.x * r0.w;
  r0.w = cmp(0 < r3.z);
  r0.w = r0.w ? 1.000000 : 0;
  r0.x = r0.x * r0.w;
  r0.w = cmp(r3.z < 1);
  r0.yz = cmp(abs(r0.yz) < float2(1,1));
  r0.yzw = r0.yzw ? float3(1,1,1) : 0;
  r0.x = r0.x * r0.w;
  r0.x = r0.x * r0.y;
  r0.x = r0.x * r0.z;
  r2.y = g_Light.params3.w;
  r0.yzw = g_AttenuationTex.Sample(g_AttenuationTex_ss_s, r2.xy).xyz;
  r1.w = cmp(r2.x < 1);
  r1.w = r1.w ? 1.000000 : 0;
  r0.yzw = r1.www * r0.yzw;
  r0.yzw = g_Light.posDirRadius.www * r0.yzw;
  r0.xyz = r0.xxx * r0.yzw;
  r0.xyz = r0.xyz * r4.xyz;
  r0.xyz = g_Light.color.xyz * r0.xyz;
  r0.xyz = r0.xyz * r0.xyz;
  r1.z = v2.w;
  r1.xyz = g_Light.posDirRadius.xyz + -r1.xyz;
  r0.w = dot(r1.xyz, r1.xyz);
  r0.w = rsqrt(r0.w);
  r1.xyz = r1.xyz * r0.www;
  r0.w = dot(-v2.xyz, -v2.xyz);
  r0.w = rsqrt(r0.w);
  r2.xyz = -v2.xyz * r0.www;
  r0.w = dot(v1.xyz, v1.xyz);
  r0.w = rsqrt(r0.w);
  r3.xyz = v1.xyz * r0.www;
  r0.w = dot(r3.xyz, r2.xyz);
  r1.w = r0.w + r0.w;
  r0.w = saturate(1 + -r0.w);
  r2.xyz = r3.xyz * -r1.www + r2.xyz;
  r1.w = dot(r1.xyz, r3.xyz);
  r1.x = saturate(dot(-r2.xyz, r1.xyz));
  r1.x = log2(r1.x);
  r1.x = g_MaterialPS.fs_specular_params.x * r1.x;
  r1.x = exp2(r1.x);
  r1.x = g_MaterialPS.fs_specular_params.w * r1.x;
  r1.y = max(0, r1.w);
  r1.z = g_Light.params1.x * r1.y;
  r2.xyz = r0.xyz * r1.yyy + float3(0.00100000005,0.00100000005,0.00100000005);
  r1.x = r1.x * r1.z;
  r0.xyz = r1.xxx * r0.xyz;
  r1.x = r0.w * r0.w;
  r1.x = r1.x * r1.x;
  r0.w = r1.x * r0.w;
  r1.x = 1 + -g_MaterialPS.fs_fresnel_params.y;
  r0.w = r1.x * r0.w + g_MaterialPS.fs_fresnel_params.y;
  r1.x = 1 + -g_MaterialPS.fs_specular_params.z;
  r1.y = r1.x * r0.w;
  r0.w = -r0.w * r1.x + 1;
  r1.x = saturate(g_MaterialPS.fs_specular_specular.x * r1.y);
  r0.xyz = r1.xxx * r0.xyz;
  r1.x = 1 + -g_MaterialPS.fs_brdf_params.y;
  r0.w = r1.x * r0.w + g_MaterialPS.fs_brdf_params.y;
  r1.xyzw = layer0_sampler.Sample(layer0_sampler_ss_s, v3.xy).xyzw;
  r1.xyzw = g_MaterialPS.fs_layer0_diffuse.xyzw * r1.xyzw;
  r1.xyz = r1.xyz * r1.xyz;
  r1.w = saturate(v4.x * r1.w);
  r1.xyz = r1.xyz * r0.www;
  r0.xyz = r1.xyz * r2.xyz + r0.xyz;
  r0.xyz = v1.www * r0.xyz;
  r0.xyz = g_MiscGroupPS.fs_exposure.yyy * r0.xyz;
  o0.xyz = r0.xyz * r1.www;
  o0.w = 1;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.3.11 on Thu May 24 22:33:01 2018
//
//
// Buffer Definitions:
//
// cbuffer g_CameraPS_CB
// {
//
//   struct CameraPS
//   {
//
//       float4 fs_projection_params;   // Offset:    0
//       float4 fs_inverse_projection_xy;// Offset:   16
//       float4 fs_customPixelClipPlane;// Offset:   32
//       float4 fs_viewportScaleBias;   // Offset:   48
//
//   } g_CameraPS;                      // Offset:    0 Size:    64
//
// }
//
// cbuffer g_MaterialPS_CB
// {
//
//   struct MaterialPS
//   {
//
//       float4 fs_layer0_diffuse;      // Offset:    0
//       float4 fs_layer1_diffuse;      // Offset:   16
//       float4 fs_layer2_diffuse;      // Offset:   32
//       float4 fs_layer3_diffuse;      // Offset:   48
//       float4 fs_specular_specular;   // Offset:   64
//       float4 fs_specular2_specular;  // Offset:   80
//       float4 fs_specular_params;     // Offset:   96
//       float4 fs_surface_params;      // Offset:  112
//       float4 fs_surface_params2;     // Offset:  128
//       float4 fs_incandescentGlow;    // Offset:  144
//       float4 fs_rimLightColour;      // Offset:  160
//       float4 fs_fresnel_params;      // Offset:  176
//       float4 fs_ambientColor;        // Offset:  192
//       float4 fs_envmap_params;       // Offset:  208
//       float4 fs_diffenv_params;      // Offset:  224
//       float4 fs_refraction_color;    // Offset:  240
//       float4 fs_refraction_kIndex;   // Offset:  256
//       float4 fs_lego_params;         // Offset:  272
//       float4 fs_vtf_kNormal;         // Offset:  288
//       float4 fs_carpaint_params;     // Offset:  304
//       float4 fs_brdf_params;         // Offset:  320
//       float4 fs_fractal_params;      // Offset:  336
//       float4 fs_carpaint_tints0;     // Offset:  352
//       float4 fs_carpaint_tints1;     // Offset:  368
//       float4 fs_specular4_specular;  // Offset:  384
//       float4 fs_perLayerUVScale;     // Offset:  400
//       float4 fs_specular3_specular;  // Offset:  416
//       float4 fs_lego_brdf_fudge;     // Offset:  432
//
//   } g_MaterialPS;                    // Offset:    0 Size:   448
//
// }
//
// cbuffer g_MiscGroupPS_CB
// {
//
//   struct MiscGroupPS
//   {
//
//       float4 fs_fog_color;           // Offset:    0
//       float4 fs_liveCubemapReflectionPlane;// Offset:   16
//       float4 fs_envRotation0;        // Offset:   32
//       float4 fs_envRotation1;        // Offset:   48
//       float4 fs_envRotation2;        // Offset:   64
//       float4 fs_exposure;            // Offset:   80
//       float4 fs_screenSize;          // Offset:   96
//       float4 fs_time;                // Offset:  112
//       float4 fs_exposure2;           // Offset:  128
//       float4 fs_fog_color2;          // Offset:  144
//       float4 fs_per_pixel_fade_pos;  // Offset:  160
//       float4 fs_per_pixel_fade_col;  // Offset:  176
//       float4 fs_per_pixel_fade_rot;  // Offset:  192
//       float4 fs_fog_params1;         // Offset:  208
//       float4 fs_fog_params2;         // Offset:  224
//       float4 fs_fog_params3;         // Offset:  240
//       float4 fs_fog_params4;         // Offset:  256
//       float4 fs_fog_params5;         // Offset:  272
//
//   } g_MiscGroupPS;                   // Offset:    0 Size:   288
//
// }
//
// cbuffer g_Light_CB
// {
//
//   struct Light
//   {
//
//       float4 posDirRadius;           // Offset:    0
//       float4 color;                  // Offset:   16
//       float4 params1;                // Offset:   32
//       float4 params2;                // Offset:   48
//       float4 params3;                // Offset:   64
//       float4 projectedTexCoordUAxis; // Offset:   80
//       float4 projectedTexCoordVAxis; // Offset:   96
//       float4 fadeColor;              // Offset:  112
//       row_major float4x4 spotViewProj;// Offset:  128
//
//   } g_Light;                         // Offset:    0 Size:   192
//
// }
//
// cbuffer g_ShadowCommon_CB
// {
//
//   struct ShadowCommon
//   {
//
//       float4 shadowFactors;          // Offset:    0
//       float4 lightDirPos;            // Offset:   16
//       float4 params;                 // Offset:   32
//
//   } g_ShadowCommon;                  // Offset:    0 Size:    48
//
// }
//
// cbuffer g_ShadowSpot_CB
// {
//
//   struct ShadowSpot
//   {
//
//       row_major float4x4 eye2shadowMapUVMtx;// Offset:    0
//       float4 params;                 // Offset:   64
//       float4 light2UVScaleOffset;    // Offset:   80
//       float4 softShadowParams;       // Offset:   96
//       float4 softShadowParams1;      // Offset:  112
//
//   } g_ShadowSpot;                    // Offset:    0 Size:   128
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// layer0_sampler_ss                 sampler      NA          NA    5        1
// g_AttenuationTex_ss               sampler      NA          NA   12        1
// g_ProjectedTex_ss                 sampler      NA          NA   13        1
// g_ShadowMapTexPCF_ss            sampler_c      NA          NA   15        1
// layer0_sampler                    texture  float4          2d    5        1
// g_AttenuationTex                  texture  float4          2d   12        1
// g_ProjectedTex                    texture  float4          2d   13        1
// g_ShadowMapTexPCF                 texture  float4          2d   15        1
// g_CameraPS_CB                     cbuffer      NA          NA    0        1
// g_MaterialPS_CB                   cbuffer      NA          NA    1        1
// g_MiscGroupPS_CB                  cbuffer      NA          NA    2        1
// g_Light_CB                        cbuffer      NA          NA    3        1
// g_ShadowCommon_CB                 cbuffer      NA          NA    4        1
// g_ShadowSpot_CB                   cbuffer      NA          NA    5        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyzw        3     NONE   float   xyzw
// COLOR                    0   x           4     NONE   float   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[2], immediateIndexed
dcl_constantbuffer cb1[21], immediateIndexed
dcl_constantbuffer cb2[6], immediateIndexed
dcl_constantbuffer cb3[12], immediateIndexed
dcl_constantbuffer cb4[1], immediateIndexed
dcl_constantbuffer cb5[6], immediateIndexed
dcl_sampler s5, mode_default
dcl_sampler s12, mode_default
dcl_sampler s13, mode_default
dcl_sampler s15, mode_comparison
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t12
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t15
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_temps 6
add r0.x, v2.w, -cb4[0].y
mul_sat r0.x, r0.x, cb4[0].z
add r0.x, -r0.x, l(1.000000)
mul r0.yz, v2.wwww, cb0[1].zzwz
mad r1.xy, v3.wzww, cb0[1].xyxx, r0.yzyy
mul r2.xyzw, r1.yyyy, cb3[9].xyzw
mad r2.xyzw, r1.xxxx, cb3[8].xyzw, r2.xyzw
mad r2.xyzw, v2.wwww, cb3[10].xyzw, r2.xyzw
add r2.xyzw, r2.xyzw, cb3[11].xyzw
div r0.yzw, r2.xxyz, r2.wwww
add r1.w, r2.w, -cb3[1].w
mul r2.x, r1.w, cb3[2].z
mad r3.xy, r0.yzyy, cb5[5].xyxx, cb5[5].zwzz
add r1.w, r3.y, -cb5[4].w
lt r1.w, l(0.125000), |r1.w|
movc r1.w, r1.w, l(0), l(1.000000)
mov r3.z, r0.w
mul r3.xyw, r1.wwww, r3.xyxz
mul r0.w, r3.w, cb4[0].w
mul r2.zw, r3.yyyx, l(0.000000, 0.000000, 8192.000000, 2048.000000)
min r0.w, r0.w, l(0.990000)
round_ni r3.xy, r2.wzww
frc r2.zw, r2.zzzw
mul r3.xy, r3.xyxx, l(0.000488281250, 0.000122070313, 0.000000, 0.000000)
gather4_c_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r4.xyzw, r3.xyxx, t15.xyzw, s15.x, r0.w
add r3.xy, -r2.wzww, l(1.000000, 1.000000, 0.000000, 0.000000)
mul r5.xz, r2.zzwz, r3.xxyx
mul r5.w, r3.y, r3.x
mul r5.y, r2.z, r2.w
dp4 r0.w, r4.xyzw, r5.xyzw
mul r0.w, r0.w, cb4[0].x
mad r0.x, -r0.w, r0.x, l(1.000000)
mad r2.zw, r0.yyyz, l(0.000000, 0.000000, 0.500000, -0.500000), l(0.000000, 0.000000, 0.500000, 0.500000)
sample_indexable(texture2d)(float,float,float,float) r4.xyzw, r2.zwzz, t13.xyzw, s13
add r4.xyzw, r4.xyzw, l(-1.000000, -1.000000, -1.000000, -1.000000)
mad r4.xyzw, cb3[4].zzzz, r4.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
dp2 r0.w, r0.yzyy, r0.yzyy
add r0.w, -r0.w, l(1.000000)
max r0.w, r0.w, l(0.000000)
add r1.w, -r0.w, r4.w
mad r0.w, cb3[4].z, r1.w, r0.w
mul r0.x, r0.w, r0.x
lt r0.w, l(0.000000), r3.z
and r0.w, r0.w, l(0x3f800000)
mul r0.x, r0.w, r0.x
lt r0.w, r3.z, l(1.000000)
lt r0.yz, |r0.yyzy|, l(0.000000, 1.000000, 1.000000, 0.000000)
and r0.yzw, r0.yyzw, l(0, 0x3f800000, 0x3f800000, 0x3f800000)
mul r0.x, r0.w, r0.x
mul r0.x, r0.y, r0.x
mul r0.x, r0.z, r0.x
mov r2.y, cb3[4].w
sample_indexable(texture2d)(float,float,float,float) r0.yzw, r2.xyxx, t12.wxyz, s12
lt r1.w, r2.x, l(1.000000)
and r1.w, r1.w, l(0x3f800000)
mul r0.yzw, r0.yyzw, r1.wwww
mul r0.yzw, r0.yyzw, cb3[0].wwww
mul r0.xyz, r0.yzwy, r0.xxxx
mul r0.xyz, r4.xyzx, r0.xyzx
mul r0.xyz, r0.xyzx, cb3[1].xyzx
mul r0.xyz, r0.xyzx, r0.xyzx
mov r1.z, v2.w
add r1.xyz, -r1.xyzx, cb3[0].xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
dp3 r0.w, -v2.xyzx, -v2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, -v2.xyzx
dp3 r0.w, v1.xyzx, v1.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, v1.xyzx
dp3 r0.w, r3.xyzx, r2.xyzx
add r1.w, r0.w, r0.w
add_sat r0.w, -r0.w, l(1.000000)
mad r2.xyz, r3.xyzx, -r1.wwww, r2.xyzx
dp3 r1.w, r1.xyzx, r3.xyzx
dp3_sat r1.x, -r2.xyzx, r1.xyzx
log r1.x, r1.x
mul r1.x, r1.x, cb1[6].x
exp r1.x, r1.x
mul r1.x, r1.x, cb1[6].w
max r1.y, r1.w, l(0.000000)
mul r1.z, r1.y, cb3[2].x
mad r2.xyz, r0.xyzx, r1.yyyy, l(0.001000, 0.001000, 0.001000, 0.000000)
mul r1.x, r1.z, r1.x
mul r0.xyz, r0.xyzx, r1.xxxx
mul r1.x, r0.w, r0.w
mul r1.x, r1.x, r1.x
mul r0.w, r0.w, r1.x
add r1.x, -cb1[11].y, l(1.000000)
mad r0.w, r1.x, r0.w, cb1[11].y
add r1.x, -cb1[6].z, l(1.000000)
mul r1.y, r0.w, r1.x
mad r0.w, -r0.w, r1.x, l(1.000000)
mul_sat r1.x, r1.y, cb1[4].x
mul r0.xyz, r0.xyzx, r1.xxxx
add r1.x, -cb1[20].y, l(1.000000)
mad r0.w, r1.x, r0.w, cb1[20].y
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, v3.xyxx, t5.xyzw, s5
mul r1.xyzw, r1.xyzw, cb1[0].xyzw
mul r1.xyz, r1.xyzx, r1.xyzx
mul_sat r1.w, r1.w, v4.x
mul r1.xyz, r0.wwww, r1.xyzx
mad r0.xyz, r1.xyzx, r2.xyzx, r0.xyzx
mul r0.xyz, r0.xyzx, v1.wwww
mul r0.xyz, r0.xyzx, cb2[5].yyyy
mul o0.xyz, r1.wwww, r0.xyzx
mov o0.w, l(1.000000)
ret
// Approximately 110 instruction slots used

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