#include <metal_stdlib>
using namespace metal;
struct MyStruct {
  float f1;
};
template<typename T, size_t N>
struct tint_array {
  const constant T& operator[](size_t i) const constant { return elements[i]; }
  device T& operator[](size_t i) device { return elements[i]; }
  const device T& operator[](size_t i) const device { return elements[i]; }
  thread T& operator[](size_t i) thread { return elements[i]; }
  const thread T& operator[](size_t i) const thread { return elements[i]; }
  threadgroup T& operator[](size_t i) threadgroup { return elements[i]; }
  const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; }
  T elements[N];
};

struct tint_module_vars_struct {
  thread int* v1;
  thread uint* v2;
  thread float* v3;
  thread int3* v4;
  thread uint3* v5;
  thread float3* v6;
  thread MyStruct* v7;
  thread tint_array<float, 10>* v8;
  thread int* v9;
  thread uint* v10;
  thread float* v11;
  thread MyStruct* v12;
  thread MyStruct* v13;
  thread tint_array<float, 10>* v14;
  thread int3* v15;
  thread float3* v16;
};

kernel void f() {
  thread int v1 = 1;
  thread uint v2 = 1u;
  thread float v3 = 1.0f;
  thread int3 v4 = int3(1);
  thread uint3 v5 = uint3(1u, 2u, 3u);
  thread float3 v6 = float3(1.0f, 2.0f, 3.0f);
  thread MyStruct v7 = MyStruct{.f1=1.0f};
  thread tint_array<float, 10> v8 = tint_array<float, 10>{};
  thread int v9 = 0;
  thread uint v10 = 0u;
  thread float v11 = 0.0f;
  thread MyStruct v12 = MyStruct{};
  thread MyStruct v13 = MyStruct{};
  thread tint_array<float, 10> v14 = tint_array<float, 10>{};
  thread int3 v15 = int3(1, 2, 3);
  thread float3 v16 = float3(1.0f, 2.0f, 3.0f);
  tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.v1=(&v1), .v2=(&v2), .v3=(&v3), .v4=(&v4), .v5=(&v5), .v6=(&v6), .v7=(&v7), .v8=(&v8), .v9=(&v9), .v10=(&v10), .v11=(&v11), .v12=(&v12), .v13=(&v13), .v14=(&v14), .v15=(&v15), .v16=(&v16)};
  int const l1 = (*tint_module_vars.v1);
  uint const l2 = (*tint_module_vars.v2);
  float const l3 = (*tint_module_vars.v3);
  int3 const l4 = (*tint_module_vars.v4);
  uint3 const l5 = (*tint_module_vars.v5);
  float3 const l6 = (*tint_module_vars.v6);
  MyStruct const l7 = (*tint_module_vars.v7);
  tint_array<float, 10> const l8 = (*tint_module_vars.v8);
  int const l9 = (*tint_module_vars.v9);
  uint const l10 = (*tint_module_vars.v10);
  float const l11 = (*tint_module_vars.v11);
  MyStruct const l12 = (*tint_module_vars.v12);
  MyStruct const l13 = (*tint_module_vars.v13);
  tint_array<float, 10> const l14 = (*tint_module_vars.v14);
  int3 const l15 = (*tint_module_vars.v15);
  float3 const l16 = (*tint_module_vars.v16);
}
