#include <metal_stdlib>
using namespace metal;

struct FragOutput {
  float4 color;
  float4 blend;
};

struct frag_main_outputs {
  float4 FragOutput_color [[color(0)]] [[index(0)]];
  float4 FragOutput_blend [[color(0)]] [[index(1)]];
};

FragOutput frag_main_inner() {
  FragOutput output = {};
  output.color = float4(0.5f, 0.5f, 0.5f, 1.0f);
  output.blend = float4(0.5f, 0.5f, 0.5f, 1.0f);
  return output;
}

fragment frag_main_outputs frag_main() {
  FragOutput const v = frag_main_inner();
  frag_main_outputs tint_wrapper_result = {};
  tint_wrapper_result.FragOutput_color = v.color;
  tint_wrapper_result.FragOutput_blend = v.blend;
  return tint_wrapper_result;
}
