How could I deduce what this organic compound would be?


> 
> [![enter image description here](https://i.stack.imgur.com/5tncU.png)](https://i.stack.imgur.com/5tncU.png)
> 
> 
> 


For compound **D** (shown in the figure attached above), how can I deduce its structure?


I understand $\ce{CO2}$ has been produced and thus the compound will no longer have the $\ce{-COOH}$ group attached, but what I do not understand is why the double bond will get affected and why a nitrile will be produced? 


I am unaware of what type of reaction/decomposition this is for the compound in square brackets (image above) , but I think compound **D** is supposed to be deduced backwards from its reaction with $\ce{LiAlH4}$. So what I can deduce is that something with $\ce{-CN}$ group in an organic compound can react with $\ce{LiAlH4}$ to produce another type of compound **E** which would be an amine. On the basis of knowledge I would deduce that compound **E** would have to be a nitrile. 


Also in the image shown below, why is the latter isomer incorrect with that double bond left as it is from the original compounds shown in brackets in the image above?


[![enter image description here](https://i.stack.imgur.com/4ELeS.png)](https://i.stack.imgur.com/4ELeS.png)


