#include <metal_stdlib>

using namespace metal;
struct tint_padded_array_element {
  /* 0x0000 */ float el;
  /* 0x0004 */ int8_t tint_pad[12];
};
struct tint_array_wrapper {
  /* 0x0000 */ tint_padded_array_element arr[1];
};
struct buf0 {
  /* 0x0000 */ tint_array_wrapper x_GLF_uniform_float_values;
};
struct tint_padded_array_element_1 {
  /* 0x0000 */ int el;
  /* 0x0004 */ int8_t tint_pad_1[12];
};
struct tint_array_wrapper_1 {
  /* 0x0000 */ tint_padded_array_element_1 arr[4];
};
struct buf1 {
  /* 0x0000 */ tint_array_wrapper_1 x_GLF_uniform_int_values;
};
struct tint_array_wrapper_2 {
  float4 arr[2];
};
struct main_out {
  float4 x_GLF_color_1;
};
struct tint_symbol_2 {
  float4 x_GLF_color_1 [[color(0)]];
};

void main_1(constant buf0& x_7, constant buf1& x_10, thread float4* const tint_symbol_6, thread float4* const tint_symbol_7) {
  tint_array_wrapper_2 data = {};
  int b = 0;
  int y = 0;
  int i = 0;
  float const x_42 = x_7.x_GLF_uniform_float_values.arr[0].el;
  float const x_45 = x_7.x_GLF_uniform_float_values.arr[0].el;
  tint_array_wrapper_2 const tint_symbol_4 = {.arr={float4(x_42, x_42, x_42, x_42), float4(x_45, x_45, x_45, x_45)}};
  data = tint_symbol_4;
  int const x_49 = x_10.x_GLF_uniform_int_values.arr[1].el;
  b = x_49;
  float const x_51 = (*(tint_symbol_6)).y;
  int const x_54 = x_10.x_GLF_uniform_int_values.arr[1].el;
  float const x_56 = (*(tint_symbol_6)).y;
  int const x_60 = x_10.x_GLF_uniform_int_values.arr[1].el;
  y = clamp(int(x_51), (x_54 | int(x_56)), x_60);
  int const x_63 = x_10.x_GLF_uniform_int_values.arr[1].el;
  i = x_63;
  while (true) {
    bool x_82 = false;
    bool x_83_phi = false;
    int const x_68 = i;
    int const x_70 = x_10.x_GLF_uniform_int_values.arr[0].el;
    if ((x_68 < x_70)) {
    } else {
      break;
    }
    int const x_73 = b;
    int const x_75 = x_10.x_GLF_uniform_int_values.arr[0].el;
    bool const x_76 = (x_73 > x_75);
    x_83_phi = x_76;
    if (x_76) {
      int const x_79 = y;
      int const x_81 = x_10.x_GLF_uniform_int_values.arr[1].el;
      x_82 = (x_79 > x_81);
      x_83_phi = x_82;
    }
    bool const x_83 = x_83_phi;
    if (x_83) {
      break;
    }
    int const x_86 = b;
    b = (x_86 + 1);
    {
      int const x_88 = i;
      i = (x_88 + 1);
    }
  }
  int const x_90 = b;
  int const x_92 = x_10.x_GLF_uniform_int_values.arr[0].el;
  if ((x_90 == x_92)) {
    int const x_97 = x_10.x_GLF_uniform_int_values.arr[2].el;
    int const x_99 = x_10.x_GLF_uniform_int_values.arr[1].el;
    int const x_101 = x_10.x_GLF_uniform_int_values.arr[3].el;
    int const x_104 = x_10.x_GLF_uniform_int_values.arr[1].el;
    int const x_107 = x_10.x_GLF_uniform_int_values.arr[2].el;
    int const x_110 = x_10.x_GLF_uniform_int_values.arr[2].el;
    int const x_113 = x_10.x_GLF_uniform_int_values.arr[1].el;
    data.arr[clamp(x_97, x_99, x_101)] = float4(float(x_104), float(x_107), float(x_110), float(x_113));
  }
  int const x_118 = x_10.x_GLF_uniform_int_values.arr[1].el;
  float4 const x_120 = data.arr[x_118];
  *(tint_symbol_7) = float4(x_120.x, x_120.y, x_120.z, x_120.w);
  return;
}

fragment tint_symbol_2 tint_symbol(float4 gl_FragCoord_param [[position]], constant buf0& x_7 [[buffer(0)]], constant buf1& x_10 [[buffer(1)]]) {
  thread float4 tint_symbol_8 = 0.0f;
  thread float4 tint_symbol_9 = 0.0f;
  tint_symbol_8 = gl_FragCoord_param;
  main_1(x_7, x_10, &(tint_symbol_8), &(tint_symbol_9));
  main_out const tint_symbol_3 = {.x_GLF_color_1=tint_symbol_9};
  tint_symbol_2 const tint_symbol_5 = {.x_GLF_color_1=tint_symbol_3.x_GLF_color_1};
  return tint_symbol_5;
}