Well, seems like most of the answers here are repeating pretty much the same mantra of this CTO being a douchebag and the champion founder being obviously correct. Please allow me to offer an alternative viewpoint.
I've seen some founders, especially of the technical variety, who manage to get a business running and then attribute all of that to their personal brilliance, and that they therefore deserve all the power in the company. This means that they will be extremely toxic personalities for everyone else, which in turn can easily stunt a company.
I don't know if this is the case here, since we only hear this from your perspective... but it may be that it's not your coding skill actually that is in question, but your interpersonal skills and attitude.
I've seen some founders, especially of the technical variety, who manage to get a business running and then attribute all of that to their personal brilliance, and that they therefore deserve all the power in the company. This means that they will be extremely toxic personalities for everyone else, which in turn can easily stunt a company.
I don't know if this is the case here, since we only hear this from your perspective... but it may be that it's not your coding skill actually that is in question, but your interpersonal skills and attitude.