The function had special handling for -1, but that is incompatible with functions whose entry point is not the first address. Use std::nullopt instead.