Based on what we have learned in the previous halachah (according to the Mishnah Berurah), in the Rashba’s opinion, even a person who did not sleep at night must wash his hands with a berachah in order to sanctify himself so that he may thank Hashem for a new day. In the Rosh’s opinion, however, because he did not sleep, there is no concern that he unintentionally touched the parts of his body that are normally covered and therefore it is unnecessary to wash his hands before praying.
Hence, the Shulchan Aruch rules (4:13) that a person who remains awake all night must wash his hands without a berachah. He must wash his hands, according to the opinion of the Rashba, however he does not make a blessing on that washing, so as not to recite a berachah in vain, consistent with the opinion of the Rosh.
The Mishnah Berurah writes (4:30) that a person who did not sleep all night should relieve himself before Shacharit. After his hands touch the parts of his body that are normally covered, then even according to the Rosh, he must wash his hands with a berachah. He can therefore wash his hands with a berachah according to all opinions. This is the Ashkenazic custom for those who stay awake all night on Shavuot.
The minhag of the Sephardim is that before praying, even a person who touched the normally covered parts of his body washes his hands without a berachah. This is because we take into consideration the opinion stating that the Chachamim instituted washing with a berachah only for a person who slept at night. But a person who dirtied his hands and did not sleep is the same as one whose hands were dirty before Minchah and Ma’ariv – he washes his hands without a berachah. The sole advice for someone who was awake all night and wants to fulfill the obligation according to all opinions is to hear the berachah recited by another person and have in mind to fulfill his obligation by hearing it (Kaf HaChaim 4:49). (See further in this book 8:5; 9:5-6, for the law regarding someone who remains awake all night, or who wakes up in the middle of the night, concerning the recital of Birkot HaShachar and Al netilat yadayim.)