Two-loop diagrams in Yang-Mills theory