Hi Lilly,
well done on not having cancelled. Alone this part is so hard as your anxiety just keeps urging you not to go and it takes such a huge discipline and energy to go anyway. Really glad to hear you managed it and please, give yourself credit for it.
Sorry to read about the referral. My suspicion is that the teeth need to get out as soon as possible so that they decided to get them all out? Are you getting any form of sedation for that?
To your concerns about pain: as letsconnect suggests, there should be no pain for any treatment as dentists use local anesthetic to shut any pain off. Should you ever feel even a slightest pain you can ask your dentist to get more of it. In the past, treatment used to be painful but that's all history.
Taking out rotten teeth is actually much easier than taking out healthy teeth and if they are broken on the gumline they will get out even easier. Your dentist / surgeon will be able to tell you how much time he will need to take them out. Again, the most important thing to consider is that you won't feel any pain so the only annoying thing might be the noises and coping with your anxiety. This might be hard for you to imagine right now, but looking around here in the forum you will find a lot of success stories from people who have dealt with similar situation.
All the best wishes, keep us posted and again, please do not forget giving yourself a pat on the back. You are doing a very courageous thing right now.