#include <metal_stdlib>
using namespace metal;

struct tint_module_vars_struct {
  thread int* a;
  thread float4* b;
  thread float2x2* c;
};

int tint_div_i32(int lhs, int rhs) {
  uint const v = uint((lhs == (-2147483647 - 1)));
  bool const v_1 = bool((v & uint((rhs == -1))));
  uint const v_2 = uint((rhs == 0));
  return (lhs / select(rhs, 1, bool((v_2 | uint(v_1)))));
}

void foo(tint_module_vars_struct tint_module_vars) {
  (*tint_module_vars.a) = tint_div_i32((*tint_module_vars.a), 2);
  (*tint_module_vars.b) = ((*tint_module_vars.b) * float4x4(float4(0.0f), float4(0.0f), float4(0.0f), float4(0.0f)));
  (*tint_module_vars.c) = ((*tint_module_vars.c) * 2.0f);
}
