
RWByteAddressBuffer prevent_dce : register(u0);
int3 subgroupShuffleXor_7435fe() {
  int3 arg_0 = (int(1)).xxx;
  uint arg_1 = 1u;
  int3 v = arg_0;
  uint v_1 = arg_1;
  int3 res = WaveReadLaneAt(v, (WaveGetLaneIndex() ^ v_1));
  return res;
}

void fragment_main() {
  prevent_dce.Store3(0u, asuint(subgroupShuffleXor_7435fe()));
}

[numthreads(1, 1, 1)]
void compute_main() {
  prevent_dce.Store3(0u, asuint(subgroupShuffleXor_7435fe()));
}

