Huge company in my town and they do fairly well, so the whole thing left me feeling awful for about a month afterward, particularly the jab at my technical skills. Didn't mean to vent like this but I figure if anyone would understand it's people on HN. There is a happy ending: I got a new role a little while later and found multiple coworkers who also interviewed there with similar stories. So it wasn't just me.
I agree with the other folks that indicated you dodged a bullet.
Also: I'm sorry that there are folks in our industry that would submit you to such inhumane conditions. I'm also glad you stuck around in spite of this shiz.
You can leave an interview at any time if you're not feeling it. You're not obligated to stick it out. I've bailed on interviews before. It sounds like you really wanted this job, though, so I understand wanting to see it through.
That's why I always ask candidates how they feel it's going so far when I begin an interview. Any issues on our end? You should be checking in with yourself at least between every interview to gauge how you feel. The vast majority of interviewers are shitty, so if you're not feeling great it's probably more on them than you.