programming arduino without arduino libraries?

I have seen this info around but I can't find it (apologizes if it is somewhere obvious).

I would like to learn how to do digitalWrite, digitalRead, analogWrite, analogRead, and pinMode without using the arduino libraries that provide those functions. i.e. How do you program the atmega168 using gcc and no libraries?

Is there a tutorial on programming the atmega168 using C/gcc that is kind of a migration for users of arduino?

The whole point is to get deeper into programming uP and arduino has been a great introduction. I also want to write faster code and I read somewhere (wish I could find the post) that using digitalWrite/Read is a lot slower than doing it a more direct way.

I just happened to know what to search for in the libraries :)

http://www.arduino.cc/en/Reference/PortManipulation

There was a discussion in this thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1216659239

There are some macros for doing direct port io posted at the bottom of reply 7: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1216659239/7#7