// ---- Created with 3Dmigoto v1.2.39 on Sat Jun 25 10:26:07 2016

cbuffer _Globals : register(b0)
{
  float4x4 LocalToWorld : packoffset(c0);
  float4x4 ScreenToWorldMatrix : packoffset(c4);
  float TwoSidedSign : packoffset(c8);
  bool bDecompressSceneColor : packoffset(c8.y);
  float4 PackedParameters : packoffset(c9);
  float4 MinMaxBlurClamp : packoffset(c10);
  float4 LightColorAndFalloffExponent : packoffset(c11);
  float3 DistanceFieldParameters : packoffset(c12);
  float4x4 ScreenToShadowMatrix : packoffset(c13);
  float4 ShadowBufferAndTexelSize : packoffset(c17);
  float ShadowOverrideFactor : packoffset(c18);
  float SSSMultiplier : packoffset(c18.y);
  bool bReceiveDynamicShadows : packoffset(c18.z);
  bool bEnableDistanceShadowFading : packoffset(c18.w);
  float2 DistanceFadeParameters : packoffset(c19);
  float4 IBLPositionAndWeight0 : packoffset(c20);
  float4 IBLPositionAndWeight1 : packoffset(c21);
  float4 IBLPositionAndWeight2 : packoffset(c22);
  float4 IBLPositionAndWeight3 : packoffset(c23);
  float4x4 IBLProxyOBB0 : packoffset(c24);
  float4x4 IBLProxyOBB1 : packoffset(c28);
  float4x4 IBLProxyOBB2 : packoffset(c32);
  float4 IBLUseProxyVolume : packoffset(c36);
  float4x4 IBLLastProxyOBB0 : packoffset(c37);
  float4x4 IBLLastProxyOBB1 : packoffset(c41);
  float4x4 IBLLastProxyOBB2 : packoffset(c45);
  float4 IBLUseLastProxyVolume : packoffset(c49);
  float ForcedIBLWeight : packoffset(c50);
  float AdditionalReflections : packoffset(c50.y);
  float4x4 InvViewProjectionMatrix : packoffset(c51);
  float3 CameraWorldPos : packoffset(c55);
  float3 ActorWorldPos : packoffset(c56);
  float4 ObjectWorldPositionAndRadius : packoffset(c57);
  float3 ObjectOrientation : packoffset(c58);
  float3 ObjectPostProjectionPosition : packoffset(c59);
  float3 ObjectNDCPosition : packoffset(c60);
  float4 ObjectMacroUVScales : packoffset(c61);
  float3 FoliageImpulseDirection : packoffset(c62);
  float4 FoliageNormalizedRotationAxisAndAngle : packoffset(c63);
  float4 WindDirectionAndSpeed : packoffset(c64);
  float3 FogVolumeDensityParameters : packoffset(c65);
  float4 FogVolumeHalfspaceParameters : packoffset(c66);
  float3 ApproxFogColor : packoffset(c67);
  float3 FogVolumeBoxMin : packoffset(c68);
  float3 FogVolumeBoxMax : packoffset(c69);
  float3x3 LocalToWorldMatrix : packoffset(c70);
  float3x3 WorldToLocalMatrix : packoffset(c73);
  float3x3 WorldToViewMatrix : packoffset(c76);
  float3x3 ViewToWorldMatrix : packoffset(c79);
  float4 UniformPixelVector_0 : packoffset(c82);
  float4 UniformPixelVector_1 : packoffset(c83);
  float4 UniformPixelVector_2 : packoffset(c84);
  float4 UniformPixelVector_3 : packoffset(c85);
  float4 UniformPixelVector_4 : packoffset(c86);
  float4 UniformPixelVector_5 : packoffset(c87);
  float4 UniformPixelScalars_0 : packoffset(c88);
  float4 UniformPixelScalars_1 : packoffset(c89);
  float4 UniformPixelScalars_2 : packoffset(c90);
  float3 TemporalAAParameters : packoffset(c91);
  float4x4 PreviousLocalToWorld : packoffset(c92);
  float LocalToWorldRotDeterminantFlip : packoffset(c96);
  float3x3 WorldToLocal : packoffset(c97);
  float4 LightmapCoordinateScaleBias : packoffset(c100);
  float4 ShadowmapCoordinateScaleBias : packoffset(c101);
  float SubSurfaceQuality : packoffset(c102);
  float4 DeferredRenderingParameters : packoffset(c103);
  float2 TemporalAAParametersPS : packoffset(c104);
  float3 SpotDirection : packoffset(c105);
  float2 SpotAngles : packoffset(c106);
  float3 UpperSkyColor : packoffset(c107);
  float3 LowerSkyColor : packoffset(c108);
  float UseOnlyLightMapSpecular : packoffset(c108.w);
  float4 AmbientColorAndSkyFactor : packoffset(c109);
  float4 LightMapScale[2] : packoffset(c110);
  float EmissiveMultiplier : packoffset(c112);
  float DiffuseMultiplier : packoffset(c112.y);
}

cbuffer VSOffsetConstants : register(b1)
{
  float4x4 ViewProjectionMatrix : packoffset(c0);
  float4 CameraPositionVS : packoffset(c4);
  float4 PreViewTranslation : packoffset(c5);
}

cbuffer PSOffsetConstants : register(b2)
{
  float4 ScreenPositionScaleBias : packoffset(c0);
  float4 MinZ_MaxZRatio : packoffset(c1);
  float NvStereoEnabled : packoffset(c2);
  float4 DiffuseOverrideParameter : packoffset(c3);
  float4 SpecularOverrideParameter : packoffset(c4);
  float4 CameraPositionPS : packoffset(c5);
  float4 ScreenAndTexelSize : packoffset(c6);
}

SamplerState LightMapTexturesSampler_0__s : register(s0);
SamplerState LightMapTexturesSampler_1__s : register(s1);
SamplerState SceneColorTextureSampler_s : register(s2);
SamplerState AmbientReflectionCubemapSampler_s : register(s3);
SamplerState ForcedIBLCubemapSampler_s : register(s4);
SamplerState PixelTexture2D_0Sampler_s : register(s5);
SamplerState PixelTexture2D_1Sampler_s : register(s6);
SamplerState PixelTexture2D_2Sampler_s : register(s7);
Texture2D<float4> SceneColorTexture : register(t0);
TextureCube<float4> AmbientReflectionCubemap : register(t1);
TextureCube<float4> ForcedIBLCubemap : register(t2);
Texture2D<float4> PixelTexture2D_0 : register(t3);
Texture2D<float4> PixelTexture2D_1 : register(t4);
Texture2D<float4> PixelTexture2D_2 : register(t5);
Texture2D<float4> LightMapTextures_0_ : register(t6);
Texture2D<float4> LightMapTextures_1_ : register(t7);


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


void main( 
  linear centroid float4 v0 : TEXCOORD10,
  linear centroid float4 v1 : TEXCOORD11,
  float4 v2 : COLOR0,
  float4 v3 : TEXCOORD0,
  float4 v4 : TEXCOORD1,
  float4 v5 : TEXCOORD4,
  float4 v6 : TEXCOORD6,
  float4 v7 : TEXCOORD7,
  float4 v8 : TEXCOORD5,
  uint v9 : SV_IsFrontFace0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = dot(v1.xyz, v1.xyz);
  r0.x = rsqrt(r0.x);
  r0.xyz = v1.xyz * r0.xxx;
  r0.w = dot(v0.xyz, v0.xyz);
  r0.w = rsqrt(r0.w);
  r1.xyz = v0.xyz * r0.www;
  r2.xyz = r1.yzx * r0.zxy;
  r2.xyz = r0.yzx * r1.zxy + -r2.xyz;
  r2.xyz = v1.www * r2.xyz;
  r3.xyz = CameraWorldPos.xyz + v8.xyz;
  r4.xyz = ViewProjectionMatrix._m01_m11_m31 * v8.yyy;
  r4.xyz = ViewProjectionMatrix._m00_m10_m30 * v8.xxx + r4.xyz;
  r4.xyz = ViewProjectionMatrix._m02_m12_m32 * v8.zzz + r4.xyz;
  r4.xyz = ViewProjectionMatrix._m03_m13_m33 * v8.www + r4.xyz;

float4 stereo = StereoParams.Load(0);
r4.x += stereo.x*(r4.z - stereo.y);

  r0.w = dot(v6.xyz, v6.xyz);
  r0.w = rsqrt(r0.w);
  r5.xyz = v6.xyz * r0.www;
  r6.xy = UniformPixelVector_1.xy * v4.xy;
  r7.xy = PixelTexture2D_0.SampleBias(PixelTexture2D_0Sampler_s, r6.xy, 0).xy;
  r0.w = dot(r7.xy, r7.xy);
  r0.w = min(1, r0.w);
  r0.w = 1 + -r0.w;
  r7.z = sqrt(r0.w);
  r7.xyz = r7.xyz * UniformPixelVector_3.xyz + float3(0,0,9.99999975e-005);
  r0.w = dot(r7.xyz, r7.xyz);
  r0.w = sqrt(r0.w);
  r7.xyz = r7.xyz / r0.www;
  r0.w = dot(r7.xyz, r7.xyz);
  r0.w = rsqrt(r0.w);
  r7.xyz = r7.xyz * r0.www;
  r8.xyz = float3(1,1,1) + -UniformPixelVector_0.xyz;
  r9.xyzw = PixelTexture2D_1.SampleBias(PixelTexture2D_1Sampler_s, v4.xy, 0).xyzw;
  r9.xyz = max(float3(9.99999997e-007,9.99999997e-007,9.99999997e-007), abs(r9.xyz));
  r9.xyz = log2(r9.xyz);
  r9.xyz = UniformPixelScalars_1.xxx * r9.xyz;
  r9.xyz = exp2(r9.xyz);
  r6.xyzw = PixelTexture2D_2.SampleBias(PixelTexture2D_2Sampler_s, r6.xy, 0).xyzw;
  r6.xyz = UniformPixelVector_4.xyz * r6.xyz;
  r6.xyz = r9.xyz * r6.xyz;
  r8.xyz = r6.xyz * r8.xyz;
  r8.xyz = r8.xyz * DiffuseOverrideParameter.www + DiffuseOverrideParameter.xyz;
  r9.xyz = DiffuseMultiplier * r8.xyz;
  r0.w = saturate(r6.w * UniformPixelVector_4.w + UniformPixelScalars_0.w);
  r0.w = r9.w * r0.w;
  r4.xy = r4.xy / r4.zz;
  r4.xy = r4.xy * ScreenPositionScaleBias.xy + ScreenPositionScaleBias.wz;
  r4.xyz = SceneColorTexture.Sample(SceneColorTextureSampler_s, r4.xy).xyz;
  r4.xyz = r6.xyz * r4.xyz;
  r4.xyz = r0.www * r4.xyz + UniformPixelVector_0.xyz;
  r6.xyz = UniformPixelScalars_1.yyy * SpecularOverrideParameter.www + SpecularOverrideParameter.xyz;
  r0.w = UniformPixelScalars_2.z + -UniformPixelScalars_2.x;
  r0.w = UniformPixelScalars_2.y * r0.w + UniformPixelScalars_2.x;
  r6.yzw = float3(0.0799999982,0.0799999982,0.0799999982) * r6.xyz;
  r8.xyz = r8.xyz * DiffuseMultiplier + -r6.yzw;
  r6.yzw = UniformPixelScalars_2.www * r8.xyz + r6.yzw;
  r1.w = saturate(r6.x + r6.x);
  r1.w = -1 + r1.w;
  r1.w = UniformPixelScalars_2.w * r1.w + 1;
  r6.xyz = r6.yzw * r1.www;
  r8.xyz = -r9.xyz * UniformPixelScalars_2.www + r9.xyz;
  r9.x = saturate(dot(r7.yz, float2(0.816496611,0.577350259)));
  r9.y = saturate(dot(r7.xyz, float3(-0.707106769,-0.408248305,0.577350259)));
  r9.z = saturate(dot(r7.yzx, float3(-0.408248305,0.577350259,0.707106769)));
  r9.xyz = r9.xyz * r9.xyz;
  r10.xyz = LightMapTextures_0_.Sample(LightMapTexturesSampler_0__s, v3.xy).xyz;
  r10.xyz = LightMapScale[0].xyz * r10.xyz;
  r11.xyz = LightMapTextures_1_.Sample(LightMapTexturesSampler_1__s, v3.xy).xyz;
  r11.xyz = LightMapScale[1].xyz * r11.xyz;
  r1.w = dot(r11.xyz, r9.xyz);
  r9.xyz = r10.xyz * r1.www;
  r10.xyz = r9.xyz * r8.xyz;
  r4.xyz = r4.xyz * EmissiveMultiplier + r10.xyz;
  r1.w = dot(r9.xyz, float3(0.300000012,0.589999974,0.109999999));
  r2.w = dot(v8.xyz, v8.xyz);
  r2.w = rsqrt(r2.w);
  r9.xyz = v8.xyz * r2.www;
  r1.x = dot(r1.xyz, r7.xyz);
  r1.y = dot(r2.xyz, r7.xyz);
  r1.z = dot(r0.xyz, r7.xyz);
  r0.x = dot(r9.xyz, r1.xyz);
  r0.x = r0.x + r0.x;
  r0.xyz = r1.xyz * -r0.xxx + r9.xyz;
  r1.x = log2(r0.w);
  r1.x = -r1.x * 1.20000005 + 1;
  r1.x = 6 + -r1.x;
  r2.xyz = cmp(float3(0,0,0) != IBLUseProxyVolume.xyz);
  r1.y = (int)r2.y | (int)r2.x;
  r1.y = (int)r2.z | (int)r1.y;
  if (r1.y != 0) {
    r1.z = cmp(0 != IBLPositionAndWeight0.w);
    if (r1.z != 0) {
      r9.xyz = IBLProxyOBB0._m01_m11_m21 * r0.yyy;
      r9.xyz = IBLProxyOBB0._m00_m10_m20 * r0.xxx + r9.xyz;
      r9.xyz = IBLProxyOBB0._m02_m12_m22 * r0.zzz + r9.xyz;
      r10.xyz = IBLProxyOBB0._m01_m11_m21 * r3.yyy;
      r10.xyz = IBLProxyOBB0._m00_m10_m20 * r3.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB0._m02_m12_m22 * r3.zzz + r10.xyz;
      r10.xyz = IBLProxyOBB0._m03_m13_m23 + r10.xyz;
      r11.xyz = float3(1,1,1) + -r10.xyz;
      r11.xyz = r11.xyz / r9.xyz;
      r10.xyz = float3(-1,-1,-1) + -r10.xyz;
      r9.xyz = r10.xyz / r9.xyz;
      r9.xyz = max(r11.xyz, r9.xyz);
      r1.z = min(r9.y, r9.z);
      r1.z = min(r9.x, r1.z);
      r1.z = r2.x ? r1.z : 0;
      r9.xyz = IBLProxyOBB1._m01_m11_m21 * r0.yyy;
      r9.xyz = IBLProxyOBB1._m00_m10_m20 * r0.xxx + r9.xyz;
      r9.xyz = IBLProxyOBB1._m02_m12_m22 * r0.zzz + r9.xyz;
      r10.xyz = IBLProxyOBB1._m01_m11_m21 * r3.yyy;
      r10.xyz = IBLProxyOBB1._m00_m10_m20 * r3.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB1._m02_m12_m22 * r3.zzz + r10.xyz;
      r10.xyz = IBLProxyOBB1._m03_m13_m23 + r10.xyz;
      r11.xyz = float3(1,1,1) + -r10.xyz;
      r11.xyz = r11.xyz / r9.xyz;
      r10.xyz = float3(-1,-1,-1) + -r10.xyz;
      r9.xyz = r10.xyz / r9.xyz;
      r9.xyz = max(r11.xyz, r9.xyz);
      r2.w = min(r9.y, r9.z);
      r2.w = min(r9.x, r2.w);
      r2.w = r2.y ? r2.w : 0;
      r9.xyz = IBLProxyOBB2._m01_m11_m21 * r0.yyy;
      r9.xyz = IBLProxyOBB2._m00_m10_m20 * r0.xxx + r9.xyz;
      r9.xyz = IBLProxyOBB2._m02_m12_m22 * r0.zzz + r9.xyz;
      r10.xyz = IBLProxyOBB2._m01_m11_m21 * r3.yyy;
      r10.xyz = IBLProxyOBB2._m00_m10_m20 * r3.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB2._m02_m12_m22 * r3.zzz + r10.xyz;
      r10.xyz = IBLProxyOBB2._m03_m13_m23 + r10.xyz;
      r11.xyz = float3(1,1,1) + -r10.xyz;
      r11.xyz = r11.xyz / r9.xyz;
      r10.xyz = float3(-1,-1,-1) + -r10.xyz;
      r9.xyz = r10.xyz / r9.xyz;
      r9.xyz = max(r11.xyz, r9.xyz);
      r3.w = min(r9.y, r9.z);
      r3.w = min(r9.x, r3.w);
      r3.w = r2.z ? r3.w : 0;
      r1.z = max(r2.w, r1.z);
      r1.z = max(r1.z, r3.w);
      r9.xyz = r0.xyz * r1.zzz + r3.xyz;
      r9.xyz = -IBLPositionAndWeight0.xyz + r9.xyz;
      r9.xyz = r1.yyy ? r9.xyz : r0.xyz;
      r1.z = dot(r9.xyz, r9.xyz);
      r1.z = rsqrt(r1.z);
      r9.xyz = r9.xyz * r1.zzz;
      r9.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r9.xyz, r1.x).xyz;
      r1.z = cmp(0 != IBLUseLastProxyVolume.w);
      if (r1.z != 0) {
        r10.xyz = cmp(float3(0,0,0) != IBLUseLastProxyVolume.xyz);
        r1.z = (int)r10.y | (int)r10.x;
        r1.z = (int)r10.z | (int)r1.z;
        r11.xyz = IBLLastProxyOBB0._m01_m11_m21 * r0.yyy;
        r11.xyz = IBLLastProxyOBB0._m00_m10_m20 * r0.xxx + r11.xyz;
        r11.xyz = IBLLastProxyOBB0._m02_m12_m22 * r0.zzz + r11.xyz;
        r12.xyz = IBLLastProxyOBB0._m01_m11_m21 * r3.yyy;
        r12.xyz = IBLLastProxyOBB0._m00_m10_m20 * r3.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB0._m02_m12_m22 * r3.zzz + r12.xyz;
        r12.xyz = IBLLastProxyOBB0._m03_m13_m23 + r12.xyz;
        r13.xyz = float3(1,1,1) + -r12.xyz;
        r13.xyz = r13.xyz / r11.xyz;
        r12.xyz = float3(-1,-1,-1) + -r12.xyz;
        r11.xyz = r12.xyz / r11.xyz;
        r11.xyz = max(r13.xyz, r11.xyz);
        r2.w = min(r11.y, r11.z);
        r2.w = min(r11.x, r2.w);
        r2.w = r10.x ? r2.w : 0;
        r11.xyz = IBLLastProxyOBB1._m01_m11_m21 * r0.yyy;
        r11.xyz = IBLLastProxyOBB1._m00_m10_m20 * r0.xxx + r11.xyz;
        r11.xyz = IBLLastProxyOBB1._m02_m12_m22 * r0.zzz + r11.xyz;
        r12.xyz = IBLLastProxyOBB1._m01_m11_m21 * r3.yyy;
        r12.xyz = IBLLastProxyOBB1._m00_m10_m20 * r3.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB1._m02_m12_m22 * r3.zzz + r12.xyz;
        r12.xyz = IBLLastProxyOBB1._m03_m13_m23 + r12.xyz;
        r13.xyz = float3(1,1,1) + -r12.xyz;
        r13.xyz = r13.xyz / r11.xyz;
        r12.xyz = float3(-1,-1,-1) + -r12.xyz;
        r11.xyz = r12.xyz / r11.xyz;
        r11.xyz = max(r13.xyz, r11.xyz);
        r3.w = min(r11.y, r11.z);
        r3.w = min(r11.x, r3.w);
        r3.w = r10.y ? r3.w : 0;
        r10.xyw = IBLLastProxyOBB2._m01_m11_m21 * r0.yyy;
        r10.xyw = IBLLastProxyOBB2._m00_m10_m20 * r0.xxx + r10.xyw;
        r10.xyw = IBLLastProxyOBB2._m02_m12_m22 * r0.zzz + r10.xyw;
        r11.xyz = IBLLastProxyOBB2._m01_m11_m21 * r3.yyy;
        r11.xyz = IBLLastProxyOBB2._m00_m10_m20 * r3.xxx + r11.xyz;
        r11.xyz = IBLLastProxyOBB2._m02_m12_m22 * r3.zzz + r11.xyz;
        r11.xyz = IBLLastProxyOBB2._m03_m13_m23 + r11.xyz;
        r12.xyz = float3(1,1,1) + -r11.xyz;
        r12.xyz = r12.xyz / r10.xyw;
        r11.xyz = float3(-1,-1,-1) + -r11.xyz;
        r10.xyw = r11.xyz / r10.xyw;
        r10.xyw = max(r12.xyz, r10.xyw);
        r4.w = min(r10.y, r10.w);
        r4.w = min(r10.x, r4.w);
        r4.w = r10.z ? r4.w : 0;
        r2.w = max(r3.w, r2.w);
        r2.w = max(r2.w, r4.w);
        r10.xyz = r0.xyz * r2.www + r3.xyz;
        r10.xyz = -IBLPositionAndWeight0.xyz + r10.xyz;
        r10.xyz = r1.zzz ? r10.xyz : r0.xyz;
        r1.z = dot(r10.xyz, r10.xyz);
        r1.z = rsqrt(r1.z);
        r10.xyz = r10.xyz * r1.zzz;
        r10.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r10.xyz, r1.x).xyz;
        r10.xyz = r10.xyz + -r9.xyz;
        r9.xyz = IBLUseLastProxyVolume.www * r10.xyz + r9.xyz;
      }
      r9.xyz = IBLPositionAndWeight0.www * r9.xyz;
    } else {
      r9.xyz = float3(0,0,0);
    }
    r1.z = cmp(0 != IBLPositionAndWeight1.w);
    if (r1.z != 0) {
      r10.xyz = IBLProxyOBB0._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB0._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB0._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB0._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB0._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB0._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB0._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r1.z = min(r10.y, r10.z);
      r1.z = min(r10.x, r1.z);
      r1.z = r2.x ? r1.z : 0;
      r10.xyz = IBLProxyOBB1._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB1._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB1._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB1._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB1._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB1._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB1._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r2.w = min(r10.y, r10.z);
      r2.w = min(r10.x, r2.w);
      r2.w = r2.y ? r2.w : 0;
      r10.xyz = IBLProxyOBB2._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB2._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB2._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB2._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB2._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB2._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB2._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r3.w = min(r10.y, r10.z);
      r3.w = min(r10.x, r3.w);
      r3.w = r2.z ? r3.w : 0;
      r1.z = max(r2.w, r1.z);
      r1.z = max(r1.z, r3.w);
      r10.xyz = r0.xyz * r1.zzz + r3.xyz;
      r10.xyz = -IBLPositionAndWeight1.xyz + r10.xyz;
      r10.xyz = r1.yyy ? r10.xyz : r0.xyz;
      r1.z = dot(r10.xyz, r10.xyz);
      r1.z = rsqrt(r1.z);
      r10.xyz = r10.xyz * r1.zzz;
      r10.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r10.xyz, r1.x).xyz;
      r1.z = cmp(0 != IBLUseLastProxyVolume.w);
      if (r1.z != 0) {
        r11.xyz = cmp(float3(0,0,0) != IBLUseLastProxyVolume.xyz);
        r1.z = (int)r11.y | (int)r11.x;
        r1.z = (int)r11.z | (int)r1.z;
        r12.xyz = IBLLastProxyOBB0._m01_m11_m21 * r0.yyy;
        r12.xyz = IBLLastProxyOBB0._m00_m10_m20 * r0.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB0._m02_m12_m22 * r0.zzz + r12.xyz;
        r13.xyz = IBLLastProxyOBB0._m01_m11_m21 * r3.yyy;
        r13.xyz = IBLLastProxyOBB0._m00_m10_m20 * r3.xxx + r13.xyz;
        r13.xyz = IBLLastProxyOBB0._m02_m12_m22 * r3.zzz + r13.xyz;
        r13.xyz = IBLLastProxyOBB0._m03_m13_m23 + r13.xyz;
        r14.xyz = float3(1,1,1) + -r13.xyz;
        r14.xyz = r14.xyz / r12.xyz;
        r13.xyz = float3(-1,-1,-1) + -r13.xyz;
        r12.xyz = r13.xyz / r12.xyz;
        r12.xyz = max(r14.xyz, r12.xyz);
        r2.w = min(r12.y, r12.z);
        r2.w = min(r12.x, r2.w);
        r2.w = r11.x ? r2.w : 0;
        r12.xyz = IBLLastProxyOBB1._m01_m11_m21 * r0.yyy;
        r12.xyz = IBLLastProxyOBB1._m00_m10_m20 * r0.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB1._m02_m12_m22 * r0.zzz + r12.xyz;
        r13.xyz = IBLLastProxyOBB1._m01_m11_m21 * r3.yyy;
        r13.xyz = IBLLastProxyOBB1._m00_m10_m20 * r3.xxx + r13.xyz;
        r13.xyz = IBLLastProxyOBB1._m02_m12_m22 * r3.zzz + r13.xyz;
        r13.xyz = IBLLastProxyOBB1._m03_m13_m23 + r13.xyz;
        r14.xyz = float3(1,1,1) + -r13.xyz;
        r14.xyz = r14.xyz / r12.xyz;
        r13.xyz = float3(-1,-1,-1) + -r13.xyz;
        r12.xyz = r13.xyz / r12.xyz;
        r12.xyz = max(r14.xyz, r12.xyz);
        r3.w = min(r12.y, r12.z);
        r3.w = min(r12.x, r3.w);
        r3.w = r11.y ? r3.w : 0;
        r11.xyw = IBLLastProxyOBB2._m01_m11_m21 * r0.yyy;
        r11.xyw = IBLLastProxyOBB2._m00_m10_m20 * r0.xxx + r11.xyw;
        r11.xyw = IBLLastProxyOBB2._m02_m12_m22 * r0.zzz + r11.xyw;
        r12.xyz = IBLLastProxyOBB2._m01_m11_m21 * r3.yyy;
        r12.xyz = IBLLastProxyOBB2._m00_m10_m20 * r3.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB2._m02_m12_m22 * r3.zzz + r12.xyz;
        r12.xyz = IBLLastProxyOBB2._m03_m13_m23 + r12.xyz;
        r13.xyz = float3(1,1,1) + -r12.xyz;
        r13.xyz = r13.xyz / r11.xyw;
        r12.xyz = float3(-1,-1,-1) + -r12.xyz;
        r11.xyw = r12.xyz / r11.xyw;
        r11.xyw = max(r13.xyz, r11.xyw);
        r4.w = min(r11.y, r11.w);
        r4.w = min(r11.x, r4.w);
        r4.w = r11.z ? r4.w : 0;
        r2.w = max(r3.w, r2.w);
        r2.w = max(r2.w, r4.w);
        r11.xyz = r0.xyz * r2.www + r3.xyz;
        r11.xyz = -IBLPositionAndWeight1.xyz + r11.xyz;
        r11.xyz = r1.zzz ? r11.xyz : r0.xyz;
        r1.z = dot(r11.xyz, r11.xyz);
        r1.z = rsqrt(r1.z);
        r11.xyz = r11.xyz * r1.zzz;
        r11.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r11.xyz, r1.x).xyz;
        r11.xyz = r11.xyz + -r10.xyz;
        r10.xyz = IBLUseLastProxyVolume.www * r11.xyz + r10.xyz;
      }
      r9.xyz = r10.xyz * IBLPositionAndWeight1.www + r9.xyz;
    }
    r1.z = cmp(0 != IBLPositionAndWeight2.w);
    if (r1.z != 0) {
      r10.xyz = IBLProxyOBB0._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB0._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB0._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB0._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB0._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB0._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB0._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r1.z = min(r10.y, r10.z);
      r1.z = min(r10.x, r1.z);
      r1.z = r2.x ? r1.z : 0;
      r10.xyz = IBLProxyOBB1._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB1._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB1._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB1._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB1._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB1._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB1._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r2.w = min(r10.y, r10.z);
      r2.w = min(r10.x, r2.w);
      r2.w = r2.y ? r2.w : 0;
      r10.xyz = IBLProxyOBB2._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB2._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB2._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB2._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB2._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB2._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB2._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r3.w = min(r10.y, r10.z);
      r3.w = min(r10.x, r3.w);
      r3.w = r2.z ? r3.w : 0;
      r1.z = max(r2.w, r1.z);
      r1.z = max(r1.z, r3.w);
      r10.xyz = r0.xyz * r1.zzz + r3.xyz;
      r10.xyz = -IBLPositionAndWeight2.xyz + r10.xyz;
      r10.xyz = r1.yyy ? r10.xyz : r0.xyz;
      r1.z = dot(r10.xyz, r10.xyz);
      r1.z = rsqrt(r1.z);
      r10.xyz = r10.xyz * r1.zzz;
      r10.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r10.xyz, r1.x).xyz;
      r1.z = cmp(0 != IBLUseLastProxyVolume.w);
      if (r1.z != 0) {
        r11.xyz = cmp(float3(0,0,0) != IBLUseLastProxyVolume.xyz);
        r1.z = (int)r11.y | (int)r11.x;
        r1.z = (int)r11.z | (int)r1.z;
        r12.xyz = IBLLastProxyOBB0._m01_m11_m21 * r0.yyy;
        r12.xyz = IBLLastProxyOBB0._m00_m10_m20 * r0.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB0._m02_m12_m22 * r0.zzz + r12.xyz;
        r13.xyz = IBLLastProxyOBB0._m01_m11_m21 * r3.yyy;
        r13.xyz = IBLLastProxyOBB0._m00_m10_m20 * r3.xxx + r13.xyz;
        r13.xyz = IBLLastProxyOBB0._m02_m12_m22 * r3.zzz + r13.xyz;
        r13.xyz = IBLLastProxyOBB0._m03_m13_m23 + r13.xyz;
        r14.xyz = float3(1,1,1) + -r13.xyz;
        r14.xyz = r14.xyz / r12.xyz;
        r13.xyz = float3(-1,-1,-1) + -r13.xyz;
        r12.xyz = r13.xyz / r12.xyz;
        r12.xyz = max(r14.xyz, r12.xyz);
        r2.w = min(r12.y, r12.z);
        r2.w = min(r12.x, r2.w);
        r2.w = r11.x ? r2.w : 0;
        r12.xyz = IBLLastProxyOBB1._m01_m11_m21 * r0.yyy;
        r12.xyz = IBLLastProxyOBB1._m00_m10_m20 * r0.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB1._m02_m12_m22 * r0.zzz + r12.xyz;
        r13.xyz = IBLLastProxyOBB1._m01_m11_m21 * r3.yyy;
        r13.xyz = IBLLastProxyOBB1._m00_m10_m20 * r3.xxx + r13.xyz;
        r13.xyz = IBLLastProxyOBB1._m02_m12_m22 * r3.zzz + r13.xyz;
        r13.xyz = IBLLastProxyOBB1._m03_m13_m23 + r13.xyz;
        r14.xyz = float3(1,1,1) + -r13.xyz;
        r14.xyz = r14.xyz / r12.xyz;
        r13.xyz = float3(-1,-1,-1) + -r13.xyz;
        r12.xyz = r13.xyz / r12.xyz;
        r12.xyz = max(r14.xyz, r12.xyz);
        r3.w = min(r12.y, r12.z);
        r3.w = min(r12.x, r3.w);
        r3.w = r11.y ? r3.w : 0;
        r11.xyw = IBLLastProxyOBB2._m01_m11_m21 * r0.yyy;
        r11.xyw = IBLLastProxyOBB2._m00_m10_m20 * r0.xxx + r11.xyw;
        r11.xyw = IBLLastProxyOBB2._m02_m12_m22 * r0.zzz + r11.xyw;
        r12.xyz = IBLLastProxyOBB2._m01_m11_m21 * r3.yyy;
        r12.xyz = IBLLastProxyOBB2._m00_m10_m20 * r3.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB2._m02_m12_m22 * r3.zzz + r12.xyz;
        r12.xyz = IBLLastProxyOBB2._m03_m13_m23 + r12.xyz;
        r13.xyz = float3(1,1,1) + -r12.xyz;
        r13.xyz = r13.xyz / r11.xyw;
        r12.xyz = float3(-1,-1,-1) + -r12.xyz;
        r11.xyw = r12.xyz / r11.xyw;
        r11.xyw = max(r13.xyz, r11.xyw);
        r4.w = min(r11.y, r11.w);
        r4.w = min(r11.x, r4.w);
        r4.w = r11.z ? r4.w : 0;
        r2.w = max(r3.w, r2.w);
        r2.w = max(r2.w, r4.w);
        r11.xyz = r0.xyz * r2.www + r3.xyz;
        r11.xyz = -IBLPositionAndWeight2.xyz + r11.xyz;
        r11.xyz = r1.zzz ? r11.xyz : r0.xyz;
        r1.z = dot(r11.xyz, r11.xyz);
        r1.z = rsqrt(r1.z);
        r11.xyz = r11.xyz * r1.zzz;
        r11.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r11.xyz, r1.x).xyz;
        r11.xyz = r11.xyz + -r10.xyz;
        r10.xyz = IBLUseLastProxyVolume.www * r11.xyz + r10.xyz;
      }
      r9.xyz = r10.xyz * IBLPositionAndWeight2.www + r9.xyz;
    }
    r1.z = cmp(0 != IBLPositionAndWeight3.w);
    if (r1.z != 0) {
      r10.xyz = IBLProxyOBB0._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB0._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB0._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB0._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB0._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB0._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB0._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r1.z = min(r10.y, r10.z);
      r1.z = min(r10.x, r1.z);
      r1.z = r2.x ? r1.z : 0;
      r10.xyz = IBLProxyOBB1._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB1._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB1._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB1._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB1._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB1._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB1._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r2.x = min(r10.y, r10.z);
      r2.x = min(r10.x, r2.x);
      r2.x = r2.y ? r2.x : 0;
      r10.xyz = IBLProxyOBB2._m01_m11_m21 * r0.yyy;
      r10.xyz = IBLProxyOBB2._m00_m10_m20 * r0.xxx + r10.xyz;
      r10.xyz = IBLProxyOBB2._m02_m12_m22 * r0.zzz + r10.xyz;
      r11.xyz = IBLProxyOBB2._m01_m11_m21 * r3.yyy;
      r11.xyz = IBLProxyOBB2._m00_m10_m20 * r3.xxx + r11.xyz;
      r11.xyz = IBLProxyOBB2._m02_m12_m22 * r3.zzz + r11.xyz;
      r11.xyz = IBLProxyOBB2._m03_m13_m23 + r11.xyz;
      r12.xyz = float3(1,1,1) + -r11.xyz;
      r12.xyz = r12.xyz / r10.xyz;
      r11.xyz = float3(-1,-1,-1) + -r11.xyz;
      r10.xyz = r11.xyz / r10.xyz;
      r10.xyz = max(r12.xyz, r10.xyz);
      r2.y = min(r10.y, r10.z);
      r2.y = min(r10.x, r2.y);
      r2.y = r2.z ? r2.y : 0;
      r1.z = max(r2.x, r1.z);
      r1.z = max(r1.z, r2.y);
      r2.xyz = r0.xyz * r1.zzz + r3.xyz;
      r2.xyz = -IBLPositionAndWeight3.xyz + r2.xyz;
      r2.xyz = r1.yyy ? r2.xyz : r0.xyz;
      r1.y = dot(r2.xyz, r2.xyz);
      r1.y = rsqrt(r1.y);
      r2.xyz = r2.xyz * r1.yyy;
      r2.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r2.xyz, r1.x).xyz;
      r1.y = cmp(0 != IBLUseLastProxyVolume.w);
      if (r1.y != 0) {
        r10.xyz = cmp(float3(0,0,0) != IBLUseLastProxyVolume.xyz);
        r1.y = (int)r10.y | (int)r10.x;
        r1.y = (int)r10.z | (int)r1.y;
        r11.xyz = IBLLastProxyOBB0._m01_m11_m21 * r0.yyy;
        r11.xyz = IBLLastProxyOBB0._m00_m10_m20 * r0.xxx + r11.xyz;
        r11.xyz = IBLLastProxyOBB0._m02_m12_m22 * r0.zzz + r11.xyz;
        r12.xyz = IBLLastProxyOBB0._m01_m11_m21 * r3.yyy;
        r12.xyz = IBLLastProxyOBB0._m00_m10_m20 * r3.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB0._m02_m12_m22 * r3.zzz + r12.xyz;
        r12.xyz = IBLLastProxyOBB0._m03_m13_m23 + r12.xyz;
        r13.xyz = float3(1,1,1) + -r12.xyz;
        r13.xyz = r13.xyz / r11.xyz;
        r12.xyz = float3(-1,-1,-1) + -r12.xyz;
        r11.xyz = r12.xyz / r11.xyz;
        r11.xyz = max(r13.xyz, r11.xyz);
        r1.z = min(r11.y, r11.z);
        r1.z = min(r11.x, r1.z);
        r1.z = r10.x ? r1.z : 0;
        r11.xyz = IBLLastProxyOBB1._m01_m11_m21 * r0.yyy;
        r11.xyz = IBLLastProxyOBB1._m00_m10_m20 * r0.xxx + r11.xyz;
        r11.xyz = IBLLastProxyOBB1._m02_m12_m22 * r0.zzz + r11.xyz;
        r12.xyz = IBLLastProxyOBB1._m01_m11_m21 * r3.yyy;
        r12.xyz = IBLLastProxyOBB1._m00_m10_m20 * r3.xxx + r12.xyz;
        r12.xyz = IBLLastProxyOBB1._m02_m12_m22 * r3.zzz + r12.xyz;
        r12.xyz = IBLLastProxyOBB1._m03_m13_m23 + r12.xyz;
        r13.xyz = float3(1,1,1) + -r12.xyz;
        r13.xyz = r13.xyz / r11.xyz;
        r12.xyz = float3(-1,-1,-1) + -r12.xyz;
        r11.xyz = r12.xyz / r11.xyz;
        r11.xyz = max(r13.xyz, r11.xyz);
        r2.w = min(r11.y, r11.z);
        r2.w = min(r11.x, r2.w);
        r2.w = r10.y ? r2.w : 0;
        r10.xyw = IBLLastProxyOBB2._m01_m11_m21 * r0.yyy;
        r10.xyw = IBLLastProxyOBB2._m00_m10_m20 * r0.xxx + r10.xyw;
        r10.xyw = IBLLastProxyOBB2._m02_m12_m22 * r0.zzz + r10.xyw;
        r11.xyz = IBLLastProxyOBB2._m01_m11_m21 * r3.yyy;
        r11.xyz = IBLLastProxyOBB2._m00_m10_m20 * r3.xxx + r11.xyz;
        r11.xyz = IBLLastProxyOBB2._m02_m12_m22 * r3.zzz + r11.xyz;
        r11.xyz = IBLLastProxyOBB2._m03_m13_m23 + r11.xyz;
        r12.xyz = float3(1,1,1) + -r11.xyz;
        r12.xyz = r12.xyz / r10.xyw;
        r11.xyz = float3(-1,-1,-1) + -r11.xyz;
        r10.xyw = r11.xyz / r10.xyw;
        r10.xyw = max(r12.xyz, r10.xyw);
        r3.w = min(r10.y, r10.w);
        r3.w = min(r10.x, r3.w);
        r3.w = r10.z ? r3.w : 0;
        r1.z = max(r2.w, r1.z);
        r1.z = max(r1.z, r3.w);
        r10.xyz = r0.xyz * r1.zzz + r3.xyz;
        r10.xyz = -IBLPositionAndWeight3.xyz + r10.xyz;
        r10.xyz = r1.yyy ? r10.xyz : r0.xyz;
        r1.y = dot(r10.xyz, r10.xyz);
        r1.y = rsqrt(r1.y);
        r10.xyz = r10.xyz * r1.yyy;
        r10.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r10.xyz, r1.x).xyz;
        r10.xyz = r10.xyz + -r2.xyz;
        r2.xyz = IBLUseLastProxyVolume.www * r10.xyz + r2.xyz;
      }
      r9.xyz = r2.xyz * IBLPositionAndWeight3.www + r9.xyz;
    }
  } else {
    r9.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r0.xyz, r1.x).xyz;
    r1.y = cmp(0 != IBLUseLastProxyVolume.w);
    if (r1.y != 0) {
      r1.y = cmp(0 != IBLPositionAndWeight0.w);
      if (r1.y != 0) {
        r1.y = dot(r0.xyz, r0.xyz);
        r1.y = rsqrt(r1.y);
        r2.xyz = r1.yyy * r0.xyz;
        r2.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r2.xyz, r1.x).xyz;
        r1.y = cmp(0 != IBLUseLastProxyVolume.w);
        if (r1.y != 0) {
          r10.xyz = cmp(float3(0,0,0) != IBLUseLastProxyVolume.xyz);
          r1.y = (int)r10.y | (int)r10.x;
          r1.y = (int)r10.z | (int)r1.y;
          r11.xyz = IBLLastProxyOBB0._m01_m11_m21 * r0.yyy;
          r11.xyz = IBLLastProxyOBB0._m00_m10_m20 * r0.xxx + r11.xyz;
          r11.xyz = IBLLastProxyOBB0._m02_m12_m22 * r0.zzz + r11.xyz;
          r12.xyz = IBLLastProxyOBB0._m01_m11_m21 * r3.yyy;
          r12.xyz = IBLLastProxyOBB0._m00_m10_m20 * r3.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB0._m02_m12_m22 * r3.zzz + r12.xyz;
          r12.xyz = IBLLastProxyOBB0._m03_m13_m23 + r12.xyz;
          r13.xyz = float3(1,1,1) + -r12.xyz;
          r13.xyz = r13.xyz / r11.xyz;
          r12.xyz = float3(-1,-1,-1) + -r12.xyz;
          r11.xyz = r12.xyz / r11.xyz;
          r11.xyz = max(r13.xyz, r11.xyz);
          r1.z = min(r11.y, r11.z);
          r1.z = min(r11.x, r1.z);
          r1.z = r10.x ? r1.z : 0;
          r11.xyz = IBLLastProxyOBB1._m01_m11_m21 * r0.yyy;
          r11.xyz = IBLLastProxyOBB1._m00_m10_m20 * r0.xxx + r11.xyz;
          r11.xyz = IBLLastProxyOBB1._m02_m12_m22 * r0.zzz + r11.xyz;
          r12.xyz = IBLLastProxyOBB1._m01_m11_m21 * r3.yyy;
          r12.xyz = IBLLastProxyOBB1._m00_m10_m20 * r3.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB1._m02_m12_m22 * r3.zzz + r12.xyz;
          r12.xyz = IBLLastProxyOBB1._m03_m13_m23 + r12.xyz;
          r13.xyz = float3(1,1,1) + -r12.xyz;
          r13.xyz = r13.xyz / r11.xyz;
          r12.xyz = float3(-1,-1,-1) + -r12.xyz;
          r11.xyz = r12.xyz / r11.xyz;
          r11.xyz = max(r13.xyz, r11.xyz);
          r2.w = min(r11.y, r11.z);
          r2.w = min(r11.x, r2.w);
          r2.w = r10.y ? r2.w : 0;
          r10.xyw = IBLLastProxyOBB2._m01_m11_m21 * r0.yyy;
          r10.xyw = IBLLastProxyOBB2._m00_m10_m20 * r0.xxx + r10.xyw;
          r10.xyw = IBLLastProxyOBB2._m02_m12_m22 * r0.zzz + r10.xyw;
          r11.xyz = IBLLastProxyOBB2._m01_m11_m21 * r3.yyy;
          r11.xyz = IBLLastProxyOBB2._m00_m10_m20 * r3.xxx + r11.xyz;
          r11.xyz = IBLLastProxyOBB2._m02_m12_m22 * r3.zzz + r11.xyz;
          r11.xyz = IBLLastProxyOBB2._m03_m13_m23 + r11.xyz;
          r12.xyz = float3(1,1,1) + -r11.xyz;
          r12.xyz = r12.xyz / r10.xyw;
          r11.xyz = float3(-1,-1,-1) + -r11.xyz;
          r10.xyw = r11.xyz / r10.xyw;
          r10.xyw = max(r12.xyz, r10.xyw);
          r3.w = min(r10.y, r10.w);
          r3.w = min(r10.x, r3.w);
          r3.w = r10.z ? r3.w : 0;
          r1.z = max(r2.w, r1.z);
          r1.z = max(r1.z, r3.w);
          r10.xyz = r0.xyz * r1.zzz + r3.xyz;
          r10.xyz = -IBLPositionAndWeight0.xyz + r10.xyz;
          r10.xyz = r1.yyy ? r10.xyz : r0.xyz;
          r1.y = dot(r10.xyz, r10.xyz);
          r1.y = rsqrt(r1.y);
          r10.xyz = r10.xyz * r1.yyy;
          r10.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r10.xyz, r1.x).xyz;
          r10.xyz = r10.xyz + -r2.xyz;
          r2.xyz = IBLUseLastProxyVolume.www * r10.xyz + r2.xyz;
        }
        r2.xyz = IBLPositionAndWeight0.www * r2.xyz;
      } else {
        r2.xyz = float3(0,0,0);
      }
      r1.y = cmp(0 != IBLPositionAndWeight1.w);
      if (r1.y != 0) {
        r1.y = dot(r0.xyz, r0.xyz);
        r1.y = rsqrt(r1.y);
        r10.xyz = r1.yyy * r0.xyz;
        r10.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r10.xyz, r1.x).xyz;
        r1.y = cmp(0 != IBLUseLastProxyVolume.w);
        if (r1.y != 0) {
          r11.xyz = cmp(float3(0,0,0) != IBLUseLastProxyVolume.xyz);
          r1.y = (int)r11.y | (int)r11.x;
          r1.y = (int)r11.z | (int)r1.y;
          r12.xyz = IBLLastProxyOBB0._m01_m11_m21 * r0.yyy;
          r12.xyz = IBLLastProxyOBB0._m00_m10_m20 * r0.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB0._m02_m12_m22 * r0.zzz + r12.xyz;
          r13.xyz = IBLLastProxyOBB0._m01_m11_m21 * r3.yyy;
          r13.xyz = IBLLastProxyOBB0._m00_m10_m20 * r3.xxx + r13.xyz;
          r13.xyz = IBLLastProxyOBB0._m02_m12_m22 * r3.zzz + r13.xyz;
          r13.xyz = IBLLastProxyOBB0._m03_m13_m23 + r13.xyz;
          r14.xyz = float3(1,1,1) + -r13.xyz;
          r14.xyz = r14.xyz / r12.xyz;
          r13.xyz = float3(-1,-1,-1) + -r13.xyz;
          r12.xyz = r13.xyz / r12.xyz;
          r12.xyz = max(r14.xyz, r12.xyz);
          r1.z = min(r12.y, r12.z);
          r1.z = min(r12.x, r1.z);
          r1.z = r11.x ? r1.z : 0;
          r12.xyz = IBLLastProxyOBB1._m01_m11_m21 * r0.yyy;
          r12.xyz = IBLLastProxyOBB1._m00_m10_m20 * r0.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB1._m02_m12_m22 * r0.zzz + r12.xyz;
          r13.xyz = IBLLastProxyOBB1._m01_m11_m21 * r3.yyy;
          r13.xyz = IBLLastProxyOBB1._m00_m10_m20 * r3.xxx + r13.xyz;
          r13.xyz = IBLLastProxyOBB1._m02_m12_m22 * r3.zzz + r13.xyz;
          r13.xyz = IBLLastProxyOBB1._m03_m13_m23 + r13.xyz;
          r14.xyz = float3(1,1,1) + -r13.xyz;
          r14.xyz = r14.xyz / r12.xyz;
          r13.xyz = float3(-1,-1,-1) + -r13.xyz;
          r12.xyz = r13.xyz / r12.xyz;
          r12.xyz = max(r14.xyz, r12.xyz);
          r2.w = min(r12.y, r12.z);
          r2.w = min(r12.x, r2.w);
          r2.w = r11.y ? r2.w : 0;
          r11.xyw = IBLLastProxyOBB2._m01_m11_m21 * r0.yyy;
          r11.xyw = IBLLastProxyOBB2._m00_m10_m20 * r0.xxx + r11.xyw;
          r11.xyw = IBLLastProxyOBB2._m02_m12_m22 * r0.zzz + r11.xyw;
          r12.xyz = IBLLastProxyOBB2._m01_m11_m21 * r3.yyy;
          r12.xyz = IBLLastProxyOBB2._m00_m10_m20 * r3.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB2._m02_m12_m22 * r3.zzz + r12.xyz;
          r12.xyz = IBLLastProxyOBB2._m03_m13_m23 + r12.xyz;
          r13.xyz = float3(1,1,1) + -r12.xyz;
          r13.xyz = r13.xyz / r11.xyw;
          r12.xyz = float3(-1,-1,-1) + -r12.xyz;
          r11.xyw = r12.xyz / r11.xyw;
          r11.xyw = max(r13.xyz, r11.xyw);
          r3.w = min(r11.y, r11.w);
          r3.w = min(r11.x, r3.w);
          r3.w = r11.z ? r3.w : 0;
          r1.z = max(r2.w, r1.z);
          r1.z = max(r1.z, r3.w);
          r11.xyz = r0.xyz * r1.zzz + r3.xyz;
          r11.xyz = -IBLPositionAndWeight1.xyz + r11.xyz;
          r11.xyz = r1.yyy ? r11.xyz : r0.xyz;
          r1.y = dot(r11.xyz, r11.xyz);
          r1.y = rsqrt(r1.y);
          r11.xyz = r11.xyz * r1.yyy;
          r11.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r11.xyz, r1.x).xyz;
          r11.xyz = r11.xyz + -r10.xyz;
          r10.xyz = IBLUseLastProxyVolume.www * r11.xyz + r10.xyz;
        }
        r2.xyz = r10.xyz * IBLPositionAndWeight1.www + r2.xyz;
      }
      r1.y = cmp(0 != IBLPositionAndWeight2.w);
      if (r1.y != 0) {
        r1.y = dot(r0.xyz, r0.xyz);
        r1.y = rsqrt(r1.y);
        r10.xyz = r1.yyy * r0.xyz;
        r10.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r10.xyz, r1.x).xyz;
        r1.y = cmp(0 != IBLUseLastProxyVolume.w);
        if (r1.y != 0) {
          r11.xyz = cmp(float3(0,0,0) != IBLUseLastProxyVolume.xyz);
          r1.y = (int)r11.y | (int)r11.x;
          r1.y = (int)r11.z | (int)r1.y;
          r12.xyz = IBLLastProxyOBB0._m01_m11_m21 * r0.yyy;
          r12.xyz = IBLLastProxyOBB0._m00_m10_m20 * r0.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB0._m02_m12_m22 * r0.zzz + r12.xyz;
          r13.xyz = IBLLastProxyOBB0._m01_m11_m21 * r3.yyy;
          r13.xyz = IBLLastProxyOBB0._m00_m10_m20 * r3.xxx + r13.xyz;
          r13.xyz = IBLLastProxyOBB0._m02_m12_m22 * r3.zzz + r13.xyz;
          r13.xyz = IBLLastProxyOBB0._m03_m13_m23 + r13.xyz;
          r14.xyz = float3(1,1,1) + -r13.xyz;
          r14.xyz = r14.xyz / r12.xyz;
          r13.xyz = float3(-1,-1,-1) + -r13.xyz;
          r12.xyz = r13.xyz / r12.xyz;
          r12.xyz = max(r14.xyz, r12.xyz);
          r1.z = min(r12.y, r12.z);
          r1.z = min(r12.x, r1.z);
          r1.z = r11.x ? r1.z : 0;
          r12.xyz = IBLLastProxyOBB1._m01_m11_m21 * r0.yyy;
          r12.xyz = IBLLastProxyOBB1._m00_m10_m20 * r0.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB1._m02_m12_m22 * r0.zzz + r12.xyz;
          r13.xyz = IBLLastProxyOBB1._m01_m11_m21 * r3.yyy;
          r13.xyz = IBLLastProxyOBB1._m00_m10_m20 * r3.xxx + r13.xyz;
          r13.xyz = IBLLastProxyOBB1._m02_m12_m22 * r3.zzz + r13.xyz;
          r13.xyz = IBLLastProxyOBB1._m03_m13_m23 + r13.xyz;
          r14.xyz = float3(1,1,1) + -r13.xyz;
          r14.xyz = r14.xyz / r12.xyz;
          r13.xyz = float3(-1,-1,-1) + -r13.xyz;
          r12.xyz = r13.xyz / r12.xyz;
          r12.xyz = max(r14.xyz, r12.xyz);
          r2.w = min(r12.y, r12.z);
          r2.w = min(r12.x, r2.w);
          r2.w = r11.y ? r2.w : 0;
          r11.xyw = IBLLastProxyOBB2._m01_m11_m21 * r0.yyy;
          r11.xyw = IBLLastProxyOBB2._m00_m10_m20 * r0.xxx + r11.xyw;
          r11.xyw = IBLLastProxyOBB2._m02_m12_m22 * r0.zzz + r11.xyw;
          r12.xyz = IBLLastProxyOBB2._m01_m11_m21 * r3.yyy;
          r12.xyz = IBLLastProxyOBB2._m00_m10_m20 * r3.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB2._m02_m12_m22 * r3.zzz + r12.xyz;
          r12.xyz = IBLLastProxyOBB2._m03_m13_m23 + r12.xyz;
          r13.xyz = float3(1,1,1) + -r12.xyz;
          r13.xyz = r13.xyz / r11.xyw;
          r12.xyz = float3(-1,-1,-1) + -r12.xyz;
          r11.xyw = r12.xyz / r11.xyw;
          r11.xyw = max(r13.xyz, r11.xyw);
          r3.w = min(r11.y, r11.w);
          r3.w = min(r11.x, r3.w);
          r3.w = r11.z ? r3.w : 0;
          r1.z = max(r2.w, r1.z);
          r1.z = max(r1.z, r3.w);
          r11.xyz = r0.xyz * r1.zzz + r3.xyz;
          r11.xyz = -IBLPositionAndWeight2.xyz + r11.xyz;
          r11.xyz = r1.yyy ? r11.xyz : r0.xyz;
          r1.y = dot(r11.xyz, r11.xyz);
          r1.y = rsqrt(r1.y);
          r11.xyz = r11.xyz * r1.yyy;
          r11.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r11.xyz, r1.x).xyz;
          r11.xyz = r11.xyz + -r10.xyz;
          r10.xyz = IBLUseLastProxyVolume.www * r11.xyz + r10.xyz;
        }
        r2.xyz = r10.xyz * IBLPositionAndWeight2.www + r2.xyz;
      }
      r1.y = cmp(0 != IBLPositionAndWeight3.w);
      if (r1.y != 0) {
        r1.y = dot(r0.xyz, r0.xyz);
        r1.y = rsqrt(r1.y);
        r10.xyz = r1.yyy * r0.xyz;
        r10.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r10.xyz, r1.x).xyz;
        r1.y = cmp(0 != IBLUseLastProxyVolume.w);
        if (r1.y != 0) {
          r11.xyz = cmp(float3(0,0,0) != IBLUseLastProxyVolume.xyz);
          r1.y = (int)r11.y | (int)r11.x;
          r1.y = (int)r11.z | (int)r1.y;
          r12.xyz = IBLLastProxyOBB0._m01_m11_m21 * r0.yyy;
          r12.xyz = IBLLastProxyOBB0._m00_m10_m20 * r0.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB0._m02_m12_m22 * r0.zzz + r12.xyz;
          r13.xyz = IBLLastProxyOBB0._m01_m11_m21 * r3.yyy;
          r13.xyz = IBLLastProxyOBB0._m00_m10_m20 * r3.xxx + r13.xyz;
          r13.xyz = IBLLastProxyOBB0._m02_m12_m22 * r3.zzz + r13.xyz;
          r13.xyz = IBLLastProxyOBB0._m03_m13_m23 + r13.xyz;
          r14.xyz = float3(1,1,1) + -r13.xyz;
          r14.xyz = r14.xyz / r12.xyz;
          r13.xyz = float3(-1,-1,-1) + -r13.xyz;
          r12.xyz = r13.xyz / r12.xyz;
          r12.xyz = max(r14.xyz, r12.xyz);
          r1.z = min(r12.y, r12.z);
          r1.z = min(r12.x, r1.z);
          r1.z = r11.x ? r1.z : 0;
          r12.xyz = IBLLastProxyOBB1._m01_m11_m21 * r0.yyy;
          r12.xyz = IBLLastProxyOBB1._m00_m10_m20 * r0.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB1._m02_m12_m22 * r0.zzz + r12.xyz;
          r13.xyz = IBLLastProxyOBB1._m01_m11_m21 * r3.yyy;
          r13.xyz = IBLLastProxyOBB1._m00_m10_m20 * r3.xxx + r13.xyz;
          r13.xyz = IBLLastProxyOBB1._m02_m12_m22 * r3.zzz + r13.xyz;
          r13.xyz = IBLLastProxyOBB1._m03_m13_m23 + r13.xyz;
          r14.xyz = float3(1,1,1) + -r13.xyz;
          r14.xyz = r14.xyz / r12.xyz;
          r13.xyz = float3(-1,-1,-1) + -r13.xyz;
          r12.xyz = r13.xyz / r12.xyz;
          r12.xyz = max(r14.xyz, r12.xyz);
          r2.w = min(r12.y, r12.z);
          r2.w = min(r12.x, r2.w);
          r2.w = r11.y ? r2.w : 0;
          r11.xyw = IBLLastProxyOBB2._m01_m11_m21 * r0.yyy;
          r11.xyw = IBLLastProxyOBB2._m00_m10_m20 * r0.xxx + r11.xyw;
          r11.xyw = IBLLastProxyOBB2._m02_m12_m22 * r0.zzz + r11.xyw;
          r12.xyz = IBLLastProxyOBB2._m01_m11_m21 * r3.yyy;
          r12.xyz = IBLLastProxyOBB2._m00_m10_m20 * r3.xxx + r12.xyz;
          r12.xyz = IBLLastProxyOBB2._m02_m12_m22 * r3.zzz + r12.xyz;
          r12.xyz = IBLLastProxyOBB2._m03_m13_m23 + r12.xyz;
          r13.xyz = float3(1,1,1) + -r12.xyz;
          r13.xyz = r13.xyz / r11.xyw;
          r12.xyz = float3(-1,-1,-1) + -r12.xyz;
          r11.xyw = r12.xyz / r11.xyw;
          r11.xyw = max(r13.xyz, r11.xyw);
          r3.w = min(r11.y, r11.w);
          r3.w = min(r11.x, r3.w);
          r3.w = r11.z ? r3.w : 0;
          r1.z = max(r2.w, r1.z);
          r1.z = max(r1.z, r3.w);
          r3.xyz = r0.xyz * r1.zzz + r3.xyz;
          r3.xyz = -IBLPositionAndWeight3.xyz + r3.xyz;
          r3.xyz = r1.yyy ? r3.xyz : r0.xyz;
          r1.y = dot(r3.xyz, r3.xyz);
          r1.y = rsqrt(r1.y);
          r3.xyz = r3.xyz * r1.yyy;
          r3.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r3.xyz, r1.x).xyz;
          r3.xyz = r3.xyz + -r10.xyz;
          r10.xyz = IBLUseLastProxyVolume.www * r3.xyz + r10.xyz;
        }
        r2.xyz = r10.xyz * IBLPositionAndWeight3.www + r2.xyz;
      }
      r2.xyz = r2.xyz + -r9.xyz;
      r9.xyz = IBLUseLastProxyVolume.www * r2.xyz + r9.xyz;
    }
  }
  r1.y = cmp(0 != ForcedIBLWeight);
  if (r1.y != 0) {
    r2.xyz = ForcedIBLCubemap.SampleLevel(ForcedIBLCubemapSampler_s, r0.xyz, r1.x).xyz;
    r2.xyz = r2.xyz + -r9.xyz;
    r9.xyz = ForcedIBLWeight * r2.xyz + r9.xyz;
  }
  r2.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r0.xyz, 7).xyz;
  r1.y = r2.x + r2.y;
  r1.y = r1.y + r2.z;
  r1.z = 0.333333343 * r1.y;
  r1.y = cmp(0.00300000003 < r1.y);
  r1.z = r1.w / r1.z;
  r1.z = min(1, r1.z);
  r2.xyz = r9.xyz * r1.zzz;
  r1.yzw = r1.yyy ? r2.xyz : r9.xyz;
  r2.x = saturate(dot(r7.xyz, r5.xyz));
  r3.xyzw = r0.wwww * float4(-1,-0.0274999999,-0.572000027,0.0219999999) + float4(1,0.0425000004,1.03999996,-0.0399999991);
  r0.w = r3.x * r3.x;
  r2.x = -9.27999973 * r2.x;
  r2.x = exp2(r2.x);
  r0.w = min(r2.x, r0.w);
  r0.w = r0.w * r3.x + r3.y;
  r2.xy = r0.ww * float2(-1.03999996,1.03999996) + r3.zw;
  r0.w = saturate(50 * r6.y);
  r0.w = r2.y * r0.w;
  r2.xyz = r6.xyz * r2.xxx + r0.www;
  r1.yzw = r1.yzw * r2.xyz + r4.xyz;
  r1.yzw = r8.xyz * AmbientColorAndSkyFactor.xyz + r1.yzw;
  r0.w = cmp(0 < AdditionalReflections);
  if (r0.w != 0) {
    r0.xyz = AmbientReflectionCubemap.SampleLevel(AmbientReflectionCubemapSampler_s, r0.xyz, r1.x).xyz;
    r0.xyz = r0.xyz * r2.xyz;
    r1.yzw = r0.xyz * AdditionalReflections + r1.yzw;
  }
  r0.x = cmp(AdditionalReflections < 0);
  r0.yzw = r1.yzw / -AdditionalReflections;
  r0.xyz = r0.xxx ? r0.yzw : r1.yzw;
  o0.xyz = r0.xyz * v5.www + v5.xyz;
  o0.w = UniformPixelScalars_1.z;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.39 on Sat Jun 25 10:26:07 2016
//
//
// Buffer Definitions: 
//
// cbuffer $Globals
// {
//
//   float4x4 LocalToWorld;             // Offset:    0 Size:    64 [unused]
//   float4x4 ScreenToWorldMatrix;      // Offset:   64 Size:    64 [unused]
//   float TwoSidedSign;                // Offset:  128 Size:     4 [unused]
//   bool bDecompressSceneColor;        // Offset:  132 Size:     4 [unused]
//   float4 PackedParameters;           // Offset:  144 Size:    16 [unused]
//   float4 MinMaxBlurClamp;            // Offset:  160 Size:    16 [unused]
//   float4 LightColorAndFalloffExponent;// Offset:  176 Size:    16 [unused]
//   float3 DistanceFieldParameters;    // Offset:  192 Size:    12 [unused]
//   float4x4 ScreenToShadowMatrix;     // Offset:  208 Size:    64 [unused]
//   float4 ShadowBufferAndTexelSize;   // Offset:  272 Size:    16 [unused]
//   float ShadowOverrideFactor;        // Offset:  288 Size:     4 [unused]
//   float SSSMultiplier;               // Offset:  292 Size:     4 [unused]
//   bool bReceiveDynamicShadows;       // Offset:  296 Size:     4 [unused]
//   bool bEnableDistanceShadowFading;  // Offset:  300 Size:     4 [unused]
//   float2 DistanceFadeParameters;     // Offset:  304 Size:     8 [unused]
//   float4 IBLPositionAndWeight0;      // Offset:  320 Size:    16
//   float4 IBLPositionAndWeight1;      // Offset:  336 Size:    16
//   float4 IBLPositionAndWeight2;      // Offset:  352 Size:    16
//   float4 IBLPositionAndWeight3;      // Offset:  368 Size:    16
//   float4x4 IBLProxyOBB0;             // Offset:  384 Size:    64
//   float4x4 IBLProxyOBB1;             // Offset:  448 Size:    64
//   float4x4 IBLProxyOBB2;             // Offset:  512 Size:    64
//   float4 IBLUseProxyVolume;          // Offset:  576 Size:    16
//   float4x4 IBLLastProxyOBB0;         // Offset:  592 Size:    64
//   float4x4 IBLLastProxyOBB1;         // Offset:  656 Size:    64
//   float4x4 IBLLastProxyOBB2;         // Offset:  720 Size:    64
//   float4 IBLUseLastProxyVolume;      // Offset:  784 Size:    16
//   float ForcedIBLWeight;             // Offset:  800 Size:     4
//   float AdditionalReflections;       // Offset:  804 Size:     4
//   float4x4 InvViewProjectionMatrix;  // Offset:  816 Size:    64 [unused]
//   float3 CameraWorldPos;             // Offset:  880 Size:    12
//   float3 ActorWorldPos;              // Offset:  896 Size:    12 [unused]
//   float4 ObjectWorldPositionAndRadius;// Offset:  912 Size:    16 [unused]
//   float3 ObjectOrientation;          // Offset:  928 Size:    12 [unused]
//   float3 ObjectPostProjectionPosition;// Offset:  944 Size:    12 [unused]
//   float3 ObjectNDCPosition;          // Offset:  960 Size:    12 [unused]
//   float4 ObjectMacroUVScales;        // Offset:  976 Size:    16 [unused]
//   float3 FoliageImpulseDirection;    // Offset:  992 Size:    12 [unused]
//   float4 FoliageNormalizedRotationAxisAndAngle;// Offset: 1008 Size:    16 [unused]
//   float4 WindDirectionAndSpeed;      // Offset: 1024 Size:    16 [unused]
//   float3 FogVolumeDensityParameters; // Offset: 1040 Size:    12 [unused]
//   float4 FogVolumeHalfspaceParameters;// Offset: 1056 Size:    16 [unused]
//   float3 ApproxFogColor;             // Offset: 1072 Size:    12 [unused]
//   float3 FogVolumeBoxMin;            // Offset: 1088 Size:    12 [unused]
//   float3 FogVolumeBoxMax;            // Offset: 1104 Size:    12 [unused]
//   float3x3 LocalToWorldMatrix;       // Offset: 1120 Size:    44 [unused]
//   float3x3 WorldToLocalMatrix;       // Offset: 1168 Size:    44 [unused]
//   float3x3 WorldToViewMatrix;        // Offset: 1216 Size:    44 [unused]
//   float3x3 ViewToWorldMatrix;        // Offset: 1264 Size:    44 [unused]
//   float4 UniformPixelVector_0;       // Offset: 1312 Size:    16
//   float4 UniformPixelVector_1;       // Offset: 1328 Size:    16
//   float4 UniformPixelVector_2;       // Offset: 1344 Size:    16 [unused]
//   float4 UniformPixelVector_3;       // Offset: 1360 Size:    16
//   float4 UniformPixelVector_4;       // Offset: 1376 Size:    16
//   float4 UniformPixelVector_5;       // Offset: 1392 Size:    16 [unused]
//   float4 UniformPixelScalars_0;      // Offset: 1408 Size:    16
//   float4 UniformPixelScalars_1;      // Offset: 1424 Size:    16
//   float4 UniformPixelScalars_2;      // Offset: 1440 Size:    16
//   float3 TemporalAAParameters;       // Offset: 1456 Size:    12 [unused]
//   float4x4 PreviousLocalToWorld;     // Offset: 1472 Size:    64 [unused]
//   float LocalToWorldRotDeterminantFlip;// Offset: 1536 Size:     4 [unused]
//   float3x3 WorldToLocal;             // Offset: 1552 Size:    44 [unused]
//   float4 LightmapCoordinateScaleBias;// Offset: 1600 Size:    16 [unused]
//   float4 ShadowmapCoordinateScaleBias;// Offset: 1616 Size:    16 [unused]
//   float SubSurfaceQuality;           // Offset: 1632 Size:     4 [unused]
//   float4 DeferredRenderingParameters;// Offset: 1648 Size:    16 [unused]
//   float2 TemporalAAParametersPS;     // Offset: 1664 Size:     8 [unused]
//   float3 SpotDirection;              // Offset: 1680 Size:    12 [unused]
//   float2 SpotAngles;                 // Offset: 1696 Size:     8 [unused]
//   float3 UpperSkyColor;              // Offset: 1712 Size:    12 [unused]
//   float3 LowerSkyColor;              // Offset: 1728 Size:    12 [unused]
//   float UseOnlyLightMapSpecular;     // Offset: 1740 Size:     4 [unused]
//   float4 AmbientColorAndSkyFactor;   // Offset: 1744 Size:    16
//   float4 LightMapScale[2];           // Offset: 1760 Size:    32
//   float EmissiveMultiplier;          // Offset: 1792 Size:     4
//   float DiffuseMultiplier;           // Offset: 1796 Size:     4
//
// }
//
// cbuffer VSOffsetConstants
// {
//
//   float4x4 ViewProjectionMatrix;     // Offset:    0 Size:    64
//   float4 CameraPositionVS;           // Offset:   64 Size:    16 [unused]
//   float4 PreViewTranslation;         // Offset:   80 Size:    16 [unused]
//
// }
//
// cbuffer PSOffsetConstants
// {
//
//   float4 ScreenPositionScaleBias;    // Offset:    0 Size:    16
//   float4 MinZ_MaxZRatio;             // Offset:   16 Size:    16 [unused]
//   float NvStereoEnabled;             // Offset:   32 Size:     4 [unused]
//   float4 DiffuseOverrideParameter;   // Offset:   48 Size:    16
//   float4 SpecularOverrideParameter;  // Offset:   64 Size:    16
//   float4 CameraPositionPS;           // Offset:   80 Size:    16 [unused]
//   float4 ScreenAndTexelSize;         // Offset:   96 Size:    16 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// LightMapTexturesSampler[0]        sampler      NA          NA    0        1
// LightMapTexturesSampler[1]        sampler      NA          NA    1        1
// SceneColorTextureSampler          sampler      NA          NA    2        1
// AmbientReflectionCubemapSampler    sampler      NA          NA    3        1
// ForcedIBLCubemapSampler           sampler      NA          NA    4        1
// PixelTexture2D_0Sampler           sampler      NA          NA    5        1
// PixelTexture2D_1Sampler           sampler      NA          NA    6        1
// PixelTexture2D_2Sampler           sampler      NA          NA    7        1
// SceneColorTexture                 texture  float4          2d    0        1
// AmbientReflectionCubemap          texture  float4        cube    1        1
// ForcedIBLCubemap                  texture  float4        cube    2        1
// PixelTexture2D_0                  texture  float4          2d    3        1
// PixelTexture2D_1                  texture  float4          2d    4        1
// PixelTexture2D_2                  texture  float4          2d    5        1
// LightMapTextures[0]               texture  float4          2d    6        1
// LightMapTextures[1]               texture  float4          2d    7        1
// $Globals                          cbuffer      NA          NA    0        1
// VSOffsetConstants                 cbuffer      NA          NA    1        1
// PSOffsetConstants                 cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                10   xyzw        0     NONE   float   xyz 
// TEXCOORD                11   xyzw        1     NONE   float   xyzw
// COLOR                    0   xyzw        2     NONE   float       
// TEXCOORD                 0   xy          3     NONE   float   xy  
// TEXCOORD                 1   xyzw        4     NONE   float   xy  
// TEXCOORD                 4   xyzw        5     NONE   float   xyzw
// TEXCOORD                 6   xyzw        6     NONE   float   xyz 
// TEXCOORD                 7   xyz         7     NONE   float       
// TEXCOORD                 5   xyzw        8     NONE   float   xyzw
// SV_IsFrontFace           0   x           9    FFACE    uint       
//
//
// 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[113], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_sampler s5, mode_default
dcl_sampler s6, mode_default
dcl_sampler s7, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texturecube (float,float,float,float) t1
dcl_resource_texturecube (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t5
dcl_resource_texture2d (float,float,float,float) t6
dcl_resource_texture2d (float,float,float,float) t7
dcl_input_ps linear centroid v0.xyz
dcl_input_ps linear centroid v1.xyzw
dcl_input_ps linear v3.xy
dcl_input_ps linear v4.xy
dcl_input_ps linear v5.xyzw
dcl_input_ps linear v6.xyz
dcl_input_ps linear v8.xyzw
dcl_output o0.xyzw
dcl_temps 15
dp3 r0.x, v1.xyzx, v1.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, v1.xyzx
dp3 r0.w, v0.xyzx, v0.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, v0.xyzx
mul r2.xyz, r0.zxyz, r1.yzxy
mad r2.xyz, r0.yzxy, r1.zxyz, -r2.xyzx
mul r2.xyz, r2.xyzx, v1.wwww
add r3.xyz, v8.xyzx, cb0[55].xyzx
mul r4.xyz, v8.yyyy, cb1[1].xywx
mad r4.xyz, cb1[0].xywx, v8.xxxx, r4.xyzx
mad r4.xyz, cb1[2].xywx, v8.zzzz, r4.xyzx
mad r4.xyz, cb1[3].xywx, v8.wwww, r4.xyzx
dp3 r0.w, v6.xyzx, v6.xyzx
rsq r0.w, r0.w
mul r5.xyz, r0.wwww, v6.xyzx
mul r6.xy, v4.xyxx, cb0[83].xyxx
sample_b_indexable(texture2d)(float,float,float,float) r7.xy, r6.xyxx, t3.xyzw, s5, l(0.000000)
dp2 r0.w, r7.xyxx, r7.xyxx
min r0.w, r0.w, l(1.000000)
add r0.w, -r0.w, l(1.000000)
sqrt r7.z, r0.w
mad r7.xyz, r7.xyzx, cb0[85].xyzx, l(0.000000, 0.000000, 0.000100, 0.000000)
dp3 r0.w, r7.xyzx, r7.xyzx
sqrt r0.w, r0.w
div r7.xyz, r7.xyzx, r0.wwww
dp3 r0.w, r7.xyzx, r7.xyzx
rsq r0.w, r0.w
mul r7.xyz, r0.wwww, r7.xyzx
add r8.xyz, -cb0[82].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
sample_b_indexable(texture2d)(float,float,float,float) r9.xyzw, v4.xyxx, t4.xyzw, s6, l(0.000000)
max r9.xyz, |r9.xyzx|, l(0.000001, 0.000001, 0.000001, 0.000000)
log r9.xyz, r9.xyzx
mul r9.xyz, r9.xyzx, cb0[89].xxxx
exp r9.xyz, r9.xyzx
sample_b_indexable(texture2d)(float,float,float,float) r6.xyzw, r6.xyxx, t5.xyzw, s7, l(0.000000)
mul r6.xyz, r6.xyzx, cb0[86].xyzx
mul r6.xyz, r6.xyzx, r9.xyzx
mul r8.xyz, r8.xyzx, r6.xyzx
mad r8.xyz, r8.xyzx, cb2[3].wwww, cb2[3].xyzx
mul r9.xyz, r8.xyzx, cb0[112].yyyy
mad_sat r0.w, r6.w, cb0[86].w, cb0[88].w
mul r0.w, r0.w, r9.w
div r4.xy, r4.xyxx, r4.zzzz
mad r4.xy, r4.xyxx, cb2[0].xyxx, cb2[0].wzww
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t0.xyzw, s2
mul r4.xyz, r4.xyzx, r6.xyzx
mad r4.xyz, r0.wwww, r4.xyzx, cb0[82].xyzx
mad r6.xyz, cb0[89].yyyy, cb2[4].wwww, cb2[4].xyzx
add r0.w, -cb0[90].x, cb0[90].z
mad r0.w, cb0[90].y, r0.w, cb0[90].x
mul r6.yzw, r6.xxyz, l(0.000000, 0.080000, 0.080000, 0.080000)
mad r8.xyz, r8.xyzx, cb0[112].yyyy, -r6.yzwy
mad r6.yzw, cb0[90].wwww, r8.xxyz, r6.yyzw
add_sat r1.w, r6.x, r6.x
add r1.w, r1.w, l(-1.000000)
mad r1.w, cb0[90].w, r1.w, l(1.000000)
mul r6.xyz, r1.wwww, r6.yzwy
mad r8.xyz, -r9.xyzx, cb0[90].wwww, r9.xyzx
dp2_sat r9.x, r7.yzyy, l(0.816496611, 0.577350259, 0.000000, 0.000000)
dp3_sat r9.y, r7.xyzx, l(-0.707106769, -0.408248305, 0.577350259, 0.000000)
dp3_sat r9.z, r7.yzxy, l(-0.408248305, 0.577350259, 0.707106769, 0.000000)
mul r9.xyz, r9.xyzx, r9.xyzx
sample_indexable(texture2d)(float,float,float,float) r10.xyz, v3.xyxx, t6.xyzw, s0
mul r10.xyz, r10.xyzx, cb0[110].xyzx
sample_indexable(texture2d)(float,float,float,float) r11.xyz, v3.xyxx, t7.xyzw, s1
mul r11.xyz, r11.xyzx, cb0[111].xyzx
dp3 r1.w, r11.xyzx, r9.xyzx
mul r9.xyz, r1.wwww, r10.xyzx
mul r10.xyz, r8.xyzx, r9.xyzx
mad r4.xyz, r4.xyzx, cb0[112].xxxx, r10.xyzx
dp3 r1.w, r9.xyzx, l(0.300000, 0.590000, 0.110000, 0.000000)
dp3 r2.w, v8.xyzx, v8.xyzx
rsq r2.w, r2.w
mul r9.xyz, r2.wwww, v8.xyzx
dp3 r1.x, r1.xyzx, r7.xyzx
dp3 r1.y, r2.xyzx, r7.xyzx
dp3 r1.z, r0.xyzx, r7.xyzx
dp3 r0.x, r9.xyzx, r1.xyzx
add r0.x, r0.x, r0.x
mad r0.xyz, r1.xyzx, -r0.xxxx, r9.xyzx
log r1.x, r0.w
mad r1.x, -r1.x, l(1.200000), l(1.000000)
add r1.x, -r1.x, l(6.000000)
ne r2.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[36].xyzx
or r1.y, r2.y, r2.x
or r1.y, r2.z, r1.y
if_nz r1.y
  ne r1.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[20].w
  if_nz r1.z
    mul r9.xyz, r0.yyyy, cb0[25].xyzx
    mad r9.xyz, cb0[24].xyzx, r0.xxxx, r9.xyzx
    mad r9.xyz, cb0[26].xyzx, r0.zzzz, r9.xyzx
    mul r10.xyz, r3.yyyy, cb0[25].xyzx
    mad r10.xyz, cb0[24].xyzx, r3.xxxx, r10.xyzx
    mad r10.xyz, cb0[26].xyzx, r3.zzzz, r10.xyzx
    add r10.xyz, r10.xyzx, cb0[27].xyzx
    add r11.xyz, -r10.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r11.xyz, r11.xyzx, r9.xyzx
    add r10.xyz, -r10.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r9.xyz, r10.xyzx, r9.xyzx
    max r9.xyz, r9.xyzx, r11.xyzx
    min r1.z, r9.z, r9.y
    min r1.z, r1.z, r9.x
    and r1.z, r1.z, r2.x
    mul r9.xyz, r0.yyyy, cb0[29].xyzx
    mad r9.xyz, cb0[28].xyzx, r0.xxxx, r9.xyzx
    mad r9.xyz, cb0[30].xyzx, r0.zzzz, r9.xyzx
    mul r10.xyz, r3.yyyy, cb0[29].xyzx
    mad r10.xyz, cb0[28].xyzx, r3.xxxx, r10.xyzx
    mad r10.xyz, cb0[30].xyzx, r3.zzzz, r10.xyzx
    add r10.xyz, r10.xyzx, cb0[31].xyzx
    add r11.xyz, -r10.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r11.xyz, r11.xyzx, r9.xyzx
    add r10.xyz, -r10.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r9.xyz, r10.xyzx, r9.xyzx
    max r9.xyz, r9.xyzx, r11.xyzx
    min r2.w, r9.z, r9.y
    min r2.w, r2.w, r9.x
    and r2.w, r2.w, r2.y
    mul r9.xyz, r0.yyyy, cb0[33].xyzx
    mad r9.xyz, cb0[32].xyzx, r0.xxxx, r9.xyzx
    mad r9.xyz, cb0[34].xyzx, r0.zzzz, r9.xyzx
    mul r10.xyz, r3.yyyy, cb0[33].xyzx
    mad r10.xyz, cb0[32].xyzx, r3.xxxx, r10.xyzx
    mad r10.xyz, cb0[34].xyzx, r3.zzzz, r10.xyzx
    add r10.xyz, r10.xyzx, cb0[35].xyzx
    add r11.xyz, -r10.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r11.xyz, r11.xyzx, r9.xyzx
    add r10.xyz, -r10.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r9.xyz, r10.xyzx, r9.xyzx
    max r9.xyz, r9.xyzx, r11.xyzx
    min r3.w, r9.z, r9.y
    min r3.w, r3.w, r9.x
    and r3.w, r2.z, r3.w
    max r1.z, r1.z, r2.w
    max r1.z, r3.w, r1.z
    mad r9.xyz, r0.xyzx, r1.zzzz, r3.xyzx
    add r9.xyz, r9.xyzx, -cb0[20].xyzx
    movc r9.xyz, r1.yyyy, r9.xyzx, r0.xyzx
    dp3 r1.z, r9.xyzx, r9.xyzx
    rsq r1.z, r1.z
    mul r9.xyz, r1.zzzz, r9.xyzx
    sample_l_indexable(texturecube)(float,float,float,float) r9.xyz, r9.xyzx, t1.xyzw, s3, r1.x
    ne r1.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
    if_nz r1.z
      ne r10.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].xyzx
      or r1.z, r10.y, r10.x
      or r1.z, r10.z, r1.z
      mul r11.xyz, r0.yyyy, cb0[38].xyzx
      mad r11.xyz, cb0[37].xyzx, r0.xxxx, r11.xyzx
      mad r11.xyz, cb0[39].xyzx, r0.zzzz, r11.xyzx
      mul r12.xyz, r3.yyyy, cb0[38].xyzx
      mad r12.xyz, cb0[37].xyzx, r3.xxxx, r12.xyzx
      mad r12.xyz, cb0[39].xyzx, r3.zzzz, r12.xyzx
      add r12.xyz, r12.xyzx, cb0[40].xyzx
      add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r13.xyz, r13.xyzx, r11.xyzx
      add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r11.xyz, r12.xyzx, r11.xyzx
      max r11.xyz, r11.xyzx, r13.xyzx
      min r2.w, r11.z, r11.y
      min r2.w, r2.w, r11.x
      and r2.w, r2.w, r10.x
      mul r11.xyz, r0.yyyy, cb0[42].xyzx
      mad r11.xyz, cb0[41].xyzx, r0.xxxx, r11.xyzx
      mad r11.xyz, cb0[43].xyzx, r0.zzzz, r11.xyzx
      mul r12.xyz, r3.yyyy, cb0[42].xyzx
      mad r12.xyz, cb0[41].xyzx, r3.xxxx, r12.xyzx
      mad r12.xyz, cb0[43].xyzx, r3.zzzz, r12.xyzx
      add r12.xyz, r12.xyzx, cb0[44].xyzx
      add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r13.xyz, r13.xyzx, r11.xyzx
      add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r11.xyz, r12.xyzx, r11.xyzx
      max r11.xyz, r11.xyzx, r13.xyzx
      min r3.w, r11.z, r11.y
      min r3.w, r3.w, r11.x
      and r3.w, r3.w, r10.y
      mul r10.xyw, r0.yyyy, cb0[46].xyxz
      mad r10.xyw, cb0[45].xyxz, r0.xxxx, r10.xyxw
      mad r10.xyw, cb0[47].xyxz, r0.zzzz, r10.xyxw
      mul r11.xyz, r3.yyyy, cb0[46].xyzx
      mad r11.xyz, cb0[45].xyzx, r3.xxxx, r11.xyzx
      mad r11.xyz, cb0[47].xyzx, r3.zzzz, r11.xyzx
      add r11.xyz, r11.xyzx, cb0[48].xyzx
      add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r12.xyz, r12.xyzx, r10.xywx
      add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r10.xyw, r11.xyxz, r10.xyxw
      max r10.xyw, r10.xyxw, r12.xyxz
      min r4.w, r10.w, r10.y
      min r4.w, r4.w, r10.x
      and r4.w, r4.w, r10.z
      max r2.w, r2.w, r3.w
      max r2.w, r4.w, r2.w
      mad r10.xyz, r0.xyzx, r2.wwww, r3.xyzx
      add r10.xyz, r10.xyzx, -cb0[20].xyzx
      movc r10.xyz, r1.zzzz, r10.xyzx, r0.xyzx
      dp3 r1.z, r10.xyzx, r10.xyzx
      rsq r1.z, r1.z
      mul r10.xyz, r1.zzzz, r10.xyzx
      sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r10.xyzx, t1.xyzw, s3, r1.x
      add r10.xyz, -r9.xyzx, r10.xyzx
      mad r9.xyz, cb0[49].wwww, r10.xyzx, r9.xyzx
    endif 
    mul r9.xyz, r9.xyzx, cb0[20].wwww
  else 
    mov r9.xyz, l(0,0,0,0)
  endif 
  ne r1.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[21].w
  if_nz r1.z
    mul r10.xyz, r0.yyyy, cb0[25].xyzx
    mad r10.xyz, cb0[24].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[26].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[25].xyzx
    mad r11.xyz, cb0[24].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[26].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[27].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r1.z, r10.z, r10.y
    min r1.z, r1.z, r10.x
    and r1.z, r1.z, r2.x
    mul r10.xyz, r0.yyyy, cb0[29].xyzx
    mad r10.xyz, cb0[28].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[30].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[29].xyzx
    mad r11.xyz, cb0[28].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[30].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[31].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r2.w, r10.z, r10.y
    min r2.w, r2.w, r10.x
    and r2.w, r2.w, r2.y
    mul r10.xyz, r0.yyyy, cb0[33].xyzx
    mad r10.xyz, cb0[32].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[34].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[33].xyzx
    mad r11.xyz, cb0[32].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[34].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[35].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r3.w, r10.z, r10.y
    min r3.w, r3.w, r10.x
    and r3.w, r2.z, r3.w
    max r1.z, r1.z, r2.w
    max r1.z, r3.w, r1.z
    mad r10.xyz, r0.xyzx, r1.zzzz, r3.xyzx
    add r10.xyz, r10.xyzx, -cb0[21].xyzx
    movc r10.xyz, r1.yyyy, r10.xyzx, r0.xyzx
    dp3 r1.z, r10.xyzx, r10.xyzx
    rsq r1.z, r1.z
    mul r10.xyz, r1.zzzz, r10.xyzx
    sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r10.xyzx, t1.xyzw, s3, r1.x
    ne r1.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
    if_nz r1.z
      ne r11.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].xyzx
      or r1.z, r11.y, r11.x
      or r1.z, r11.z, r1.z
      mul r12.xyz, r0.yyyy, cb0[38].xyzx
      mad r12.xyz, cb0[37].xyzx, r0.xxxx, r12.xyzx
      mad r12.xyz, cb0[39].xyzx, r0.zzzz, r12.xyzx
      mul r13.xyz, r3.yyyy, cb0[38].xyzx
      mad r13.xyz, cb0[37].xyzx, r3.xxxx, r13.xyzx
      mad r13.xyz, cb0[39].xyzx, r3.zzzz, r13.xyzx
      add r13.xyz, r13.xyzx, cb0[40].xyzx
      add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r14.xyz, r14.xyzx, r12.xyzx
      add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r12.xyz, r13.xyzx, r12.xyzx
      max r12.xyz, r12.xyzx, r14.xyzx
      min r2.w, r12.z, r12.y
      min r2.w, r2.w, r12.x
      and r2.w, r2.w, r11.x
      mul r12.xyz, r0.yyyy, cb0[42].xyzx
      mad r12.xyz, cb0[41].xyzx, r0.xxxx, r12.xyzx
      mad r12.xyz, cb0[43].xyzx, r0.zzzz, r12.xyzx
      mul r13.xyz, r3.yyyy, cb0[42].xyzx
      mad r13.xyz, cb0[41].xyzx, r3.xxxx, r13.xyzx
      mad r13.xyz, cb0[43].xyzx, r3.zzzz, r13.xyzx
      add r13.xyz, r13.xyzx, cb0[44].xyzx
      add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r14.xyz, r14.xyzx, r12.xyzx
      add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r12.xyz, r13.xyzx, r12.xyzx
      max r12.xyz, r12.xyzx, r14.xyzx
      min r3.w, r12.z, r12.y
      min r3.w, r3.w, r12.x
      and r3.w, r3.w, r11.y
      mul r11.xyw, r0.yyyy, cb0[46].xyxz
      mad r11.xyw, cb0[45].xyxz, r0.xxxx, r11.xyxw
      mad r11.xyw, cb0[47].xyxz, r0.zzzz, r11.xyxw
      mul r12.xyz, r3.yyyy, cb0[46].xyzx
      mad r12.xyz, cb0[45].xyzx, r3.xxxx, r12.xyzx
      mad r12.xyz, cb0[47].xyzx, r3.zzzz, r12.xyzx
      add r12.xyz, r12.xyzx, cb0[48].xyzx
      add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r13.xyz, r13.xyzx, r11.xywx
      add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r11.xyw, r12.xyxz, r11.xyxw
      max r11.xyw, r11.xyxw, r13.xyxz
      min r4.w, r11.w, r11.y
      min r4.w, r4.w, r11.x
      and r4.w, r4.w, r11.z
      max r2.w, r2.w, r3.w
      max r2.w, r4.w, r2.w
      mad r11.xyz, r0.xyzx, r2.wwww, r3.xyzx
      add r11.xyz, r11.xyzx, -cb0[21].xyzx
      movc r11.xyz, r1.zzzz, r11.xyzx, r0.xyzx
      dp3 r1.z, r11.xyzx, r11.xyzx
      rsq r1.z, r1.z
      mul r11.xyz, r1.zzzz, r11.xyzx
      sample_l_indexable(texturecube)(float,float,float,float) r11.xyz, r11.xyzx, t1.xyzw, s3, r1.x
      add r11.xyz, -r10.xyzx, r11.xyzx
      mad r10.xyz, cb0[49].wwww, r11.xyzx, r10.xyzx
    endif 
    mad r9.xyz, r10.xyzx, cb0[21].wwww, r9.xyzx
  endif 
  ne r1.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[22].w
  if_nz r1.z
    mul r10.xyz, r0.yyyy, cb0[25].xyzx
    mad r10.xyz, cb0[24].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[26].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[25].xyzx
    mad r11.xyz, cb0[24].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[26].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[27].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r1.z, r10.z, r10.y
    min r1.z, r1.z, r10.x
    and r1.z, r1.z, r2.x
    mul r10.xyz, r0.yyyy, cb0[29].xyzx
    mad r10.xyz, cb0[28].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[30].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[29].xyzx
    mad r11.xyz, cb0[28].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[30].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[31].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r2.w, r10.z, r10.y
    min r2.w, r2.w, r10.x
    and r2.w, r2.w, r2.y
    mul r10.xyz, r0.yyyy, cb0[33].xyzx
    mad r10.xyz, cb0[32].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[34].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[33].xyzx
    mad r11.xyz, cb0[32].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[34].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[35].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r3.w, r10.z, r10.y
    min r3.w, r3.w, r10.x
    and r3.w, r2.z, r3.w
    max r1.z, r1.z, r2.w
    max r1.z, r3.w, r1.z
    mad r10.xyz, r0.xyzx, r1.zzzz, r3.xyzx
    add r10.xyz, r10.xyzx, -cb0[22].xyzx
    movc r10.xyz, r1.yyyy, r10.xyzx, r0.xyzx
    dp3 r1.z, r10.xyzx, r10.xyzx
    rsq r1.z, r1.z
    mul r10.xyz, r1.zzzz, r10.xyzx
    sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r10.xyzx, t1.xyzw, s3, r1.x
    ne r1.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
    if_nz r1.z
      ne r11.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].xyzx
      or r1.z, r11.y, r11.x
      or r1.z, r11.z, r1.z
      mul r12.xyz, r0.yyyy, cb0[38].xyzx
      mad r12.xyz, cb0[37].xyzx, r0.xxxx, r12.xyzx
      mad r12.xyz, cb0[39].xyzx, r0.zzzz, r12.xyzx
      mul r13.xyz, r3.yyyy, cb0[38].xyzx
      mad r13.xyz, cb0[37].xyzx, r3.xxxx, r13.xyzx
      mad r13.xyz, cb0[39].xyzx, r3.zzzz, r13.xyzx
      add r13.xyz, r13.xyzx, cb0[40].xyzx
      add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r14.xyz, r14.xyzx, r12.xyzx
      add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r12.xyz, r13.xyzx, r12.xyzx
      max r12.xyz, r12.xyzx, r14.xyzx
      min r2.w, r12.z, r12.y
      min r2.w, r2.w, r12.x
      and r2.w, r2.w, r11.x
      mul r12.xyz, r0.yyyy, cb0[42].xyzx
      mad r12.xyz, cb0[41].xyzx, r0.xxxx, r12.xyzx
      mad r12.xyz, cb0[43].xyzx, r0.zzzz, r12.xyzx
      mul r13.xyz, r3.yyyy, cb0[42].xyzx
      mad r13.xyz, cb0[41].xyzx, r3.xxxx, r13.xyzx
      mad r13.xyz, cb0[43].xyzx, r3.zzzz, r13.xyzx
      add r13.xyz, r13.xyzx, cb0[44].xyzx
      add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r14.xyz, r14.xyzx, r12.xyzx
      add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r12.xyz, r13.xyzx, r12.xyzx
      max r12.xyz, r12.xyzx, r14.xyzx
      min r3.w, r12.z, r12.y
      min r3.w, r3.w, r12.x
      and r3.w, r3.w, r11.y
      mul r11.xyw, r0.yyyy, cb0[46].xyxz
      mad r11.xyw, cb0[45].xyxz, r0.xxxx, r11.xyxw
      mad r11.xyw, cb0[47].xyxz, r0.zzzz, r11.xyxw
      mul r12.xyz, r3.yyyy, cb0[46].xyzx
      mad r12.xyz, cb0[45].xyzx, r3.xxxx, r12.xyzx
      mad r12.xyz, cb0[47].xyzx, r3.zzzz, r12.xyzx
      add r12.xyz, r12.xyzx, cb0[48].xyzx
      add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r13.xyz, r13.xyzx, r11.xywx
      add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r11.xyw, r12.xyxz, r11.xyxw
      max r11.xyw, r11.xyxw, r13.xyxz
      min r4.w, r11.w, r11.y
      min r4.w, r4.w, r11.x
      and r4.w, r4.w, r11.z
      max r2.w, r2.w, r3.w
      max r2.w, r4.w, r2.w
      mad r11.xyz, r0.xyzx, r2.wwww, r3.xyzx
      add r11.xyz, r11.xyzx, -cb0[22].xyzx
      movc r11.xyz, r1.zzzz, r11.xyzx, r0.xyzx
      dp3 r1.z, r11.xyzx, r11.xyzx
      rsq r1.z, r1.z
      mul r11.xyz, r1.zzzz, r11.xyzx
      sample_l_indexable(texturecube)(float,float,float,float) r11.xyz, r11.xyzx, t1.xyzw, s3, r1.x
      add r11.xyz, -r10.xyzx, r11.xyzx
      mad r10.xyz, cb0[49].wwww, r11.xyzx, r10.xyzx
    endif 
    mad r9.xyz, r10.xyzx, cb0[22].wwww, r9.xyzx
  endif 
  ne r1.z, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[23].w
  if_nz r1.z
    mul r10.xyz, r0.yyyy, cb0[25].xyzx
    mad r10.xyz, cb0[24].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[26].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[25].xyzx
    mad r11.xyz, cb0[24].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[26].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[27].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r1.z, r10.z, r10.y
    min r1.z, r1.z, r10.x
    and r1.z, r1.z, r2.x
    mul r10.xyz, r0.yyyy, cb0[29].xyzx
    mad r10.xyz, cb0[28].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[30].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[29].xyzx
    mad r11.xyz, cb0[28].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[30].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[31].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r2.x, r10.z, r10.y
    min r2.x, r2.x, r10.x
    and r2.x, r2.x, r2.y
    mul r10.xyz, r0.yyyy, cb0[33].xyzx
    mad r10.xyz, cb0[32].xyzx, r0.xxxx, r10.xyzx
    mad r10.xyz, cb0[34].xyzx, r0.zzzz, r10.xyzx
    mul r11.xyz, r3.yyyy, cb0[33].xyzx
    mad r11.xyz, cb0[32].xyzx, r3.xxxx, r11.xyzx
    mad r11.xyz, cb0[34].xyzx, r3.zzzz, r11.xyzx
    add r11.xyz, r11.xyzx, cb0[35].xyzx
    add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
    div r12.xyz, r12.xyzx, r10.xyzx
    add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
    div r10.xyz, r11.xyzx, r10.xyzx
    max r10.xyz, r10.xyzx, r12.xyzx
    min r2.y, r10.z, r10.y
    min r2.y, r2.y, r10.x
    and r2.y, r2.y, r2.z
    max r1.z, r1.z, r2.x
    max r1.z, r2.y, r1.z
    mad r2.xyz, r0.xyzx, r1.zzzz, r3.xyzx
    add r2.xyz, r2.xyzx, -cb0[23].xyzx
    movc r2.xyz, r1.yyyy, r2.xyzx, r0.xyzx
    dp3 r1.y, r2.xyzx, r2.xyzx
    rsq r1.y, r1.y
    mul r2.xyz, r1.yyyy, r2.xyzx
    sample_l_indexable(texturecube)(float,float,float,float) r2.xyz, r2.xyzx, t1.xyzw, s3, r1.x
    ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
    if_nz r1.y
      ne r10.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].xyzx
      or r1.y, r10.y, r10.x
      or r1.y, r10.z, r1.y
      mul r11.xyz, r0.yyyy, cb0[38].xyzx
      mad r11.xyz, cb0[37].xyzx, r0.xxxx, r11.xyzx
      mad r11.xyz, cb0[39].xyzx, r0.zzzz, r11.xyzx
      mul r12.xyz, r3.yyyy, cb0[38].xyzx
      mad r12.xyz, cb0[37].xyzx, r3.xxxx, r12.xyzx
      mad r12.xyz, cb0[39].xyzx, r3.zzzz, r12.xyzx
      add r12.xyz, r12.xyzx, cb0[40].xyzx
      add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r13.xyz, r13.xyzx, r11.xyzx
      add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r11.xyz, r12.xyzx, r11.xyzx
      max r11.xyz, r11.xyzx, r13.xyzx
      min r1.z, r11.z, r11.y
      min r1.z, r1.z, r11.x
      and r1.z, r1.z, r10.x
      mul r11.xyz, r0.yyyy, cb0[42].xyzx
      mad r11.xyz, cb0[41].xyzx, r0.xxxx, r11.xyzx
      mad r11.xyz, cb0[43].xyzx, r0.zzzz, r11.xyzx
      mul r12.xyz, r3.yyyy, cb0[42].xyzx
      mad r12.xyz, cb0[41].xyzx, r3.xxxx, r12.xyzx
      mad r12.xyz, cb0[43].xyzx, r3.zzzz, r12.xyzx
      add r12.xyz, r12.xyzx, cb0[44].xyzx
      add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r13.xyz, r13.xyzx, r11.xyzx
      add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r11.xyz, r12.xyzx, r11.xyzx
      max r11.xyz, r11.xyzx, r13.xyzx
      min r2.w, r11.z, r11.y
      min r2.w, r2.w, r11.x
      and r2.w, r2.w, r10.y
      mul r10.xyw, r0.yyyy, cb0[46].xyxz
      mad r10.xyw, cb0[45].xyxz, r0.xxxx, r10.xyxw
      mad r10.xyw, cb0[47].xyxz, r0.zzzz, r10.xyxw
      mul r11.xyz, r3.yyyy, cb0[46].xyzx
      mad r11.xyz, cb0[45].xyzx, r3.xxxx, r11.xyzx
      mad r11.xyz, cb0[47].xyzx, r3.zzzz, r11.xyzx
      add r11.xyz, r11.xyzx, cb0[48].xyzx
      add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
      div r12.xyz, r12.xyzx, r10.xywx
      add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
      div r10.xyw, r11.xyxz, r10.xyxw
      max r10.xyw, r10.xyxw, r12.xyxz
      min r3.w, r10.w, r10.y
      min r3.w, r3.w, r10.x
      and r3.w, r3.w, r10.z
      max r1.z, r1.z, r2.w
      max r1.z, r3.w, r1.z
      mad r10.xyz, r0.xyzx, r1.zzzz, r3.xyzx
      add r10.xyz, r10.xyzx, -cb0[23].xyzx
      movc r10.xyz, r1.yyyy, r10.xyzx, r0.xyzx
      dp3 r1.y, r10.xyzx, r10.xyzx
      rsq r1.y, r1.y
      mul r10.xyz, r1.yyyy, r10.xyzx
      sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r10.xyzx, t1.xyzw, s3, r1.x
      add r10.xyz, -r2.xyzx, r10.xyzx
      mad r2.xyz, cb0[49].wwww, r10.xyzx, r2.xyzx
    endif 
    mad r9.xyz, r2.xyzx, cb0[23].wwww, r9.xyzx
  endif 
else 
  sample_l_indexable(texturecube)(float,float,float,float) r9.xyz, r0.xyzx, t1.xyzw, s3, r1.x
  ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
  if_nz r1.y
    ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[20].w
    if_nz r1.y
      dp3 r1.y, r0.xyzx, r0.xyzx
      rsq r1.y, r1.y
      mul r2.xyz, r0.xyzx, r1.yyyy
      sample_l_indexable(texturecube)(float,float,float,float) r2.xyz, r2.xyzx, t1.xyzw, s3, r1.x
      ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
      if_nz r1.y
        ne r10.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].xyzx
        or r1.y, r10.y, r10.x
        or r1.y, r10.z, r1.y
        mul r11.xyz, r0.yyyy, cb0[38].xyzx
        mad r11.xyz, cb0[37].xyzx, r0.xxxx, r11.xyzx
        mad r11.xyz, cb0[39].xyzx, r0.zzzz, r11.xyzx
        mul r12.xyz, r3.yyyy, cb0[38].xyzx
        mad r12.xyz, cb0[37].xyzx, r3.xxxx, r12.xyzx
        mad r12.xyz, cb0[39].xyzx, r3.zzzz, r12.xyzx
        add r12.xyz, r12.xyzx, cb0[40].xyzx
        add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r13.xyz, r13.xyzx, r11.xyzx
        add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r11.xyz, r12.xyzx, r11.xyzx
        max r11.xyz, r11.xyzx, r13.xyzx
        min r1.z, r11.z, r11.y
        min r1.z, r1.z, r11.x
        and r1.z, r1.z, r10.x
        mul r11.xyz, r0.yyyy, cb0[42].xyzx
        mad r11.xyz, cb0[41].xyzx, r0.xxxx, r11.xyzx
        mad r11.xyz, cb0[43].xyzx, r0.zzzz, r11.xyzx
        mul r12.xyz, r3.yyyy, cb0[42].xyzx
        mad r12.xyz, cb0[41].xyzx, r3.xxxx, r12.xyzx
        mad r12.xyz, cb0[43].xyzx, r3.zzzz, r12.xyzx
        add r12.xyz, r12.xyzx, cb0[44].xyzx
        add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r13.xyz, r13.xyzx, r11.xyzx
        add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r11.xyz, r12.xyzx, r11.xyzx
        max r11.xyz, r11.xyzx, r13.xyzx
        min r2.w, r11.z, r11.y
        min r2.w, r2.w, r11.x
        and r2.w, r2.w, r10.y
        mul r10.xyw, r0.yyyy, cb0[46].xyxz
        mad r10.xyw, cb0[45].xyxz, r0.xxxx, r10.xyxw
        mad r10.xyw, cb0[47].xyxz, r0.zzzz, r10.xyxw
        mul r11.xyz, r3.yyyy, cb0[46].xyzx
        mad r11.xyz, cb0[45].xyzx, r3.xxxx, r11.xyzx
        mad r11.xyz, cb0[47].xyzx, r3.zzzz, r11.xyzx
        add r11.xyz, r11.xyzx, cb0[48].xyzx
        add r12.xyz, -r11.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r12.xyz, r12.xyzx, r10.xywx
        add r11.xyz, -r11.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r10.xyw, r11.xyxz, r10.xyxw
        max r10.xyw, r10.xyxw, r12.xyxz
        min r3.w, r10.w, r10.y
        min r3.w, r3.w, r10.x
        and r3.w, r3.w, r10.z
        max r1.z, r1.z, r2.w
        max r1.z, r3.w, r1.z
        mad r10.xyz, r0.xyzx, r1.zzzz, r3.xyzx
        add r10.xyz, r10.xyzx, -cb0[20].xyzx
        movc r10.xyz, r1.yyyy, r10.xyzx, r0.xyzx
        dp3 r1.y, r10.xyzx, r10.xyzx
        rsq r1.y, r1.y
        mul r10.xyz, r1.yyyy, r10.xyzx
        sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r10.xyzx, t1.xyzw, s3, r1.x
        add r10.xyz, -r2.xyzx, r10.xyzx
        mad r2.xyz, cb0[49].wwww, r10.xyzx, r2.xyzx
      endif 
      mul r2.xyz, r2.xyzx, cb0[20].wwww
    else 
      mov r2.xyz, l(0,0,0,0)
    endif 
    ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[21].w
    if_nz r1.y
      dp3 r1.y, r0.xyzx, r0.xyzx
      rsq r1.y, r1.y
      mul r10.xyz, r0.xyzx, r1.yyyy
      sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r10.xyzx, t1.xyzw, s3, r1.x
      ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
      if_nz r1.y
        ne r11.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].xyzx
        or r1.y, r11.y, r11.x
        or r1.y, r11.z, r1.y
        mul r12.xyz, r0.yyyy, cb0[38].xyzx
        mad r12.xyz, cb0[37].xyzx, r0.xxxx, r12.xyzx
        mad r12.xyz, cb0[39].xyzx, r0.zzzz, r12.xyzx
        mul r13.xyz, r3.yyyy, cb0[38].xyzx
        mad r13.xyz, cb0[37].xyzx, r3.xxxx, r13.xyzx
        mad r13.xyz, cb0[39].xyzx, r3.zzzz, r13.xyzx
        add r13.xyz, r13.xyzx, cb0[40].xyzx
        add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r14.xyz, r14.xyzx, r12.xyzx
        add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r12.xyz, r13.xyzx, r12.xyzx
        max r12.xyz, r12.xyzx, r14.xyzx
        min r1.z, r12.z, r12.y
        min r1.z, r1.z, r12.x
        and r1.z, r1.z, r11.x
        mul r12.xyz, r0.yyyy, cb0[42].xyzx
        mad r12.xyz, cb0[41].xyzx, r0.xxxx, r12.xyzx
        mad r12.xyz, cb0[43].xyzx, r0.zzzz, r12.xyzx
        mul r13.xyz, r3.yyyy, cb0[42].xyzx
        mad r13.xyz, cb0[41].xyzx, r3.xxxx, r13.xyzx
        mad r13.xyz, cb0[43].xyzx, r3.zzzz, r13.xyzx
        add r13.xyz, r13.xyzx, cb0[44].xyzx
        add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r14.xyz, r14.xyzx, r12.xyzx
        add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r12.xyz, r13.xyzx, r12.xyzx
        max r12.xyz, r12.xyzx, r14.xyzx
        min r2.w, r12.z, r12.y
        min r2.w, r2.w, r12.x
        and r2.w, r2.w, r11.y
        mul r11.xyw, r0.yyyy, cb0[46].xyxz
        mad r11.xyw, cb0[45].xyxz, r0.xxxx, r11.xyxw
        mad r11.xyw, cb0[47].xyxz, r0.zzzz, r11.xyxw
        mul r12.xyz, r3.yyyy, cb0[46].xyzx
        mad r12.xyz, cb0[45].xyzx, r3.xxxx, r12.xyzx
        mad r12.xyz, cb0[47].xyzx, r3.zzzz, r12.xyzx
        add r12.xyz, r12.xyzx, cb0[48].xyzx
        add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r13.xyz, r13.xyzx, r11.xywx
        add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r11.xyw, r12.xyxz, r11.xyxw
        max r11.xyw, r11.xyxw, r13.xyxz
        min r3.w, r11.w, r11.y
        min r3.w, r3.w, r11.x
        and r3.w, r3.w, r11.z
        max r1.z, r1.z, r2.w
        max r1.z, r3.w, r1.z
        mad r11.xyz, r0.xyzx, r1.zzzz, r3.xyzx
        add r11.xyz, r11.xyzx, -cb0[21].xyzx
        movc r11.xyz, r1.yyyy, r11.xyzx, r0.xyzx
        dp3 r1.y, r11.xyzx, r11.xyzx
        rsq r1.y, r1.y
        mul r11.xyz, r1.yyyy, r11.xyzx
        sample_l_indexable(texturecube)(float,float,float,float) r11.xyz, r11.xyzx, t1.xyzw, s3, r1.x
        add r11.xyz, -r10.xyzx, r11.xyzx
        mad r10.xyz, cb0[49].wwww, r11.xyzx, r10.xyzx
      endif 
      mad r2.xyz, r10.xyzx, cb0[21].wwww, r2.xyzx
    endif 
    ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[22].w
    if_nz r1.y
      dp3 r1.y, r0.xyzx, r0.xyzx
      rsq r1.y, r1.y
      mul r10.xyz, r0.xyzx, r1.yyyy
      sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r10.xyzx, t1.xyzw, s3, r1.x
      ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
      if_nz r1.y
        ne r11.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].xyzx
        or r1.y, r11.y, r11.x
        or r1.y, r11.z, r1.y
        mul r12.xyz, r0.yyyy, cb0[38].xyzx
        mad r12.xyz, cb0[37].xyzx, r0.xxxx, r12.xyzx
        mad r12.xyz, cb0[39].xyzx, r0.zzzz, r12.xyzx
        mul r13.xyz, r3.yyyy, cb0[38].xyzx
        mad r13.xyz, cb0[37].xyzx, r3.xxxx, r13.xyzx
        mad r13.xyz, cb0[39].xyzx, r3.zzzz, r13.xyzx
        add r13.xyz, r13.xyzx, cb0[40].xyzx
        add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r14.xyz, r14.xyzx, r12.xyzx
        add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r12.xyz, r13.xyzx, r12.xyzx
        max r12.xyz, r12.xyzx, r14.xyzx
        min r1.z, r12.z, r12.y
        min r1.z, r1.z, r12.x
        and r1.z, r1.z, r11.x
        mul r12.xyz, r0.yyyy, cb0[42].xyzx
        mad r12.xyz, cb0[41].xyzx, r0.xxxx, r12.xyzx
        mad r12.xyz, cb0[43].xyzx, r0.zzzz, r12.xyzx
        mul r13.xyz, r3.yyyy, cb0[42].xyzx
        mad r13.xyz, cb0[41].xyzx, r3.xxxx, r13.xyzx
        mad r13.xyz, cb0[43].xyzx, r3.zzzz, r13.xyzx
        add r13.xyz, r13.xyzx, cb0[44].xyzx
        add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r14.xyz, r14.xyzx, r12.xyzx
        add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r12.xyz, r13.xyzx, r12.xyzx
        max r12.xyz, r12.xyzx, r14.xyzx
        min r2.w, r12.z, r12.y
        min r2.w, r2.w, r12.x
        and r2.w, r2.w, r11.y
        mul r11.xyw, r0.yyyy, cb0[46].xyxz
        mad r11.xyw, cb0[45].xyxz, r0.xxxx, r11.xyxw
        mad r11.xyw, cb0[47].xyxz, r0.zzzz, r11.xyxw
        mul r12.xyz, r3.yyyy, cb0[46].xyzx
        mad r12.xyz, cb0[45].xyzx, r3.xxxx, r12.xyzx
        mad r12.xyz, cb0[47].xyzx, r3.zzzz, r12.xyzx
        add r12.xyz, r12.xyzx, cb0[48].xyzx
        add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r13.xyz, r13.xyzx, r11.xywx
        add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r11.xyw, r12.xyxz, r11.xyxw
        max r11.xyw, r11.xyxw, r13.xyxz
        min r3.w, r11.w, r11.y
        min r3.w, r3.w, r11.x
        and r3.w, r3.w, r11.z
        max r1.z, r1.z, r2.w
        max r1.z, r3.w, r1.z
        mad r11.xyz, r0.xyzx, r1.zzzz, r3.xyzx
        add r11.xyz, r11.xyzx, -cb0[22].xyzx
        movc r11.xyz, r1.yyyy, r11.xyzx, r0.xyzx
        dp3 r1.y, r11.xyzx, r11.xyzx
        rsq r1.y, r1.y
        mul r11.xyz, r1.yyyy, r11.xyzx
        sample_l_indexable(texturecube)(float,float,float,float) r11.xyz, r11.xyzx, t1.xyzw, s3, r1.x
        add r11.xyz, -r10.xyzx, r11.xyzx
        mad r10.xyz, cb0[49].wwww, r11.xyzx, r10.xyzx
      endif 
      mad r2.xyz, r10.xyzx, cb0[22].wwww, r2.xyzx
    endif 
    ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[23].w
    if_nz r1.y
      dp3 r1.y, r0.xyzx, r0.xyzx
      rsq r1.y, r1.y
      mul r10.xyz, r0.xyzx, r1.yyyy
      sample_l_indexable(texturecube)(float,float,float,float) r10.xyz, r10.xyzx, t1.xyzw, s3, r1.x
      ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].w
      if_nz r1.y
        ne r11.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[49].xyzx
        or r1.y, r11.y, r11.x
        or r1.y, r11.z, r1.y
        mul r12.xyz, r0.yyyy, cb0[38].xyzx
        mad r12.xyz, cb0[37].xyzx, r0.xxxx, r12.xyzx
        mad r12.xyz, cb0[39].xyzx, r0.zzzz, r12.xyzx
        mul r13.xyz, r3.yyyy, cb0[38].xyzx
        mad r13.xyz, cb0[37].xyzx, r3.xxxx, r13.xyzx
        mad r13.xyz, cb0[39].xyzx, r3.zzzz, r13.xyzx
        add r13.xyz, r13.xyzx, cb0[40].xyzx
        add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r14.xyz, r14.xyzx, r12.xyzx
        add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r12.xyz, r13.xyzx, r12.xyzx
        max r12.xyz, r12.xyzx, r14.xyzx
        min r1.z, r12.z, r12.y
        min r1.z, r1.z, r12.x
        and r1.z, r1.z, r11.x
        mul r12.xyz, r0.yyyy, cb0[42].xyzx
        mad r12.xyz, cb0[41].xyzx, r0.xxxx, r12.xyzx
        mad r12.xyz, cb0[43].xyzx, r0.zzzz, r12.xyzx
        mul r13.xyz, r3.yyyy, cb0[42].xyzx
        mad r13.xyz, cb0[41].xyzx, r3.xxxx, r13.xyzx
        mad r13.xyz, cb0[43].xyzx, r3.zzzz, r13.xyzx
        add r13.xyz, r13.xyzx, cb0[44].xyzx
        add r14.xyz, -r13.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r14.xyz, r14.xyzx, r12.xyzx
        add r13.xyz, -r13.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r12.xyz, r13.xyzx, r12.xyzx
        max r12.xyz, r12.xyzx, r14.xyzx
        min r2.w, r12.z, r12.y
        min r2.w, r2.w, r12.x
        and r2.w, r2.w, r11.y
        mul r11.xyw, r0.yyyy, cb0[46].xyxz
        mad r11.xyw, cb0[45].xyxz, r0.xxxx, r11.xyxw
        mad r11.xyw, cb0[47].xyxz, r0.zzzz, r11.xyxw
        mul r12.xyz, r3.yyyy, cb0[46].xyzx
        mad r12.xyz, cb0[45].xyzx, r3.xxxx, r12.xyzx
        mad r12.xyz, cb0[47].xyzx, r3.zzzz, r12.xyzx
        add r12.xyz, r12.xyzx, cb0[48].xyzx
        add r13.xyz, -r12.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
        div r13.xyz, r13.xyzx, r11.xywx
        add r12.xyz, -r12.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
        div r11.xyw, r12.xyxz, r11.xyxw
        max r11.xyw, r11.xyxw, r13.xyxz
        min r3.w, r11.w, r11.y
        min r3.w, r3.w, r11.x
        and r3.w, r3.w, r11.z
        max r1.z, r1.z, r2.w
        max r1.z, r3.w, r1.z
        mad r3.xyz, r0.xyzx, r1.zzzz, r3.xyzx
        add r3.xyz, r3.xyzx, -cb0[23].xyzx
        movc r3.xyz, r1.yyyy, r3.xyzx, r0.xyzx
        dp3 r1.y, r3.xyzx, r3.xyzx
        rsq r1.y, r1.y
        mul r3.xyz, r1.yyyy, r3.xyzx
        sample_l_indexable(texturecube)(float,float,float,float) r3.xyz, r3.xyzx, t1.xyzw, s3, r1.x
        add r3.xyz, -r10.xyzx, r3.xyzx
        mad r10.xyz, cb0[49].wwww, r3.xyzx, r10.xyzx
      endif 
      mad r2.xyz, r10.xyzx, cb0[23].wwww, r2.xyzx
    endif 
    add r2.xyz, -r9.xyzx, r2.xyzx
    mad r9.xyz, cb0[49].wwww, r2.xyzx, r9.xyzx
  endif 
endif 
ne r1.y, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[50].x
if_nz r1.y
  sample_l_indexable(texturecube)(float,float,float,float) r2.xyz, r0.xyzx, t2.xyzw, s4, r1.x
  add r2.xyz, -r9.xyzx, r2.xyzx
  mad r9.xyz, cb0[50].xxxx, r2.xyzx, r9.xyzx
endif 
sample_l_indexable(texturecube)(float,float,float,float) r2.xyz, r0.xyzx, t1.xyzw, s3, l(7.000000)
add r1.y, r2.y, r2.x
add r1.y, r2.z, r1.y
mul r1.z, r1.y, l(0.333333343)
lt r1.y, l(0.003000), r1.y
div r1.z, r1.w, r1.z
min r1.z, r1.z, l(1.000000)
mul r2.xyz, r1.zzzz, r9.xyzx
movc r1.yzw, r1.yyyy, r2.xxyz, r9.xxyz
dp3_sat r2.x, r7.xyzx, r5.xyzx
mad r3.xyzw, r0.wwww, l(-1.000000, -0.027500, -0.572000, 0.022000), l(1.000000, 0.042500, 1.040000, -0.040000)
mul r0.w, r3.x, r3.x
mul r2.x, r2.x, l(-9.280000)
exp r2.x, r2.x
min r0.w, r0.w, r2.x
mad r0.w, r0.w, r3.x, r3.y
mad r2.xy, r0.wwww, l(-1.040000, 1.040000, 0.000000, 0.000000), r3.zwzz
mul_sat r0.w, r6.y, l(50.000000)
mul r0.w, r0.w, r2.y
mad r2.xyz, r6.xyzx, r2.xxxx, r0.wwww
mad r1.yzw, r1.yyzw, r2.xxyz, r4.xxyz
mad r1.yzw, r8.xxyz, cb0[109].xxyz, r1.yyzw
lt r0.w, l(0.000000), cb0[50].y
if_nz r0.w
  sample_l_indexable(texturecube)(float,float,float,float) r0.xyz, r0.xyzx, t1.xyzw, s3, r1.x
  mul r0.xyz, r2.xyzx, r0.xyzx
  mad r1.yzw, r0.xxyz, cb0[50].yyyy, r1.yyzw
endif 
lt r0.x, cb0[50].y, l(0.000000)
div r0.yzw, r1.yyzw, -cb0[50].yyyy
movc r0.xyz, r0.xxxx, r0.yzwy, r1.yzwy
mad o0.xyz, r0.xyzx, v5.wwww, v5.xyzx
mov o0.w, cb0[89].z
ret 
// Approximately 901 instruction slots used

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