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VidWcsDQogKiAgICAgICAgICAgICAgezB4NTQsMHgwMn0gOiBmYWN0b3J5LA0KICogICAgICAgICAgICAgIHsweDU0LDB4NER9IDogYW10LA0KICogQHJldHVybiAwILPJuaYgIA0KICogQHJldHVybiAtMSDKp7DcDQogKiBAbm90ZSAgIA0KICogQHdhcm5pbmcgDQogKi8NCnVuc2lnbmVkIGludCBhbXRfc2V0X2Jvb3Rtb2RlKHVuc2lnbmVkIGNoYXIgIGJvb3Rtb2RlW10pOw0KDQovKioNCiAqIEBicmllZiDJ6NbDteez2LzssuKx6ta+zrsNCiAqIEBwYXJhbSBiYXRkZXRfdmFsdWUgteez2LzssuKx6ta+DQogKiAgICAgICAgICAgICAwIDogv6q7+rK7vOyy4rXns9gsDQogKiAgICAgICAgICAgICAxIDogv6q7+rzssuK157PYDQogKiBAcmV0dXJuIDAgs8m5piAgDQogKiBAcmV0dXJuIC0xIMqnsNwNCiAqIEBub3RlICAgDQogKiBAd2FybmluZyANCiAqLw0KdW5zaWduZWQgaW50IGFtdF9zZXRfYmF0ZGV0X2ZsYWcoaW50IGJhdGRldF92YWx1ZSk7DQoNCi8qKg0KICogQGJyaWVmILbBteez2LzssuKx6ta+zrsNCiAqIEBwYXJhbSBwYmF0ZGV0X3ZhbHVlILbBs/a1xLXns9i87LLiserWvg0KICogQHJldHVybiAwILPJuaYgIA0KICogQHJldHVybiAtMSDKp7DcDQogKiBAbm90ZSAgIA0KICogQHdhcm5pbmcgDQogKi8NCnVuc2lnbmVkIGludCBhbXRfZ2V0X2JhdGRldF9mbGFnKGludCAqcGJhdGRldF92YWx1ZSk7DQoNCi8qKg0KICogQGJyaWVmIMno1sNhbXTEo8q9z8K94s72QVTD/MHuserWvg0KICogQHBhcmFtIGJvb3Rtb2RlIDK49tfWvdq1xLHqyrY6IA0KICogICAgICAgICAgICAgIHsweDQxLDB4NTR9IDogYW10xKPKvc/CveLO9kFUw/zB7g0KICogQHJldHVybiAwILPJuaYgIA0KICogQHJldHVybiAtMSDKp7DcDQogKiBAbm90ZSAgIA0KICogQHdhcm5pbmcgDQogKi8NCnVuc2lnbmVkIGludCBhbXRfc2V0X2FtdF9hdG1vZGUodW5zaWduZWQgY2hhciAgYm9vdG1vZGVbXSx1bnNpZ25lZCBjaGFyICBhdG1vZGVbXSk7DQp1bnNpZ25lZCBpbnQgaXNfYW10X2F0bW9kZSgpOw0KDQoNCg0KDQoNCiNlbmRpZiAvLyBfX0FNVE5WX0gNCg==