#include <metal_stdlib>

using namespace metal;
void max_e8192f(device int2* const tint_symbol_1) {
  int2 res = int2(1);
  *(tint_symbol_1) = res;
}

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

float4 vertex_main_inner(device int2* const tint_symbol_2) {
  max_e8192f(tint_symbol_2);
  return float4(0.0f);
}

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

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

