refactor libpatch_define_orig