What seems confusing to me about the 3d Conditional sentence is that the "interpretation" is the same sentence without the double use of "had":
If I had had that book, I would have given it to you.
If I had the book, I would have given it to you.
Whether the use of the double "had" with a non-action verb, which "have" is here, in a 3d Conditional sentence correct, is another question.
Nevertheless, here is an example of the use of the double "had" when "have" is an action verb:
He has already had a drink, so he can't drive her home. (That's why
she's going to order a taxi.)
If he hadn't had a drink, he could have driven her home. (That's why
she got home by taxi.)
Also, see here.