A process for preparing a dihydropyrimidine compound having Formula, or a tautomer thereof having Formula (Ia), wherein each R 1 and R 2 is independently F, Cl, or Br; R 3 is C 1-4 alkyl; Z is -O-, -S-, -S(=O) t -, or -N(R 4)-; Y is -O-, -S-, -S(=O) t -, -(CH 2) q -, or -N(R 5)-; each t and q is independently 0, 1, or 2; each of R 4 and R 5 is independently H or C 1-4 alkyl; each R 6 is independently H, deuterium, halo, C 1-4 alkyl, C 1-4 haloalkyl, amino, C 1-4 alkylamino, C 1-4 alkoxy, nitro, triazolyl, tetrazyl, -(CR 7 R 7a) m -OH, -S(=O) q OR 8a, -(CR 7 R 7a) m -S(=O) q N(R 8a) 2, -(CR 7 R 7a) l -N(R 8a) 2, -(CR 7 R 7a) m -C(=O)O-R 8, -(CR 7 R 7a) m -C(=O)O-(CR 7 R 7a) m -OC(=O)O-R 8, -(CR 7 R 7a) m -C(=O)O-(CR 7 R 7a) m -OC(=O)-R 8, -(CR 7 R 7a) m -C(=O)O-(CR 7 R 7a) m -C(=O)O-R 8, -(CR 7 R 7a) m -OC(=O)-R 8, or -(CR 7 R 7a) m -C(=O)-N(R 8 R 8a); each R 7a and R 7 is independently H, halo, C 1-4 alkyl, C 1-4 haloalkyl, -(CH 2) m -OH, or -(CH 2) m -C(=O)O-R 8; or R 7a and R 7, together with the carbon atom to which they are attached, form a C 3-6 cycloalkyl group, C 2-9 heterocyclyl goup, or -(C=O)-; each R 8 and R 8a is independently H, C 1-4 alkyl, amino-C 1-4 -alkyl, C 1-4 alkoxy, C 1-6 alkyl-S(=O) q -, C 6-10 aryl, C 1-9 heteroaryl, C 3-6 cycloalkyl, C 2-9 heterocyclyl, C 6-10 aryl-C 1-6 -alkyl, C 1-9 heteroaryl-C 1-6 -alkyl, C 3-6 cycloalkyl-C 1-4 -alkyl, C 2-9 heterocyclyl-C 1-6 -alkyl, C 2-9 heterocyclyl-S(=O) q -, C 1-9 heteroaryl-S(=O) q -, C 3-6 cycloalkyl-S(=O) q -, C 6-10 aryl-S(=O) q -, -(CH 2) m -OH, -(CH 2) m -C(=O)O-(CH 2) m -H, or -(CH 2) m -OC(=O)-(CH 2) m -H; each R 9 is independently H, halo, C 1-4 alkyl, C 1-4 haloalkyl, C 1-4 alkylthio, C 3-6 cycloalkyl, -(CR 7 R 7a) m -C(=O)-N(R 8 R 8a), or -(CR 7 R 7a) m -C(=O)O-R 8; R 10 is H or deuterium; n is 0, 1, 2, 3, 4, or 5; each m is independently 0, 1, 2, 3, or 4; f is 1, 2, 3, or 4; and j is 0, 1, or 2; wherein the process comprises the steps of: step: reacting an amidine compound of Formula, or a salt thereof with an aldehyde compound of Formula and a compound of Formula (IVa) to obtain a compound of Formula (Va), wherein the step further comprises a step of cooling the resulting compound of Formula (Va) of step to obtain a solid compound of Formula (Va) at a cooling temperature from -40 °C to 40 °C, wherein R 3b is ethoxy; and R 3a is H; step: halogenating the compound of Formula (Va) to form a halide; and then reacting the halide with a compound of Formula, or a salt thereof to obtain a compound of Formula (VIIa), and step: forming the compound of Formula or Formula (Ia) from the compound of Formula (VIIa) by means of a transesterification. wherein each R 1 and R 2 is independently F, Cl, or Br; R 3 is C 1-4 alkyl; Z is -O-, -S-, -S(=O) t -, or -N(R 4)-; Y is -O-, -S-, -S(=O) t -, -(CH 2) q -, or -N(R 5)-; each t and q is independently 0, 1, or 2; each of R 4 and R 5 is independently H or C 1-4 alkyl; each R 6 is independently H, deuterium, halo, C 1-4 alkyl, C 1-4 haloalkyl, amino, C 1-4 alkylamino, C 1-4 alkoxy, nitro, triazolyl, tetrazyl, -(CR 7 R 7a) m -OH, -S(=O) q OR 8a, -(CR 7 R 7a) m -S(=O) q N(R 8a) 2, -(CR 7 R 7a) l -N(R 8a) 2, -(CR 7 R 7a) m -C(=O)O-R 8, -(CR 7 R 7a) m -C(=O)O-(CR 7 R 7a) m -OC(=O)O-R 8, -(CR 7 R 7a) m -C(=O)O-(CR 7 R 7a) m -OC(=O)-R 8, -(CR 7 R 7a) m -C(=O)O-(CR 7 R 7a) m -C(=O)O-R 8, -(CR 7 R 7a) m -OC(=O)-R 8, or -(CR 7 R 7a) m -C(=O)-N(R 8 R 8a); each R 7a and R 7 is independently H, halo, C 1-4 alkyl, C 1-4 haloalkyl, -(CH 2) m -OH, or -(CH 2) m -C(=O)O-R 8; or R 7a and R 7, together with the carbon atom to which they are attached, form a C 3-6 cycloalkyl group, C 2-9 heterocyclyl goup, or -(C=O)-; each R 8 and R 8a is independently H, C 1-4 alkyl, amino-C 1-4 -alkyl, C 1-4 alkoxy, C 1-6 alkyl-S(=O) q -, C 6-10 aryl, C 1-9 heteroaryl, C 3-6 cycloalkyl, C 2-9 heterocyclyl, C 6-10 aryl-C 1-6 -alkyl, C 1-9 heteroaryl-C 1-6 -alkyl, C 3-6 cycloalkyl-C 1-4 -alkyl, C 2-9 heterocyclyl-C 1-6 -alkyl, C 2-9 heterocyclyl-S(=O) q -, C 1-9 heteroaryl-S(=O) q -, C 3-6 cycloalkyl-S(=O) q -, C 6-10 aryl-S(=O) q -, -(CH 2) m -OH, -(CH 2) m -C(=O)O-(CH 2) m -H, or -(CH 2) m -OC(=O)-(CH 2) m -H; each R 9 is independently H, halo, C 1-4 alkyl, C 1-4 haloalkyl, C 1-4 alkylthio, C 3-6 cycloalkyl, -(CR 7 R 7a) m -C(=O)-N(R 8 R 8a), or -(CR 7 R 7a) m -C(=O)O-R 8; R 10 is H or deuterium; n is 0, 1, 2, 3, 4, or 5; each m is independently 0, 1, 2, 3, or 4; f is 1, 2, 3, or 4; and j is 0, 1, or 2; step: reacting an amidine compound of Formula, or a salt thereof with an aldehyde compound of Formula and a compound of Formula (IVa) to obtain a compound of Formula (Va), wherein the step further comprises a step of cooling the resulting compound of Formula (Va) of step to obtain a solid compound of Formula (Va) at a cooling temperature from -40 °C to 40 °C, wherein R 3b is ethoxy; and R 3a is H; wherein R 3b is ethoxy; and R 3a is H; step: halogenating the compound of Formula (Va) to form a halide; and then reacting the halide with a compound of Formula, or a salt thereof to obtain a compound of Formula (VIIa), and step: forming the compound of Formula or Formula (Ia) from the compound of Formula (VIIa) by means of a transesterification.