Answer: B
The first round gives N,N-dimethylpent-4-en-1-amine by ring-opening Hofmann elimination (the ring N-C bond breaks, the C=C forms at the terminal position). The second round forms the quaternary ammonium salt, and elimination again removes the most accessible beta-hydrogen, giving CHX2=CH−CHX2−CH=CHX2 (penta-1,4-diene) and N(CHX3)X3.