Refactorized dead code elimination:
- Use library to get noreturn functions
- Fixed do-while simplification (#4940)