#include <metal_stdlib>
using namespace metal;

int3 tint_mod_v3i32(int3 lhs, int3 rhs) {
  uint3 const v = uint3((lhs == int3((-2147483647 - 1))));
  bool3 const v_1 = bool3((v & uint3((rhs == int3(-1)))));
  uint3 const v_2 = uint3((rhs == int3(0)));
  int3 const v_3 = select(rhs, int3(1), bool3((v_2 | uint3(v_1))));
  return as_type<int3>((as_type<uint3>(lhs) - as_type<uint3>(as_type<int3>((as_type<uint3>((lhs / v_3)) * as_type<uint3>(v_3))))));
}

kernel void f() {
  int3 const a = int3(1, 2, 3);
  int3 const b = int3(4, 5, 6);
  int3 const r = tint_mod_v3i32(a, b);
}
