Improve PT analysis, add debugging options

Signed-off-by: Andrey Danin <danindrey@mail.ru>