#include <metal_stdlib>
using namespace metal;

struct tint_symbol_outputs {
  float4 tint_symbol_1 [[position]];
};

int vec4f() {
  return 0;
}

float vec2f(int i) {
  return float(i);
}

bool vec2i(float f) {
  return bool(f);
}

float4 tint_symbol_inner(uint VertexIndex) {
  return select(float4(0.0f), float4(1.0f), vec2i(vec2f(vec4f())));
}

vertex tint_symbol_outputs tint_symbol(uint VertexIndex [[vertex_id]]) {
  tint_symbol_outputs tint_wrapper_result = {};
  tint_wrapper_result.tint_symbol_1 = tint_symbol_inner(VertexIndex);
  return tint_wrapper_result;
}
