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 :)

There was a discussion in this thread:

There are some macros for doing direct port io posted at the bottom of reply 7: