code: def _cast_to_int(x):
      y = x
      if x.dtype.is_floating():
          if core.constexpr(x.dtype.primitive_bitwidth) == 16:
              dtype_int = core.int16
          elif core.constexpr(x.dtype.primitive_bitwidth) == 32:
              dtype_int = core.int32
          elif core.constexpr(x.dtype.primitive_bitwidth) == 64:
              dtype_int = core.int64
          else:
              raise ValueError("Unsupported dtype")
          y = x.to(dtype_int, bitcast=True)
      return y
  
imports: from __future__ import annotations
  from ..runtime.jit import jit
  from .None import core, math
label_desc: Use image node_id 28 for calling a global function with example usage: _cast_to_int(x) and returns: y