Hi Abhinav,
I am sure this will shouldn't come under SAP SD or infact SAP itself. Its purely realted to company law. Not sure why this has been posted here.
Still i am trying to attempt to answer your question.
In your scenarios you didn't mention the relationship between A to C and D. Is Company A the subsidary of D?
If so, Since Company D has filed the IP, what is the legal and actual status of company A? If you say company A is still exist and doing their normal business, then most likely company A should be the responsible for this.
who is responsible for what is purely depends on terms and agreements between buyer and seller. Nothing to do with SAP.
Note: I know you have mentioned about the partner functions of A,B,C and D but not the legal relations.
Regards, Sai Krishna.