#include <metal_stdlib>
using namespace metal;

struct S {
  int a;
};

struct tint_module_vars_struct {
  device S* v;
};

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

void foo(tint_module_vars_struct tint_module_vars) {
  (*tint_module_vars.v).a = tint_div_i32((*tint_module_vars.v).a, 2);
}
