#include <metal_stdlib>

using namespace metal;
void reverseBits_35fea9(device uint4* const tint_symbol_1) {
  uint4 res = uint4(2147483648u);
  *(tint_symbol_1) = res;
}

struct tint_symbol {
  float4 value [[position]];
};

float4 vertex_main_inner(device uint4* const tint_symbol_2) {
  reverseBits_35fea9(tint_symbol_2);
  return float4(0.0f);
}

vertex tint_symbol vertex_main(device uint4* tint_symbol_3 [[buffer(0)]]) {
  float4 const inner_result = vertex_main_inner(tint_symbol_3);
  tint_symbol wrapper_result = {};
  wrapper_result.value = inner_result;
  return wrapper_result;
}

fragment void fragment_main(device uint4* tint_symbol_4 [[buffer(0)]]) {
  reverseBits_35fea9(tint_symbol_4);
  return;
}

kernel void compute_main(device uint4* tint_symbol_5 [[buffer(0)]]) {
  reverseBits_35fea9(tint_symbol_5);
  return;
}

