code: def _gf_gcd(fp, gp, p):
      r"""
      Compute the GCD of two univariate polynomials in `\mathbb{Z}_p[x]`.
      """
      dom = fp.ring.domain
  
      while gp:
          rem = fp
          deg = gp.degree()
          lcinv = dom.invert(gp.LC, p)
  
          while True:
              degrem = rem.degree()
              if degrem < deg:
                  break
              rem = (
                  rem
                  - gp.mul_monom((degrem - deg,)).mul_ground(
                      lcinv * rem.LC
                  )
              ).trunc_ground(p)
  
          fp = gp
          gp = rem
  
      return fp.mul_ground(dom.invert(fp.LC, p)).trunc_ground(p)
  
imports: from sympy.core.symbol import Dummy
  from sympy.ntheory import nextprime
  from sympy.ntheory.modular import crt
  from sympy.polys.domains import PolynomialRing
  from sympy.polys.galoistools import gf_gcd, gf_from_dict, gf_gcdex, gf_div, gf_lcm
  from sympy.polys.polyerrors import ModularGCDFailed
  from mpmath import sqrt
  import random
label_desc: Use image node_id 2 for calling a global function with example usage: _gf_gcd(fp, gp, p) and returns: fp