Mystery Procedure

 

What does this procedure do? Prove it.