Mechanisms you can find in any university organic textbooks.
1 - (amine) alkylation
2 - nitration (I think much better is nitrosylation in this cazse (introducing NO with HNO2), next step reduction, acylation od amine, reductive cyclization (reduction+cyclization), (heterocyclic amine) alkylation
3 - benzylation with C6H5CH2Cl, OH to Cl exchange with PCl5 (POCl3, PCl3), Alkylation (cyclization), alkoholysis of nitrile(esterification), (amine) alkylation