It depends on who you know. Unfortunately, there isn't an algorithm for determining the unlock codes (like how some Nokia unlock codes were mathematically based on the IMEI). Motorola generates these codes randomly and stores them in a database. An moto employee can later search the database for an unlock code for a particular IMEI. Restated, unlock codes are stored in the databases with their corresponding IMEI's, but the unlock codes are not mathematically based on the IMEI's.
To add to the confusion, the Motorola database does not contain the unlock code lists for Cingy/AT&T motos (not sure why that is).
So, where you bought your phone dictates how you'd obtain your unlock code. When you purchase your unlock code online, you are paying someone who has inside access (probably an employee) to the Motorola (or Cingy/AT&T) database to lookup your code. Again, they aren't using software to generate a code.
With all that in mind, you can theoretically obtain your subsidy code if you know an AT&T employee that is willing to conduct a search for you for free.

Otherwise, you're gonna have to pay.
Other methods for unlocking are still not available (i.e. scrubbing the PDS with GOT MOTO). Sorry.
If you want to obtain your code legit from AT&T, you have three options (since I last chatted with them):
1) If your account is less than 90 days old, you can pay the difference from what you actually paid, and what an unlocked version from Moto costs. Upon receipt of your payment, you'll receive your code.
2) You can request that International Roaming be added to your account. There's no guarantees that they'll give you the code, but the International Account Specialist at AT&T mentioned that they do consider it.
3) If your account is older than 90 days, you should get you code for free with little to no problems.
P.S. It's not free, but you can usually get unlock codes for pretty cheap on ebay.
