ruiu added a comment. It's not very clear to me if what this patch does is correct, even though I clearly understand each line of code. Can you write a function comment instead of writing a comment for each line? https://reviews.llvm.org/D35792