code: def igcdex(a, b):
      """Returns x, y, g such that g = x*a + y*b = gcd(a, b).
  
      Examples
      ========
  
      >>> from sympy.core.intfunc import igcdex
      >>> igcdex(2, 3)
      (-1, 1, 1)
      >>> igcdex(10, 12)
      (-1, 1, 2)
  
      >>> x, y, g = igcdex(100, 2004)
      >>> x, y, g
      (-20, 1, 4)
      >>> x*100 + y*2004
      4
  
      """
      if (not a) and (not b):
          return (0, 1, 0)
      g, x, y = gcdext(int(a), int(b))
      return x, y, g
  
file_path: sympy/sympy/core/intfunc.py
imports: import math
  import sys
  from functools import lru_cache
  from .sympify import sympify
  from .singleton import S
  from sympy.external.gmpy import gcd, lcm, sqrt, iroot, bit_scan1, gcdext
  from sympy.utilities.misc import as_int, filldedent
label_desc: Use image node_id 7 for calling a global function with example usage: igcdex(a, b) and returns: x,  y,  g, int,  int,  int