```
int gcd(int x, int y) {
    int t;
    while (y) {
        t = x;
        x = y;
        y = t % y;
    }
    return x;
}

```

Does it stop when y = 0? I thought the loop stops when y isn't defined.