Perturbative diagonalization for Maryland-type quasiperiodic operators with flat pieces