fn cmp_zorder(a, b): let mut j = 0; let mut x = 0; for k in 0..dim { let y = a[k] ^ b[k] if less_msb(x, y) { j = k x = y } } a[j] - b[j] } fn less_msb(x, y) { x < y && x < (x ^ y) }