#version 310 es

layout(binding = 0, std430)
buffer tint_symbol_2_1_ssbo {
  uint tint_symbol_1;
} v;
void tint_symbol() {
  {
    while(true) {
      if ((v.tint_symbol_1 < 10u)) {
      } else {
        break;
      }
      {
        v.tint_symbol_1 = (v.tint_symbol_1 + 1u);
      }
      continue;
    }
  }
}
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
void main() {
}
