//DMC5 tutorial mirror?
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//   using 3Dmigoto v1.3.14 on Sun Mar 10 10:30:17 2019
//
//
// Note: shader requires additional functionality:
//       Minimum-precision data types
//
//
// Buffer Definitions:
//
// cbuffer SceneInfo
// {
//
//   row_major float4x4 viewProjMat;    // Offset:    0 Size:    64
//   row_major float3x4 transposeViewMat;// Offset:   64 Size:    48 [unused]
//   row_major float3x4 transposeViewInvMat;// Offset:  112 Size:    48
//   float4 projElement[2];             // Offset:  160 Size:    32 [unused]
//   float4 projInvElements[2];         // Offset:  192 Size:    32 [unused]
//   row_major float4x4 viewProjInvMat; // Offset:  224 Size:    64 [unused]
//   row_major float4x4 prevViewProjMat;// Offset:  288 Size:    64 [unused]
//   float3 ZToLinear;                  // Offset:  352 Size:    12 [unused]
//   float subdivisionLevel;            // Offset:  364 Size:     4 [unused]
//   float2 screenSize;                 // Offset:  368 Size:     8 [unused]
//   float2 screenInverseSize;          // Offset:  376 Size:     8 [unused]
//   float2 cullingHelper;              // Offset:  384 Size:     8 [unused]
//   float cameraNearPlane;             // Offset:  392 Size:     4 [unused]
//   float cameraFarPlane;              // Offset:  396 Size:     4 [unused]
//   float4 viewFrustum[6];             // Offset:  400 Size:    96 [unused]
//   float4 clipplane;                  // Offset:  496 Size:    16 [unused]
//
// }
//
// cbuffer World
// {
//
//   row_major float4x4 worldMat;       // Offset:    0 Size:    64
//   row_major float4x4 prevWorldMat;   // Offset:   64 Size:    64 [unused]
//   int jointOffset;                   // Offset:  128 Size:     4 [unused]
//   int prevJoinOffset;                // Offset:  132 Size:     4 [unused]
//   int2 reserveWorld;                 // Offset:  136 Size:     8 [unused]
//
// }
//
// cbuffer LightDataBuffer
// {
//
//   uint GUIPunctualLightCount;        // Offset:    0 Size:     4
//   uint LightMask;                    // Offset:    4 Size:     4
//   uint dummy0;                       // Offset:    8 Size:     4 [unused]
//   uint dummy1;                       // Offset:   12 Size:     4 [unused]
//
// }
//
// cbuffer ColorAdjust
// {
//
//   float4 colorTransform;             // Offset:    0 Size:    16
//   float stencilScale;                // Offset:   16 Size:     4
//   float padding0;                    // Offset:   20 Size:     4 [unused]
//   float padding1;                    // Offset:   24 Size:     4 [unused]
//   float padding2;                    // Offset:   28 Size:     4 [unused]
//
// }
//
// cbuffer UserMaterial
// {
//
//   float4 VAR_CrackMaskPos;           // Offset:    0 Size:    16
//   float4 VAR_UIBase_Pos;             // Offset:   16 Size:    16
//   float4 VAR_UI_Base_Color;          // Offset:   32 Size:    16
//   float4 VAR_GlassColor_Side;        // Offset:   48 Size:    16
//   float4 VAR_GlassColor_Surface;     // Offset:   64 Size:    16
//   float4 VAR_Reflection_Distortion_Power;// Offset:   80 Size:    16
//   float4 VAR_ColorParam;             // Offset:   96 Size:    16
//   float4 VAR_Reflection_Pos;         // Offset:  112 Size:    16
//   float4 VAR_Refraction_Distortion_Power;// Offset:  128 Size:    16
//   float4 VAR_BloodBase_Pos;          // Offset:  144 Size:    16
//   float4 VAR_ColorParam_2;           // Offset:  160 Size:    16
//   float4 VAR_FakeLightPos;           // Offset:  176 Size:    16
//   float4 VAR_Float4Param;            // Offset:  192 Size:    16 [unused]
//   float VAR_CrackMask_CenterIntensity;// Offset:  208 Size:     4
//   float VAR_CrackMask_Fade;          // Offset:  212 Size:     4
//   float VAR_CrackMask_Size;          // Offset:  216 Size:     4
//   float VAR_Reflect_Reverse_U;       // Offset:  220 Size:     4
//   float VAR_Reflect_Reverse_V;       // Offset:  224 Size:     4
//   float VAR_Gradation_Min;           // Offset:  228 Size:     4
//   float VAR_CrackMask_OutIntensity;  // Offset:  232 Size:     4
//   float VAR_Blood_Min;               // Offset:  236 Size:     4
//   float VAR_UIBase_Size;             // Offset:  240 Size:     4
//   float VAR_UIBase_Fade;             // Offset:  244 Size:     4
//   float VAR_RoughnessContrast;       // Offset:  248 Size:     4
//   float VAR_Roughness_Intensity_Surface;// Offset:  252 Size:     4
//   float VAR_Roughness_Illuminance_Surface;// Offset:  256 Size:     4
//   float VAR_Roughness_Intensity_SideFace;// Offset:  260 Size:     4
//   float VAR_Roughness_Illuminance_Sideface;// Offset:  264 Size:     4
//   float VAR_Glass_SideFace_Intensity;// Offset:  268 Size:     4
//   float VAR_GlassColor_Rouness_effect;// Offset:  272 Size:     4
//   float VAR_GlassColor_Rouness_effect_Contrast;// Offset:  276 Size:     4
//   float VAR_ReflectionImageIntensity;// Offset:  280 Size:     4
//   float VAR_RoughnessMetalBlend;     // Offset:  284 Size:     4
//   float VAR_TonemapRate;             // Offset:  288 Size:     4
//   float VAR_FakeLightDepth;          // Offset:  292 Size:     4
//   float VAR_FakeLight;               // Offset:  296 Size:     4
//   float VAR_BloodSize;               // Offset:  300 Size:     4
//   float VAR_BloodPos;                // Offset:  304 Size:     4
//   float VAR_BloodNormal;             // Offset:  308 Size:     4
//   float VAR_BloodDist;               // Offset:  312 Size:     4
//   float VAR_BloodRoughness;          // Offset:  316 Size:     4
//   float VAR_BloodBase_Size;          // Offset:  320 Size:     4
//   float VAR_BloodBase_Fade;          // Offset:  324 Size:     4
//   float VAR_RoughnessSize;           // Offset:  328 Size:     4
//   float VAR_DepthColor;              // Offset:  332 Size:     4
//   float VAR_GlassDirtMax;            // Offset:  336 Size:     4
//   float VAR_GlassDirtMin;            // Offset:  340 Size:     4
//   float VAR_RounessMapDistortioIntensity;// Offset:  344 Size:     4
//   float CAPCOM_MATERIAL_RESERVE;     // Offset:  348 Size:     4 [unused]
//
// }
//
// Resource bind info for GUILightParameterSRV
// {
//
//   struct LightParameter
//   {
//
//       float3 position;               // Offset:    0
//       float boundingRadius;          // Offset:   12
//       float3 direction;              // Offset:   16
//       float falloff;                 // Offset:   28
//       float4 attenuation;            // Offset:   32
//       float3 color;                  // Offset:   48
//       float tolerance;               // Offset:   60
//       uint shadowIndex;              // Offset:   64
//       uint iesId;                    // Offset:   68
//       uint2 reserved;                // Offset:   72
//
//   } $Element;                        // Offset:    0 Size:    80
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PointClamp                        sampler      NA          NA    0        1
// BilinearWrap                      sampler      NA          NA    1        1
// BilinearClamp                     sampler      NA          NA    2        1
// AutomaticWrap                     sampler      NA          NA    3        1
// IESLightTableSRV                  texture   float     1darray    0        1
// SrcImage                          texture  float4          2d    1        1
// GUILightParameterSRV              texture  struct         r/o    2        1
// NormalMap                         texture  float4          2d    3        1
// EffectMap_ATOS                    texture  float4          2d    4        1
// SceneInfo                         cbuffer      NA          NA    0        1
// World                             cbuffer      NA          NA    1        1
// LightDataBuffer                   cbuffer      NA          NA    2        1
// ColorAdjust                       cbuffer      NA          NA    3        1
// UserMaterial                      cbuffer      NA          NA    4        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// INTERPOLATOR             0   xyzw        1     NONE   float   xyzw
// INTERPOLATOR             1   xyzw        2     NONE   float   xyzw
// INTERPOLATOR             2   xyzw        3     NONE   float   xyzw
// NOINTERPOLATOR           0   x           4     NONE   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET                0   xyzw        0   TARGET   float   xyzw
// SV_TARGET                1   x           1   TARGET   float   x
//
ps_5_0
dcl_globalFlags refactoringAllowed | enableMinimumPrecision
dcl_constantbuffer cb0[10], immediateIndexed
dcl_constantbuffer cb1[4], immediateIndexed
dcl_constantbuffer cb2[1], immediateIndexed
dcl_constantbuffer cb3[2], immediateIndexed
dcl_constantbuffer cb4[22], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_resource_texture1darray (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_structured t2, 80
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4

//stereo2mono
dcl_resource_texture2d (float,float,float,float) t100

dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xyzw
dcl_input_ps linear v3.xyzw
dcl_output o0.xyzw
dcl_output o1.x
dcl_temps 40

dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r21.xyzw, l(0, 0, 0, 0), t125.xyzw

dp3 r0.x, v1.xyzx, v1.xyzx
rsq r0.x, r0.x
mul r0.xyz, r0.xxxx, v1.xyzx
dp3 r0.w, v2.yzwy, v2.yzwy
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, v2.yzwy
mul r2.xyz, r0.zxyz, r1.yzxy
mad r2.xyz, r0.yzxy, r1.zxyz, -r2.xyzx
lt r0.w, v3.x, l(0.000000)
movc r2.xyz, r0.wwww, -r2.xyzx, r2.xyzx
mov r3.x, -cb0[7].w
mov r3.y, -cb0[8].w
mov r3.z, -cb0[9].w
add r3.xyz, r3.xyzx, v3.yzwy
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r3.xyzx
mov r4.x, v1.w
mov r4.y, v2.x

//float2 pos = r3.zy;
//pos.x = pos.x / 2;
//if (stereo.z == -1)
//  pos.x += 0.5;
//r3.yzw = stereo2mono.Sample(AutomaticWrap_s, pos).xyz;

//mov r25.xy, r4.xy
//mul r25.x, r25.x, l(0.500000)
//ieq r26.x, r21.z, l(-1.000000)
//if_nz r26.x
//add r25.x, l(0.500000), r25.x
//endif
//
//sample_indexable(texture2d)(float,float,float,float) r5.xyzw, r25.xyxx, t100.xyzw, s3

sample_indexable(texture2d)(float,float,float,float) r5.xyzw, r4.xyxx, t3.xyzw, s3
mad r5.xyz, r5.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r2.xyzx
mul r2.xyz, r2.xyzx, r5.yyyy
mad r1.xyz, r5.xxxx, r1.xyzx, r2.xyzx
mad r0.xyz, r5.zzzz, r0.xyzx, r1.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r0.xyzx
add r2.xyz, v3.yzwy, -cb1[3].xyzx
mad r0.xy, r1.xyxx, cb4[19].yyyy, cb4[19].xxxx
mad r0.xy, r2.xyxx, cb4[18].wwww, r0.xyxx
sample_indexable(texture2d)(float,float,float,float) r0.x, r0.xyxx, t4.yxzw, s1
add r0.y, -cb4[20].y, cb4[20].x
add r1.w, cb4[20].y, cb4[20].x
add r5.xyz, -r2.xyzx, cb4[9].xyzx
dp3 r2.w, r5.xyzx, r5.xyzx
sqrt r2.w, r2.w
add r2.w, -r2.w, l(1.000000)
add r1.w, -r0.y, r1.w
add r0.y, -r0.y, r2.w
div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r1.w
mul_sat r0.y, r0.y, r1.w
mad r1.w, r0.y, l(-2.000000), l(3.000000)
mul r0.y, r0.y, r0.y
add r4.zw, -cb4[14].yyyw, l(0.000000, 0.000000, 0.500000, 0.500000)
mad_sat r0.y, r1.w, r0.y, -r4.z
mad r1.w, r0.y, l(-2.000000), l(3.000000)
mul r0.y, r0.y, r0.y
mul r0.y, r0.y, r1.w
add r5.xyz, cb4[10].xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r6.xyz, r0.yyyy, r5.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
add_sat r0.x, r0.x, -r4.w
mad r0.y, r0.x, l(-2.000000), l(3.000000)
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, r0.y
mad r5.xyz, r0.xxxx, r5.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r6.xyw, r5.xyxz, r6.xyxz
sample_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t4.xzwy, s1
add r0.x, -cb4[13].y, cb4[13].z
add r0.y, cb4[13].y, cb4[13].z
add r7.xyz, -r2.xyzx, cb4[0].xyzx
dp3 r1.w, r7.xyzx, r7.xyzx
sqrt r1.w, r1.w
add r1.w, -r1.w, l(1.000000)
add r0.y, -r0.x, r0.y
add r0.x, -r0.x, r1.w
div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
mul_sat r0.x, r0.y, r0.x
mad r0.y, r0.x, l(-2.000000), l(3.000000)
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, r0.y
min r0.x, r0.x, l(1.000000)
add r0.y, cb4[13].x, -cb4[14].z
mad r0.x, r0.x, r0.y, cb4[14].z
mad r0.y, -r6.z, r5.z, l(1.000000)
mad r1.w, cb4[15].w, r5.w, cb4[16].x
mad r2.w, cb4[16].y, r5.w, cb4[16].z
add r2.w, -r1.w, r2.w
mad r1.w, r4.y, r2.w, r1.w
max r1.w, r1.w, l(0.000001)
log r1.w, r1.w
mul r1.w, r1.w, cb4[15].z
exp r1.w, r1.w
add r2.w, cb4[17].w, l(-0.500000)
mad_sat r2.w, r4.x, r2.w, l(0.500000)
mul r4.x, r0.y, cb4[19].w
mad r1.w, r1.w, r0.x, -r4.x
mov r5.xyz, v3.yzwy
mov r5.w, l(0)
add r7.xyzw, -r5.xyzw, cb4[11].xyzw
dp4 r4.x, r7.xyzw, r7.xyzw
rsq r4.x, r4.x
mov r3.w, l(0)
mad r7.xyzw, r7.xyzw, r4.xxxx, r3.xyzw
dp4 r3.w, r7.xyzw, r7.xyzw
rsq r3.w, r3.w
mul r7.xyz, r3.wwww, r7.xyzx
max r7.xyz, r7.xyzx, l(0.001000, 0.001000, 0.001000, 0.000000)
min r7.xyz, r7.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
dp3 r3.w, r1.xyzx, r7.xyzx
add r4.x, -cb4[18].y, cb4[20].z
mad r4.x, r1.w, r4.x, cb4[18].y
log r3.w, -r3.w
mul r3.w, r3.w, r4.x
exp r3.w, r3.w
mul_sat r3.w, r3.w, cb4[18].z
dp3 r4.x, r3.xyzx, r1.xyzx
mov_sat r4.w, r1.w
mad r7.xyz, r0.yyyy, cb4[19].zzzz, cb4[5].xyzx
mad r8.xyz, r0.yyyy, cb4[19].zzzz, cb4[8].xyzx
mul r9.xyz, v3.zzzz, cb0[1].xywx
mad r9.xyz, v3.yyyy, cb0[0].xywx, r9.xyzx
mad r9.xyz, v3.wwww, cb0[2].xywx, r9.xyzx
add r9.xyz, r9.xyzx, cb0[3].xywx
div r9.xy, r9.xyxx, r9.zzzz
mad r9.xy, r9.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
add r0.y, r4.x, l(1.000000)
mul r4.x, r4.w, cb4[21].z
mad r4.w, r4.x, r4.x, r1.z
mad r0.z, r0.z, r0.w, r4.x
mad r9.zw, r9.xxxy, l(0.000000, 0.000000, -2.000000, -2.000000), l(0.000000, 0.000000, 1.000000, 1.000000)
mad r0.w, cb4[13].w, r9.z, r9.x
mad r4.x, cb4[14].x, r9.w, r9.y
mad r7.zw, r4.wwww, r7.zzzz, r1.xxxy
mad r7.xy, r7.zwzz, r7.xyxx, cb4[7].xyxx
add r10.x, r0.w, r7.x
add r10.y, r4.x, r7.y
mad r0.zw, r0.zzzz, r8.zzzz, r1.xxxy
mul r0.zw, r8.xxxy, r0.zzzw
mad r0.zw, r0.zzzw, r4.zzzz, r9.xxxy
mul r0.y, r0.y, cb4[17].z
sample_l_indexable(texture2d)(float,float,float,float) r7.xyz, r10.xyxx, t1.xyzw, s0, l(0.000000)
mul r4.x, r1.w, cb4[17].x
max r4.x, r4.x, l(0.000001)
log r4.x, r4.x
mul r4.x, r4.x, cb4[17].y
exp r4.x, r4.x
mad r4.w, r3.w, cb4[20].w, cb4[3].x
sample_l_indexable(texture2d)(float,float,float,float) r8.xyz, r0.zwzz, t1.xyzw, s0, l(0.000000)
mad r0.yzw, r7.xxyz, r0.yyyy, r4.xxxx
add r7.xyz, -r8.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
add r0.yzw, -r0.yyzw, l(0.000000, 1.000000, 1.000000, 1.000000)
mad r0.yzw, -r7.xxyz, r0.yyzw, l(0.000000, 1.000000, 1.000000, 1.000000)
add r7.xyz, r4.wwww, l(0.000000, 0.666666687, 0.333333343, 0.000000)
frc r7.xyz, r7.xyzx
mad r7.xyz, r7.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mad_sat r7.xyz, |r7.xyzx|, l(3.000000, 3.000000, 3.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
add r7.xyz, r7.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r7.xyz, r7.xyzx, cb4[3].yyyy, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r7.xyz, r7.xyzx, cb4[3].zzzz
mul r7.xyz, r0.yzwy, r7.xyzx
mul r0.x, r0.x, cb4[16].w
mul r0.yzw, r0.yyzw, cb4[4].xxyz
mad r7.xyz, r7.xyzx, r0.xxxx, -r0.yzwy
mad r0.xyz, r4.yyyy, r7.xyzx, r0.yzwy
max r0.w, r0.y, r0.z
max r0.w, r0.x, r0.w
mad r0.w, cb4[18].x, r0.w, l(1.000000)
div r0.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.w
add r0.w, r3.w, r0.w
mul r4.xyw, r0.wwww, r0.xyxz
add r5.w, -cb4[15].y, cb4[15].x
add r6.z, cb4[15].y, cb4[15].x
add r2.xyz, -r2.xyzx, cb4[1].xyzx
dp3 r2.x, r2.xyzx, r2.xyzx
sqrt r2.x, r2.x
add r2.x, -r2.x, l(1.000000)
add r2.y, -r5.w, r6.z
add r2.x, -r5.w, r2.x
div r2.y, l(1.000000, 1.000000, 1.000000, 1.000000), r2.y
mul_sat r2.x, r2.y, r2.x
mad r2.y, r2.x, l(-2.000000), l(3.000000)
mul r2.x, r2.x, r2.x
mul r2.x, r2.x, r2.y
mad r7.xyz, r3.wwww, cb4[6].xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
add r2.y, -cb4[21].y, cb4[21].x
mad r8.xyz, r4.xywx, r2.yyyy, cb4[21].yyyy
mad r0.xyz, -r0.xyzx, r0.wwww, r8.xyzx
mad r0.xyz, r1.wwww, r0.xyzx, r4.xywx
mul r0.xyz, r0.xyzx, r7.xyzx
add r4.xyw, cb4[2].xyxz, l(-1.000000, -1.000000, 0.000000, -1.000000)
mad r2.xyz, r2.xxxx, r4.xywx, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r0.xyz, r0.xyzx, r2.xyzx
add r0.w, -r2.w, l(1.000000)
mul r0.xyz, r0.xyzx, r6.xywx
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
min r2.xyz, r0.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000)
max r1.w, r1.w, l(0.010000)
min r1.w, r1.w, l(1.000000)
max r0.w, r0.w, l(0.040000)
min r2.w, r0.w, l(0.080000)
mul r1.w, r1.w, r1.w
dp3_sat r3.w, r1.xyzx, -r3.xyzx
add r4.x, r3.w, r3.w
lt r4.y, l(0.000000), r3.w
add r4.w, -r0.w, l(1.000000)
mul r11.xyz {min16f}, r2.xyzx {def32 as min16f}, r0.wwww {def32 as min16f}
max r11.xyz {min16f}, r2.wwww {def32 as min16f}, r11.xyzx {min16f}
add r6.xyz, -r11.xyzx {min16f as def32}, l(1.000000, 1.000000, 1.000000, 0.000000)
mov r7.xyz, l(0,0,0,0)
mov r8.xyz, l(0,0,0,0)
mov r0.w, l(1)
mov r2.w, l(0)
loop
  uge r5.w, r2.w, cb2[0].x
  breakc_nz r5.w
  and r5.w, r0.w, cb2[0].y
  if_z r5.w
    iadd r5.w, r2.w, l(1)
    ishl r6.w, r0.w, l(1)
    mov r0.w, r6.w
    mov r2.w, r5.w
    continue
  endif
  ld_structured_indexable(structured_buffer, stride=80)(mixed,mixed,mixed,mixed) r9.xyzw, r2.w, l(0), t2.xyzw
  ld_structured_indexable(structured_buffer, stride=80)(mixed,mixed,mixed,mixed) r10.xyzw, r2.w, l(16), t2.xyzw
  ld_structured_indexable(structured_buffer, stride=80)(mixed,mixed,mixed,mixed) r12.xyzw, r2.w, l(32), t2.xyzw
  ld_structured_indexable(structured_buffer, stride=80)(mixed,mixed,mixed,mixed) r13.xyzw, r2.w, l(48), t2.xyzw
  ld_structured_indexable(structured_buffer, stride=80)(mixed,mixed,mixed,mixed) r5.w, r2.w, l(68), t2.xxxx
  add r9.xyz, -r5.xyzx, r9.xyzx
  dp3 r6.w, r9.xyzx, r9.xyzx
  rsq r7.w, r6.w
  mul r6.w, r6.w, r7.w
  mul r9.xyz, r7.wwww, r9.xyzx
  dp3 r7.w, r9.xyzx, r10.xyzx
  mad r14.x, r7.w, l(0.500000), l(0.500000)
  ieq r7.w, r5.w, l(-1)
  utof r14.y, r5.w
  sample_l_indexable(texture1darray)(float,float,float,float) r5.w, r14.xyxx, t0.yzwx, s2, l(0.000000)
  movc r5.w, r7.w, l(1.000000), r5.w
  mad r7.w, r6.w, r12.x, l(1.000000)
  mul r7.w, r7.w, r7.w
  rcp r7.w, r7.w
  add_sat r7.w, -r13.w, r7.w
  add r8.w, -r13.w, l(1.000000)
  iadd r8.w, -r8.w, l(0x7eef370b)
  mul r7.w, r7.w, r8.w
  dp3 r8.w, -r10.xyzx, r9.xyzx
  mad_sat r8.w, r8.w, r12.w, r12.z
  div r10.x, l(1.000000, 1.000000, 1.000000, 1.000000), r10.w
  mul_sat r8.w, r8.w, r10.x
  mad r10.x, r8.w, l(-2.000000), l(3.000000)
  mul r8.w, r8.w, r8.w
  mul r8.w, r8.w, r10.x
  mul_sat r7.w, r7.w, r8.w
  mul r5.w, r5.w, r7.w
  lt r6.w, r6.w, r9.w
  lt r7.w, l(0.000000), r5.w
  and r6.w, r6.w, r7.w
  if_nz r6.w
    dp3_sat r6.w, r1.xyzx, r9.xyzx
    mul r5.w, r5.w, r6.w
    max r7.w, r1.w, r12.y
    mul r8.w, r7.w, r7.w
    dp3 r9.x, r9.xyzx, -r3.xyzx
    mad r9.x, r9.x, l(2.000000), l(2.000000)
    max r9.x, r9.x, l(0.000100)
    rsq r9.y, r9.x
    mul r9.x, r9.y, r9.x
    add r9.z, r3.w, r6.w
    mad r9.x, -r9.x, l(0.500000), l(1.000000)
    mul r9.yw, r9.yyyx, r9.zzzx
    mul r9.w, r9.w, r9.w
    mul r9.xy, r9.wyww, r9.xyxx
    mad r9.w, r7.w, r7.w, l(-1.000000)
    mad r9.y, r9.y, r9.w, l(1.000000)
    mul r9.w, r4.x, r6.w
    mad r6.w, -r4.x, r6.w, r9.z
    mad r6.w, r7.w, r6.w, r9.w
    mul r7.w, r9.y, r9.y
    dp2 r6.w, r7.wwww, r6.wwww
    rcp r6.w, r6.w
    mul r6.w, r6.w, r8.w
    and r10.x, r4.y, r6.w
    mul r10.y, r9.x, r10.x
    mul r9.xy, r5.wwww, r10.xyxx
  else
    mov r9.xy, l(0,0,0,0)
    mov r5.w, l(0)
  endif
  eq r6.w, r5.w, l(0.000000)
  if_nz r6.w
    iadd r6.w, r2.w, l(1)
    ishl r7.w, r0.w, l(1)
    mov r0.w, r7.w
    mov r2.w, r6.w
    continue
  endif
  mul r5.w, r4.w, r5.w
  mad r7.xyz, r13.xyzx, r5.wwww, r7.xyzx
  mul r9.yzw, r6.xxyz, r9.yyyy
  mad r9.xyz, r11.xyzx {min16f as def32}, r9.xxxx, r9.yzwy
  mad r8.xyz, r13.xyzx, r9.xyzx, r8.xyzx
  iadd r2.w, r2.w, l(1)
  ishl r0.w, r0.w, l(1)
endloop
mad r1.xyz, r7.xyzx, r2.xyzx, r8.xyzx
mad r0.xyz, r1.xyzx, l(0.318309873, 0.318309873, 0.318309873, 0.000000), r0.xyzx
mul r0.w, r4.z, cb3[0].w
mul r0.xyz, r0.xyzx, cb3[0].xyzx
mul o0.xyz, r0.wwww, r0.xyzx
mul o1.x, r0.w, cb3[1].x
mov o0.w, r0.w
ret
// Approximately 306 instruction slots used

///////////////////////////////// HLSL Code /////////////////////////////////
// // ---- Created with 3Dmigoto v1.3.14 on Sun Mar 10 10:30:17 2019
//
// struct LightParameter
// {
//     float3 position;               // Offset:    0
//     float boundingRadius;          // Offset:   12
//     float3 direction;              // Offset:   16
//     float falloff;                 // Offset:   28
//     float4 attenuation;            // Offset:   32
//     float3 color;                  // Offset:   48
//     float tolerance;               // Offset:   60
//     uint shadowIndex;              // Offset:   64
//     uint iesId;                    // Offset:   68
//     uint2 reserved;                // Offset:   72
// };
//
// cbuffer SceneInfo : register(b0)
// {
//   row_major float4x4 viewProjMat : packoffset(c0);
//   row_major float3x4 transposeViewMat : packoffset(c4);
//   row_major float3x4 transposeViewInvMat : packoffset(c7);
//   float4 projElement[2] : packoffset(c10);
//   float4 projInvElements[2] : packoffset(c12);
//   row_major float4x4 viewProjInvMat : packoffset(c14);
//   row_major float4x4 prevViewProjMat : packoffset(c18);
//   float3 ZToLinear : packoffset(c22);
//   float subdivisionLevel : packoffset(c22.w);
//   float2 screenSize : packoffset(c23);
//   float2 screenInverseSize : packoffset(c23.z);
//   float2 cullingHelper : packoffset(c24);
//   float cameraNearPlane : packoffset(c24.z);
//   float cameraFarPlane : packoffset(c24.w);
//   float4 viewFrustum[6] : packoffset(c25);
//   float4 clipplane : packoffset(c31);
// }
//
// cbuffer World : register(b1)
// {
//   row_major float4x4 worldMat : packoffset(c0);
//   row_major float4x4 prevWorldMat : packoffset(c4);
//   int jointOffset : packoffset(c8);
//   int prevJoinOffset : packoffset(c8.y);
//   int2 reserveWorld : packoffset(c8.z);
// }
//
// cbuffer LightDataBuffer : register(b2)
// {
//   uint GUIPunctualLightCount : packoffset(c0);
//   uint LightMask : packoffset(c0.y);
//   uint dummy0 : packoffset(c0.z);
//   uint dummy1 : packoffset(c0.w);
// }
//
// cbuffer ColorAdjust : register(b3)
// {
//   float4 colorTransform : packoffset(c0);
//   float stencilScale : packoffset(c1);
//   float padding0 : packoffset(c1.y);
//   float padding1 : packoffset(c1.z);
//   float padding2 : packoffset(c1.w);
// }
//
// cbuffer UserMaterial : register(b4)
// {
//   float4 VAR_CrackMaskPos : packoffset(c0);
//   float4 VAR_UIBase_Pos : packoffset(c1);
//   float4 VAR_UI_Base_Color : packoffset(c2);
//   float4 VAR_GlassColor_Side : packoffset(c3);
//   float4 VAR_GlassColor_Surface : packoffset(c4);
//   float4 VAR_Reflection_Distortion_Power : packoffset(c5);
//   float4 VAR_ColorParam : packoffset(c6);
//   float4 VAR_Reflection_Pos : packoffset(c7);
//   float4 VAR_Refraction_Distortion_Power : packoffset(c8);
//   float4 VAR_BloodBase_Pos : packoffset(c9);
//   float4 VAR_ColorParam_2 : packoffset(c10);
//   float4 VAR_FakeLightPos : packoffset(c11);
//   float4 VAR_Float4Param : packoffset(c12);
//   float VAR_CrackMask_CenterIntensity : packoffset(c13);
//   float VAR_CrackMask_Fade : packoffset(c13.y);
//   float VAR_CrackMask_Size : packoffset(c13.z);
//   float VAR_Reflect_Reverse_U : packoffset(c13.w);
//   float VAR_Reflect_Reverse_V : packoffset(c14);
//   float VAR_Gradation_Min : packoffset(c14.y);
//   float VAR_CrackMask_OutIntensity : packoffset(c14.z);
//   float VAR_Blood_Min : packoffset(c14.w);
//   float VAR_UIBase_Size : packoffset(c15);
//   float VAR_UIBase_Fade : packoffset(c15.y);
//   float VAR_RoughnessContrast : packoffset(c15.z);
//   float VAR_Roughness_Intensity_Surface : packoffset(c15.w);
//   float VAR_Roughness_Illuminance_Surface : packoffset(c16);
//   float VAR_Roughness_Intensity_SideFace : packoffset(c16.y);
//   float VAR_Roughness_Illuminance_Sideface : packoffset(c16.z);
//   float VAR_Glass_SideFace_Intensity : packoffset(c16.w);
//   float VAR_GlassColor_Rouness_effect : packoffset(c17);
//   float VAR_GlassColor_Rouness_effect_Contrast : packoffset(c17.y);
//   float VAR_ReflectionImageIntensity : packoffset(c17.z);
//   float VAR_RoughnessMetalBlend : packoffset(c17.w);
//   float VAR_TonemapRate : packoffset(c18);
//   float VAR_FakeLightDepth : packoffset(c18.y);
//   float VAR_FakeLight : packoffset(c18.z);
//   float VAR_BloodSize : packoffset(c18.w);
//   float VAR_BloodPos : packoffset(c19);
//   float VAR_BloodNormal : packoffset(c19.y);
//   float VAR_BloodDist : packoffset(c19.z);
//   float VAR_BloodRoughness : packoffset(c19.w);
//   float VAR_BloodBase_Size : packoffset(c20);
//   float VAR_BloodBase_Fade : packoffset(c20.y);
//   float VAR_RoughnessSize : packoffset(c20.z);
//   float VAR_DepthColor : packoffset(c20.w);
//   float VAR_GlassDirtMax : packoffset(c21);
//   float VAR_GlassDirtMin : packoffset(c21.y);
//   float VAR_RounessMapDistortioIntensity : packoffset(c21.z);
//   float CAPCOM_MATERIAL_RESERVE : packoffset(c21.w);
// }
//
// SamplerState PointClamp_s : register(s0);
// SamplerState BilinearWrap_s : register(s1);
// SamplerState BilinearClamp_s : register(s2);
// SamplerState AutomaticWrap_s : register(s3);
//  IESLightTableSRV : register(t0);
// Texture2D<float4> SrcImage : register(t1);
// StructuredBuffer<LightParameter> GUILightParameterSRV : register(t2);
// Texture2D<float4> NormalMap : register(t3);
// Texture2D<float4> EffectMap_ATOS : register(t4);
//
//
// // 3Dmigoto declarations
// #define cmp -
// Texture1D<float4> IniParams : register(t120);
// Texture2D<float4> StereoParams : register(t125);
//
//
// void main(
//   float4 v0 : SV_POSITION0,
//   float4 v1 : INTERPOLATOR0,
//   float4 v2 : INTERPOLATOR1,
//   float4 v3 : INTERPOLATOR2,
//   float v4 : NOINTERPOLATOR0,
//   out float4 o0 : SV_TARGET0,
//   out float o1 : SV_TARGET1)
// {
// // Needs manual fix for instruction:
// // unknown dcl_: dcl_resource_texture1darray (float,float,float,float) t0
//   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(v2.yzw, v2.yzw);
//   r0.w = rsqrt(r0.w);
//   r1.xyz = v2.yzw * r0.www;
//   r2.xyz = r1.yzx * r0.zxy;
//   r2.xyz = r0.yzx * r1.zxy + -r2.xyz;
//   r0.w = cmp(v3.x < 0);
//   r2.xyz = r0.www ? -r2.xyz : r2.xyz;
//   r3.x = -transposeViewInvMat._m03;
//   r3.y = -transposeViewInvMat._m13;
//   r3.z = -transposeViewInvMat._m23;
//   r3.xyz = v3.yzw + r3.xyz;
//   r0.w = dot(r3.xyz, r3.xyz);
//   r0.w = rsqrt(r0.w);
//   r3.xyz = r3.xyz * r0.www;
//   r4.x = v1.w;
//   r4.y = v2.x;
//   r5.xyzw = NormalMap.Sample(AutomaticWrap_s, r4.xy).xyzw;
//   r5.xyz = r5.xyz * float3(2,2,2) + float3(-1,-1,-1);
//   r0.w = dot(r2.xyz, r2.xyz);
//   r0.w = rsqrt(r0.w);
//   r2.xyz = r2.xyz * r0.www;
//   r2.xyz = r5.yyy * r2.xyz;
//   r1.xyz = r5.xxx * r1.xyz + r2.xyz;
//   r0.xyz = r5.zzz * r0.xyz + r1.xyz;
//   r0.w = dot(r0.xyz, r0.xyz);
//   r0.w = rsqrt(r0.w);
//   r1.xyz = r0.xyz * r0.www;
//   r2.xyz = -worldMat._m30_m31_m32 + v3.yzw;
//   r0.xy = r1.xy * VAR_BloodNormal + VAR_BloodPos;
//   r0.xy = r2.xy * VAR_BloodSize + r0.xy;
//   r0.x = EffectMap_ATOS.Sample(BilinearWrap_s, r0.xy).y;
//   r0.y = VAR_BloodBase_Size + -VAR_BloodBase_Fade;
//   r1.w = VAR_BloodBase_Size + VAR_BloodBase_Fade;
//   r5.xyz = VAR_BloodBase_Pos.xyz + -r2.xyz;
//   r2.w = dot(r5.xyz, r5.xyz);
//   r2.w = sqrt(r2.w);
//   r2.w = 1 + -r2.w;
//   r1.w = r1.w + -r0.y;
//   r0.y = r2.w + -r0.y;
//   r1.w = 1 / r1.w;
//   r0.y = saturate(r1.w * r0.y);
//   r1.w = r0.y * -2 + 3;
//   r0.y = r0.y * r0.y;
//   r4.zw = float2(0.5,0.5) + -VAR_Gradation_Min;
//   r0.y = saturate(r1.w * r0.y + -r4.z);
//   r1.w = r0.y * -2 + 3;
//   r0.y = r0.y * r0.y;
//   r0.y = r1.w * r0.y;
//   r5.xyz = float3(-1,-1,-1) + VAR_ColorParam_2.xyz;
//   r6.xyz = r0.yyy * r5.xyz + float3(1,1,1);
//   r0.x = saturate(-r4.w + r0.x);
//   r0.y = r0.x * -2 + 3;
//   r0.x = r0.x * r0.x;
//   r0.x = r0.y * r0.x;
//   r5.xyz = r0.xxx * r5.xyz + float3(1,1,1);
//   r6.xyw = r6.xyz * r5.xyz;
//   r4.xyz = EffectMap_ATOS.Sample(BilinearWrap_s, r4.xy).xzw;
//   r0.x = VAR_CrackMask_Size + -VAR_CrackMask_Fade;
//   r0.y = VAR_CrackMask_Size + VAR_CrackMask_Fade;
//   r7.xyz = VAR_CrackMaskPos.xyz + -r2.xyz;
//   r1.w = dot(r7.xyz, r7.xyz);
//   r1.w = sqrt(r1.w);
//   r1.w = 1 + -r1.w;
//   r0.y = r0.y + -r0.x;
//   r0.x = r1.w + -r0.x;
//   r0.y = 1 / r0.y;
//   r0.x = saturate(r0.x * r0.y);
//   r0.y = r0.x * -2 + 3;
//   r0.x = r0.x * r0.x;
//   r0.x = r0.y * r0.x;
//   r0.x = min(1, r0.x);
//   r0.y = -VAR_CrackMask_OutIntensity + VAR_CrackMask_CenterIntensity;
//   r0.x = r0.x * r0.y + VAR_CrackMask_OutIntensity;
//   r0.y = -r6.z * r5.z + 1;
//   r1.w = VAR_Roughness_Intensity_Surface * r5.w + VAR_Roughness_Illuminance_Surface;
//   r2.w = VAR_Roughness_Intensity_SideFace * r5.w + VAR_Roughness_Illuminance_Sideface;
//   r2.w = r2.w + -r1.w;
//   r1.w = r4.y * r2.w + r1.w;
//   r1.w = max(9.99999997e-007, r1.w);
//   r1.w = log2(r1.w);
//   r1.w = VAR_RoughnessContrast * r1.w;
//   r1.w = exp2(r1.w);
//   r2.w = -0.5 + VAR_RoughnessMetalBlend;
//   r2.w = saturate(r4.x * r2.w + 0.5);
//   r4.x = VAR_BloodRoughness * r0.y;
//   r1.w = r1.w * r0.x + -r4.x;
//   r5.xyz = v3.yzw;
//   r5.w = 0;
//   r7.xyzw = VAR_FakeLightPos.xyzw + -r5.xyzw;
//   r4.x = dot(r7.xyzw, r7.xyzw);
//   r4.x = rsqrt(r4.x);
//   r3.w = 0;
//   r7.xyzw = r7.xyzw * r4.xxxx + r3.xyzw;
//   r3.w = dot(r7.xyzw, r7.xyzw);
//   r3.w = rsqrt(r3.w);
//   r7.xyz = r7.xyz * r3.www;
//   r7.xyz = max(float3(0.00100000005,0.00100000005,0.00100000005), r7.xyz);
//   r7.xyz = min(float3(1,1,1), r7.xyz);
//   r3.w = dot(r1.xyz, r7.xyz);
//   r4.x = VAR_RoughnessSize + -VAR_FakeLightDepth;
//   r4.x = r1.w * r4.x + VAR_FakeLightDepth;
//   r3.w = log2(-r3.w);
//   r3.w = r4.x * r3.w;
//   r3.w = exp2(r3.w);
//   r3.w = saturate(VAR_FakeLight * r3.w);
//   r4.x = dot(r3.xyz, r1.xyz);
//   r4.w = saturate(r1.w);
//   r7.xyz = r0.yyy * VAR_BloodDist + VAR_Reflection_Distortion_Power.xyz;
//   r8.xyz = r0.yyy * VAR_BloodDist + VAR_Refraction_Distortion_Power.xyz;
//   r9.xyz = viewProjMat._m10_m11_m13 * v3.zzz;
//   r9.xyz = v3.yyy * viewProjMat._m00_m01_m03 + r9.xyz;
//   r9.xyz = v3.www * viewProjMat._m20_m21_m23 + r9.xyz;
//   r9.xyz = viewProjMat._m30_m31_m33 + r9.xyz;
//   r9.xy = r9.xy / r9.zz;
//   r9.xy = r9.xy * float2(0.5,-0.5) + float2(0.5,0.5);
//   r0.y = 1 + r4.x;
//   r4.x = VAR_RounessMapDistortioIntensity * r4.w;
//   r4.w = r4.x * r4.x + r1.z;
//   r0.z = r0.z * r0.w + r4.x;
//   r9.zw = r9.xy * float2(-2,-2) + float2(1,1);
//   r0.w = VAR_Reflect_Reverse_U * r9.z + r9.x;
//   r4.x = VAR_Reflect_Reverse_V * r9.w + r9.y;
//   r7.zw = r4.ww * r7.zz + r1.xy;
//   r7.xy = r7.zw * r7.xy + VAR_Reflection_Pos.xy;
//   r10.x = r7.x + r0.w;
//   r10.y = r7.y + r4.x;
//   r0.zw = r0.zz * r8.zz + r1.xy;
//   r0.zw = r0.zw * r8.xy;
//   r0.zw = r0.zw * r4.zz + r9.xy;
//   r0.y = VAR_ReflectionImageIntensity * r0.y;
//   r7.xyz = SrcImage.SampleLevel(PointClamp_s, r10.xy, 0).xyz;
//   r4.x = VAR_GlassColor_Rouness_effect * r1.w;
//   r4.x = max(9.99999997e-007, r4.x);
//   r4.x = log2(r4.x);
//   r4.x = VAR_GlassColor_Rouness_effect_Contrast * r4.x;
//   r4.x = exp2(r4.x);
//   r4.w = r3.w * VAR_DepthColor + VAR_GlassColor_Side.x;
//   r8.xyz = SrcImage.SampleLevel(PointClamp_s, r0.zw, 0).xyz;
//   r0.yzw = r7.xyz * r0.yyy + r4.xxx;
//   r7.xyz = float3(1,1,1) + -r8.xyz;
//   r0.yzw = float3(1,1,1) + -r0.yzw;
//   r0.yzw = -r7.xyz * r0.yzw + float3(1,1,1);
//   r7.xyz = float3(0,0.666666687,0.333333343) + r4.www;
//   r7.xyz = frac(r7.xyz);
//   r7.xyz = r7.xyz * float3(2,2,2) + float3(-1,-1,-1);
//   r7.xyz = saturate(abs(r7.xyz) * float3(3,3,3) + float3(-1,-1,-1));
//   r7.xyz = float3(-1,-1,-1) + r7.xyz;
//   r7.xyz = r7.xyz * VAR_GlassColor_Side.yyy + float3(1,1,1);
//   r7.xyz = VAR_GlassColor_Side.zzz * r7.xyz;
//   r7.xyz = r7.xyz * r0.yzw;
//   r0.x = VAR_Glass_SideFace_Intensity * r0.x;
//   r0.yzw = VAR_GlassColor_Surface.xyz * r0.yzw;
//   r7.xyz = r7.xyz * r0.xxx + -r0.yzw;
//   r0.xyz = r4.yyy * r7.xyz + r0.yzw;
//   r0.w = max(r0.z, r0.y);
//   r0.w = max(r0.w, r0.x);
//   r0.w = VAR_TonemapRate * r0.w + 1;
//   r0.w = 1 / r0.w;
//   r0.w = r0.w + r3.w;
//   r4.xyw = r0.xyz * r0.www;
//   r5.w = VAR_UIBase_Size + -VAR_UIBase_Fade;
//   r6.z = VAR_UIBase_Size + VAR_UIBase_Fade;
//   r2.xyz = VAR_UIBase_Pos.xyz + -r2.xyz;
//   r2.x = dot(r2.xyz, r2.xyz);
//   r2.x = sqrt(r2.x);
//   r2.x = 1 + -r2.x;
//   r2.y = r6.z + -r5.w;
//   r2.x = r2.x + -r5.w;
//   r2.y = 1 / r2.y;
//   r2.x = saturate(r2.x * r2.y);
//   r2.y = r2.x * -2 + 3;
//   r2.x = r2.x * r2.x;
//   r2.x = r2.y * r2.x;
//   r7.xyz = r3.www * VAR_ColorParam.xyz + float3(1,1,1);
//   r2.y = VAR_GlassDirtMax + -VAR_GlassDirtMin;
//   r8.xyz = r4.xyw * r2.yyy + VAR_GlassDirtMin;
//   r0.xyz = -r0.xyz * r0.www + r8.xyz;
//   r0.xyz = r1.www * r0.xyz + r4.xyw;
//   r0.xyz = r7.xyz * r0.xyz;
//   r4.xyw = float3(-1,-1,-1) + VAR_UI_Base_Color.xyz;
//   r2.xyz = r2.xxx * r4.xyw + float3(1,1,1);
//   r0.xyz = r2.xyz * r0.xyz;
//   r0.w = 1 + -r2.w;
//   r0.xyz = r6.xyw * r0.xyz;
//   r0.xyz = max(float3(0,0,0), r0.xyz);
//   r2.xyz = min(float3(1,1,1), r0.xyz);
//   r1.w = max(0.00999999978, r1.w);
//   r1.w = min(1, r1.w);
//   r0.w = max(0.0399999991, r0.w);
//   r2.w = min(0.0799999982, r0.w);
//   r1.w = r1.w * r1.w;
//   r3.w = saturate(dot(r1.xyz, -r3.xyz));
//   r4.x = r3.w + r3.w;
//   r4.y = cmp(0 < r3.w);
//   r4.w = 1 + -r0.w;
//   r11.xyz = r2.xyz * {min16f};
//   r11.xyz = max(r2.www, {min16f});
//   r6.xyz = {min16f + -r11.xyz;
//     r7.xyz = float3(0,0,0);
//     r8.xyz = float3(0,0,0);
//     r0.w = 1;
//     r2.w = 0;
//     while (true) {
//       r5.w = cmp((uint)r2.w >= GUIPunctualLightCount);
//       if (r5.w != 0) break;
//       r5.w = (int)r0.w & LightMask;
//       if (r5.w == 0) {
//         r5.w = (int)r2.w + 1;
//         r6.w = (uint)r0.w << 1;
//         r0.w = r6.w;
//         r2.w = r5.w;
//         continue;
//       }
//       r9.x = GUILightParameterSRV[r2.w].position.x;
//       r9.y = GUILightParameterSRV[r2.w].position.y;
//       r9.z = GUILightParameterSRV[r2.w].position.z;
//       r9.w = GUILightParameterSRV[r2.w].boundingRadius;
//       r10.x = GUILightParameterSRV[r2.w].direction.x;
//       r10.y = GUILightParameterSRV[r2.w].direction.y;
//       r10.z = GUILightParameterSRV[r2.w].direction.z;
//       r10.w = GUILightParameterSRV[r2.w].falloff;
//       r12.x = GUILightParameterSRV[r2.w].attenuation.x;
//       r12.y = GUILightParameterSRV[r2.w].attenuation.y;
//       r12.z = GUILightParameterSRV[r2.w].attenuation.z;
//       r12.w = GUILightParameterSRV[r2.w].attenuation.w;
//       r13.x = GUILightParameterSRV[r2.w].color.x;
//       r13.y = GUILightParameterSRV[r2.w].color.y;
//       r13.z = GUILightParameterSRV[r2.w].color.z;
//       r13.w = GUILightParameterSRV[r2.w].tolerance;
//       r5.w = GUILightParameterSRV[r2.w].iesId;
//       r9.xyz = r9.xyz + -r5.xyz;
//       r6.w = dot(r9.xyz, r9.xyz);
//       r7.w = rsqrt(r6.w);
//       r6.w = r7.w * r6.w;
//       r9.xyz = r9.xyz * r7.www;
//       r7.w = dot(r9.xyz, r10.xyz);
//       r14.x = r7.w * 0.5 + 0.5;
//       r7.w = cmp((int)r5.w == -1);
//       r14.y = (uint)r5.w;
//       r5.w = IESLightTableSRV.SampleLevel(BilinearClamp_s, r14.xyxx, 0).x;
//       r5.w = r7.w ? 1 : r5.w;
//       r7.w = r6.w * r12.x + 1;
//       r7.w = r7.w * r7.w;
//       r7.w = rcp(r7.w);
//       r7.w = saturate(r7.w + -r13.w);
//       r8.w = 1 + -r13.w;
//       r8.w = (int)-r8.w + 0x7eef370b;
//       r7.w = r8.w * r7.w;
//       r8.w = dot(-r10.xyz, r9.xyz);
//       r8.w = saturate(r8.w * r12.w + r12.z);
//       r10.x = 1 / r10.w;
//       r8.w = saturate(r10.x * r8.w);
//       r10.x = r8.w * -2 + 3;
//       r8.w = r8.w * r8.w;
//       r8.w = r10.x * r8.w;
//       r7.w = saturate(r8.w * r7.w);
//       r5.w = r7.w * r5.w;
//       r6.w = cmp(r6.w < r9.w);
//       r7.w = cmp(0 < r5.w);
//       r6.w = r6.w ? r7.w : 0;
//       if (r6.w != 0) {
//         r6.w = saturate(dot(r1.xyz, r9.xyz));
//         r5.w = r6.w * r5.w;
//         r7.w = max(r12.y, r1.w);
//         r8.w = r7.w * r7.w;
//         r9.x = dot(r9.xyz, -r3.xyz);
//         r9.x = r9.x * 2 + 2;
//         r9.x = max(9.99999975e-005, r9.x);
//         r9.y = rsqrt(r9.x);
//         r9.x = r9.x * r9.y;
//         r9.z = r6.w + r3.w;
//         r9.x = -r9.x * 0.5 + 1;
//         r9.yw = r9.zx * r9.yx;
//         r9.w = r9.w * r9.w;
//         r9.xy = r9.xy * r9.wy;
//         r9.w = r7.w * r7.w + -1;
//         r9.y = r9.y * r9.w + 1;
//         r9.w = r6.w * r4.x;
//         r6.w = -r4.x * r6.w + r9.z;
//         r6.w = r7.w * r6.w + r9.w;
//         r7.w = r9.y * r9.y;
//         r6.w = dot(r7.ww, r6.ww);
//         r6.w = rcp(r6.w);
//         r6.w = r8.w * r6.w;
//         r10.x = r4.y ? r6.w : 0;
//         r10.y = r10.x * r9.x;
//         r9.xy = r10.xy * r5.ww;
//       } else {
//         r9.xy = float2(0,0);
//         r5.w = 0;
//       }
//       r6.w = cmp(r5.w == 0.000000);
//       if (r6.w != 0) {
//         r6.w = (int)r2.w + 1;
//         r7.w = (uint)r0.w << 1;
//         r0.w = r7.w;
//         r2.w = r6.w;
//         continue;
//       }
//       r5.w = r5.w * r4.w;
//       r7.xyz = r13.xyz * r5.www + r7.xyz;
//       r9.yzw = r9.yyy * r6.xyz;
//       r9.xyz = r11.xyz * {min16f + as;
//         r8.xyz = r13.xyz * r9.xyz + r8.xyz;
//         r2.w = (int)r2.w + 1;
//         r0.w = (uint)r0.w << 1;
//       }
//       r1.xyz = r7.xyz * r2.xyz + r8.xyz;
//       r0.xyz = r1.xyz * float3(0.318309873,0.318309873,0.318309873) + r0.xyz;
//       r0.w = colorTransform.w * r4.z;
//       r0.xyz = colorTransform.xyz * r0.xyz;
//       o0.xyz = r0.xyz * r0.www;
//       o1.x = stencilScale * r0.w;
//       o0.w = r0.w;
//       return;
// }
//////////////////////////////// HLSL Errors ////////////////////////////////
// E:\SteamLibrary\steamapps\common\Devil May Cry 5\ShaderFixes\81d5a99f4ae026ea-ps_replace.txt(120,2-17): error X3000: unrecognized identifier 'IESLightTableSRV'
/////////////////////////////////////////////////////////////////////////////
