In the first example, cashing a check on your account, the bank would check the deposit/withdrawal box (Item 34) because it is your account.
In the second, the bank would not check that box. You are not making a withdrawal from your friend's account, you are simply cashing a check.
In both cases, you would check the box that indicates you are cashing a negotiable instrument (Item 32) and include the account number.
That's based in large part on 1995 guidance published by Treasury on CTR completion. However, it has been modified slightly based on repeated, consistent comments I've heard from FinCEN personnel that they want the negotiable instrument box checked even when a customer is withdrawing money from her own account if there is a check involved.
They want to know they are looking for a check.
The guidance:
24. Question: When an individual presents an on-us check drawn on an account of someone other than the presenter's account, which box should a reporting bank check? When an individual presents an on-us check drawn on the account of the presenter to withdraw funds from his/her own account, which box should be checked?
Answer: When an individual presents an on-us check drawn on an account of someone other than the presenter's account, the bank should check box 32 (Negotiable Instruments(s) Cashed). When an individual presents an on-us check drawn on the account of the presenter to withdraw funds from his/her own account, box 32 could be checked or box 34 (Deposit(s)/Withdrawal(s) may bec (sic) checked to indicate that the transaction is a withdrawal. In any case, list account numbers in Item 35 (Account Number(s) Affected).
_________________________
In this world you must be oh so smart or oh so pleasant. Well, for years I was smart. I recommend pleasant.