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ZXZpY2UgKmFwc2g0YTNhX2RldmljZXNbXSBfX2luaXRkYXRhID0geworCSZub3JfZmxhc2hfZGV2aWNlLAorCSZzbXNjOTExeF9kZXZpY2UsCit9OworCitzdGF0aWMgaW50IF9faW5pdCBhcHNoNGEzYV9kZXZpY2VzX3NldHVwKHZvaWQpCit7CisJcmV0dXJuIHBsYXRmb3JtX2FkZF9kZXZpY2VzKGFwc2g0YTNhX2RldmljZXMsCisJCQkJICAgIEFSUkFZX1NJWkUoYXBzaDRhM2FfZGV2aWNlcykpOworfQorZGV2aWNlX2luaXRjYWxsKGFwc2g0YTNhX2RldmljZXNfc2V0dXApOworCitzdGF0aWMgaW50IGFwc2g0YTNhX2Nsa19pbml0KHZvaWQpCit7CisJc3RydWN0IGNsayAqY2xrOworCWludCByZXQ7CisKKwljbGsgPSBjbGtfZ2V0KE5VTEwsICJleHRhbCIpOworCWlmICghY2xrIHx8IElTX0VSUihjbGspKQorCQlyZXR1cm4gUFRSX0VSUihjbGspOworCXJldCA9IGNsa19zZXRfcmF0ZShjbGssIDMzMzMzMDAwKTsKKwljbGtfcHV0KGNsayk7CisKKwlyZXR1cm4gcmV0OworfQorCisvKiBJbml0aWFsaXplIHRoZSBib2FyZCAqLworc3RhdGljIHZvaWQgX19pbml0IGFwc2g0YTNhX3NldHVwKGNoYXIgKipjbWRsaW5lX3ApCit7CisJcHJpbnRrKEtFUk5fSU5GTyAiQWxwaGEgUHJvamVjdCBBUC1TSDRBLTNBIHN1cHBvcnQ6XG4iKTsKK30KKworc3RhdGljIHZvaWQgX19pbml0IGFwc2g0YTNhX2luaXRfaXJxKHZvaWQpCit7CisJcGxhdF9pcnFfc2V0dXBfcGlucyhJUlFfTU9ERV9JUlE3NjU0KTsKK30KKworLyogUmV0dXJuIHRoZSBib2FyZCBzcGVjaWZpYyBib290IG1vZGUgcGluIGNvbmZpZ3VyYXRpb24gKi8KK3N0YXRpYyBpbnQgYXBzaDRhM2FfbW9kZV9waW5zKHZvaWQpCit7Cis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hFTl9CVVNfSURfU0laRV0sIGNvbnN0IGNoYXIgKm5vZGVuYW1lKQoreworCW5vZGVuYW1lID0gc3RyY2hyKG5vZGVuYW1lLCAnLycpOworCWlmICghbm9kZW5hbWUgfHwgc3RybGVuKG5vZGVuYW1lICsgMSkgPj0gWEVOX0JVU19JRF9TSVpFKSB7CisJCXByaW50ayhLRVJOX1dBUk5JTkcgIlhFTkJVUzogYmFkIGZyb250ZW5kICVzXG4iLCBub2RlbmFtZSk7CisJCXJldHVybiAtRUlOVkFMOworCX0KKworCXN0cmxjcHkoYnVzX2lkLCBub2RlbmFtZSArIDEsIFhFTl9CVVNfSURfU0laRSk7CisJaWYgKCFzdHJjaHIoYnVzX2lkLCAnLycpKSB7CisJCXByaW50ayhLRVJOX1dBUk5JTkcgIlhFTkJVUzogYnVzX2lkICVzIG5vIHNsYXNoXG4iLCBidXNfaWQpOworCQlyZXR1cm4gLUVJTlZBTDsKKwl9CisJKnN0cmNocihidXNfaWQsICcvJykgPSAnLSc7CisJcmV0dXJuIDA7Cit9CisKKy8qIGRldmljZS88dHlwZW5hbWU+LzxuYW1lPiAqLworc3RhdGljIGludCB4ZW5idXNfcHJvYmVfZnJvbnRlbmQoc3RydWN0IHhlbl9idXNfdHlwZSAqYnVzLCBjb25zdCBjaGFyICp0eXBlLAorCQkJCSBjb25zdCBjaGFyICpuYW1lKQoreworCWNoYXIgKm5vZGVuYW1lOworCWludCBlcnI7CisKKwlub2RlbmFtZSA9IGthc3ByaW50ZihHRlBfS0VSTkVMLCAiJXMvJXMvJXMiLCBidXMtPnJvb3QsIHR5cGUsIG5hbWUpOworCWlmICghbm9kZW5hbWUpCisJCXJldHVybiAtRU5PTUVNOworCisJRFBSSU5USygiJXMiLCBub2RlbmFtZSk7CisKKwllcnIgPSB4ZW5idXNfcHJvYmVfbm9kZShidXMsIHR5cGUsIG5vZGVuYW1lKTsKKwlrZnJlZShub2RlbmFtZSk7CisJcmV0dXJuIGVycjsKK30KKworc3RhdGljIGludC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KTsKKwl9CisKKwljbG9zZShmZCk7CisJcmV0dXJuIG1zcjsKK30KKwordm9pZCBwcmludF9oZWFkZXIoKQoreworCWlmIChzaG93X3BrZykKKwkJZnByaW50ZihzdGRlcnIsICJwa2cgIik7CisJaWYgKHNob3dfY29yZSkKKwkJZnByaW50ZihzdGRlcnIsICJjb3JlIik7CisJaWYgKHNob3dfY3B1KQorCQlmcHJpbnRmKHN0ZGVyciwgIiBDUFUiKTsKKwlpZiAoZG9fbmhtX2NzdGF0ZXMpCisJCWZwcmludGYoc3RkZXJyLCAiICAgJSVjMCAiKTsKKwlpZiAoaGFzX2FwZXJmKQorCQlmcHJpbnRmKHN0ZGVyciwgIiAgR0h6Iik7CisJZnByaW50ZihzdGRlcnIsICIgIFRTQyIpOworCWlmIChkb19uaG1fY3N0YXRlcykKKwkJZnByaW50ZihzdGRlcnIsICIgICAlJWMxICIpOworCWlmIChkb19uaG1fY3N0YXRlcykKKwkJZnByaW50ZihzdGRlcnIsICIgICAlJWMzICIpOworCWlmIChkb19uaG1fY3N0YXRlcykKKwkJZnByaW50ZihzdGRlcnIsICIgICAlJWM2ICIpOworCWlmIChkb19zbmJfY3N0YXRlcykKKwkJZnByaW50ZihzdGRlcnIsICIgICAlJWM3ICIpOworCWlmIChkb19zbmJfY3N0YXRlcykKKwkJZnByaW50ZihzdGRlcnIsICIgICUlcGMyICIpOworCWlmIChkb19uaG1fY3N0YXRlcykKKwkJZnByaW50ZihzdGRlcnIsICIgICUlcGMzICIpOworCWlmIChkb19uaG1fY3N0YXRlcykKKwkJZnByaW50ZihzdGRlcnIsICIgICUlcGM2ICIpOworCWlmIChkb19zbmJfY3N0YXRlcykKKwkJZnByaW50ZihzdGRlcnIsICIgICUlcGM3ICIpOworCWlmIChleHRyYV9tc3Jfb2Zmc2V0KQorCQlmcHJpbnRmKHN0ZGVyciwgIiAgICAgICBNU1IgMHgleCAiLCBleHRyYV9tc3Jfb2Zmc2V0KTsKKworCXB1dGMoJ1xuJywgc3Rk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ZXJzKGludCBwa2csIGludCBjb3JlLCBpbnQgY3B1KQoreworCVBDQyAqbmV3OworCisJaWYgKHZlcmJvc2UgPiAxKQorCQlwcmludGYoInBrZyVkIGNvcmUlZCwgY3B1JWRcbiIsIHBrZywgY29yZSwgY3B1KTsKKworCW5ldyA9IChQQ0MgKiljYWxsb2MoMSwgc2l6ZW9mKFBDQykpOworCWlmIChuZXcgPT0gTlVMTCkgeworCQlwZXJyb3IoImNhbGxvYyIpOworCQlleGl0KDEpOworCX0KKwluZXctPnBrZyA9IHBrZzsKKwluZXctPmNvcmUgPSBjb3JlOworCW5ldy0+Y3B1ID0gY3B1OworCWluc2VydF9jcHVfY291bnRlcnMoJnBjY19vZGQsIG5ldyk7CisKKwluZXcgPSAoUENDICopY2FsbG9jKDEsIHNpemVvZihQQ0MpKTsKKwlpZiAobmV3ID09IE5VTEwpIHsKKwkJcGVycm9yKCJjYWxsb2MiKTsKKwkJZXhpdCgxKTsKKwl9CisJbmV3LT5wa2cgPSBwa2c7CisJbmV3LT5jb3JlID0gY29yZTsKKwluZXctPmNwdSA9IGNwdTsKKwlpbnNlcnRfY3B1X2NvdW50ZXJzKCZwY2NfZXZlbiwgbmV3KTsKKworCW5ldyA9IChQQ0MgKiljYWxsb2MoMSwgc2l6ZW9mKFBDQykpOworCWlmIChuZXcgPT0gTlVMTCkgeworCQlwZXJyb3IoImNhbGxvYyIpOworCQlleGl0KDEpOworCX0KKwluZXctPnBrZyA9IHBrZzsKKwluZXctPmNvcmUgPSBjb3JlOworCW5ldy0+Y3B1ID0gY3B1OworCWluc2VydF9jcHVfY291bnRlcnMoJnBjY19kZWx0YSwgbmV3KTsKKworCW5ldyA9IChQQ0MgKiljYWxsb2MoMSwgc2l6ZW9mKFBDQykpOworCWlmIChuZXcgPT0gTlVMTCkgeworCQlwZXJyb3IoImNhbGxvYyIpOworCQlleGl0KDEpOworCX0KKwluZXctPnBrZyA9IHBrZzsKKwluZXctPmNvcmUgPSBjb3JlOworCW5ldy0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T1QifQkJPSAic3NoIFwkU1NIX1VTRVJcQFwkTUFDSElORSByZWJvb3QiOworJGRlZmF1bHR7IlNUT1BfQUZURVJfU1VDQ0VTUyJ9CT0gMTA7CiskZGVmYXVsdHsiU1RPUF9BRlRFUl9GQUlMVVJFIn0JPSA2MDsKKyRkZWZhdWx0eyJMT0NBTFZFUlNJT04ifQk9ICItdGVzdCI7CisKK215ICRrdGVzdF9jb25maWc7CitteSAkdmVyc2lvbjsKK215ICRtYWNoaW5lOworbXkgJHNzaF91c2VyOworbXkgJHRtcGRpcjsKK215ICRidWlsZGRpcjsKK215ICRvdXRwdXRkaXI7CitteSAkb3V0cHV0X2NvbmZpZzsKK215ICR0ZXN0X3R5cGU7CitteSAkYnVpbGRfdHlwZTsKK215ICRidWlsZF9vcHRpb25zOworbXkgJHJlYm9vdF90eXBlOworbXkgJHJlYm9vdF9zY3JpcHQ7CitteSAkcG93ZXJfY3ljbGU7CitteSAkcmVib290OworbXkgJHJlYm9vdF9vbl9lcnJvcjsKK215ICRwb3dlcm9mZl9vbl9lcnJvcjsKK215ICRkaWVfb25fZmFpbHVyZTsKK215ICRwb3dlcmN5Y2xlX2FmdGVyX3JlYm9vdDsKK215ICRwb3dlcm9mZl9hZnRlcl9oYWx0OworbXkgJHNzaF9leGVjOworbXkgJHNjcF90b190YXJnZXQ7CitteSAkcG93ZXJfb2ZmOworbXkgJGdydWJfbWVudTsKK215ICRncnViX251bWJlcjsKK215ICR0YXJnZXQ7CitteSAkbWFrZTsKK215ICRwb3N0X2luc3RhbGw7CitteSAkbm9jbGVhbjsKK215ICRtaW5jb25maWc7CitteSAkYWRkY29uZmlnOworbXkgJGluX2Jpc2VjdCA9IDA7CitteSAkYmlzZWN0X2JhZCA9ICIiOworbXkgJHJldmVyc2VfYmlzZWN0OworbXkgJGluX3BhdGNoY2hlY2sgPSAwOworbXkgJHJ1bl90ZXN0OworbXkgJHJlZGlyZWN0OworbXkgJGJ1aWxkbG9nOworbXkgJGRtZXNnOworb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iBzLC4qLyguKiksJDEsOworCisgICAgbXkgJHRlc3RfbnVtID0gMDsKKyAgICBteSAkZGVmYXVsdCA9IDE7CisgICAgbXkgJHJlcGVhdCA9IDE7CisgICAgbXkgJG51bV90ZXN0c19zZXQgPSAwOworICAgIG15ICRza2lwID0gMDsKKyAgICBteSAkcmVzdDsKKworICAgIHdoaWxlICg8SU4+KSB7CisKKwkjIGlnbm9yZSBibGFuayBsaW5lcyBhbmQgY29tbWVudHMKKwluZXh0IGlmICgvXlxzKiQvIHx8IC9ccypcIy8pOworCisJaWYgKC9eXHMqVEVTVF9TVEFSVCguKikvKSB7CisKKwkgICAgJHJlc3QgPSAkMTsKKworCSAgICBpZiAoJG51bV90ZXN0c19zZXQpIHsKKwkJZGllICIkbmFtZTogJC46IENhbiBub3Qgc3BlY2lmeSBib3RoIE5VTV9URVNUUyBhbmQgVEVTVF9TVEFSVFxuIjsKKwkgICAgfQorCisJICAgIG15ICRvbGRfdGVzdF9udW0gPSAkdGVzdF9udW07CisJICAgIG15ICRvbGRfcmVwZWF0ID0gJHJlcGVhdDsKKworCSAgICAkdGVzdF9udW0gKz0gJHJlcGVhdDsKKwkgICAgJGRlZmF1bHQgPSAwOworCSAgICAkcmVwZWF0ID0gMTsKKworCSAgICBpZiAoJHJlc3QgPX4gL1xzK1NLSVAoLiopLykgeworCQkkcmVzdCA9ICQxOworCQkkc2tpcCA9IDE7CisJICAgIH0gZWxzZSB7CisJCSRza2lwID0gMDsKKwkgICAgfQorCisJICAgIGlmICgkcmVzdCA9fiAvXHMrSVRFUkFURVxzKyhcZCspKC4qKSQvKSB7CisJCSRyZXBlYXQgPSAkMTsKKwkJJHJlc3QgPSAkMjsKKwkJJHJlcGVhdF90ZXN0c3siJHRlc3RfbnVtIn0gPSAkcmVwZWF0OworCSAgICB9CisKKwkgICAgaWYgKCRyZXN0ID1+IC9ccytTS0lQKC4qKS8pIHsKKwkJJHJlc3QgPSAkMTsKKwkJJHNraXAgPSAxOworCSAgICB9CisK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JU0VDVF9UWVBFWyRpXSJ9IGVxICJidWlsZCIpOworfQorCitzdWIgZG9kaWUgeworICAgIGRvcHJpbnQgIkNSSVRJQ0FMIEZBSUxVUkUuLi4gIiwgQF8sICJcbiI7CisKKyAgICBteSAkaSA9ICRpdGVyYXRpb247CisKKyAgICBpZiAoJHJlYm9vdF9vbl9lcnJvciAmJiAhZG9fbm90X3JlYm9vdCkgeworCisJZG9wcmludCAiUkVCT09USU5HXG4iOworCXJlYm9vdDsKKworICAgIH0gZWxzaWYgKCRwb3dlcm9mZl9vbl9lcnJvciAmJiBkZWZpbmVkKCRwb3dlcl9vZmYpKSB7CisJZG9wcmludCAiUE9XRVJJTkcgT0ZGXG4iOworCWAkcG93ZXJfb2ZmYDsKKyAgICB9CisKKyAgICBkaWUgQF8sICJcbiI7Cit9CisKK3N1YiBvcGVuX2NvbnNvbGUgeworICAgIG15ICgkZnApID0gQF87CisKKyAgICBteSAkZmxhZ3M7CisKKyAgICBteSAkcGlkID0gb3BlbigkZnAsICIkY29uc29sZXwiKSBvcgorCWRvZGllICJDYW4ndCBvcGVuIGNvbnNvbGUgJGNvbnNvbGUiOworCisgICAgJGZsYWdzID0gZmNudGwoJGZwLCBGX0dFVEZMLCAwKSBvcgorCWRvZGllICJDYW4ndCBnZXQgZmxhZ3MgZm9yIHRoZSBzb2NrZXQ6ICQhIjsKKyAgICAkZmxhZ3MgPSBmY250bCgkZnAsIEZfU0VURkwsICRmbGFncyB8IE9fTk9OQkxPQ0spIG9yCisJZG9kaWUgIkNhbid0IHNldCBmbGFncyBmb3IgdGhlIHNvY2tldDogJCEiOworCisgICAgcmV0dXJuICRwaWQ7Cit9CisKK3N1YiBjbG9zZV9jb25zb2xlIHsKKyAgICBteSAoJGZwLCAkcGlkKSA9IEBfOworCisgICAgZG9wcmludCAia2lsbCBjaGlsZCBwcm9jZXNzICRwaWRcbiI7CisgICAga2lsbCAyLCAkcGlkOworCisgICAgcHJpbnQgImNsb3NpbmchXG4iOworICAgIGNsb3NlKCRmcCk7Cit9CisKK3N1YiBzdGFydF9tb25pdG9yIHsKKyAgICBpZiAoJG1vbml0b3JfY250KyspIHsKKwlyZXR1cm47CisgICAgfQorICAgICRtb25pdG9yX2ZwID0gXCpNT05GRDsKKyAgICAkbW9uaXRvcl9waWQgPSBvcGVuX2NvbnNvbGUgJG1vbml0b3JfZnA7CisKKyAgICByZXR1cm47CisKKyAgICBvcGVuKE1PTkZELCAiU3RvcCBwZXJsIGZyb20gd2FybmluZyBhYm91dCBzaW5nbGUgdXNlIG9mIE1PTkZEIik7Cit9CisKK3N1YiBlbmRfbW9uaXRvciB7CisgICAgaWYgKC0tJG1vbml0b3JfY250KSB7CisJcmV0dXJuOworICAgIH0KKyAgICBjbG9zZV9jb25zb2xlKCRtb25pdG9yX2ZwLCAkbW9uaXRvcl9waWQpOworfQorCitzdWIgd2FpdF9mb3JfbW9uaXRvciB7CisgICAgbXkgKCR0aW1lKSA9IEBfOworICAgIG15ICRsaW5lOworCisgICAgZG9wcmludCAiKiogV2FpdCBmb3IgbW9uaXRvciB0byBzZXR0bGUgZG93biAqKlxuIjsKKworICAgICMgcmVhZCB0aGUgbW9uaXRvciBhbmQgd2FpdCBmb3IgdGhlIHN5c3RlbSB0byBjYWxtIGRvd24KKyAgICBkbyB7CisJJGxpbmUgPSB3YWl0X2Zvcl9pbnB1dCgkbW9uaXRvcl9mcCwgJHRpbWUpOworCXByaW50ICIkbGluZSIgaWYgKGRlZmluZWQoJGxpbmUpKTsKKyAgICB9IHdoaWxlIChkZWZpbmVkKCRsaW5lKSk7CisgICAgcHJpbnQgIioqIE1vbml0b3IgZmx1c2hlZCAqKlxuIjsKK30KKworc3ViIGZhaWwgeworCisJaWYgKCRkaWVfb25fZmFpbHVyZSkgeworCQlkb2RpZSBAXzsKKwl9CisKKwlkb3ByaW50ICJGQUlMRURcbiI7CisKKwlteSAkaSA9ICRpdGVyYXRpb247CisKKwkjIG5vIG5lZWQgdG8gcmVib290IGZvciBqdXN0IGJ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WUgImNhbid0IGNyZWF0ZSAkZmFpbGRpciI7CisJfQorCWlmICgtZiAiJG91dHB1dF9jb25maWciKSB7CisJICAgIGNwICIkb3V0cHV0X2NvbmZpZyIsICIkZmFpbGRpci9jb25maWciIG9yCisJCWRpZSAiZmFpbGVkIHRvIGNvcHkgLmNvbmZpZyI7CisJfQorCWlmICgtZiAkYnVpbGRsb2cpIHsKKwkgICAgY3AgJGJ1aWxkbG9nLCAiJGZhaWxkaXIvYnVpbGRsb2ciIG9yCisJCWRpZSAiZmFpbGVkIHRvIG1vdmUgJGJ1aWxkbG9nIjsKKwl9CisJaWYgKC1mICRkbWVzZykgeworCSAgICBjcCAkZG1lc2csICIkZmFpbGRpci9kbWVzZyIgb3IKKwkJZGllICJmYWlsZWQgdG8gbW92ZSAkZG1lc2ciOworCX0KKworCWRvcHJpbnQgIioqKiBTYXZlZCBpbmZvIHRvICRmYWlsZGlyICoqKlxuIjsKKworCXJldHVybiAxOworfQorCitzdWIgcnVuX2NvbW1hbmQgeworICAgIG15ICgkY29tbWFuZCkgPSBAXzsKKyAgICBteSAkZG9sb2cgPSAwOworICAgIG15ICRkb3JkID0gMDsKKyAgICBteSAkcGlkOworCisgICAgJGNvbW1hbmQgPX4gcy9cJFNTSF9VU0VSLyRzc2hfdXNlci9nOworICAgICRjb21tYW5kID1+IHMvXCRNQUNISU5FLyRtYWNoaW5lL2c7CisKKyAgICBkb3ByaW50KCIkY29tbWFuZCAuLi4gIik7CisKKyAgICAkcGlkID0gb3BlbihDTUQsICIkY29tbWFuZCAyPiYxIHwiKSBvcgorCShmYWlsICJ1bmFibGUgdG8gZXhlYyAkY29tbWFuZCIgYW5kIHJldHVybiAwKTsKKworICAgIGlmIChkZWZpbmVkKCRvcHR7IkxPR19GSUxFIn0pKSB7CisJb3BlbihMT0csICI+PiRvcHR7TE9HX0ZJTEV9Iikgb3IKKwkgICAgZG9kaWUgImZhaWxlZCB0byB3cml0ZSB0byBsb2ciOworCSRkb2xvZyA9IDE7C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Ym9vdF90eXBlIG5lICJncnViIikgeworCXJldHVybjsKKyAgICB9CisgICAgcmV0dXJuIGlmIChkZWZpbmVkKCRncnViX251bWJlcikpOworCisgICAgZG9wcmludCAiRmluZCBncnViIG1lbnUgLi4uICI7CisgICAgJGdydWJfbnVtYmVyID0gLTE7CisKKyAgICBteSAkc3NoX2dydWIgPSAkc3NoX2V4ZWM7CisgICAgJHNzaF9ncnViID1+IHMsXCRTU0hfQ09NTUFORCxjYXQgL2Jvb3QvZ3J1Yi9tZW51LmxzdCxnOworCisgICAgb3BlbihJTiwgIiRzc2hfZ3J1YiB8IikKKwlvciBkaWUgInVuYWJsZSB0byBnZXQgbWVudS5sc3QiOworCisgICAgd2hpbGUgKDxJTj4pIHsKKwlpZiAoL15ccyp0aXRsZVxzKyRncnViX21lbnVccyokLykgeworCSAgICAkZ3J1Yl9udW1iZXIrKzsKKwkgICAgbGFzdDsKKwl9IGVsc2lmICgvXlxzKnRpdGxlXHMvKSB7CisJICAgICRncnViX251bWJlcisrOworCX0KKyAgICB9CisgICAgY2xvc2UoSU4pOworCisgICAgZGllICJDb3VsZCBub3QgZmluZCAnJGdydWJfbWVudScgaW4gL2Jvb3QvZ3J1Yi9tZW51IG9uICRtYWNoaW5lIgorCWlmICgkZ3J1Yl9udW1iZXIgPCAwKTsKKyAgICBkb3ByaW50ICIkZ3J1Yl9udW1iZXJcbiI7Cit9CisKK3N1YiB3YWl0X2Zvcl9pbnB1dAoreworICAgIG15ICgkZnAsICR0aW1lKSA9IEBfOworICAgIG15ICRyaW47CisgICAgbXkgJHJlYWR5OworICAgIG15ICRsaW5lOworICAgIG15ICRjaDsKKworICAgIGlmICghZGVmaW5lZCgkdGltZSkpIHsKKwkkdGltZSA9ICR0aW1lb3V0OworICAgIH0KKworICAgICRyaW4gPSAnJzsKKyAgICB2ZWMoJHJpbiwgZmlsZW5vKCRmcCksIDEpID0gMTsKKyAgICAkcmVhZHkgPSBzZWxlY3QoJHJpbiwgdW5kZWYsIHVuZGVmLCAkdGltZSk7CisKKyAgICAkbGluZSA9ICIiOworCisgICAgIyB0cnkgdG8gcmVhZCBvbmUgY2hhciBhdCBhIHRpbWUKKyAgICB3aGlsZSAoc3lzcmVhZCAkZnAsICRjaCwgMSkgeworCSRsaW5lIC49ICRjaDsKKwlsYXN0IGlmICgkY2ggZXEgIlxuIik7CisgICAgfQorCisgICAgaWYgKCFsZW5ndGgoJGxpbmUpKSB7CisJcmV0dXJuIHVuZGVmOworICAgIH0KKworICAgIHJldHVybiAkbGluZTsKK30KKworc3ViIHJlYm9vdF90byB7CisgICAgaWYgKCRyZWJvb3RfdHlwZSBlcSAiZ3J1YiIpIHsKKwlydW5fc3NoICInKGVjaG8gXCJzYXZlZGVmYXVsdCAtLWRlZmF1bHQ9JGdydWJfbnVtYmVyIC0tb25jZVwiIHwgZ3J1YiAtLWJhdGNoOyByZWJvb3QpJyI7CisJcmV0dXJuOworICAgIH0KKworICAgIHJ1bl9jb21tYW5kICIkcmVib290X3NjcmlwdCI7Cit9CisKK3N1YiBnZXRfc2hhMSB7CisgICAgbXkgKCRjb21taXQpID0gQF87CisKKyAgICBkb3ByaW50ICJnaXQgcmV2LWxpc3QgLS1tYXgtY291bnQ9MSAkY29tbWl0IC4uLiAiOworICAgIG15ICRzaGExID0gYGdpdCByZXYtbGlzdCAtLW1heC1jb3VudD0xICRjb21taXRgOworICAgIG15ICRyZXQgPSAkPzsKKworICAgIGxvZ2l0ICRzaGExOworCisgICAgaWYgKCRyZXQpIHsKKwlkb3ByaW50ICJGQUlMRURcbiI7CisJZG9kaWUgIkZhaWxlZCB0byBnZXQgZ2l0ICRjb21taXQiOworICAgIH0KKworICAgIHByaW50ICJTVUNDRVNTXG4iOworCisgICAgY2hvbXAgJHNoYTE7CisKKyAgICByZXR1cm4gJHNoYTE7Cit9CisKK3N1YiBtb25pdG9yIHsKKyAgICBteSAkYm9vdGVkID0gMDsKKyAgICBteSAkYnVnID0gMDsKKyAgICBteSAkc2tpcF9jYWxsX3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Qgc2hvdyAkcGF0Y2ggfCIpIG9yCisJZG9kaWUgImZhaWxlZCB0byBzaG93ICRwYXRjaCI7CisgICAgd2hpbGUgKDxJTj4pIHsKKwlpZiAobSxeLS0tIGEvKC4qKSwpIHsKKwkgICAgY2hvbXAgJDE7CisJICAgICRmaWxlc1skI2ZpbGVzXSA9ICQxOworCX0KKyAgICB9CisgICAgY2xvc2UoSU4pOworCisgICAgb3BlbihJTiwgJGJ1aWxkbG9nKSBvciBkb2RpZSAiQ2FuJ3Qgb3BlbiAkYnVpbGRsb2ciOworICAgIHdoaWxlICg8SU4+KSB7CisJaWYgKC9eXHMqKC4qPyk6Liood2FybmluZ3xlcnJvcikvKSB7CisJICAgIG15ICRlcnIgPSAkMTsKKwkgICAgZm9yZWFjaCBteSAkZmlsZSAoQGZpbGVzKSB7CisJCW15ICRmdWxscGF0aCA9ICIkYnVpbGRkaXIvJGZpbGUiOworCQlpZiAoJGZpbGUgZXEgJGVyciB8fCAkZnVsbHBhdGggZXEgJGVycikgeworCQkgICAgZmFpbCAiJGZpbGUgYnVpbHQgd2l0aCB3YXJuaW5ncyIgYW5kIHJldHVybiAwOworCQl9CisJICAgIH0KKwl9CisgICAgfQorICAgIGNsb3NlKElOKTsKKworICAgIHJldHVybiAxOworfQorCitzdWIgYnVpbGQgeworICAgIG15ICgkdHlwZSkgPSBAXzsKKyAgICBteSAkZGVmY29uZmlnID0gIiI7CisKKyAgICB1bmxpbmsgJGJ1aWxkbG9nOworCisgICAgaWYgKCR0eXBlID1+IC9edXNlY29uZmlnOiguKikvKSB7CisJcnVuX2NvbW1hbmQgImNwICQxICRvdXRwdXRfY29uZmlnIiBvcgorCSAgICBkb2RpZSAiY291bGQgbm90IGNvcHkgJDEgdG8gLmNvbmZpZyI7CisKKwkkdHlwZSA9ICJvbGRjb25maWciOworICAgIH0KKworICAgICMgb2xkIGNvbmZpZyBjYW4gYXNrIHF1ZXN0aW9ucworICAgIGlmICgkdHlwZSBlcSAib2xkY29uZmlnI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tYWtlIGNvbmZpZyI7CisKKyAgICAkcmVkaXJlY3QgPSAiJGJ1aWxkbG9nIjsKKyAgICBpZiAoIXJ1bl9jb21tYW5kICIkbWFrZSAkYnVpbGRfb3B0aW9ucyIpIHsKKwl1bmRlZiAkcmVkaXJlY3Q7CisJIyBiaXNlY3QgbWF5IG5lZWQgdGhpcyB0byBwYXNzCisJcmV0dXJuIDAgaWYgKCRpbl9iaXNlY3QpOworCWZhaWwgImZhaWxlZCBidWlsZCIgYW5kIHJldHVybiAwOworICAgIH0KKyAgICB1bmRlZiAkcmVkaXJlY3Q7CisKKyAgICByZXR1cm4gMTsKK30KKworc3ViIGhhbHQgeworICAgIGlmICghcnVuX3NzaCAiaGFsdCIgb3IgZGVmaW5lZCgkcG93ZXJfb2ZmKSkgeworCWlmIChkZWZpbmVkKCRwb3dlcm9mZl9hZnRlcl9oYWx0KSkgeworCSAgICBzbGVlcCAkcG93ZXJvZmZfYWZ0ZXJfaGFsdDsKKwkgICAgcnVuX2NvbW1hbmQgIiRwb3dlcl9vZmYiOworCX0KKyAgICB9IGVsc2UgeworCSMgbm9wZT8gdGhlIHphcCBpdCEKKwlydW5fY29tbWFuZCAiJHBvd2VyX29mZiI7CisgICAgfQorfQorCitzdWIgc3VjY2VzcyB7CisgICAgbXkgKCRpKSA9IEBfOworCisgICAgJHN1Y2Nlc3NlcysrOworCisgICAgZG9wcmludCAiXG5cbioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbiI7CisgICAgZG9wcmludCAgICAgIioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbiI7CisgICAgZG9wcmludCAgICAgIktURVNUIFJFU1VMVDogVEVTVCAkaSBTVUNDRVNTISEhISAgICAgICAgICoqXG4iOworICAgIGRvcHJpbnQgICAgICIqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXG4iOworICAgIGRvcHJpbnQgICAgICIqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXG4iOworCisgICAgaWYgKCRpICE9ICRvcHR7Ik5VTV9URVNUUyJ9ICYmICFkb19ub3RfcmVib290KSB7CisJZG9wcmludCAiUmVib290IGFuZCB3YWl0ICRzbGVlcF90aW1lIHNlY29uZHNcbiI7CisJcmVib290OworCXN0YXJ0X21vbml0b3I7CisJd2FpdF9mb3JfbW9uaXRvciAkc2xlZXBfdGltZTsKKwllbmRfbW9uaXRvcjsKKyAgICB9Cit9CisKK3N1YiBnZXRfdmVyc2lvbiB7CisgICAgIyBnZXQgdGhlIHJlbGVhc2UgbmFtZQorICAgIGRvcHJpbnQgIiRtYWtlIGtlcm5lbHJlbGVhc2UgLi4uICI7CisgICAgJHZlcnNpb24gPSBgJG1ha2Uga2VybmVscmVsZWFzZSB8IHRhaWwgLTFgOworICAgIGNob21wKCR2ZXJzaW9uKTsKKyAgICBkb3ByaW50ICIkdmVyc2lvblxuIjsKK30KKworc3ViIGNoaWxkX3J1bl90ZXN0IHsKKyAgICBteSAkZmFpbGVkID0gMDsKKworICAgICMgY2hpbGQgc2hvdWxkIGhhdmUgbm8gcG93ZXIKKyAgICAkcmVib290X29uX2Vycm9yID0gMDsKKyAgICAkcG93ZXJvZmZfb25fZXJyb3IgPSAwOworICAgICRkaWVfb25fZmFpbHVyZSA9IDE7CisKKyAgICBydW5fY29tbWFuZCAkcnVuX3Rlc3Qgb3IgJGZhaWxlZCA9IDE7CisgICAgZXhpdCAkZmFpbGVkOworfQorCitteSAkY2hpbGRfZG9uZTsKKworc3ViIGNoaWxkX2ZpbmlzaGVkIHsKKyAgICAkY2hpbGRfZG9uZSA9IDE7Cit9CisKK3N1YiBkb19ydW5fdGVzdCB7CisgICAgbXkgJGNoaWxkX3BpZDsKKyAgICBteSAkY2hpbGRfZXhpdDsKKyAgICBteSAkbGluZTsKKyAgICBteSAkZnVsbF9saW5lOworICAgIG15ICRidWcgPSAwOworCisgICAgd2FpdF9mb3JfbW9uaXRvciAxOwor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CisgICAgJGluX2Jpc2VjdCA9IDE7CisKKyAgICBidWlsZCAkYnVpbGR0eXBlIG9yICRmYWlsZWQgPSAxOworCisgICAgaWYgKCR0eXBlIG5lICJidWlsZCIpIHsKKwlkb2RpZSAiRmFpbGVkIG9uIGJ1aWxkIiBpZiAkZmFpbGVkOworCisJIyBOb3cgYm9vdCB0aGUgYm94CisJZ2V0X2dydWJfaW5kZXg7CisJZ2V0X3ZlcnNpb247CisJaW5zdGFsbDsKKworCXN0YXJ0X21vbml0b3I7CisJbW9uaXRvciBvciAkZmFpbGVkID0gMTsKKworCWlmICgkdHlwZSBuZSAiYm9vdCIpIHsKKwkgICAgZG9kaWUgIkZhaWxlZCBvbiBib290IiBpZiAkZmFpbGVkOworCisJICAgIGRvX3J1bl90ZXN0IG9yICRmYWlsZWQgPSAxOworCX0KKwllbmRfbW9uaXRvcjsKKyAgICB9CisKKyAgICBpZiAoJGZhaWxlZCkgeworCSRyZXN1bHQgPSAwOworCisJIyByZWJvb3QgdGhlIGJveCB0byBhIGdvb2Qga2VybmVsCisJaWYgKCR0eXBlIG5lICJidWlsZCIpIHsKKwkgICAgZG9wcmludCAiUmVib290IGFuZCBzbGVlcCAkYmlzZWN0X3NsZWVwX3RpbWUgc2Vjb25kc1xuIjsKKwkgICAgcmVib290OworCSAgICBzdGFydF9tb25pdG9yOworCSAgICB3YWl0X2Zvcl9tb25pdG9yICRiaXNlY3Rfc2xlZXBfdGltZTsKKwkgICAgZW5kX21vbml0b3I7CisJfQorICAgIH0gZWxzZSB7CisJJHJlc3VsdCA9IDE7CisgICAgfQorICAgICRpbl9iaXNlY3QgPSAwOworCisgICAgcmV0dXJuICRyZXN1bHQ7Cit9CisKK3N1YiBydW5fYmlzZWN0IHsKKyAgICBteSAoJHR5cGUpID0gQF87CisgICAgbXkgJGJ1aWxkdHlwZSA9ICJvbGRjb25maWciOworCisgICAgIyBXZSBzaG91bGQgaGF2ZSBhIG1pbmNvbmZpZyB0byB1c2U/CisgICAgaWY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c3ViIHJlYWRfY3VycmVudF9jb25maWcgeworICAgIG15ICgkY29uZmlnX3JlZikgPSBAXzsKKworICAgICV7JGNvbmZpZ19yZWZ9ID0gKCk7CisgICAgdW5kZWYgJXskY29uZmlnX3JlZn07CisKKyAgICBteSBAa2V5ID0ga2V5cyAleyRjb25maWdfcmVmfTsKKyAgICBpZiAoJCNrZXkgPj0gMCkgeworCXByaW50ICJkaWQgbm90IGRlbGV0ZSFcbiI7CisJZXhpdDsKKyAgICB9CisgICAgb3BlbiAoSU4sICIkb3V0cHV0X2NvbmZpZyIpOworCisgICAgd2hpbGUgKDxJTj4pIHsKKwlpZiAoL14oQ09ORklHXFMrKT0oLiopLykgeworCSAgICAkeyRjb25maWdfcmVmfXskMX0gPSAkMjsKKwl9CisgICAgfQorICAgIGNsb3NlKElOKTsKK30KKworc3ViIGdldF9kZXBlbmRlbmNpZXMgeworICAgIG15ICgkY29uZmlnKSA9IEBfOworCisgICAgbXkgJGFyciA9ICRkZXBlbmRlbmN5eyRjb25maWd9OworICAgIGlmICghZGVmaW5lZCgkYXJyKSkgeworCXJldHVybiAoKTsKKyAgICB9CisKKyAgICBteSBAZGVwcyA9IEB7JGFycn07CisKKyAgICBmb3JlYWNoIG15ICRkZXAgKEB7JGFycn0pIHsKKwlwcmludCAiQUREIERFUCAkZGVwXG4iOworCUBkZXBzID0gKEBkZXBzLCBnZXRfZGVwZW5kZW5jaWVzICRkZXApOworICAgIH0KKworICAgIHJldHVybiBAZGVwczsKK30KKworc3ViIGNyZWF0ZV9jb25maWcgeworICAgIG15IEBjb25maWdzID0gQF87CisKKyAgICBvcGVuKE9VVCwgIj4kb3V0cHV0X2NvbmZpZyIpIG9yIGRvZGllICJDYW4gbm90IHdyaXRlIHRvICRvdXRwdXRfY29uZmlnIjsKKworICAgIGZvcmVhY2ggbXkgJGNvbmZpZyAoQGNvbmZpZ3MpIHsKKwlwcmludCBPVVQgIiRjb25maWdfc2V0eyRjb25maWd9XG4iOworCW15IEBkZXBzID0gZ2V0X2RlcGVuZGVuY2llcyAkY29uZmlnOworCWZvcmVhY2ggbXkgJGRlcCAoQGRlcHMpIHsKKwkgICAgcHJpbnQgT1VUICIkY29uZmlnX3NldHskZGVwfVxuIjsKKwl9CisgICAgfQorCisgICAgZm9yZWFjaCBteSAkY29uZmlnIChrZXlzICVjb25maWdfaWdub3JlKSB7CisJcHJpbnQgT1VUICIkY29uZmlnX2lnbm9yZXskY29uZmlnfVxuIjsKKyAgICB9CisgICAgY2xvc2UoT1VUKTsKKworIyAgICBleGl0OworICAgIHJ1bl9jb21tYW5kICIkbWFrZSBvbGRub2NvbmZpZyIgb3IKKwlkb2RpZSAiZmFpbGVkIG1ha2UgY29uZmlnIG9sZGNvbmZpZyI7CisKK30KKworc3ViIGNvbXBhcmVfY29uZmlncyB7CisgICAgbXkgKCVhLCAlYikgPSBAXzsKKworICAgIGZvcmVhY2ggbXkgJGl0ZW0gKGtleXMgJWEpIHsKKwlpZiAoIWRlZmluZWQoJGJ7JGl0ZW19KSkgeworCSAgICBwcmludCAiZGlmZiAkaXRlbVxuIjsKKwkgICAgcmV0dXJuIDE7CisJfQorCWRlbGV0ZSAkYnskaXRlbX07CisgICAgfQorCisgICAgbXkgQGtleXMgPSBrZXlzICViOworICAgIGlmICgkI2tleXMpIHsKKwlwcmludCAiZGlmZjIgJGtleXNbMF1cbiI7CisgICAgfQorICAgIHJldHVybiAtMSBpZiAoJCNrZXlzID49IDApOworCisgICAgcmV0dXJuIDA7Cit9CisKK3N1YiBydW5fY29uZmlnX2Jpc2VjdF90ZXN0IHsKKyAgICBteSAoJHR5cGUpID0gQF87CisKKyAgICByZXR1cm4gcnVuX2Jpc2VjdF90ZXN0ICR0eXBlLCAib2xkY29uZmlnIjsKK30KKworc3ViIHByb2Nlc3NfcGFzc2VkIHsKKyAgICBteSAoJWNvbmZpZ3MpID0gQF87CisKKyAgICBkb3ByaW50ICJUaGVzZSBjb25maWdzIGhhZCBubyBmYWlsdXJlOiAoRW5hYmxpbmcgdGhlbSBmb3IgZnVydGhlciBjb21waWxlcylcbiI7CisgICAgIyBQYXNzZWQhIEFsbCB0aGVzZSBjb25maWdzIGFyZSBwYXJ0IG9mIGEgZ29vZCBjb21waWxlLgorICAgICMgQWRkIHRoZW0gdG8gdGhlIG1pbiBvcHRpb25zLgorICAgIGZvcmVhY2ggbXkgJGNvbmZpZyAoa2V5cyAlY29uZmlncykgeworCWlmIChkZWZpbmVkKCRjb25maWdfbGlzdHskY29uZmlnfSkpIHsKKwkgICAgZG9wcmludCAiIHJlbW92aW5nICRjb25maWdcbiI7CisJICAgICRjb25maWdfaWdub3JleyRjb25maWd9ID0gJGNvbmZpZ19saXN0eyRjb25maWd9OworCSAgICBkZWxldGUgJGNvbmZpZ19saXN0eyRjb25maWd9OworCX0KKyAgICB9CisgICAgZG9wcmludCAiY29uZmlnIGNvcGllZCB0byAkb3V0cHV0ZGlyL2NvbmZpZ19nb29kXG4iOworICAgIHJ1bl9jb21tYW5kICJjcCAtZiAkb3V0cHV0X2NvbmZpZyAkb3V0cHV0ZGlyL2NvbmZpZ19nb29kIjsKK30KKworc3ViIHByb2Nlc3NfZmFpbGVkIHsKKyAgICBteSAoJGNvbmZpZykgPSBAXzsKKworICAgIGRvcHJpbnQgIlxuXG4qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbiI7CisgICAgZG9wcmludCAiRm91bmQgYmFkIGNvbmZpZzogJGNvbmZpZ1xuIjsKKyAgICBkb3ByaW50ICIqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcblxuIjsKK30KKworc3ViIHJ1bl9jb25maWdfYmlzZWN0IHsKKworICAgIG15IEBzdGFydF9saXN0ID0ga2V5cyAlY29uZmlnX2xpc3Q7CisKKyAgICBpZiAoJCNzdGFydF9saXN0IDwgMCkgeworCWRvcHJpbnQgIk5vIG1vcmUgY29uZmlncyB0byB0ZXN0ISEhXG4iOworCXJldHVybiAtMTsKKyAgICB9CisKKyAgICBkb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NvbmZpZyBhbmQgdGhlIG1pbiBjb25maWcKKyAgICBpZiAoZGVmaW5lZCgkbWluY29uZmlnKSkgeworCSMgcmVhZCB0aGUgbWluIGNvbmZpZyBmb3IgdGhpbmdzIHRvIGlnbm9yZQorCXJ1bl9jb21tYW5kICJjcCAkbWluY29uZmlnICR0bXBjb25maWciIG9yCisJICAgIGRvZGllICJmYWlsZWQgdG8gY29weSAkbWluY29uZmlnIHRvICR0bXBjb25maWciOworICAgIH0gZWxzZSB7CisJdW5saW5rICR0bXBjb25maWc7CisgICAgfQorCisgICAgIyBBZGQgb3RoZXIgY29uZmlncworICAgIGlmIChkZWZpbmVkKCRhZGRjb25maWcpKSB7CisJcnVuX2NvbW1hbmQgImNhdCAkYWRkY29uZmlnID4+ICR0bXBjb25maWciIG9yCisJICAgIGRvZGllICJmYWlsZWQgdG8gYXBwZW5kICRhZGRjb25maWciOworICAgIH0KKworICAgIG15ICRkZWZjb25maWcgPSAiIjsKKyAgICBpZiAoLWYgJHRtcGNvbmZpZykgeworCSRkZWZjb25maWcgPSAiS0NPTkZJR19BTExDT05GSUc9JHRtcGNvbmZpZyI7CisJcHJvY2Vzc19jb25maWdfaWdub3JlICR0bXBjb25maWc7CisgICAgfQorCisgICAgIyBub3cgcHJvY2VzcyB0aGUgc3RhcnQgY29uZmlnCisgICAgcnVuX2NvbW1hbmQgImNwICRzdGFydF9jb25maWcgJG91dHB1dF9jb25maWciIG9yCisJZG9kaWUgImZhaWxlZCB0byBjb3B5ICRzdGFydF9jb25maWcgdG8gJG91dHB1dF9jb25maWciOworCisgICAgIyByZWFkIGRpcmVjdGx5IHdoYXQgd2Ugd2FudCB0byBjaGVjaworICAgIG15ICVjb25maWdfY2hlY2s7CisgICAgb3BlbiAoSU4sICRvdXRwdXRfY29uZmlnKQorCW9yIGRvZGllICJmYWllZCB0byBvcGVuICRvdXRwdXRfY29uZmlnIjsKKworICAgIHdoaWxlICg8SU4+KSB7CisJaWYgKC9eKChDT05GSUdcUyopPS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NvbmZpZyA9ICRhZGRjb25maWc7CisKKyAgICB9IGVsc2lmIChkZWZpbmVkKCRhZGRjb25maWcpKSB7CisJcnVuX2NvbW1hbmQgImNhdCAkYWRkY29uZmlnICRtaW5jb25maWcgPiAkdG1wZGlyL2FkZF9jb25maWciIG9yCisJICAgIGRvZGllICJGYWlsZWQgdG8gY3JlYXRlIHRlbXAgY29uZmlnIjsKKwkkbWluY29uZmlnID0gIiR0bXBkaXIvYWRkX2NvbmZpZyI7CisgICAgfQorCisgICAgbXkgJGNoZWNrb3V0ID0gJG9wdHsiQ0hFQ0tPVVRbJGldIn07CisgICAgaWYgKGRlZmluZWQoJGNoZWNrb3V0KSkgeworCXJ1bl9jb21tYW5kICJnaXQgY2hlY2tvdXQgJGNoZWNrb3V0IiBvcgorCSAgICBkaWUgImZhaWxlZCB0byBjaGVja291dCAkY2hlY2tvdXQiOworICAgIH0KKworICAgIGlmICgkdGVzdF90eXBlIGVxICJiaXNlY3QiKSB7CisJYmlzZWN0ICRpOworCW5leHQ7CisgICAgfSBlbHNpZiAoJHRlc3RfdHlwZSBlcSAiY29uZmlnX2Jpc2VjdCIpIHsKKwljb25maWdfYmlzZWN0ICRpOworCW5leHQ7CisgICAgfSBlbHNpZiAoJHRlc3RfdHlwZSBlcSAicGF0Y2hjaGVjayIpIHsKKwlwYXRjaGNoZWNrICRpOworCW5leHQ7CisgICAgfQorCisgICAgaWYgKCRidWlsZF90eXBlIG5lICJub2J1aWxkIikgeworCWJ1aWxkICRidWlsZF90eXBlIG9yIG5leHQ7CisgICAgfQorCisgICAgaWYgKCR0ZXN0X3R5cGUgbmUgImJ1aWxkIikgeworCWdldF9ncnViX2luZGV4OworCWdldF92ZXJzaW9uOworCWluc3RhbGw7CisKKwlteSAkZmFpbGVkID0gMDsKKwlzdGFydF9tb25pdG9yOworCW1vbml0b3Igb3IgJGZhaWxlZCA9IDE7OworCisJaWYgKCEkZmFpbGVkICYmICR0ZXN0X3R5cGUgbmUgImJvb3QiICYmI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