I spent some time looking at the relevant algorithms and took a simple note.
The specific implementation method of the Euclidean algorithm is roughly as follows: