// Directional lighting (shadows=ultra)
// PS 7afaca8dbc8230a4 faba7cafc597dea0

//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
//   using 3Dmigoto v1.2.31 on Wed Mar 02 08:06:55 2016
//
//
// Buffer Definitions: 
//
// cbuffer CViewportShaderParameterProvider
// {
//
//   float4x4 InvProjectionMatrix;      // Offset:    0 Size:    64 [unused]
//   float4x4 InvViewMatrix;            // Offset:   64 Size:    64 [unused]
//   float4x4 ProjectionMatrix;         // Offset:  128 Size:    64 [unused]
//   float4x4 ViewMatrix;               // Offset:  192 Size:    64 [unused]
//   float4x4 ViewProjectionMatrix;     // Offset:  256 Size:    64 [unused]
//   float4x4 ViewRotProjectionMatrix;  // Offset:  320 Size:    64 [unused]
//   float4x4 ViewRotProjectionMatrix_Previous;// Offset:  384 Size:    64 [unused]
//   float4 AmbientSHR;                 // Offset:  448 Size:    16 [unused]
//   float4 AmbientSHG;                 // Offset:  464 Size:    16 [unused]
//   float4 AmbientSHB;                 // Offset:  480 Size:    16 [unused]
//   float4 CameraDistances;            // Offset:  496 Size:    16
//   float4 CameraNearPlaneSize;        // Offset:  512 Size:    16 [unused]
//   float4 DepthScale;                 // Offset:  528 Size:    16
//   float4 DepthTextureScaleOffset;    // Offset:  544 Size:    16 [unused]
//   float4 FogParams;                  // Offset:  560 Size:    16 [unused]
//   float4 FogSHB;                     // Offset:  576 Size:    16 [unused]
//   float4 FogSHG;                     // Offset:  592 Size:    16 [unused]
//   float4 FogSHR;                     // Offset:  608 Size:    16 [unused]
//   float4 HeightFogParams;            // Offset:  624 Size:    16 [unused]
//   float4 ViewportSize;               // Offset:  640 Size:    16 [unused]
//   float3 ViewPoint;                  // Offset:  656 Size:    12 [unused]
//   float3 CameraPosition;             // Offset:  672 Size:    12
//   float3 CameraPosition_Previous;    // Offset:  688 Size:    12 [unused]
//   float3 CameraPositionFractions;    // Offset:  704 Size:    12 [unused]
//   float3 CameraPositionFractions_Previous;// Offset:  720 Size:    12 [unused]
//   float3 CameraRight;                // Offset:  736 Size:    12 [unused]
//   float3 CameraUp;                   // Offset:  752 Size:    12 [unused]
//   float3 CameraDirection;            // Offset:  768 Size:    12 [unused]
//   float3 EnvironmentMapColorOffset;  // Offset:  784 Size:    12 [unused]
//   float3 EnvironmentMapColorScale;   // Offset:  800 Size:    12 [unused]
//   float3 AmbientOcclusionRanges;     // Offset:  816 Size:    12 [unused]
//   float3 DepthTextureRcpSize;        // Offset:  832 Size:    12 [unused]
//   float2 MotionVectorOffsets;        // Offset:  848 Size:     8 [unused]
//   float2 DepthRangeCompression;      // Offset:  856 Size:     8 [unused]
//   float ShadowProjDepthMinValue;     // Offset:  864 Size:     4 [unused]
//   float DistanceScale;               // Offset:  868 Size:     4 [unused]
//   float WorldSpaceZOffset;           // Offset:  872 Size:     4 [unused]
//   float WorldSpaceZOffset_Previous;  // Offset:  876 Size:     4 [unused]
//   float CameraFOVDeg;                // Offset:  880 Size:     4 [unused]
//   float EffectsEmissiveEVBias;       // Offset:  884 Size:     4 [unused]
//   float ShadowCSMLastSliceIndex;     // Offset:  888 Size:     4
//   float UseNormalization;            // Offset:  892 Size:     4 [unused]
//   float FogUndergroundColorScale;    // Offset:  896 Size:     4 [unused]
//
// }
//
// cbuffer CNewLightingDataProvider
// {
//
//   float4x4 ShadowProjectionMatrix;   // Offset:    0 Size:    64 [unused]
//   float4x4 ShadowRotProjectionMatrix;// Offset:   64 Size:    64 [unused]
//   float4 CSMSlice0_0;                // Offset:  128 Size:    16
//   float4 CSMSlice0_1;                // Offset:  144 Size:    16
//   float4 CSMSlice0_2;                // Offset:  160 Size:    16
//   float4 CSMSlice1_0;                // Offset:  176 Size:    16
//   float4 CSMSlice1_1;                // Offset:  192 Size:    16
//   float4 CSMSlice1_2;                // Offset:  208 Size:    16
//   float4 CSMSlice2_0;                // Offset:  224 Size:    16
//   float4 CSMSlice2_1;                // Offset:  240 Size:    16
//   float4 CSMSlice2_2;                // Offset:  256 Size:    16
//   float4 CSMSliceFade;               // Offset:  272 Size:    16 [unused]
//   float4 ShadowMapSize;              // Offset:  288 Size:    16
//   float3 LightColor;                 // Offset:  304 Size:    12 [unused]
//   float3 LightColorUpNormal;         // Offset:  320 Size:    12 [unused]
//   float3 LightDirectionWS;           // Offset:  336 Size:    12 [unused]
//   float3 LightPositionWS;            // Offset:  352 Size:    12 [unused]
//   float3 LightRightWS;               // Offset:  368 Size:    12 [unused]
//   float3 LightUpWS;                  // Offset:  384 Size:    12 [unused]
//   float RcpSquaredLightRadius;       // Offset:  396 Size:     4 [unused]
//   float2 SpotFactors;                // Offset:  400 Size:     8 [unused]
//   float PointAttenuation;            // Offset:  408 Size:     4 [unused]
//
// }
//
// cbuffer CSceneTerrainShadowAtlasPrivateData
// {
//
//   float4 SectorOffsetScale;          // Offset:    0 Size:    16
//   float2 LongRangeShadowFade;        // Offset:   16 Size:     8
//
// }
//
// cbuffer CDepthReconstructionProvider
// {
//
//   float4x4 InvViewRotProjectionMatrix;// Offset:    0 Size:    64
//   float4x4 ReconsInvViewRotProjectionMatrix;// Offset:   64 Size:    64 [unused]
//   float3 ReconsCamPosition;          // Offset:  128 Size:    12 [unused]
//   float ReconsDepthMul;              // Offset:  140 Size:     4 [unused]
//   float ReconsDepthOffset;           // Offset:  144 Size:     4 [unused]
//   float ReconsViewFar;               // Offset:  148 Size:     4 [unused]
//   float ReconsViewNear;              // Offset:  152 Size:     4 [unused]
//   float ReconsViewOORange;           // Offset:  156 Size:     4 [unused]
//   float ReconsViewRange;             // Offset:  160 Size:     4 [unused]
//
// }
//
// cbuffer CCloudShadowParameterProvider
// {
//
//   float4 CloudSettings;              // Offset:    0 Size:    16
//   float4 SunColor;                   // Offset:   16 Size:    16 [unused]
//   float3 PlayerPosition;             // Offset:   32 Size:    12
//   float3 SunDirection;               // Offset:   48 Size:    12
//   float4 CloudShadowsSettings;       // Offset:   64 Size:    16
//   float4 CloudShadowsDistances;      // Offset:   80 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// DepthVPSampler__SampObj__         sampler      NA          NA    0        1
// ShadowCmpSampler                sampler_c      NA          NA    1        1
// SkyDomeColorWrap                  sampler      NA          NA    2        1
// DepthVPSampler__TexObj__          texture  float4          2d    0        1
// ShadowCmpSampler_TextureObject    texture  float4     2darray    1        1
// SectorAtlasTexture_UINT_TextureObject    texture   uint4          2d    2        1
// CloudShadowTexture                texture  float4          2d    3        1
// CViewportShaderParameterProvider    cbuffer      NA          NA    0        1
// CNewLightingDataProvider          cbuffer      NA          NA    1        1
// CSceneTerrainShadowAtlasPrivateData    cbuffer      NA          NA    2        1
// CDepthReconstructionProvider      cbuffer      NA          NA    3        1
// CCloudShadowParameterProvider     cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xyzw        1     NONE   float   xy  
// SV_IsFrontFace           0   x           2    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[56], immediateIndexed
dcl_constantbuffer cb1[19], immediateIndexed
dcl_constantbuffer cb2[2], immediateIndexed
dcl_constantbuffer cb3[4], immediateIndexed
dcl_constantbuffer cb4[6], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_comparison
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2darray (float,float,float,float) t1
dcl_resource_texture2d (uint,uint,uint,uint) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 18
dcl_resource_texture2d (float,float,float,float) t125

ld_indexable(texture2d)(float,float,float,float) r16.xyzw, l(0, 0, 0, 0), t125.xyzw

sample_l_indexable(texture2d)(float,float,float,float) r0.x, v1.xyxx, t0.xyzw, s0, l(0.000000)
mad r0.x, cb0[33].y, r0.x, cb0[33].x
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mul r0.y, cb0[31].y, cb0[31].x
mul r0.x, r0.x, cb0[31].z

// Depth:
mov r17.w, r0.x

div r0.x, r0.y, r0.x
add r0.x, -r0.x, cb0[31].y
mad r0.z, -r0.x, cb0[31].w, l(1.000000)
mad r0.xy, v1.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mov r0.w, l(1.000000)
dp4 r1.x, r0.xyzw, cb3[0].xyzw
dp4 r1.y, r0.xyzw, cb3[1].xyzw
dp4 r1.z, r0.xyzw, cb3[2].xyzw
dp4 r0.x, r0.xyzw, cb3[3].xyzw
div r0.xyz, r1.xyzx, r0.xxxx

add r16.w, r17.w, -r16.y
mul r17.x, r16.w, r16.x
mov r17.yzw, l(0)

dp4 r16.x, r17.xyzw, cb0[0].xyzw
dp4 r16.y, r17.xyzw, cb0[1].xyzw
dp4 r16.z, r17.xyzw, cb0[2].xyzw
dp4 r16.w, r17.xyzw, cb0[3].xyzw
dp4 r17.x, r16.xyzw, cb0[4].xyzw
dp4 r17.y, r16.xyzw, cb0[5].xyzw
dp4 r17.z, r16.xyzw, cb0[6].xyzw

add r0.xyz, r0.xyz, -r17.xyz

add r1.xyz, r0.xyzx, cb0[42].xyzx
add r2.xyz, r1.xyzx, -cb4[2].xyzx
dp3 r0.w, -cb4[3].xyzx, -cb4[3].xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, -cb4[3].xyzx
dp3 r0.w, r2.xyzx, r3.xyzx
add r2.w, r0.w, r0.w
dp3 r3.w, r2.xyzx, r2.xyzx
mad r4.x, -cb4[0].z, cb4[0].z, r3.w
mul r4.x, r4.x, l(4.000000)
mad r2.w, r2.w, r2.w, -r4.x
sqrt r2.w, r2.w
mad r4.x, -r0.w, l(2.000000), -r2.w
mul r4.x, r4.x, l(0.500000)
mad r0.w, -r0.w, l(2.000000), r2.w
mul r0.w, r0.w, l(0.500000)
max r0.w, r0.w, r4.x
mad r2.xyz, r3.xyzx, r0.wwww, r2.xyzx
div r0.w, r2.y, r2.x
min r2.w, |r0.w|, l(1.000000)
max r3.x, |r0.w|, l(1.000000)
div r3.x, l(1.000000, 1.000000, 1.000000, 1.000000), r3.x
mul r2.w, r2.w, r3.x
mul r3.x, r2.w, r2.w
mad r3.y, r3.x, l(0.0208350997), l(-0.085133)
mad r3.y, r3.x, r3.y, l(0.180141)
mad r3.y, r3.x, r3.y, l(-0.330299497)
mad r3.x, r3.x, r3.y, l(0.999866)
mul r3.y, r2.w, r3.x
lt r3.z, l(1.000000), |r0.w|
mad r3.y, r3.y, l(-2.000000), l(1.57079637)
and r3.y, r3.z, r3.y
mad r2.w, r2.w, r3.x, r3.y
min r0.w, r0.w, l(1.000000)
lt r0.w, r0.w, -r0.w
movc r0.w, r0.w, -r2.w, r2.w
mul r0.w, r0.w, l(-0.318309873)
frc r0.w, r0.w
mad r3.x, cb4[0].y, l(0.300000), r0.w
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul_sat r0.w, r0.w, r2.z
mad r3.y, -r0.w, l(0.915000), l(1.000000)
sample_l_indexable(texture2d)(float,float,float,float) r0.w, r3.xyxx, t3.xyzw, s2, l(0.000000)
mul r0.w, r0.w, cb4[4].y
mul r0.w, r0.w, r0.w
mad r2.xy, -r0.wwww, cb4[4].zwzz, l(1.000000, 1.000000, 0.000000, 0.000000)
sqrt r0.w, r3.w
add r2.z, -cb4[5].x, cb4[5].y
add r0.w, r0.w, -cb4[5].x
div r2.z, l(1.000000, 1.000000, 1.000000, 1.000000), r2.z
mul_sat r0.w, r0.w, r2.z
mad r2.z, r0.w, l(-2.000000), l(3.000000)
mul r0.w, r0.w, r0.w
mul r0.w, r0.w, r2.z
add r2.y, -r2.x, r2.y
mad r0.w, r0.w, r2.y, r2.x
mov r1.w, l(1.000000)
dp4 r2.x, r1.xyzw, cb1[14].xyzw
dp4 r2.y, r1.xyzw, cb1[15].xyzw
dp4 r2.z, r1.xyzw, cb1[16].xyzw
dp4 r3.x, r1.xyzw, cb1[11].xyzw
dp4 r3.y, r1.xyzw, cb1[12].xyzw
dp4 r3.z, r1.xyzw, cb1[13].xyzw
add r4.xyz, r3.xyzx, l(-0.000000, -0.000000, -0.001000, 0.000000)
ge r5.xyz, r4.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r5.xyz, r5.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
ge r4.xyz, l(1.000000, 1.000000, 1.000000, 0.000000), r4.xyzx
and r4.xyz, r4.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
mul r4.xyz, r4.xyzx, r5.xyzx
dp3 r4.x, r4.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
ge r4.x, r4.x, l(3.000000)
mov r3.w, l(1.000000)
mov r2.w, l(2.000000)
movc r4.xyzw, r4.xxxx, r3.xyzw, r2.xyzw
dp4 r5.x, r1.xyzw, cb1[8].xyzw
dp4 r5.y, r1.xyzw, cb1[9].xyzw
dp4 r5.z, r1.xyzw, cb1[10].xyzw
add r6.xyz, r5.xyzx, l(-0.000000, -0.000000, -0.001000, 0.000000)
ge r7.xyz, r6.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r7.xyz, r7.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
ge r6.xyz, l(1.000000, 1.000000, 1.000000, 0.000000), r6.xyzx
and r6.xyz, r6.xyzx, l(0x3f800000, 0x3f800000, 0x3f800000, 0)
mul r6.xyz, r6.xyzx, r7.xyzx
dp3 r1.w, r6.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
ge r1.w, r1.w, l(3.000000)
mov r5.w, l(0)
movc r4.xyzw, r1.wwww, r5.xyzw, r4.xyzw
min r6.z, r4.w, cb0[55].z
eq r1.w, r6.z, cb0[55].z
if_nz r1.w
  dp3 r0.x, r0.xyzx, r0.xyzx
  sqrt r0.x, r0.x
  mad r0.yz, r1.yyxy, cb2[0].yyxy, cb2[0].wwzw
  resinfo_indexable(texture2d)(uint,uint,uint,uint)_uint r1.xy, l(0), t2.xyzw
  utof r7.xy, r1.xyxx
  mad r0.yz, r0.yyzy, r7.xxyx, l(0.000000, 0.500000, 0.500000, 0.000000)
  frc r7.xy, r0.zyzz
  add r7.zw, -r7.yyyx, l(0.000000, 0.000000, 1.000000, 1.000000)
  mul r8.xyzw, r7.xxyw, r7.zywz
  ftou r0.yz, r0.yyzy
  iadd r0.yz, r0.yyzy, r1.xxyx
  iadd r7.xyzw, r0.yzyz, l(-1, 0, 0, -1)
  udiv null, r9.xy, r0.yzyy, r1.xyxx
  udiv null, r7.xyzw, r7.zwxy, r1.xyxy
  iadd r0.yz, r0.yyzy, l(0, -1, -1, 0)
  udiv null, r10.xy, r0.yzyy, r1.xyxx
  mov r11.xy, r7.zwzz
  mov r11.zw, l(0,0,0,0)
  ld_indexable(texture2d)(uint,uint,uint,uint) r0.yz, r11.xyzw, t2.zxyw
  mov r9.zw, l(0,0,0,0)
  ld_indexable(texture2d)(uint,uint,uint,uint) r1.xy, r9.xyzw, t2.xyzw
  mov r7.zw, l(0,0,0,0)
  ld_indexable(texture2d)(uint,uint,uint,uint) r7.xy, r7.xyzw, t2.xyzw
  mov r10.zw, l(0,0,0,0)
  ld_indexable(texture2d)(uint,uint,uint,uint) r9.xw, r10.xyzw, t2.yzwx
  f16tof32 r10.x, r0.z
  f16tof32 r10.y, r1.y
  f16tof32 r10.z, r7.y
  f16tof32 r10.w, r9.x
  dp4 r0.z, r10.xyzw, r8.xyzw
  mov r9.x, r0.y
  mov r9.y, r1.x
  mov r9.z, r7.x
  or r7.xyzw, r9.xyzw, l(0xffff8000, 0xffff8000, 0xffff8000, 0xffff8000)
  add r0.y, -r0.z, r1.z
  mul r1.x, r0.y, l(0.250000)
  ftoi r1.x, r1.x
  imul null, r1.y, r1.x, l(3)
  ishl r1.w, l(7), r1.y
  and r9.xyzw, r1.wwww, r7.xyzw
  ushr r9.xyzw, r9.xyzw, r1.yyyy
  utof r9.xyzw, r9.xyzw
  mul r9.xyzw, r9.xyzw, l(0.142857149, 0.142857149, 0.142857149, 0.142857149)
  dp4 r1.y, r9.xyzw, r8.xyzw
  iadd r1.x, r1.x, l(1)
  imul null, r1.x, r1.x, l(3)
  ishl r1.w, l(7), r1.x
  and r7.xyzw, r1.wwww, r7.xyzw
  ushr r7.xyzw, r7.xyzw, r1.xxxx
  utof r7.xyzw, r7.xyzw
  mul r7.xyzw, r7.xyzw, l(0.142857149, 0.142857149, 0.142857149, 0.142857149)
  dp4 r1.x, r7.xyzw, r8.xyzw
  mul r0.y, |r0.y|, l(0.250000)
  ge r1.w, r0.y, -r0.y
  frc r0.y, r0.y
  movc r0.y, r1.w, r0.y, -r0.y
  add r1.x, -r1.y, r1.x
  mad r0.y, r0.y, r1.x, r1.y
  add r0.z, r0.z, l(20.000000)
  add r0.z, -r0.z, r1.z
  mul_sat r0.z, r0.z, l(0.050000)
  add r1.x, -r0.y, l(1.000000)
  mad r0.y, r0.z, r1.x, r0.y
  mad_sat r0.x, r0.x, cb2[1].x, cb2[1].y
  add r0.z, -r0.y, l(1.000000)
  mad r0.x, r0.x, r0.z, r0.y
  mul r0.x, r0.w, r0.x
  mad r0.yz, r2.xxyx, l(0.000000, 2.000000, 2.000000, 0.000000), l(0.000000, -1.000000, -1.000000, 0.000000)
  add r0.yz, |r0.yyzy|, l(0.000000, -0.800000, -0.800000, 0.000000)
  mul_sat r0.yz, r0.yyzy, l(0.000000, 5.000000, 5.000000, 0.000000)
  add r0.yz, -r0.yyzy, l(0.000000, 1.000000, 1.000000, 0.000000)
  add r1.x, r2.z, l(-0.500000)
  mad r1.x, -|r1.x|, l(2.000000), l(1.000000)
  max r1.x, r1.x, l(0.000000)
  min r1.x, r1.x, l(0.200000)
  mul r1.x, r1.x, l(5.000000)
  min r0.y, r0.z, r0.y
  min r0.y, r1.x, r0.y
  mad r1.xy, r4.xyxx, cb1[18].xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
  round_ni r1.zw, r1.xxxy
  add r1.xy, -r1.zwzz, r1.xyxx
  add r1.zw, r1.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000)
  mad r7.xy, -r1.yxyy, l(2.000000, 2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
  mad r7.zw, r1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, 1.000000, 1.000000)
  add r8.xy, -r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000)
  div r8.xy, r8.xyxx, r7.yxyy
  div r1.xy, r1.xyxx, r7.zwzz
  add r8.zw, r8.xxxy, l(0.000000, 0.000000, -1.000000, -1.000000)
  add r8.xy, r1.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
  mul r0.z, r7.x, r7.y
  mul r9.xyzw, r8.zwxw, cb1[18].zwzw
  mad r10.xy, r1.zwzz, cb1[18].zwzz, r9.xyxx
  mov r10.z, cb0[55].z
  sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.x, r10.xyzx, t1.xxxx, s1, r4.z
  mul r7.xy, r7.xyxx, r7.zwzz
  mad r9.xy, r1.zwzz, cb1[18].zwzz, r9.zwzz
  mov r9.z, cb0[55].z
  sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r9.xyzx, t1.xxxx, s1, r4.z
  mul r1.y, r1.y, r7.x
  mad r0.z, r0.z, r1.x, r1.y
  mul r8.xyzw, r8.zyxy, cb1[18].zwzw
  mad r9.xy, r1.zwzz, cb1[18].zwzz, r8.xyxx
  mov r9.z, cb0[55].z
  sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.x, r9.xyzx, t1.xxxx, s1, r4.z
  mad r0.z, r7.y, r1.x, r0.z
  mul r1.x, r7.w, r7.z
  mad r7.xy, r1.zwzz, cb1[18].zwzz, r8.zwzz
  mov r7.z, cb0[55].z
  sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r7.xyzx, t1.xxxx, s1, r4.z
  mad r0.z, r1.x, r1.y, r0.z
  mad r0.z, r0.z, l(0.062500), -r0.x
  mad r0.x, r0.y, r0.z, r0.x
else 
  eq r0.y, r6.z, l(1.000000)
  if_nz r0.y
    mad r0.yz, r4.xxyx, cb1[18].xxyx, l(0.000000, 0.500000, 0.500000, 0.000000)
    round_ni r1.xy, r0.yzyy
    add r0.yz, r0.yyzy, -r1.xxyx
    add r1.xy, r1.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
    mul r1.zw, r1.xxxy, cb1[18].zzzw
    mad r7.xy, -r0.zyzz, l(3.000000, 3.000000, 0.000000, 0.000000), l(4.000000, 4.000000, 0.000000, 0.000000)
    mad r7.zw, r0.yyyz, l(0.000000, 0.000000, 3.000000, 3.000000), l(0.000000, 0.000000, 1.000000, 1.000000)
    mad r8.xy, -r0.yzyy, l(2.000000, 2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
    div r8.xy, r8.xyxx, r7.yxyy
    add r8.zw, r0.yyyz, l(0.000000, 0.000000, 3.000000, 3.000000)
    div r0.yz, r0.yyzy, r7.zzwz
    add r9.xw, r8.xxxy, l(-2.000000, 0.000000, 0.000000, -2.000000)
    mul r9.yz, r8.wwzw, l(0.000000, 0.142857149, 0.142857149, 0.000000)
    add r8.xy, r0.yzyy, l(2.000000, 2.000000, 0.000000, 0.000000)
    mul r0.y, r7.x, r7.y
    mul r10.xyzw, r9.xwzw, cb1[18].zwzw
    mad r11.xy, r1.xyxx, cb1[18].zwzz, r10.xyxx
    mov r11.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r11.xyzx, t1.xxxx, s1, r4.z
    mul r10.xy, r7.xyxx, l(7.000000, 7.000000, 0.000000, 0.000000)
    mad r11.xy, r1.xyxx, cb1[18].zwzz, r10.zwzz
    mov r11.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r2.w, r11.xyzx, t1.xxxx, s1, r4.z
    mul r2.w, r2.w, r10.x
    mad r0.y, r0.y, r0.z, r2.w
    mul r7.xy, r7.xyxx, r7.zwzz
    mov r8.zw, r9.wwwy
    mul r11.xyzw, r8.xzxw, cb1[18].zwzw
    mad r12.xy, r1.xyxx, cb1[18].zwzz, r11.xyxx
    mov r12.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r12.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r7.x, r0.z, r0.y
    mul r12.xyzw, r9.xyzy, cb1[18].zwzw
    mad r13.xy, r1.xyxx, cb1[18].zwzz, r12.xyxx
    mov r13.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r13.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r10.y, r0.z, r0.y
    mad r10.xy, r1.xyxx, cb1[18].zwzz, r12.zwzz
    mov r10.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r10.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r0.z, l(49.000000), r0.y
    mul r8.zw, r7.zzzw, l(0.000000, 0.000000, 7.000000, 7.000000)
    mad r10.xy, r1.xyxx, cb1[18].zwzz, r11.zwzz
    mov r10.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r10.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r8.z, r0.z, r0.y
    mov r9.y, r8.y
    mul r9.xyzw, r9.xyzy, cb1[18].zwzw
    mad r10.xy, r1.xyxx, cb1[18].zwzz, r9.xyxx
    mov r10.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r10.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r7.y, r0.z, r0.y
    mad r9.xy, r1.xyxx, cb1[18].zwzz, r9.zwzz
    mov r9.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r9.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r8.w, r0.z, r0.y
    mul r0.z, r7.w, r7.z
    mad r1.xy, r8.xyxx, cb1[18].zwzz, r1.zwzz
    mov r1.z, l(1.000000)
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.x, r1.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r0.z, r1.x, r0.y
    mad r1.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
    add r1.xy, |r1.xyxx|, l(-0.800000, -0.800000, 0.000000, 0.000000)
    mul_sat r1.xy, r1.xyxx, l(5.000000, 5.000000, 0.000000, 0.000000)
    add r1.xy, -r1.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
    add r0.z, r3.z, l(-0.500000)
    mad r0.z, -|r0.z|, l(2.000000), l(1.000000)
    max r0.z, r0.z, l(0.000000)
    min r0.z, r0.z, l(0.200000)
    mul r0.xz, r0.yyzy, l(0.00694444450, 0.000000, 5.000000, 0.000000)
    min r1.x, r1.y, r1.x
    min r0.z, r0.z, r1.x
    ne r1.x, r0.z, l(1.000000)
    if_nz r1.x
      mad r1.xy, r2.xyxx, cb1[18].xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
      round_ni r1.zw, r1.xxxy
      add r1.xy, -r1.zwzz, r1.xyxx
      add r1.zw, r1.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000)
      mad r2.xy, -r1.yxyy, l(2.000000, 2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
      mad r7.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(1.000000, 1.000000, 0.000000, 0.000000)
      add r7.zw, -r1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000)
      div r7.zw, r7.zzzw, r2.yyyx
      div r1.xy, r1.xyxx, r7.xyxx
      add r8.zw, r7.zzzw, l(0.000000, 0.000000, -1.000000, -1.000000)
      add r8.xy, r1.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
      mul r1.x, r2.x, r2.y
      mul r9.xyzw, r8.zwxw, cb1[18].zwzw
      mad r10.xy, r1.zwzz, cb1[18].zwzz, r9.xyxx
      mov r10.z, l(2.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r10.xyzx, t1.xxxx, s1, r2.z
      mul r2.xy, r2.xyxx, r7.xyxx
      mad r9.xy, r1.zwzz, cb1[18].zwzz, r9.zwzz
      mov r9.z, l(2.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r2.w, r9.xyzx, t1.xxxx, s1, r2.z
      mul r2.x, r2.w, r2.x
      mad r1.x, r1.x, r1.y, r2.x
      mul r8.xyzw, r8.zyxy, cb1[18].zwzw
      mad r9.xy, r1.zwzz, cb1[18].zwzz, r8.xyxx
      mov r9.z, l(2.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r9.xyzx, t1.xxxx, s1, r2.z
      mad r1.x, r2.y, r1.y, r1.x
      mul r1.y, r7.y, r7.x
      mad r7.xy, r1.zwzz, cb1[18].zwzz, r8.zwzz
      mov r7.z, l(2.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.z, r7.xyzx, t1.xxxx, s1, r2.z
      mad r1.x, r1.y, r1.z, r1.x
      mul r1.x, r1.x, l(0.062500)
      mad r0.y, r0.y, l(0.00694444450), -r1.x
      mad r0.x, r0.z, r0.y, r1.x
    endif 
  else 
    mad r0.yz, r4.xxyx, cb1[18].xxyx, l(0.000000, 0.500000, 0.500000, 0.000000)
    round_ni r1.xy, r0.yzyy
    add r0.yz, r0.yyzy, -r1.xxyx
    add r1.xy, r1.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000)
    mul r1.zw, r1.xxxy, cb1[18].zzzw
    mad r2.xyzw, r0.yyyy, l(11.000000, 11.000000, 5.000000, 5.000000), l(-28.000000, 17.000000, -6.000000, 1.000000)
    mad r4.xyw, r0.yyyy, l(4.000000, 4.000000, 0.000000, 7.000000), l(-5.000000, -16.000000, 0.000000, 5.000000)
    div r4.xyw, r4.xyxw, r2.zxzy
    add r7.xyz, r4.yxwy, l(-1.000000, -3.000000, 1.000000, 0.000000)
    div r0.y, r0.y, r2.w
    add r8.x, r0.y, l(3.000000)
    mad r9.xyzw, r0.zzzz, l(11.000000, 11.000000, 5.000000, 5.000000), l(-28.000000, 17.000000, -6.000000, 1.000000)
    mad r4.xyw, r0.zzzz, l(4.000000, 4.000000, 0.000000, 7.000000), l(-5.000000, -16.000000, 0.000000, 5.000000)
    div r4.xyw, r4.xyxw, r9.zxzy
    add r10.xyz, r4.xywx, l(-3.000000, -1.000000, 1.000000, 0.000000)
    div r0.y, r0.z, r9.w
    add r11.y, r0.y, l(3.000000)
    mul r12.xyzw, r2.zxzx, r9.zzxx
    mov r7.w, r10.x
    mul r13.xyzw, r7.ywxw, cb1[18].zwzw
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r13.xyxx
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.y, r6.xyzx, t1.xxxx, s1, r4.z
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r13.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mul r0.z, r0.z, r12.y
    mad r0.y, r12.x, r0.y, r0.z
    mul r13.xyzw, -r2.ywyw, r9.zzxx
    mad r6.xy, r7.zwzz, cb1[18].zwzz, r1.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r13.x, r0.z, r0.y
    mov r8.y, r7.w
    mad r6.xy, r8.xyxx, cb1[18].zwzz, r1.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r13.y, r0.z, r0.y
    mov r10.w, r7.y
    mul r14.xyzw, r10.wywz, cb1[18].zwzw
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r14.xyxx
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r12.z, r0.z, r0.y
    mov r7.yw, r10.yyyz
    mul r15.xyzw, r7.xyzy, cb1[18].zwzw
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r15.xyxx
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r12.w, r0.z, r0.y
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r15.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r13.z, r0.z, r0.y
    mov r8.zw, r7.yyyw
    mul r12.xyzw, r8.xzxw, cb1[18].zwzw
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r12.xyxx
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r13.w, r0.z, r0.y
    mul r13.xyzw, r2.zxzx, -r9.yyww
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r14.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r13.x, r0.z, r0.y
    mul r14.xyzw, r7.xwzw, cb1[18].zwzw
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r14.xyxx
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r13.y, r0.z, r0.y
    mul r2.xyzw, r2.ywyw, r9.yyww
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r14.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r2.x, r0.z, r0.y
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r12.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r2.y, r0.z, r0.y
    mov r11.x, r10.w
    mad r6.xy, r11.xyxx, cb1[18].zwzz, r1.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r13.z, r0.z, r0.y
    mov r11.zw, r7.xxxz
    mul r7.xyzw, r11.zywy, cb1[18].zwzw
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r7.xyxx
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r13.w, r0.z, r0.y
    mad r6.xy, r1.xyxx, cb1[18].zwzz, r7.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r2.z, r0.z, r0.y
    mov r11.x, r8.x
    mad r6.xy, r11.xyxx, cb1[18].zwzz, r1.zwzz
    sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r0.z, r6.xyzx, t1.xxxx, s1, r4.z
    mad r0.y, r2.w, r0.z, r0.y
    mad r1.xy, r5.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
    add r1.xy, |r1.xyxx|, l(-0.800000, -0.800000, 0.000000, 0.000000)
    mul_sat r1.xy, r1.xyxx, l(5.000000, 5.000000, 0.000000, 0.000000)
    add r1.xy, -r1.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000)
    add r0.z, r5.z, l(-0.500000)
    mad r0.z, -|r0.z|, l(2.000000), l(1.000000)
    max r0.z, r0.z, l(0.000000)
    min r0.z, r0.z, l(0.200000)
    mul r0.xz, r0.yyzy, l(0.000369822490, 0.000000, 5.000000, 0.000000)
    min r1.x, r1.y, r1.x
    min r0.z, r0.z, r1.x
    ne r1.x, r0.z, l(1.000000)
    if_nz r1.x
      mad r1.xy, r3.xyxx, cb1[18].xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
      round_ni r1.zw, r1.xxxy
      add r1.xy, -r1.zwzz, r1.xyxx
      add r1.zw, r1.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000)
      mul r2.xy, r1.zwzz, cb1[18].zwzz
      mad r2.zw, -r1.yyyx, l(0.000000, 0.000000, 3.000000, 3.000000), l(0.000000, 0.000000, 4.000000, 4.000000)
      mad r3.xy, r1.xyxx, l(3.000000, 3.000000, 0.000000, 0.000000), l(1.000000, 1.000000, 0.000000, 0.000000)
      mad r4.xy, -r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(3.000000, 3.000000, 0.000000, 0.000000)
      div r4.xy, r4.xyxx, r2.wzww
      add r4.zw, r1.xxxy, l(0.000000, 0.000000, 3.000000, 3.000000)
      div r1.xy, r1.xyxx, r3.xyxx
      add r5.xw, r4.xxxy, l(-2.000000, 0.000000, 0.000000, -2.000000)
      mul r5.yz, r4.wwzw, l(0.000000, 0.142857149, 0.142857149, 0.000000)
      add r4.xy, r1.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000)
      mul r1.x, r2.z, r2.w
      mul r6.xyzw, r5.xwzw, cb1[18].zwzw
      mad r7.xy, r1.zwzz, cb1[18].zwzz, r6.xyxx
      mov r7.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r7.xyzx, t1.xxxx, s1, r3.z
      mul r6.xy, r2.zwzz, l(7.000000, 7.000000, 0.000000, 0.000000)
      mad r7.xy, r1.zwzz, cb1[18].zwzz, r6.zwzz
      mov r7.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r3.w, r7.xyzx, t1.xxxx, s1, r3.z
      mul r3.w, r3.w, r6.x
      mad r1.x, r1.x, r1.y, r3.w
      mul r2.zw, r2.zzzw, r3.xxxy
      mov r4.zw, r5.wwwy
      mul r7.xyzw, r4.xzxw, cb1[18].zwzw
      mad r8.xy, r1.zwzz, cb1[18].zwzz, r7.xyxx
      mov r8.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r8.xyzx, t1.xxxx, s1, r3.z
      mad r1.x, r2.z, r1.y, r1.x
      mul r8.xyzw, r5.xyzy, cb1[18].zwzw
      mad r9.xy, r1.zwzz, cb1[18].zwzz, r8.xyxx
      mov r9.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r9.xyzx, t1.xxxx, s1, r3.z
      mad r1.x, r6.y, r1.y, r1.x
      mad r6.xy, r1.zwzz, cb1[18].zwzz, r8.zwzz
      mov r6.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r6.xyzx, t1.xxxx, s1, r3.z
      mad r1.x, r1.y, l(49.000000), r1.x
      mul r4.zw, r3.xxxy, l(0.000000, 0.000000, 7.000000, 7.000000)
      mad r6.xy, r1.zwzz, cb1[18].zwzz, r7.zwzz
      mov r6.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r6.xyzx, t1.xxxx, s1, r3.z
      mad r1.x, r4.z, r1.y, r1.x
      mov r5.y, r4.y
      mul r5.xyzw, r5.xyzy, cb1[18].zwzw
      mad r6.xy, r1.zwzz, cb1[18].zwzz, r5.xyxx
      mov r6.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r6.xyzx, t1.xxxx, s1, r3.z
      mad r1.x, r2.w, r1.y, r1.x
      mad r5.xy, r1.zwzz, cb1[18].zwzz, r5.zwzz
      mov r5.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.y, r5.xyzx, t1.xxxx, s1, r3.z
      mad r1.x, r4.w, r1.y, r1.x
      mul r1.y, r3.y, r3.x
      mad r2.xy, r4.xyxx, cb1[18].zwzz, r2.xyxx
      mov r2.z, l(1.000000)
      sample_c_lz_aoffimmi_indexable(0,0,0)(texture2darray)(float,float,float,float) r1.z, r2.xyzx, t1.xxxx, s1, r3.z
      mad r1.x, r1.y, r1.z, r1.x
      mul r1.x, r1.x, l(0.00694444450)
      mad r0.y, r0.y, l(0.000369822490), -r1.x
      mad r0.x, r0.z, r0.y, r1.x
    endif 
  endif 
endif 
mul o0.xyzw, r0.wwww, r0.xxxx
ret 
// Approximately 497 instruction slots used