#include <metal_stdlib>
using namespace metal;

struct S {
  int a;
};

struct tint_module_vars_struct {
  device S* v;
};

int tint_mod_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));
  int const v_4 = select(rhs, 1, bool((v_3 | uint(v_2))));
  return as_type<int>((as_type<uint>(lhs) - as_type<uint>(as_type<int>((as_type<uint>((lhs / v_4)) * as_type<uint>(v_4))))));
}

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