Investors & landlords

My situation is a tab bit different. I had several RSU and ESPP lots. I got the 1099-DIV with the liquidation reported in it. A few weeks later I then sold all shares. So I got a 1099-B for the sales. I also got a statement with adjusted cost basis which mostly show losses since the sale happened after the initial liquidation distribution. How do I report this? Do I report the 1099-B normally and adjust the cost basis based on the statement I was given? And do I add a new "sale" for the distribution in the 1099-DIV? If so, how do I report the gain/loss? Would I need to know my cost basis for each of the ESPP/RSU lots?

 

In summary, do I report the gain/loss for the 1099-DIV liquidation by figuring out the original cost basis for each ESPP/RSU lot, or do I just set the cost basis to $0 and count it all as gain, or do I set the cost basis to the total distribution amount to count non of it as gains; and do I report the gain/loss for the 1099-B using adjusted cost basis provided on the supplemental statement I received?