// MANUALLY DUMPED [ShaderRegexHalo2] P5S. Fixed in 5603d03d9895d56d-ps_replace.txt
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Sun Mar 06 17:40:07 2022
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float4 vEye;                       // Index:   27.xyzw           Components:     4
//   row_major float4x4 mW2P;           // Index:    0 1 2 3          Components:    16
//   float4 vSPort;                     // Index:   28.xyzw           Components:     4
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// NORMAL                   0   xyz         1     NONE   float   xyz
// COLOR                    0   xyzw        2     NONE   float   xyzw
// TEXCOORD                 0   xy          3     NONE   float   xy
// BLENDWEIGHT              0   xyzw        4     NONE   float   xyzw
// BLENDINDICES             0   xyzw        5     NONE   float   xyzw
// BINORMAL                 0   xyzw        6     NONE   float   xyzw
// COLOR                    1   xyzw        7     NONE     int   xyzw
// TEXCOORD                 3   xyzw        8     NONE     int   xyzw
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xyzw        1     NONE   float   xyzw
// TEXCOORD                 1   xyzw        2     NONE   float   xyzw
// TEXCOORD                 2   xyz         3     NONE   float   xyz
// TEXCOORD                 3   xy          4     NONE   float   xy
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[29], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xyz
dcl_input v2.xyzw
dcl_input v3.xy
dcl_input v4.xyzw
dcl_input v5.xyzw
dcl_input v6.xyzw
dcl_input v7.xyzw
dcl_input v8.xyzw
dcl_output_siv o0.xyzw, position

dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyz
dcl_output o4.xy
dcl_temps 6
dcl_resource_texture2d (float,float,float,float) t125
dp4 r0.y, v0.xyzw, v5.xyzw
mul r1.xyzw, r0.yyyy, cb0[1].xyzw
dp4 r0.x, v0.xyzw, v4.xyzw
mad r1.xyzw, r0.xxxx, cb0[0].xyzw, r1.xyzw
dp4 r0.z, v0.xyzw, v6.xyzw
mad r1.xyzw, r0.zzzz, cb0[2].xyzw, r1.xyzw
add r0.xyz, -r0.xyzx, cb0[27].xyzx
mad r1.xyzw, v0.wwww, cb0[3].xyzw, r1.xyzw

mov o0.xyzw, r1.xyzw

ld_indexable(texture2d)(float,float,float,float) r5.xyzw, l(0, 0, 0, 0), t125.xyzw
add r5.w, r1.w, -r5.y
//mad r1.x, r5.x, r5.w, r1.x
mul r2.xyz, v5.zxyz, v6.yzxy
mad r2.xyz, v5.yzxy, v6.zxyz, -r2.xyzx
dp3 r2.x, v1.xyzx, r2.xyzx
mul r3.xyz, v4.yzxy, v6.zxyz
mad r3.xyz, v6.yzxy, v4.zxyz, -r3.xyzx
dp3 r2.y, v1.xyzx, r3.xyzx
mul r3.xyz, v4.zxyz, v5.yzxy
mad r3.xyz, v4.yzxy, v5.zxyz, -r3.xyzx
dp3 r2.z, v1.xyzx, r3.xyzx
dp3 r0.w, r2.xyzx, r2.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r2.xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
rsq r0.w, r0.w
mul r3.xyz, r0.wwww, r0.xyzx
dp3 r0.w, r2.xyzx, r3.xyzx
dp3 r1.z, r2.xyzx, -r3.xyzx
add_sat r1.z, r1.z, l(1.000000)
itof r3.xyzw, v7.xyzw
lt r4.xyz, r3.xywx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r4.xyz, r4.xyzx, l(0x43800000, 0x43800000, 0x43800000, 0)
mad r4.xyz, r3.xywx, l(0.00390625000, 0.00390625000, 0.00390625000, 0.000000), r4.xyzx
mul r3.xyzw, r3.xyzw, l(0.00390625000, 0.00390625000, 0.00390625000, 0.00390625000)
frc r3.xyzw, r3.xyzw
add r4.xyz, -r3.xywx, r4.xyzx
mul r3.xyzw, r3.xyzw, v2.xyzw
mul r3.xyzw, r3.xyzw, l(1.00392163, 1.00392163, 1.00392163, 1.00392163)
lt r2.w, l(0.500000), r4.z
movc r0.w, r2.w, |r0.w|, l(1.000000)
mul o1.w, r0.w, r3.w
mov_sat r3.xyz, r3.xyzx
log r3.xyz, r3.xyzx
ge r0.w, r4.x, l(128.000000)
movc r2.w, r0.w, l(2.200000), l(1.000000)
mul r3.xyz, r3.xyzx, r2.wwww
exp o1.xyz, r3.xyzx
add r2.w, r4.x, l(-128.000000)
movc r0.w, r0.w, r2.w, r4.x
mul r0.w, r0.w, l(0.00784313772)
dp3 r2.w, -r0.xyzx, r2.xyzx
mad r3.xyz, r2.wwww, r2.xyzx, r0.xyzx
add r2.w, r2.w, r2.w
mad o3.xyz, -r2.wwww, r2.xyzx, -r0.xyzx
mad r0.xyz, r0.wwww, r3.xyzx, -r0.xyzx
mul r2.xyz, r0.yyyy, cb0[1].xywx
mad r0.xyw, r0.xxxx, cb0[0].xyxw, r2.xyxz
mad r0.xyz, r0.zzzz, cb0[2].xywx, r0.xywx
add r0.xyz, r1.xywx, r0.xyzx
dp2 o2.x, cb0[28].xyxx, r0.xzxx
dp2 o2.y, cb0[28].zwzz, r0.yzyy
mov o2.z, r0.z
mul r0.x, r1.z, r1.z
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, r1.z
mul r0.y, r4.y, l(0.00392156886)
mad r0.z, -r4.y, l(0.00392156886), l(1.000000)
mad o2.w, r0.x, r0.z, r0.y
itof r0.xyzw, v8.xyzw
mul r0.xyzw, r0.xyzw, l(0.000244140625, 0.000244140625, 0.000244140625, 0.000244140625)
mad o4.xy, v3.xyxx, r0.zwzz, r0.xyxx
ret
// Approximately 70 instruction slots used
