You can't apply Michigan laws in Illinois (or other states).
Your gun and ammo should have been in the trunk
where the cops would have needed either a warrant
OR your consent to look in the trunk. WHY did they
pull you over? I hope you didn't give them "consent"
to search your vehicle. WHERE was gun/ammo located?
In the back seat? In plain view? Good luck!
THIS ANSWER IS PURELY FOR ACADEMIC DISCUSSION ONLY AND DOES NOT CONSTITUTE ANY TYPE OF LEGAL ADVICE OR LEGAL REPRESENTATION.
You need an attorney licensed to practice in Illinois.
Based on your post I do not have all the facts necessary to give legal advice specific to your case. Do not rely on my answer for legal advice. I am only providing general information. For legal help consult with attorneys of your choosing. Other attorneys may come to different conclusions. I give legal advice only in the course of an attorney-client relationship. An attorney-client relationship can only be established by individual consultation and execution of a written agreement for legal services.
You should re-post your question for an Illinois criminal defense attorney. You have the option of using a court appointed attorney.