Factorize a Gaussian integer
Ruby, 258 256 249 246+8 = 264 257 254 bytes



Uses the -rprime flag.

Geez, what a mess.

Uses this algorithm from stackoverflow.

-&gt;c{m=-&gt;x,y{x-y*eval("%d+%di"%(x/y).rect)};a=c.abs2.prime_division.flat_map{|b,e|b%4&lt;2?(1..e).map{k=(2..d=b).find{|n|n**(~-b/2)%b==b-1}**(~-b/4)%b+1i;d,k=k,m[d,k]while k!=0;c/=d=m[c,d]==0?d:d.conj;d}:(c/=b&lt;3?(b=1+1i)**e:b**e/=2;[b]*e)};a[0]*=c;a}


Try it online!