Whenever you're ready, walk me through how you'd approach this.
Explain the purpose of the volatile keyword in C. Provide a concrete scenario in embedded development where omitting it would cause a bug.
Address how volatile affects compiler-generated memory accesses, and distinguish it from atomicity, thread safety, and memory ordering. Keep the answer focused on standard C in bare-metal or microcontroller firmware.