Linked List swapping first and last element

The goal of this manipulation is to swap the first and the last element of a linked list.

Storyboard

Scenarios

Unfold and Fold descriptions

Control flow sketch

---------------------
while(----------)
{
--------------------
--------------------
}

Synthesized Implementation