#include <metal_stdlib>

using namespace metal;
void bitcast_ca5c3f(device float* const tint_symbol_1) {
  float res = 1.40129846e-45f;
  *(tint_symbol_1) = res;
}

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

float4 vertex_main_inner(device float* const tint_symbol_2) {
  bitcast_ca5c3f(tint_symbol_2);
  return float4(0.0f);
}

vertex tint_symbol vertex_main(device float* 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 float* tint_symbol_4 [[buffer(0)]]) {
  bitcast_ca5c3f(tint_symbol_4);
  return;
}

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

