Catalyzes the hydrolysis of 4-amino-2-methyl-5-hydroxymethylpyrimidine pyrophosphate (HMP-PP) to 4-amino-2-methyl-5-hydroxymethylpyrimidine phosphate (HMP-P). Can also hydrolyze other substrates such as MeO-HMP-PP and 4-amino-2-trifluoromethyl 5-hydroxymethylpyrimidine pyrophosphate (CF3-HMP-PP) to give MeO-HMP-P and 4-amino-2-trifluoromethyl-5-hydroxymethylpyrimidine phosphate. This hydrolysis generates resistance to the antibiotics (bacimethrin, CF3-HMP) by reducing the formation of their toxic forms, 2'-methoxythiamin pyrophosphate (MeO-TPP) and CF3-HMP-PP. Also hydrolyzes pyridoxal-phosphate (PLP) and flavin mononucleotide (FMN), and purines (GMP and IMP) as secondary substrates. 4-amino-2-methyl-5-(diphosphooxymethyl)pyrimidine + H2O = 4-amino-2-methyl-5-(phosphooxymethyl)pyrimidine + H(+) + phosphate Magnesium. Can also use other divalent metal cations as manganese, cobalt or zinc. Optimum pH is between 6 and 7.5. Belongs to the HAD-like hydrolase superfamily. Cof family. Extended N-terminus. Extended N-terminus.