emit IR for while loop
check basic blocks' terminators properly
output debug information in stages