
// Vk3DVision (http://3dsurroundgaming.com/) - Original Shader
#version 450
#extension GL_EXT_nonuniform_qualifier : require
#extension GL_ARB_shader_draw_parameters : require
#extension GL_ARB_shader_ballot : require

out float gl_ClipDistance[1];

invariant gl_Position;

struct S_MATRICES
{
    mat4 _mModelViewProj;
    mat4 _mModelViewProjPrevious;
    mat4 _mModelView;
    mat4 _mInvModelView;
};

struct unaligned_float3
{
    float x;
    float y;
    float z;
};

struct S_TBN
{
    int _iNormal;
    int _iTangent;
};

struct S_INDICES
{
    uint _uiObjectIndex;
    uint _uiMaterialIndex;
    uint _uiMaterialInstanceIndex;
    uint _uiLastFrameMaterialIndex;
    uint _uiLastFrameMaterialInstanceIndex;
    uint _uiPositionsBufferIndex;
    uint _uiPrevPositionsBufferIndex;
    uint _uiNormalsBufferIndex;
    uint _uiPositionOffset;
    uint _uiPrevPositionOffset;
    uint _uiNormalOffset;
    uint _uiMatricesIndex;
};

struct S_MAIN_DEFAULT
{
    S_INDICES _Indices;
};

struct S_MAIN_DEFAULT_ARRAY
{
    S_MAIN_DEFAULT _aMain[32];
};

struct S_SPEEDTREE_MESH_OBJECT
{
    mat4 _mModel;
    mat4 _mModelLast;
    mat4 _mInvModel;
    mat4 _mInvModelLast;
    vec4 _vDiversityOffset;
    uint _uiSceneZoneIndex;
    uint _uiNeighborSceneZoneIndex;
    uint _uiDisplayFlags;
    uint _uiPackedLocalExposureCompensation;
    vec4 _vPortalDirAndDistance;
    int _iPickingID[2];
    uint _uiPadding[2];
    vec4 _vTreeRotation;
    vec4 _vWindGlobal;
    vec4 _vWindVector;
    vec4 _vWindBranchAdherences;
    vec4 _vWindBranch;
    vec4 _vWindBranchTwitch;
    vec4 _vWindBranchWhipTurbulences;
    vec4 _vWindFrondRipple;
    vec4 _vWindLeaf1Ripple;
    vec4 _vWindLeaf1Tumble;
    vec4 _vWindLeaf1Twitch;
    vec4 _vWindLeaf2Ripple;
    vec4 _vWindLeaf2Tumble;
    vec4 _vWindLeaf2Twitch;
    vec4 _vAnchorAllTime;
    vec4 _vRollingBranch;
    vec4 _vRollingLeafOffset;
    vec4 _vRollingNoise;
    uint _uiLOD;
    uint _uiSmooth;
    float _fLocalExposureCompensation;
    float _fLocalExposureCompensationEV100;
    vec4 _vWindGlobalLast;
    vec4 _vWindBranchLast;
    vec4 _vWindFrondRippleLast;
    vec4 _vWindLeaf1RippleLast;
    vec4 _vWindLeaf1TumbleLast;
    vec4 _vWindLeaf1TwitchLast;
    vec4 _vWindLeaf2RippleLast;
    vec4 _vWindLeaf2TumbleLast;
    vec4 _vAnchorAllTimeLast;
};

struct S_PASS_MATRICES
{
    mat4 _mViewJitteredProj;
    mat4 _mViewProj;
    mat4 _mView;
    mat4 _mInvView;
    mat4 _mJitteredProj;
};

struct S_EYE_DATA
{
    S_PASS_MATRICES _mCurrentFrameMatrices[2];
    S_PASS_MATRICES _mPreviousFrameMatrices[2];
    mat4 _mJitteredProjection[2];
    mat4 _mNoJitterProjection[2];
    mat4 _mInvViewJitteredProj[2];
    vec4 _vWorldSpaceCameraVector[2];
    vec4 _vWorldSpaceCameraPosition[2];
    vec4 _vFrameBufferScale;
    vec4 _vFrameBufferViewportSize;
    vec4 _vFrameBufferOneOnViewportSize;
    vec4 _vViewportSize;
    vec4 _vFogSubCrop;
    uint _uiAlignment0;
    uint _uiAlignment1;
    float _vCameraJitterDeltaX;
    float _vCameraJitterDeltaY;
    vec4 _vfRcpFVolumetricFogDepthTileSize;
};

struct S_CASCADED_SHADOW
{
    mat4 _mCascadeMatrix[2][8];
    mat4 _mViewSpaceToStaticShadowMapSpace[2];
    vec4 _vfCascadeShadowAttenuation;
    vec4 _vfShadowCascadeTextureTexelSize;
    vec4 _vfStaticShadowBlurRadius;
    vec4 _vfCascadeLinearZProjFactors[8];
    vec4 _vfCascadeParams[8];
};

struct S_CLUSTER_LIGHT_SETUP
{
    S_CASCADED_SHADOW _CascadedShadow;
    vec4 _vfSkinUVParamsAndNormalBias;
    vec4 _vfShadowTextureTexelSize;
    vec4 _vfDummy_SkinFresnelF0AndF90;
    uint _uiCascadedUsed;
    float _fSSSWidth;
    float _fOffsetBias;
    float _fDummy;
};

struct S_CLUSTER_INFO
{
    mat4 _mViewToClusterView[2];
    mat4 _mClusterProjMatrix;
    mat4 _mClusterInvProjMatrix;
    vec4 _vfLeftEyeToCombinedEyeVsDeltaXZ;
    uint _uiFinestMipWidth;
    uint _uiFinestMipHeight;
    uint _uiFinestMipDepth;
    uint _uiFinestMipWidthHeight;
    float _fZSliceGeomFactor;
    float _fRcpLogZSliceGeomFactor;
    float _fDummy0;
    float _fDummy1;
    float _fNearP;
    float _fInvNearP;
    float _fFarP;
    float _fClusterCoincidentWithCamera;
};

struct S_PASS
{
    S_EYE_DATA _EyeData;
    vec4 _avFrustumCorners[4];
    vec4 _vTime;
    vec4 _cFogColor;
    vec4 _vFogSetup;
    vec4 _cSunColor;
    vec4 _vSunDir;
    vec4 _vProjectionSetup;
    vec4 _vProjectionCoeff;
    vec4 _vOutputColor;
    vec4 _vfVsClippingPlane[2];
    S_CLUSTER_LIGHT_SETUP _LightSetup;
    S_CLUSTER_INFO _ClusterInfo;
    float _fIBLIntensity;
    float _fGIIntensity;
    float _fAmbiantOcclusionDirectIntensity;
    float _fAmbiantOcclusionIndirectIntensity;
    float _fNormalSign;
    int _iFogType;
    float _fSelfOcclusionDebugRatio;
    float _fEmissive;
    int _iEnableSkinSSSSS;
    int _iUseHairOpaquePrepass;
    float _fLocalSceneExposure;
    uint _uiDebugMode;
    uint _sFlags;
    float _fTAADropsSharpness;
    uint _uNeoScaleX;
    uint _uNeoScaleY;
    uint _uiDirectOverdrawFilter;
    float _fCoderTest0;
    float _fCoderTest1;
    float _fCoderTest2;
    uint _uiBakeOutput;
    float _fDefaultAmbientIntensity;
    float _fDefaultLightingIntensity;
    uint _uiOutputColor;
    float _fAARotation;
    float _fClampDirectSpecular;
    float _fNearPlane;
    float _fFarPlane;
    float _fNDFFilteringScreenSpaceVariance;
    float _fNDFFilteringThreshold;
    float _fNDFFilteringScreenSpaceVariance_EyeShader;
    float _fNDFFilteringThreshold_EyeShader;
    float _fSurfaceGradientTextureFiltering;
    float _fZero;
    uint _uDepthClamp;
    uint _uiLightDebugMode;
    vec4 _vfFragCoordToDepthTexFactor;
    vec4 _vfFragCoordToDepthTexFactor_HalfRes;
    uint _uHdr;
    uint _uiDrawMayaSwatch;
    float _fEyeRoughnessBias;
    float _fDummy1;
};

layout(set = 1, binding = 24, std430) readonly buffer stc_g_rbMatrices_Layout
{
    S_MATRICES g_rbMatrices[];
} _426;

layout(set = 1, binding = 39, std430) readonly buffer g_rbVertices_Layout
{
    unaligned_float3 g_rbVertices[];
} g_rbVertices_Buffer[];

layout(set = 1, binding = 40, std430) readonly buffer g_rbTBNs_Layout
{
    S_TBN g_rbTBNs[];
} g_rbTBNs_Buffer[];

layout(set = 0, binding = 52, std140) uniform dyn_CONSTANT_BUFFER_BLOCK_CB_S_MAIN_ARRAY_BINDING
{
    S_MAIN_DEFAULT_ARRAY g_cbMainArray;
} _3253;

layout(set = 1, binding = 33, std430) readonly buffer g_rbObjects_Layout
{
    S_SPEEDTREE_MESH_OBJECT g_rbObjects[];
} g_rbObjects_Buffer[];

layout(set = 2, binding = 53, std140) uniform dyn_CONSTANT_BUFFER_BLOCK_CB_S_PASS_BINDING
{
    S_PASS g_cbPass;
} _3500;

layout(location = 8) in vec2 in_uv0;
layout(location = 10) in vec4 in_lodPosition;
layout(location = 11) in vec4 in_windBranchData;
layout(location = 12) in vec4 in_windExtraDataFlag;
layout(location = 13) in vec4 in_LeafAnchorHint;
layout(location = 8) out vec2 interp_uv0;
layout(location = 21) out vec3 interp_vfVsPosition;
layout(location = 14) out vec3 interp_vfVsTangent;
layout(location = 15) out vec3 interp_vfVsBinormal;
layout(location = 13) out vec3 interp_vfVsNormal;
layout(location = 23) out float interp_instanceID;

void main()
{
    int _3243 = gl_InstanceIndex + gl_DrawIDARB;
    int _3244 = readFirstInvocationARB(_3243);
    uint _5138 = uint(gl_VertexIndex);
    uint _5141 = _5138 + _3253.g_cbMainArray._aMain[_3244]._Indices._uiPositionOffset;
    vec4 _5154 = vec4(g_rbVertices_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiPositionsBufferIndex].g_rbVertices[_5141].x, g_rbVertices_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiPositionsBufferIndex].g_rbVertices[_5141].y, g_rbVertices_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiPositionsBufferIndex].g_rbVertices[_5141].z, 1.0);
    uint _5161 = _5138 + _3253.g_cbMainArray._aMain[_3244]._Indices._uiNormalOffset;
    int _5190 = g_rbTBNs_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiNormalsBufferIndex].g_rbTBNs[_5161]._iNormal & 1023;
    int _5193 = (g_rbTBNs_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiNormalsBufferIndex].g_rbTBNs[_5161]._iNormal >> 10) & 1023;
    int _5196 = (g_rbTBNs_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiNormalsBufferIndex].g_rbTBNs[_5161]._iNormal >> 20) & 1023;
    int _9856;
    if (_5190 > 512)
    {
        _9856 = _5190 | (-1024);
    }
    else
    {
        _9856 = _5190;
    }
    int _9858;
    if (_5193 > 512)
    {
        _9858 = _5193 | (-1024);
    }
    else
    {
        _9858 = _5193;
    }
    int _9860;
    if (_5196 > 512)
    {
        _9860 = _5196 | (-1024);
    }
    else
    {
        _9860 = _5196;
    }
    vec3 _5249 = vec3(float(_9856), float(_9858), float(_9860)) * vec3(0.001956947147846221923828125);
    int _5258 = g_rbTBNs_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiNormalsBufferIndex].g_rbTBNs[_5161]._iTangent & 1023;
    int _5261 = (g_rbTBNs_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiNormalsBufferIndex].g_rbTBNs[_5161]._iTangent >> 10) & 1023;
    int _5264 = (g_rbTBNs_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiNormalsBufferIndex].g_rbTBNs[_5161]._iTangent >> 20) & 1023;
    int _9862;
    if (_5258 > 512)
    {
        _9862 = _5258 | (-1024);
    }
    else
    {
        _9862 = _5258;
    }
    int _9864;
    if (_5261 > 512)
    {
        _9864 = _5261 | (-1024);
    }
    else
    {
        _9864 = _5261;
    }
    int _9866;
    if (_5264 > 512)
    {
        _9866 = _5264 | (-1024);
    }
    else
    {
        _9866 = _5264;
    }
    float _5322 = float((g_rbTBNs_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiNormalsBufferIndex].g_rbTBNs[_5161]._iTangent >> 30) != 0);
    vec3 _5339 = _5154.xyz;
    vec3 _5453 = vec4(vec3(float(_9862), float(_9864), float(_9866)) * vec3(0.001956947147846221923828125), _5322).xyz;
    float _5996 = length(_5339);
    float _6007 = max(g_rbVertices_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiPositionsBufferIndex].g_rbVertices[_5141].y - (0.25 / g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindGlobal.z), 0.0) * g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindGlobal.z;
    float _9875;
    if (_6007 != 0.0)
    {
        _9875 = pow(abs(_6007), g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindGlobal.w);
    }
    else
    {
        _9875 = _6007;
    }
    float _6021 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindGlobal.x * 0.800000011920928955078125;
    vec4 _6022 = vec4(g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindGlobal.x, _6021, 0.0, 0.0);
    vec4 _6078 = _6022 + vec4(0.5);
    vec4 _6079 = fract(_6078);
    vec4 _6080 = _6079 * 2.0;
    vec4 _6082 = _6080 - vec4(1.0);
    vec4 _6083 = abs(_6082);
    vec4 _6087 = _6083 * _6083;
    vec4 _6089 = _6083 * 2.0;
    vec4 _6091 = vec4(3.0) - _6089;
    vec4 _6092 = _6087 * _6091;
    vec4 _6073 = _6092 - vec4(0.5);
    vec4 _6074 = _6073 * 2.0;
    float _6025 = _6074.x;
    float _6027 = _6074.y;
    float _6030 = _6027 * _6027;
    float _6031 = _6025 + _6030;
    float _6035 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindGlobal.y * _6031;
    float _6048 = _6035 * _9875;
    vec2 _6052 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindVector.xz * _6048;
    vec2 _6054 = _5154.xz;
    vec2 _6055 = _6054 + _6052;
    vec3 _6057 = vec3(_6055.x, _5154.y, _6055.y);
    vec3 _6062 = normalize(_6057);
    vec3 _6064 = _6062 * _5996;
    vec3 _5939 = _6064 - _5339;
    vec3 _6266 = vec3(in_windBranchData.y);
    vec3 _6267 = _6266 * vec3(0.0625, -1.0, 16.0);
    vec3 _6268 = fract(_6267);
    vec3 _6270 = _6268.xzy;
    vec3 _6271 = _6270 * 2.0;
    vec3 _6272 = _6271 - vec3(1.0);
    vec3 _6242 = _6272 * in_windBranchData.x;
    float _6341 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranch.x + in_windBranchData.y;
    float _6344 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranch.x * g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranchTwitch.y;
    float _6346 = _6344 + in_windBranchData.y;
    float _6348 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranchTwitch.y * 0.5;
    float _6352 = _6348 * _6341;
    vec4 _6353 = vec4(_6341, _6346, _6352, 0.0);
    vec4 _6492 = _6353 + vec4(0.5);
    vec4 _6493 = fract(_6492);
    vec4 _6494 = _6493 * 2.0;
    vec4 _6496 = _6494 - vec4(1.0);
    vec4 _6497 = abs(_6496);
    vec4 _6501 = _6497 * _6497;
    vec4 _6503 = _6497 * 2.0;
    vec4 _6505 = vec4(3.0) - _6503;
    vec4 _6506 = _6501 * _6505;
    vec4 _6487 = _6506 - vec4(0.5);
    vec4 _6488 = _6487 * 2.0;
    float _6378 = _6488.x;
    float _6380 = _6488.y;
    float _6382 = _6488.z;
    float _6383 = _6380 * _6382;
    bool _6386 = _6383 < 0.0;
    float _9889;
    if (_6386)
    {
        _9889 = -_6383;
    }
    else
    {
        _9889 = _6383;
    }
    float _9917 = _6386 ? (-1.0) : 1.0;
    float _6396 = mix(_6383, _9917, _9889);
    float _6400 = mix(_6396, _9917, _9889);
    float _6403 = _6400 * g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranchTwitch.x;
    float _6406 = 1.0 - g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindVector.w;
    float _6407 = _6403 * _6406;
    float _6410 = 1.0 - g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranchTwitch.x;
    float _6411 = _6378 * _6410;
    float _6412 = _6407 + _6411;
    vec3 _6257 = _6242 * _6412;
    vec3 _6259 = _6257 * g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranch.y;
    vec3 _6261 = _5339 + _6259;
    vec3 _6577 = vec3(in_windBranchData.w);
    vec3 _6578 = _6577 * vec3(0.0625, -1.0, 16.0);
    vec3 _6579 = fract(_6578);
    vec3 _6581 = _6579.xzy;
    vec3 _6582 = _6581 * 2.0;
    vec3 _6583 = _6582 - vec3(1.0);
    vec3 _6553 = _6583 * in_windBranchData.z;
    float _6652 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranch.z + in_windBranchData.w;
    float _6655 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranch.z * g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranchTwitch.w;
    float _6657 = _6655 + in_windBranchData.w;
    float _6659 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranchTwitch.w * 0.5;
    float _6663 = _6659 * _6652;
    vec4 _6664 = vec4(_6652, _6657, _6663, 0.0);
    vec4 _6803 = _6664 + vec4(0.5);
    vec4 _6804 = fract(_6803);
    vec4 _6805 = _6804 * 2.0;
    vec4 _6807 = _6805 - vec4(1.0);
    vec4 _6808 = abs(_6807);
    vec4 _6812 = _6808 * _6808;
    vec4 _6814 = _6808 * 2.0;
    vec4 _6816 = vec4(3.0) - _6814;
    vec4 _6817 = _6812 * _6816;
    vec4 _6798 = _6817 - vec4(0.5);
    vec4 _6799 = _6798 * 2.0;
    float _6689 = _6799.x;
    float _6691 = _6799.y;
    float _6693 = _6799.z;
    float _6694 = _6691 * _6693;
    bool _6697 = _6694 < 0.0;
    float _9902;
    if (_6697)
    {
        _9902 = -_6694;
    }
    else
    {
        _9902 = _6694;
    }
    float _9918 = _6697 ? (-1.0) : 1.0;
    float _6707 = mix(_6694, _9918, _9902);
    float _6711 = mix(_6707, _9918, _9902);
    float _6714 = _6711 * g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranchTwitch.z;
    float _6718 = _6714 * _6406;
    float _6721 = 1.0 - g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranchTwitch.z;
    float _6722 = _6689 * _6721;
    float _6723 = _6718 + _6722;
    vec3 _6568 = _6553 * _6723;
    vec3 _6570 = _6568 * g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vWindBranch.w;
    vec3 _6572 = _6261 + _6570;
    vec3 _5960 = _6572 - _5339;
    vec3 _5973 = _5939 + _5960;
    vec3 _5975 = _5339 + _5973;
    float _5760 = mix(in_lodPosition.w, 1.0, g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vTreeRotation.z);
    vec2 _5762 = in_lodPosition.xy * _5760;
    float _5765 = -in_lodPosition.z;
    float _5766 = _5762.x;
    float _5767 = _5762.y;
    vec3 _5768 = vec3(_5766, _5767, _5765);
    vec3 _5771 = _5768 * g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._vTreeRotation.w;
    float _5775 = _5975.x;
    float _5776 = _5975.y;
    float _5777 = _5975.z;
    vec4 _5778 = vec4(_5775, _5776, _5777, 1.0);
    vec4 _5779 = g_rbObjects_Buffer[_3253.g_cbMainArray._aMain[_3244]._Indices._uiObjectIndex].g_rbObjects[0]._mModel * _5778;
    float _5784 = _5779.x;
    float _5785 = _5779.y;
    float _5786 = _5779.z;
    vec4 _5787 = vec4(_5784, _5785, _5786, 1.0);
    vec4 _5788 = _3500.g_cbPass._EyeData._mCurrentFrameMatrices[0]._mView * _5787;
    vec3 _5789 = _5788.xyz;
    vec3 _5792 = _5789 + _5771;
    float _5796 = _5792.x;
    float _5797 = _5792.y;
    float _5798 = _5792.z;
    vec4 _5799 = vec4(_5796, _5797, _5798, 1.0);
    vec4 _5800 = _3500.g_cbPass._EyeData._mCurrentFrameMatrices[0]._mInvView * _5799;
    float _5807 = _5800.x;
    float _5808 = _5800.y;
    float _5809 = _5800.z;
    vec4 _5810 = vec4(_5807, _5808, _5809, 1.0);
    vec4 _5811 = _3500.g_cbPass._EyeData._mCurrentFrameMatrices[0]._mViewJitteredProj * _5810;
    vec4 _5832 = _3500.g_cbPass._EyeData._mCurrentFrameMatrices[0]._mView * _5810;
    vec4 _9909;
    if (_3500.g_cbPass._uDepthClamp == 4294967295u)
    {
        float _6857 = _5811.w;
        vec4 _9910;
        if ((_5811.z / _6857) > 1.0)
        {
            vec4 _9911;
            if (_5832.z > _3500.g_cbPass._fNearPlane)
            {
                vec4 _9847 = _5811;
                _9847.z = _6857;
                _9911 = _9847;
            }
            else
            {
                _9911 = _5811;
            }
            _9910 = _9911;
        }
        else
        {
            _9910 = _5811;
        }
        _9909 = _9910;
    }
    else
    {
        _9909 = _5811;
    }
    interp_instanceID = float(_3243) + 0.5;
    float _5021 = _5832.x;
    float _5022 = _5832.y;
    float _5023 = _5832.z;
    vec4 _5024 = vec4(_5021, _5022, _5023, 1.0);
    float _5025 = dot(_3500.g_cbPass._vfVsClippingPlane[0], _5024);
    float _5026 = -_5025;
    gl_ClipDistance[0] = _5026;
    interp_uv0 = in_uv0;
    interp_vfVsPosition = _5832.xyz;
    interp_vfVsTangent = mat3(_426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[0].xyz, _426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[1].xyz, _426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[2].xyz) * _5453;
    interp_vfVsBinormal = mat3(_426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[0].xyz, _426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[1].xyz, _426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[2].xyz) * (cross(_5249, _5453) * ((_5322 != 0.0) ? (-1.0) : 1.0));
    interp_vfVsNormal = mat3(_426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[0].xyz, _426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[1].xyz, _426.g_rbMatrices[_3253.g_cbMainArray._aMain[_3244]._Indices._uiMatricesIndex]._mModelView[2].xyz) * _5249;
    gl_Position = _9909;
}

