What should I do?

I considered a girl to be my friend but today she turned against me for a guy. She has a crush on a guy who I really hate and I was talking to my friend and the girl was trying to listen and the boy said: ignore her she's stupid

And the girl was like: yeah she is

I was really mad so I said: did you just call me stupid?

She said: yeah I did

So I said: yeah if I'm stupid then what are you?

She said: not stupid

My friends were quick to defend me. One said: she came 1st in the entire school for OC, how could you call her stupid? Let's see what you get for Selective!

And the other said: you're stupid you can't even do division yet.

But she's being really rude so what should I do?