Inventory converted to persoanl use goes on line 36 of schedule c as a negative number.
Items donated to charity first are converted to personal use (see above); then you deduct them on schedule A as a charitable contribution.
You should put 0 at the ending inventory. That means anything discarded/destroyed is written of as "Cost of goods sold".