This is a very custom item discount situation but here is a way you could do this.
On the top of your confirm page you will have add to cart server behaviors for each of your possible free items. For the trigger on these you will need to customize it to check for the presence of one of the triggering items in the cart. You would then have the regular add to cart stuff, for the quantity you would need to set this to the quantity of the triggering item.
To use the code to check if the item is in the cart you will need to know the ids for the triggering items. Here is the function that will check if the item is in the cart:
$eCart1->InCart(the item id)
When you set the quantity of the free item you will want to make it the same as the triggering item, here is the code to do this:
$ATC_itemQuantity = $eCart1->GetInfo(the item id, "Quantity");// column binding
This should get you the free items added to the cart with the quantity of the triggering item. Let us know if you have any further questions on this.