Arduino IDE's -- 'C' code generation and intermediate files

This article was helpful when I had the same question:

http://arduino.cc/en/Hacking/BuildProcess

The short of it being, the IDE tidies up the sketch by merging all tabs into one file, adding prototypes, including library files in the build, and so on. But that's about it. Most of the "magic" is actually just C++ wrappers to add friendly functions and defines so you don't have to know so much about the hardware registers.

Moving to AVR C is fairly easy to do with Atmel Studio. You can even import the Arduino libs and write your programs in a "real" C++ IDE. That's actually a good way to go, because IMO, the Arduino IDE is really a horrible code editor, but the platform is so handy. :stuck_out_tongue: