Reaction SMILES: C(O[CH:4](OCC)[CH2:5][N:6]([CH3:8])[CH3:7])C.Cl.[OH-].[K+].[Cl:15][C:16]1[CH:17]=[C:18]([NH:30][C:31]2[C:32]3[CH:40]=[C:39]([NH:41][C:42](=[O:52])[CH2:43]P(=O)(OCC)OCC)[N:38]=[CH:37][C:33]=3[N:34]=[CH:35][N:36]=2)[CH:19]=[CH:20][C:21]=1[O:22][CH2:23][C:24]1[CH:29]=[CH:28][CH:27]=[CH:26][N:25]=1.[Li+].[Cl-]>O.C(Cl)Cl.CO.CC(N(C)C)=O>[Cl:15][C:16]1[CH:17]=[C:18]([CH:19]=[CH:20][C:21]=1[O:22][CH2:23][C:24]1[CH:29]=[CH:28][CH:27]=[CH:26][N:25]=1)[NH:30][C:31]1[C:32]2[CH:40]=[C:39]([NH:41][C:42](=[O:52])/[CH:43]=[CH:4]/[CH2:5][N:6]([CH3:8])[CH3:7])[N:38]=[CH:37][C:33]=2[N:34]=[CH:35][N:36]=1
Reactant: CCOP(=O)(CC(=O)Nc1cc2c(Nc3ccc(OCc4ccccn4)c(Cl)c3)ncnc2cn1)OCC
Reactant: CCOC(CN(C)C)OCC
Agent: Cl
Agent: [Cl-]
Agent: [K+]
Solvent: O
Solvent: ClCCl
Solvent: CO
Product: CN(C)C/C=C/C(=O)Nc1cc2c(Nc3ccc(OCc4ccccn4)c(Cl)c3)ncnc2cn1
Temperature: 50 °C
Reaction time: 22 h
Yield: 83.4 %

Procedure:
To a stirred mixture of 2,2-diethoxy-N,N-dimethylethanamine (1.76 g, 11.0 mmol) and water (1.8 mL) at room temperature and under a nitrogen atmosphere was added an aq. 37% HCl (1.84 mL, 21.9 mmol). After addition the mixture was stirred at 50° C. (bath) for 22 h. It was cooled to 0° C. (bath). This is called solution A. KOH (3.14 g, 56.1 mmol) was dissolved in water (9 mL) at room temperature under a nitrogen atmosphere. It was cooled to 0° C. (bath). This is called solution B. To a stirred heterogeneous mixture of compound 230 (2.44 g, 4.38 mmol) and THE (9 mL) at room temperature and under a nitrogen atmosphere was added minimum amount of DMA (6 mL) to give a homogeneous solution. LiCl (186 mg, 4.38 mmol) was added and stirred at 0° C. (bath) for 15 min. The cold solution B was added and stirred at 0° C. for 2 min. Then the cold solution A was added and the final reaction mixture was continued to stir at 0° C. under a nitrogen atmosphere. The reaction was monitored by TLC (DCM-MeOH=10:1). After stirred for 30 min. it was poured into water (300 mL). Petroleum ether (400 mL) was added and stirred at room temperature for 15 min. Petroleum ether layer was decanted. More petroleum ether (300 mL) was added and stirred for 15 min. The solid was collected by suction filtration; washed with water (4×30 mL); dried under reduced pressure over silica gel/KOH to give compound 3 (1.79 g, 83%) which was found only 87% pure by HPLC. Thus, the sample was stirred with warm MeOH (200 mL) for 30 min and cooled to room temperature. The insoluble materials were filtered off and to the filtrates was added one volume of water to precipitate out the required product. The solid was collected, washed with water/MeOH=1:1 several times and dried to give (2E)-N-{4-[3-chloro-4-(2-pyridinylmethoxy)anilino]pyrido[3,4-d]pyrimidin-6-yl}-4-(dimethylamino)-2-butenamide (3) (1.54 g, 72%) as a pale yellow solid, mp 196-199; HPLC: 94.6% pure; 1H NMR δ [(CD3)2SO] 10.88 (s, 1H), 10.19 (s, 1H), 8.99 (s, m), 8.64-8.55 (m, 2H), 8.00 (d, J=2.5 Hz, 1H), 7.88 (td, J=7.7, 1.8 Hz, 1H), 7.73 (br dd, J=8.9, 2.5 Hz, 1H), 7.59 (br d, J=7.8 Hz, 1H), 7.41-7.34 (m, 1H), 7.28 (d, J=9.0 Hz, 1H), 6.87 (dt, J=15.4, 6.1 Hz, 1H), 6.51 (br d, J=15.4 Hz, 1H), 5.30 (s, 2 H), 3.09 (dd, J=6.1, 1.2 Hz, 2H), 2.19 (s, 6H). Anal. Calcd for C25H24ClN7O2.1.5H2O: C, 58.08; H, 5.26; N, 18.97%. Found C, 58.17; H, 5.36; N, 19.00%.