mm/z3fold.c: limit first_num to the actual range of possible buddy indexes