fix register tracking with nested ifs