Hi there ~
It may be best to see a urologist
as soon as you can to have your questions answered regarding the testicular pain
, pain in the rectum
and upper thigh. A surgeon may be a good starting point if getting the appointment with a urologist is a problem. I hope you have had a testing for STDs and if they are negative, it should be a surgically treatable problem. I hope this helps.
Take care and have a nice day !