To add one thing to rowlands57 excellent advice...dig out your insurance policy and read the fine print. It will say what the insurance company will pay, whether it is current retail market value or something else. Start with that. Using that, do your own research to find what that value will be in your region and the current used car market.
Don't be in a rush to sign anything. Is your wife or anyone else banged up? Don't sign off on their medical settlement, if any, until they're 100% recovered and some time has passed in case anything else comes up. Go ahead and sign for the car settlement when you feel the offer is fair. You can always buy a half-hour of an attorney's time to give you advice if you feel you need it. Be wary of getting the lawyer too deeply involved until you get a full idea of what they will cost you. The cost of the lawyer might be more than the value you receive.
If the insurance company doesn't total the car.......pick a great repair shop. Be very alert for hidden damage that isn't apparent at first to the shop guys. Again, don't be in a hurry to sign off on the job. Put some miles on the repaired car first. I know a fellow who was driving down a mountain road when a tree fell directly in front of his Subaru. Slam! He wanted Allstate to total that car. They insisted on repairs. After about the 3rd trip back to the shop to fix hidden items it was finally totalled, and at higher cost to the insurer than if they'd totaled it in the first place. He said that the airbag tasted horrible.
Each state law gives insurance companies the duty to determine when to total a vehicle. A percentage or range of percentages of the car's value is listed. For example state law might say that if the damage is estimated to be, say, 85% or more of the value, it must be totaled. This also relates to the car's title--the title will be listed as totaled after the insurance company's determination.