; MIT License
; Copyright (C) 2022 Shintaro Mukai.
; https://mukai.systems/articles/h7e86oucj0jv25molxsx3odyyxcns1tk/

; greatest common divisor.

(function gcd (n m)
  (loop
    (if (= n m) (return n)
        (> n m) (<- n (- n m))
        (<- m (- m n)))))

(function! main (args)
  (let ((x y) args)
    (write (gcd (int x) (int y)))))
