call swap (ia, ib+5)
The first parameter is passed by reference. For the second parameter, ib isn't passed by reference; rather a temporary memory cell is passed, whose value if 8+5=13. Let's name it p.
p swaps with a, hence a gets the value 13; p gets the value 3. We'll never refer to p again now.
print *, ia, ib
This would print 13, 8 because ib was never passed by reference, its value stays intact.
$S_1$ and $S_4$ are correct
Line 1 and Line 2 won't generate a runtime error, as ints are being assigned to ints. So, $S_2$ and $S_3$ are incorrect.
And since $S_4$ is correct, $S_5$ is incorrect.