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IC0xIC0xCithYi57Miw1fXh5IGFiX3h5IC0xIC0xCisKKzsgYWdhaW4gYnV0IHdpdGggc2xvd2VyIGFsZ29yaXRobSB2YXJpYW50OgorLSBtYXRjaF9kZWZhdWx0IFJFR19FWFRFTkRFRAorOyBub3cgYWdhaW4gZm9yIHNpbmdsZSBjaGFyYWN0ZXIgcmVwZWF0czoKKworYWJfKnh5IGFieHlfIDAgNAorYWJfKnh5IGFiX3h5XyAwIDUKK2FiXyp4eSBhYnh5IDAgNAorYWJfKnh5IGFiX3h5IDAgNQorYWJfKiBhYiAwIDIKK2FiXyogYWJfXyAwIDQKKworYWJfezIsNX14eSBhYl9feHlfIDAgNgorYWJfezIsNX14eSBhYl9fX194eV8gMCA4CithYl97Miw1fXh5IGFiX19fX194eV8gMCA5CithYl97Miw1fXh5IGFiX194eSAwIDYKK2FiX3syLDV9eHkgYWJfX19fX3h5IDAgOQorYWJfezIsNX0gYWJfXyAwIDQKK2FiX3syLDV9IGFiX19fX19fXyAwIDcKK2FiX3syLDV9eHkgYWJfX19fX194eSAtMSAtMQorYWJfezIsNX14eSBhYl94eSAtMSAtMQorCithYl8qP3h5IGFieHlfIDAgNAorYWJfKj94eSBhYl94eV8gMCA1CithYl8qP3h5IGFieHkgMCA0CithYl8qP3h5IGFiX3h5IDAgNQorYWJfKj8gYWIgMCAyCithYl8qPyBhYl9fIDAgNAorCithYl97Miw1fT94eSBhYl9feHlfIDAgNgorYWJfezIsNX0/eHkgYWJfX19feHlfIDAgOAorYWJfezIsNX0/eHkgYWJfX19fX3h5XyAwIDkKK2FiX3syLDV9P3h5IGFiX194eSAwIDYKK2FiX3syLDV9P3h5IGFiX19fX194eSAwIDkKK2FiX3syLDV9PyBhYl9fIDAgNAorYWJfezIsNX0/IGFiX19fX19fXyAwIDcKK2FiX3syLDV9P3h5IGFiX19fX19feHkgLTEgLTEKK2FiX3syLDV9eHkgYWJfeHkgLTEgLTEKKworOyBhbmQgYWdhaW4gZm9yIHNldHM6CithYltfLDtdKnh5IGFieHlfIDAgNAorYWJbXyw7XSp4eSBhYl94eV8gMCA1CithYltfLDtdKnh5IGFieHkgMCA0CithYltfLDtdKnh5IGFiX3h5IDAgNQorYWJbXyw7XSogYWIgMCAyCithYltfLDtdKiBhYl9fIDAgNAorCithYltfLDtdezIsNX14eSBhYl9feHlfIDAgNgorYWJbXyw7XXsyLDV9eHkgYWJfX19feHlfIDAgOAorYWJbXyw7XXsyLDV9eHkgYWJfX19fX3h5XyAwIDkKK2FiW18sO117Miw1fXh5IGFiX194eSAwIDYKK2FiW18sO117Miw1fXh5IGFiX19fX194eSAwIDkKK2FiW18sO117Miw1fSBhYl9fIDAgNAorYWJbXyw7XXsyLDV9IGFiX19fX19fXyAwIDcKK2FiW18sO117Miw1fXh5IGFiX19fX19feHkgLTEgLTEKK2FiW18sO117Miw1fXh5IGFiX3h5IC0xIC0xCisKK2FiW18sO10qP3h5IGFieHlfIDAgNAorYWJbXyw7XSo/eHkgYWJfeHlfIDAgNQorYWJbXyw7XSo/eHkgYWJ4eSAwIDQKK2FiW18sO10qP3h5IGFiX3h5IDAgNQorYWJbXyw7XSo/IGFiIDAgMgorYWJbXyw7XSo/IGFiX18gMCA0CisKK2FiW18sO117Miw1fT94eSBhYl9feHlfIDAgNgorYWJbXyw7XXsyLDV9P3h5IGFiX19fX3h5XyAwIDgKK2FiW18sO117Miw1fT94eSBhYl9fX19feHlfIDAgOQorYWJbXyw7XXsyLDV9P3h5IGFiX194eSAwIDYKK2FiW18sO117Miw1fT94eSBhYl9fX19feHkgMCA5CithYltfLDtdezIsNX0/IGFiX18gMCA0CithYltfLDtdezIsNX0/IGFiX19fX19fXyAwIDcKK2FiW18sO117Miw1fT94eSBhYl9fX19fX3h5IC0xIC0xCithYltfLDtdezIsNX14eSBhYl94eSAtMSAtMQorCis7IGFuZCBhZ2FpbiBmb3IgdHJpY2t5IHNldHMgd2l0aCBkaWdyYXBoczoKKzthYltfWy5hZS5dXSp4eSBhYnh5XyAwIDQKKz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eXpwcXJycmFiYnh5eXl5cHFBenoKKyAwOiBhYWFhYnh5enBxcnJyYWJieHl5eXlwcUF6egorICAgID4+Pj5hYmN4eXpwcXJycmFiYnh5eXl5cHFBenoKKyAwOiBhYmN4eXpwcXJycmFiYnh5eXl5cHFBenoKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYnh5enBxcnJhYmJ4eXl5eXBxQXp6CitObyBtYXRjaAorICAgIGFieHl6cHFycnJyYWJieHl5eXlwcUF6egorTm8gbWF0Y2gKKyAgICBhYnh5enBxcnJyYWJ4eXl5eXBxQXp6CitObyBtYXRjaAorICAgIGFhYWFiY3h5enp6enBxcnJyYWJiYnh5eXl5eXlwcUF6egorTm8gbWF0Y2gKKyAgICBhYWFhYmN4eXp6enpwcXJycmFiYmJ4eXl5cHFBenoKK05vIG1hdGNoCisgICAgYWFhYmN4eXpwcXJycmFiYnh5eXl5cHFxcXFxcXFBenoKK05vIG1hdGNoCisKKy9eKGFiYyl7MSwyfXp6LworICAgIGFiY3p6CisgMDogYWJjenoKKyAxOiBhYmMKKyAgICBhYmNhYmN6egorIDA6IGFiY2FiY3p6CisgMTogYWJjCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgenoKK05vIG1hdGNoCisgICAgYWJjYWJjYWJjenoKK05vIG1hdGNoCisgICAgPj5hYmN6egorTm8gbWF0Y2gKKworL14oYit8YSl7MSwyfWMvCisgICAgYmMKKyAwOiBiYworIDE6IGIKKyAgICBiYmMKKyAwOiBiYmMKKyAxOiBiYgorICAgIGJiYmMKKyAwOiBiYmJjCisgMTogYmJiCisgICAgYmFjCisgMDogYmFjCisgMTogYQorICAgIGJiYWMKKyAwOiBiYmFjCisgMTogYQorICAgIGFhYworIDA6IGFhYworIDE6IGEKKyAgICBhYmJiYmJiYmJiYmJjCisgMDogYWJiYmJiYmJiYmJiYworIDE6IGJiYmJiYmJiYmJiCisgICAgYmJiYmJiYmJiYmJhYworIDA6IGJiYmJiYmJiYmJiYWMKKyAxOiBhCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWFhYworTm8gbWF0Y2gKKyAgICBhYmJiYmJiYmJiYmJhYworTm8gbWF0Y2gKKworL15bXWNkZV0vCisgICAgXXRoaW5nCisgMDogXQorICAgIGN0aGluZworIDA6IGMKKyAgICBkdGhpbmcKKyAwOiBkCisgICAgZXRoaW5nCisgMDogZQorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGF0aGluZworTm8gbWF0Y2gKKyAgICBmdGhpbmcKK05vIG1hdGNoCisKKy9eW15dY2RlXS8KKyAgICBhdGhpbmcKKyAwOiBhCisgICAgZnRoaW5nCisgMDogZgorICAgICoqKiBGYWlsZXJzCisgMDogKgorICAgIF10aGluZworTm8gbWF0Y2gKKyAgICBjdGhpbmcKK05vIG1hdGNoCisgICAgZHRoaW5nCitObyBtYXRjaAorICAgIGV0aGluZworTm8gbWF0Y2gKKworL15bMC05XSskLworICAgIDAKKyAwOiAwCisgICAgMQorIDA6IDEKKyAgICAyCisgMDogMgorICAgIDMKKyAwOiAzCisgICAgNAorIDA6IDQKKyAgICA1CisgMDogNQorICAgIDYKKyAwOiA2CisgICAgNworIDA6IDcKKyAgICA4CisgMDogOAorICAgIDkKKyAwOiA5CisgICAgMTAKKyAwOiAxMAorICAgIDEwMAorIDA6IDEwMAorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiYworTm8gbWF0Y2gKKworL14uKm50ZXIvCisgICAgZW50ZXIKKyAwOiBlbnRlcgorICAgIGludGVyCisgMDogaW50ZXIKKyAgICB1cG9udGVyCisgMDogdXBvbnRlcgorCisvXnh4eFswLTldKyQvCisgICAgeHh4MAorIDA6IHh4eDAKKyAgICB4eHgxMjM0CisgMDogeHh4MTIzNAorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIHh4eAorTm8gbWF0Y2gKKworL14uK1swLTldWzAtOV1bMC05XSQvCisgICAgeDEyMworIDA6IHgxMjMKKyAgICB4eDEyMworIDA6IHh4MTIzCisgICAgMTIzNDU2CisgMDogMTIzNDU2CisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgMTIzCitObyBtYXRjaAorICAgIHgxMjM0CisgMDogeDEyMzQKKworL14oW14hXSspISguKyk9YXBxdXh6XC5peHJcLnp6elwuYWNcLnVrJC8KKyAgICBhYmMhcHFyPWFwcXV4ei5peHIuenp6LmFjLnVrCisgMDogYWJjIXBxcj1hcHF1eHouaXhyLnp6ei5hYy51aworIDE6IGFiYworIDI6IHBxcgorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgICFwcXI9YXBxdXh6Lml4ci56enouYWMudWsKK05vIG1hdGNoCisgICAgYWJjIT1hcHF1eHouaXhyLnp6ei5hYy51aworTm8gbWF0Y2gKKyAgICBhYmMhcHFyPWFwcXV4ejppeHIuenp6LmFjLnVrCitObyBtYXRjaAorICAgIGFiYyFwcXI9YXBxdXh6Lml4ci56enouYWMudWtrCitObyBtYXRjaAorCisvOi8KKyAgICBXZWxsLCB3ZSBuZWVkIGEgY29sb246IHNvbWV3aGVyZQorIDA6IDoKKyAgICAqKiogRmFpbCBpZiB3ZSBkb24ndAorTm8gbWF0Y2gKKworLyhbMC05YS1mOl0rKSQvaQorICAgIDBhYmMKKyAwOiAwYWJjCisgMTogMGFiYworICAgIGFiYworIDA6IGFiYworIDE6IGFiYworICAgIGZlZAorIDA6IGZlZAorIDE6IGZlZAorICAgIEUKKyAwOiBFCisgMTogRQorICAgIDo6CisgMDogOjoKKyAxOiA6OgorICAgIDVmMDM6MTJDMDo6OTMyZQorIDA6IDVmMDM6MTJDMDo6OTMyZQorIDE6IDVmMDM6MTJDMDo6OTMyZQorICAgIGZlZCBkZWYKKyAwOiBkZWYKKyAxOiBkZWYKKyAgICBBbnkgb2xkIHN0dWZmCisgMDogZmYKKyAxOiBmZgorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIDB6enoKK05vIG1hdGNoCisgICAgZ3p6egorTm8gbWF0Y2gKKyAgICBBbnkgb2xkIHJ1YmJpc2gKK05vIG1hdGNoCisKKy9eLipcLihbMC05XXsxLDN9KVwuKFswLTldezEsM30pXC4oWzAtOV17MSwzfSkkLworICAgIC4xLjIuMworIDA6IC4xLjIuMworIDE6IDEKKyAyOiAyCisgMzogMworICAgIEEuMTIuMTIzLjAKKyAwOiBBLjEyLjEyMy4wCisgMTogMTIKKyAyOiAxMjMKKyAzOiAwCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgLjEuMi4zMzMzCitObyBtYXRjaAorICAgIDEuMi4zCitObyBtYXRjaAorICAgIDEyMzQuMi4zCitObyBtYXRjaAorCisvXihbMC05XSspXHMrSU5ccytTT0FccysoXFMrKVxzKyhcUyspXHMqXChccyokLworICAgIDEgSU4gU09BIG5vbi1zcDEgbm9uLXNwMigKKyAwOiAxIElOIFNPQSBub24tc3AxIG5vbi1zcDIoCisgMTogMQorIDI6IG5vbi1zcDEKKyAzOiBub24tc3AyCisgICAgMSAgICBJTiAgICBTT0EgICAgbm9uLXNwMSAgICBub24tc3AyICAgKAorIDA6IDEgICAgSU4gICAgU09BICAgIG5vbi1zcDEgICAgbm9uLXNwMiAgICgKKyAxOiAxCisgMjogbm9uLXNwMQorIDM6IG5vbi1zcDIKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICAxSU4gU09BIG5vbi1zcDEgbm9uLXNwMigKK05vIG1hdGNoCisKKy9eW2EtekEtWjAtOV1bYS16QS1aMC05LV0qKFwuW2EtekEtWjAtOV1bYS16QS16MC05LV0qKSpcLiQvCisgICAgYS4KKyAwOiBhLgorICAgIFouCisgMDogWi4KKyAgICAyLgorIDA6IDIuCisgICAgYWItYy5wcS1yLgorIDA6IGFiLWMucHEtci4KKyAxOiAucHEtcgorICAgIHN4ay56enouYWMudWsuCisgMDogc3hrLnp6ei5hYy51ay4KKyAxOiAudWsKKyAgICB4LS55LS4KKyAwOiB4LS55LS4KKyAxOiAueS0KKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICAtYWJjLnBlcS4KK05vIG1hdGNoCisKKy9eXCpcLlthLXpdKFthLXowLTktXSpbYS16MC05XSspPyhcLlthLXpdKFthLXowLTktXSpbYS16MC05XSspPykqJC8KKyAgICAqLmEKKyAwOiAqLmEKKyAgICAqLmIwLWEKKyAwOiAqLmIwLWEKKyAxOiAwLWEKKyAgICAqLmMzLWIuYworIDA6ICouYzMtYi5jCisgMTogMy1iCisgMjogLmMKKyAgICAqLmMtYS5iLWMKKyAwOiAqLmMtYS5iLWMKKyAxOiAtYQorIDI6IC5iLWMKKyAzOiAtYworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgICouMAorTm8gbWF0Y2gKKyAgICAqLmEtCitObyBtYXRjaAorICAgICouYS1iLmMtCitObyBtYXRjaAorICAgICouYy1hLjAtYworTm8gbWF0Y2gKKworL15bMC05YS1mXShcLlswLTlhLWZdKSokL2kKKyAgICBhLmIuYy5kCisgMDogYS5iLmMuZAorIDE6IC5kCisgICAgQS5CLkMuRAorIDA6IEEuQi5DLkQKKyAxOiAuRAorICAgIGEuYi5jLjEuMi4zLkMKKyAwOiBhLmIuYy4xLjIuMy5DCisgMTogLkMKKworL14iLioiXHMqKDsuKik/JC8KKyAgICAiMTIzNCIKKyAwOiAiMTIzNCIKKyAgICAiYWJjZCIgOworIDA6ICJhYmNkIiA7CisgMTogOworICAgICIiIDsgcmh1YmFyYgorIDA6ICIiIDsgcmh1YmFyYgorIDE6IDsgcmh1YmFyYgorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgICIxMjM0IiA6IHRoaW5ncworTm8gbWF0Y2gKKworL14oYShiKGMpKSkoZChlKGYpKSkoaChpKGopKSkoayhsKG0pKSkkLworICAgIGFiY2RlZmhpamtsbQorIDA6IGFiY2RlZmhpamtsbQorIDE6IGFiYworIDI6IGJjCisgMzogYworIDQ6IGRlZgorIDU6IGVmCisgNjogZgorIDc6IGhpagorIDg6IGlqCisgOTogagorMTA6IGtsbQorMTE6IGxtCisxMjogbQorCisvXmEqXHcvCisgICAgegorIDA6IHoKKyAgICBhegorIDA6IGF6CisgICAgYWFhegorIDA6IGFhYXoKKyAgICBhCisgMDogYQorICAgIGFhCisgMDogYWEKKyAgICBhYWFhCisgMDogYWFhYQorICAgIGErCisgMDogYQorICAgIGFhKworIDA6IGFhCisKKy9eYStcdy8KKyAgICBhegorIDA6IGF6CisgICAgYWFhegorIDA6IGFhYXoKKyAgICBhYQorIDA6IGFhCisgICAgYWFhYQorIDA6IGFhYWEKKyAgICBhYSsKKyAwOiBhYQorCisvXlswLTldezh9XHd7Mix9LworICAgIDEyMzQ1Njc4OTAKKyAwOiAxMjM0NTY3ODkwCisgICAgMTIzNDU2NzhhYgorIDA6IDEyMzQ1Njc4YWIKKyAgICAxMjM0NTY3OF9fCisgMDogMTIzNDU2NzhfXworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIDEyMzQ1NjcKK05vIG1hdGNoCisKKy9eW2FlaW91MC05XXs0LDV9JC8KKyAgICB1b2llCisgMDogdW9pZQorICAgIDEyMzQKKyAwOiAxMjM0CisgICAgMTIzNDUKKyAwOiAxMjM0NQorICAgIGFhYWFhCisgMDogYWFhYWEKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICAxMjM0NTYKK05vIG1hdGNoCisKKy9cYChhYmN8ZGVmKT0oXDEpezIsM31cJy8KKyAgICBhYmM9YWJjYWJjCisgMDogYWJjPWFiY2FiYworIDE6IGFiYworIDI6IGFiYworICAgIGRlZj1kZWZkZWZkZWYKKyAwOiBkZWY9ZGVmZGVmZGVmCisgMTogZGVmCisgMjogZGVmCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWJjPWRlZmRlZgorTm8gbWF0Y2gKKworLyhjYXQoYShyYWN0fHRvbmljKXxlcnBpbGxhcikpIFwxKCkyKDMpLworICAgIGNhdGFyYWN0IGNhdGFyYWN0MjMKKyAwOiBjYXRhcmFjdCBjYXRhcmFjdDIzCisgMTogY2F0YXJhY3QKKyAyOiBhcmFjdAorIDM6IHJhY3QKKyA0OiAKKyA1OiAzCisgICAgY2F0YXRvbmljIGNhdGF0b25pYzIzCisgMDogY2F0YXRvbmljIGNhdGF0b25pYzIzCisgMTogY2F0YXRvbmljCisgMjogYXRvbmljCisgMzogdG9uaWMKKyA0OiAKKyA1OiAzCisgICAgY2F0ZXJwaWxsYXIgY2F0ZXJwaWxsYXIyMworIDA6IGNhdGVycGlsbGFyIGNhdGVycGlsbGFyMjMKKyAxOiBjYXRlcnBpbGxhcgorIDI6IGVycGlsbGFyCisgMzogPHVuc2V0PgorIDQ6IAorIDU6IDMKKworCisvXkZyb20gKyhbXiBdKykgK1thLXpBLVpdW2EtekEtWl1bYS16QS1aXSArW2EtekEtWl1bYS16QS1aXVthLXpBLVpdICtbMC05XT9bMC05XSArWzAtOV1bMC05XTpbMC05XVswLTldLworICAgIEZyb20gYWJjZCAgTW9uIFNlcCAwMSAxMjozMzowMiAxOTk3CisgMDogRnJvbSBhYmNkICBNb24gU2VwIDAxIDEyOjMzCisgMTogYWJjZAorCisvXkZyb21ccytcUytccysoW2EtekEtWl17M31ccyspezJ9WzAtOV17MSwyfVxzK1swLTldWzAtOV06WzAtOV1bMC05XS8KKyAgICBGcm9tIGFiY2QgIE1vbiBTZXAgMDEgMTI6MzM6MDIgMTk5NworIDA6IEZyb20gYWJjZCAgTW9uIFNlcCAwMSAxMjozMworIDE6IFNlcCAKKyAgICBGcm9tIGFiY2QgIE1vbiBTZXAgIDEgMTI6MzM6MDIgMTk5NworIDA6IEZyb20gYWJjZCAgTW9uIFNlcCAgMSAxMjozMworIDE6IFNlcCAgCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgRnJvbSBhYmNkICBTZXAgMDEgMTI6MzM6MDIgMTk5NworTm8gbWF0Y2gKKworL14oYSlcMXsyLDN9KC4pLworICAgIGFhYWIKKyAwOiBhYWFiCisgMTogYQorIDI6IGIKKyAgICBhYWFhYgorIDA6IGFhYWFiCisgMTogYQorIDI6IGIKKyAgICBhYWFhYWIKKyAwOiBhYWFhYQorIDE6IGEKKyAyOiBhCisgICAgYWFhYWFhYgorIDA6IGFhYWFhCisgMTogYQorIDI6IGEKKworL15bYWJdezEsM30oYWIqfGIpLworICAgIGFhYmJiYmIKKyAwOiBhYWJiYmJiCisgMTogYWJiYmJiCisKKy9eKGNvd3wpXDEoYmVsbCkvCisgICAgY293Y293YmVsbAorIDA6IGNvd2Nvd2JlbGwKKyAxOiBjb3cKKyAyOiBiZWxsCisgICAgYmVsbAorIDA6IGJlbGwKKyAxOiAKKyAyOiBiZWxsCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgY293YmVsbAorTm8gbWF0Y2gKKworL14oYXwpXDErYi8KKyAgICBhYWIKKyAwOiBhYWIKKyAxOiBhCisgICAgYWFhYWIKKyAwOiBhYWFhYgorIDE6IGEKKyAgICBiCisgMDogYgorIDE6IAorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiCitObyBtYXRjaAorCisvXihhfClcMXsyfWIvCisgICAgYWFhYgorIDA6IGFhYWIKKyAxOiBhCisgICAgYgorIDA6IGIKKyAxOiAKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYgorTm8gbWF0Y2gKKyAgICBhYWIKK05vIG1hdGNoCisgICAgYWFhYWIKK05vIG1hdGNoCisKKy9eKGF8KVwxezIsM31iLworICAgIGFhYWIKKyAwOiBhYWFiCisgMTogYQorICAgIGFhYWFiCisgMDogYWFhYWIKKyAxOiBhCisgICAgYgorIDA6IGIKKyAxOiAKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYgorTm8gbWF0Y2gKKyAgICBhYWIKK05vIG1hdGNoCisgICAgYWFhYWFiCitObyBtYXRjaAorCisvYWJ7MSwzfWJjLworICAgIGFiYmJiYworIDA6IGFiYmJiYworICAgIGFiYmJjCisgMDogYWJiYmMKKyAgICBhYmJjCisgMDogYWJiYworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiYworTm8gbWF0Y2gKKyAgICBhYmJiYmJjCitObyBtYXRjaAorCisvKFteLl0qKVwuKFteOl0qKTpbVCBdKyguKikvCisgICAgdHJhY2sxLnRpdGxlOlRCbGFoIGJsYWggYmxhaAorIDA6IHRyYWNrMS50aXRsZTpUQmxhaCBibGFoIGJsYWgKKyAxOiB0cmFjazEKKyAyOiB0aXRsZQorIDM6IEJsYWggYmxhaCBibGFoCisKKy8oW14uXSopXC4oW146XSopOltUIF0rKC4qKS9pCisgICAgdHJhY2sxLnRpdGxlOlRCbGFoIGJsYWggYmxhaAorIDA6IHRyYWNrMS50aXRsZTpUQmxhaCBibGFoIGJsYWgKKyAxOiB0cmFjazEKKyAyOiB0aXRsZQorIDM6IEJsYWggYmxhaCBibGFoCisKKy8oW14uXSopXC4oW146XSopOlt0IF0rKC4qKS9pCisgICAgdHJhY2sxLnRpdGxlOlRCbGFoIGJsYWggYmxhaAorIDA6IHRyYWNrMS50aXRsZTpUQmxhaCBibGFoIGJsYWgKKyAxOiB0cmFjazEKKyAyOiB0aXRsZQorIDM6IEJsYWggYmxhaCBibGFoCisKKy9eYWJjJC8KKyAgICBhYmMKKyAwOiBhYmMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKworL1stYXpdKy8KKyAgICBhei0KKyAwOiBhei0KKyAgICAqKiogRmFpbGVycworIDA6IGEKKyAgICBiCitObyBtYXRjaAorCisvW2F6LV0rLworICAgIHphLQorIDA6IHphLQorICAgICoqKiBGYWlsZXJzCisgMDogYQorICAgIGIKK05vIG1hdGNoCisKKy9bYS16XSsvCisgICAgYWJjZHh5egorIDA6IGFiY2R4eXoKKworL1swLTktXSsvCisgICAgMTItMzQKKyAwOiAxMi0zNAorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFhYQorTm8gbWF0Y2gKKworLyhhYmMpXDEvaQorICAgIGFiY2FiYworIDA6IGFiY2FiYworIDE6IGFiYworICAgIEFCQ2FiYworIDA6IEFCQ2FiYworIDE6IEFCQworICAgIGFiY0FCQworIDA6IGFiY0FCQworIDE6IGFiYworCisvYXswfWJjLworICAgIGJjCisgMDogYmMKKworL14oW15hXSkoW15iXSkoW15jXSopKFteZF17Myw0fSkvCisgICAgYmFOT1RjY2NjZAorIDA6IGJhTk9UY2NjYworIDE6IGIKKyAyOiBhCisgMzogTk9UCisgNDogY2NjYworICAgIGJhTk9UY2NjZAorIDA6IGJhTk9UY2NjCisgMTogYgorIDI6IGEKKyAzOiBOT1QKKyA0OiBjY2MKKyAgICBiYU5PVGNjZAorIDA6IGJhTk9UY2MKKyAxOiBiCisgMjogYQorIDM6IE5PCisgNDogVGNjCisgICAgYmFjY2NkCisgMDogYmFjY2MKKyAxOiBiCisgMjogYQorIDM6IAorIDQ6IGNjYworICAgICoqKiBGYWlsZXJzCisgMDogKioqIEZhaWxlcnMKKyAxOiAqCisgMjogKgorIDM6ICogRmFpbAorIDQ6IGVycworICAgIGFueXRoaW5nCitObyBtYXRjaAorICAgIGJhY2NkCitObyBtYXRjaAorCisvW15hXS8KKyAgICBBYmMKKyAwOiBBCisKKy9bXmFdL2kKKyAgICBBYmMgCisgMDogYgorCisvW15hXSsvCisgICAgQUFBYUFiYworIDA6IEFBQQorCisvW15hXSsvaQorICAgIEFBQWFBYmMKKyAwOiBiYworCisvW15rXSQvCisgICAgYWJjCisgMDogYworICAgICoqKiBGYWlsZXJzCisgMDogcworICAgIGFiaworTm8gbWF0Y2gKKworL1tea117MiwzfSQvCisgICAgYWJjCisgMDogYWJjCisgICAga2JjCisgMDogYmMKKyAgICBrYWJjCisgMDogYWJjCisgICAgKioqIEZhaWxlcnMKKyAwOiBlcnMKKyAgICBhYmsKK05vIG1hdGNoCisgICAgYWtiCitObyBtYXRjaAorICAgIGFrayAKK05vIG1hdGNoCisKKy9eWzAtOV17OCx9QC4rW15rXSQvCisgIC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WzpkaWdpdDpdXVwvW1s6ZGlnaXQ6XV1bWzpkaWdpdDpdXVwvW1s6ZGlnaXQ6XV1bWzpkaWdpdDpdXVtbOmRpZ2l0Ol1dW1s6ZGlnaXQ6XV0vCisgICAgMDEvMDEvMjAwMAorIDA6IDAxLzAxLzIwMDAKKworL14oYSl7MCwwfS8KKyAgICBiY2QKKyAwOiAKKyAgICBhYmMKKyAwOiAKKyAgICBhYWIgICAgIAorIDA6IAorCisvXihhKXswLDF9LworICAgIGJjZAorIDA6IAorICAgIGFiYworIDA6IGEKKyAxOiBhCisgICAgYWFiICAKKyAwOiBhCisgMTogYQorCisvXihhKXswLDJ9LworICAgIGJjZAorIDA6IAorICAgIGFiYworIDA6IGEKKyAxOiBhCisgICAgYWFiICAKKyAwOiBhYQorIDE6IGEKKworL14oYSl7MCwzfS8KKyAgICBiY2QKKyAwOiAKKyAgICBhYmMKKyAwOiBhCisgMTogYQorICAgIGFhYgorIDA6IGFhCisgMTogYQorICAgIGFhYSAgIAorIDA6IGFhYQorIDE6IGEKKworL14oYSl7MCx9LworICAgIGJjZAorIDA6IAorICAgIGFiYworIDA6IGEKKyAxOiBhCisgICAgYWFiCisgMDogYWEKKyAxOiBhCisgICAgYWFhCisgMDogYWFhCisgMTogYQorICAgIGFhYWFhYWFhICAgIAorIDA6IGFhYWFhYWFhCisgMTogYQorCisvXihhKXsxLDF9LworICAgIGJjZAorTm8gbWF0Y2gKKyAgICBhYmMKKyAwOiBhCisgMTogYQorICAgIGFhYiAgCisgMDogYQorIDE6IGEKKworL14oYSl7MSwyfS8KKyAgICBiY2QKK05vIG1hdGNoCisgICAgYWJjCisgMDogYQorIDE6IGEKKyAgICBhYWIgIAorIDA6IGFhCisgMTogYQorCisvXihhKXsxLDN9LworICAgIGJjZAorTm8gbWF0Y2gKKyAgICBhYmMKKyAwOiBhCisgMTogYQorICAgIGFhYgorIDA6IGFhCisgMTogYQorICAgIGFhYSAgIAorIDA6IGFhYQorIDE6IGEKKworL14oYSl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bGVycworTm8gbWF0Y2gKKyAgICBhYmNkZSAKK05vIG1hdGNoCisgICAgCisvYWIoYyl7MCwwfWQvCisgICAgYWJkCisgMDogYWJkCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWJjZCAgIAorTm8gbWF0Y2gKKworL2EoYiopLworICAgIGEKKyAwOiBhCisgMTogCisgICAgYWIKKyAwOiBhYgorIDE6IGIKKyAgICBhYmJiYgorIDA6IGFiYmJiCisgMTogYmJiYgorICAgICoqKiBGYWlsZXJzCisgMDogYQorIDE6IAorICAgIGJiYmJiICAgIAorTm8gbWF0Y2gKKyAgICAKKy9hYlswLTldezB9ZS8KKyAgICBhYmUKKyAwOiBhYmUKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYjFlICAgCitObyBtYXRjaAorICAgIAorLyhBfEIpKkNELworICAgIENEIAorIDA6IENECisKKy8oQUIpKlwxLworICAgIEFCQUJBQgorIDA6IEFCQUJBQgorIDE6IEFCCisgICAgCisvKFswLTldKykoXHcpLworICAgIDEyMzQ1YQorIDA6IDEyMzQ1YQorIDE6IDEyMzQ1CisgMjogYQorICAgIDEyMzQ1KyAKKyAwOiAxMjM0NQorIDE6IDEyMzQKKyAyOiA1CisKKy8oYWJjfCkrLworICAgIGFiYworIDA6IGFiYworIDE6IGFiYworICAgIGFiY2FiYworIDA6IGFiY2FiYworIDE6IGFiYworICAgIGFiY2FiY2FiYworIDA6IGFiY2FiY2FiYworIDE6IGFiYworICAgIHh5eiAgICAgIAorIDA6IAorIDE6IAorCisvKFthXSopKi8KKyAgICBhCisgMDogYQorIDE6IGEKKyAgICBhYWFhYSAKKyAwOiBhYWFhYQorIDE6IGFhYWFhCisKKy8oW2FiXSopKi8KKyAgICBhCisgMDogYQorIDE6IGEKKyAgICBiCisgMDogYgorIDE6IGIKKyAgICBhYmFiYWIKKyAwOiBhYmFiYWIKKyAxOiBhYmFiYWIKKyAgICBhYWFhYmNkZQorIDA6IGFhYWFiCisgMTogYWFhYWIKKyAgICBiYmJiICAgIAorIDA6IGJiYmIKKyAxOiBiYmJiCisKKy8oW15hXSopKi8KKyAgICBiCisgMDogYgorIDE6IGIKKyAgICBiYmJiCisgMDogYmJiYgorIDE6IGJiYmIKKyAgICBhYWEgICAKKyAwOiAKKworLyhbXmFiXSopKi8KKyAgICBjY2NjCisgMDogY2NjYworIDE6IGNjY2MKKyAgICBhYmFiICAKKyAwOiAKKworL2FiYy8KKyAgICBhYmMKKyAwOiBhYmMKKyAgICB4YWJjeQorIDA6IGFiYworICAgIGFiYWJjCisgMDogYWJjCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgeGJjCitObyBtYXRjaAorICAgIGF4YworTm8gbWF0Y2gKKyAgICBhYngKK05vIG1hdGNoCisKKy9hYipjLworICAgIGFiYworIDA6IGFiYworCisvYWIqYmMvCisgICAgYWJjCisgMDogYWJjCisgICAgYWJiYworIDA6IGFiYmMKKyAgICBhYmJiYmMKKyAwOiBhYmJiYmMKKworLy57MX0vCisgICAgYWJiYmJjCisgMDogYQorCisvLnszLDR9LworICAgIGFiYmJiYworIDA6IGFiYmIKKworL2FiezAsfWJjLworICAgIGFiYmJiYworIDA6IGFiYmJiYworCisvYWIrYmMvCisgICAgYWJiYworIDA6IGFiYmMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYmMKK05vIG1hdGNoCisgICAgYWJxCitObyBtYXRjaAorCisvYWIrYmMvCisgICAgYWJiYmJjCisgMDogYWJiYmJjCisKKy9hYnsxLH1iYy8KKyAgICBhYmJiYmMKKyAwOiBhYmJiYmMKKworL2FiezEsM31iYy8KKyAgICBhYmJiYmMKKyAwOiBhYmJiYmMKKworL2FiezMsNH1iYy8KKyAgICBhYmJiYmMKKyAwOiBhYmJiYmMKKworL2FiezQsNX1iYy8KKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYnEKK05vIG1hdGNoCisgICAgYWJiYmJjCitObyBtYXRjaAorCisvYWI/YmMvCisgICAgYWJiYworIDA6IGFiYmMKKyAgICBhYmMKKyAwOiBhYmMKKworL2FiezAsMX1iYy8KKyAgICBhYmMKKyAwOiBhYmMKKworL2FiP2MvCisgICAgYWJjCisgMDogYWJjCisKKy9hYnswLDF9Yy8KKyAgICBhYmMKKyAwOiBhYmMKKworL15hYmMkLworICAgIGFiYworIDA6IGFiYworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiYmJiYworTm8gbWF0Y2gKKyAgICBhYmNjCitObyBtYXRjaAorCisvXmFiYy8KKyAgICBhYmNjCisgMDogYWJjCisKKy9hYmMkLworICAgIGFhYmMKKyAwOiBhYmMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYWJjCisgMDogYWJjCisgICAgYWFiY2QKK05vIG1hdGNoCisKKy9eLworICAgIGFiYworIDA6IAorCisvJC8KKyAgICBhYmMKKyAwOiAKKworL2EuYy8KKyAgICBhYmMKKyAwOiBhYmMKKyAgICBheGMKKyAwOiBheGMKKworL2EuKmMvCisgICAgYXh5emMKKyAwOiBheHl6YworCisvYVtiY11kLworICAgIGFiZAorIDA6IGFiZAorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGF4eXpkCitObyBtYXRjaAorICAgIGFiYworTm8gbWF0Y2gKKworL2FbYi1kXWUvCisgICAgYWNlCisgMDogYWNlCisKKy9hW2ItZF0vCisgICAgYWFjCisgMDogYWMKKworL2FbLWJdLworICAgIGEtCisgMDogYS0KKworL2FbYi1dLworICAgIGEtCisgMDogYS0KKworL2FbXV1iLworICAgIGFdYgorIDA6IGFdYgorCisvYVteYmNdZC8KKyAgICBhZWQKKyAwOiBhZWQKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYmQKK05vIG1hdGNoCisgICAgYWJkCitObyBtYXRjaAorCisvYVteLWJdYy8KKyAgICBhZGMKKyAwOiBhZGMKKworL2FbXl1iXWMvCisgICAgYWRjCisgMDogYWRjCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYS1jCisgMDogYS1jCisgICAgYV1jCitObyBtYXRjaAorCisvXGJhXGIvCisgICAgYS0KKyAwOiBhCisgICAgLWEKKyAwOiBhCisgICAgLWEtCisgMDogYQorCisvXGJ5XGIvCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgeHkKK05vIG1hdGNoCisgICAgeXoKK05vIG1hdGNoCisgICAgeHl6CitObyBtYXRjaAorCisvXEJhXEIvCisgICAgKioqIEZhaWxlcnMKKyAwOiBhCisgICAgYS0KK05vIG1hdGNoCisgICAgLWEKK05vIG1hdGNoCisgICAgLWEtCitObyBtYXRjaAorCisvXEJ5XGIvCisgICAgeHkKKyAwOiB5CisKKy9cYnlcQi8KKyAgICB5egorIDA6IHkKKworL1xCeVxCLworICAgIHh5egorIDA6IHkKKworL1x3LworICAgIGEKKyAwOiBhCisKKy9cVy8KKyAgICAtCisgMDogLQorICAgICoqKiBGYWlsZXJzCisgMDogKgorICAgIC0KKyAwOiAtCisgICAgYQorTm8gbWF0Y2gKKworL2Fcc2IvCisgICAgYSBiCisgMDogYSBiCisKKy9hXFNiLworICAgIGEtYgorIDA6IGEtYgorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGEtYgorIDA6IGEtYgorICAgIGEgYgorTm8gbWF0Y2gKKworL1swLTldLworICAgIDEKKyAwOiAxCisKKy9bXjAtOV0vCisgICAgLQorIDA6IC0KKyAgICAqKiogRmFpbGVycworIDA6ICoKKyAgICAtCisgMDogLQorICAgIDEKK05vIG1hdGNoCisKKy9hYnxjZC8KKyAgICBhYmMKKyAwOiBhYgorICAgIGFiY2QKKyAwOiBhYgorCisvKCllZi8KKyAgICBkZWYKKyAwOiBlZgorIDE6IAorCisvYVwoYi8KKyAgICBhKGIKKyAwOiBhKGIKKworL2FcKCpiLworICAgIGFiCisgMDogYWIKKyAgICBhKChiCisgMDogYSgoYgorCisvKChhKSkvCisgICAgYWJjCisgMDogYQorIDE6IGEKKyAyOiBhCisKKy8oYSliKGMpLworICAgIGFiYworIDA6IGFiYworIDE6IGEKKyAyOiBjCisKKy9hK2IrYy8KKyAgICBhYWJiYWJjCisgMDogYWJjCisKKy9hezEsfWJ7MSx9Yy8KKyAgICBhYWJiYWJjCisgMDogYWJjCisKKy8oYSt8YikqLworICAgIGFiCisgMDogYWIKKyAxOiBiCisKKy8oYSt8Yil7MCx9LworICAgIGFiCisgMDogYWIKKyAxOiBiCisKKy8oYSt8YikrLworICAgIGFiCisgMDogYWIKKyAxOiBiCisKKy8oYSt8Yil7MSx9LworICAgIGFiCisgMDogYWIKKyAxOiBiCisKKy8oYSt8Yik/LworICAgIGFiCisgMDogYQorIDE6IGEKKworLyhhK3xiKXswLDF9LworICAgIGFiCisgMDogYQorIDE6IGEKKworL1teYWJdKi8KKyAgICBjZGUKKyAwOiBjZGUKKworL2FiYy8KKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBiCitObyBtYXRjaAorICAgIAorCisvYSovCisgICAgCisKKy8oW2FiY10pKmQvCisgICAgYWJiYmNkCisgMDogYWJiYmNkCisgMTogYworCisvKFthYmNdKSpiY2QvCisgICAgYWJjZAorIDA6IGFiY2QKKyAxOiBhCisKKy9hfGJ8Y3xkfGUvCisgICAgZQorIDA6IGUKKworLyhhfGJ8Y3xkfGUpZi8KKyAgICBlZgorIDA6IGVmCisgMTogZQorCisvYWJjZCplZmcvCisgICAgYWJjZGVmZworIDA6IGFiY2RlZmcKKworL2FiKi8KKyAgICB4YWJ5YWJiYnoKKyAwOiBhYgorICAgIHhheWFiYmJ6CisgMDogYQorCisvKGFifGNkKWUvCisgICAgYWJjZGUKKyAwOiBjZGUKKyAxOiBjZAorCisvW2FiaGdlZmRjXWlqLworICAgIGhpagorIDA6IGhpagorCisvKGFiY3wpZWYvCisgICAgYWJjZGVmCisgMDogZWYKKyAxOiAKKworLyhhfGIpYypkLworICAgIGFiY2QKKyAwOiBiY2QKKyAxOiBiCisKKy8oYWJ8YWIqKWJjLworICAgIGFiYworIDA6IGFiYworIDE6IGEKKworL2EoW2JjXSopYyovCisgICAgYWJjCisgMDogYWJjCisgMTogYmMKKworL2EoW2JjXSopKGMqZCkvCisgICAgYWJjZAorIDA6IGFiY2QKKyAxOiBiYworIDI6IGQKKworL2EoW2JjXSspKGMqZCkvCisgICAgYWJjZAorIDA6IGFiY2QKKyAxOiBiYworIDI6IGQKKworL2EoW2JjXSopKGMrZCkvCisgICAgYWJjZAorIDA6IGFiY2QKKyAxOiBiCisgMjogY2QKKworL2FbYmNkXSpkY2RjZGUvCisgICAgYWRjZGNkZQorIDA6IGFkY2RjZGUKKworL2FbYmNkXStkY2RjZGUvCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWJjZGUKK05vIG1hdGNoCisgICAgYWRjZGNkZQorTm8gbWF0Y2gKKworLyhhYnxhKWIqYy8KKyAgICBhYmMKKyAwOiBhYmMKKyAxOiBhYgorCisvKChhKShiKWMpKGQpLworICAgIGFiY2QKKyAwOiBhYmNkCisgMTogYWJjCisgMjogYQorIDM6IGIKKyA0OiBkCisKKy9bYS16QS1aX11bYS16QS1aMC05X10qLworICAgIGFscGhhCisgMDogYWxwaGEKKworL15hKGJjK3xiW2VoXSlnfC5oJC8KKyAgICBhYmgKKyAwOiBiaAorCisvKGJjK2QkfGVmKmcufGg/aShqfGspKS8KKyAgICBlZmZnegorIDA6IGVmZmd6CisgMTogZWZmZ3oKKyAgICBpagorIDA6IGlqCisgMTogaWoKKyAyOiBqCisgICAgcmVmZmd6CisgMDogZWZmZ3oKKyAxOiBlZmZnegorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGVmZmcKK05vIG1hdGNoCisgICAgYmNkZAorTm8gbWF0Y2gKKworLygoKCgoKCgoKChhKSkpKSkpKSkpKS8KKyAgICBhCisgMDogYQorIDE6IGEKKyAyOiBhCisgMzogYQorIDQ6IGEKKyA1OiBhCisgNjogYQorIDc6IGEKKyA4OiBhCisgOTogYQorMTA6IGEKKworLygoKCgoKCgoKChhKSkpKSkpKSkpKVw5LworICAgIGFhCisgMDogYWEKKyAxOiBhCisgMjogYQorIDM6IGEKKyA0OiBhCisgNTogYQorIDY6IGEKKyA3OiBhCisgODogYQorIDk6IGEKKzEwOiBhCisKKy8oKCgoKCgoKChhKSkpKSkpKSkpLworICAgIGEKKyAwOiBhCisgMTogYQorIDI6IGEKKyAzOiBhCisgNDogYQorIDU6IGEKKyA2OiBhCisgNzogYQorIDg6IGEKKyA5OiBhCisKKy9tdWx0aXBsZSB3b3JkcyBvZiB0ZXh0LworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFhCitObyBtYXRjaAorICAgIHVoLXVoCitObyBtYXRjaAorCisvbXVsdGlwbGUgd29yZHMvCisgICAgbXVsdGlwbGUgd29yZHMsIHllYWgKKyAwOiBtdWx0aXBsZSB3b3JkcworCisvKC4qKWMoLiopLworICAgIGFiY2RlCisgMDogYWJjZGUKKyAxOiBhYgorIDI6IGRlCisKKy9cKCguKiksICguKilcKS8KKyAgICAoYSwgYikKKyAwOiAoYSwgYikKKyAxOiBhCisgMjogYgorCisvYWJjZC8KKyAgICBhYmNkCisgMDogYWJjZAorCisvYShiYylkLworICAgIGFiY2QKKyAwOiBhYmNkCisgMTogYmMKKworL2FbLV0/Yy8KKyAgICBhYworIDA6IGFjCisKKy8oYWJjKVwxLworICAgIGFiY2FiYworIDA6IGFiY2FiYworIDE6IGFiYworCisvKFthLWNdKilcMS8KKyAgICBhYmNhYmMKKyAwOiBhYmNhYmMKKyAxOiBhYmMKKworLyhhKXxcMS8KKyAgICBhCisgMDogYQorIDE6IGEKKyAgICAqKiogRmFpbGVycworIDA6IGEKKyAxOiBhCisgICAgYWIKKyAwOiBhCisgMTogYQorICAgIHgKK05vIG1hdGNoCisKKy9hYmMvaQorICAgIEFCQworIDA6IEFCQworICAgIFhBQkNZCisgMDogQUJDCisgICAgQUJBQkMKKyAwOiBBQkMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYXhhYnhiYXhiYngKK05vIG1hdGNoCisgICAgWEJDCitObyBtYXRjaAorICAgIEFYQworTm8gbWF0Y2gKKyAgICBBQlgKK05vIG1hdGNoCisKKy9hYipjL2kKKyAgICBBQkMKKyAwOiBBQkMKKworL2FiKmJjL2kKKyAgICBBQkMKKyAwOiBBQkMKKyAgICBBQkJDCisgMDogQUJCQworCisvYWIrYmMvaQorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIEFCQworTm8gbWF0Y2gKKyAgICBBQlEKK05vIG1hdGNoCisKKy9hYitiYy9pCisgICAgQUJCQkJDCisgMDogQUJCQkJDCisKKy9eYWJjJC9pCisgICAgQUJDCisgMDogQUJDCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgQUJCQkJDCitObyBtYXRjaAorICAgIEFCQ0MKK05vIG1hdGNoCisKKy9eYWJjL2kKKyAgICBBQkNDCisgMDogQUJDCisKKy9hYmMkL2kKKyAgICBBQUJDCisgMDogQUJDCisKKy9eL2kKKyAgICBBQkMKKyAwOiAKKworLyQvaQorICAgIEFCQworIDA6IAorCisvYS5jL2kKKyAgICBBQkMKKyAwOiBBQkMKKyAgICBBWEMKKyAwOiBBWEMKKworL2EuKmMvaQorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIEFBQkMKKyAwOiBBQUJDCisgICAgQVhZWkQKK05vIG1hdGNoCisKKy9hW2JjXWQvaQorICAgIEFCRAorIDA6IEFCRAorCisvYVtiLWRdZS9pCisgICAgQUNFCisgMDogQUNFCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgQUJDCitObyBtYXRjaAorICAgIEFCRAorTm8gbWF0Y2gKKworL2FbYi1kXS9pCisgICAgQUFDCisgMDogQUMKKworL2FbLWJdL2kKKyAgICBBLQorIDA6IEEtCisKKy9hW2ItXS9pCisgICAgQS0KKyAwOiBBLQorCisvYVtdXWIvaQorICAgIEFdQgorIDA6IEFdQgorCisvYVteYmNdZC9pCisgICAgQUVECisgMDogQUVECisKKy9hW14tYl1jL2kKKyAgICBBREMKKyAwOiBBREMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBBQkQKK05vIG1hdGNoCisgICAgQS1DCitObyBtYXRjaAorCisvYVteXWJdYy9pCisgICAgQURDCisgMDogQURDCisKKy9hYnxjZC9pCisgICAgQUJDCisgMDogQUIKKyAgICBBQkNECisgMDogQUIKKworLygpZWYvaQorICAgIERFRgorIDA6IEVGCisgMTogCisKKy8kYi9pCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgQV1DCitObyBtYXRjaAorICAgIEIKK05vIG1hdGNoCisKKy9hXChiL2kKKyAgICBBKEIKKyAwOiBBKEIKKworL2FcKCpiL2kKKyAgICBBQgorIDA6IEFCCisgICAgQSgoQgorIDA6IEEoKEIKKworLygoYSkpL2kKKyAgICBBQkMKKyAwOiBBCisgMTogQQorIDI6IEEKKworLyhhKWIoYykvaQorICAgIEFCQworIDA6IEFCQworIDE6IEEKKyAyOiBDCisKKy9hK2IrYy9pCisgICAgQUFCQkFCQworIDA6IEFCQworCisvYXsxLH1iezEsfWMvaQorICAgIEFBQkJBQkMKKyAwOiBBQkMKKworLyhhK3xiKSovaQorICAgIEFCCisgMDogQUIKKyAxOiBCCisKKy8oYSt8Yil7MCx9L2kKKyAgICBBQgorIDA6IEFCCisgMTogQgorCisvKGErfGIpKy9pCisgICAgQUIKKyAwOiBBQgorIDE6IEIKKworLyhhK3xiKXsxLH0vaQorICAgIEFCCisgMDogQUIKKyAxOiBCCisKKy8oYSt8Yik/L2kKKyAgICBBQgorIDA6IEEKKyAxOiBBCisKKy8oYSt8Yil7MCwxfS9pCisgICAgQUIKKyAwOiBBCisgMTogQQorCisvW15hYl0qL2kKKyAgICBDREUKKyAwOiBDREUKKworLyhbYWJjXSkqZC9pCisgICAgQUJCQkNECisgMDogQUJCQkNECisgMTogQworCisvKFthYmNdKSpiY2QvaQorICAgIEFCQ0QKKyAwOiBBQkNECisgMTogQQorCisvYXxifGN8ZHxlL2kKKyAgICBFCisgMDogRQorCisvKGF8YnxjfGR8ZSlmL2kKKyAgICBFRgorIDA6IEVGCisgMTogRQorCisvYWJjZCplZmcvaQorICAgIEFCQ0RFRkcKKyAwOiBBQkNERUZHCisKKy9hYiovaQorICAgIFhBQllBQkJCWgorIDA6IEFCCisgICAgWEFZQUJCQloKKyAwOiBBCisKKy8oYWJ8Y2QpZS9pCisgICAgQUJDREUKKyAwOiBDREUKKyAxOiBDRAorCisvW2FiaGdlZmRjXWlqL2kKKyAgICBISUoKKyAwOiBISUoKKworL14oYWJ8Y2QpZS9pCisgICAgQUJDREUKK05vIG1hdGNoCisKKy8oYWJjfCllZi9pCisgICAgQUJDREVGCisgMDogRUYKKyAxOiAKKworLyhhfGIpYypkL2kKKyAgICBBQkNECisgMDogQkNECisgMTogQgorCisvKGFifGFiKiliYy9pCisgICAgQUJDCisgMDogQUJDCisgMTogQQorCisvYShbYmNdKiljKi9pCisgICAgQUJDCisgMDogQUJDCisgMTogQkMKKworL2EoW2JjXSopKGMqZCkvaQorICAgIEFCQ0QKKyAwOiBBQkNECisgMTogQkMKKyAyOiBECisKKy9hKFtiY10rKShjKmQpL2kKKyAgICBBQkNECisgMDogQUJDRAorIDE6IEJDCisgMjogRAorCisvYShbYmNdKikoYytkKS9pCisgICAgQUJDRAorIDA6IEFCQ0QKKyAxOiBCCisgMjogQ0QKKworL2FbYmNkXSpkY2RjZGUvaQorICAgIEFEQ0RDREUKKyAwOiBBRENEQ0RFCisKKy9hW2JjZF0rZGNkY2RlL2kKKworLyhhYnxhKWIqYy9pCisgICAgQUJDCisgMDogQUJDCisgMTogQUIKKworLygoYSkoYiljKShkKS9pCisgICAgQUJDRAorIDA6IEFCQ0QKKyAxOiBBQkMKKyAyOiBBCisgMzogQgorIDQ6IEQKKworL1thLXpBLVpfXVthLXpBLVowLTlfXSovaQorICAgIEFMUEhBCisgMDogQUxQSEEKKworL15hKGJjK3xiW2VoXSlnfC5oJC9pCisgICAgQUJICisgMDogQkgKKworLyhiYytkJHxlZipnLnxoP2koanxrKSkvaQorICAgIEVGRkdaCisgMDogRUZGR1oKKyAxOiBFRkZHWgorICAgIElKCisgMDogSUoKKyAxOiBJSgorIDI6IEoKKyAgICBSRUZGR1oKKyAwOiBFRkZHWgorIDE6IEVGRkdaCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgQURDRENERQorTm8gbWF0Y2gKKyAgICBFRkZHCitObyBtYXRjaAorICAgIEJDREQKK05vIG1hdGNoCisKKy8oKCgoKCgoKCgoYSkpKSkpKSkpKSkvaQorICAgIEEKKyAwOiBBCisgMTogQQorIDI6IEEKKyAzOiBBCisgNDogQQorIDU6IEEKKyA2OiBBCisgNzogQQorIDg6IEEKKyA5OiBBCisxMDogQQorCisvKCgoKCgoKCgoKGEpKSkpKSkpKSkpXDkvaQorICAgIEFBCisgMDogQUEKKyAxOiBBCisgMjogQQorIDM6IEEKKyA0OiBBCisgNTogQQorIDY6IEEKKyA3OiBBCisgODogQQorIDk6IEEKKzEwOiBBCisKKy8oKCgoKCgoKChhKSkpKSkpKSkpL2kKKyAgICBBCisgMDogQQorIDE6IEEKKyAyOiBBCisgMzogQQorIDQ6IEEKKyA1OiBBCisgNjogQQorIDc6IEEKKyA4OiBBCisgOTogQQorCisvbXVsdGlwbGUgd29yZHMgb2YgdGV4dC9pCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgQUEKK05vIG1hdGNoCisgICAgVUgtVUgKK05vIG1hdGNoCisKKy9tdWx0aXBsZSB3b3Jkcy9pCisgICAgTVVMVElQTEUgV09SRFMsIFlFQUgKKyAwOiBNVUxUSVBMRSBXT1JEUworCisvKC4qKWMoLiopL2kKKyAgICBBQkNERQorIDA6IEFCQ0RFCisgMTogQUIKKyAyOiBERQorCisvXCgoLiopLCAoLiopXCkvaQorICAgIChBLCBCKQorIDA6IChBLCBCKQorIDE6IEEKKyAyOiBCCisKKy9hYmNkL2kKKyAgICBBQkNECisgMDogQUJDRAorCisvYShiYylkL2kKKyAgICBBQkNECisgMDogQUJDRAorIDE6IEJDCisKKy9hWy1dP2MvaQorICAgIEFDCisgMDogQUMKKworLyhhYmMpXDEvaQorICAgIEFCQ0FCQworIDA6IEFCQ0FCQworIDE6IEFCQworCisvKFthLWNdKilcMS9pCisgICAgQUJDQUJDCisgMDogQUJDQUJDCisgMTogQUJDCisKKy8oKGZvbyl8KGJhcikpKi8KKyAgICBmb29iYXIKKyAwOiBmb29iYXIKKyAxOiBiYXIKKyAyOiBmb28KKyAzOiBiYXIKKworL14oLispP0IvCisgICAgQUIKKyAwOiBBQgorIDE6IEEKKworL14oW15hLXpdKXwoXF4pJC8KKyAgICAuCisgMDogLgorIDE6IC4KKworL15bPD5dJi8KKyAgICA8Jk9VVAorIDA6IDwmCisKKy9eKCl7Myw1fS8KKyAgICBhYmMKKyAwOiAKKyAxOiAKKworL14oYSspKmF4LworICAgIGFheAorIDA6IGFheAorIDE6IGEKKworL14oKGF8YikrKSpheC8KKyAgICBhYXgKKyAwOiBhYXgKKyAxOiBhCisgMjogYQorCisvXigoYXxiYykrKSpheC8KKyAgICBhYXgKKyAwOiBhYXgKKyAxOiBhCisgMjogYQorCisvKGF8eCkqYWIvCisgICAgY2FiCisgMDogYWIKKworLyhhKSphYi8KKyAgICBjYWIKKyAwOiBhYgorCisvKGFiKVswLTldXDEvaQorICAgIEFiNGFiCisgMDogQWI0YWIKKyAxOiBBYgorICAgIGFiNEFiCisgMDogYWI0QWIKKyAxOiBhYgorCisvZm9vXHcqWzAtOV17NH1iYXovCisgICAgZm9vYmFyMTIzNGJhegorIDA6IGZvb2JhcjEyMzRiYXoKKworLyhcdys6KSsvCisgICAgb25lOgorIDA6IG9uZToKKyAxOiBvbmU6CisKKy8oKFx3fDopKzo6KT8oXHcrKSQvCisgICAgYWJjZAorIDA6IGFiY2QKKyAxOiA8dW5zZXQ+CisgMjogPHVuc2V0PgorIDM6IGFiY2QKKyAgICB4eTp6Ojo6YWJjZAorIDA6IHh5Ono6OjphYmNkCisgMTogeHk6ejo6OgorIDI6IDoKKyAzOiBhYmNkCisKKy9eW15iY2RdKihjKykvCisgICAgYWV4eWNkCisgMDogYWV4eWMKKyAxOiBjCisKKy8oYSopYisvCisgICAgY2FhYgorIDA6IGFhYgorIDE6IGFhCisKKy8oKFx3fDopKzo6KT8oXHcrKSQvCisgICAgYWJjZAorIDA6IGFiY2QKKyAxOiA8dW5zZXQ+CisgMjogPHVuc2V0PgorIDM6IGFiY2QKKyAgICB4eTp6Ojo6YWJjZAorIDA6IHh5Ono6OjphYmNkCisgMTogeHk6ejo6OgorIDI6IDoKKyAzOiBhYmNkCisgICAgKioqIEZhaWxlcnMKKyAwOiBGYWlsZXJzCisgMTogPHVuc2V0PgorIDI6IDx1bnNldD4KKyAzOiBGYWlsZXJzCisgICAgYWJjZDoKK05vIG1hdGNoCisgICAgYWJjZDoKK05vIG1hdGNoCisKKy9eW15iY2RdKihjKykvCisgICAgYWV4eWNkCisgMDogYWV4eWMKKyAxOiBjCisKKy8oKFopK3xBKSovCisgICAgWkFCQ0RFRkcKKyAwOiBaQQorIDE6IEEKKyAyOiBaCisKKy8oWigpfEEpKi8KKyAgICBaQUJDREVGRworIDA6IFpBCisgMTogQQorIDI6IAorCisvKFooKCkpfEEpKi8KKyAgICBaQUJDREVGRworIDA6IFpBCisgMTogQQorIDI6IAorIDM6IAorCisvKC4qKVswLTldK1wxLworICAgIGFiYzEyM2FiYworIDA6IGFiYzEyM2FiYworIDE6IGFiYworICAgIGFiYzEyM2JjIAorIDA6IGJjMTIzYmMKKyAxOiBiYworCisvKCguKikpWzAtOV0rXDEvCisgICAgYWJjMTIzYWJjCisgMDogYWJjMTIzYWJjCisgMTogYWJjCisgMjogYWJjCisgICAgYWJjMTIzYmMgIAorIDA6IGJjMTIzYmMKKyAxOiBiYworIDI6IGJjCisKKy9eYXsyLDV9JC8KKy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mxlbiIsCisgICJtYnN0b3djcyIsICJtYnRvd2MiLCAicXNvcnQiLCAicmFuZCIsICJyYW5kX3IiLCAicmVhbGxvYyIsICJzcmFuZCIsCisgICJzdHJ0b2QiLCAic3RydG9sIiwgInN0cnRvdWwiLCAic3lzdGVtIiwgIndjc3RvbWJzIiwgIndjdG9tYiIKK307CisKKy8qIDxzdHJpbmcuaD4uICAqLworc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IHN0cmluZ19zeW1zW10gPQoreworICAiTlVMTCIKK307CitzdGF0aWMgY29uc3QgY2hhciAqY29uc3Qgc3RyaW5nX21heWJlW10gPQoreworICAibWVtY2hyIiwgIm1lbWNtcCIsICJtZW1jcHkiLCAibWVtbW92ZSIsICJtZW1zZXQiLCAic3RyY2F0IiwgInN0cmNociIsCisgICJzdHJjbXAiLCAic3RyY29sbCIsICJzdHJjcHkiLCAic3RyY3NwbiIsICJzdHJlcnJvciIsICJzdHJsZW4iLAorICAic3RybmNhdCIsICJzdHJuY21wIiwgInN0cm5jcHkiLCAic3RycGJyayIsICJzdHJyY2hyIiwgInN0cnNwbiIsCisgICJzdHJzdHIiLCAic3RydG9rIiwgInN0cnRva19yIiwgInN0cnhmcm0iCit9OworCisvKiA8c3lzL21tYW4uaD4uICAqLworc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IG1tYW5fc3ltc1tdID0KK3sKKyAgIk1BUF9GQUlMRUQiLCAiTUFQX0ZJWEVEIiwgIk1BUF9QUklWQVRFIiwgIk1BUF9TSEFSRUQiLCAiTUNMX0NVUlJFTlQiLAorICAiTUNMX0ZVVFVSRSIsICJNU19BU1lOQyIsICJNU19JTlZBTElEQVRFIiwgIk1TX1NZTkMiLCAiUFJPVF9FWEVDIiwKKyAgIlBST1RfTk9ORSIsICJQUk9UX1JFQUQiLCAiUFJPVF9XUklURSIKK307CitzdGF0aWMgY29uc3QgY2hhciAqY29uc3QgbW1hbl9tYXliZVtdID0KK3sKKyAgIm1sb2NrIiwgIm1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WFkZXIKK3sKKyAgY29uc3QgY2hhciAqbmFtZTsKKyAgY29uc3QgY2hhciAqY29uc3QgKnN5bXM7CisgIHNpemVfdCBuc3ltczsKKyAgY29uc3QgY2hhciAqY29uc3QgKm1heWJlOworICBzaXplX3Qgbm1heWJlOworICBjb25zdCBjaGFyICpzdWJzZXQ7Cit9IGhlYWRlcnNbXSA9Cit7CisjZGVmaW5lIEgobikgXAorICB7ICNuICIuaCIsIG4jI19zeW1zLCBzaXplb2YgKG4jI19zeW1zKSAvIHNpemVvZiAobiMjX3N5bXNbMF0pLCBcCisgICAgbiMjX21heWJlLCBzaXplb2YgKG4jI19tYXliZSkgLyBzaXplb2YgKG4jI19tYXliZVswXSksIE5VTEwgfQorI2RlZmluZSBIYyhuLCBzKSBcCisgIHsgI24gIi5oIiwgbiMjX3N5bXMsIHNpemVvZiAobiMjX3N5bXMpIC8gc2l6ZW9mIChuIyNfc3ltc1swXSksIFwKKyAgICBuIyNfbWF5YmUsIHNpemVvZiAobiMjX21heWJlKSAvIHNpemVvZiAobiMjX21heWJlWzBdKSwgcyB9CisjZGVmaW5lIEhzKG4pIFwKKyAgeyAic3lzLyIgI24gIi5oIiwgbiMjX3N5bXMsIHNpemVvZiAobiMjX3N5bXMpIC8gc2l6ZW9mIChuIyNfc3ltc1swXSksIFwKKyAgICBuIyNfbWF5YmUsIHNpemVvZiAobiMjX21heWJlKSAvIHNpemVvZiAobiMjX21heWJlWzBdKSwgTlVMTCB9CisgIEgoYWlvKSwKKyAgSChhc3NlcnQpLAorICBIKGN0eXBlKSwKKyAgSChkaXJlbnQpLAorICBIKGVycm5vKSwKKyAgSChmY250bCksCisgIEgoZmxvYXQpLAorICBIKGdycCksCisgIEgobGltaXRzKSwKKyAgSChsb2NhbGUpLAorICBIKG1hdGgpLAorICBIYyhtcXVldWUsICJfUE9TSVhfTUVTU0FHRV9QQVNTSU5HIiksCisgIEgocHRocmVhZCksCisgIEgocHdkKSwKKyAgSChzY2hlZCksCisgIEgoc2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CisvKiBUaGUgLUkgcGFyYW1ldGVycyBmb3IgQ0MgdG8gZmluZCBhbGwgaGVhZGVycy4gICovCitjb25zdCBjaGFyICpJTkM7CisKK3N0YXRpYyBjaGFyICp4c3RybmR1cCAoY29uc3QgY2hhciAqLCBzaXplX3QpOworc3RhdGljIGNvbnN0IGNoYXIgKipnZXRfbnVsbF9kZWZpbmVzICh2b2lkKTsKK3N0YXRpYyBpbnQgY2hlY2tfaGVhZGVyIChjb25zdCBzdHJ1Y3QgaGVhZGVyICosIGNvbnN0IGNoYXIgKiopOworc3RhdGljIGludCB4c3lzdGVtIChjb25zdCBjaGFyICopOworCitpbnQKK21haW4gKGludCBhcmdjLCBjaGFyICphcmd2W10pCit7CisgIGludCBoOworICBpbnQgcmVzdWx0ID0gMDsKKyAgY29uc3QgY2hhciAqKmlnbm9yZV9saXN0OworCisgIENDID0gYXJnYyA+IDEgPyBhcmd2WzFdIDogImdjYyI7CisgIElOQyA9IGFyZ2MgPiAyID8gYXJndlsyXSA6ICIiOworCisgIGlmIChzeXN0ZW0gKE5VTEwpID09IDApCisgICAgeworICAgICAgcHV0cyAoIlNvcnJ5LCBubyBjb21tYW5kIHByb2Nlc3Nvci4iKTsKKyAgICAgIHJldHVybiBFWElUX0ZBSUxVUkU7CisgICAgfQorCisgIC8qIEZpcnN0IGdldCBsaXN0IG9mIHN5bWJvbHMgd2hpY2ggYXJlIGRlZmluZWQgYnkgdGhlIGNvbXBpbGVyLiAgKi8KKyAgaWdub3JlX2xpc3QgPSBnZXRfbnVsbF9kZWZpbmVzICgpOworCisgIGZwdXRzICgiVGVzdGVkIGZpbGVzOlxuIiwgc3Rkb3V0KTsKKworICBmb3IgKGggPSAwOyBoIDwgTlVNQkVSX09GX0hFQURFUlM7ICsraCkKKyAgICByZXN1bHQgfD0gY2hlY2tfaGVhZGVyICgmaGVhZGVyc1toXSwgaWdub3JlX2xpc3QpOworCisgIC8qIFRoZSB0ZXN0IHN1aXRlIHNob3VsZCByZXR1cm4g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0KKyAgcmV0dXJuIHN0YXR1czsKK30KKworCitzdGF0aWMgY29uc3QgY2hhciAqKgorZ2V0X251bGxfZGVmaW5lcyAodm9pZCkKK3sKKyAgY2hhciBsaW5lW0JVRlNJWl0sICpjb21tYW5kOworICBjaGFyICoqcmVzdWx0ID0gTlVMTDsKKyAgc2l6ZV90IHJlc3VsdF9sZW4gPSAwOworICBzaXplX3QgcmVzdWx0X21heCA9IDA7CisgIEZJTEUgKmlucHV0OworICBpbnQgZmlyc3QgPSAxOworCisgIG1hY3JvZmlsZSA9IHRtcG5hbSAoTlVMTCk7CisKKyAgY29tbWFuZCA9IG1hbGxvYyAoc2l6ZW9mIGZtdCArIHNpemVvZiAiL2Rldi9udWxsIiArIDIgKiBzdHJsZW4gKENDKQorCQkgICAgKyBzdHJsZW4gKElOQykgKyBzdHJsZW4gKG1hY3JvZmlsZSkpOworCisgIGlmIChjb21tYW5kID09IE5VTEwpCisgICAgeworICAgICAgcHV0cyAoIk5vIG1vcmUgbWVtb3J5LiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIHNwcmludGYgKGNvbW1hbmQsIGZtdCwgIi9kZXYvbnVsbCIsIENDLCBJTkMsIENDLCBtYWNyb2ZpbGUpOworCisgIGlmICh4c3lzdGVtIChjb21tYW5kKSkKKyAgICB7CisgICAgICBwdXRzICgic3lzdGVtKCkgcmV0dXJuZWQgbm9uemVybyIpOworICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICBmcmVlIChjb21tYW5kKTsKKyAgaW5wdXQgPSBmb3BlbiAobWFjcm9maWxlLCAiciIpOworCisgIGlmIChpbnB1dCA9PSBOVUxMKQorICAgIHsKKyAgICAgIHByaW50ZiAoIkNvdWxkIG5vdCByZWFkICVzOiAiLCBtYWNyb2ZpbGUpOworICAgICAgcGVycm9yIChOVUxMKTsKKyAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICB3aGlsZSAoZmdldHMgKGxpbmUsIHNpemVvZiBsaW5lLCBpbnB1dCkgIT0gTlVMTCkKKyAgICB7CisgICAgICBjaGFyICpzdGFydDsKKyAgICAgIGlmIChzdHJsZW4gKGxpbmUpIDwgOSB8fCBsaW5lWzddICE9ICcgJykKKwl7IC8qICIjZGVmaW5lIEEiICovCisJICBwcmludGYgKCJNYWxmb3JtZWQgaW5wdXQsIGV4cGVjdGVkICcjZGVmaW5lIE1BQ1JPJ1xuZ290ICclcydcbiIsCisJCSAgbGluZSk7CisJICBjb250aW51ZTsKKwl9CisgICAgICBpZiAobGluZVs4XSA9PSAnXycpCisJLyogSXQncyBhIHNhZmUgaWRlbnRpZmllci4gICovCisJY29udGludWU7CisgICAgICBpZiAocmVzdWx0X2xlbiA9PSByZXN1bHRfbWF4KQorCXsKKwkgIHJlc3VsdF9tYXggKz0gMTA7CisJICByZXN1bHQgPSByZWFsbG9jIChyZXN1bHQsIHJlc3VsdF9tYXggKiBzaXplb2YgKGNoYXIgKiopKTsKKwkgIGlmIChyZXN1bHQgPT0gTlVMTCkKKwkgICAgeworCSAgICAgIHB1dHMgKCJObyBtb3JlIG1lbW9yeS4iKTsKKwkgICAgICBleGl0ICgxKTsKKwkgICAgfQorCX0KKyAgICAgIHN0YXJ0ID0gJmxpbmVbOF07CisgICAgICByZXN1bHRbcmVzdWx0X2xlbisrXSA9IHhzdHJuZHVwIChzdGFydCwgc3RyY3NwbiAoc3RhcnQsICIgKCIpKTsKKworICAgICAgaWYgKGZpcnN0KQorCXsKKwkgIGZwdXRzICgiVGhlIGZvbGxvd2luZyBpZGVudGlmaWVycyB3aWxsIGJlIGlnbm9yZWQgc2luY2UgdGhlIGNvbXBpbGVyIGRlZmluZXMgdGhlbVxuYnkgZGVmYXVsdDpcbiIsIHN0ZG91dCk7CisJICBmaXJzdCA9IDA7CisJfQorICAgICAgcHV0cyAocmVzdWx0W3Jlc3VsdF9sZW4gLSAxXSk7CisgICAgfQorICBpZiAocmVzdWx0X2xlbiA9PSByZXN1bHRfbWF4KQorICAgIHsKKyAgICAgIHJlc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19idWYpICE9IChzaXplX3QpIC0xKQorICAgIHsKKyAgICAgIGlmICghX19idWlsdGluX2NvbnN0YW50X3AgKF9fbmJ5dGVzKSkKKwlyZXR1cm4gX19wcmVhZDY0X2NoayAoX19mZCwgX19idWYsIF9fbmJ5dGVzLCBfX29mZnNldCwgX19ib3MwIChfX2J1ZikpOworCisgICAgICBpZiAoIF9fbmJ5dGVzID4gX19ib3MwIChfX2J1ZikpCisJcmV0dXJuIF9fcHJlYWQ2NF9jaGtfd2FybiAoX19mZCwgX19idWYsIF9fbmJ5dGVzLCBfX29mZnNldCwKKwkJCQkgICBfX2JvczAgKF9fYnVmKSk7CisgICAgfQorCisgIHJldHVybiBfX3ByZWFkNjRfYWxpYXMgKF9fZmQsIF9fYnVmLCBfX25ieXRlcywgX19vZmZzZXQpOworfQorIyBlbmRpZgorI2VuZGlmCisKKyNpZiBkZWZpbmVkIF9fVVNFX1hPUEVOX0VYVEVOREVEIHx8IGRlZmluZWQgX19VU0VfWE9QRU4ySworZXh0ZXJuIHNzaXplX3QgX19yZWFkbGlua19jaGsgKGNvbnN0IGNoYXIgKl9fcmVzdHJpY3QgX19wYXRoLAorCQkJICAgICAgIGNoYXIgKl9fcmVzdHJpY3QgX19idWYsIHNpemVfdCBfX2xlbiwKKwkJCSAgICAgICBzaXplX3QgX19idWZsZW4pCisgICAgIF9fVEhST1cgX19ub25udWxsICgoMSwgMikpIF9fd3VyOworZXh0ZXJuIHNzaXplX3QgX19SRURJUkVDVF9OVEggKF9fcmVhZGxpbmtfYWxpYXMsCisJCQkgICAgICAgKGNvbnN0IGNoYXIgKl9fcmVzdHJpY3QgX19wYXRoLAorCQkJCWNoYXIgKl9fcmVzdHJpY3QgX19idWYsIHNpemVfdCBfX2xlbiksIHJlYWRsaW5rKQorICAgICBfX25vbm51bGwgKCgxLCAyKSkgX193dXI7CitleHRlcm4gc3NpemVfdCBfX1JFRElSRUNUX05USCAoX19yZWFkbGlua19jaGtfd2FybiwKKwkJCSAgICAgICA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LCBzaXplX3QgX19sZW4sCisJCQkJIHNpemVfdCBfX2J1ZmxlbikKKyAgICAgX19USFJPVyBfX25vbm51bGwgKCgyLCAzKSkgX193dXI7CitleHRlcm4gc3NpemVfdCBfX1JFRElSRUNUX05USCAoX19yZWFkbGlua2F0X2FsaWFzLAorCQkJICAgICAgIChpbnQgX19mZCwgY29uc3QgY2hhciAqX19yZXN0cmljdCBfX3BhdGgsCisJCQkJY2hhciAqX19yZXN0cmljdCBfX2J1Ziwgc2l6ZV90IF9fbGVuKSwKKwkJCSAgICAgICByZWFkbGlua2F0KQorICAgICBfX25vbm51bGwgKCgyLCAzKSkgX193dXI7CitleHRlcm4gc3NpemVfdCBfX1JFRElSRUNUX05USCAoX19yZWFkbGlua2F0X2Noa193YXJuLAorCQkJICAgICAgIChpbnQgX19mZCwgY29uc3QgY2hhciAqX19yZXN0cmljdCBfX3BhdGgsCisJCQkJY2hhciAqX19yZXN0cmljdCBfX2J1Ziwgc2l6ZV90IF9fbGVuLAorCQkJCXNpemVfdCBfX2J1ZmxlbiksIF9fcmVhZGxpbmthdF9jaGspCisgICAgIF9fbm9ubnVsbCAoKDIsIDMpKSBfX3d1ciBfX3dhcm5hdHRyICgicmVhZGxpbmthdCBjYWxsZWQgd2l0aCBiaWdnZXIgIgorCQkJCQkgICJsZW5ndGggdGhhbiBzaXplIG9mIGRlc3RpbmF0aW9uICIKKwkJCQkJICAiYnVmZmVyIik7CisKK19fZm9ydGlmeV9mdW5jdGlvbiBfX25vbm51bGwgKCgyLCAzKSkgX193dXIgc3NpemVfdAorX19OVEggKHJlYWRsaW5rYXQgKGludCBfX2ZkLCBjb25zdCBjaGFyICpfX3Jlc3RyaWN0IF9fcGF0aCwKKwkJICAgY2hhciAqX19yZXN0cmljdCBfX2J1Ziwgc2l6ZV90IF9fbGVuKSkKK3sKKyAgaWYgKF9fYm9zIChfX2J1ZikgIT0gKHNpemVfdCkgLTEpCisgICAgeworICAgICAgaWYgKCFfX2J1aWx0aW5fY29u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gICB9CisgIHJldHVybiBfX2dldGdyb3Vwc19hbGlhcyAoX19zaXplLCBfX2xpc3QpOworfQorCisKK2V4dGVybiBpbnQgX190dHluYW1lX3JfY2hrIChpbnQgX19mZCwgY2hhciAqX19idWYsIHNpemVfdCBfX2J1ZmxlbiwKKwkJCSAgICBzaXplX3QgX19ucmVhbCkgX19USFJPVyBfX25vbm51bGwgKCgyKSk7CitleHRlcm4gaW50IF9fUkVESVJFQ1RfTlRIIChfX3R0eW5hbWVfcl9hbGlhcywgKGludCBfX2ZkLCBjaGFyICpfX2J1ZiwKKwkJCQkJICAgICAgIHNpemVfdCBfX2J1ZmxlbiksIHR0eW5hbWVfcikKKyAgICAgX19ub25udWxsICgoMikpOworZXh0ZXJuIGludCBfX1JFRElSRUNUX05USCAoX190dHluYW1lX3JfY2hrX3dhcm4sCisJCQkgICAoaW50IF9fZmQsIGNoYXIgKl9fYnVmLCBzaXplX3QgX19idWZsZW4sCisJCQkgICAgc2l6ZV90IF9fbnJlYWwpLCBfX3R0eW5hbWVfcl9jaGspCisgICAgIF9fbm9ubnVsbCAoKDIpKSBfX3dhcm5hdHRyICgidHR5bmFtZV9yIGNhbGxlZCB3aXRoIGJpZ2dlciBidWZsZW4gdGhhbiAiCisJCQkJICJzaXplIG9mIGRlc3RpbmF0aW9uIGJ1ZmZlciIpOworCitfX2ZvcnRpZnlfZnVuY3Rpb24gaW50CitfX05USCAodHR5bmFtZV9yIChpbnQgX19mZCwgY2hhciAqX19idWYsIHNpemVfdCBfX2J1ZmxlbikpCit7CisgIGlmIChfX2JvcyAoX19idWYpICE9IChzaXplX3QpIC0xKQorICAgIHsKKyAgICAgIGlmICghX19idWlsdGluX2NvbnN0YW50X3AgKF9fYnVmbGVuKSkKKwlyZXR1cm4gX190dHluYW1lX3JfY2hrIChfX2ZkLCBfX2J1ZiwgX19idWZsZW4sIF9fYm9zIChfX2J1ZikpOworCisgICAgICBpZiAoX19idWZsZW4gPiBfX2JvcyAoX19idWYpKQorCXJld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IGV4cGVjdGVkW2ldKQorCXsKKwkgIHByaW50ZiAoImZvcm1hdCAnJXMnIHRlc3QgJWQgZmFpbGVkOiBleHBlY3RlZCAnJWMnLCBnb3QgJyVjJ1xuIiwKKwkJICBmbXQsIGksIGV4cGVjdGVkW2ldLCBjKTsKKwkgIHJlcyA9IDE7CisJfQorICAgICAgaWYgKGZ0ZWxsIChzdGRlcnIpID09IDApCisJeworCSAgcHJpbnRmICgiZm9ybWF0ICclcycgdGVzdCAlZCBmYWlsZWQ6IG5vdCBwcmludGVkIHRvIHN0ZGVyclxuIiwKKwkJICBmbXQsIGkpOworCSAgcmVzID0gMTsKKwl9CisgICAgfQorCisgIHJldHVybiByZXM7Cit9CisKKworc3RhdGljIGludAorZG9fdGVzdCAodm9pZCkKK3sKKyAgY2hhciAqZm5hbWUgPSB0bXBuYW0gKE5VTEwpOworICBpZiAoZm5hbWUgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiY2Fubm90IGdlbmVyYXRlIG5hbWUgZm9yIHRlbXBvcmFyeSBmaWxlIik7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgaWYgKGZyZW9wZW4gKGZuYW1lLCAidysiLCBzdGRlcnIpID09IE5VTEwpCisgICAgeworICAgICAgcHV0cyAoImNhbm5vdCByZWRpcmVjdCBzdGRlcnIiKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICByZW1vdmUgKGZuYW1lKTsKKworICBvcHRpbmQgPSAwOworICBpbnQgcmV0ID0gb25lX3Rlc3QgKCIrYSIsIDIsCisJCSAgICAgIChjaGFyICpbMl0pIHsgKGNoYXIgKikgImJ1Zy1nZXRvcHQyIiwgKGNoYXIgKikgIi0rIiB9LAorCQkgICAgICAoaW50IFsxXSkgeyAnPycgfSk7CisKKyAgb3B0aW5kID0gMTsKKyAgcmV0IHw9IG9uZV90ZXN0ICgiK2EiLCAyLAorCQkgICAoY2hhciAqWzJdKSB7IChjaGFyICopICJidWctZ2V0b3B0MiIsICh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KyAgeworICAgIHsgImFscGhhIiwgICAgb3B0aW9uYWxfYXJndW1lbnQsIE5VTEwsICdhJyB9LAorICAgIHsgTlVMTCwgICAgICAgMCwgICAgICAgICAgICAgICAgIE5VTEwsIDAgfQorICB9OworCitzdGF0aWMgaW50CitvbmVfdGVzdCAoY29uc3QgY2hhciAqZm10LCBpbnQgYXJnYywgY2hhciAqYXJndltdLCBpbnQgbiwgaW50IGV4cGVjdGVkW25dKQoreworICBvcHRpbmQgPSAxOworCisgIGludCByZXMgPSAwOworICBmb3IgKGludCBpID0gMDsgaSA8IG47ICsraSkKKyAgICB7CisgICAgICByZXdpbmQgKHN0ZGVycik7CisgICAgICBpZiAoZnRydW5jYXRlIChmaWxlbm8gKHN0ZGVyciksIDApICE9IDApCisJeworCSAgcHV0cyAoImNhbm5vdCB0cnVuY2F0ZSBmaWxlIik7CisJICByZXR1cm4gMTsKKwl9CisKKyAgICAgIGludCBjID0gZ2V0b3B0X2xvbmcgKGFyZ2MsIGFyZ3YsIGZtdCwgb3B0cywgTlVMTCk7CisgICAgICBpZiAoYyAhPSBleHBlY3RlZFtpXSkKKwl7CisJICBwcmludGYgKCJmb3JtYXQgJyVzJyB0ZXN0ICVkIGZhaWxlZDogZXhwZWN0ZWQgJyVjJywgZ290ICclYydcbiIsCisJCSAgZm10LCBpLCBleHBlY3RlZFtpXSwgYyk7CisJICByZXMgPSAxOworCX0KKyAgICAgIGVsc2UgaWYgKG9wdGFyZyAhPSBOVUxMKQorCXsKKwkgIHByaW50ZiAoImZvcm1hdCAnJXMnIHRlc3QgJWQgZmFpbGVkOiBvcHRhcmcgaXMgXCIlc1wiLCBub3QgTlVMTFxuIiwKKwkJICBmbXQsIGksIG9wdGFyZyk7CisJICByZXMgPSAxOworCX0KKyAgICAgIGlmIChmdGVsbCAoc3RkZXJyKSAhPSAwKQorCXsKKwkgIHByaW50ZiAoImZvcm1hdCAnJXMnIHRlc3QgJWQgZmFpbGVkOiBwcmludGVkIHRvIHN0ZGVycl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RElSLCAwNzU1IH0sCisgICAgICB7ICIuLiIsIDMsIERUX0RJUiwgMDc1NSB9LAorICAgICAgeyAiYSIsIDMsIERUX1JFRywgMDY0NCB9LAorICAgIHsgInVucmVhZGFibGUiLCAyLCBEVF9ESVIsIDAxMTEgfSwKKyAgICAgIHsgIi4iLCAzLCBEVF9ESVIsIDAxMTEgfSwKKyAgICAgIHsgIi4uIiwgMywgRFRfRElSLCAwNzU1IH0sCisgICAgICB7ICJhIiwgMywgRFRfUkVHLCAwNjQ0IH0sCisgICAgeyAienotcmVhZGFibGUiLCAyLCBEVF9ESVIsIDA3NTUgfSwKKyAgICAgIHsgIi4iLCAzLCBEVF9ESVIsIDA3NTUgfSwKKyAgICAgIHsgIi4uIiwgMywgRFRfRElSLCAwNzU1IH0sCisgICAgICB7ICJhIiwgMywgRFRfUkVHLCAwNjQ0IH0KK307CisjZGVmaW5lIG5maWxlcyAoc2l6ZW9mIChmaWxlc3lzdGVtKSAvIHNpemVvZiAoZmlsZXN5c3RlbVswXSkpCisKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgaW50IGxldmVsOworICBpbnQgaWR4OworICBzdHJ1Y3QgZGlyZW50IGQ7CisgIGNoYXIgcm9vbV9mb3JfZGlyZW50W05BTUVfTUFYXTsKK30gbXlfRElSOworCisKK3N0YXRpYyBsb25nIGludAorZmluZF9maWxlIChjb25zdCBjaGFyICpzKQoreworICBpbnQgbGV2ZWwgPSAxOworICBsb25nIGludCBpZHggPSAwOworCisgIGlmIChzdHJjbXAgKHMsICIuIikgPT0gMCkKKyAgICByZXR1cm4gMDsKKworICBpZiAoc1swXSA9PSAnLicgJiYgc1sxXSA9PSAnLycpCisgICAgcyArPSAyOworCisgIHdoaWxlICgqcyAhPSAnXDAnKQorICAgIHsKKyAgICAgIGNoYXIgKmVuZHAgPSBzdHJjaHJudWwgKHMsICcvJyk7CisKKyAgICAgIFBSSU5URiAoImxvb2tpbmcgZm9yICUuKnMsIGxldmVsICVkXG4iLCAoaW50KSAoZW5kcCAtIHMpLCBzLCBsZXZlbCk7CisKKyAgICAgIHdoaWxlIChpZHggPCBuZmlsZXMgJiYgZmlsZXN5c3RlbVtpZHhdLmxldmVsID49IGxldmVsKQorCXsKKwkgIGlmIChmaWxlc3lzdGVtW2lkeF0ubGV2ZWwgPT0gbGV2ZWwKKwkgICAgICAmJiBtZW1jbXAgKHMsIGZpbGVzeXN0ZW1baWR4XS5uYW1lLCBlbmRwIC0gcykgPT0gMAorCSAgICAgICYmIGZpbGVzeXN0ZW1baWR4XS5uYW1lW2VuZHAgLSBzXSA9PSAnXDAnKQorCSAgICBicmVhazsKKwkgICsraWR4OworCX0KKworICAgICAgaWYgKGlkeCA9PSBuZmlsZXMgfHwgZmlsZXN5c3RlbVtpZHhdLmxldmVsIDwgbGV2ZWwpCisJeworCSAgZXJybm8gPSBFTk9FTlQ7CisJICByZXR1cm4gLTE7CisJfQorCisgICAgICBpZiAoKmVuZHAgPT0gJ1wwJykKKwlyZXR1cm4gaWR4ICsgMTsKKworICAgICAgaWYgKGZpbGVzeXN0ZW1baWR4XS50eXBlICE9IERUX0RJUgorCSAgJiYgKGlkeCArIDEgPj0gbmZpbGVzCisJICAgICAgfHwgZmlsZXN5c3RlbVtpZHhdLmxldmVsID49IGZpbGVzeXN0ZW1baWR4ICsgMV0ubGV2ZWwpKQorCXsKKwkgIGVycm5vID0gRU5PVERJUjsKKwkgIHJldHVybiAtMTsKKwl9CisKKyAgICAgICsraWR4OworCisgICAgICBzID0gZW5kcCArIDE7CisgICAgICArK2xldmVsOworICAgIH0KKworICBlcnJubyA9IEVOT0VOVDsKKyAgcmV0dXJuIC0xOworfQorCisKK3N0YXRpYyB2b2lkICoKK215X29wZW5kaXIgKGNvbnN0IGNoYXIgKnMpCit7CisgIGxvbmcgaW50IGlkeCA9IGZpbmRfZmlsZSAocyk7CisgIG15X0RJUiAqZGlyOworCisgIGlmIChpZHggPT0gLTEpCisgICAgeworICAgICAgUFJJTlRGICgibXlfb3BlbmRpcihcIiVzXCIpID09IE5VTEwgKCVtKVxuIiwgcyk7CisgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgaWYgKChmaWxlc3lzdGVtW2lkeF0ubW9kZSAmIDA0MDApID09IDApCisgICAgeworICAgICAgZXJybm8gPSBFQUNDRVM7CisgICAgICBQUklOVEYgKCJteV9vcGVuZGlyKFwiJXNcIikgPT0gTlVMTCAoJW0pXG4iLCBzKTsKKyAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICBkaXIgPSAobXlfRElSICopIG1hbGxvYyAoc2l6ZW9mIChteV9ESVIpKTsKKyAgaWYgKGRpciA9PSBOVUxMKQorICAgIHsKKyAgICAgIHByaW50ZiAoImNhbm5vdCBhbGxvY2F0ZSBkaXJlY3RvcnkgaGFuZGxlOiAlbVxuIik7CisgICAgICBleGl0IChFWElUX0ZBSUxVUkUpOworICAgIH0KKworICBkaXItPmxldmVsID0gZmlsZXN5c3RlbVtpZHhdLmxldmVsOworICBkaXItPmlkeCA9IGlkeDsKKworICBQUklOVEYgKCJteV9vcGVuZGlyKFwiJXNcIikgPT0geyBsZXZlbDogJWQsIGlkeDogJWxkIH1cbiIsCisJICBzLCBmaWxlc3lzdGVtW2lkeF0ubGV2ZWwsIGlkeCk7CisKKyAgcmV0dXJuIGRpcjsKK30KKworCitzdGF0aWMgc3RydWN0IGRpcmVudCAqCitteV9yZWFkZGlyICh2b2lkICpnZGlyKQoreworICBteV9ESVIgKmRpciA9IGdkaXI7CisKKyAgaWYgKGRpci0+aWR4ID09IC0xKQorICAgIHsKKyAgICAgIFBSSU5URiAoIm15X3JlYWRkaXIgKHsgbGV2ZWw6ICVkLCBpZHg6ICVsZCB9KSA9IE5VTExcbiIsCisJICAgICAgZGlyLT5sZXZlbCwgKGxvbmcgaW50KSBkaXItPmlkeCk7CisgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgd2hpbGUgKGRpci0+aWR4IDwgbmZpbGVzICYmIGZpbGVzeXN0Z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Sk7CisjZW5kaWYKKworICArK2Rpci0+aWR4OworCisgIHJldHVybiAmZGlyLT5kOworfQorCisKK3N0YXRpYyB2b2lkCitteV9jbG9zZWRpciAodm9pZCAqZGlyKQoreworICBQUklOVEYgKCJteV9jbG9zZWRpciAoKVxuIik7CisgIGZyZWUgKGRpcik7Cit9CisKKworLyogV2UgdXNlIHRoaXMgZnVuY3Rpb24gZm9yIGxzdGF0IGFzIHdlbGwgc2luY2Ugd2UgZG9uJ3QgaGF2ZSBhbnkuICAqLworc3RhdGljIGludAorbXlfc3RhdCAoY29uc3QgY2hhciAqbmFtZSwgc3RydWN0IHN0YXQgKnN0KQoreworICBsb25nIGludCBpZHggPSBmaW5kX2ZpbGUgKG5hbWUpOworCisgIGlmIChpZHggPT0gLTEpCisgICAgeworICAgICAgUFJJTlRGICgibXlfc3RhdCAoXCIlc1wiLCAuLi4pID0gLTEgKCVtKVxuIiwgbmFtZSk7CisgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgIG1lbXNldCAoc3QsICdcMCcsIHNpemVvZiAoKnN0KSk7CisKKyAgaWYgKGZpbGVzeXN0ZW1baWR4XS50eXBlID09IERUX1VOS05PV04pCisgICAgc3QtPnN0X21vZGUgPSBEVFRPSUYgKGlkeCArIDEgPCBuZmlsZXMKKwkJCSAgJiYgZmlsZXN5c3RlbVtpZHhdLmxldmVsIDwgZmlsZXN5c3RlbVtpZHggKyAxXS5sZXZlbAorCQkJICA/IERUX0RJUiA6IERUX1JFRykgfCBmaWxlc3lzdGVtW2lkeF0ubW9kZTsKKyAgZWxzZQorICAgIHN0LT5zdF9tb2RlID0gRFRUT0lGIChmaWxlc3lzdGVtW2lkeF0udHlwZSkgfCBmaWxlc3lzdGVtW2lkeF0ubW9kZTsKKworICBQUklOVEYgKCJteV9zdGF0IChcIiVzXCIsIHsgc3RfbW9kZTogJW8gfSkgPSAwXG4iLCBuYW1lLCBzdC0+c3RfbW9kZSk7CisKKyAgcmV0dXJuIDA7Cit9CisKKworc3R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SByZXBsOworICAgICAgZm9yIChqID0gMDsgaiA8IDc7ICsraikKKwlpZiAoaSAmICgxIDw8IGopKQorCSAgeworCSAgICBpZiAoIXN0cmNociAodGVzdC0+cGF0dGVybiwgY2hhcnNbal0pCisJCSYmICFzdHJjaHIgKHRlc3QtPnN0cmluZywgY2hhcnNbal0pKQorCSAgICAgIGJyZWFrOworCSAgICAqcCsrID0gY2hhcnNbal07CisJICB9CisgICAgICBpZiAoaiA8IDcpCisJY29udGludWU7CisgICAgICAqcCA9ICdcMCc7CisKKyAgICAgIGZvciAoaiA9IDAsIHAgPSBwYXR0ZXJuOyB0ZXN0LT5wYXR0ZXJuW2pdOyArK2opCisJaWYgKHN0cmNociAocmVwbCwgdGVzdC0+cGF0dGVybltqXSkpCisJICBwID0gcmVwbGFjZSAocCwgdGVzdC0+cGF0dGVybltqXSk7CisJZWxzZSBpZiAodGVzdC0+cGF0dGVybltqXSA9PSAnXFwnICYmIHRlc3QtPnBhdHRlcm5baiArIDFdKQorCSAgeworCSAgICAqcCsrID0gdGVzdC0+cGF0dGVybltqKytdOworCSAgICAqcCsrID0gdGVzdC0+cGF0dGVybltqXTsKKwkgIH0KKwllbHNlCisJICAqcCsrID0gdGVzdC0+cGF0dGVybltqXTsKKyAgICAgICpwID0gJ1wwJzsKKworICAgICAgdC5zdGFydCA9IHRlc3QtPnN0YXJ0OworICAgICAgdC5yZXMgPSB0ZXN0LT5yZXM7CisKKyAgICAgIGZvciAoaiA9IDAsIHAgPSBzdHJpbmc7IHRlc3QtPnN0cmluZ1tqXTsgKytqKQorCWlmIChzdHJjaHIgKHJlcGwsIHRlc3QtPnN0cmluZ1tqXSkpCisJICB7CisJICAgIGNoYXIgKmQgPSByZXBsYWNlIChwLCB0ZXN0LT5zdHJpbmdbal0pOworCSAgICBpZiAodGVzdC0+c3RhcnQgPiBqKQorCSAgICAgIHQuc3RhcnQgKz0gZCAtIHAgLSAxOworCSAgICBpZiAodGVzdC0+cmVzID4gaikKKwkgICAgICB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FLCAiYVxcd3oiLCAiYVx4YzNceDg0eiIsIDAsIDB9LAorICB7RVJFLCAieFxcV3oiLCAiXHhjM1x4OTZ4XHhlMlx4ODBceDk0eiIsIDIsIDB9LAorfTsKKworaW50CittYWluICh2b2lkKQoreworICBzdHJ1Y3QgcmVfcGF0dGVybl9idWZmZXIgcmVnYnVmOworICBjb25zdCBjaGFyICplcnI7CisgIHNpemVfdCBpOworICBpbnQgcmV0ID0gMDsKKworICBtdHJhY2UgKCk7CisKKyAgc2V0bG9jYWxlIChMQ19BTEwsICJkZV9ERS5VVEYtOCIpOworICBmb3IgKGkgPSAwOyBpIDwgc2l6ZW9mICh0ZXN0cykgLyBzaXplb2YgKHRlc3RzWzBdKTsgKytpKQorICAgIHsKKyAgICAgIGludCByZXMsIG9wdGltaXplZDsKKworICAgICAgcmVfc2V0X3N5bnRheCAodGVzdHNbaV0uc3ludGF4KTsKKyAgICAgIG1lbXNldCAoJnJlZ2J1ZiwgJ1wwJywgc2l6ZW9mIChyZWdidWYpKTsKKyAgICAgIGVyciA9IHJlX2NvbXBpbGVfcGF0dGVybiAodGVzdHNbaV0ucGF0dGVybiwgc3RybGVuICh0ZXN0c1tpXS5wYXR0ZXJuKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlZ2J1Zik7CisgICAgICBpZiAoZXJyICE9IE5VTEwpCisJeworCSAgcHJpbnRmICgicmVfY29tcGlsZV9wYXR0ZXJuIGZhaWxlZDogJXNcbiIsIGVycik7CisJICByZXQgPSAxOworCSAgY29udGludWU7CisJfQorCisgICAgICAvKiBDaGVjayBpZiByZV9zZWFyY2ggd2lsbCBiZSBkb25lIGFzIG11bHRpLWJ5dGUgb3Igc2luZ2xlLWJ5dGUuICAqLworICAgICAgb3B0aW1pemVkID0gKChyZV9kZmFfdCAqKSByZWdidWYuYnVmZmVyKS0+bWJfY3VyX21heCA9PSAxOworICAgICAgaWYgKG9wdGltaXplZCAhPSB0ZXN0c1tpXS5vcHRpbWl6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lX2NvbXBpbGVfcGF0dGVybiAodGVzdHNbaV0ucGF0dGVybiwgc3RybGVuICh0ZXN0c1tpXS5wYXR0ZXJuKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlZ2J1Zik7CisgICAgICBpZiAoZXJyICE9IE5VTEwpCisJeworCSAgcHJpbnRmICgicmVfY29tcGlsZV9wYXR0ZXJuIGZhaWxlZDogJXNcbiIsIGVycik7CisJICByZXQgPSAxOworCSAgY29udGludWU7CisJfQorCisgICAgICAvKiBDaGVjayBpZiByZV9zZWFyY2ggd2lsbCBiZSBkb25lIGFzIG11bHRpLWJ5dGUgb3Igc2luZ2xlLWJ5dGUuICAqLworICAgICAgb3B0aW1pemVkID0gKChyZV9kZmFfdCAqKSByZWdidWYuYnVmZmVyKS0+bWJfY3VyX21heCA9PSAxOworICAgICAgaWYgKG9wdGltaXplZCkKKyAgICAgICAgeworICAgICAgICAgIHByaW50ZiAoInBhdHRlcm4gJXpkIG9wdGltaXplZCB3aGlsZSBpdCBzaG91bGQgbm90IGJlIHdoZW4gY2FzZSBpbnNlbnNpdGl2ZVxuIiwKKwkJICBpKTsKKwkgIHJldCA9IDE7CisgICAgICAgIH0KKworICAgICAgcmVzID0gcmVfc2VhcmNoICgmcmVnYnVmLCB0ZXN0c1tpXS5zdHJpbmcsIHN0cl9sZW4sIDAsIHN0cl9sZW4sIE5VTEwpOworICAgICAgaWYgKHJlcyAhPSB0ZXN0c1tpXS5yZXMpCisJeworCSAgcHJpbnRmICgiSUNBU0UgcmVfc2VhcmNoICV6ZCBmYWlsZWQ6ICVkXG4iLCBpLCByZXMpOworCSAgcmV0ID0gMTsKKwkgIHJlZ2ZyZWUgKCZyZWdidWYpOworCSAgY29udGludWU7CisJfQorCisgICAgICByZXMgPSByZV9zZWFyY2ggKCZyZWdidWYsIHRlc3RzW2ldLnN0cmluZywgc3RyX2xlbiwgc3RyX2xlbiwgLXN0cl9sZW4sCisJCSAgICAgICBOVUxMKTsKKyAgICA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sIHNpemVvZiAocmUpKTsKKyAgcmUudHJhbnNsYXRlID0gKHVuc2lnbmVkIGNoYXIgKikgdHJhbnM7CisgIHMgPSByZV9jb21waWxlX3BhdHRlcm4gKCJcXFciLCAyLCAmcmUpOworCisgIGlmIChzICE9IE5VTEwpCisgICAgeworICAgICAgcHJpbnRmICgiZmFpbGVkIHRvIGNvbXBpbGUgcGF0dGVybiBcIlxcV1wiOiAlc1xuIiwgcyk7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIGludCByZXQgPSByZV9zZWFyY2ggKCZyZSwgImFiYy5kZSIsIDYsIDAsIDYsIE5VTEwpOworICAgICAgaWYgKHJldCAhPSAzKQorCXsKKwkgIHByaW50ZiAoIjFzdCByZV9zZWFyY2ggcmV0dXJuZWQgJWRcbiIsIHJldCk7CisJICByZXN1bHQgPSAxOworCX0KKworICAgICAgcmV0ID0gcmVfc2VhcmNoICgmcmUsICJceGM0XHhkNlx4YWVceGY3IiwgNCwgMCwgNCwgTlVMTCk7CisgICAgICBpZiAocmV0ICE9IDIpCisJeworCSAgcHJpbnRmICgiMm5kIHJlX3NlYXJjaCByZXR1cm5lZCAlZFxuIiwgcmV0KTsKKwkgIHJlc3VsdCA9IDE7CisJfQorICAgICAgcmUudHJhbnNsYXRlID0gTlVMTDsKKyAgICAgIHJlZ2ZyZWUgKCZyZSk7CisgICAgfQorCisgIG1lbXNldCAoJnJlLCAwLCBzaXplb2YgKHJlKSk7CisgIHJlLnRyYW5zbGF0ZSA9ICh1bnNpZ25lZCBjaGFyICopIHRyYW5zOworICBzID0gcmVfY29tcGlsZV9wYXR0ZXJuICgiXFx3IiwgMiwgJnJlKTsKKworICBpZiAocyAhPSBOVUxMKQorICAgIHsKKyAgICAgIHByaW50ZiAoImZhaWxlZCB0byBjb21waWxlIHBhdHRlcm4gXCJcXHdcIjogJXNcbiIsIHMpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBpbnQgcmV0ID0gcmVfc2VhcmNoICgmcmUsICIuLCFhYmMiLCA2LCAwLCA2LCBOVUxMKTsKKyAgICAgIGlmIChyZXQgIT0gMykKKwl7CisJICBwcmludGYgKCIzcmQgcmVfc2VhcmNoIHJldHVybmVkICVkXG4iLCByZXQpOworCSAgcmVzdWx0ID0gMTsKKwl9CisKKyAgICAgIHJldCA9IHJlX3NlYXJjaCAoJnJlLCAiXHhhZVx4ZjdceGM0XHhkNiIsIDQsIDAsIDQsIE5VTEwpOworICAgICAgaWYgKHJldCAhPSAyKQorCXsKKwkgIHByaW50ZiAoIjR0aCByZV9zZWFyY2ggcmV0dXJuZWQgJWRcbiIsIHJldCk7CisJICByZXN1bHQgPSAxOworCX0KKyAgICAgIHJlLnRyYW5zbGF0ZSA9IE5VTEw7CisgICAgICByZWdmcmVlICgmcmUpOworICAgIH0KKworICBtZW1zZXQgKCZyZSwgMCwgc2l6ZW9mIChyZSkpOworICByZS50cmFuc2xhdGUgPSAodW5zaWduZWQgY2hhciAqKSB0cmFuczsKKyAgcyA9IHJlX2NvbXBpbGVfcGF0dGVybiAoIltbOkRJR0lUOl1dIiwgMTEsICZyZSk7CisgIGlmIChzID09IE5VTEwpCisgICAgeworICAgICAgcHJpbnRmICgiY29tcGlsYXRpb24gb2YgXCJbWzpESUdJVDpdXVwiIHBhdHRlcm4gdW5leHBlY3RlZGx5IHN1Y2NlZWRlZDogJXNcbiIsCisJICAgICAgcyk7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBtZW1zZXQgKCZyZSwgMCwgc2l6ZW9mIChyZSkpOworICByZS50cmFuc2xhdGUgPSAodW5zaWduZWQgY2hhciAqKSB0cmFuczsKKyAgcyA9IHJlX2NvbXBpbGVfcGF0dGVybiAoIltbOkRJR0lUOl1dIiwgMiwgJnJlKTsKKyAgaWYgKHMgPT0gTlVMTCkKKyAgICB7CisgICAgICBwcmludGYgKCJjb21waWxhdGlvbiBvZiBcIltbOkRJ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MVx4NjFceDYxXHhiN1x4ZWZceDYxXHhiZlx4YjdceGJkXHhlOCIsCisgICAgICAgICAgICAgICAgIDEwLCAwLCAxMCwgJnMpOworICBpZiAoZSAhPSAtMSkKKyAgICB7CisgICAgICBwcmludGYgKCJidWctcmVnZXgzMy4zOiBmYWxzZSBtYXRjaCBvciBlcnJvcjogcmVfc2VhcmNoKCkgcmV0dXJuZWQgJWQsIHNob3VsZCByZXR1cm4gLTFcbiIsIGUpOworICAgICAgcmMgPSAxOworICAgIH0KKworICAgICAgICAgICAgICAgIC8qIGFh5Lu2YeaWsOWHpiwgXHhiN1x4YmQgY29uc3RpdHV0ZXMgYSBmYWxzZSBtYXRjaCAqLworICBlID0gcmVfc2VhcmNoICgmciwgIlx4NjFceDYxXHhiN1x4ZWZceDYxXHhiZlx4YjdceGJkXHhlOCIsCisgICAgICAgICAgICAgICAgIDksIDAsIDksICZzKTsKKyAgaWYgKGUgIT0gLTEpCisgICAgeworICAgICAgcHJpbnRmICgiYnVnLXJlZ2V4MzMuNDogZmFsc2UgbWF0Y2ggb3IgZXJyb3I6IHJlX3NlYXJjaCgpIHJldHVybmVkICVkLCBzaG91bGQgcmV0dXJuIC0xXG4iLCBlKTsKKyAgICAgIHJjID0gMTsKKyAgICB9CisKKyAgICAgICAgICAgICAgICAvKiBh5Lu2YeaWsOWHpiwgXHhiN1x4YmQgY29uc3RpdHV0ZXMgYSBmYWxzZSBtYXRjaCAqLworICBlID0gcmVfc2VhcmNoICgmciwgIlx4NjFceGI3XHhlZlx4NjFceGJmXHhiN1x4YmRceGU4IiwKKyAgICAgICAgICAgICAgICAgOCwgMCwgOCwgJnMpOworICBpZiAoZSAhPSAtMSkKKyAgICB7CisgICAgICBwcmludGYgKCJidWctcmVnZXgzMy41OiBmYWxzZSBtYXRjaCBvciBlcnJvcjogcmVfc2VhcmNoKCkgcmV0dXJuZWQgJWQsIHNob3VsZCByZXR1cm4gLTFcbiIsIGUpOworICAgICAgcmMgPSAxOworICAgIH0K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YXR0ZXJuOworCSAgICB9CisJfQorICAgICAgZWxzZQorCXsKKwlwcmVwYXJlX3dwYXR0ZXJuOgorCSAgbiA9IG1ic3J0b3djcyAoTlVMTCwgJnBhdHRlcm4sIDAsICZwcyk7CisJICBpZiAoX19nbGliY191bmxpa2VseSAobiA9PSAoc2l6ZV90KSAtMSkpCisJICAgIC8qIFNvbWV0aGluZyB3cm9uZy4KKwkgICAgICAgWFhYIERvIHdlIGhhdmUgdG8gc2V0IGBlcnJubycgdG8gc29tZXRoaW5nIHdoaWNoIG1ic3J0b3dzIGhhc24ndAorCSAgICAgICBhbHJlYWR5IGRvbmU/ICAqLworCSAgICByZXR1cm4gLTE7CisJICBpZiAoX19nbGliY191bmxpa2VseSAobiA+PSAoc2l6ZV90KSAtMSAvIHNpemVvZiAod2NoYXJfdCkpKQorCSAgICB7CisJICAgICAgX19zZXRfZXJybm8gKEVOT01FTSk7CisJICAgICAgcmV0dXJuIC0yOworCSAgICB9CisJICB3cGF0dGVybl9tYWxsb2MgPSB3cGF0dGVybgorCSAgICA9ICh3Y2hhcl90ICopIG1hbGxvYyAoKG4gKyAxKSAqIHNpemVvZiAod2NoYXJfdCkpOworCSAgYXNzZXJ0IChtYnNpbml0ICgmcHMpKTsKKwkgIGlmICh3cGF0dGVybiA9PSBOVUxMKQorCSAgICByZXR1cm4gLTI7CisJICAodm9pZCkgbWJzcnRvd2NzICh3cGF0dGVybiwgJnBhdHRlcm4sIG4gKyAxLCAmcHMpOworCX0KKworICAgICAgYXNzZXJ0IChtYnNpbml0ICgmcHMpKTsKKyNpZmRlZiBfTElCQworICAgICAgbiA9IF9fc3RybmxlbiAoc3RyaW5nLCAxMDI0KTsKKyNlbHNlCisgICAgICBuID0gc3RybGVuIChzdHJpbmcpOworI2VuZGlmCisgICAgICBwID0gc3RyaW5nOworICAgICAgaWYgKF9fZ2xpYmNfbGlrZWx5IChuIDwgMTAyNCkpCisJeworCSAgd3N0cmluZyA9ICh3Y2hhcl90ICopIGFsbG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TkxfQ09MTEFURV9DT0xMU0VRV0MpOworIyBlbHNlCisgIGNvbnN0IFVDSEFSICpjb2xsc2VxID0gKGNvbnN0IFVDSEFSICopCisgICAgX05MX0NVUlJFTlQoTENfQ09MTEFURSwgX05MX0NPTExBVEVfQ09MTFNFUU1CKTsKKyMgZW5kaWYKKyNlbmRpZgorCisgIHdoaWxlICgoYyA9ICpwKyspICE9IEwoJ1wwJykpCisgICAgeworICAgICAgaW50IG5ld19ub19sZWFkaW5nX3BlcmlvZCA9IDA7CisgICAgICBjID0gRk9MRCAoYyk7CisKKyAgICAgIHN3aXRjaCAoYykKKwl7CisJY2FzZSBMKCc/Jyk6CisJICBpZiAoX19idWlsdGluX2V4cGVjdCAoZmxhZ3MgJiBGTk1fRVhUTUFUQ0gsIDApICYmICpwID09ICcoJykKKwkgICAgeworCSAgICAgIGludCByZXMgPSBFWFQgKGMsIHAsIG4sIHN0cmluZ19lbmQsIG5vX2xlYWRpbmdfcGVyaW9kLAorCQkJICAgICBmbGFncywgYWxsb2NhX3VzZWQpOworCSAgICAgIGlmIChyZXMgIT0gLTEpCisJCXJldHVybiByZXM7CisJICAgIH0KKworCSAgaWYgKG4gPT0gc3RyaW5nX2VuZCkKKwkgICAgcmV0dXJuIEZOTV9OT01BVENIOworCSAgZWxzZSBpZiAoKm4gPT0gTCgnLycpICYmIChmbGFncyAmIEZOTV9GSUxFX05BTUUpKQorCSAgICByZXR1cm4gRk5NX05PTUFUQ0g7CisJICBlbHNlIGlmICgqbiA9PSBMKCcuJykgJiYgbm9fbGVhZGluZ19wZXJpb2QpCisJICAgIHJldHVybiBGTk1fTk9NQVRDSDsKKwkgIGJyZWFrOworCisJY2FzZSBMKCdcXCcpOgorCSAgaWYgKCEoZmxhZ3MgJiBGTk1fTk9FU0NBUEUpKQorCSAgICB7CisJICAgICAgYyA9ICpwKys7CisJICAgICAgaWYgKGMgPT0gTCgnXDAnKSkKKwkJLyogVHJhaWxpbmcgXCBsb3Nlcy4gICovCisJCXJldHVybiBGTk1fTk9NQVRDSDsKKwkgICAgICBjID0gRk9MRCAoYyk7CisJICAgIH0KKwkgIGlmIChuID09IHN0cmluZ19lbmQgfHwgRk9MRCAoKFVDSEFSKSAqbikgIT0gYykKKwkgICAgcmV0dXJuIEZOTV9OT01BVENIOworCSAgYnJlYWs7CisKKwljYXNlIEwoJyonKToKKwkgIGlmIChfX2J1aWx0aW5fZXhwZWN0IChmbGFncyAmIEZOTV9FWFRNQVRDSCwgMCkgJiYgKnAgPT0gJygnKQorCSAgICB7CisJICAgICAgaW50IHJlcyA9IEVYVCAoYywgcCwgbiwgc3RyaW5nX2VuZCwgbm9fbGVhZGluZ19wZXJpb2QsCisJCQkgICAgIGZsYWdzLCBhbGxvY2FfdXNlZCk7CisJICAgICAgaWYgKHJlcyAhPSAtMSkKKwkJcmV0dXJuIHJlczsKKwkgICAgfQorCSAgZWxzZSBpZiAoZW5kcyAhPSBOVUxMKQorCSAgICB7CisJICAgICAgZW5kcy0+cGF0dGVybiA9IHAgLSAxOworCSAgICAgIGVuZHMtPnN0cmluZyA9IG47CisJICAgICAgZW5kcy0+bm9fbGVhZGluZ19wZXJpb2QgPSBub19sZWFkaW5nX3BlcmlvZDsKKwkgICAgICByZXR1cm4gMDsKKwkgICAgfQorCisJICBpZiAobiAhPSBzdHJpbmdfZW5kICYmICpuID09IEwoJy4nKSAmJiBub19sZWFkaW5nX3BlcmlvZCkKKwkgICAgcmV0dXJuIEZOTV9OT01BVENIOworCisJICBmb3IgKGMgPSAqcCsrOyBjID09IEwoJz8nKSB8fCBjID09IEwoJyonKTsgYyA9ICpwKyspCisJICAgIHsKKwkgICAgICBpZiAoKnAgPT0gTCgnKCcpICYmIChmbGFncyAmIEZOTV9FWFRNQVRDSCkgIT0gMCkKKwkJeworCQkgIGNvbnN0IENIQVIgKmVuZHAgPSBFTkQgKHApOworCQkgIGlmIChlbmRwICE9IHApCisJCSAgICB7CisJCSAgICAgIC8qIFRoaXMgaXMgYSBwYXR0ZXJu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DsKKworCSAgICBpZiAoKm4gPT0gTCgnLycpICYmIChmbGFncyAmIEZOTV9GSUxFX05BTUUpKQorCSAgICAgIC8qIGAvJyBjYW5ub3QgYmUgbWF0Y2hlZC4gICovCisJICAgICAgcmV0dXJuIEZOTV9OT01BVENIOworCisJICAgIG5vdCA9ICgqcCA9PSBMKCchJykgfHwgKHBvc2l4bHlfY29ycmVjdCA8IDAgJiYgKnAgPT0gTCgnXicpKSk7CisJICAgIGlmIChub3QpCisJICAgICAgKytwOworCisJICAgIGZuID0gRk9MRCAoKFVDSEFSKSAqbik7CisKKwkgICAgYyA9ICpwKys7CisJICAgIGZvciAoOzspCisJICAgICAgeworCQlpZiAoIShmbGFncyAmIEZOTV9OT0VTQ0FQRSkgJiYgYyA9PSBMKCdcXCcpKQorCQkgIHsKKwkJICAgIGlmICgqcCA9PSBMKCdcMCcpKQorCQkgICAgICByZXR1cm4gRk5NX05PTUFUQ0g7CisJCSAgICBjID0gRk9MRCAoKFVDSEFSKSAqcCk7CisJCSAgICArK3A7CisKKwkJICAgIGdvdG8gbm9ybWFsX2JyYWNrZXQ7CisJCSAgfQorCQllbHNlIGlmIChjID09IEwoJ1snKSAmJiAqcCA9PSBMKCc6JykpCisJCSAgeworCQkgICAgLyogTGVhdmUgcm9vbSBmb3IgdGhlIG51bGwuICAqLworCQkgICAgQ0hBUiBzdHJbQ0hBUl9DTEFTU19NQVhfTEVOR1RIICsgMV07CisJCSAgICBzaXplX3QgYzEgPSAwOworI2lmIGRlZmluZWQgX0xJQkMgfHwgKGRlZmluZWQgSEFWRV9XQ1RZUEVfSCAmJiBkZWZpbmVkIEhBVkVfV0NIQVJfSCkKKwkJICAgIHdjdHlwZV90IHd0OworI2VuZGlmCisJCSAgICBjb25zdCBDSEFSICpzdGFydHAgPSBwOworCisJCSAgICBmb3IgKDs7KQorCQkgICAgICB7CisJCQlpZiAoYzEgPT0gQ0hBUl9DTEFTU19NQVhfTEVOR1RIKQorCQkJICAvKiBUaGUgbmFtZ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pID09IChpZHgyID4+IDI0KQorCQkJCSYmIGxlbiA9PSB3ZWlnaHRzW2lkeDIgJiAweGZmZmZmZl0pCisJCQkgICAgICB7CisJCQkJaW50IGNudCA9IDA7CisKKwkJCQlpZHggJj0gMHhmZmZmZmY7CisJCQkJaWR4MiAmPSAweGZmZmZmZjsKKworCQkJCXdoaWxlIChjbnQgPCBsZW4KKwkJCQkgICAgICAgJiYgKHdlaWdodHNbaWR4ICsgMSArIGNudF0KKwkJCQkJICAgPT0gd2VpZ2h0c1tpZHgyICsgMSArIGNudF0pKQorCQkJCSAgKytjbnQ7CisKKwkJCQlpZiAoY250ID09IGxlbikKKwkJCQkgIGdvdG8gbWF0Y2hlZDsKKwkJCSAgICAgIH0KKwkJCSAgfQorCQkgICAgICB9CisKKwkJICAgIGMgPSAqcCsrOworCQkgIH0KKyNlbmRpZgorCQllbHNlIGlmIChjID09IEwoJ1wwJykpCisJCSAgeworCQkgICAgLyogWyB1bnRlcm1pbmF0ZWQsIHRyZWF0IGFzIG5vcm1hbCBjaGFyYWN0ZXIuICAqLworCQkgICAgcCA9IHBfaW5pdDsKKwkJICAgIG4gPSBuX2luaXQ7CisJCSAgICBjID0gTCgnWycpOworCQkgICAgZ290byBub3JtYWxfbWF0Y2g7CisJCSAgfQorCQllbHNlCisJCSAgeworCQkgICAgaW50IGlzX3JhbmdlID0gMDsKKworI2lmZGVmIF9MSUJDCisJCSAgICBpbnQgaXNfc2VxdmFsID0gMDsKKworCQkgICAgaWYgKGMgPT0gTCgnWycpICYmICpwID09IEwoJy4nKSkKKwkJICAgICAgeworCQkJdWludDMyX3QgbnJ1bGVzID0KKwkJCSAgX05MX0NVUlJFTlRfV09SRCAoTENfQ09MTEFURSwgX05MX0NPTExBVEVfTlJVTEVTKTsKKwkJCWNvbnN0IENIQVIgKnN0YXJ0cCA9IHA7CisJCQlzaXplX3QgYzEgPSAwOworCisJCQl3aGlsZSAoMSkKKwkJCSAgeworCQkJICAgIGMgPSAqKytwOworCQkJIC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W0gKyAxXQorCQkJCQkJCSAgICAgICsgMV0sIGMxKSA9PSAwKQorCQkJCQkgIHsKKwkJCQkJICAgIC8qIFllcCwgdGhpcyBpcyB0aGUgZW50cnkuICAqLworCQkJCQkgICAgaWR4ID0gc3ltYl90YWJsZVsyICogZWxlbSArIDFdOworCQkJCQkgICAgaWR4ICs9IDEgKyBleHRyYVtpZHhdOworCQkJCQkgICAgYnJlYWs7CisJCQkJCSAgfQorCisJCQkJCS8qIE5leHQgZW50cnkuICAqLworCQkJCQllbGVtICs9IHNlY29uZDsKKwkJCQkgICAgICB9CisJCQkJICAgIHdoaWxlIChzeW1iX3RhYmxlWzIgKiBlbGVtXSAhPSAwKTsKKwkJCQkgIH0KKworCQkJCWlmIChzeW1iX3RhYmxlWzIgKiBlbGVtXSAhPSAwKQorCQkJCSAgeworCQkJCSAgICAvKiBDb21wYXJlIHRoZSBieXRlIHNlcXVlbmNlIGJ1dCBvbmx5IGlmCisJCQkJICAgICAgIHRoaXMgaXMgbm90IHBhcnQgb2YgYSByYW5nZS4gICovCisjIGlmIFdJREVfQ0hBUl9WRVJTSU9OCisJCQkJICAgIGludDMyX3QgKndleHRyYTsKKworCQkJCSAgICBpZHggKz0gMSArIGV4dHJhW2lkeF07CisJCQkJICAgIC8qIEFkanVzdCBmb3IgdGhlIGFsaWdubWVudC4gICovCisJCQkJICAgIGlkeCA9IChpZHggKyAzKSAmIH40OworCisJCQkJICAgIHdleHRyYSA9IChpbnQzMl90ICopICZleHRyYVtpZHggKyA0XTsKKyMgZW5kaWYKKwkJCQkgICAgLyogR2V0IHRoZSBjb2xsYXRpb24gc2VxdWVuY2UgdmFsdWUuICAqLworCQkJCSAgICBpc19zZXF2YWwgPSAxOworIyBpZiBXSURFX0NIQVJfVkVSU0lPTgorCQkJCSAgICBjZW5kID0gd2V4dHJhWzEgKyB3ZXh0cmFbaWR4XV07CisjIGVsc2UKKwkJCQkgICAgLyogQWRqdXN0IGZvciB0aGUgYWxpZ25tZW50LiAgK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wkJICB9CisJCWVsc2UgaWYgKGMgPT0gTCgnWycpICYmICpwID09IEwoJzonKSkKKwkJICB7CisJCSAgICBpbnQgYzEgPSAwOworCQkgICAgY29uc3QgQ0hBUiAqc3RhcnRwID0gcDsKKworCQkgICAgd2hpbGUgKDEpCisJCSAgICAgIHsKKwkJCWMgPSAqKytwOworCQkJaWYgKCsrYzEgPT0gQ0hBUl9DTEFTU19NQVhfTEVOR1RIKQorCQkJICByZXR1cm4gRk5NX05PTUFUQ0g7CisKKwkJCWlmICgqcCA9PSBMKCc6JykgJiYgcFsxXSA9PSBMKCddJykpCisJCQkgIGJyZWFrOworCisJCQlpZiAoYyA8IEwoJ2EnKSB8fCBjID49IEwoJ3onKSkKKwkJCSAgeworCQkJICAgIHAgPSBzdGFydHAgLSAyOworCQkJICAgIGJyZWFrOworCQkJICB9CisJCSAgICAgIH0KKwkJICAgIHAgKz0gMjsKKwkJICB9CisJCWVsc2UgaWYgKGMgPT0gTCgnWycpICYmICpwID09IEwoJz0nKSkKKwkJICB7CisJCSAgICBjID0gKisrcDsKKwkJICAgIGlmIChjID09IEwoJ1wwJykpCisJCSAgICAgIHJldHVybiBGTk1fTk9NQVRDSDsKKwkJICAgIGMgPSAqKytwOworCQkgICAgaWYgKGMgIT0gTCgnPScpIHx8IHBbMV0gIT0gTCgnXScpKQorCQkgICAgICByZXR1cm4gRk5NX05PTUFUQ0g7CisJCSAgICBwICs9IDI7CisJCSAgfQorCQllbHNlIGlmIChjID09IEwoJ1snKSAmJiAqcCA9PSBMKCcuJykpCisJCSAgeworCQkgICAgd2hpbGUgKDEpCisJCSAgICAgIHsKKwkJCWMgPSAqKytwOworCQkJaWYgKGMgPT0gTCgnXDAnKSkKKwkJCSAgcmV0dXJuIEZOTV9OT01BVENIOworCisJCQlpZiAoYyA9PSBMKCcuJykgJiYgcFsxXSA9PSBMKCddJykpCisJCQkgIGJyZWFrOworCQkgICAgICB9CisJCSAgICBwICs9IDI7CisJCSAgfQorCSAgICAgIH0KKwkgICAgaWYgKG5vdCkKKwkgICAgICByZXR1cm4gRk5NX05PTUFUQ0g7CisJICB9CisJICBicmVhazsKKworCWNhc2UgTCgnKycpOgorCWNhc2UgTCgnQCcpOgorCWNhc2UgTCgnIScpOgorCSAgaWYgKF9fYnVpbHRpbl9leHBlY3QgKGZsYWdzICYgRk5NX0VYVE1BVENILCAwKSAmJiAqcCA9PSAnKCcpCisJICAgIHsKKwkgICAgICBpbnQgcmVzID0gRVhUIChjLCBwLCBuLCBzdHJpbmdfZW5kLCBub19sZWFkaW5nX3BlcmlvZCwgZmxhZ3MsCisJCQkgICAgIGFsbG9jYV91c2VkKTsKKwkgICAgICBpZiAocmVzICE9IC0xKQorCQlyZXR1cm4gcmVzOworCSAgICB9CisJICBnb3RvIG5vcm1hbF9tYXRjaDsKKworCWNhc2UgTCgnLycpOgorCSAgaWYgKE5PX0xFQURJTkdfUEVSSU9EIChmbGFncykpCisJICAgIHsKKwkgICAgICBpZiAobiA9PSBzdHJpbmdfZW5kIHx8IGMgIT0gKFVDSEFSKSAqbikKKwkJcmV0dXJuIEZOTV9OT01BVENIOworCisJICAgICAgbmV3X25vX2xlYWRpbmdfcGVyaW9kID0gMTsKKwkgICAgICBicmVhazsKKwkgICAgfQorCSAgLyogRkFMTFRIUk9VR0ggKi8KKwlkZWZhdWx0OgorCW5vcm1hbF9tYXRjaDoKKwkgIGlmIChuID09IHN0cmluZ19lbmQgfHwgYyAhPSBGT0xEICgoVUNIQVIpICpuKSkKKwkgICAgcmV0dXJuIEZOTV9OT01BVENIOworCX0KKworICAgICAgbm9fbGVhZGluZ19wZXJpb2QgPSBuZXdfbm9fbGVhZGluZ19wZXJpb2Q7CisgICAgICArK247CisgICAgfQorCisgIGlmIChuID09IHN0cmluZ19lbmQpCisgICAgcmV0dXJuIDA7CisKKyAgaWYgKChmbGFncyAmIEZOTV9MRUFESU5HX0RJUikgJiYgbiAhPSBzdHJpbmdfZW5kICYmICpuID09IEwoJy8nKSkKKyAgICAvK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IGlzIG5vIHZhbGlkIHBhdHRlcm4uICAqLworCSAgICByZXR1cm4gcGF0dGVybjsKKyAgICAgIH0KKyAgICBlbHNlIGlmICgoKnAgPT0gTCgnPycpIHx8ICpwID09IEwoJyonKSB8fCAqcCA9PSBMKCcrJykgfHwgKnAgPT0gTCgnQCcpCisJICAgICAgfHwgKnAgPT0gTCgnIScpKSAmJiBwWzFdID09IEwoJygnKSkKKyAgICAgIHsKKwlwID0gRU5EIChwICsgMSk7CisJaWYgKCpwID09IEwoJ1wwJykpCisJICAvKiBUaGlzIGlzIGFuIGludmFsaWQgcGF0dGVybi4gICovCisJICByZXR1cm4gcGF0dGVybjsKKyAgICAgIH0KKyAgICBlbHNlIGlmICgqcCA9PSBMKCcpJykpCisgICAgICBicmVhazsKKworICByZXR1cm4gcCArIDE7Cit9CisKKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK0VYVCAoSU5UIG9wdCwgY29uc3QgQ0hBUiAqcGF0dGVybiwgY29uc3QgQ0hBUiAqc3RyaW5nLCBjb25zdCBDSEFSICpzdHJpbmdfZW5kLAorICAgICBpbnQgbm9fbGVhZGluZ19wZXJpb2QsIGludCBmbGFncywgc2l6ZV90IGFsbG9jYV91c2VkKQoreworICBjb25zdCBDSEFSICpzdGFydHA7CisgIGludCBsZXZlbDsKKyAgc3RydWN0IHBhdHRlcm5saXN0CisgIHsKKyAgICBzdHJ1Y3QgcGF0dGVybmxpc3QgKm5leHQ7CisgICAgQ0hBUiBtYWxsb2NlZDsKKyAgICBDSEFSIHN0clswXTsKKyAgfSAqbGlzdCA9IE5VTEw7CisgIHN0cnVjdCBwYXR0ZXJubGlzdCAqKmxhc3RwID0gJmxpc3Q7CisgIHNpemVfdCBwYXR0ZXJuX2xlbiA9IFNUUkxFTiAocGF0dGVybik7CisgIGludCBhbnlfbWFsbG9jZWQgPSAwOworICBjb25zdCBDSEFSICpwOworICBjb25zdCBDSEFSICpyczsKKyAgaW50IHJldHZhbCA9IDA7Cis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gIFwKKwkJICAgIGdvdG8gb3V0OwkJCQkJCSAgICAgIFwKKwkJICB9CQkJCQkJCSAgICAgIFwKKwkJYW55X21hbGxvY2VkID0gMTsJCQkJCSAgICAgIFwKKwkgICAgICB9CQkJCQkJCQkgICAgICBcCisJICAgIGVsc2UJCQkJCQkJICAgICAgXAorCSAgICAgIG5ld3AgPSBhbGxvY2FfYWNjb3VudCAoc2xlbiwgYWxsb2NhX3VzZWQpOwkJICAgICAgXAorCSAgICBuZXdwLT5uZXh0ID0gTlVMTDsJCQkJCQkgICAgICBcCisJICAgIG5ld3AtPm1hbGxvY2VkID0gbWFsbG9jZWQ7CQkJCQkgICAgICBcCisJICAgICooKENIQVIgKikgTUVNUENQWSAobmV3cC0+c3RyLCBzdGFydHAsIHAgLSBzdGFydHApKSA9IEwoJ1wwJyk7ICAgIFwKKwkgICAgKmxhc3RwID0gbmV3cDsJCQkJCQkgICAgICBcCisJICAgIGxhc3RwID0gJm5ld3AtPm5leHQKKwkgICAgTkVXX1BBVFRFUk47CisJICB9CisgICAgICB9CisgICAgZWxzZSBpZiAoKnAgPT0gTCgnfCcpKQorICAgICAgeworCWlmIChsZXZlbCA9PSAwKQorCSAgeworCSAgICBORVdfUEFUVEVSTjsKKwkgICAgc3RhcnRwID0gcCArIDE7CisJICB9CisgICAgICB9CisgIGFzc2VydCAobGlzdCAhPSBOVUxMKTsKKyAgYXNzZXJ0IChwWy0xXSA9PSBMKCcpJykpOworI3VuZGVmIE5FV19QQVRURVJOCisKKyAgc3dpdGNoIChvcHQpCisgICAgeworICAgIGNhc2UgTCgnKicpOgorICAgICAgaWYgKEZDVCAocCwgc3RyaW5nLCBzdHJpbmdfZW5kLCBub19sZWFkaW5nX3BlcmlvZCwgZmxhZ3MsIE5VTEwsCisJICAgICAgIGFsbG9jYV91c2VkKSA9PSAwKQorCWdvdG8gc3VjY2VzczsKKyAgICAgIC8qIEZBTExUSFJPVUdIICovCisKKyAgICBjYXNlIEwoJysnKToKKyAgICAgIG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xKSwgc3BlYywgc3BlY19sZW4gKyAxKTsKKwkgICAgICBhcmdzWzBdID0gYXJndjA7CisJICAgICAgYXJnc1sxXSA9ICItdiI7CisJICAgICAgYXJnc1syXSA9IHNwZWM7CisJICAgICAgbWVtY3B5ICgmYXJnc1szXSwgJmFyZ3ZbMV0sIGFyZ2MgKiBzaXplb2YgKGFyZ3ZbMV0pKTsKKwkgICAgICBleGVjdiAoZ2V0Y29uZl9uYW1lLCAoY2hhciAqIGNvbnN0ICopIGFyZ3MpOworCSAgICAgIGVycm9yICg0LCBlcnJubywgXygiQ291bGRuJ3QgZXhlY3V0ZSAlcyIpLCBnZXRjb25mX25hbWUpOworCSAgICB9CisJICBkZWZhdWx0OgorCSAgICBicmVhazsKKwl9CisgICAgfQorCisgIGlmIChhcmdjID4gMSAmJiBzdHJjbXAgKGFyZ3ZbMV0sICItYSIpID09IDApCisgICAgeworICAgICAgaWYgKGFyZ2MgPT0gMikKKwlwcmludF9hbGwgKCIvIik7CisgICAgICBlbHNlIGlmIChhcmdjID09IDMpCisJcHJpbnRfYWxsIChhcmd2WzJdKTsKKyAgICAgIGVsc2UKKwl1c2FnZSAoKTsKKyAgICB9CisKKyAgaW50IGFpID0gMTsKKyAgaWYgKGFyZ2MgPiBhaSAmJiBzdHJjbXAgKGFyZ3ZbYWldLCAiLS0iKSA9PSAwKQorICAgICsrYWk7CisKKyAgaWYgKGFyZ2MgLSBhaSA8IDEgfHwgYXJnYyAtIGFpID4gMikKKyAgICB1c2FnZSAoKTsKKworICBmb3IgKGMgPSB2YXJzOyBjLT5uYW1lICE9IE5VTEw7ICsrYykKKyAgICBpZiAoc3RyY21wIChjLT5uYW1lLCBhcmd2W2FpXSkgPT0gMAorCXx8IChzdHJuY21wIChjLT5uYW1lLCAiX1BPU0lYXyIsIDcpID09IDAKKwkgICAgJiYgc3RyY21wIChjLT5uYW1lICsgNywgYXJndlthaV0pID09IDApKQorICAgICAgeworCWxvbmcgaW50IHZhbHVlOworCXNpemVfdC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NlY29uZCBvciBsYXRlciBub25leGFjdCBtYXRjaCBmb3VuZC4gICovCisJCWFtYmlnID0gMTsKKwkgICAgfQorCWlmIChhbWJpZyAmJiAhZXhhY3QpCisJICB7CisJICAgIGlmIChwcmludF9lcnJvcnMpCisJICAgICAgeworI2lmIGRlZmluZWQgX0xJQkMKKwkJY2hhciAqYnVmOworCisJCWlmIChfX2FzcHJpbnRmICgmYnVmLCBfKCIlczogb3B0aW9uICctVyAlcycgaXMgYW1iaWd1b3VzXG4iKSwKKwkJCQlhcmd2WzBdLCBkLT5vcHRhcmcpID49IDApCisJCSAgeworCQkgICAgX0lPX2Zsb2NrZmlsZSAoc3RkZXJyKTsKKworCQkgICAgaW50IG9sZF9mbGFnczIgPSAoKF9JT19GSUxFICopIHN0ZGVyciktPl9mbGFnczI7CisJCSAgICAoKF9JT19GSUxFICopIHN0ZGVyciktPl9mbGFnczIgfD0gX0lPX0ZMQUdTMl9OT1RDQU5DRUw7CisKKwkJICAgIF9fZnhwcmludGYgKE5VTEwsICIlcyIsIGJ1Zik7CisKKwkJICAgICgoX0lPX0ZJTEUgKikgc3RkZXJyKS0+X2ZsYWdzMiA9IG9sZF9mbGFnczI7CisJCSAgICBfSU9fZnVubG9ja2ZpbGUgKHN0ZGVycik7CisKKwkJICAgIGZyZWUgKGJ1Zik7CisJCSAgfQorI2Vsc2UKKwkJZnByaW50ZiAoc3RkZXJyLCBfKCIlczogb3B0aW9uICctVyAlcycgaXMgYW1iaWd1b3VzXG4iKSwKKwkJCSBhcmd2WzBdLCBkLT5vcHRhcmcpOworI2VuZGlmCisJICAgICAgfQorCSAgICBkLT5fX25leHRjaGFyICs9IHN0cmxlbiAoZC0+X19uZXh0Y2hhcik7CisJICAgIGQtPm9wdGluZCsrOworCSAgICByZXR1cm4gJz8nOworCSAgfQorCWlmIChwZm91bmQgIT0gTlVMTCkKKwkgIHsKKwkgICAgb3B0aW9uX2luZGV4ID0gaW5kZm91bmQ7CisJICAgIGlmICgqbmFtZWV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QkgYXJndlswXSwgcGZvdW5kLT5uYW1lKTsKKyNlbmRpZgorCQkgICAgICB9CisJCSAgICBkLT5fX25leHRjaGFyICs9IHN0cmxlbiAoZC0+X19uZXh0Y2hhcik7CisJCSAgICByZXR1cm4gb3B0c3RyaW5nWzBdID09ICc6JyA/ICc6JyA6ICc/JzsKKwkJICB9CisJICAgICAgfQorCSAgICBlbHNlCisJICAgICAgZC0+b3B0YXJnID0gTlVMTDsKKwkgICAgZC0+X19uZXh0Y2hhciArPSBzdHJsZW4gKGQtPl9fbmV4dGNoYXIpOworCSAgICBpZiAobG9uZ2luZCAhPSBOVUxMKQorCSAgICAgICpsb25naW5kID0gb3B0aW9uX2luZGV4OworCSAgICBpZiAocGZvdW5kLT5mbGFnKQorCSAgICAgIHsKKwkJKihwZm91bmQtPmZsYWcpID0gcGZvdW5kLT52YWw7CisJCXJldHVybiAwOworCSAgICAgIH0KKwkgICAgcmV0dXJuIHBmb3VuZC0+dmFsOworCSAgfQorCisgICAgICBub19sb25nczoKKwlkLT5fX25leHRjaGFyID0gTlVMTDsKKwlyZXR1cm4gJ1cnOwkvKiBMZXQgdGhlIGFwcGxpY2F0aW9uIGhhbmRsZSBpdC4gICAqLworICAgICAgfQorICAgIGlmICh0ZW1wWzFdID09ICc6JykKKyAgICAgIHsKKwlpZiAodGVtcFsyXSA9PSAnOicpCisJICB7CisJICAgIC8qIFRoaXMgaXMgYW4gb3B0aW9uIHRoYXQgYWNjZXB0cyBhbiBhcmd1bWVudCBvcHRpb25hbGx5LiAgKi8KKwkgICAgaWYgKCpkLT5fX25leHRjaGFyICE9ICdcMCcpCisJICAgICAgeworCQlkLT5vcHRhcmcgPSBkLT5fX25leHRjaGFyOworCQlkLT5vcHRpbmQrKzsKKwkgICAgICB9CisJICAgIGVsc2UKKwkgICAgICBkLT5vcHRhcmcgPSBOVUxMOworCSAgICBkLT5fX25leHRjaGFyID0gTlVMTDsKKwkgIH0KKwllbHNlCisJICB7CisJICAgIC8qIFRoaXM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B0X2RhdGEub3B0YXJnOworICBvcHRvcHQgPSBnZXRvcHRfZGF0YS5vcHRvcHQ7CisKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CitnZXRvcHQgKGludCBhcmdjLCBjaGFyICpjb25zdCAqYXJndiwgY29uc3QgY2hhciAqb3B0c3RyaW5nKQoreworICByZXR1cm4gX2dldG9wdF9pbnRlcm5hbCAoYXJnYywgYXJndiwgb3B0c3RyaW5nLAorCQkJICAgKGNvbnN0IHN0cnVjdCBvcHRpb24gKikgMCwKKwkJCSAgIChpbnQgKikgMCwKKwkJCSAgIDAsIDApOworfQorCisjaWZkZWYgX0xJQkMKK2ludAorX19wb3NpeF9nZXRvcHQgKGludCBhcmdjLCBjaGFyICpjb25zdCAqYXJndiwgY29uc3QgY2hhciAqb3B0c3RyaW5nKQoreworICByZXR1cm4gX2dldG9wdF9pbnRlcm5hbCAoYXJnYywgYXJndiwgb3B0c3RyaW5nLAorCQkJICAgKGNvbnN0IHN0cnVjdCBvcHRpb24gKikgMCwKKwkJCSAgIChpbnQgKikgMCwKKwkJCSAgIDAsIDEpOworfQorI2VuZGlmCisKKyNlbmRpZgkvKiBOb3QgRUxJREVfQ09ERS4gICovCisMCisjaWZkZWYgVEVTVAorCisvKiBDb21waWxlIHdpdGggLURURVNUIHRvIG1ha2UgYW4gZXhlY3V0YWJsZSBmb3IgdXNlIGluIHRlc3RpbmcKKyAgIHRoZSBhYm92ZSBkZWZpbml0aW9uIG9mIGBnZXRvcHQnLiAgKi8KKworaW50CittYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCit7CisgIGludCBjOworICBpbnQgZGlnaXRfb3B0aW5kID0gMDsKKworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpbnQgdGhpc19vcHRpb25fb3B0aW5kID0gb3B0aW5kID8gb3B0aW5kIDogMTsKKworICAgICAgYyA9IGdldG9wdCAoYXJnYywgYXJndiwgImFiYzpkOjAxMjM0NTY3ODkiKTsKKyAgICAgIGlmIChjID09IC0xKQorCWJyZWFrOworCisgICAgICBzd2l0Y2ggKGMpCisJeworCWNhc2UgJzAnOgorCWNhc2UgJzEnOgorCWNhc2UgJzInOgorCWNhc2UgJzMnOgorCWNhc2UgJzQnOgorCWNhc2UgJzUnOgorCWNhc2UgJzYnOgorCWNhc2UgJzcnOgorCWNhc2UgJzgnOgorCWNhc2UgJzknOgorCSAgaWYgKGRpZ2l0X29wdGluZCAhPSAwICYmIGRpZ2l0X29wdGluZCAhPSB0aGlzX29wdGlvbl9vcHRpbmQpCisJICAgIHByaW50ZiAoImRpZ2l0cyBvY2N1ciBpbiB0d28gZGlmZmVyZW50IGFyZ3YtZWxlbWVudHMuXG4iKTsKKwkgIGRpZ2l0X29wdGluZCA9IHRoaXNfb3B0aW9uX29wdGluZDsKKwkgIHByaW50ZiAoIm9wdGlvbiAlY1xuIiwgYyk7CisJICBicmVhazsKKworCWNhc2UgJ2EnOgorCSAgcHJpbnRmICgib3B0aW9uIGFcbiIpOworCSAgYnJlYWs7CisKKwljYXNlICdiJzoKKwkgIHByaW50ZiAoIm9wdGlvbiBiXG4iKTsKKwkgIGJyZWFrOworCisJY2FzZSAnYyc6CisJICBwcmludGYgKCJvcHRpb24gYyB3aXRoIHZhbHVlICclcydcbiIsIG9wdGFyZyk7CisJICBicmVhazsKKworCWNhc2UgJz8nOgorCSAgYnJlYWs7CisKKwlkZWZhdWx0OgorCSAgcHJpbnRmICgiPz8gZ2V0b3B0IHJldHVybmVkIGNoYXJhY3RlciBjb2RlIDAlbyA/P1xuIiwgYyk7CisJfQorICAgIH0KKworICBpZiAob3B0aW5kIDwgYXJnYykKKyAgICB7CisgICAgICBwcmludGYgKCJub24tb3B0aW9uIEFSR1YtZWxlbWVudHM6ICIpOworICAgICAgd2hpbGUgKG9wdGluZCA8IGFyZ2MpCisJcHJpbnRmICgiJXMgIiwgYXJndltvcHRpbmQrK10pOworICAgICAgcHJpbnRmICgiXG4iKTsKKyAgICB9CisKKyAgZXhpdCAoMC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aW4sIGludCBmbGFncykgX19USFJPV05MOworCisjZW5kaWYgLyogIWRlZmluZWQgX0xJQkMgfHwgIWRlZmluZWQgR0xPQl9PTkxZX1AgKi8KKworI2lmbmRlZiBhdHRyaWJ1dGVfaGlkZGVuCisjIGRlZmluZSBhdHRyaWJ1dGVfaGlkZGVuCisjZW5kaWYKKworc3RhdGljIGludCBnbG9iX2luX2RpciAoY29uc3QgY2hhciAqcGF0dGVybiwgY29uc3QgY2hhciAqZGlyZWN0b3J5LAorCQkJaW50IGZsYWdzLCBpbnQgKCplcnJmdW5jKSAoY29uc3QgY2hhciAqLCBpbnQpLAorCQkJZ2xvYl90ICpwZ2xvYiwgc2l6ZV90IGFsbG9jYV91c2VkKTsKK2V4dGVybiBpbnQgX19nbG9iX3BhdHRlcm5fdHlwZSAoY29uc3QgY2hhciAqcGF0dGVybiwgaW50IHF1b3RlKQorICAgIGF0dHJpYnV0ZV9oaWRkZW47CisKKyNpZiAhZGVmaW5lZCBfTElCQyB8fCAhZGVmaW5lZCBHTE9CX09OTFlfUAorc3RhdGljIGludCBwcmVmaXhfYXJyYXkgKGNvbnN0IGNoYXIgKnByZWZpeCwgY2hhciAqKmFycmF5LCBzaXplX3QgbikgX19USFJPV05MOworc3RhdGljIGludCBjb2xsYXRlZF9jb21wYXJlIChjb25zdCB2b2lkICosIGNvbnN0IHZvaWQgKikgX19USFJPV05MOworCisKKy8qIEZpbmQgdGhlIGVuZCBvZiB0aGUgc3ViLXBhdHRlcm4gaW4gYSBicmFjZSBleHByZXNzaW9uLiAgKi8KK3N0YXRpYyBjb25zdCBjaGFyICoKK25leHRfYnJhY2Vfc3ViIChjb25zdCBjaGFyICpjcCwgaW50IGZsYWdzKQoreworICBzaXplX3QgZGVwdGggPSAwOworICB3aGlsZSAoKmNwICE9ICdcMCcpCisgICAgaWYgKChmbGFncyAmIEdMT0JfTk9FU0NBUEUpID09IDAgJiYgKmNwID09ICdcXCcpCisgICAgICB7CisJaWYgKCorK2NwID09ICdcM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ICBpZiAoX19nbGliY191bmxpa2VseSAobWFsbG9jX2Rpcm5hbWUpKQorCQlmcmVlIChkaXJuYW1lKTsKKworCSAgICAgIGRpcm5hbWUgPSBob21lX2RpcjsKKwkgICAgICBkaXJsZW4gPSBzdHJsZW4gKGRpcm5hbWUpOworCSAgICAgIG1hbGxvY19kaXJuYW1lID0gbWFsbG9jX2hvbWVfZGlyOworCSAgICB9CisJICBlbHNlCisJICAgIHsKKwkgICAgICBjaGFyICpuZXdwOworCSAgICAgIHNpemVfdCBob21lX2xlbiA9IHN0cmxlbiAoaG9tZV9kaXIpOworCSAgICAgIGludCB1c2VfYWxsb2NhID0gX19saWJjX3VzZV9hbGxvY2EgKGFsbG9jYV91c2VkCisJCQkJCQkgICsgaG9tZV9sZW4gKyBkaXJsZW4pOworCSAgICAgIGlmICh1c2VfYWxsb2NhKQorCQluZXdwID0gYWxsb2NhX2FjY291bnQgKGhvbWVfbGVuICsgZGlybGVuLCBhbGxvY2FfdXNlZCk7CisJICAgICAgZWxzZQorCQl7CisJCSAgbmV3cCA9IG1hbGxvYyAoaG9tZV9sZW4gKyBkaXJsZW4pOworCQkgIGlmIChuZXdwID09IE5VTEwpCisJCSAgICB7CisJCSAgICAgIGlmIChfX2dsaWJjX3VubGlrZWx5IChtYWxsb2NfaG9tZV9kaXIpKQorCQkJZnJlZSAoaG9tZV9kaXIpOworCQkgICAgICByZXR2YWwgPSBHTE9CX05PU1BBQ0U7CisJCSAgICAgIGdvdG8gb3V0OworCQkgICAgfQorCQl9CisKKwkgICAgICBtZW1wY3B5IChtZW1wY3B5IChuZXdwLCBob21lX2RpciwgaG9tZV9sZW4pLAorCQkgICAgICAgJmRpcm5hbWVbMV0sIGRpcmxlbik7CisKKwkgICAgICBpZiAoX19nbGliY191bmxpa2VseSAobWFsbG9jX2Rpcm5hbWUpKQorCQlmcmVlIChkaXJuYW1lKTsKKworCSAgICAgIGRpcm5hbWUgPSBuZXdwOworCSAgICAgIGRpcmxlbiArPSBob21lX2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LCBkaXJsZW4pOworCSplbmRwKysgPSBESVJTRVBfQ0hBUjsKKwltZW1wY3B5IChlbmRwLCBhcnJheVtpXSwgZWx0bGVuKTsKKyAgICAgIH0KKyAgICAgIGZyZWUgKGFycmF5W2ldKTsKKyAgICAgIGFycmF5W2ldID0gbmV3OworICAgIH0KKworICByZXR1cm4gMDsKK30KKworCisvKiBXZSBtdXN0IG5vdCBjb21waWxlIHRoaXMgZnVuY3Rpb24gdHdpY2UuICAqLworI2lmICFkZWZpbmVkIF9MSUJDIHx8ICFkZWZpbmVkIE5PX0dMT0JfUEFUVEVSTl9QCitpbnQKK19fZ2xvYl9wYXR0ZXJuX3R5cGUgKGNvbnN0IGNoYXIgKnBhdHRlcm4sIGludCBxdW90ZSkKK3sKKyAgY29uc3QgY2hhciAqcDsKKyAgaW50IHJldCA9IDA7CisKKyAgZm9yIChwID0gcGF0dGVybjsgKnAgIT0gJ1wwJzsgKytwKQorICAgIHN3aXRjaCAoKnApCisgICAgICB7CisgICAgICBjYXNlICc/JzoKKyAgICAgIGNhc2UgJyonOgorCXJldHVybiAxOworCisgICAgICBjYXNlICdcXCc6CisJaWYgKHF1b3RlKQorCSAgeworCSAgICBpZiAocFsxXSAhPSAnXDAnKQorCSAgICAgICsrcDsKKwkgICAgcmV0IHw9IDI7CisJICB9CisJYnJlYWs7CisKKyAgICAgIGNhc2UgJ1snOgorCXJldCB8PSA0OworCWJyZWFrOworCisgICAgICBjYXNlICddJzoKKwlpZiAocmV0ICYgNCkKKwkgIHJldHVybiAxOworCWJyZWFrOworICAgICAgfQorCisgIHJldHVybiByZXQ7Cit9CisKKy8qIFJldHVybiBub256ZXJvIGlmIFBBVFRFUk4gY29udGFpbnMgYW55IG1ldGFjaGFyYWN0ZXJzLgorICAgTWV0YWNoYXJhY3RlcnMgY2FuIGJlIHF1b3RlZCB3aXRoIGJhY2tzbGFzaGVzIGlmIFFVT1RFIGlzIG5vbnplcm8uICAqLworaW50CitfX2dsb2JfcGF0dGVybl9w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XJyICE9IFJFR19OT0VSUk9SLCAwKSkKKwkgICAgcmV0dXJuIGVycjsKKwkgIGlmIChub2RlLT5wYXJlbnQgPT0gTlVMTCkKKwkgICAgcmV0dXJuIFJFR19OT0VSUk9SOworCSAgcHJldiA9IG5vZGU7CisJICBub2RlID0gbm9kZS0+cGFyZW50OworCX0KKyAgICAgIC8qIEdvIHVwIHdoaWxlIHdlIGhhdmUgYSBub2RlIHRoYXQgaXMgcmVhY2hlZCBmcm9tIHRoZSByaWdodC4gICovCisgICAgICB3aGlsZSAobm9kZS0+cmlnaHQgPT0gcHJldiB8fCBub2RlLT5yaWdodCA9PSBOVUxMKTsKKyAgICAgIG5vZGUgPSBub2RlLT5yaWdodDsKKyAgICB9Cit9CisKK3N0YXRpYyByZWdfZXJyY29kZV90CitwcmVvcmRlciAoYmluX3RyZWVfdCAqcm9vdCwgcmVnX2VycmNvZGVfdCAoZm4gKHZvaWQgKiwgYmluX3RyZWVfdCAqKSksCisJICB2b2lkICpleHRyYSkKK3sKKyAgYmluX3RyZWVfdCAqbm9kZTsKKworICBmb3IgKG5vZGUgPSByb290OyA7ICkKKyAgICB7CisgICAgICByZWdfZXJyY29kZV90IGVyciA9IGZuIChleHRyYSwgbm9kZSk7CisgICAgICBpZiAoQkUgKGVyciAhPSBSRUdfTk9FUlJPUiwgMCkpCisJcmV0dXJuIGVycjsKKworICAgICAgLyogR28gdG8gdGhlIGxlZnQgbm9kZSwgb3IgdXAgYW5kIHRvIHRoZSByaWdodC4gICovCisgICAgICBpZiAobm9kZS0+bGVmdCkKKwlub2RlID0gbm9kZS0+bGVmdDsKKyAgICAgIGVsc2UKKwl7CisJICBiaW5fdHJlZV90ICpwcmV2ID0gTlVMTDsKKwkgIHdoaWxlIChub2RlLT5yaWdodCA9PSBwcmV2IHx8IG5vZGUtPnJpZ2h0ID09IE5VTEwpCisJICAgIHsKKwkgICAgICBwcmV2ID0gbm9kZTsKKwkgICAgICBub2RlID0gbm9kZS0+cGFyZW50OworCSA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KikgZXh0cmE7CisgIGlmIChub2RlLT50b2tlbi50eXBlID09IENPTkNBVCkKKyAgICB7CisgICAgICBub2RlLT5maXJzdCA9IG5vZGUtPmxlZnQtPmZpcnN0OworICAgICAgbm9kZS0+bm9kZV9pZHggPSBub2RlLT5sZWZ0LT5ub2RlX2lkeDsKKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBub2RlLT5maXJzdCA9IG5vZGU7CisgICAgICBub2RlLT5ub2RlX2lkeCA9IHJlX2RmYV9hZGRfbm9kZSAoZGZhLCBub2RlLT50b2tlbik7CisgICAgICBpZiAoQkUgKG5vZGUtPm5vZGVfaWR4ID09IC0xLCAwKSkKKwlyZXR1cm4gUkVHX0VTUEFDRTsKKyAgICAgIGlmIChub2RlLT50b2tlbi50eXBlID09IEFOQ0hPUikKKwlkZmEtPm5vZGVzW25vZGUtPm5vZGVfaWR4XS5jb25zdHJhaW50ID0gbm9kZS0+dG9rZW4ub3ByLmN0eF90eXBlOworICAgIH0KKyAgcmV0dXJuIFJFR19OT0VSUk9SOworfQorCisvKiBQYXNzIDI6IGNvbXB1dGUgTkVYVCBvbiB0aGUgdHJlZS4gIFByZW9yZGVyIHZpc2l0LiAgKi8KK3N0YXRpYyByZWdfZXJyY29kZV90CitjYWxjX25leHQgKHZvaWQgKmV4dHJhLCBiaW5fdHJlZV90ICpub2RlKQoreworICBzd2l0Y2ggKG5vZGUtPnRva2VuLnR5cGUpCisgICAgeworICAgIGNhc2UgT1BfRFVQX0FTVEVSSVNLOgorICAgICAgbm9kZS0+bGVmdC0+bmV4dCA9IG5vZGU7CisgICAgICBicmVhazsKKyAgICBjYXNlIENPTkNBVDoKKyAgICAgIG5vZGUtPmxlZnQtPm5leHQgPSBub2RlLT5yaWdodC0+Zmlyc3Q7CisgICAgICBub2RlLT5yaWdodC0+bmV4dCA9IG5vZGUtPm5leHQ7CisgICAgICBicmVhazsKKyAgICBkZWZhdWx0OgorICAgICAgaWYgKG5vZGUtPmxlZnQpCisJbm9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UuICAqLworICAgICAgZGZhLT5vcmdfaW5kaWNlc1tkdXBfaWR4XSA9IG9yZ19pZHg7CisgICAgfQorICByZXR1cm4gZHVwX2lkeDsKK30KKworc3RhdGljIHJlZ19lcnJjb2RlX3QKK2NhbGNfaW52ZWNsb3N1cmUgKHJlX2RmYV90ICpkZmEpCit7CisgIGludCBzcmMsIGlkeCwgcmV0OworICBmb3IgKGlkeCA9IDA7IGlkeCA8IGRmYS0+bm9kZXNfbGVuOyArK2lkeCkKKyAgICByZV9ub2RlX3NldF9pbml0X2VtcHR5IChkZmEtPmludmVjbG9zdXJlcyArIGlkeCk7CisKKyAgZm9yIChzcmMgPSAwOyBzcmMgPCBkZmEtPm5vZGVzX2xlbjsgKytzcmMpCisgICAgeworICAgICAgaW50ICplbGVtcyA9IGRmYS0+ZWNsb3N1cmVzW3NyY10uZWxlbXM7CisgICAgICBmb3IgKGlkeCA9IDA7IGlkeCA8IGRmYS0+ZWNsb3N1cmVzW3NyY10ubmVsZW07ICsraWR4KQorCXsKKwkgIHJldCA9IHJlX25vZGVfc2V0X2luc2VydF9sYXN0IChkZmEtPmludmVjbG9zdXJlcyArIGVsZW1zW2lkeF0sIHNyYyk7CisJICBpZiAoQkUgKHJldCA9PSAtMSwgMCkpCisJICAgIHJldHVybiBSRUdfRVNQQUNFOworCX0KKyAgICB9CisKKyAgcmV0dXJuIFJFR19OT0VSUk9SOworfQorCisvKiBDYWxjdWxhdGUgImVjbG9zdXJlIiBmb3IgYWxsIHRoZSBub2RlIGluIERGQS4gICovCisKK3N0YXRpYyByZWdfZXJyY29kZV90CitjYWxjX2VjbG9zdXJlIChyZV9kZmFfdCAqZGZhKQoreworICBpbnQgbm9kZV9pZHgsIGluY29tcGxldGU7CisjaWZkZWYgREVCVUcKKyAgYXNzZXJ0IChkZmEtPm5vZGVzX2xlbiA+IDApOworI2VuZGlmCisgIGluY29tcGxldGUgPSAwOworICAvKiBGb3IgZWFjaCBub2RlcywgY2FsY3VsYXRlIGVwc2l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IGNhc2UgJzgnOiBjYXNlICc5JzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0JLX1JFRlMpKQorCSAgICB7CisJICAgICAgdG9rZW4tPnR5cGUgPSBPUF9CQUNLX1JFRjsKKwkgICAgICB0b2tlbi0+b3ByLmlkeCA9IGMyIC0gJzEnOworCSAgICB9CisJICBicmVhazsKKwljYXNlICc8JzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0dOVV9PUFMpKQorCSAgICB7CisJICAgICAgdG9rZW4tPnR5cGUgPSBBTkNIT1I7CisJICAgICAgdG9rZW4tPm9wci5jdHhfdHlwZSA9IFdPUkRfRklSU1Q7CisJICAgIH0KKwkgIGJyZWFrOworCWNhc2UgJz4nOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHsKKwkgICAgICB0b2tlbi0+dHlwZSA9IEFOQ0hPUjsKKwkgICAgICB0b2tlbi0+b3ByLmN0eF90eXBlID0gV09SRF9MQVNUOworCSAgICB9CisJICBicmVhazsKKwljYXNlICdiJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0dOVV9PUFMpKQorCSAgICB7CisJICAgICAgdG9rZW4tPnR5cGUgPSBBTkNIT1I7CisJICAgICAgdG9rZW4tPm9wci5jdHhfdHlwZSA9IFdPUkRfREVMSU07CisJICAgIH0KKwkgIGJyZWFrOworCWNhc2UgJ0InOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHsKKwkgICAgICB0b2tlbi0+dHlwZSA9IEFOQ0hPUjsKKwkgICAgICB0b2tlbi0+b3ByLmN0eF90eXBlID0gTk9UX1dPUkRfREVMSU07CisJICAgIH0KKwkgIGJyZWFrOworCWNhc2UgJ3cnOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfV09SRDsKKwkgIGJyZWFrOworCWNhc2UgJ1cnOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfTk9UV09SRDsKKwkgIGJyZWFrOworCWNhc2UgJ3MnOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfU1BBQ0U7CisJICBicmVhazsKKwljYXNlICdTJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0dOVV9PUFMpKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX05PVFNQQUNFOworCSAgYnJlYWs7CisJY2FzZSAnYCc6CisJICBpZiAoIShzeW50YXggJiBSRV9OT19HTlVfT1BTKSkKKwkgICAgeworCSAgICAgIHRva2VuLT50eXBlID0gQU5DSE9SOworCSAgICAgIHRva2VuLT5vcHIuY3R4X3R5cGUgPSBCVUZfRklSU1Q7CisJICAgIH0KKwkgIGJyZWFrOworCWNhc2UgJ1wnJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0dOVV9PUFMpKQorCSAgICB7CisJICAgICAgdG9rZW4tPnR5cGUgPSBBTkNIT1I7CisJICAgICAgdG9rZW4tPm9wci5jdHhfdHlwZSA9IEJVRl9MQVNUOworCSAgICB9CisJICBicmVhazsKKwljYXNlICcoJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0JLX1BBUkVOUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfT1BFTl9TVUJFWFA7CisJICBicmVhazsKKwljYXNlICcpJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0JLX1BBUkVOUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfQ0xPU0VfU1VCRVhQOworCSAgYnJlYWs7CisJY2FzZSAnKyc6CisJICBpZiAoIShzeW50YXggJiBSRV9MSU1JVEVEX09QUykgJiYgKHN5bnRheCAmIFJFX0JLX1BMVVNfUU0pKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX0RVUF9QTFVTOworCSAgYnJlYWs7CisJY2FzZSAnPyc6CisJICBpZiAoIShzeW50YXggJiBSRV9MSU1JVEVEX09QUykgJiYgKHN5bnRheCAmIFJFX0JLX1BMVVNfUU0pKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX0RVUF9RVUVTVElPTjsKKwkgIGJyZWFrOworCWNhc2UgJ3snOgorCSAgaWYgKChzeW50YXggJiBSRV9JTlRFUlZBTFMpICYmICghKHN5bnRheCAmIFJFX05PX0JLX0JSQUNFUykpKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX09QRU5fRFVQX05VTTsKKwkgIGJyZWFrOworCWNhc2UgJ30nOgorCSAgaWYgKChzeW50YXggJiBSRV9JTlRFUlZBTFMpICYmICghKHN5bnRheCAmIFJFX05PX0JLX0JSQUNFUykpKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX0NMT1NFX0RVUF9OVU07CisJICBicmVhazsKKwlkZWZhdWx0OgorCSAgYnJlYWs7CisJfQorICAgICAgcmV0dXJuIDI7CisgICAgfQorCisgIHRva2VuLT50eXBlID0gQ0hBUkFDVEVSOworI2lmZGVmIFJFX0VOQUJMRV9JMThOCisgIGlmIChpbnB1dC0+bWJfY3VyX21heCA+IDEpCisgICAgeworICAgICAgd2ludF90IHdjID0gcmVfc3RyaW5nX3djaGFyX2F0IChpbnB1dCwgcmVfc3RyaW5nX2N1cl9pZHggKGlucHV0KSk7CisgICAgICB0b2tlbi0+d29yZF9jaGFyID0gSVNfV0lERV9XT1JEX0NIQVIgKHdjKSAhPSAwOworICAgIH0KKyAgZWxzZQorI2VuZGlmCisgICAgdG9rZW4tPndvcmRfY2hhciA9IElTX1dPUkRfQ0hBUiAodG9rZW4tPm9wci5jKTsKKworICBzd2l0Y2ggKGMpCisgICAgeworICAgIGNhc2UgJ1xuJzoKKyAgICAgIGlmIChzeW50YXggJiBSRV9ORVdMSU5FX0FMVCkKKwl0b2tlbi0+dHlwZSA9IE9QX0FMVDsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJ3wnOgorICAgICAgaWYgKCEoc3ludGF4ICYgUkVfTElNSVRFRF9PUFMpICYmIChzeW50YXggJiBSRV9OT19CS19WQkFSKSkKKwl0b2tlbi0+dHlwZSA9IE9QX0FMVDsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJyonOgorICAgICAgdG9rZW4tPnR5cGUgPSBPUF9EVVBfQVNURVJJU0s7CisgICAgICBicmVhazsKKyAgICBjYXNlICcrJzoKKyAgICAgIGlmICghKHN5bnRheCAmIFJFX0xJTUlURURfT1BTKSAmJiAhKHN5bnRheCAmIFJFX0JLX1BMVVNfUU0pKQorCXRva2VuLT50eXBlID0gT1BfRFVQX1BMVVM7CisgICAgICBicmVhazsKKyAgICBjYXNlICc/JzoKKyAgICAgIGlmICghKHN5bnRheCAmIFJFX0xJTUlURURfT1BTKSAmJiAhKHN5bnRheCAmIFJFX0JLX1BMVVNfUU0pKQorCXRva2VuLT50eXBlID0gT1BfRFVQX1FVRVNUSU9OOworICAgICAgYnJlYWs7CisgICAgY2FzZSAneyc6CisgICAgICBpZiAoKHN5bnRheCAmIFJFX0lOVEVSVkFMUykgJiYgKHN5bnRheCAmIFJFX05PX0JLX0JSQUNFUykpCisJdG9rZW4tPnR5cGUgPSBPUF9PUEVOX0RVUF9OVU07CisgICAgICBicmVhazsKKyAgICBjYXNlICd9JzoKKyAgICAgIGlmICgoc3ludGF4ICYgUkVfSU5URVJWQUxTKSAmJiAoc3ludGF4ICYgUkVfTk9fQktfQlJBQ0VTKSkKKwl0b2tlbi0+dHlwZSA9IE9QX0NMT1NFX0RVUF9OVU07CisgICAgICBicmVhazsKKyAgICBjYXNlICcoJzoKKyAgICAgIGlmIChzeW50YXggJiBSRV9OT19CS19QQVJFTlMpCisJdG9rZW4tPnR5cGUgPSBPUF9PUEVOX1NVQkVYUDsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJyknOgorICAgICAgaWYgKHN5bnRheCAmIFJFX05PX0JLX1BBUkVOUykKKwl0b2tlbi0+dHlwZSA9IE9QX0NMT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AgICAgIHRva2VuLT50eXBlID0gQU5DSE9SOworICAgICAgdG9rZW4tPm9wci5jdHhfdHlwZSA9IExJTkVfTEFTVDsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgICBicmVhazsKKyAgICB9CisgIHJldHVybiAxOworfQorCisvKiBQZWVrIGEgdG9rZW4gZnJvbSBJTlBVVCwgYW5kIHJldHVybiB0aGUgbGVuZ3RoIG9mIHRoZSB0b2tlbi4KKyAgIFdlIG11c3Qgbm90IHVzZSB0aGlzIGZ1bmN0aW9uIG91dCBvZiBicmFja2V0IGV4cHJlc3Npb25zLiAgKi8KKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK3BlZWtfdG9rZW5fYnJhY2tldCAocmVfdG9rZW5fdCAqdG9rZW4sIHJlX3N0cmluZ190ICppbnB1dCwgcmVnX3N5bnRheF90IHN5bnRheCkKK3sKKyAgdW5zaWduZWQgY2hhciBjOworICBpZiAocmVfc3RyaW5nX2VvaSAoaW5wdXQpKQorICAgIHsKKyAgICAgIHRva2VuLT50eXBlID0gRU5EX09GX1JFOworICAgICAgcmV0dXJuIDA7CisgICAgfQorICBjID0gcmVfc3RyaW5nX3BlZWtfYnl0ZSAoaW5wdXQsIDApOworICB0b2tlbi0+b3ByLmMgPSBjOworCisjaWZkZWYgUkVfRU5BQkxFX0kxOE4KKyAgaWYgKGlucHV0LT5tYl9jdXJfbWF4ID4gMSAmJgorICAgICAgIXJlX3N0cmluZ19maXJzdF9ieXRlIChpbnB1dCwgcmVfc3RyaW5nX2N1cl9pZHggKGlucHV0KSkpCisgICAgeworICAgICAgdG9rZW4tPnR5cGUgPSBDSEFSQUNURVI7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisjZW5kaWYgLyogUkVfRU5BQkxFX0kxOE4gKi8KKworICBpZiAoYyA9PSAnXFwnICYmIChzeW50YXggJiBSRV9CQUNLU0xBU0hfRVNDQVBFX0lOX0xJU1RTKQorICAgICAgJiYgcmVfc3RyaW5nX2N1cl9pZHggKGlucHV0KSArIDEgPCByZV9zdHJpbmdfbGVuZ3RoIChpbnB1dCkpCisgICAgeworICAgICAgLyogSW4gdGhpcyBjYXNlLCAnXCcgZXNjYXBlIGEgY2hhcmFjdGVyLiAgKi8KKyAgICAgIHVuc2lnbmVkIGNoYXIgYzI7CisgICAgICByZV9zdHJpbmdfc2tpcF9ieXRlcyAoaW5wdXQsIDEpOworICAgICAgYzIgPSByZV9zdHJpbmdfcGVla19ieXRlIChpbnB1dCwgMCk7CisgICAgICB0b2tlbi0+b3ByLmMgPSBjMjsKKyAgICAgIHRva2VuLT50eXBlID0gQ0hBUkFDVEVSOworICAgICAgcmV0dXJuIDE7CisgICAgfQorICBpZiAoYyA9PSAnWycpIC8qICdbJyBpcyBhIHNwZWNpYWwgY2hhciBpbiBhIGJyYWNrZXQgZXhwcy4gICovCisgICAgeworICAgICAgdW5zaWduZWQgY2hhciBjMjsKKyAgICAgIGludCB0b2tlbl9sZW47CisgICAgICBpZiAocmVfc3RyaW5nX2N1cl9pZHggKGlucHV0KSArIDEgPCByZV9zdHJpbmdfbGVuZ3RoIChpbnB1dCkpCisJYzIgPSByZV9zdHJpbmdfcGVla19ieXRlIChpbnB1dCwgMSk7CisgICAgICBlbHNlCisJYzIgPSAwOworICAgICAgdG9rZW4tPm9wci5jID0gYzI7CisgICAgICB0b2tlbl9sZW4gPSAyOworICAgICAgc3dpdGNoIChjMikKKwl7CisJY2FzZSAnLic6CisJICB0b2tlbi0+dHlwZSA9IE9QX09QRU5fQ09MTF9FTEVNOworCSAgYnJlYWs7CisJY2FzZSAnPSc6CisJICB0b2tlbi0+dHlwZSA9IE9QX09QRU5fRVFVSVZfQ0xBU1M7CisJICBicmVhazsKKwljYXNlICc6JzoKKwkgIGlmIChzeW50YXggJiBSRV9DSEFSX0NMQVNTRVMpCisJICAgIHsKKwkgICAgICB0b2tlbi0+dHlwZSA9IE9QX09QRU5fQ0hBUl9DTEFTUzsKKwkgICAgICBicmVhaz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mQgb2YgcmVndWxhciBleHByZXNzaW9uLiAgKi8KKworc3RhdGljIGJpbl90cmVlX3QgKgorcGFyc2UgKHJlX3N0cmluZ190ICpyZWdleHAsIHJlZ2V4X3QgKnByZWcsIHJlZ19zeW50YXhfdCBzeW50YXgsCisgICAgICAgcmVnX2VycmNvZGVfdCAqZXJyKQoreworICByZV9kZmFfdCAqZGZhID0gKHJlX2RmYV90ICopIHByZWctPmJ1ZmZlcjsKKyAgYmluX3RyZWVfdCAqdHJlZSwgKmVvciwgKnJvb3Q7CisgIHJlX3Rva2VuX3QgY3VycmVudF90b2tlbjsKKyAgZGZhLT5zeW50YXggPSBzeW50YXg7CisgIGZldGNoX3Rva2VuICgmY3VycmVudF90b2tlbiwgcmVnZXhwLCBzeW50YXggfCBSRV9DQVJFVF9BTkNIT1JTX0hFUkUpOworICB0cmVlID0gcGFyc2VfcmVnX2V4cCAocmVnZXhwLCBwcmVnLCAmY3VycmVudF90b2tlbiwgc3ludGF4LCAwLCBlcnIpOworICBpZiAoQkUgKCplcnIgIT0gUkVHX05PRVJST1IgJiYgdHJlZSA9PSBOVUxMLCAwKSkKKyAgICByZXR1cm4gTlVMTDsKKyAgZW9yID0gY3JlYXRlX3RyZWUgKGRmYSwgTlVMTCwgTlVMTCwgRU5EX09GX1JFKTsKKyAgaWYgKHRyZWUgIT0gTlVMTCkKKyAgICByb290ID0gY3JlYXRlX3RyZWUgKGRmYSwgdHJlZSwgZW9yLCBDT05DQVQpOworICBlbHNlCisgICAgcm9vdCA9IGVvcjsKKyAgaWYgKEJFIChlb3IgPT0gTlVMTCB8fCByb290ID09IE5VTEwsIDApKQorICAgIHsKKyAgICAgICplcnIgPSBSRUdfRVNQQUNFOworICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorICByZXR1cm4gcm9vdDsKK30KKworLyogVGhpcyBmdW5jdGlvbiBidWlsZCB0aGUgZm9sbG93aW5nIHRyZWUsIGZyb20gcmVndWxhciBleHByZXNzaW9uCisgICA8YnJhb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oIShzeW50YXggJiBSRV9JTlZBTElEX0lOVEVSVkFMX09SRCksIDApKQorCSAgICB7CisJICAgICAgaWYgKHRva2VuLT50eXBlID09IEVORF9PRl9SRSkKKwkJKmVyciA9IFJFR19FQlJBQ0U7CisJICAgICAgZWxzZQorCQkqZXJyID0gUkVHX0JBREJSOworCisJICAgICAgcmV0dXJuIE5VTEw7CisJICAgIH0KKworCSAgLyogSWYgdGhlIHN5bnRheCBiaXQgaXMgc2V0LCByb2xsYmFjay4gICovCisJICByZV9zdHJpbmdfc2V0X2luZGV4IChyZWdleHAsIHN0YXJ0X2lkeCk7CisJICAqdG9rZW4gPSBzdGFydF90b2tlbjsKKwkgIHRva2VuLT50eXBlID0gQ0hBUkFDVEVSOworCSAgLyogbWJfcGFydGlhbCBhbmQgd29yZF9jaGFyIGJpdHMgc2hvdWxkIGJlIGFscmVhZHkgaW5pdGlhbGl6ZWQgYnkKKwkgICAgIHBlZWtfdG9rZW4uICAqLworCSAgcmV0dXJuIGVsZW07CisJfQorCisgICAgICBpZiAoQkUgKChlbmQgIT0gLTEgJiYgc3RhcnQgPiBlbmQpIHx8IHRva2VuLT50eXBlICE9IE9QX0NMT1NFX0RVUF9OVU0sIDApKQorCXsKKwkgIC8qIEZpcnN0IG51bWJlciBncmVhdGVyIHRoYW4gc2Vjb25kLiAgKi8KKwkgICplcnIgPSBSRUdfQkFEQlI7CisJICByZXR1cm4gTlVMTDsKKwl9CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgc3RhcnQgPSAodG9rZW4tPnR5cGUgPT0gT1BfRFVQX1BMVVMpID8gMSA6IDA7CisgICAgICBlbmQgPSAodG9rZW4tPnR5cGUgPT0gT1BfRFVQX1FVRVNUSU9OKSA/IDEgOiAtMTsKKyAgICB9CisKKyAgZmV0Y2hfdG9rZW4gKHRva2VuLCByZWdleHAsIHN5bnRheCk7CisKKyAgaWYgKEJFIChlbGVtID09IE5VTEwsIDApKQorICAgIHJldHVybiBOVUxMOworICBpZiAoQkU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VzOworICBpbnQzMl90IHRhYmxlX3NpemU7CisgIGNvbnN0IGludDMyX3QgKnN5bWJfdGFibGU7CisgIGNvbnN0IHVuc2lnbmVkIGNoYXIgKmV4dHJhOworCisgIC8qIExvY2FsIGZ1bmN0aW9uIGZvciBwYXJzZV9icmFja2V0X2V4cCB1c2VkIGluIF9MSUJDIGVudmlyb25tZW50LgorICAgICBTZWVrIHRoZSBjb2xsYXRpbmcgc3ltYm9sIGVudHJ5IGNvcnJlc3BvbmRpbmcgdG8gTkFNRS4KKyAgICAgUmV0dXJuIHRoZSBpbmRleCBvZiB0aGUgc3ltYm9sIGluIHRoZSBTWU1CX1RBQkxFLAorICAgICBvciAtMSBpZiBub3QgZm91bmQuICAqLworCisgIGF1dG8gaW5saW5lIGludDMyX3QKKyAgX19hdHRyaWJ1dGVfXyAoKGFsd2F5c19pbmxpbmUpKQorICBzZWVrX2NvbGxhdGluZ19zeW1ib2xfZW50cnkgKGNvbnN0IHVuc2lnbmVkIGNoYXIgKm5hbWUsIHNpemVfdCBuYW1lX2xlbikKKyAgICB7CisgICAgICBpbnQzMl90IGVsZW07CisKKyAgICAgIGZvciAoZWxlbSA9IDA7IGVsZW0gPCB0YWJsZV9zaXplOyBlbGVtKyspCisJaWYgKHN5bWJfdGFibGVbMiAqIGVsZW1dICE9IDApCisJICB7CisJICAgIGludDMyX3QgaWR4ID0gc3ltYl90YWJsZVsyICogZWxlbSArIDFdOworCSAgICAvKiBTa2lwIHRoZSBuYW1lIG9mIGNvbGxhdGluZyBlbGVtZW50IG5hbWUuICAqLworCSAgICBpZHggKz0gMSArIGV4dHJhW2lkeF07CisJICAgIGlmICgvKiBDb21wYXJlIHRoZSBsZW5ndGggb2YgdGhlIG5hbWUuICAqLworCQluYW1lX2xlbiA9PSBleHRyYVtpZHhdCisJCS8qIENvbXBhcmUgdGhlIG5hbWUuICAqLworCQkmJiBtZW1jbXAgKG5hbWUsICZleHRyYVtpZHggKyAxXSwgbmFtZV9sZW4pID09IDApCis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QUJMRV9JMThOCisgICAgICByZV9mcmVlIChtYmNzZXQpOworI2VuZGlmCisgICAgICAqZXJyID0gUkVHX0VTUEFDRTsKKyAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICB0b2tlbl9sZW4gPSBwZWVrX3Rva2VuX2JyYWNrZXQgKHRva2VuLCByZWdleHAsIHN5bnRheCk7CisgIGlmIChCRSAodG9rZW4tPnR5cGUgPT0gRU5EX09GX1JFLCAwKSkKKyAgICB7CisgICAgICAqZXJyID0gUkVHX0JBRFBBVDsKKyAgICAgIGdvdG8gcGFyc2VfYnJhY2tldF9leHBfZnJlZV9yZXR1cm47CisgICAgfQorICBpZiAodG9rZW4tPnR5cGUgPT0gT1BfTk9OX01BVENIX0xJU1QpCisgICAgeworI2lmZGVmIFJFX0VOQUJMRV9JMThOCisgICAgICBtYmNzZXQtPm5vbl9tYXRjaCA9IDE7CisjZW5kaWYgLyogbm90IFJFX0VOQUJMRV9JMThOICovCisgICAgICBub25fbWF0Y2ggPSAxOworICAgICAgaWYgKHN5bnRheCAmIFJFX0hBVF9MSVNUU19OT1RfTkVXTElORSkKKwliaXRzZXRfc2V0IChzYmNzZXQsICdcbicpOworICAgICAgcmVfc3RyaW5nX3NraXBfYnl0ZXMgKHJlZ2V4cCwgdG9rZW5fbGVuKTsgLyogU2tpcCBhIHRva2VuLiAgKi8KKyAgICAgIHRva2VuX2xlbiA9IHBlZWtfdG9rZW5fYnJhY2tldCAodG9rZW4sIHJlZ2V4cCwgc3ludGF4KTsKKyAgICAgIGlmIChCRSAodG9rZW4tPnR5cGUgPT0gRU5EX09GX1JFLCAwKSkKKwl7CisJICAqZXJyID0gUkVHX0JBRFBBVDsKKwkgIGdvdG8gcGFyc2VfYnJhY2tldF9leHBfZnJlZV9yZXR1cm47CisJfQorICAgIH0KKworICAvKiBXZSB0cmVhdCB0aGUgZmlyc3QgJ10nIGFzIGEgbm9ybWFsIGNoYXJhY3Rlci4gICovCisgIGlmICh0b2tlbi0+dHlwZSA9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BleHByZXNzaW9ucyBsaWtlICJhezEsM30iLgorICAgRmV0Y2ggYSBudW1iZXIgZnJvbSBgaW5wdXQnLCBhbmQgcmV0dXJuIHRoZSBudW1iZXIuCisgICBSZXR1cm4gLTEsIGlmIHRoZSBudW1iZXIgZmllbGQgaXMgZW1wdHkgbGlrZSAieywxfSIuCisgICBSZXR1cm4gLTIsIElmIGFuIGVycm9yIGlzIG9jY3VyZWQuICAqLworCitzdGF0aWMgaW50CitmZXRjaF9udW1iZXIgKHJlX3N0cmluZ190ICppbnB1dCwgcmVfdG9rZW5fdCAqdG9rZW4sIHJlZ19zeW50YXhfdCBzeW50YXgpCit7CisgIGludCBudW0gPSAtMTsKKyAgdW5zaWduZWQgY2hhciBjOworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBmZXRjaF90b2tlbiAodG9rZW4sIGlucHV0LCBzeW50YXgpOworICAgICAgYyA9IHRva2VuLT5vcHIuYzsKKyAgICAgIGlmIChCRSAodG9rZW4tPnR5cGUgPT0gRU5EX09GX1JFLCAwKSkKKwlyZXR1cm4gLTI7CisgICAgICBpZiAodG9rZW4tPnR5cGUgPT0gT1BfQ0xPU0VfRFVQX05VTSB8fCBjID09ICcsJykKKwlicmVhazsKKyAgICAgIG51bSA9ICgodG9rZW4tPnR5cGUgIT0gQ0hBUkFDVEVSIHx8IGMgPCAnMCcgfHwgJzknIDwgYyB8fCBudW0gPT0gLTIpCisJICAgICA/IC0yIDogKChudW0gPT0gLTEpID8gYyAtICcwJyA6IG51bSAqIDEwICsgYyAtICcwJykpOworICAgICAgbnVtID0gKG51bSA+IFJFX0RVUF9NQVgpID8gLTIgOiBudW07CisgICAgfQorICByZXR1cm4gbnVtOworfQorDAorI2lmZGVmIFJFX0VOQUJMRV9JMThOCitzdGF0aWMgdm9pZAorZnJlZV9jaGFyc2V0IChyZV9jaGFyc2V0X3QgKmNzZXQpCit7CisgIHJlX2ZyZWUgKGNzZXQtPm1iY2hhcnMpOworIyBpZmRlZiBfTElCQwor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N0ci0+YnVmc19sZW4gKiAyKTsKKwkgICAgICBpZiAoQkUgKHJldCAhPSBSRUdfTk9FUlJPUiwgMCkpCisJCXJldHVybiByZXQ7CisJICAgIH0KKwl9CisgICAgICBlbHNlCisjZW5kaWYgLyogUkVfRU5BQkxFX0kxOE4gICovCisJYnVpbGRfdXBwZXJfYnVmZmVyIChwc3RyKTsKKyAgICB9CisgIGVsc2UKKyAgICB7CisjaWZkZWYgUkVfRU5BQkxFX0kxOE4KKyAgICAgIGlmIChkZmEtPm1iX2N1cl9tYXggPiAxKQorCWJ1aWxkX3djc19idWZmZXIgKHBzdHIpOworICAgICAgZWxzZQorI2VuZGlmIC8qIFJFX0VOQUJMRV9JMThOICAqLworCXsKKwkgIGlmICh0cmFucyAhPSBOVUxMKQorCSAgICByZV9zdHJpbmdfdHJhbnNsYXRlX2J1ZmZlciAocHN0cik7CisJICBlbHNlCisJICAgIHsKKwkgICAgICBwc3RyLT52YWxpZF9sZW4gPSBwc3RyLT5idWZzX2xlbjsKKwkgICAgICBwc3RyLT52YWxpZF9yYXdfbGVuID0gcHN0ci0+YnVmc19sZW47CisJICAgIH0KKwl9CisgICAgfQorCisgIHJldHVybiBSRUdfTk9FUlJPUjsKK30KKworLyogSGVscGVyIGZ1bmN0aW9ucyBmb3IgcmVfc3RyaW5nX2FsbG9jYXRlLCBhbmQgcmVfc3RyaW5nX2NvbnN0cnVjdC4gICovCisKK3N0YXRpYyByZWdfZXJyY29kZV90CitpbnRlcm5hbF9mdW5jdGlvbiBfX2F0dHJpYnV0ZV93YXJuX3VudXNlZF9yZXN1bHRfXworcmVfc3RyaW5nX3JlYWxsb2NfYnVmZmVycyAocmVfc3RyaW5nX3QgKnBzdHIsIGludCBuZXdfYnVmX2xlbikKK3sKKyNpZmRlZiBSRV9FTkFCTEVfSTE4TgorICBpZiAocHN0ci0+bWJfY3VyX21heCA+IDEpCisgICAgeworICAgICAgd2ludF90ICpuZXdfd2NzOworCisgICAgICAvKiBBdm9pZCBvd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29uY3JldGVseSwgY29udmVydCB0byB3aWRlIGNoYXJhY3RlciBpbiBjYXNlIG9mIHBzdHItPm1iX2N1cl9tYXggPiAxLAorICAgY29udmVydCB0byB1cHBlciBjYXNlIGluIGNhc2Ugb2YgUkVHX0lDQVNFLCBhcHBseSB0cmFuc2xhdGlvbi4gICovCisKK3N0YXRpYyByZWdfZXJyY29kZV90CitpbnRlcm5hbF9mdW5jdGlvbiBfX2F0dHJpYnV0ZV93YXJuX3VudXNlZF9yZXN1bHRfXworcmVfc3RyaW5nX3JlY29uc3RydWN0IChyZV9zdHJpbmdfdCAqcHN0ciwgaW50IGlkeCwgaW50IGVmbGFncykKK3sKKyAgaW50IG9mZnNldCA9IGlkeCAtIHBzdHItPnJhd19tYnNfaWR4OworICBpZiAoQkUgKG9mZnNldCA8IDAsIDApKQorICAgIHsKKyAgICAgIC8qIFJlc2V0IGJ1ZmZlci4gICovCisjaWZkZWYgUkVfRU5BQkxFX0kxOE4KKyAgICAgIGlmIChwc3RyLT5tYl9jdXJfbWF4ID4gMSkKKwltZW1zZXQgKCZwc3RyLT5jdXJfc3RhdGUsICdcMCcsIHNpemVvZiAobWJzdGF0ZV90KSk7CisjZW5kaWYgLyogUkVfRU5BQkxFX0kxOE4gKi8KKyAgICAgIHBzdHItPmxlbiA9IHBzdHItPnJhd19sZW47CisgICAgICBwc3RyLT5zdG9wID0gcHN0ci0+cmF3X3N0b3A7CisgICAgICBwc3RyLT52YWxpZF9sZW4gPSAwOworICAgICAgcHN0ci0+cmF3X21ic19pZHggPSAwOworICAgICAgcHN0ci0+dmFsaWRfcmF3X2xlbiA9IDA7CisgICAgICBwc3RyLT5vZmZzZXRzX25lZWRlZCA9IDA7CisgICAgICBwc3RyLT50aXBfY29udGV4dCA9ICgoZWZsYWdzICYgUkVHX05PVEJPTCkgPyBDT05URVhUX0JFR0JVRgorCQkJICAgOiBDT05URVhUX05FV0xJTkUgfCBDT05URVhUX0JFR0JVRik7CisgICAgICBpZiAoIXBzdH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ByZV9zdHJpbmdfc2tpcF9jaGFycyAocHN0ciwgaWR4LCAmd2MpIC0gaWR4OworCSAgICAgIGlmICh3YyA9PSBXRU9GKQorCQlwc3RyLT50aXBfY29udGV4dAorCQkgID0gcmVfc3RyaW5nX2NvbnRleHRfYXQgKHBzdHIsIHByZXZfdmFsaWRfbGVuIC0gMSwgZWZsYWdzKTsKKwkgICAgICBlbHNlCisJCXBzdHItPnRpcF9jb250ZXh0ID0gKChCRSAocHN0ci0+d29yZF9vcHNfdXNlZCAhPSAwLCAwKQorCQkJCSAgICAgICYmIElTX1dJREVfV09SRF9DSEFSICh3YykpCisJCQkJICAgICA/IENPTlRFWFRfV09SRAorCQkJCSAgICAgOiAoKElTX1dJREVfTkVXTElORSAod2MpCisJCQkJCSAmJiBwc3RyLT5uZXdsaW5lX2FuY2hvcikKKwkJCQkJPyBDT05URVhUX05FV0xJTkUgOiAwKSk7CisJICAgICAgaWYgKEJFIChwc3RyLT52YWxpZF9sZW4sIDApKQorCQl7CisJCSAgZm9yICh3Y3NfaWR4ID0gMDsgd2NzX2lkeCA8IHBzdHItPnZhbGlkX2xlbjsgKyt3Y3NfaWR4KQorCQkgICAgcHN0ci0+d2NzW3djc19pZHhdID0gV0VPRjsKKwkJICBpZiAocHN0ci0+bWJzX2FsbG9jYXRlZCkKKwkJICAgIG1lbXNldCAocHN0ci0+bWJzLCAyNTUsIHBzdHItPnZhbGlkX2xlbik7CisJCX0KKwkgICAgICBwc3RyLT52YWxpZF9yYXdfbGVuID0gcHN0ci0+dmFsaWRfbGVuOworCSAgICB9CisJICBlbHNlCisjZW5kaWYgLyogUkVfRU5BQkxFX0kxOE4gKi8KKwkgICAgeworCSAgICAgIGludCBjID0gcHN0ci0+cmF3X21ic1twc3RyLT5yYXdfbWJzX2lkeCArIG9mZnNldCAtIDFdOworCSAgICAgIHBzdHItPnZhbGlkX3Jhd19sZW4gPSAwOworCSAgICAgIGlmIChwc3RyLT50cmFucykKKwkJYyA9IHBzdHItPnRyY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HVybiBDT05URVhUX1dPUkQ7CisgICAgICByZXR1cm4gKElTX1dJREVfTkVXTElORSAod2MpICYmIGlucHV0LT5uZXdsaW5lX2FuY2hvcgorCSAgICAgID8gQ09OVEVYVF9ORVdMSU5FIDogMCk7CisgICAgfQorICBlbHNlCisjZW5kaWYKKyAgICB7CisgICAgICBjID0gcmVfc3RyaW5nX2J5dGVfYXQgKGlucHV0LCBpZHgpOworICAgICAgaWYgKGJpdHNldF9jb250YWluIChpbnB1dC0+d29yZF9jaGFyLCBjKSkKKwlyZXR1cm4gQ09OVEVYVF9XT1JEOworICAgICAgcmV0dXJuIElTX05FV0xJTkUgKGMpICYmIGlucHV0LT5uZXdsaW5lX2FuY2hvciA/IENPTlRFWFRfTkVXTElORSA6IDA7CisgICAgfQorfQorDAorLyogRnVuY3Rpb25zIGZvciBzZXQgb3BlcmF0aW9uLiAgKi8KKworc3RhdGljIHJlZ19lcnJjb2RlX3QKK2ludGVybmFsX2Z1bmN0aW9uIF9fYXR0cmlidXRlX3dhcm5fdW51c2VkX3Jlc3VsdF9fCityZV9ub2RlX3NldF9hbGxvYyAocmVfbm9kZV9zZXQgKnNldCwgaW50IHNpemUpCit7CisgIHNldC0+YWxsb2MgPSBzaXplOworICBzZXQtPm5lbGVtID0gMDsKKyAgc2V0LT5lbGVtcyA9IHJlX21hbGxvYyAoaW50LCBzaXplKTsKKyAgaWYgKEJFIChzZXQtPmVsZW1zID09IE5VTEwsIDApKQorICAgIHJldHVybiBSRUdfRVNQQUNFOworICByZXR1cm4gUkVHX05PRVJST1I7Cit9CisKK3N0YXRpYyByZWdfZXJyY29kZV90CitpbnRlcm5hbF9mdW5jdGlvbiBfX2F0dHJpYnV0ZV93YXJuX3VudXNlZF9yZXN1bHRfXworcmVfbm9kZV9zZXRfaW5pdF8xIChyZV9ub2RlX3NldCAqc2V0LCBpbnQgZWxlbSkKK3sKKyAgc2V0LT5hbGxvYyA9IDE7CisgIHNldC0+bmVsZW0gPSAxOworICBzZXQtPm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GludCBsYXN0X3N0cl9pZHg7CisgIHJlX25vZGVfc2V0IGxpbWl0czsKK30gcmVfc2lmdF9jb250ZXh0X3Q7CisKK3N0cnVjdCByZV9mYWlsX3N0YWNrX2VudF90Cit7CisgIGludCBpZHg7CisgIGludCBub2RlOworICByZWdtYXRjaF90ICpyZWdzOworICByZV9ub2RlX3NldCBlcHNfdmlhX25vZGVzOworfTsKKworc3RydWN0IHJlX2ZhaWxfc3RhY2tfdAoreworICBpbnQgbnVtOworICBpbnQgYWxsb2M7CisgIHN0cnVjdCByZV9mYWlsX3N0YWNrX2VudF90ICpzdGFjazsKK307CisKK3N0cnVjdCByZV9kZmFfdAoreworICByZV90b2tlbl90ICpub2RlczsKKyAgc2l6ZV90IG5vZGVzX2FsbG9jOworICBzaXplX3Qgbm9kZXNfbGVuOworICBpbnQgKm5leHRzOworICBpbnQgKm9yZ19pbmRpY2VzOworICByZV9ub2RlX3NldCAqZWRlc3RzOworICByZV9ub2RlX3NldCAqZWNsb3N1cmVzOworICByZV9ub2RlX3NldCAqaW52ZWNsb3N1cmVzOworICBzdHJ1Y3QgcmVfc3RhdGVfdGFibGVfZW50cnkgKnN0YXRlX3RhYmxlOworICByZV9kZmFzdGF0ZV90ICppbml0X3N0YXRlOworICByZV9kZmFzdGF0ZV90ICppbml0X3N0YXRlX3dvcmQ7CisgIHJlX2RmYXN0YXRlX3QgKmluaXRfc3RhdGVfbmw7CisgIHJlX2RmYXN0YXRlX3QgKmluaXRfc3RhdGVfYmVnYnVmOworICBiaW5fdHJlZV90ICpzdHJfdHJlZTsKKyAgYmluX3RyZWVfc3RvcmFnZV90ICpzdHJfdHJlZV9zdG9yYWdlOworICByZV9iaXRzZXRfcHRyX3Qgc2JfY2hhcjsKKyAgaW50IHN0cl90cmVlX3N0b3JhZ2VfaWR4OworCisgIC8qIG51bWJlciBvZiBzdWJleHByZXNzaW9ucyBgcmVfbnN1YicgaXMgaW4gcmVnZXhfdC4gICovCisgIHVuc2lnbmVkIGludCBz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CQkJICAgICAgJm5leHRfbm9kZXMpOworCSAgaWYgKEJFIChlcnIgIT0gUkVHX05PRVJST1IsIDApKQorCSAgICB7CisJICAgICAgcmVfbm9kZV9zZXRfZnJlZSAoJm5leHRfbm9kZXMpOworCSAgICAgIHJldHVybiBlcnI7CisJICAgIH0KKwl9CisgICAgICArK3N0cl9pZHg7CisgICAgICBpZiAobmV4dF9ub2Rlcy5uZWxlbSkKKwl7CisJICBlcnIgPSBjaGVja19hcnJpdmFsX2V4cGFuZF9lY2wgKGRmYSwgJm5leHRfbm9kZXMsIHN1YmV4cF9udW0sIHR5cGUpOworCSAgaWYgKEJFIChlcnIgIT0gUkVHX05PRVJST1IsIDApKQorCSAgICB7CisJICAgICAgcmVfbm9kZV9zZXRfZnJlZSAoJm5leHRfbm9kZXMpOworCSAgICAgIHJldHVybiBlcnI7CisJICAgIH0KKwkgIGVyciA9IGV4cGFuZF9ia3JlZl9jYWNoZSAobWN0eCwgJm5leHRfbm9kZXMsIHN0cl9pZHgsCisJCQkJICAgIHN1YmV4cF9udW0sIHR5cGUpOworCSAgaWYgKEJFIChlcnIgIT0gUkVHX05PRVJST1IsIDApKQorCSAgICB7CisJICAgICAgcmVfbm9kZV9zZXRfZnJlZSAoJm5leHRfbm9kZXMpOworCSAgICAgIHJldHVybiBlcnI7CisJICAgIH0KKwl9CisgICAgICBjb250ZXh0ID0gcmVfc3RyaW5nX2NvbnRleHRfYXQgKCZtY3R4LT5pbnB1dCwgc3RyX2lkeCAtIDEsIG1jdHgtPmVmbGFncyk7CisgICAgICBjdXJfc3RhdGUgPSByZV9hY3F1aXJlX3N0YXRlX2NvbnRleHQgKCZlcnIsIGRmYSwgJm5leHRfbm9kZXMsIGNvbnRleHQpOworICAgICAgaWYgKEJFIChjdXJfc3RhdGUgPT0gTlVMTCAmJiBlcnIgIT0gUkVHX05PRVJST1IsIDApKQorCXsKKwkgIHJlX25vZGVfc2V0X2ZyZWUgKCZuZXh0X25vZGVzKTsKKwkgIHJldHV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WNjZXB0cyk7CisJICAgICAgaWYgKGFjY2VwdHNfbmV3bGluZSkKKwkJYml0c2V0X3NldCAoYWNjZXB0cywgTkVXTElORV9DSEFSKTsKKwkgICAgICBlbHNlCisJCWNvbnRpbnVlOworCSAgICB9CisJICBpZiAoY29uc3RyYWludCAmIE5FWFRfRU5EQlVGX0NPTlNUUkFJTlQpCisJICAgIHsKKwkgICAgICBiaXRzZXRfZW1wdHkgKGFjY2VwdHMpOworCSAgICAgIGNvbnRpbnVlOworCSAgICB9CisKKwkgIGlmIChjb25zdHJhaW50ICYgTkVYVF9XT1JEX0NPTlNUUkFJTlQpCisJICAgIHsKKwkgICAgICBiaXRzZXRfd29yZF90IGFueV9zZXQgPSAwOworCSAgICAgIGlmICh0eXBlID09IENIQVJBQ1RFUiAmJiAhbm9kZS0+d29yZF9jaGFyKQorCQl7CisJCSAgYml0c2V0X2VtcHR5IChhY2NlcHRzKTsKKwkJICBjb250aW51ZTsKKwkJfQorI2lmZGVmIFJFX0VOQUJMRV9JMThOCisJICAgICAgaWYgKGRmYS0+bWJfY3VyX21heCA+IDEpCisJCWZvciAoaiA9IDA7IGogPCBCSVRTRVRfV09SRFM7ICsraikKKwkJICBhbnlfc2V0IHw9IChhY2NlcHRzW2pdICY9IChkZmEtPndvcmRfY2hhcltqXSB8IH5kZmEtPnNiX2NoYXJbal0pKTsKKwkgICAgICBlbHNlCisjZW5kaWYKKwkJZm9yIChqID0gMDsgaiA8IEJJVFNFVF9XT1JEUzsgKytqKQorCQkgIGFueV9zZXQgfD0gKGFjY2VwdHNbal0gJj0gZGZhLT53b3JkX2NoYXJbal0pOworCSAgICAgIGlmICghYW55X3NldCkKKwkJY29udGludWU7CisJICAgIH0KKwkgIGlmIChjb25zdHJhaW50ICYgTkVYVF9OT1RXT1JEX0NPTlNUUkFJTlQpCisJICAgIHsKKwkgICAgICBiaXRzZXRfd29yZF90IGFueV9zZXQgPSAwOworCSAgICAgIGlmICh0eXBlID09IENIQVJBQ1RFUiAm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lX2F0IChpbnB1dCwgc3RyX2lkeCksIGQ7CisgICAgICBpZiAoQkUgKGMgPCAweGMyLCAxKSkKKwlyZXR1cm4gMDsKKworICAgICAgaWYgKHN0cl9pZHggKyAyID4gaW5wdXQtPmxlbikKKwlyZXR1cm4gMDsKKworICAgICAgZCA9IHJlX3N0cmluZ19ieXRlX2F0IChpbnB1dCwgc3RyX2lkeCArIDEpOworICAgICAgaWYgKGMgPCAweGUwKQorCXJldHVybiAoZCA8IDB4ODAgfHwgZCA+IDB4YmYpID8gMCA6IDI7CisgICAgICBlbHNlIGlmIChjIDwgMHhmMCkKKwl7CisJICBjaGFyX2xlbiA9IDM7CisJICBpZiAoYyA9PSAweGUwICYmIGQgPCAweGEwKQorCSAgICByZXR1cm4gMDsKKwl9CisgICAgICBlbHNlIGlmIChjIDwgMHhmOCkKKwl7CisJICBjaGFyX2xlbiA9IDQ7CisJICBpZiAoYyA9PSAweGYwICYmIGQgPCAweDkwKQorCSAgICByZXR1cm4gMDsKKwl9CisgICAgICBlbHNlIGlmIChjIDwgMHhmYykKKwl7CisJICBjaGFyX2xlbiA9IDU7CisJICBpZiAoYyA9PSAweGY4ICYmIGQgPCAweDg4KQorCSAgICByZXR1cm4gMDsKKwl9CisgICAgICBlbHNlIGlmIChjIDwgMHhmZSkKKwl7CisJICBjaGFyX2xlbiA9IDY7CisJICBpZiAoYyA9PSAweGZjICYmIGQgPCAweDg0KQorCSAgICByZXR1cm4gMDsKKwl9CisgICAgICBlbHNlCisJcmV0dXJuIDA7CisKKyAgICAgIGlmIChzdHJfaWR4ICsgY2hhcl9sZW4gPiBpbnB1dC0+bGVuKQorCXJldHVybiAwOworCisgICAgICBmb3IgKGkgPSAxOyBpIDwgY2hhcl9sZW47ICsraSkKKwl7CisJICBkID0gcmVfc3RyaW5nX2J5dGVfYXQgKGlucHV0LCBzdHJfaWR4ICsgaSk7CisJICBpZiAoZCA8IDB4ODAgfHwgZCA+IDB4YmYpCisJICAgIHJldHVybiAwOworCX0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mc19sZW4gKyAxKTsKKyAgICAgIGlmIChCRSAobmV3X2FycmF5ID09IE5VTEwsIDApKQorCXJldHVybiBSRUdfRVNQQUNFOworICAgICAgbWN0eC0+c3RhdGVfbG9nID0gbmV3X2FycmF5OworICAgIH0KKworICAvKiBUaGVuIHJlY29uc3RydWN0IHRoZSBidWZmZXJzLiAgKi8KKyAgaWYgKHBzdHItPmljYXNlKQorICAgIHsKKyNpZmRlZiBSRV9FTkFCTEVfSTE4TgorICAgICAgaWYgKHBzdHItPm1iX2N1cl9tYXggPiAxKQorCXsKKwkgIHJldCA9IGJ1aWxkX3djc191cHBlcl9idWZmZXIgKHBzdHIpOworCSAgaWYgKEJFIChyZXQgIT0gUkVHX05PRVJST1IsIDApKQorCSAgICByZXR1cm4gcmV0OworCX0KKyAgICAgIGVsc2UKKyNlbmRpZiAvKiBSRV9FTkFCTEVfSTE4TiAgKi8KKwlidWlsZF91cHBlcl9idWZmZXIgKHBzdHIpOworICAgIH0KKyAgZWxzZQorICAgIHsKKyNpZmRlZiBSRV9FTkFCTEVfSTE4TgorICAgICAgaWYgKHBzdHItPm1iX2N1cl9tYXggPiAxKQorCWJ1aWxkX3djc19idWZmZXIgKHBzdHIpOworICAgICAgZWxzZQorI2VuZGlmIC8qIFJFX0VOQUJMRV9JMThOICAqLworCXsKKwkgIGlmIChwc3RyLT50cmFucyAhPSBOVUxMKQorCSAgICByZV9zdHJpbmdfdHJhbnNsYXRlX2J1ZmZlciAocHN0cik7CisJfQorICAgIH0KKyAgcmV0dXJuIFJFR19OT0VSUk9SOworfQorCisMCisvKiBGdW5jdGlvbnMgZm9yIG1hdGNoaW5nIGNvbnRleHQuICAqLworCisvKiBJbml0aWFsaXplIE1DVFguICAqLworCitzdGF0aWMgcmVnX2VycmNvZGVfdAoraW50ZXJuYWxfZnVuY3Rpb24gX19hdHRyaWJ1dGVfd2Fybl91bnVzZWRfcmVzdWx0X18KK21hdGNoX2N0eF9pbml0IChyZV9tYXRjaF9jb250ZXh0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ki95Lyp6Ki8JLyp4Ki8KKyMgYnV0Li4uCisvXCooW14qXXxcKlteL10pKlwqLwktCS8qeCoqL3kvKnoqLwkvKngqKi95Lyp6Ki8KKyMgYW5kIGEgc3RpbGwgZmFuY2llciB2ZXJzaW9uLCB3aGljaCBkb2VzIGl0IHJpZ2h0IChJIHRoaW5rKS4uLgorL1wqKFteKl18XCorW14qL10pKlwqKy8JLQkvKngqLwkvKngqLworL1wqKFteKl18XCorW14qL10pKlwqKy8JLQkvKngqL3kvKnoqLwkvKngqLworL1wqKFteKl18XCorW14qL10pKlwqKy8JLQkvKngqKi95Lyp6Ki8JLyp4KiovCisvXCooW14qXXxcKitbXiovXSkqXCorLwktCS8qeCoqKioveS8qeiovCS8qeCoqKiovCisvXCooW14qXXxcKitbXiovXSkqXCorLwktCS8qeCoqeCoveS8qeiovCS8qeCoqeCovCisvXCooW14qXXxcKitbXiovXSkqXCorLwktCS8qeCoqKngveS8qeiovCS8qeCoqKngveS8qeiovCisKKyMgc3ViZXhwcmVzc2lvbnMKKy4qCQktCWFiYwlhYmMJLQorYShiKShjKWQJLQlhYmNkCWFiY2QJYixjCithKCgoYikpKWMJLQlhYmMJYWJjCWIsYixiCithKGJ8KGMpKWQJLQlhYmQJYWJkCWIsLQorYShiKnxjfGUpZAktCWFiYmQJYWJiZAliYgorYShiKnxjfGUpZAktCWFjZAlhY2QJYworYShiKnxjfGUpZAktCWFkCWFkCUBkCithKGI/KWMJCS0JYWJjCWFiYwliCithKGI/KWMJCS0JYWMJYWMJQGMKK2EoYispYwkJLQlhYmMJYWJjCWIKK2EoYispYwkJLQlhYmJiYwlhYmJiYwliYmIKK2EoYiopYwkJLQlhYwlhYwlAYworKGF8YWIpKGJjKFtkZV0rKWZ8Y2RlKQktCWFiY2RlZglhYmNkZWYJYSxiY2RlZixkZQorIyB0aGUgcmVncmVzc2lvbiB0ZXN0ZXIgb25seSBhc2tzIGZvciA5IHN1YmV4cHJlc3Npb25zCithKGIpKGMpKGQpKGUp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iYWJjIn0sCisgIHswLCAiYS5jIiwgImF4YyJ9LAorICB7MCwgImEuKmMiLCAiYXh5emMifSwKKyAgezEsICJhLipjIiwgImF4eXpkIn0sCisgIHsxLCAiYVtiY11kIiwgImFiYyJ9LAorICB7MCwgImFbYmNdZCIsICJhYmQifSwKKyAgezEsICJhW2ItZF1lIiwgImFiZCJ9LAorICB7MCwgImFbYi1kXWUiLCAiYWNlIn0sCisgIHswLCAiYVtiLWRdIiwgImFhYyJ9LAorICB7MCwgImFbLWJdIiwgImEtIn0sCisgIHswLCAiYVtiLV0iLCAiYS0ifSwKKyAgezIsICJhW2ItYV0iLCAiLSJ9LAorICB7MiwgImFbXWIiLCAiLSJ9LAorICB7MiwgImFbIiwgIi0ifSwKKyAgezAsICJhXSIsICJhXSJ9LAorICB7MCwgImFbXV1iIiwgImFdYiJ9LAorICB7MCwgImFbXmJjXWQiLCAiYWVkIn0sCisgIHsxLCAiYVteYmNdZCIsICJhYmQifSwKKyAgezAsICJhW14tYl1jIiwgImFkYyJ9LAorICB7MSwgImFbXi1iXWMiLCAiYS1jIn0sCisgIHsxLCAiYVteXWJdYyIsICJhXWMifSwKKyAgezAsICJhW15dYl1jIiwgImFkYyJ9LAorICB7MCwgImFifGNkIiwgImFiYyJ9LAorICB7MCwgImFifGNkIiwgImFiY2QifSwKKyAgezAsICIoKWVmIiwgImRlZiJ9LAorICB7MCwgIigpKiIsICItIn0sCisgIHsyLCAiKmEiLCAiLSJ9LAorICB7MiwgIl4qIiwgIi0ifSwKKyAgezIsICIkKiIsICItIn0sCisgIHsyLCAiKCopYiIsICItIn0sCisgIHsxLCAiJGIiLCAiYiJ9LAorICB7MiwgImFcXCIsICItIn0sCisgIHswLCAiYVxcKGIiLCAiYShiIn0sCisgIHswLCAiYVxcKCpiIiwgImFiIn0sCisgIHswLCAiYVxcKCpiIiwgImEoKGIifSwKKyAgezEsICJhXFx4IiwgImFcXHgifSwKKyAgezEsICJhYmMpIiwgIi0ifSwKKyAgezIsICIoYWJjIiwgIi0ifSwKKyAgezAsICIoKGEpKSIsICJhYmMifSwKKyAgezAsICIoYSliKGMpIiwgImFiYyJ9LAorICB7MCwgImErYitjIiwgImFhYmJhYmMifSwKKyAgezAsICJhKioiLCAiLSJ9LAorICB7MCwgImEqPyIsICItIn0sCisgIHswLCAiKGEqKSoiLCAiLSJ9LAorICB7MCwgIihhKikrIiwgIi0ifSwKKyAgezAsICIoYXwpKiIsICItIn0sCisgIHswLCAiKGEqfGIpKiIsICItIn0sCisgIHswLCAiKGErfGIpKiIsICJhYiJ9LAorICB7MCwgIihhK3xiKSsiLCAiYWIifSwKKyAgezAsICIoYSt8Yik/IiwgImFiIn0sCisgIHswLCAiW15hYl0qIiwgImNkZSJ9LAorICB7MCwgIiheKSoiLCAiLSJ9LAorICB7MCwgIihhYnwpKiIsICItIn0sCisgIHsyLCAiKSgiLCAiLSJ9LAorICB7MSwgImFiYyIsICIifSwKKyAgezEsICJhYmMiLCAiIn0sCisgIHswLCAiYSoiLCAiIn0sCisgIHswLCAiKFthYmNdKSpkIiwgImFiYmJjZCJ9LAorICB7MCwgIihbYWJjXSkqYmNkIiwgImFiY2QifSwKKyAgezAsICJhfGJ8Y3xkfGUiLCAiZSJ9LAorICB7MCwgIihhfGJ8Y3xkfGUpZiIsICJlZiJ9LAorICB7MCwgIigoYSp8YikpKiIsICItIn0sCisgIHswLCAiYWJjZCplZmciLCAiYWJjZGVmZyJ9LAorICB7MCwgImFiKiIsICJ4YWJ5YWJiYnoifSwKKyAgezAsICJhYioiLCAieGF5YWJiYnoifSwKKyAgezAsICIoYWJ8Y2QpZSIsICJhYmNkZSJ9LAorICB7MCwgIlthYmhnZWZkY11paiIsICJoaWoifSwKKyAgezEsICJeKGFifGNkKWUiLCAiYWJjZGUifSwKKyAgezAsICIoYWJjfCllZiIsICJhYmNkZWYifSwKKyAgezAsICIoYXxiKWMqZCIsICJhYmNkIn0sCisgIHswLCAiKGFifGFiKiliYyIsICJhYmMifSwKKyAgezAsIC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csICdcMDM1JywgJ1wwMzYnLCAnXDAzNycsCisgIC8qICcgJyAgICAgJyEnICAgICAnIicgICAgICcjJyAgICAgJyQnICAgICAnJScgICAgICcmJyAgICAgJycnICovCisgICdcMDQwJywgJ1wwNDEnLCAnXDA0MicsICdcMDQzJywgJ1wwNDQnLCAnXDA0NScsICdcMDQ2JywgJ1wwNDcnLAorICAvKiAnKCcgICAgICcpJyAgICAgJyonICAgICAnKycgICAgICcsJyAgICAgJy0nICAgICAnLicgICAgICcvJyAqLworICAnXDA1MCcsICdcMDUxJywgJ1wwNTInLCAnXDA1MycsICdcMDU0JywgJ1wwNTUnLCAnXDA1NicsICdcMDU3JywKKyAgLyogJzAnICAgICAnMScgICAgICcyJyAgICAgJzMnICAgICAnNCcgICAgICc1JyAgICAgJzYnICAgICAnNycgKi8KKyAgJ1wwNjAnLCAnXDA2MScsICdcMDYyJywgJ1wwNjMnLCAnXDA2NCcsICdcMDY1JywgJ1wwNjYnLCAnXDA2NycsCisgIC8qICc4JyAgICAgJzknICAgICAnOicgICAgICc7JyAgICAgJzwnICAgICAnPScgICAgICc+JyAgICAgJz8nICovCisgICdcMDcwJywgJ1wwNzEnLCAnXDA3MicsICdcMDczJywgJ1wwNzQnLCAnXDA3NScsICdcMDc2JywgJ1wwNzcnLAorICAvKiAnQCcgICAgICdBJyAgICAgJ0InICAgICAnQycgICAgICdEJyAgICAgJ0UnICAgICAnRicgICAgICdHJyAqLworICAnXDEwMCcsICdcMTQxJywgJ1wxNDInLCAnXDE0MycsICdcMTQ0JywgJ1wxNDUnLCAnXDE0NicsICdcMTQ3JywKKyAgLyogJ0gnICAgICAnSScgICAgICdKJyAgICAgJ0snICAgICAnTCcgICAgICdNJyAgICAgJ04nICAgICAnTycgKi8KKyAgJ1wxNTAnLCAnXDE1MScsICdcMTUyJywgJ1wxNTMnLCAnXDE1NCcsICdcMTU1JywgJ1wxNTYnLCAnXDE1NycsCisgIC8qICdQJyAgICAgJ1EnICAgICAnUicgICAgICdTJyAgICAgJ1QnICAgICAnVScgICAgICdWJyAgICAgJ1cnICovCisgICdcMTYwJywgJ1wxNjEnLCAnXDE2MicsICdcMTYzJywgJ1wxNjQnLCAnXDE2NScsICdcMTY2JywgJ1wxNjcnLAorICAvKiAnWCcgICAgICdZJyAgICAgJ1onICAgICAnWycgICAgICdcJyAgICAgJ10nICAgICAnXicgICAgICdfJyAqLworICAnXDE3MCcsICdcMTcxJywgJ1wxNzInLCAnXDEzMycsICdcMTM0JywgJ1wxMzUnLCAnXDEzNicsICdcMTM3JywKKyAgLyogJ2AnICAgICAnYScgICAgICdiJyAgICAgJ2MnICAgICAnZCcgICAgICdlJyAgICAgJ2YnICAgICAnZycgKi8KKyAgJ1wxNDAnLCAnXDE0MScsICdcMTQyJywgJ1wxNDMnLCAnXDE0NCcsICdcMTQ1JywgJ1wxNDYnLCAnXDE0NycsCisgIC8qICdoJyAgICAgJ2knICAgICAnaicgICAgICdrJyAgICAgJ2wnICAgICAnbScgICAgICduJyAgICAgJ28nICovCisgICdcMTUwJywgJ1wxNTEnLCAnXDE1MicsICdcMTUzJywgJ1wxNTQnLCAnXDE1NScsICdcMTU2JywgJ1wxNTcnLAorICAvKiAncCcgICAgICdxJyAgICAgJ3InICAgICAncycgICAgICd0JyAgICAgJ3UnICAgICAndicgICAgICd3JyAqLworICAnXDE2MCcsICdcMTYxJywgJ1wxNjInLCAnXDE2MycsICdcMTY0JywgJ1wxNjUnLCAnXDE2NicsICdcMTY3JywKKyAgLyogJ3gnICAgICAneScgICAgICd6JyAgICAgJ3snICAgICAnfCcgICAgICd9JyAgICAgJ34nICovCisgICdcMTcwJywgJ1wxNzEnLCAnXDE3MicsICdcMTczJywgJ1wxNzQnLCAnXDE3NScsICdcMTc2JywgJ1wxNzcnLAorCisgIC8qIExhdGluIDE6ICovCisgICdcMjAwJywgJ1wyMDEnLCAnXDIwMicsICdcMjAzJywgJ1wyMDQnLCAnXDIwNScsICdcMjA2JywgJ1wyMDcnLAorICAnXDIxMC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ZyB3aXRoIHRoZSBHTlUgQyBMaWJyYXJ5OyBpZiBub3QsIHNlZQorICAgPGh0dHA6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KKworI2luY2x1ZGUgPHN5cy90eXBlcy5oPgorI2luY2x1ZGUgPG1jaGVjay5oPgorI2luY2x1ZGUgPHJlZ2V4Lmg+CisjaW5jbHVkZSA8c3RkaW8uaD4KKyNpbmNsdWRlIDxzdGRsaWIuaD4KKyNpbmNsdWRlIDxzdHJpbmcuaD4KKwordm9pZAorZnJvYl9lc2NhcGVzIChjaGFyICpzcmMsIGludCBwYXR0ZXJuKQoreworICBjaGFyICpkc3Q7CisKKyAgZm9yIChkc3QgPSBzcmM7ICpzcmMgIT0gJ1wwJzsgZHN0KyssIHNyYysrKQorICAgIHsKKyAgICAgIGlmICgqc3JjID09ICdcXCcpCisJeworCSAgc3dpdGNoIChzcmNbMV0pCisJICAgIHsKKwkgICAgY2FzZSAndCc6CisJICAgICAgc3JjKys7CisJICAgICAgKmRzdCA9ICdcdCc7CisJICAgICAgY29udGludWU7CisJICAgIGNhc2UgJ24nOgorCSAgICAgIHNyYysrOworCSAgICAgICpkc3QgPSAnXG4nOworCSAgICAgIGNvbnRpbnVlOworCSAgICBjYXNlICdyJzoKKwkgICAgICBzcmMrKzsKKwkgICAgICAqZHN0ID0gJ1xyJzsKKwkgICAgICBjb250aW51ZTsKKwkgICAgY2FzZSAnXFwnOgorCSAgICBjYXNlICdeJzoKKwkgICAgY2FzZSAneyc6CisJICAgIGNhc2UgJ3wnOgorCSAgICBjYXNlICd9JzoKKwkgICAgICBpZiAoIXBhdHRlcm4pCisJCXsKKwkJICBzcmMrKzsKKwkJICAqZHN0ID0gKnNyYzsKKwkJICBjb250aW51ZTsKKwkJfQorCSAgICAgIGJyZWFrOworCSAgICB9CisJfQorICAgICAgaWYgKHNyYyAhPSBkc3QpCisJKmRzdCA9ICpzcmM7CisgICAgfQorICAqZHN0ID0gJ1wwJzsKK30KKworaW50CittYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCit7CisgIGludCByZXQgPSAwLCBuOworICBjaGFyICpsaW5lID0gTlVMTDsKKyAgc2l6ZV90IGxpbmVfbGVuID0gMDsKKyAgc3NpemVfdCBsZW47CisgIEZJTEUgKmY7CisgIGNoYXIgKnBhdHRlcm4sICpzdHJpbmc7CisgIGludCBmbGFncyA9IFJFR19FWFRFTkRFRDsKKyAgaW50IGVmbGFncyA9IDA7CisgIHJlZ2V4X3QgcmU7CisgIHJlZ21hdGNoX3Qgcm1bMjBdOworCisgIG10cmFjZSAoKTsKKworICBpZiAoYXJnYyA8IDIpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiTWlzc2luZyB0ZXN0IGZpbGVuYW1lXG4iKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICBmID0gZm9wZW4gKGFyZ3ZbMV0sICJyIik7CisgIGlmIChmID09IE5VTEwpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiQ291bGRuJ3Qgb3BlbiAlc1xuIiwgYXJndlsxXSk7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgd2hpbGUgKChsZW4gPSBnZXRsaW5lICgmbGluZSwgJmxpbmVfbGVuLCBmKSkgPiAwKQorICAgIHsKKyAgICAgIGNoYXIgKnAsICpxOworICAgICAgaW50IGk7CisKKyAgICAgIGlmIChsaW5lW2xlbiAtIDFdID09ICdcbicpCisJbGluZVstLWxlbl0gPSAnXDAnOworCisgICAgICBwdXRzIChsaW5lKTsKKworICAgICAgaWYgKGxpbmVbMF0gPT0gJzsnKQorCWNvbnRpbnVlOworCisgICAgICBpZiAobGluZVswXSA9PSAnXDAnKQorCWNvbnRpbnVlOworCisgICAgICBpZiAobGluZVswXSA9PSAnLScpCisJeworCSAgaWYgKHN0cnN0ciAobGluZSwgIlJFR19CQVNJQyIpKQorCSAgICBmbGFncyA9IDA7CisJICBlbHNlCisJICAgIGZsYWdzID0gUkVHX0VYVEVOREVEOworCSAgaWYgKHN0cnN0ciAobGluZSwgIlJFR19JQ0FTRSIpKQorCSAgICBmbGFncyB8PSBSRUdfSUNBU0U7CisJICBpZiAoc3Ryc3RyIChsaW5lLCAiUkVHX05FV0xJTkUiKSkKKwkgICAgZmxhZ3MgfD0gUkVHX05FV0xJTkU7CisJICBlZmxhZ3MgPSAwOworCSAgaWYgKHN0cnN0ciAobGluZSwgIlJFR19OT1RCT0wiKSkKKwkgICAgZWZsYWdzIHw9IFJFR19OT1RCT0w7CisJICBpZiAoc3Ryc3RyIChsaW5lLCAiUkVHX05PVEVPTCIpKQorCSAgICBlZmxhZ3MgfD0gUkVHX05PVEVPTDsKKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgcGF0dGVybiA9IGxpbmUgKyBzdHJzcG4gKGxpbmUsICIgXHQiKTsKKyAgICAgIGlmICgqcGF0dGVybiA9PSAnXDAnKQorCWNvbnRpbnVlOworICAgICAgcCA9IHBhdHRlcm4gKyBzdHJjc3BuIChwYXR0ZXJuLCAiIFx0Iik7CisgICAgICBpZiAoKnAgPT0gJ1wwJykKKwljb250aW51ZTsKKyAgICAgICpwKysgPSAnXDAnOworCisgICAgICBzdHJpbmcgPSBwICsgc3Ryc3BuIChwLCAiIFx0Iik7CisgICAgICBpZiAoKnN0cmluZyA9PSAnXDAnKQorCWNvbnRpbnVlOworICAgICAgaWYgKCpzdHJpbmcgPT0gJyInKQorCXsKKwkgIHN0cmluZysrOworCSAgcCA9IHN0cmNociAoc3RyaW5nLCAnIicpOworCSAgaWYgKHAgPT0gTlVMTCkKKwkgICAgY29udGludWU7CisJICAqcCsrID0gJ1wwJzsKKwl9CisgICAgICBlbHNlCisJeworCSAgcCA9IHN0cmluZyArIHN0cmNzcG4gKHN0cmluZywgIiBcdCIpOworCSAgaWYgKCpzdHJpbmcgPT0gJyEnKQorCSAgICBzdHJpbmcgPSBOVUxMOworCSAgZWxzZSBpZiAoKnAgPT0gJ1wwJykKKwkgICAgY29udGludWU7CisJICBlbHNlCisJICAgICpwKysgPSAnXDAnOworCX0KKworICAgICAgZnJvYl9lc2NhcGVzIChwYXR0ZXJuLCAxKTsKKyAgICAgIGlmIChzdHJpbmcgIT0gTlVMTCkKKwlmcm9iX2VzY2FwZXMgKHN0cmluZywgMCk7CisKKyAgICAgIG4gPSByZWdjb21wICgmcmUsIHBhdHRlcm4sIGZsYWdzKTsKKyAgICAgIGlmIChuICE9IDApCisJeworCSAgaWYgKHN0cmluZyAhPSBOVUxMKQorCSAgICB7CisJICAgICAgY2hhciBidWZbNTAwXTsKKwkgICAgICByZWdlcnJvciAobiwgJnJlLCBidWYsIHNpemVvZiAoYnVmKSk7CisJICAgICAgcHJpbnRmICgiRkFJTCByZWdjb21wIHVuZXhwZWN0ZWRseSBmYWlsZWQ6ICVzXG4iLAorCQkgICAgICBidWYpOworCSAgICAgIHJldCA9IDE7CisJICAgIH0KKwkgIGNvbnRpbnVlOworCX0KKyAgICAgIGVsc2UgaWYgKHN0cmluZyA9PSBOVUxMKQorCXsKKwkgIHJlZ2ZyZWUgKCZyZSk7CisJICBwdXRzICgiRkFJTCByZWdjb21wIHVucGV4cGVjdGVkbHkgc3VjY2VlZGVkIik7CisJICByZXQgPSAxOworCSAgY29udGludWU7CisJfQorCisgICAgICBpZiAocmVnZXhlYyAoJnJlLCBzdHJpbmcsIDIwLCBybSwgZWZsYWdzKSkKKwl7CisJICBmb3IgKGkgPSAwOyBpIDwgMjA7ICsraSkKKwkgICAgeworCSAgICAgIHJtW2ldLnJtX3NvID0gLTE7CisJICAgICAgcm1baV0ucm1fZW8gPSAtMTsKKwkgICAgfQorCX0KKworICAgICAgcmVnZnJlZSAoJnJlKTsKKworICAgICAgZm9yIChpID0gMDsgaSA8IDIwICYmICpwICE9ICdcMCc7ICsraSkKKwl7CisJICBpbnQgcm1fc28sIHJtX2VvOworCisJICBybV9zbyA9IHN0cnRvbCAocCwgJnEsIDEwKTsKKwkgIGlmIChwID09IHEpCisJICAgIGJyZWFrOwor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KCJjaG1vZChcIi4uLi9uby1zdWNoLWZpbGVcIiwwNjAwKSBkb2VzIG5vdCBzZXQgZXJybm8gdG8gRU5PRU5UIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBzbnByaW50ZiAoYnVmLCBidWZsZW4sICIlcy8iLCBiYXNlbmFtZSAodGVzdGRpcikpOworICBpZiAoY2htb2QgKGJhc2VuYW1lICh0ZXN0ZGlyKSwgMDY3NykgIT0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjYW5ub3QgY2hhbmdlIG1vZGUgb2YgdGVzdCBkaXJlY3RvcnkgdG8gMDY3NzogJW1cbiIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisgIGVsc2UKKyAgICB7CisgICAgICBzbnByaW50ZiAoYnVmLCBidWZsZW4sICIuLyVzL2ZpbGUiLCBiYXNlbmFtZSAodGVzdGRpcikpOworICAgICAgaWYgKGNobW9kIChidWYsIDA2MDApID09IDApCisJeworCSAgaWYgKGdldHVpZCAoKSAhPSAwKQorCSAgICB7CisJICAgICAgcHV0cyAoImNobW9kKFwiLi4uL2ZpbGVcIikgd2l0aCBuby1leGVjIGRpcmVjdG9yeSBzdWNjZWVkZWQiKTsKKwkgICAgICByZXN1bHQgPSAxOworCSAgICB9CisJfQorICAgICAgZWxzZSBpZiAoZXJybm8gIT0gRUFDQ0VTKQorCXsKKwkgIHB1dHMgKCJjaG1vZChcIi4uLi9maWxlXCIpIHdpdGggbm8tZXhlYyBkaXJlY3RvcnkgZGlkbid0IHNldCBFQUNDRVMiKTsKKwkgIHJlc3VsdCA9IDE7CisJfQorICAgIH0KKworICBpZiAoY2htb2QgKGJhc2VuYW1lICh0ZXN0ZGlyKSwgMDc3NykgIT0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjYW5ub3QgY2hhbmdlIG1vZGUgb2YgdGVzdCBkaXJlY3RvcnkgdG8gMDc3NzogJW1cbiIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICAgIGdvdG8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emUgPSBDUFVfQUxMT0NfU0laRSAoMjA0OCk7CisKKyAgQ1BVX1pFUk9fUyAodnNzaXplLCB2czEpOworICBDUFVfU0VUX1MgKDAsIHZzc2l6ZSwgdnMxKTsKKworICBDUFVfWkVST19TICh2c3NpemUsIHZzMik7CisgIENQVV9TRVRfUyAoMCwgdnNzaXplLCB2czIpOworICBDUFVfU0VUX1MgKDIwNDcsIHZzc2l6ZSwgdnMyKTsKKworICBDUFVfQU5EX1MgKHZzc2l6ZSwgdnMzLCB2czEsIHZzMik7CisgIGlmICghIENQVV9FUVVBTF9TICh2c3NpemUsIHZzMywgdnMxKSkKKyAgICB7CisgICAgICBwdXRzICgicmVzdWx0IG9mIENQVV9BTkRfUyB3cm9uZyIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgQ1BVX09SX1MgKHZzc2l6ZSwgdnMzLCB2czEsIHZzMik7CisgIGlmICghIENQVV9FUVVBTF9TICh2c3NpemUsIHZzMywgdnMyKSkKKyAgICB7CisgICAgICBwdXRzICgicmVzdWx0IG9mIENQVV9PUl9TIHdyb25nIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBDUFVfWE9SX1MgKHZzc2l6ZSwgdnMzLCB2czEsIHZzMik7CisgIGlmIChDUFVfQ09VTlRfUyAodnNzaXplLCB2czMpICE9IDEpCisgICAgeworICAgICAgcHV0cyAoInJlc3VsdCBvZiBDUFVfWE9SX1Mgd3JvbmciKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIENQVV9GUkVFICh2czEpOworICBDUFVfRlJFRSAodnMyKTsKKyAgQ1BVX0ZSRUUgKHZzMyk7CisKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworI2RlZmluZSBURVNUX0ZVTkNUSU9OIGRvX3Rlc3QgKCkKKyNpbmNsdWRlICIuLi90ZXN0LXNrZWxldG9uLmMiCmRpZmYgLS1naXQgYS9hcC9saWJjL2dsaWJjL2dsaWJjLTIuMjMvcG9zaXgv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KyAgRElSICpkaXIxOworICBESVIgKmRpcjI7CisgIGludCByZXN1bHQgPSAwOworICBzdHJ1Y3QgZGlyZW50NjQgKmQ7CisgIHVuaW9uCisgICAgeworICAgICAgc3RydWN0IGRpcmVudDY0IGQ7CisgICAgICBjaGFyIHJvb20gW29mZnNldG9mIChzdHJ1Y3QgZGlyZW50NjQsIGRfbmFtZVswXSkgKyBOQU1FX01BWCArIDFdOworICAgIH0KKyAgICBkaXJlbnRidWY7CisgIGNoYXIgKm9iamRpcl9jb3B5MTsKKyAgY2hhciAqb2JqZGlyX2NvcHkyOworICBjaGFyICpidWY7CisgIGludCBmZDsKKworICBtdHJhY2UgKCk7CisKKyAgaWYgKGFyZ2MgPCA1KQorICAgIHsKKyAgICAgIHB1dHMgKCJub3QgZW5vdWdoIHBhcmFtZXRlcnMiKTsKKyAgICAgIGV4aXQgKDEpOworICAgIH0KKworICAvKiBNYWtlIHBhcmFtZXRlcnMgYXZhaWxhYmxlIHdpdGggbmljZXIgbmFtZXMuICAqLworICBzcmNkaXIgPSBhcmd2WzFdOworICBvYmpkaXIgPSBhcmd2WzJdOworICBjb21tb25fb2JqZGlyID0gYXJndlszXTsKKyAgcHJvZ3BhdGggPSBhcmd2WzRdOworCisgIC8qIEZpcnN0IHRlc3QgdGhlIGN1cnJlbnQgc291cmNlIGRpci4gIFdlIGNhbm5vdCByZWFsbHkgY29tcGFyZSB0aGUKKyAgICAgcmVzdWx0IG9mIGBnZXRwd2QnIHdpdGggdGhlIHNyY2RpciBzdHJpbmcgYnV0IHdlIGhhdmUgb3RoZXIgbWVhbnMuICAqLworICBpZiAoc3RhdDY0ICgiLiIsICZzdDEpIDwgMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjYW5ub3Qgc3RhdCBzdGFydGluZyBkaXJlY3Rvcnk6ICVtXG4iKTsKKyAgICAgIGV4aXQgKDEpOworICAgIH0KKworICBpZiAoY2hkaXIgKHNyY2RpcikgPCAwKQorICAgIHsKKyAgICAgIHByaW50Z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pbnRmICgiY2Fubm90IGNyZWF0ZSBcImFuZC1hLWZpbGVcIjogJW1cbiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBjbG9zZSAoZmQpOworCisgIC8qIFNvbWUgdGVzdHMgYWJvdXQgZXJyb3IgcmVwb3J0aW5nLiAgKi8KKyAgZXJybm8gPSAwOworICBpZiAoY2hkaXIgKCJhbmQtYS1maWxlIikgPj0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFuZC1hLWZpbGVcIiBzdWNjZWVkZWRcbiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoZXJybm8gIT0gRU5PVERJUikKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFuZC1hLWZpbGVcIiBkaWRuJ3Qgc2V0IGNvcnJlY3QgZXJyb3JcbiIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgZXJybm8gPSAwOworICBpZiAoY2hkaXIgKCJhbmQtYS1maWxlLy4uIikgPj0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFuZC1hLWZpbGUvLi5cIiBzdWNjZWVkZWRcbiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoZXJybm8gIT0gRU5PVERJUikKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFuZC1hLWZpbGUvLi5cIiBkaWRuJ3Qgc2V0IGNvcnJlY3QgZXJyb3JcbiIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgZXJybm8gPSAwOworICBpZiAoY2hkaXIgKCJhbm90aGVyLWRpci8uLi9hbmQtYS1maWxlIikgPj0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFub3RoZXItZGlyLy4uL2FuZC1hLWZpbGVcIiBzdWNjZWVkZWRcbiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoZXJybm8gIT0gRU5PVERJUikKKyAgIC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2xvc2VkaXIgKGRpcjEpIDwgMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjbG9zaW5nIGRpcjEgZmFpbGVkOiAlbVxuIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKyAgaWYgKGNsb3NlZGlyIChkaXIyKSA8IDApCisgICAgeworICAgICAgcHJpbnRmICgic2Vjb25kIGNsb3NpbmcgZGlyMiBmYWlsZWQ6ICVtXG4iKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGlmIChybWRpciAoImFub3RoZXItZGlyIikgPCAwKQorICAgIHsKKyAgICAgIHByaW50ZiAoImNhbm5vdCByZW1vdmUgXCJhbm90aGVyLWRpclwiOiAlbVxuIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBpZiAodW5saW5rICgiYW5kLWEtZmlsZSIpIDwgMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjYW5ub3QgcmVtb3ZlIFwiYW5kLWEtZmlsZVwiOiAlbVxuIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICAvKiBPbmUgbW9yZSB0ZXN0IGJlZm9yZSB3ZSBsZWF2ZTogbWtkaXIoKSBpcyBzdXBwb3NlZCB0byBmYWlsIHdpdGgKKyAgICAgRUVYSVNUIGlmIHRoZSBuYW1lZCBmaWxlIGlzIGEgc3ltbGluay4gICovCisgIGlmIChzeW1saW5rICgiYS1zeW1saW5rIiwgImEtc3ltbGluayIpICE9IDApCisgICAgeworICAgICAgcHJpbnRmICgiY2Fubm90IGNyZWF0ZSBzeW1saW5rIFwiYS1zeW1saW5rXCI6ICVtXG4iKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaWYgKG1rZGlyICgiYS1zeW1saW5rIiwgMDY2NikgPT0gMCkKKwl7CisJICBwdXRzICgiY2FuIG1ha2UgZGlyZWN0b3J5IFwiYS1zeW1saW5rXCIiKTsKKwkgIHJlc3VsdCA9IDE7CisJfQorICAgICA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UX0ZVTkNUSU9OIGRvX3Rlc3QgKCkKKyNpbmNsdWRlICIuLi90ZXN0LXNrZWxldG9uLmMiCisKKworc3RhdGljIGNoYXIgKmNvcHk7CisKK3N0YXRpYyB2b2lkCitwcmVwYXJlIChpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworICBjaGFyICpidWY7CisgIGludCBvZmY7CisgIGFzcHJpbnRmICgmYnVmLCAiY3AgJXMgJW4lcy1jb3B5IiwgYXJndlswXSwgJm9mZiwgYXJndlswXSk7CisgIGlmIChidWYgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiYXNwcmludGYgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoc3lzdGVtIChidWYpICE9IDApCisgICAgeworICAgICAgcHV0cyAoInN5c3RlbSAgZmFpbGVkIik7CisgICAgICBleGl0ICgxKTsKKyAgICB9CisKKyAgLyogTWFrZSBpdCBub3QgZXhlY3V0YWJsZS4gICovCisgIGNvcHkgPSBidWYgKyBvZmY7CisgIGlmIChjaG1vZCAoY29weSwgMDY2NikgIT0gMCkKKyAgICB7CisgICAgICBwdXRzICgiY2htb2QgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIGFkZF90ZW1wX2ZpbGUgKGNvcHkpOworfQorCisKK3N0YXRpYyBpbnQKK2RvX3Rlc3QgKHZvaWQpCit7CisgIGNvbnN0IGNoYXIgKmVudltdID0geyJGT089QkFSIiwgTlVMTH07CisgIGVycm5vID0gMDsKKyAgZXhlY2xlIChjb3B5LCBjb3B5LCBOVUxMLCBlbnYpOworCisgIGlmIChlcnJubyAhPSBFQUNDRVMpCisgICAgeworICAgICAgcHJpbnRmICgiZXJybm8gPSAlZCAoJW0pLCBleHBlY3RlZCBFQUNDRVNcbiIsIGVycm5vKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICByZXR1cm4gMDsKK30KZGlmZiAtLWdpdCBhL2FwL2xpYmMvZ2xpYmMvZ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7CisgICAgICBwdXRzICgiYXNwcmludGYgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoc3lzdGVtIChidWYpICE9IDApCisgICAgeworICAgICAgcHV0cyAoInN5c3RlbSAgZmFpbGVkIik7CisgICAgICBleGl0ICgxKTsKKyAgICB9CisKKyAgLyogTWFrZSBpdCBub3QgZXhlY3V0YWJsZS4gICovCisgIGNvcHkgPSBidWYgKyBvZmY7CisgIGlmIChjaG1vZCAoY29weSwgMDY2NikgIT0gMCkKKyAgICB7CisgICAgICBwdXRzICgiY2htb2QgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIGFkZF90ZW1wX2ZpbGUgKGNvcHkpOworfQorCisKK3N0YXRpYyBpbnQKK2RvX3Rlc3QgKHZvaWQpCit7CisgIC8qIE1ha2Ugc3VyZSB3ZSBkbyBub3QgZmluZCBhIGJpbmFyeSB3aXRoIHRoZSBuYW1lIHdlIGFyZSBnb2luZyB0bworICAgICB1c2UuICAqLworICBjaGFyICpiaW5kaXIgPSBzdHJkdXBhIChjb3B5KTsKKyAgYmluZGlyID0gY2Fub25pY2FsaXplX2ZpbGVfbmFtZSAoZGlybmFtZSAoYmluZGlyKSk7CisgIGlmIChiaW5kaXIgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiY2Fub25pY2FsaXplX2ZpbGVfbmFtZSBmYWlsZWQiKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKyAgY2hhciAqcGF0aDsKKyAgYXNwcmludGYgKCZwYXRoLCAiJXM6Li4vbGliaW86Li4vZWxmIiwgYmluZGlyKTsKKyAgaWYgKHBhdGggPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiYXNwcmludGYgIGZhaWxlZCIpOworICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgIHNldGVudiAoIlBBVEgiLCBwYXRoLCAxKTsKKworICBjaGFyICpwcm9nID0gYmFzZW5hbWUgKGNvcHkpOworIC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cmVwYXJlIChpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworICBjaGFyICpidWY7CisgIGludCBvZmY7CisgIGFzcHJpbnRmICgmYnVmLCAiY3AgJXMgJW4lcy1jb3B5IiwgYXJndlswXSwgJm9mZiwgYXJndlswXSk7CisgIGlmIChidWYgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiYXNwcmludGYgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoc3lzdGVtIChidWYpICE9IDApCisgICAgeworICAgICAgcHV0cyAoInN5c3RlbSAgZmFpbGVkIik7CisgICAgICBleGl0ICgxKTsKKyAgICB9CisKKyAgLyogTWFrZSBpdCBub3QgZXhlY3V0YWJsZS4gICovCisgIGNvcHkgPSBidWYgKyBvZmY7CisgIGlmIChjaG1vZCAoY29weSwgMDY2NikgIT0gMCkKKyAgICB7CisgICAgICBwdXRzICgiY2htb2QgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIGFkZF90ZW1wX2ZpbGUgKGNvcHkpOworfQorCisKK3N0YXRpYyBpbnQKK2RvX3Rlc3QgKHZvaWQpCit7CisgIGNoYXIgKmFyZ3ZbXSA9IHsgY29weSwgTlVMTCB9OworICBjaGFyICplbnZwW10gPSB7IChjaGFyICopICJGT089QkFSIiwgTlVMTCB9OworCisgIGVycm5vID0gMDsKKyAgZXhlY3ZlIChjb3B5LCBhcmd2LCBlbnZwKTsKKworICBpZiAoZXJybm8gIT0gRUFDQ0VTKQorICAgIHsKKyAgICAgIHByaW50ZiAoImVycm5vID0gJWQgKCVtKSwgZXhwZWN0ZWQgRUFDQ0VTXG4iLCBlcnJubyk7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgcmV0dXJuIDA7Cit9CmRpZmYgLS1naXQgYS9hcC9saWJjL2dsaWJjL2dsaWJjLTIuMjMvcG9zaXgvdHN0LWV4ZWN2cDEuYyBiL2FwL2xpYmMvZ2xpYmMvZ2xp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YgYQorICAgICBzdHJpbmcgaXMgJyInIHdlIHJlYWQgdW50aWwgdGhlIG5leHQgJyInIGFuZCBoYW5kbGVkIGVzY2FwZWQgJyInLiAgKi8KKyAgd2hpbGUgKCEgZmVvZiAoc3RkaW4pKQorICAgIHsKKyAgICAgIHNzaXplX3QgbiA9IGdldGxpbmUgKCZsaW5lYnVmLCAmbGluZWJ1Zmxlbiwgc3RkaW4pOworICAgICAgY2hhciAqY3A7CisgICAgICBjb25zdCBjaGFyICpsb2NhbGU7CisgICAgICBjb25zdCBjaGFyICppbnB1dDsKKyAgICAgIGNvbnN0IGNoYXIgKnBhdHRlcm47CisgICAgICBjb25zdCBjaGFyICpyZXN1bHRfc3RyOworICAgICAgaW50IHJlc3VsdDsKKyAgICAgIGNvbnN0IGNoYXIgKmZsYWdzOworICAgICAgaW50IGZsYWdzX3ZhbDsKKyAgICAgIGludCBmbm1yZXM7CisgICAgICBjaGFyIG51bWJ1ZlsyNF07CisKKyAgICAgIGlmIChuID09IC0xKQorCWJyZWFrOworCisgICAgICBpZiAobiA9PSAwKQorCS8qIE1heWJlIGFuIGVtcHR5IGxpbmUuICAqLworCWNvbnRpbnVlOworCisgICAgICAvKiBTa2lwIG92ZXIgYWxsIGxlYWRpbmcgd2hpdGUgc3BhY2VzLiAgKi8KKyAgICAgIGNwID0gbGluZWJ1ZjsKKworICAgICAgbG9jYWxlID0gbmV4dF9pbnB1dCAoJmNwLCAxLCAwKTsKKyAgICAgIGlmIChsb2NhbGUgPT0gTlVMTCkKKwljb250aW51ZTsKKworICAgICAgaW5wdXQgPSBuZXh0X2lucHV0ICgmY3AsIDAsIDApOworICAgICAgaWYgKGlucHV0ID09IE5VTEwpCisJY29udGludWU7CisKKyAgICAgIHBhdHRlcm4gPSBuZXh0X2lucHV0ICgmY3AsIDAsIDApOworICAgICAgaWYgKHBhdHRlcm4gPT0gTlVMTCkKKwljb250aW51ZTsKKworICAgICAgcmVzdWx0X3N0ciA9IG5leHRfaW5wdXQgKCZjcCwgMCwgMCk7CisgICAgICBpZiAocmVzdWx0X3N0ciA9PSBOVUxMKQorCWNvbnRpbnVlOworCisgICAgICBpZiAoc3RyY21wIChyZXN1bHRfc3RyLCAiMCIpID09IDApCisJcmVzdWx0ID0gMDsKKyAgICAgIGVsc2UgaWYgIChzdHJjYXNlY21wIChyZXN1bHRfc3RyLCAiTk9NQVRDSCIpID09IDApCisJcmVzdWx0ID0gRk5NX05PTUFUQ0g7CisgICAgICBlbHNlCisJeworCSAgY2hhciAqZW5kcDsKKwkgIHJlc3VsdCA9IHN0cnRvbCAocmVzdWx0X3N0ciwgJmVuZHAsIDApOworCSAgaWYgKCplbmRwICE9ICdcMCcpCisJICAgIGNvbnRpbnVlOworCX0KKworICAgICAgZmxhZ3MgPSBuZXh0X2lucHV0ICgmY3AsIDAsIDEpOworICAgICAgaWYgKGZsYWdzID09IE5VTEwpCisJLyogV2UgYWxsb3cgdGhlIGZsYWdzIG1pc3NpbmcuICAqLworCWZsYWdzID0gIiI7CisKKyAgICAgIC8qIENvbnZlcnQgdGhlIHRleHQgZGVzY3JpYmluZyB0aGUgZmxhZ3MgaW4gYSBudW1lcmljIHZhbHVlLiAgKi8KKyAgICAgIGZsYWdzX3ZhbCA9IGNvbnZlcnRfZmxhZ3MgKGZsYWdzKTsKKyAgICAgIGlmIChmbGFnc192YWwgPT0gLTEpCisJLyogU29tZXRoaW5nIHdlbnQgd3JvbmcuICAqLworCWNvbnRpbnVlOworCisgICAgICAvKiBOb3cgcnVuIHRoZSBhY3R1YWwgdGVzdC4gICovCisgICAgICArK250ZXN0czsKKworICAgICAgaWYgKHNldGxvY2FsZSAoTENfQ09MTEFURSwgbG9jYWxlKSA9PSBOVUxMCisJICB8fCBzZXRsb2NhbGUgKExDX0NUWVBFLCBsb2NhbGUpID09IE5VTEwpCisJeworCSAgcHV0cyAoIioqKiBDYW5ub3Qgc2V0IGxvY2FsZSIpOworCSAgKytuZmFpbGVkOworCSAgY29udGludWU7CisJfQorCisgICAg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4gbmZhaWxlZCAhPSAwOworfQorCisKK3N0YXRpYyBjaGFyICoKK25leHRfaW5wdXQgKGNoYXIgKipsaW5lLCBpbnQgZmlyc3QsIGludCBsYXN0KQoreworICBjaGFyICpjcCA9ICpsaW5lOworICBjaGFyICpyZXN1bHQ7CisKKyAgd2hpbGUgKCpjcCA9PSAnICcgfHwgKmNwID09ICdcdCcpCisgICAgKytjcDsKKworICAvKiBXZSBhbGxvdyBjb21tZW50IGxpbmVzIHN0YXJ0aW5nIHdpdGggJyMnLiAgKi8KKyAgaWYgKGZpcnN0ICYmICpjcCA9PSAnIycpCisgICAgcmV0dXJuIE5VTEw7CisKKyAgaWYgKCpjcCA9PSAnIicpCisgICAgeworICAgICAgY2hhciAqd3A7CisKKyAgICAgIHJlc3VsdCA9ICsrY3A7CisgICAgICB3cCA9IGNwOworCisgICAgICB3aGlsZSAoKmNwICE9ICciJyAmJiAqY3AgIT0gJ1wwJyAmJiAqY3AgIT0gJ1xuJykKKwlpZiAoKmNwID09ICdcXCcpCisJICB7CisJICAgIGlmIChjcFsxXSA9PSAnXG4nIHx8IGNwWzFdID09ICdcMCcpCisJICAgICAgcmV0dXJuIE5VTEw7CisKKwkgICAgKytjcDsKKwkgICAgaWYgKCpjcCA9PSAndCcpCisJICAgICAgKndwKysgPSAnXHQnOworCSAgICBlbHNlIGlmICgqY3AgPT0gJ24nKQorCSAgICAgICp3cCsrID0gJ1xuJzsKKwkgICAgZWxzZQorCSAgICAgICp3cCsrID0gKmNwOworCisJICAgICsrY3A7CisJICB9CisJZWxzZQorCSAgKndwKysgPSAqY3ArKzsKKworICAgICAgaWYgKCpjcCAhPSAnIicpCisJcmV0dXJuIE5VTEw7CisKKyAgICAgIGlmICh3cCAhPSBjcCkKKwkqd3AgPSAnXDAnOworICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIHJlc3VsdCA9IGNwOworICAgICAgd2hpbGUgKCpjcCAhPSAnXDAnICYmICpjcCAhPSAnXG4nICYmICpjcCAh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MSkgPT0gMAorCSAgICAgICAmJiAoc3RyWzExXSA9PSAnfCcgfHwgc3RyWzExXSA9PSAnXDAnKSkKKwl7CisJICByZXN1bHQgfD0gRk5NX0xFQURJTkdfRElSOworCSAgbGVuID0gMTE7CisJfQorICAgICAgZWxzZSBpZiAoc3RybmNhc2VjbXAgKHN0ciwgIkNBU0VGT0xEIiwgOCkgPT0gMAorCSAgICAgICAmJiAoc3RyWzhdID09ICd8JyB8fCBzdHJbOF0gPT0gJ1wwJykpCisJeworCSAgcmVzdWx0IHw9IEZOTV9DQVNFRk9MRDsKKwkgIGxlbiA9IDg7CisJfQorICAgICAgZWxzZSBpZiAoc3RybmNhc2VjbXAgKHN0ciwgIkVYVE1BVENIIiwgOCkgPT0gMAorCSAgICAgICAmJiAoc3RyWzhdID09ICd8JyB8fCBzdHJbOF0gPT0gJ1wwJykpCisJeworCSAgcmVzdWx0IHw9IEZOTV9FWFRNQVRDSDsKKwkgIGxlbiA9IDg7CisJfQorICAgICAgZWxzZQorCXJldHVybiAtMTsKKworICAgICAgc3RyICs9IGxlbjsKKyAgICAgIGlmICgqc3RyICE9ICdcMCcpCisJKytzdHI7CisgICAgfQorCisgIHJldHVybiByZXN1bHQ7Cit9CisKKworc3RhdGljIGNoYXIgKgorZmxhZ19vdXRwdXQgKGludCBmbGFncykKK3sKKyAgc3RhdGljIGNoYXIgYnVmWzEwMF07CisgIGludCBmaXJzdCA9IDE7CisgIGNoYXIgKmNwID0gYnVmOworCisgIGlmIChmbGFncyAmIEZOTV9QQVRITkFNRSkKKyAgICB7CisgICAgICBjcCA9IHN0cGNweSAoY3AsICJGTk1fUEFUSE5BTUUiKTsKKyAgICAgIGZpcnN0ID0gMDsKKyAgICB9CisgIGlmIChmbGFncyAmIEZOTV9OT0VTQ0FQRSkKKyAgICB7CisgICAgICBpZiAoISBmaXJzdCkKKwkqY3ArKyA9ICd8JzsKKyAgICAgIGNwID0gc3RwY3B5IChjcCwgIkZOTV9OT0VTQ0FQRSIpOwor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gKiBsZW4gKyAxID4gcmVzbGVuKQorICAgIHsKKyAgICAgIHJlc2J1ZiA9IChjaGFyICopIHJlYWxsb2MgKHJlc2J1ZiwgMiAqIGxlbiArIDEpOworICAgICAgaWYgKHJlc2J1ZiA9PSBOVUxMKQorCWVycm9yIChFWElUX0ZBSUxVUkUsIGVycm5vLCAid2hpbGUgYWxsb2NhdGluZyBidWZmZXIgZm9yIHByaW50aW5nIik7CisgICAgICAqcmVzbGVucCA9IDIgKiBsZW4gKyAxOworICAgICAgKnJlc2J1ZnAgPSByZXNidWY7CisgICAgfQorCisgIHdwID0gcmVzYnVmOworICB3aGlsZSAoKnN0ciAhPSAnXDAnKQorICAgIGlmICgqc3RyID09ICdcdCcpCisgICAgICB7CisJKndwKysgPSAnXFwnOworCSp3cCsrID0gJ3QnOworCSsrc3RyOworICAgICAgfQorICAgIGVsc2UgaWYgKCpzdHIgPT0gJ1xuJykKKyAgICAgIHsKKwkqd3ArKyA9ICdcXCc7CisJKndwKysgPSAnbic7CisJKytzdHI7CisgICAgICB9CisgICAgZWxzZSBpZiAoKnN0ciA9PSAnIicpCisgICAgICB7CisJKndwKysgPSAnXFwnOworCSp3cCsrID0gJyInOworCSsrc3RyOworICAgICAgfQorICAgIGVsc2UgaWYgKCpzdHIgPT0gJ1xcJykKKyAgICAgIHsKKwkqd3ArKyA9ICdcXCc7CisJKndwKysgPSAnXFwnOworCSsrc3RyOworICAgICAgfQorICAgIGVsc2UKKyAgICAgICp3cCsrID0gKnN0cisrOworCisgICp3cCA9ICdcMCc7CisKKyAgcmV0dXJuIHJlc2J1ZjsKK30KKworI2RlZmluZSBURVNUX0ZVTkNUSU9OIGRvX3Rlc3QgKCkKKyNpbmNsdWRlICIuLi90ZXN0LXNrZWxldG9uLmMiCmRpZmYgLS1naXQgYS9hcC9saWJjL2dsaWJjL2dsaWJjLTIuMjMvcG9zaXgvdHN0LWZubWF0Y2guaW5wdXQgYi9hcC9saWJjL2dsaWJjL2dsaWJjLTIuMjMv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SIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYSIJCQkiW1s9Yj1dWzpkaWdpdDpdXSIgICAgIE5PTUFUQ0gKKworIyBCLjYgMDE3KEMpCitDCQkgImEiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJhIgkJCSJbIVs6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIi0iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJhXWEiCQkJIltbOmFsbnVtOl1dYSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiLSIJCQkiW1s6YWxudW06XS1dIgkgICAgICAgMAorQwkJICJhYSIJCQkiW1s6YWxudW06XV1hIgkgICAgICAgMAorQwkJICItIgkJCSJbIVs6YWxudW06XV0iCSAgICAgICAwCitDCQkgIl0iCQkJIlshXVs6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIlsiCQkJIlshWzphbG51bTpdW10iCSAgICAgICBOT01BVENICitDCQkgImEiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJiIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiYyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgImQiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJlIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiZiIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgImciCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJoIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiaSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgImoiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJrIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAibCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIm0iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJuIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAibyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgInAiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJxIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiciIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgInMiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJ0IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAidSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgInYiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJ3IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAieCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgInkiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJ6IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiQSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIkIiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJDIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiRCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIkUiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJGIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiRyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIkgiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJJIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiSiIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIksiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJMIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiTSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIk4iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJPIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiUCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIlEiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJSIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiUyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIlQiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJVIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiViIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIlciCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJYIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiWSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIloiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICIwIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiMSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIjIiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICIzIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiNCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIjUiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICI2IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiNyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIjgiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICI5IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiISIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIiMiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICIlIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiKyIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIiwiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICItIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiLiIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIi8iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICI6IgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiOyIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIj0iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJAIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiWyIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIlxcIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiXSIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIl4iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJfIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAieyIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIn0iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJ+IgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiXCIiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICIkIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiJiIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIiciCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICIoIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiKSIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIioiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICI/IgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYCIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgInwiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICI8IgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiPiIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIlx0IgkJCSJbWzpjbnRybDpdXSIJICAgICAgIDAKK0MJCSAidCIJCQkiW1s6Y250cmw6XV0iCSAgICAgICBOT01BVENICitDCQkgInQiCQkJIltbOmxvd2VyOl1dIgkgICAgICAgMAorQwkJICJcdCIJCQkiW1s6bG93ZXI6XV0iCSAgICAgICBOT01BVENICitDCQkgIlQiCQkJIltbOmxvd2VyOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJcdCIJCQkiW1s6c3BhY2U6XV0iCSAgICAgICAwCitDCQkgInQiCQkJIltbOnNwYWNlOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJ0IgkJCSJbWzphbHBoYTpdXSIJICAgICAgIDAKK0MJCSAiXHQiCQkJIltbOmFscGhhOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICIwIgkJCSJbWzpkaWdpdDpdXSIJICAgICAgIDAKK0MJCSAiXHQiCQkJIltbOmRpZ2l0Ol1dIgkgICAgICAgTk9NQVRDSAorQwkJICJ0IgkJCSJbWzpkaWdpdDpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiXHQiCQkJIltbO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hOl1bPWI9XV0iICAgICAwCitDCQkgImEiCQkJIltbOmFscGhhOl1bOmRpZ2l0Ol1dIiAwCitDCQkgImEiCQkJIltbOmRpZ2l0Ol1bOmFscGhhOl1dIiAwCisKKyMgQi42IDAxOChDKQorQwkJICJhIgkJCSJbYS1jXSIJCSAgICAgICAwCitDCQkgImIiCQkJIlthLWNdIgkJICAgICAgIDAKK0MJCSAiYyIJCQkiW2EtY10iCQkgICAgICAgMAorQwkJICJhIgkJCSJbYi1jXSIJCSAgICAgICBOT01BVENICitDCQkgImQiCQkJIltiLWNdIgkJICAgICAgIE5PTUFUQ0gKK0MJCSAiQiIJCQkiW2EtY10iCQkgICAgICAgTk9NQVRDSAorQwkJICJiIgkJCSJbQS1DXSIJCSAgICAgICBOT01BVENICitDCQkgIiIJCQkiW2EtY10iCQkgICAgICAgTk9NQVRDSAorQwkJICJhcyIJCQkiW2EtY2Etel0iCSAgICAgICBOT01BVENICitDCQkgImEiCQkJIltbLmEuXS1jXSIJICAgICAgIDAKK0MJCSAiYSIJCQkiW2EtWy5jLl1dIgkgICAgICAgMAorQwkJICJhIgkJCSJbWy5hLl0tWy5jLl1dIgkgICAgICAgMAorQwkJICJiIgkJCSJbWy5hLl0tY10iCSAgICAgICAwCitDCQkgImIiCQkJIlthLVsuYy5dXSIJICAgICAgIDAKK0MJCSAiYiIJCQkiW1suYS5dLVsuYy5dXSIJICAgICAgIDAKK0MJCSAiYyIJCQkiW1suYS5dLWNdIgkgICAgICAgMAorQwkJICJjIgkJCSJbYS1bLmMuXV0iCSAgICAgICAwCitDCQkgImMiCQkJIltbLmEuXS1bLmMuXV0iCSAgICAgICAwCitDCQkgImQiCQkJIltbLmEuXS1jXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiZCIJCQkiW2EtWy5jLl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJkIgkJCSJbWy5hLl0tWy5jLl1dIgkgICAgICAgTk9NQVRDSAorCisjIEIuNiAwMTkoQykKK0MJCSAiYSIJCQkiW2MtYV0iCQkgICAgICAgTk9NQVRDSAorQwkJICJhIgkJCSJbWy5jLl0tYV0iCSAgICAgICBOT01BVENICitDCQkgImEiCQkJIltjLVsuYS5dXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYSIJCQkiW1suYy5dLVsuYS5dXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYyIJCQkiW2MtYV0iCQkgICAgICAgTk9NQVRDSAorQwkJICJjIgkJCSJbWy5jLl0tYV0iCSAgICAgICBOT01BVENICitDCQkgImMiCQkJIltjLVsuYS5dXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYyIJCQkiW1suYy5dLVsuYS5dXSIJICAgICAgIE5PTUFUQ0gKKworIyBCLjYgMDIwKEMpCitDCQkgImEiCQkJIlthLWMwLTldIgkgICAgICAgMAorQwkJICJkIgkJCSJbYS1jMC05XSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiQiIJCQkiW2EtYzAtOV0iCSAgICAgICBOT01BVENICisKKyMgQi42IDAyMShDKQorQwkJICItIgkJCSJbLWFdIgkJICAgICAgIDAKK0MJCSAiYSIJCQkiWy1iXSIJCSAgICAgICBOT01BVENICitDCQkgIi0iCQkJIlshLWFdIgkJICAgICAgIE5PTUFUQ0gKK0MJCSAiYSIJCQkiWyEtYl0iCQkgICAgICAgMAorQwkJICItIgkJCSJbYS1jLTAtOV0iCSAgICAgICAwCitDCQkgImIiCQkJIlthLWMtMC05XSIJICAgICAgIDAKK0MJCSAiYToiCQkJImFbMC05LWFdIgkgICAgICAgTk9NQVRDSAorQwkJICJhOiIJCQkiYVswOS1hXSIJICAgICAgIDAKKworIyBCLjYgMDI0KEMpCitDCQkgIiIJCQkiKiIJCSAgICAgICAwCitDCQkgImFzZC9zZGYiCQkiKiIJCSAgICAgICAwCisKKyMgQi42IDAyNShDKQorQwkJICJhcyIJCQkiW2EtY11bYS16XSIJICAgICAgIDAKK0MJCSAiYXMiCQkJIj8/IgkJICAgICAgIDAKKworIyBCLjYgMDI2KEMpCitDCQkgImFzZC9zZGYiCQkiYXMqZGYiCQkgICAgICAgMAorQwkJICJhc2Qvc2RmIgkJImFzKiIJCSAgICAgICAwCitDCQkgImFzZC9zZGYiCQkiKmRmIgkJICAgICAgIDAKK0MJCSAiYXNkL3NkZiIJCSJhcypkZyIJCSAgICAgICBOT01BVENICitDCQkgImFzZGYiCQkJImFzKmRmIgkJICAgICAgIDAKK0MJCSAiYXNkZiIJCQkiYXMqZGY/IgkgICAgICAgTk9NQVRDSAorQwkJICJhc2RmIgkJCSJhcyo/PyIJCSAgICAgICAwCitDCQkgImFzZGYiCQkJImEqPz8/IgkJICAgICAgIDAKK0MJCSAiYXNkZiIJCQkiKj8/Pz8iCQkgICAgICAgMAorQwkJICJhc2RmIgkJCSI/Pz8/KiIJCSAgICAgICAwCitDCQkgImFzZGYiCQkJIj8/Kj8iCQkgICAgICAgMAorCisjIEIuNiAwMjcoQykKK0MJCSAiLyIJCQkiLyIJCSAgICAgICAwCitDCQkgIi8iCQkJIi8qIgkJICAgICAgIDAKK0MJCSAiLyIJCQkiKi8iCQkgICAgICAgMAorQwkJICIvIgkJCSIvPyIJCSAgICAgICBOT01BVENICitDCQkgIi8iCQkJIj8vIgkJICAgICAgIE5PTUFUQ0gKK0MJCSAiLyIJCQkiPyIJCSAgICAgICAwCitDCQkgIi4iCQkJIj8iCQkgICAgICAgMAorQwkJICIvLiIJCQkiPz8iCQkgICAgICAgMAorQwkJICIvIgkJCSJbIWEtY10iCSAgICAgICAwCitDCQkgIi4iCQkJIlshYS1jXSIJICAgICAgIDAKKworIyBCLjYgMDI5KEMpCitDCQkgIi8iCQkJIi8iCQkgICAgICAgMCAgICAgICBQQVRITkFNRQorQwkJICIvLyIJCQkiLy8iCQkgICAgICAgMCAgICAgICBQQVRITkFNRQorQwkJICIvLmEiCQkJIi8qIgkJICAgICAgIDAgICAgICAgUEFUSE5BTUUKK0MJCSAiLy5hIgkJCSIvP2EiCQkgICAgICAgMCAgICAgICBQQVRITkFNRQorQwkJICIvLmEiCQkJIi9bIWEtel1hIgkgICAgICAgMCAgICAgICBQQVRITkFNRQorQwkJICIvLmEvLmIiCQkiLyovP2IiCQkgICAgICAgMCAgICAgICBQQVRITkFNRQorCisjIEIuNiAwMzAoQykKK0MJCSAiLyIJCQkiPyIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FCitDCQkgIi8iCQkJIioiCQkgICAgICAgTk9NQVRDSCBQQVRITkFNRQorQwkJICJhL2IiCQkJImE/YiIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FCitDCQkgIi8uYS8uYiIJCSIvKmIiCQkgICAgICAgTk9NQVRDSCBQQVRITkFNRQorCisjIEIuNiAwMzEoQykKK0MJCSAiLyQiCQkJIlxcL1xcJCIJICAgICAgIDAKK0MJCSAiL1siCQkJIlxcL1xcWyIJICAgICAgIDAKK0MJCSAiL1siCQkJIlxcL1siCQkgICAgICAgMAorQwkJICIvW10iCQkJIlxcL1xcW10iCSAgICAgICAwCisKKyMgQi42IDAzMihDKQorQwkJICIvJCIJCQkiXFwvXFwkIgkgICAgICAgTk9NQVRDSCBOT0VTQ0FQRQorQwkJICIvXFwkIgkJCSJcXC9cXCQiCSAgICAgICBOT01BVENIIE5PRVNDQVBFCitDCQkgIlxcL1xcJCIJCSJcXC9cXCQiCSAgICAgICAwICAgICAgIE5PRVNDQVBFCisKKyMgQi42IDAzMyhDKQorQwkJICIuYXNkIgkJCSIuKiIJCSAgICAgICAwICAgICAgIFBFUklPRAorQwkJICIvLmFzZCIJCSIqIgkJICAgICAgIDAgICAgICAgUEVSSU9ECitDCQkgIi9hcy8uZGYiCQkiKi8/KmYiCQkgICAgICAgMCAgICAgICBQRVJJT0QKK0MJCSAiLi5hc2QiCQkiLlshYS16XSoiCSAgICAgICAwICAgICAgIFBFUklPRAorCisjIEIuNiAwMzQoQykKK0MJCSAiLmFzZCIJCQkiKiIJCSAgICAgICBOT01BVENIIFBFUklPRAorQwkJICIuYXNkIgkJCSI/YXNkI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ZV9ERS5JU08tODg1OS0xICJaIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLEIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLWIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLcIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJhIgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJ6IgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLkIgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICL2IgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICL8IgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJBIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJaIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLEIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLWIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLcIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJhIgkJCSJbWzpsb3dlcjpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgInoiCQkJIltbOmxvd2VyOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi5CIJCQkiW1s6bG93ZXI6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICL2IgkJCSJbWzpsb3dlcjpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIvwiCQkJIltbOmxvd2VyOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiQSIJCQkiW1s6bG93ZXI6XV0iCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJaIgkJCSJbWzpsb3dlcjpdXSIJICAgICAgIE5PTUFUQ0gKK2RlX0RFLklTTy04ODU5LTEgIsQiCQkJIltbOmxvd2VyOl1dIgkgICAgICAgTk9NQVRDSAorZGVfREUuSVNPLTg4NTktMSAi1iIJCQkiW1s6bG93ZXI6XV0iCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLcIgkJCSJbWzpsb3dlcjpdXSIJICAgICAgIE5PTUFUQ0gKK2RlX0RFLklTTy04ODU5LTEgImEiCQkJIltbOnVwcGVyOl1dIgkgICAgICAgTk9NQVRDSAorZGVfREUuSVNPLTg4NTktMSAieiIJCQkiW1s6dXBwZXI6XV0iCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLkIgkJCSJbWzp1cHBlcjpdXSIJICAgICAgIE5PTUFUQ0gKK2RlX0RFLklTTy04ODU5LTEgIvYiCQkJIltbOnVwcGVyOl1dIgkgICAgICAgTk9NQVRDSAorZGVfREUuSVNPLTg4NTktMSAi/CIJCQkiW1s6dXBwZXI6XV0iCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJBIgkJCSJbWzp1cHBlcjpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIloiCQkJIltbOnVwcGVyOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAixCIJCQkiW1s6dXBwZXI6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLWIgkJCSJbWzp1cHBlcjpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgItwiCQkJIltbOnVwcGVyOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiYSIJCQkiW1s6YWxwaGE6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJ6IgkJCSJbWzphbHBoYTpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuQiCQkJIltbOmFscGhhOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi9iIJCQkiW1s6YWxwaGE6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICL8IgkJCSJbWzphbHBoYTpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIkEiCQkJIltbOmFscGhhOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiWiIJCQkiW1s6YWxwaGE6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLEIgkJCSJbWzphbHBoYTpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgItYiCQkJIltbOmFscGhhOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi3CIJCQkiW1s6YWxwaGE6XV0iCSAgICAgICAwCisKK2RlX0RFLklTTy04ODU5LTEgImEiCQkJIltbPWE9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4iIJCQkiW1s9YT1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLgIgkJCSJbWz1hPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuEiCQkJIltbPWE9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi5CIJCQkiW1s9YT1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJiIgkJCSJbWz1hPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImMiCQkJIltbPWE9XWJdIgkgICAgICAgTk9NQVRDSAorZGVfREUuSVNPLTg4NTktMSAiYSIJCQkiW1s94j1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLiIgkJCSJbWz3iPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuAiCQkJIltbPeI9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4SIJCQkiW1s94j1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLkIgkJCSJbWz3iPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImIiCQkJIltbPeI9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiYyIJCQkiW1s94j1dYl0iCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJhIgkJCSJbWz3gPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuIiCQkJIltbPeA9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4CIJCQkiW1s94D1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLhIgkJCSJbWz3gPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuQiCQkJIltbPeA9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiYiIJCQkiW1s94D1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJjIgkJCSJbWz3gPV1iXSIJICAgICAgIE5PTUFUQ0gKK2RlX0RFLklTTy04ODU5LTEgImEiCQkJIltbPeE9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4iIJCQkiW1s94T1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLgIgkJCSJbWz3hPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuEiCQkJIltbPeE9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi5CIJCQkiW1s94T1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJiIgkJCSJbWz3hPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImMiCQkJIltbPeE9XWJdIgkgICAgICAgTk9NQVRDSAorZGVfREUuSVNPLTg4NTktMSAiYSIJCQkiW1s95D1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLiIgkJCSJbWz3kPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuAiCQkJIltbPeQ9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4SIJCQkiW1s95D1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLkIgkJCSJbWz3kPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImIiCQkJIltbPeQ9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiYyIJCQkiW1s95D1dYl0iCSAgICAgICBOT01BVENICisKK2RlX0RFLklTTy04ODU5LTEgImFhIgkJCSJbWy5hLl1dYSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImJhIgkJCSJbWy5hLl1dYSIJICAgICAgIE5PTUFUQ0gKKworCisjIEFuZCB3aXRoIGEgbXVsdGlieXRlIGNoYXJhY3RlciBzZXQuCitkZV9ERS5VVEYtOAkgImEiCQkJIlthLXpdIgkJICAgICAgIDAKK2RlX0RFLlVURi04CSAieiIJCQkiW2Etel0iCQkgICAgICAgMAorZGVfREUuVVRGLTgJICLDpCIJCQkiW2Etel0iCQkgICAgICAgMAorZGVfREUuVVRGLTgJICLDtiIJCQkiW2Etel0iCQkgICAgICAgMAorZGVfREUuVVRGLTgJICLDvCIJCQkiW2Etel0iCQkgICAgICAgMAorZGVfREUuVVRGLTgJICJBIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5VVEYtOAkgIloiCQkJIlthLXpdIgkJICAgICAgIE5PTUFUQ0gKK2RlX0RFLlVURi04CSAiw4QiCQkJIlthLXpdIgkJICAgICAgIE5PTUFUQ0gKK2RlX0RFLlVURi04CSAiw5YiCQkJIlthLXpdIgkJICAgICAgIE5PTUFUQ0gKK2RlX0RFLlVURi04CSAiw5wiCQkJIlthLXpdIgkJICAgICAgIE5PTUFUQ0gKK2RlX0RFLlVURi04CSAiYSIJCQkiW0EtWl0iCQk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lvbnMuCitDCQkgIngiCQkJIngiCQkgICAgICAgMCAgICAgICBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4L3kiCQkJIngiCQkgICAgICAgMCAgICAgICBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4L3kveiIJCSJ4IgkJICAgICAgIDAgICAgICAgUEFUSE5BTUV8TEVBRElOR19ESVIKK0MJCSAieCIJCQkiKiIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveSIJCQkiKiIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveS96IgkJIioiCQkgICAgICAgMCAgICAgICBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4IgkJCSIqeCIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveSIJCQkiKngiCQkgICAgICAgMCAgICAgICBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4L3kveiIJCSIqeCIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngiCQkJIngqIgkJICAgICAgIDAgICAgICAgUEFUSE5BTUV8TEVBRElOR19ESVIKK0MJCSAieC95IgkJCSJ4KiIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveS96IgkJIngqIgkJICAgICAgIDAgICAgICAgUEFUSE5BTUV8TEVBRElOR19ESVIKK0MJCSAieCIJCQkiYSIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveSIJCQkiYSIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveS96IgkJImEiCQkgICAgICAgTk9NQVRDSCBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4IgkJCSJ4L3kiCQkgICAgICAgTk9NQVRDSCBQQVRITkFNRXxMRUFESU5HX0RJUgorQw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InBhcmE5OTEiCQkicGFyYT8oWzM0NV18OTkpMSIgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJwYXJhMzgxIgkJInBhcmE/KFszNDVdfDk5KTEiICAgICBOT01BVENIIEVYVE1BVENICitDCQkicGFyYWdyYXBoIgkJInBhcmEqKFswLTldKSIJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJwYXJhIgkJCSJwYXJhKihbMC05XSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkicGFyYTEzODI5MzgzNzQ2NTkyIgkicGFyYSooWzAtOV0pIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJInBhcmFncmFwaCIJCSJwYXJhKyhbMC05XSkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkicGFyYSIJCQkicGFyYSsoWzAtOV0pIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJInBhcmE5ODczNDY1MjMiCQkicGFyYSsoWzAtOV0pIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJInBhcmFncmFwaCIJCSJwYXJhISgqLlswLTldKSIgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJInBhcmEuMzgiCQkicGFyYSEoKi5bMC05XSkiICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJwYXJhLmdyYXBoIgkJInBhcmEhKCouWzAtOV0pIiAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkicGFyYTM5IgkJInBhcmEhKCouWzAtOV0pIiAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiIgkJCSIqKDB8MXwzfDV8N3w5KSIgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIjEzNzU3Nzk5MSIJCSIqKDB8MXwzfDV8N3w5KSIgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIjI0NjgiCQkJIiooMHwxfDN8NXw3fDkpIiAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiMTM1OCIJCQkiKigwfDF8M3w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DAgICAgICAgRVhUTUFUQ0gKK0MJCSJhYiIJCQkiYWIqKyhlfGYpIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImFiZWYiCQkJImFiKioqZWYiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiYWJlZiIJCQkiYWIqKiIJCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9mbyIJCQkiKihmKihvKSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZmZvIgkJCSIqKGYqKG8pKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmb29vb2ZvIgkJIiooZioobykpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZvb29vZm9mIgkJIiooZioobykpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZvb29mb29mb2Zvb28iCQkiKihmKihvKSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vb29mb2YiCQkiKihmKyhvKSkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkieGZvb29vZm9mIgkJIiooZioobykpIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImZvb29vZm9meCIJCSIqKGYqKG8pKSIJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJvZnhvb2Z4byIJCSIqKCoob2YqKG8peClvKSIgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIm9mb29vZm9vZm9mb29vIgkiKihmKihvKSkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiZm9vb3hmb294Zm94Zm9vb3giCSIqKGYqKG8peCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vb3hmb294b2ZveGZvb294IgkiKihmKihvKXgpIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImZvb294Zm9veGZ4Zm9vb3giCSIqKGYqKG8peCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkib2Z4b29meG8iCQkiKigqKG9mKihvKXgpbykiICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJvZm9vb3hvb2Z4byIJCSIqKCoob2YqKG8peClvKSIgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIm9mb29veG9vZnhvb2Zvb294b29meG8iICIqKCoob2YqKG8peClvKSIgICAgICAwICAgICAgIEVYVE1BVENICitDCQkib2Zvb294b29meG9vZm9vb3hvb2Z4b28iICIqKCoob2YqKG8peClvKSIgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJvZm9vb3hvb2Z4b29mb29veG9vZnhvZm8iICIqKCoob2YqKG8peClvKSIgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJIm9mb29veG9vZnhvb2Zvb294b29meG9vb2Z4b2Z4byIgIiooKihvZioobyl4KW8pIiAwICAgIEVYVE1BVENICitDCQkiYWFjIgkJCSIqKEAoYSkpYUAoYykiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiYWMiCQkJIiooQChhKSlhQChjKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJjIgkJCSIqKEAoYSkpYUAoYykiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiYWFhYyIJCQkiKihAKGEpKWFAKGMpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImJhYWFjIgkJCSIqKEAoYSkpYUAoYykiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiYWJjZCIJCQkiP0AoYXxiKSpAKGMpZCIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJhYmNkIgkJCSJAKGFifGEqQChiKSkqKGMpZCIgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImFjZCIJCQkiQChhYnxhKihiKSkqKGMpZCIgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJhYmJjZCIJCQkiQChhYnxhKihiKSkqKGMpZCIgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJlZmZneiIJCQkiQ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gICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJmb28iCQkJIiEoZm9vKSoiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vYmFyIgkJIiEoZm9vKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmb29iYXIiCQkiIShmb28pKiIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJtb28uY293IgkJIiEoKi4qKS4hKCouKikiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkibWFkLm1vby5jb3ciCQkiISgqLiopLiEoKi4qKSIJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJtdWNjYS5wYXp6YSIJCSJtdSEoKihjKSk/LnBhISgqKHopKT8iIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJmZmYiCQkJIiEoZikiCQkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZmZiIJCQkiKighKGYpKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmZmYiCQkJIisoIShmKSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkib29vIgkJCSIhKGYpIgkJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJvb28iCQkJIiooIShmKSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkib29vIgkJCSIrKCEoZikpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZvbyIJCQkiIShmKSIJCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vIgkJCSIqKCEoZikpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZvbyIJCQkiKyghKGYpKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmIgkJCSIhKGYpIgkJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJmIgkJCSIqKCEoZikpIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImYiCQkJIisoIShmKSkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiZm9vdCIJCQkiQCghKHoqKXwqeCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiem9vdCIJCQkiQCghKHoqKXwqeCkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiZm9veCIJCQkiQCghKHoqKXwqeCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiem9veCIJCQkiQCghKHoqKXwqeCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vIgkJCSIqKCEoZm9vKSkJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmb29iIgkJCSIhKGZvbyliKiIJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJmb29iYiIJCQkiIShmb28pYioiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiWyIJCQkiKihbYVtdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJdIgkJCSIqKFtdYVtdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJhIgkJCSIqKFtdYVtdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJiIgkJCSIqKFshXWFbXSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiWyIJCQkiKihbIV1hW118W1tdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJdIgkJCSIqKFshXWFbXXxbXV0pIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIlsiCQkJIiEoWyFdYVtdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJdIgkJCSIhKFshXWFbXSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiKSIJCQkiKihbKV0pIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIioiCQkJIiooWyooXSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiYWJjZCIJCQkiKiEofGEp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mYW1pbHlbMl0gPSB7IEFGX0lORVQsIEFGX0lORVQ2IH07CisgIGludCByZXN1bHQgPSAwOworICBpbnQgZ2FpZXJyOworICBzaXplX3QgaW5kZXg7CisgIHN0cnVjdCBhZGRyaW5mbyBoaW50cywgKmFpLCAqYWl0b3A7CisKKyAgZm9yIChpbmRleCA9IDA7IGluZGV4IDwgc2l6ZW9mIChmYW1pbHkpIC8gc2l6ZW9mIChmYW1pbHlbMF0pOyArK2luZGV4KQorICAgIHsKKyAgICAgIG1lbXNldCAoJmhpbnRzLCAnXDAnLCBzaXplb2YgKGhpbnRzKSk7CisgICAgICBoaW50cy5haV9mYW1pbHkgPSBmYW1pbHlbaW5kZXhdOworICAgICAgaGludHMuYWlfc29ja3R5cGUgPSBTT0NLX1NUUkVBTTsKKworICAgICAgZ2FpZXJyID0gZ2V0YWRkcmluZm8gKE5VTEwsICI1NDMyMSIsICZoaW50cywgJmFpdG9wKTsKKyAgICAgIGlmIChnYWllcnIgIT0gMCkKKwl7CisJICBnYWlfc3RyZXJyb3IgKGdhaWVycik7CisJICByZXN1bHQgPSAxOworCX0KKyAgICAgIGVsc2UKKwl7CisJICBmb3IgKGFpID0gYWl0b3A7IGFpICE9IE5VTEw7IGFpID0gYWktPmFpX25leHQpCisJICAgIHsKKwkgICAgICBwcmludGYgKCJTaG91bGQgcmV0dXJuIGZhbWlseTogJWQuIFJldHVybmVkOiAlZFxuIiwKKwkJICAgICAgZmFtaWx5W2luZGV4XSwgYWktPmFpX2ZhbWlseSk7CisJICAgICAgcmVzdWx0IHw9IGZhbWlseVtpbmRleF0gIT0gYWktPmFpX2ZhbWlseTsKKwkgICAgfQorCisJICB3aGlsZSAoYWl0b3AgIT0gTlVMTCkKKwkgICAgeworCSAgICAgIGFpID0gYWl0b3A7CisJICAgICAgYWl0b3AgPSBhaXRvcC0+YWlfbmV4dDsKKwkgICAgICBmcmVlYWRkcmluZm8gKGFpKTsKKwkgICAgfQorCX0KKyAgICB9CisKKyAgcmV0dX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aWYgKHJ2ID09IDApCisgICAgeworICAgICAgc3RydWN0IHNvY2thZGRyX2luICpwc2luID0gMDsKKyAgICAgIGludCBnb3RfdGNwLCBnb3RfdWRwOworICAgICAgaW50IGVyciA9IDA7CisKKyAgICAgIGdvdF90Y3AgPSBnb3RfdWRwID0gMDsKKyAgICAgIGZvciAocGFpID0gYWlyZXM7IHBhaTsgcGFpID0gcGFpLT5haV9uZXh0KQorICAgICAgICB7CisgICAgICAgICAgcHJpbnRmICgiYWlfZmFtaWx5PSVkLCBhaV9hZGRybGVuPSVkLCBhaV9zb2NrdHlwZT0lZCIsCisgICAgICAgICAgICAgICAgICAoaW50KSBwYWktPmFpX2ZhbWlseSwgKGludCkgcGFpLT5haV9hZGRybGVuLAorICAgICAgICAgICAgICAgICAgKGludCkgcGFpLT5haV9zb2NrdHlwZSk7CisgICAgICAgICAgaWYgKHBhaS0+YWlfZmFtaWx5ID09IEFGX0lORVQpCisgICAgICAgICAgICBwcmludGYgKCIsIHBvcnQ9JWQiLAorICAgICAgICAgICAgICAgICAgICBudG9ocyAoKChzdHJ1Y3Qgc29ja2FkZHJfaW4gKikgcGFpLT5haV9hZGRyKS0+c2luX3BvcnQpKTsKKyAgICAgICAgICBwdXRzICgiIik7CisKKyAgICAgICAgICBlcnIgfD0gcGFpLT5haV9mYW1pbHkgIT0gQUZfSU5FVDsKKyAgICAgICAgICBlcnIgfD0gcGFpLT5haV9hZGRybGVuICE9IHNpemVvZiAoc3RydWN0IHNvY2thZGRyX2luKTsKKyAgICAgICAgICBlcnIgfD0gcGFpLT5haV9hZGRyID09IDA7CisgICAgICAgICAgaWYgKHBhaS0+YWlfZmFtaWx5ID09IEFGX0lORVQpCisgICAgICAgICAgICBlcnIgfD0KKyAgICAgICAgICAgICAgbnRvaHMgKCgoc3RydWN0IHNvY2thZGRyX2luICopIHBhaS0+YWlfYWRkciktPnNpbl9wb3J0KSAhPSBwb3J0OworICAgICAgICAgIGdvdF90Y3AgfD0gcGFpLT5haV9zb2NrdHlwZSA9PSBTT0NLX1NUUkVBTTsKKyAgICAgICAgICBnb3RfdWRwIHw9IHBhaS0+YWlfc29ja3R5cGUgPT0gU09DS19ER1JBTTsKKyAgICAgICAgICBpZiAoZXJyKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGlmIChlcnIpCisgICAgICAgIHsKKyAgICAgICAgICBwcmludGYgKCJGQUlMIGdldGFkZHJpbmZvIElQdjQgc29ja3R5cGUgMCw1MTM6ICIKKyAgICAgICAgICAgICAgICAgICJmYW0gJWQgYWxlbiAlZCBhZGRyICVwIGFkZHIvZmFtICVkICIKKyAgICAgICAgICAgICAgICAgICJhZGRyL3BvcnQgJWQgSFslZF1cbiIsCisgICAgICAgICAgICAgICAgICBwYWktPmFpX2ZhbWlseSwgcGFpLT5haV9hZGRybGVuLCBwc2luLAorICAgICAgICAgICAgICAgICAgcHNpbiA/IHBzaW4tPnNpbl9mYW1pbHkgOiAwLAorICAgICAgICAgICAgICAgICAgcHNpbiA/IHBzaW4tPnNpbl9wb3J0IDogMCwKKyAgICAgICAgICAgICAgICAgIHBzaW4gPyBodG9ucyAocHNpbi0+c2luX3BvcnQpIDogMCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKGdvdF90Y3AgJiYgZ290X3VkcCkKKyAgICAgICAgeworICAgICAgICAgIHByaW50ZiAoIlNVQ0NFU1MgZ2V0YWRkcmluZm8gSVB2NCBzb2NrdHlwZSAwLDUxM1xuIik7CisgICAgICAgICAgcmVzID0gMDsKKyAgICAgICAgfQorICAgICAgZWxzZQorICAgICAgICBwcmludGYgKCJGQUlMIGdldGFkZHJpbmZvIElQdjQgc29ja3R5cGUgMCw1MTMgVENQICVkIgorICAgICAgICAgICAgICAgICIgVURQICVkXG4iLCBnb3RfdGNwLCBnb3RfdWRwKTsKKyAgICAgIGZyZWVhZGRyaW5mbyAoYWlyZXMpOworICAgIH0KKyAgZWxzZQorICAgIHByaW50ZiAoIkZBSUwgZ2V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OworCisKK3N0YXRpYyBsb25nIGludAorZmluZF9maWxlIChjb25zdCBjaGFyICpzKQoreworICBpbnQgbGV2ZWwgPSAxOworICBsb25nIGludCBpZHggPSAwOworCisgIHdoaWxlIChzWzBdID09ICcvJykKKyAgICB7CisgICAgICBpZiAoc1sxXSA9PSAnXDAnKQorCXsKKwkgIHMgPSAiLiI7CisJICBicmVhazsKKwl9CisgICAgICArK3M7CisgICAgfQorCisgIGlmIChzdHJjbXAgKHMsICIuIikgPT0gMCkKKyAgICByZXR1cm4gMDsKKworICBpZiAoc1swXSA9PSAnLicgJiYgc1sxXSA9PSAnLycpCisgICAgcyArPSAyOworCisgIHdoaWxlICgqcyAhPSAnXDAnKQorICAgIHsKKyAgICAgIGNoYXIgKmVuZHAgPSBzdHJjaHJudWwgKHMsICcvJyk7CisKKyAgICAgIFBSSU5URiAoImxvb2tpbmcgZm9yICUuKnMsIGxldmVsICVkXG4iLCAoaW50KSAoZW5kcCAtIHMpLCBzLCBsZXZlbCk7CisKKyAgICAgIHdoaWxlIChpZHggPCBuZmlsZXMgJiYgZmlsZXN5c3RlbVtpZHhdLmxldmVsID49IGxldmVsKQorCXsKKwkgIGlmIChmaWxlc3lzdGVtW2lkeF0ubGV2ZWwgPT0gbGV2ZWwKKwkgICAgICAmJiBtZW1jbXAgKHMsIGZpbGVzeXN0ZW1baWR4XS5uYW1lLCBlbmRwIC0gcykgPT0gMAorCSAgICAgICYmIGZpbGVzeXN0ZW1baWR4XS5uYW1lW2VuZHAgLSBzXSA9PSAnXDAnKQorCSAgICBicmVhazsKKwkgICsraWR4OworCX0KKworICAgICAgaWYgKGlkeCA9PSBuZmlsZXMgfHwgZmlsZXN5c3RlbVtpZHhdLmxldmVsIDwgbGV2ZWwpCisJeworCSAgZXJybm8gPSBFTk9FTlQ7CisJICByZXR1cm4gLTE7CisJfQorCisgICAgICBpZiAoKmVuZHAgPT0gJ1wwJykKKwlyZXR1cm4gaWR4ICsgMTsKKworICAgICAgaWYgKGZpbGVzeXN0ZW1baWR4XS50eXBlICE9IERUX0RJUgorCSAgJiYgKGlkeCArIDEgPj0gbmZpbGVzCisJICAgICAgfHwgZmlsZXN5c3RlbVtpZHhdLmxldmVsID49IGZpbGVzeXN0ZW1baWR4ICsgMV0ubGV2ZWwpKQorCXsKKwkgIGVycm5vID0gRU5PVERJUjsKKwkgIHJldHVybiAtMTsKKwl9CisKKyAgICAgICsraWR4OworCisgICAgICBzID0gZW5kcCArIDE7CisgICAgICArK2xldmVsOworICAgIH0KKworICBlcnJubyA9IEVOT0VOVDsKKyAgcmV0dXJuIC0xOworfQorCisKK3N0YXRpYyB2b2lkICoKK215X29wZW5kaXIgKGNvbnN0IGNoYXIgKnMpCit7CisgIGxvbmcgaW50IGlkeCA9IGZpbmRfZmlsZSAocyk7CisgIG15X0RJUiAqZGlyOworCisKKyAgaWYgKGlkeCA9PSAtMSB8fCBmaWxlc3lzdGVtW2lkeF0udHlwZSAhPSBEVF9ESVIpCisgICAgeworICAgICAgUFJJTlRGICgibXlfb3BlbmRpcihcIiVzXCIpID09IE5VTExcbiIsIHMpOworICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgIGRpciA9IChteV9ESVIgKikgbWFsbG9jIChzaXplb2YgKG15X0RJUikpOworICBpZiAoZGlyID09IE5VTEwpCisgICAgZXJyb3IgKEVYSVRfRkFJTFVSRSwgZXJybm8sICJjYW5ub3QgYWxsb2NhdGUgZGlyZWN0b3J5IGhhbmRsZSIpOworCisgIGRpci0+bGV2ZWwgPSBmaWxlc3lzdGVtW2lkeF0ubGV2ZWw7CisgIGRpci0+aWR4ID0gaWR4OworCisgIFBSSU5URiAoIm15X29wZW5kaXIoXCIlc1wiKSA9PSB7IGxldmVsOiAlZCwgaWR4OiAlbGQgfVxuIiwKKwkgIHMsIGZpbGVzeXN0ZW1baWR4XS5sZXZlbCwgaWR4KTsKKworICByZXR1cm4gZGlyOworfQorCisKK3N0YXRpYyBzdHJ1Y3QgZGlyZW50ICoKK215X3Jl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FQ0siCisgIH07CisjZGVmaW5lIG5zdHJzIChzaXplb2YgKHN0cnMpIC8gc2l6ZW9mIChzdHJzWzBdKSkKKyAgc3RhdGljIGNoYXIgYnVmWzEwMF07CisgIGNoYXIgKmNwID0gYnVmOworICBpbnQgY250OworCisgIGZvciAoY250ID0gMDsgY250IDwgbnN0cnM7ICsrY250KQorICAgIGlmIChmbGFncyAmICgxIDw8IGNudCkpCisgICAgICB7CisJZmxhZ3MgJj0gfigxIDw8IGNudCk7CisJaWYgKGNwICE9IGJ1ZikKKwkgICpjcCsrID0gJ3wnOworCWNwID0gc3RwY3B5IChjcCwgc3Ryc1tjbnRdKTsKKyAgICAgIH0KKworICBpZiAoZmxhZ3MgIT0gMCkKKyAgICB7CisgICAgICBpZiAoY3AgIT0gYnVmKQorCSpjcCsrID0gJ3wnOworICAgICAgc3ByaW50ZiAoY3AsICIlI3giLCBmbGFncyk7CisgICAgfQorCisgIHJldHVybiBidWY7CisjdW5kZWYgbnN0cnMKK30KKworCitzdGF0aWMgY29uc3QgY2hhciAqCitlcnJzdHIgKGludCB2YWwpCit7CisgIHN0YXRpYyBjb25zdCBjaGFyICpjb25zdCBzdHJzW10gPQorICAgIHsKKyAgICAgIFtHTE9CX05PU1BBQ0VdID0gIkdMT0JfTk9TUEFDRSIsCisgICAgICBbR0xPQl9BQk9SVEVEXSA9ICJHTE9CX0FCT1JURUQiLAorICAgICAgW0dMT0JfTk9NQVRDSF0gPSAiR0xPQl9OT01BVENIIiwKKyAgICAgIFtHTE9CX05PU1lTXSA9ICJHTE9CX05PU1lTIgorICAgIH07CisjZGVmaW5lIG5zdHJzIChzaXplb2YgKHN0cnMpIC8gc2l6ZW9mIChzdHJzWzBdKSkKKyAgc3RhdGljIGNoYXIgYnVmWzEwMF07CisgIGlmICh2YWwgPCAwIHx8IHZhbCA+PSBuc3RycyB8fCBzdHJzW3ZhbF0gPT0gTlVMTCkKKyAgICB7CisgICAgICBzbnByaW50ZiAoYnVmLCBzaXplb2YgK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hdCBuaWNlKCkgZG9lcyBub3QgaW5jb3JyZWN0bHkgcmV0dXJuIDAuICAqLworc3RhdGljIGludAorZG9fdGVzdCAodm9pZCkKK3sKKyAgaW50IHJldDsKKyAgY29uc3QgaW50IGluY3IgPSAxMDsKKyAgaW50IG9sZDsKKworICAvKiBEaXNjb3ZlciBjdXJyZW50IG5pY2UgdmFsdWUuICAqLworICBlcnJubyA9IDA7CisgIG9sZCA9IG5pY2UgKDApOworICBpZiAob2xkID09IC0xICYmIGVycm5vICE9IDApCisgICAgeworICAgICAgcHJpbnRmICgiYnJlYWs6IG5pY2UoJWQpIHJldHVybjogJWQsICVtXG4iLCAwLCBvbGQpOworICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgIC8qIE5pY2Ugb3Vyc2VsdmVzIHVwLiAgKi8KKyAgZXJybm8gPSAwOworICByZXQgPSBuaWNlIChpbmNyKTsKKyAgaWYgKHJldCA9PSAtMSAmJiBlcnJubyAhPSAwKQorICAgIHsKKyAgICAgIHByaW50ZiAoImJyZWFrOiBuaWNlKCVkKSByZXR1cm46ICVkLCAlbVxuIiwgaW5jciwgcmV0KTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICAvKiBDaGVjayBmb3IgcmV0dXJuIHZhbHVlIGJlaW5nIHplcm8gd2hlbiBpdCBzaG91bGRuJ3QuICBDYW5ub3Qgc2ltcGx5CisgICAgIGNoZWNrIGZvciBleHBlY3RlZCB2YWx1ZSBzaW5jZSBuaWNlIHZhbHVlcyBhcmUgY2FwcGVkIGF0IDJebi0xLgorICAgICBCdXQgd2UgYXNzdW1lIHRoYXQgd2UgZGlkbid0IHN0YXJ0IGF0IHRoZSBjYXAgYW5kIHNvIHNob3VsZCBoYXZlCisgICAgIGluY3JlYXNlZCBzb21lLiAgKi8KKyAgaWYgKHJldCA8PSBvbGQpCisgICAgeworICAgICAgcHJpbnRmICgiRkFJTDogcmV0dmFsICglZCkgb2YgbmljZSglZCkgIT0gJWRcbiIsIHJldCwgaW5jci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mFtZSwgX1BDX1BJUEVfQlVGKTsKKworICBpZiAoZmlmb19wYXRoY29uZiA8IDApCisgICAgeworICAgICAgcHJpbnRmICgicGF0aGNvbmYgb24gZmlsZSBmYWlsZWQ6ICVzXG4iLCBzdHJlcnJvciAoZXJybm8pKTsKKyAgICAgIHJldCA9IDE7CisgICAgICBnb3RvIG91dF9ub2ZpZm87CisgICAgfQorCisgIGludCBmaWZvID0gb3BlbiAoZmlsZW5hbWUsIE9fUkRPTkxZIHwgT19OT05CTE9DSyk7CisKKyAgaWYgKGZpZm8gPCAwKQorICAgIHsKKyAgICAgIHByaW50ZiAoImZpZm8gb3BlbiBmYWlsZWQgKCVzKVxuIiwgc3RyZXJyb3IgKGVycm5vKSk7CisgICAgICByZXQgPSAxOworICAgICAgZ290byBvdXRfbm9maWZvOworICAgIH0KKworICBsb25nIGRpcl9mcGF0aGNvbmYgPSBmcGF0aGNvbmYgKGRpcl9mZCwgX1BDX1BJUEVfQlVGKTsKKworICBpZiAoZGlyX2ZwYXRoY29uZiA8IDApCisgICAgeworICAgICAgcHJpbnRmICgiZnBhdGhjb25mIG9uIGRpcmVjdG9yeSBmYWlsZWQ6ICVzXG4iLCBzdHJlcnJvciAoZXJybm8pKTsKKyAgICAgIHJldCA9IDE7CisgICAgICBnb3RvIG91dDsKKyAgICB9CisKKyAgbG9uZyBmaWZvX2ZwYXRoY29uZiA9IGZwYXRoY29uZiAoZmlmbywgX1BDX1BJUEVfQlVGKTsKKworICBpZiAoZmlmb19mcGF0aGNvbmYgPCAwKQorICAgIHsKKyAgICAgIHByaW50ZiAoImZwYXRoY29uZiBvbiBmaWxlIGZhaWxlZDogJXNcbiIsIHN0cmVycm9yIChlcnJubykpOworICAgICAgcmV0ID0gMTsKKyAgICAgIGdvdG8gb3V0OworICAgIH0KKworICBpZiAoZmlmb19wYXRoY29uZiAhPSBmaWZvX2ZwYXRoY29uZikKKyAgICB7CisgICAgICBwcmludGYgKCJmaWZvIHBhdGhjb25mICglbGQpICE9IGZpZm8gZnBhdGhjb25mICglbGQpXG4iLCBmaWZvX3BhdGhjb25mLAorCSAgICAgIGZpZm9fZnBhdGhjb25mKTsKKyAgICAgIHJldCA9IDE7CisgICAgICBnb3RvIG91dDsKKyAgICB9CisKKyAgaWYgKGRpcl9wYXRoY29uZiAhPSBmaWZvX3BhdGhjb25mKQorICAgIHsKKyAgICAgIHByaW50ZiAoImRpcmVjdG9yeSBwYXRoY29uZiAoJWxkKSAhPSBmaWZvIHBhdGhjb25mICglbGQpXG4iLAorCSAgICAgIGRpcl9wYXRoY29uZiwgZmlmb19wYXRoY29uZik7CisgICAgICByZXQgPSAxOworICAgICAgZ290byBvdXQ7CisgICAgfQorCisgIGlmIChkaXJfZnBhdGhjb25mICE9IGZpZm9fZnBhdGhjb25mKQorICAgIHsKKyAgICAgIHByaW50ZiAoImRpcmVjdG9yeSBmcGF0aGNvbmYgKCVsZCkgIT0gZmlmbyBmcGF0aGNvbmYgKCVsZClcbiIsCisJICAgICAgZGlyX2ZwYXRoY29uZiwgZmlmb19mcGF0aGNvbmYpOworICAgICAgcmV0ID0gMTsKKyAgICAgIGdvdG8gb3V0OworICAgIH0KKworb3V0OgorICBjbG9zZSAoZmlmbyk7CitvdXRfbm9maWZvOgorICBjbG9zZSAoZGlyX2ZkKTsKKworICBpZiAodW5saW5rIChmaWxlbmFtZSkgIT0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJDb3VsZCBub3QgcmVtb3ZlIGZpZm8gKCVzKVxuIiwgc3RyZXJyb3IgKGVycm5vKSk7CisgICAgICByZXQgPSAxOworICAgIH0KKworICBpZiAocm1kaXIgKGRpcmJ1ZikgIT0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJDb3VsZCBub3QgcmVtb3ZlIGRpcmVjdG9yeSAoJXMpXG4iLCBzdHJlcnJvciAoZXJybm8pKTsKKyAgICAgIHJldCA9IDE7CisgICAgfQorCisgIHJldHVybiByZXQ7Cit9CmRpZmYgLS1naXQgYS9hcC9saW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k1pc3NpbmcgdGVzdCBmaWxlbmFtZVxuIik7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgZiA9IGZvcGVuIChhcmd2WzFdLCAiciIpOworICBpZiAoZiA9PSBOVUxMKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIkNvdWxkbid0IG9wZW4gJXNcbiIsIGFyZ3ZbMV0pOworICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgIGlmICgobGVuID0gZ2V0bGluZSAoJmxpbmUsICZsaW5lX2xlbiwgZikpIDw9IDAKKyAgICAgIHx8IHN0cm5jbXAgKGxpbmUsICIjIFBDUkUiLCA2KSAhPSAwKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIk5vdCBhIFBDUkUgdGVzdCBmaWxlXG4iKTsKKyAgICAgIGZjbG9zZSAoZik7CisgICAgICBmcmVlIChsaW5lKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICBsaW5lbnVtID0gMTsKKworICB3aGlsZSAoKGxlbiA9IGdldGxpbmUgKCZsaW5lLCAmbGluZV9sZW4sIGYpKSA+IDApCisgICAgeworICAgICAgY2hhciAqcDsKKyAgICAgIHVuc2lnbmVkIGxvbmcgbnVtOworCisgICAgICArK2xpbmVudW07CisKKyAgICAgIGlmIChsaW5lW2xlbiAtIDFdID09ICdcbicpCisJbGluZVstLWxlbl0gPSAnXDAnOworCisgICAgICBpZiAobGluZVswXSA9PSAnIycpCisJY29udGludWU7CisKKyAgICAgIGlmIChsaW5lWzBdID09ICdcMCcpCisJeworCSAgLyogRW5kIG9mIHRlc3QuICAqLworCSAgaWdub3JlY2FzZSA9IDA7CisJICBwYXR0ZXJuX3ZhbGlkID0gMDsKKwkgIHJtX3ZhbGlkID0gMDsKKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgaWYgKGxpbmVbMF0gPT0gJy8nKQorCXsKKwkgIC8qIFBhdHRlcm4uICAqLworCSAgcCA9IHN0cnJjaHIgKGxpbmUgKy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Kwl7CisJICByZWdleF90IHJlOworCSAgaW50IG47CisKKwkgIGlmICghcGF0dGVybl92YWxpZCkKKwkgICAgeworCSAgICAgIHByaW50ZiAoIiV6ZDogTm8gcHJldmlvdXMgdmFsaWQgcGF0dGVybiAlc1xuIiwgbGluZW51bSwgbGluZSk7CisJICAgICAgY29udGludWU7CisJICAgIH0KKworCSAgaWYgKHN0cmluZ19hbGxvY2VkIDwgKHNpemVfdCkgKGxlbiAtIDMpKQorCSAgICB7CisJICAgICAgc3RyaW5nID0gcmVhbGxvYyAoc3RyaW5nLCBsZW4gLSAzKTsKKwkgICAgICBpZiAoc3RyaW5nID09IE5VTEwpCisJCXsKKwkJICBwcmludGYgKCIlemQ6IENhbm5vdCByZWNvcmQgc2VhcmNoIHN0cmluZzogJW1cbiIsIGxpbmVudW0pOworCQkgIHJldCA9IDE7CisJCSAgYnJlYWs7CisJCX0KKwkgICAgICBzdHJpbmdfYWxsb2NlZCA9IGxlbiAtIDM7CisJICAgIH0KKworCSAgbWVtY3B5IChzdHJpbmcsIGxpbmUgKyA0LCBsZW4gLSAzKTsKKworCSAgbiA9IHJlZ2NvbXAgKCZyZSwgcGF0dGVybiwKKwkJICAgICAgIFJFR19FWFRFTkRFRCB8IChpZ25vcmVjYXNlID8gUkVHX0lDQVNFIDogMCkpOworCSAgaWYgKG4gIT0gMCkKKwkgICAgeworCSAgICAgIGNoYXIgYnVmWzUwMF07CisJICAgICAgcmVnZXJyb3IgKG4sICZyZSwgYnVmLCBzaXplb2YgKGJ1ZikpOworCSAgICAgIHByaW50ZiAoIiV6ZDogcmVnY29tcCBmYWlsZWQgZm9yICVzOiAlc1xuIiwKKwkJICAgICAgbGluZW51bSwgcGF0dGVybiwgYnVmKTsKKwkgICAgICByZXQgPSAxOworCSAgICAgIGNvbnRpbnVlOworCSAgICB9CisKKwkgIGlmIChyZWdleGVjICgmcmUsIHN0cmluZywgMjAsIHJtLCAwKSkKKwkgICAgeworCSAgICAgIHJtWzBdLnJtX3NvID0gLTE7CisJICAgICAgcm1bMF0ucm1fZW8gPSAtMTsKKwkgICAgfQorCisJICByZWdmcmVlICgmcmUpOworCSAgcm1fdmFsaWQgPSAxOworCSAgY29udGludWU7CisJfQorCisgICAgICBpZiAoIXJtX3ZhbGlkKQorCXsKKwkgIHByaW50ZiAoIiV6ZDogTm8gcHJlY2VlZGluZyBwYXR0ZXJuIG9yIHNlYXJjaCBzdHJpbmdcbiIsIGxpbmVudW0pOworCSAgcmV0ID0gMTsKKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgaWYgKHN0cmNtcCAobGluZSwgIk5vIG1hdGNoIikgPT0gMCkKKwl7CisJICBpZiAocm1bMF0ucm1fc28gIT0gLTEgfHwgcm1bMF0ucm1fZW8gIT0gLTEpCisJICAgIHsKKwkgICAgICBwcmludGYgKCIlemQ6IC8lcy8gb24gJXMgdW5leHBlY3RlZGx5IG1hdGNoZWQgJWQuLiVkXG4iLAorCQkgICAgICBsaW5lbnVtLCBwYXR0ZXJuLCBzdHJpbmcsIHJtWzBdLnJtX3NvLCBybVswXS5ybV9lbyk7CisJICAgICAgcmV0ID0gMTsKKwkgICAgfQorCisJICBjb250aW51ZTsKKwl9CisKKyAgICAgIHAgPSBsaW5lOworICAgICAgaWYgKCpwID09ICcgJykKKyAgICAgICAgKytwOworCisgICAgICBudW0gPSBzdHJ0b3VsIChwLCAmcCwgMTApOworICAgICAgaWYgKG51bSA+PSAyMCB8fCAqcCAhPSAnOicgfHwgcFsxXSAhPSAnICcpCisJeworCSAgcHJpbnRmICgiJXpkOiBJbnZhbGlkIGxpbmUgJXNcbiIsIGxpbmVudW0sIGxpbmUpOworCSAgcmV0ID0gMTsKKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgaWYgKHJtW251bV0ucm1fc28gPT0gLTEgfHwgcm1bbnVtXS5ybV9lbyA9PSAtMSkKKwl7CisJICBpZiAoc3RyY21wIChwICsgMiwgIjx1bnNldD4iKSAhPSAwKQorCSAgICB7CisJICAgICAgcHJ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isgICAgICByZWdtYXRjaF90IG1hWzFdOworICAgICAgY29uc3QgY2hhciAqc3A7CisgICAgICBjb25zdCBjaGFyICplcDsKKworICAgICAgZXJyID0gcmVnZXhlYyAoJnJlLCBtZW0gKyBvZmZzZXQsIDEsIG1hLCAwKTsKKyAgICAgIGlmIChlcnIgPT0gUkVHX05PTUFUQ0gpCisJYnJlYWs7CisKKyAgICAgIGlmIChlcnIgIT0gUkVHX05PRVJST1IpCisJeworCSAgY2hhciBidWZbMjAwXTsKKwkgIHJlZ2Vycm9yIChlcnIsICZyZSwgYnVmLCBzaXplb2YgYnVmKTsKKwkgIGVycm9yIChFWElUX0ZBSUxVUkUsIDAsICJjYW5ub3QgdXNlIGV4cHJlc3Npb246ICVzIiwgYnVmKTsKKwl9CisKKyAgICAgIGFzc2VydCAobWFbMF0ucm1fc28gPj0gMCk7CisgICAgICBzcCA9IG1lbSArIG9mZnNldCArIG1hWzBdLnJtX3NvOworICAgICAgd2hpbGUgKHNwID4gbWVtICYmIHNwWy0xXSAhPSAnXG4nKQorCS0tc3A7CisKKyAgICAgIGVwID0gbWVtICsgb2Zmc2V0ICsgbWFbMF0ucm1fc287CisgICAgICB3aGlsZSAoKmVwICE9ICdcMCcgJiYgKmVwICE9ICdcbicpCisJKytlcDsKKworICAgICAgcHJpbnRmICgibWF0Y2ggJWQ6IFwiJS4qc1wiXG4iLCArK2NudCwgKGludCkgKGVwIC0gc3ApLCBzcCk7CisKKyAgICAgIG9mZnNldCA9IGVwICsgMSAtIG1lbTsKKyAgICB9CisKKyAgcmVnZnJlZSAoJnJlKTsKKworI2lmIGRlZmluZWQgX1BPU0lYX0NQVVRJTUUgJiYgX1BPU0lYX0NQVVRJTUUgPj0gMAorICBpZiAodXNlX2Nsb2NrICYmICF0aW1pbmcpCisgICAgeworICAgICAgdXNlX2Nsb2NrID0gY2xvY2tfZ2V0dGltZSAoY2wsICZmaW5pc2gpID09IDA7CisgICAgICBpZiAodXNlX2Nsb2NrKQorCXsKKwkgIGlmIChmaW5pc2gudHZfbnNlYyA8IHN0YXJ0LnR2X25zZWMpCisJICAgIHsKKwkgICAgICBmaW5pc2gudHZfbnNlYyAtPSBzdGFydC50dl9uc2VjIC0gMTAwMDAwMDAwMDsKKwkgICAgICBmaW5pc2gudHZfc2VjIC09IDEgKyBzdGFydC50dl9zZWM7CisJICAgIH0KKwkgIGVsc2UKKwkgICAgeworCSAgICAgIGZpbmlzaC50dl9uc2VjIC09IHN0YXJ0LnR2X25zZWM7CisJICAgICAgZmluaXNoLnR2X3NlYyAtPSBzdGFydC50dl9zZWM7CisJICAgIH0KKworCSAgcHJpbnRmICgiZWxhcHNlZCB0aW1lOiAlamQuJTA5amQgc2VjXG4iLAorCQkgIChpbnRtYXhfdCkgZmluaXNoLnR2X3NlYywgKGludG1heF90KSBmaW5pc2gudHZfbnNlYyk7CisJfQorICAgIH0KKworICBpZiAodXNlX2Nsb2NrICYmIHRpbWluZykKKyAgICB7CisgICAgICBzdHJ1Y3QgdGltZXNwZWMgbWludGltZSA9IHsgLnR2X3NlYyA9IDI0ICogNjAgKiA2MCB9OworCisgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDEwOyArK2kpCisJeworCSAgb2Zmc2V0ID0gMDsKKwkgIHVzZV9jbG9jayA9IGNsb2NrX2dldHRpbWUgKGNsLCAmc3RhcnQpID09IDA7CisKKwkgIGlmICghdXNlX2Nsb2NrKQorCSAgICBjb250aW51ZTsKKworCSAgZXJyID0gcmVnY29tcCAoJnJlLCBleHByLCBSRUdfTkVXTElORSB8IChpY2FzZSA/IFJFR19JQ0FTRSA6IDApKTsKKwkgIGlmIChlcnIgIT0gUkVHX05PRVJST1IpCisJICAgIGNvbnRpbnVlOworCisJICB3aGlsZSAob2Zmc2V0IDwgbWVtbGVuKQorCSAgICB7CisJICAgICAgcmVnbWF0Y2hfdCBtYVsxXTsKKworCSAgICAgIGVyciA9IHJlZ2V4ZWMgKCZyZSwgbWVtICsgb2Zmc2V0LCAxLCBtYSwgMCk7CisJICAgICAgaWYgKGVyciAhPSBSRUdfTk9FUlJPUikKKwkJYnJlYWs7CisKKwkgICAgICBvZmZzZXQgKz0gbWFbMF0ucm1fZW87CisJICAgIH0KKworCSAgcmVnZnJlZSAoJnJlKTsKKworCSAgdXNlX2Nsb2NrID0gY2xvY2tfZ2V0dGltZSAoY2wsICZmaW5pc2gpID09IDA7CisJICBpZiAodXNlX2Nsb2NrKQorCSAgICB7CisJICAgICAgaWYgKGZpbmlzaC50dl9uc2VjIDwgc3RhcnQudHZfbnNlYykKKwkJeworCQkgIGZpbmlzaC50dl9uc2VjIC09IHN0YXJ0LnR2X25zZWMgLSAxMDAwMDAwMDAwOworCQkgIGZpbmlzaC50dl9zZWMgLT0gMSArIHN0YXJ0LnR2X3NlYzsKKwkJfQorCSAgICAgIGVsc2UKKwkJeworCQkgIGZpbmlzaC50dl9uc2VjIC09IHN0YXJ0LnR2X25zZWM7CisJCSAgZmluaXNoLnR2X3NlYyAtPSBzdGFydC50dl9zZWM7CisJCX0KKwkgICAgICBpZiAoZmluaXNoLnR2X3NlYyA8IG1pbnRpbWUudHZfc2VjCisJCSAgfHwgKGZpbmlzaC50dl9zZWMgPT0gbWludGltZS50dl9zZWMKKwkJICAgICAgJiYgZmluaXNoLnR2X25zZWMgPCBtaW50aW1lLnR2X25zZWMpKQorCQltaW50aW1lID0gZmluaXNoOworCSAgICB9CisJfQorICAgICAgcHJpbnRmICgiZWxhcHNlZCB0aW1lOiAlamQuJTA5amQgc2VjXG4iLAorCSAgICAgIChpbnRtYXhfdCkgbWludGltZS50dl9zZWMsIChpbnRtYXhfdCkgbWludGltZS50dl9uc2VjKTsKKyAgICB9CisjZW5kaWYKKworICAvKiBSZXR1cm4gYW4gZXJyb3IgaWYgdGhlIG51bWJlciBvZiBtYXRjaGVzIGZvdW5kIGlzIG5vdCBtYXRjaCB3ZQorICAgICBleHBlY3QuICAqLworICByZXR1cm4gY250ICE9IGV4cGVjdGVkOworfQorCisKK3N0YXRpYyBpb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XRpbWluZykKKyAgICB7CisgICAgICB1c2VfY2xvY2sgPSBjbG9ja19nZXR0aW1lIChjbCwgJmZpbmlzaCkgPT0gMDsKKyAgICAgIGlmICh1c2VfY2xvY2spCisJeworCSAgaWYgKGZpbmlzaC50dl9uc2VjIDwgc3RhcnQudHZfbnNlYykKKwkgICAgeworCSAgICAgIGZpbmlzaC50dl9uc2VjIC09IHN0YXJ0LnR2X25zZWMgLSAxMDAwMDAwMDAwOworCSAgICAgIGZpbmlzaC50dl9zZWMgLT0gMSArIHN0YXJ0LnR2X3NlYzsKKwkgICAgfQorCSAgZWxzZQorCSAgICB7CisJICAgICAgZmluaXNoLnR2X25zZWMgLT0gc3RhcnQudHZfbnNlYzsKKwkgICAgICBmaW5pc2gudHZfc2VjIC09IHN0YXJ0LnR2X3NlYzsKKwkgICAgfQorCisJICBwcmludGYgKCJlbGFwc2VkIHRpbWU6ICVqZC4lMDlqZCBzZWNcbiIsCisJCSAgKGludG1heF90KSBmaW5pc2gudHZfc2VjLCAoaW50bWF4X3QpIGZpbmlzaC50dl9uc2VjKTsKKwl9CisgICAgfQorCisgIGlmICh1c2VfY2xvY2sgJiYgdGltaW5nKQorICAgIHsKKyAgICAgIHN0cnVjdCB0aW1lc3BlYyBtaW50aW1lID0geyAudHZfc2VjID0gMjQgKiA2MCAqIDYwIH07CisKKyAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMTA7ICsraSkKKwl7CisJICBvZmZzZXQgPSBtZW1sZW47CisJICB1c2VfY2xvY2sgPSBjbG9ja19nZXR0aW1lIChjbCwgJnN0YXJ0KSA9PSAwOworCisJICBpZiAoIXVzZV9jbG9jaykKKwkgICAgY29udGludWU7CisKKwkgIG1lbXNldCAoJnJlLCAwLCBzaXplb2YgKHJlKSk7CisJICByZS5mYXN0bWFwID0gbWFsbG9jICgyNTYpOworCSAgaWYgKHJlLmZhc3RtYXAgPT0gTlVMTCkKKwkgICAgY29udGludWU7CisKKwkgIGVyciA9IHJlX2NvbXBpbGVfcGF0dGVybiAoZXhwciwgc3RybGVuIChleHByKSwgJnJlKTsKKwkgIGlmIChlcnIgIT0gTlVMTCkKKwkgICAgY29udGludWU7CisKKwkgIGlmIChyZV9jb21waWxlX2Zhc3RtYXAgKCZyZSkpCisJICAgIHsKKwkgICAgICByZWdmcmVlICgmcmUpOworCSAgICAgIGNvbnRpbnVlOworCSAgICB9CisKKwkgIHdoaWxlIChvZmZzZXQgPD0gbWVtbGVuKQorCSAgICB7CisJICAgICAgaW50IHN0YXJ0OworCSAgICAgIGNvbnN0IGNoYXIgKnNwOworCisJICAgICAgc3RhcnQgPSByZV9zZWFyY2ggKCZyZSwgbWVtLCBtZW1sZW4sIG9mZnNldCwgLW9mZnNldCwgTlVMTCk7CisJICAgICAgaWYgKHN0YXJ0IDwgLTEpCisJCWJyZWFrOworCisJICAgICAgc3AgPSBtZW0gKyBzdGFydDsKKwkgICAgICB3aGlsZSAoc3AgPiBtZW0gJiYgc3BbLTFdICE9ICdcbicpCisJCS0tc3A7CisKKwkgICAgICBvZmZzZXQgPSBzcCAtIDEgLSBtZW07CisJICAgIH0KKworCSAgcmVnZnJlZSAoJnJlKTsKKworCSAgdXNlX2Nsb2NrID0gY2xvY2tfZ2V0dGltZSAoY2wsICZmaW5pc2gpID09IDA7CisJICBpZiAodXNlX2Nsb2NrKQorCSAgICB7CisJICAgICAgaWYgKGZpbmlzaC50dl9uc2VjIDwgc3RhcnQudHZfbnNlYykKKwkJeworCQkgIGZpbmlzaC50dl9uc2VjIC09IHN0YXJ0LnR2X25zZWMgLSAxMDAwMDAwMDAwOworCQkgIGZpbmlzaC50dl9zZWMgLT0gMSArIHN0YXJ0LnR2X3NlYzsKKwkJfQorCSAgICAgIGVsc2UKKwkJeworCQkgIGZpbmlzaC50dl9uc2VjIC09IHN0YXJ0LnR2X25zZWM7CisJCSAgZmluaXNoLnR2X3NlYyAtPSBzdGFydC50dl9zZWM7CisJCX0KKwkgICAgICBpZiAoZmluaXNoLnR2X3NlYyA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DEgPyAxIDogMTApOyArK2ssICsrbCkKKwkJICAgIGlmIChyZWdzLnN0YXJ0W2xdICE9IG1hdGNoICsgagorCQkJfHwgcmVncy5lbmRbbF0gIT0gcmVncy5zdGFydFtsXSArIDEpCisJCSAgICAgIHsKKwkJCXByaW50ZiAoIlxucmVncy57c3RhcnQsZW5kfVslZF0gaW5jb3JyZWN0XG4iLCBsKTsKKwkJCXJldHVybiAxOworCQkgICAgICB9CisJICAgIH0KKwl9CisKKyNpZiBkZWZpbmVkIF9QT1NJWF9DUFVUSU1FICYmIF9QT1NJWF9DUFVUSU1FID49IDAKKyAgICAgIGlmICh1c2VfY2xvY2spCisJdXNlX2Nsb2NrID0gY2xvY2tfZ2V0dGltZSAoY2wsICZzdG9wKSA9PSAwOworICAgICAgaWYgKHVzZV9jbG9jaykKKwl7CisJICBzdG9wLnR2X3NlYyAtPSBzdGFydC50dl9zZWM7CisJICBpZiAoc3RvcC50dl9uc2VjIDwgc3RhcnQudHZfbnNlYykKKwkgICAgeworCSAgICAgIHN0b3AudHZfc2VjLS07CisJICAgICAgc3RvcC50dl9uc2VjICs9IDEwMDAwMDAwMDAgLSBzdGFydC50dl9uc2VjOworCSAgICB9CisJICBlbHNlCisJICAgIHN0b3AudHZfbnNlYyAtPSBzdGFydC50dl9uc2VjOworCSAgcHJpbnRmICgiOiAlbGQuJTA5bGRzXG4iLCAobG9uZykgc3RvcC50dl9zZWMsIChsb25nKSBzdG9wLnR2X25zZWMpOworCX0KKyAgICAgIGVsc2UKKyNlbmRpZgorCXB1dGNoYXIgKCdcbicpOworCisgICAgICBpZiAodGVzdG5vIDwgMikKKwlyZWdmcmVlICgmcmJ1Zik7CisgICAgICBlbHNlCisJcmVnZnJlZSAoJnJwYnVmKTsKKyAgICB9CisKKyAgcmV0dXJuIDA7Cit9CisKKyNkZWZpbmUgVElNRU9VVCAyMAorI2RlZmluZSBURVNUX0ZVTkNUSU9OIGRvX3Rlc3QgKCkKKyNpbmNsdWRlICIuLi90ZX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wMiA9IHRydWU7CisgICppbjZhaSA9IE5VTEw7CisgICppbjZhaWxlbiA9IDA7Cit9CisKK3ZvaWQKK2F0dHJpYnV0ZV9oaWRkZW4KK19fZnJlZV9pbjZhaSAoc3RydWN0IGluNmFkZHJpbmZvICphaSkKK3sKK30KKwordm9pZAorYXR0cmlidXRlX2hpZGRlbgorX19jaGVja19uYXRpdmUgKHVpbnQzMl90IGExX2luZGV4LCBpbnQgKmExX25hdGl2ZSwKKwkJdWludDMyX3QgYTJfaW5kZXgsIGludCAqYTJfbmF0aXZlKQoreworfQorCitpbnQKK2F0dHJpYnV0ZV9oaWRkZW4KK19faWRuYV90b19hc2NpaV9seiAoY29uc3QgY2hhciAqaW5wdXQsIGNoYXIgKipvdXRwdXQsIGludCBmbGFncykKK3sKKyAgcmV0dXJuIDA7Cit9CisKK2ludAorYXR0cmlidXRlX2hpZGRlbgorX19pZG5hX3RvX3VuaWNvZGVfbHpseiAoY29uc3QgY2hhciAqaW5wdXQsIGNoYXIgKipvdXRwdXQsIGludCBmbGFncykKK3sKKyAgKm91dHB1dCA9IE5VTEw7CisgIHJldHVybiAwOworfQorCit2b2lkCithdHRyaWJ1dGVfaGlkZGVuCitfcmVzX2hjb25mX2luaXQgKHZvaWQpCit7Cit9CisKKyN1bmRlZglVU0VfTlNDRAorI2luY2x1ZGUgIi4uL3N5c2RlcHMvcG9zaXgvZ2V0YWRkcmluZm8uYyIKKworc2VydmljZV91c2VyICpfX25zc19ob3N0c19kYXRhYmFzZSBhdHRyaWJ1dGVfaGlkZGVuOworCisKKy8qIFRoaXMgaXMgdGhlIGJlZ2lubmluZyBvZiB0aGUgcmVhbCB0ZXN0IGNvZGUuICBUaGUgYWJvdmUgZGVmaW5lcworICAgKGFtb25nIG90aGVyIHRoaW5ncykgdGhlIGZ1bmN0aW9uIHJmYzM0ODRfc29ydC4gICovCisKKworI2lmIF9fQllURV9PUkRFUiA9PSBfX0JJR19FTkRJQU4KKyMgZGVmaW5lIGgobikgbgorI2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Qgc29ydF9yZXN1bHQgcmVzdWx0c1tuYWRkcnNdOworc3RhdGljIHNpemVfdCBvcmRlcltuYWRkcnNdOworCitzdGF0aWMgaW50IGV4cGVjdGVkW25hZGRyc10gPQorICB7CisgICAgOSwgNCwgMywgNiwgNSwgNywgOCwgMiwgMCwgMQorICB9OworCisKK3NzaXplX3QKK19fZ2V0bGluZSAoY2hhciAqKmxpbmVwdHIsIHNpemVfdCAqbiwgRklMRSAqcykKK3sKKyAgKmxpbmVwdHIgPSBOVUxMOworICAqbiA9IDA7CisgIHJldHVybiAwOworfQorCisKK3N0YXRpYyBpbnQKK2RvX3Rlc3QgKHZvaWQpCit7CisgIGxhYmVscyA9IGRlZmF1bHRfbGFiZWxzOworICBwcmVjZWRlbmNlID0gZGVmYXVsdF9wcmVjZWRlbmNlOworICBzY29wZXM9IGRlZmF1bHRfc2NvcGVzOworCisgIHN0cnVjdCBzb2NrYWRkcl9pbiBzbzsKKyAgc28uc2luX2ZhbWlseSA9IEFGX0lORVQ7CisgIHNvLnNpbl9hZGRyLnNfYWRkciA9IGggKDB4YzBhODVmMTkpOworICAvKiBDbGVhciB0aGUgcmVzdCBvZiB0aGUgc3RydWN0dXJlIHRvIGF2b2lkIHdhcm5pbmdzLiAgKi8KKyAgbWVtc2V0IChzby5zaW5femVybywgJ1wwJywgc2l6ZW9mIChzby5zaW5femVybykpOworCisgIGZvciAoaW50IGkgPSAwOyBpIDwgbmFkZHJzOyArK2kpCisgICAgeworICAgICAgYWlzW2ldLmFpX2ZhbWlseSA9IEFGX0lORVQ7CisgICAgICBhaXNbaV0uYWlfYWRkciA9IChzdHJ1Y3Qgc29ja2FkZHIgKikgJmFkZHJzW2ldOworICAgICAgcmVzdWx0c1tpXS5kZXN0X2FkZHIgPSAmYWlzW2ldOworICAgICAgcmVzdWx0c1tpXS5nb3Rfc291cmNlX2FkZHIgPSB0cnVlOworICAgICAgbWVtY3B5KCZyZXN1bHRzW2ldLnNvdXJjZV9hZGRyLCAmc28sI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ZWNpYWxfY2hhcnMgKGNoYXIgKnN0cikKK3sKKyAgZm9yICg7IChzdHIgPSBzdHJwYnJrIChzdHIsICJOVFNaIikpICE9IE5VTEw7ICsrc3RyKQorICAgIHN3aXRjaCAoKnN0cikKKyAgICAgIHsKKyAgICAgIGNhc2UgJ04nOiAqc3RyID0gJ1xuJzsgYnJlYWs7CisgICAgICBjYXNlICdUJzogKnN0ciA9ICdcdCc7IGJyZWFrOworICAgICAgY2FzZSAnUyc6ICpzdHIgPSAnICc7IGJyZWFrOworICAgICAgY2FzZSAnWic6ICpzdHIgPSAnXDAnOyBicmVhazsKKyAgICAgIH0KK30KKworc3RhdGljIHZvaWQKK2dsaWJjX3JlX3N5bnRheCAoY2hhciAqc3RyKQoreworICBjaGFyICpwLCAqZW5kID0gc3RyY2hyIChzdHIsICdcMCcpICsgMTsKKworICAvKiBSZXBsYWNlIFtbOjw6XV0gd2l0aCBcPCBhbmQgW1s6PjpdXSB3aXRoIFw+LiAgKi8KKyAgZm9yIChwID0gc3RyOyAocCA9IHN0cnN0ciAocCwgIltbOiIpKSAhPSBOVUxMOyApCisgICAgaWYgKChwWzNdID09ICc8JyB8fCBwWzNdID09ICc+JykgJiYgc3RybmNtcCAocCArIDQsICI6XV0iLCAzKSA9PSAwKQorICAgICAgeworICAgICAgICBwWzBdID0gJ1xcJzsKKyAgICAgICAgcFsxXSA9IHBbM107CisgICAgICAgIG1lbW1vdmUgKHAgKyAyLCBwICsgNywgZW5kIC0gcCAtIDcpOworICAgICAgICBlbmQgLT0gNTsKKyAgICAgICAgcCArPSAyOworICAgICAgfQorICAgIGVsc2UKKyAgICAgIHAgKz0gMzsKK30KKworc3RhdGljIGNoYXIgKgorbWJfcmVwbGFjZSAoY2hhciAqZHN0LCBjb25zdCBjaGFyIGMpCit7CisgIHN3aXRjaCAoYykKKyAgICB7CisgICAgLyogUmVwbGFjZSBhIHdpdGggXCdhIGFuZCBBIHdpdGggXCdBLiAgKi8KKyAgICBjYXNlICdhJzoKKyAgICAgICpkc3QrKyA9ICdceGMzJzsKKyAgICAgICpkc3QrKyA9ICdceGExJzsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJ0EnOgorICAgICAgKmRzdCsrID0gJ1x4YzMnOworICAgICAgKmRzdCsrID0gJ1x4ODEnOworICAgICAgYnJlYWs7CisgICAgLyogUmVwbGFjZSBiIHdpdGggXHZ7Y30gYW5kIEIgd2l0aCBcdntDfS4gICovCisgICAgY2FzZSAnYic6CisgICAgICAqZHN0KysgPSAnXHhjNCc7CisgICAgICAqZHN0KysgPSAnXHg4ZCc7CisgICAgICBicmVhazsKKyAgICBjYXNlICdCJzoKKyAgICAgICpkc3QrKyA9ICdceGM0JzsKKyAgICAgICpkc3QrKyA9ICdceDhjJzsKKyAgICAgIGJyZWFrOworICAgIC8qIFJlcGxhY2UgYyB3aXRoIFx2e2R9IGFuZCBDIHdpdGggXHZ7RH0uICAqLworICAgIGNhc2UgJ2MnOgorICAgICAgKmRzdCsrID0gJ1x4YzQnOworICAgICAgKmRzdCsrID0gJ1x4OGYnOworICAgICAgYnJlYWs7CisgICAgY2FzZSAnQyc6CisgICAgICAqZHN0KysgPSAnXHhjNCc7CisgICAgICAqZHN0KysgPSAnXHg4ZSc7CisgICAgICBicmVhazsKKyAgICAvKiBSZXBsYWNlIGQgd2l0aCBcJ2UgYW5kIEQgd2l0aCBcJ0UuICAqLworICAgIGNhc2UgJ2QnOgorICAgICAgKmRzdCsrID0gJ1x4YzMnOworICAgICAgKmRzdCsrID0gJ1x4YTknOworICAgICAgYnJlYWs7CisgICAgY2FzZSAnRCc6CisgICAgICAqZHN0KysgPSAnXHhjMyc7CisgICAgICAqZHN0KysgPSAnXHg4OSc7CisgICAgICBicmVhazsKKyAgICB9CisgIHJldHVybiBkc3Q7Cit9CisKK3N0YXRpYyBjaGFyICoKK21iX2Zyb2Jfc3RyaW5nIChjb25zdCBjaGFyICpzdHIsIGNvbnN0IGNoYXIgKmxldHRlcnMpCit7CisgIGNoYXIgK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E7CisJKmRzdCsrID0gKnNyYzsKKyAgICAgIH0KKyAgICBlbHNlIGlmIChlc2NhcGVkKQorICAgICAgeworCWVzY2FwZWQgPSAwOworCSpkc3QrKyA9ICpzcmM7CisJY29udGludWU7CisgICAgICB9CisgICAgZWxzZSBpZiAoIWluX2NsYXNzICYmIHN0cmNociAobGV0dGVycywgKnNyYykpCisgICAgICBkc3QgPSBtYl9yZXBsYWNlIChkc3QsICpzcmMpOworICAgIGVsc2UKKyAgICAgIHsKKwlpZiAoIWluX2NsYXNzICYmICpzcmMgPT0gJ1snICYmIHN0cmNociAoIjouPSIsIHNyY1sxXSkpCisJICBpbl9jbGFzcyA9IDE7CisJZWxzZSBpZiAoaW5fY2xhc3MgJiYgKnNyYyA9PSAnXScgJiYgc3RyY2hyICgiOi49Iiwgc3JjWy0xXSkpCisJICBpbl9jbGFzcyA9IDA7CisJKmRzdCsrID0gKnNyYzsKKyAgICAgIH0KKyAgKmRzdCA9ICdcMCc7CisgIHJldHVybiByZXQ7Cit9CisKK3N0YXRpYyBpbnQKK2NoZWNrX21hdGNoIChyZWdtYXRjaF90ICpybSwgaW50IGlkeCwgY29uc3QgY2hhciAqc3RyaW5nLAorCSAgICAgY29uc3QgY2hhciAqbWF0Y2gsIGNvbnN0IGNoYXIgKmZhaWwpCit7CisgIGlmIChtYXRjaFswXSA9PSAnLScgJiYgbWF0Y2hbMV0gPT0gJ1wwJykKKyAgICB7CisgICAgICBpZiAocm1baWR4XS5ybV9zbyA9PSAtMSAmJiBybVtpZHhdLnJtX2VvID09IC0xKQorCXJldHVybiAwOworICAgICAgcHJpbnRmICgiJXMgcm1bJWRdIHVuZXhwZWN0ZWRseSBtYXRjaGVkXG4iLCBmYWlsLCBpZHgpOworICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgIGlmIChybVtpZHhdLnJtX3NvID09IC0xIHx8IHJtW2lkeF0ucm1fZW8gPT0gLTEpCisgICAgeworICAgICAgcHJpbnRmICgiJXMgcm1bJWRdIHVu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gICAgfQorCisgIGlmIChjZmxhZ3MgJiBSRUdfTk9TVUIpCisgICAgcmV0dXJuIDA7CisKKyAgcmV0ID0gY2hlY2tfbWF0Y2ggKHJtLCAwLCBzdHJpbmcsIGV4cGVjdCwgZmFpbCk7CisgIGlmIChtYXRjaGVzID09IE5VTEwpCisgICAgcmV0dXJuIHJldDsKKworICBmb3IgKG4gPSAxOyByZXQgPT0gMCAmJiBuIDwgMTA7ICsrbikKKyAgICB7CisgICAgICBjaGFyICpwID0gTlVMTDsKKworICAgICAgaWYgKG1hdGNoZXMpCisJeworCSAgcCA9IHN0cmNociAobWF0Y2hlcywgJywnKTsKKwkgIGlmIChwICE9IE5VTEwpCisJICAgICpwID0gJ1wwJzsKKwl9CisgICAgICByZXQgPSBjaGVja19tYXRjaCAocm0sIG4sIHN0cmluZywgbWF0Y2hlcyA/OiAiLSIsIGZhaWwpOworICAgICAgaWYgKHApCisJeworCSAgKnAgPSAnLCc7CisJICBtYXRjaGVzID0gcCArIDE7CisJfQorICAgICAgZWxzZQorCW1hdGNoZXMgPSBOVUxMOworICAgIH0KKworICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50CittYl90ZXN0IChjb25zdCBjaGFyICpwYXR0ZXJuLCBpbnQgY2ZsYWdzLCBjb25zdCBjaGFyICpzdHJpbmcsIGludCBlZmxhZ3MsCisJIGNoYXIgKmV4cGVjdCwgY29uc3QgY2hhciAqbWF0Y2hlcywgY29uc3QgY2hhciAqbGV0dGVycywKKwkgY29uc3QgY2hhciAqZmFpbCkKK3sKKyAgY2hhciAqcGF0dGVybl9tYiA9IG1iX2Zyb2JfcGF0dGVybiAocGF0dGVybiwgbGV0dGVycyk7CisgIGNvbnN0IGNoYXIgKnN0cmluZ19tYgorICAgID0gZWZsYWdzID09IC0xID8gc3RyaW5nIDogbWJfZnJvYl9zdHJpbmcgKHN0cmluZywgbGV0dGVycyk7CisgIGNoYXIgKmV4cGVjdF9tYiA9IG1iX2Zyb2Jfc3RyaW5nICh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HN0cnN0ciAocGF0dGVybiwgIls6eGRpZ2l0Ol0iKSkKKyAgICByZXR1cm4gMDsKKworICAvKiBYWFg6IHJlZ2V4IEFUTSBoYW5kbGVzIG9ubHkgc2luZ2xlIGJ5dGUgZXF1aXZhbGVuY2UgY2xhc3Nlcy4gICovCisgIGlmIChzdHJzdHIgKHBhdHRlcm4sICJbWz1iPV1dIikpCisgICAgcmV0dXJuIDA7CisKKyAgZm9yIChpID0gMTsgaSA8IDE2OyArK2kpCisgICAgeworICAgICAgY2hhciAqcCA9IGxldHRlcnM7CisgICAgICBpZiAoaSAmIDEpCisJeworCSAgaWYgKCFzdHJjaHIgKHBhdHRlcm4sICdhJykgJiYgIXN0cmNociAoc3RyaW5nLCAnYScpCisJICAgICAgJiYgIXN0cmNociAocGF0dGVybiwgJ0EnKSAmJiAhc3RyY2hyIChzdHJpbmcsICdBJykpCisJICAgIGNvbnRpbnVlOworCSAgKnArKyA9ICdhJywgKnArKyA9ICdBJzsKKwl9CisgICAgICBpZiAoaSAmIDIpCisJeworCSAgaWYgKCFzdHJjaHIgKHBhdHRlcm4sICdiJykgJiYgIXN0cmNociAoc3RyaW5nLCAnYicpCisJICAgICAgJiYgIXN0cmNociAocGF0dGVybiwgJ0InKSAmJiAhc3RyY2hyIChzdHJpbmcsICdCJykpCisJICAgIGNvbnRpbnVlOworCSAgKnArKyA9ICdiJywgKnArKyA9ICdCJzsKKwl9CisgICAgICBpZiAoaSAmIDQpCisJeworCSAgaWYgKCFzdHJjaHIgKHBhdHRlcm4sICdjJykgJiYgIXN0cmNociAoc3RyaW5nLCAnYycpCisJICAgICAgJiYgIXN0cmNociAocGF0dGVybiwgJ0MnKSAmJiAhc3RyY2hyIChzdHJpbmcsICdDJykpCisJICAgIGNvbnRpbnVlOworCSAgKnArKyA9ICdjJywgKnArKyA9ICdDJzsKKwl9CisgICAgICBpZiAoaSAmIDgpCisJeworCSAgaWYgKCFzdHJjaHIgKHBhdHRlcm4sICdkJykgJiYgIXN0cm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PSBOVUxMKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIkNvdWxkbid0IG9wZW4gJXNcbiIsIGFyZ3Zbb3B0aW5kXSk7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgd2hpbGUgKChsZW4gPSBnZXRsaW5lICgmbGluZSwgJmxpbmVfbGVuLCBmKSkgPiAwKQorICAgIHsKKyAgICAgIGNoYXIgKnBhdHRlcm4sICpmbGFnc3RyLCAqc3RyaW5nLCAqZXhwZWN0LCAqbWF0Y2hlcywgKnA7CisgICAgICBpbnQgY2ZsYWdzID0gUkVHX0VYVEVOREVELCBlZmxhZ3MgPSAwLCB0cnlfYnJlX2VyZSA9IDA7CisKKyAgICAgIGlmIChsaW5lW2xlbiAtIDFdID09ICdcbicpCisgICAgICAgIGxpbmVbbGVuIC0gMV0gPSAnXDAnOworCisgICAgICAvKiBTa2lwIGNvbW1lbnRzIGFuZCBlbXB0eSBsaW5lcy4gICovCisgICAgICBpZiAoKmxpbmUgPT0gJyMnIHx8ICpsaW5lID09ICdcMCcpCisJY29udGludWU7CisKKyAgICAgIHB1dHMgKGxpbmUpOworICAgICAgZmZsdXNoIChzdGRvdXQpOworCisgICAgICBwYXR0ZXJuID0gc3RydG9rIChsaW5lLCAiXHQiKTsKKyAgICAgIGlmIChwYXR0ZXJuID09IE5VTEwpCisgICAgICAgIGNvbnRpbnVlOworCisgICAgICBpZiAoc3RyY21wIChwYXR0ZXJuLCAiXCJcIiIpID09IDApCisJcGF0dGVybiArPSAyOworCisgICAgICBmbGFnc3RyID0gc3RydG9rIChOVUxMLCAiXHQiKTsKKyAgICAgIGlmIChmbGFnc3RyID09IE5VTEwpCisgICAgICAgIGNvbnRpbnVlOworCisgICAgICBzdHJpbmcgPSBzdHJ0b2sgKE5VTEwsICJcdCIpOworICAgICAgaWYgKHN0cmluZyA9PSBOVUxMKQorICAgICAgICBjb250aW51ZTsKKworICAgICAgaWYgKHN0cmNtcCAoc3RyaW5nLCAiXC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gICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIC8qIEFuZCBnZXRwaWQgaW4gdGhlIG1haW4gcHJvY2VzcyBhZ2Fpbi4gICovCisgIHBpZF90IHA1ID0gZ2V0cGlkICgpOworCisgIC8qIEFuYWx5c2lzIG9mIHRoZSByZXN1bHRzLiAgKi8KKyAgaWYgKHAwICE9IHA1KQorICAgIHsKKyAgICAgIHByaW50ZiAoInAwKCVsZCkgIT0gcDUoJWxkKVxuIiwgKGxvbmcgaW50KSBwMCwgKGxvbmcgaW50KSBwNSk7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBpZiAocDAgPT0gcDEpCisgICAgeworICAgICAgcHJpbnRmICgicDAoJWxkKSA9PSBwMSglbGQpXG4iLCAobG9uZyBpbnQpIHAwLCAobG9uZyBpbnQpIHAxKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGlmIChwMSAhPSBwMikKKyAgICB7CisgICAgICBwcmludGYgKCJwMSglbGQpICE9IHAyKCVsZClcbiIsIChsb25nIGludCkgcDEsIChsb25nIGludCkgcDIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgaWYgKHAwID09IHAzKQorICAgIHsKKyAgICAgIHByaW50ZiAoInAwKCVsZCkgPT0gcDMoJWxkKVxuIiwgKGxvbmcgaW50KSBwMCwgKGxvbmcgaW50KSBwMyk7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBpZiAocDMgIT0gcDQpCisgICAgeworICAgICAgcHJpbnRmICgicDMoJWxkKSAhPSBwNCglbGQpXG4iLCAobG9uZyBpbnQpIHAzLCAobG9uZyBpbnQpIHA0KTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGNsb3NlIChmZFswXSk7CisgIGNsb3NlIChmZFsxXSk7CisKKyAgaWYgKHJlc3VsdCA9PSAwKQorICAgIHB1dHMgKCJBbGwgT0siKTsKKworICByZXR1cm4gcmVzdWx0OworfQorCisjZGVmaW5lIFR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bWFpbiBwcm9jZXNzLiAgKi8KKyAgcGlkX3QgcDM7CisgIGlmICgocDMgPSB2Zm9yayAoKSkgPT0gMCkKKyAgICB7CisgICAgICBwaWRfdCBwID0gZ2V0cGlkICgpOworICAgICAgX2V4aXQgKFRFTVBfRkFJTFVSRV9SRVRSWSAod3JpdGUgKGZkWzFdLCAmcCwgc2l6ZW9mIChwKSkpICE9IHNpemVvZiAocCkpOworICAgIH0KKyAgZWxzZSBpZiAocDEgPT0gLTEpCisgICAgeworICAgICAgcHV0cyAoIjJuZCB2Zm9yayBmYWlsZWQiKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIHBpZF90IHA0OworICBpZiAoVEVNUF9GQUlMVVJFX1JFVFJZIChyZWFkIChmZFswXSwgJnA0LCBzaXplb2YgKHBpZF90KSkpICE9IHNpemVvZiAocGlkX3QpKQorICAgIHsKKyAgICAgIHB1dHMgKCIybmQgcmVhZCBmYWlsZWQiKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorICBpZiAoVEVNUF9GQUlMVVJFX1JFVFJZICh3YWl0cGlkIChwMywgJnIsIDApKSAhPSBwMykKKyAgICB7CisgICAgICBwdXRzICgiMm5kIHdhaXRwaWQgZmFpbGVkIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKyAgZWxzZSBpZiAociAhPSAwKQorICAgIHsKKyAgICAgIHB1dHMgKCJ3cml0ZSBpbiAybmQgY2hpbGQgZmFpbGVkIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICAvKiBBbmQgZ2V0cGlkIGluIHRoZSBtYWluIHByb2Nlc3MgYWdhaW4uICAqLworICBwaWRfdCBwNSA9IGdldHBpZCAoKTsKKworICAvKiBBbmFseXNpcyBvZiB0aGUgcmVzdWx0cy4gICovCisgIGlmIChwMCAhPSBwNSkKKyAgICB7CisgICAgICBwcmludGYgKCJwMCglbGQpICE9IHA1KCVsZClcbiIsIChsb25nIGludCkgcDAsIChsb25nIGludCkgcDUpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgaWYgKHAwID09IHAxKQorICAgIHsKKyAgICAgIHByaW50ZiAoInAwKCVsZCkgPT0gcDEoJWxkKVxuIiwgKGxvbmcgaW50KSBwMCwgKGxvbmcgaW50KSBwMSk7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBpZiAocDEgIT0gcDIpCisgICAgeworICAgICAgcHJpbnRmICgicDEoJWxkKSAhPSBwMiglbGQpXG4iLCAobG9uZyBpbnQpIHAxLCAobG9uZyBpbnQpIHAyKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGlmIChwMCA9PSBwMykKKyAgICB7CisgICAgICBwcmludGYgKCJwMCglbGQpID09IHAzKCVsZClcbiIsIChsb25nIGludCkgcDAsIChsb25nIGludCkgcDMpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgaWYgKHAzICE9IHA0KQorICAgIHsKKyAgICAgIHByaW50ZiAoInAzKCVsZCkgIT0gcDQoJWxkKVxuIiwgKGxvbmcgaW50KSBwMywgKGxvbmcgaW50KSBwNCk7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBjbG9zZSAoZmRbMF0pOworICBjbG9zZSAoZmRbMV0pOworCisgIGlmIChyYWlzZV9mYWlsKQorICAgIHsKKyAgICAgIHB1dHMgKCJyYWlzZSBmYWlsZWQiKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGlmIChyZXN1bHQgPT0gMCkKKyAgICBwdXRzICgiQWxsIE9LIik7CisKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworI2RlZmluZSBURVNUX0ZVTkNUSU9OIGRvX3Rlc3QgKCkKKyNpbmNsdWRlICIuLi90ZXN0LXNrZWxldG9uLmMiCmRpZmYgLS1naXQgYS9hcC9saWJjL2dsaWJjL2dsaWJjLTIuMjMvcG9zaXgvdHN0LXZmb3JrMy5jIGIvYXAvbGliYy9nbGliYy9nbGliYy0yLj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25hbF9hcmd1bWVudCwgTlVMTCwgJ28nfSwKKyAgICAgIHsibm9uZSIsICAgICBub19hcmd1bWVudCwgICAgICAgTlVMTCwgJ24nfSwKKyAgICAgIHsiY29sb3IiLCAgICBub19hcmd1bWVudCwgICAgICAgTlVMTCwgJ0MnfSwKKyAgICAgIHsiY29sb3VyIiwgICBub19hcmd1bWVudCwgICAgICAgTlVMTCwgJ0MnfSwKKyAgICAgIHtOVUxMLCAgICAgICAwLCAgICAgICAgICAgICAgICAgTlVMTCwgMCB9CisgICAgfTsKKworICBpbnQgYWZsYWcgPSAwOworICBpbnQgYmZsYWcgPSAwOworICBjaGFyICpjdmFsdWUgPSBOVUxMOworICBpbnQgQ2ZsYWcgPSAwOworICBpbnQgbmZsYWcgPSAwOworICBpbnQgaW5kZXg7CisgIGludCBjOworICBpbnQgcmVzdWx0ID0gMDsKKworICB3aGlsZSAoKGMgPSBnZXRvcHRfbG9uZyAoYXJnYywgYXJndiwgImFiYzoiLCBvcHRpb25zLCBOVUxMKSkgPj0gMCkKKyAgICBzd2l0Y2ggKGMpCisgICAgICB7CisgICAgICBjYXNlICdhJzoKKwlhZmxhZyA9IDE7CisJYnJlYWs7CisgICAgICBjYXNlICdiJzoKKwliZmxhZyA9IDE7CisJYnJlYWs7CisgICAgICBjYXNlICdjJzoKKwljdmFsdWUgPSBvcHRhcmc7CisJYnJlYWs7CisgICAgICBjYXNlICdDJzoKKwkrK0NmbGFnOworCWJyZWFrOworICAgICAgY2FzZSAnPyc6CisJZnB1dHMgKCJVbmtub3duIG9wdGlvbi5cbiIsIHN0ZGVycik7CisJcmV0dXJuIDE7CisgICAgICBkZWZhdWx0OgorCWZwcmludGYgKHN0ZGVyciwgIlRoaXMgc2hvdWxkIG5ldmVyIGhhcHBlbiFcbiIpOworCXJldHVybiAxOworCisgICAgICBjYXNlICdyJzoKKwlwcmludGYgKCItLXJlcXVpcmVkICVzXG4iLCBvcHRhcmcpOworCXJlc3VsdCB8PSBzdHJjbXAgKG9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mRleHAgKHdvcmRzLCAmd2UsIDApOworICBwcmludGYgKCJ3b3JkZXhwIHJldHVybmVkICVkXG4iLCByZXR2YWwpOworICBmb3IgKGkgPSAwOyBpIDwgd2Uud2Vfd29yZGM7IGkrKykKKyAgICBwcmludGYgKCJ3ZV93b3JkdlslZF0gPSBcIiVzXCJcbiIsIGksIHdlLndlX3dvcmR2W2ldKTsKK30KKworaW50CittYWluIChpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworICBjb25zdCBjaGFyICpnbG9iZmlsZVtdID0geyAib25lIiwgInR3byIsICJ0aHJlZSIsIE5VTEwgfTsKKyAgY2hhciB0bXBkaXJbMzJdOworICBzdHJ1Y3QgcGFzc3dkICpwdzsKKyAgY29uc3QgY2hhciAqY3dkOworICBpbnQgdGVzdDsKKyAgaW50IGZhaWwgPSAwOworICBpbnQgaTsKKyAgc3RydWN0IHRlc3RfY2FzZV9zdHJ1Y3QgdHM7CisKKyAgaWYgKGFyZ2MgPiAxKQorICAgIHsKKyAgICAgIGNvbW1hbmRfbGluZV90ZXN0IChhcmd2WzFdKTsKKyAgICAgIHJldHVybiAwOworICAgIH0KKworICBjd2QgPSBnZXRjd2QgKE5VTEwsIDApOworCisgIC8qIFNldCB1cCBhcmVuYSBmb3IgcGF0aG5hbWUgZXhwYW5zaW9uICovCisgIHRtcG5hbSAodG1wZGlyKTsKKyAgaWYgKG1rZGlyICh0bXBkaXIsIFNfSVJXWFUpIHx8IGNoZGlyICh0bXBkaXIpKQorICAgIHJldHVybiAtMTsKKyAgZWxzZQorICAgIHsKKyAgICAgIGludCBmZDsKKworICAgICAgZm9yIChpID0gMDsgZ2xvYmZpbGVbaV07ICsraSkKKwlpZiAoKGZkID0gY3JlYXQgKGdsb2JmaWxlW2ldLCBTX0lSVVNSIHwgU19JV1VTUikpID09IC0xCisJICAgIHx8IGNsb3NlIChmZCkpCisJICByZXR1cm4gLTE7CisgICAgfQorCisgIC8qIElmIHdlIGFyZSBub3QgYWxsb3dlZCB0by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RzLndvcmRjID0gMTsKKyAgICAgIHRzLndvcmR2WzBdID0gIngiOworICAgICAgdHMuaWZzID0gSUZTOworCisgICAgICBpZiAodGVzdGl0ICgmdHMpKQorCSsrZmFpbDsKKyAgICB9CisKKyAgLyogIn4iIGV4cGFuZHMgdG8gdmFsdWUgb2YgJEhPTUUgd2hlbiBIT01FIGlzIHNldCAqLworCisgIHNldGVudiAoIkhPTUUiLCAiL2R1bW15L2hvbWUiLCAxKTsKKyAgdHMucmV0dmFsID0gMDsKKyAgdHMuZW52ID0gTlVMTDsKKyAgdHMud29yZHMgPSAifiB+L2ZvbyI7CisgIHRzLmZsYWdzID0gMDsKKyAgdHMud29yZGMgPSAyOworICB0cy53b3JkdlswXSA9ICIvZHVtbXkvaG9tZSI7CisgIHRzLndvcmR2WzFdID0gIi9kdW1teS9ob21lL2ZvbyI7CisgIHRzLmlmcyA9IElGUzsKKworICBpZiAodGVzdGl0ICgmdHMpKQorICAgICsrZmFpbDsKKworICAvKiAifiIgZXhwYW5kcyB0byBob21lIGRpciBmcm9tIHBhc3N3ZCBmaWxlIGlmIEhPTUUgaXMgbm90IHNldCAqLworCisgIHB3ID0gZ2V0cHd1aWQgKGdldHVpZCAoKSk7CisgIGlmIChwdyAhPSBOVUxMKQorICAgIHsKKyAgICAgIHVuc2V0ZW52ICgiSE9NRSIpOworICAgICAgdHMucmV0dmFsID0gMDsKKyAgICAgIHRzLmVudiA9IE5VTEw7CisgICAgICB0cy53b3JkcyA9ICJ+IjsKKyAgICAgIHRzLmZsYWdzID0gMDsKKyAgICAgIHRzLndvcmRjID0gMTsKKyAgICAgIHRzLndvcmR2WzBdID0gcHctPnB3X2RpcjsKKyAgICAgIHRzLmlmcyA9IElGUzsKKworICAgICAgaWYgKHRlc3RpdCAoJnRzKSkKKwkrK2ZhaWw7CisgICAgfQorCisgIC8qIEludGVnZXIgb3ZlcmZsb3cgaW4gZGl2aXNpb24uICAqLworICB7CisgICAgc3RhdGljIGNvbnN0IGNoYXIgK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ZW4pCit7CisgIC8qIEFkZCBhIHN0cmluZyB0byB0aGUgYnVmZmVyLCBhbGxvY2F0aW5nIHJvb20gZm9yIGl0IGlmIG5lZWRlZC4KKyAgICovCisgIGlmICgqYWN0bGVuICsgbGVuID4gKm1heGxlbikKKyAgICB7CisgICAgICBjaGFyICpvbGRfYnVmZmVyID0gYnVmZmVyOworICAgICAgYXNzZXJ0IChidWZmZXIgPT0gTlVMTCB8fCAqbWF4bGVuICE9IDApOworICAgICAgKm1heGxlbiArPSBNQVggKDIgKiBsZW4sIFdfQ0hVTkspOworICAgICAgYnVmZmVyID0gcmVhbGxvYyAob2xkX2J1ZmZlciwgMSArICptYXhsZW4pOworCisgICAgICBpZiAoYnVmZmVyID09IE5VTEwpCisJZnJlZSAob2xkX2J1ZmZlcik7CisgICAgfQorCisgIGlmIChidWZmZXIgIT0gTlVMTCkKKyAgICB7CisgICAgICAqKChjaGFyICopIF9fbWVtcGNweSAoJmJ1ZmZlclsqYWN0bGVuXSwgc3RyLCBsZW4pKSA9ICdcMCc7CisgICAgICAqYWN0bGVuICs9IGxlbjsKKyAgICB9CisKKyAgcmV0dXJuIGJ1ZmZlcjsKK30KKworc3RhdGljIGNoYXIgKgoraW50ZXJuYWxfZnVuY3Rpb24KK3dfYWRkc3RyIChjaGFyICpidWZmZXIsIHNpemVfdCAqYWN0bGVuLCBzaXplX3QgKm1heGxlbiwgY29uc3QgY2hhciAqc3RyKQorICAgICAvKiAobGVuZ3RocyBleGNsdWRlIHRyYWlsaW5nIHplcm8pICovCit7CisgIC8qIEFkZCBhIHN0cmluZyB0byB0aGUgYnVmZmVyLCBhbGxvY2F0aW5nIHJvb20gZm9yIGl0IGlmIG5lZWRlZC4KKyAgICovCisgIHNpemVfdCBsZW47CisKKyAgYXNzZXJ0IChzdHIgIT0gTlVMTCk7IC8qIHdfYWRkc3RyIG9ubHkgY2FsbGVkIGZyb20gdGhpcyBmaWxlICovCisgIGxlbiA9IHN0cmxlbiAoc3RyKTsKKworICByZXR1cm4gd19hZGRtZW0gKGJ1ZmZlciwgYWN0bGVuLCBtYXhsZW4sIHN0ciwgbGVuKTsKK30KKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK3dfYWRkd29yZCAod29yZGV4cF90ICpwd29yZGV4cCwgY2hhciAqd29yZCkKK3sKKyAgLyogQWRkIGEgd29yZCB0byB0aGUgd29yZGxpc3QgKi8KKyAgc2l6ZV90IG51bV9wOworICBjaGFyICoqbmV3X3dvcmR2OworICBib29sIGFsbG9jYXRlZCA9IGZhbHNlOworCisgIC8qIEludGVybmFsbHksIE5VTEwgYWN0cyBsaWtlICIiLiAgQ29udmVydCBOVUxMcyB0byAiIiBiZWZvcmUKKyAgICogdGhlIGNhbGxlciBzZWVzIHRoZW0uCisgICAqLworICBpZiAod29yZCA9PSBOVUxMKQorICAgIHsKKyAgICAgIHdvcmQgPSBfX3N0cmR1cCAoIiIpOworICAgICAgaWYgKHdvcmQgPT0gTlVMTCkKKwlnb3RvIG5vX3NwYWNlOworICAgICAgYWxsb2NhdGVkID0gdHJ1ZTsKKyAgICB9CisKKyAgbnVtX3AgPSAyICsgcHdvcmRleHAtPndlX3dvcmRjICsgcHdvcmRleHAtPndlX29mZnM7CisgIG5ld193b3JkdiA9IHJlYWxsb2MgKHB3b3JkZXhwLT53ZV93b3Jkdiwgc2l6ZW9mIChjaGFyICopICogbnVtX3ApOworICBpZiAobmV3X3dvcmR2ICE9IE5VTEwpCisgICAgeworICAgICAgcHdvcmRleHAtPndlX3dvcmR2ID0gbmV3X3dvcmR2OworICAgICAgcHdvcmRleHAtPndlX3dvcmR2W3B3b3JkZXhwLT53ZV9vZmZzICsgcHdvcmRleHAtPndlX3dvcmRjKytdID0gd29yZDsKKyAgICAgIHB3b3JkZXhwLT53ZV93b3Jkdltwd29yZGV4cC0+d2Vfb2ZmcyArIHB3b3JkZXhwLT53ZV93b3JkY10gPSBOVUxMOworICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgIGlmIChh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oqd29yZCwgc2l6ZV90ICp3b3JkX2xlbmd0aCwgc2l6ZV90ICptYXhfbGVuZ3RoLAorCQkgICAgIGNvbnN0IGNoYXIgKndvcmRzLCBzaXplX3QgKm9mZnNldCkKK3sKKyAgLyogV2UgYXJlIHBvaXNlZCBfYXRfIGEgYmFja3NsYXNoLCBpbnNpZGUgcXVvdGVzICovCisKKyAgc3dpdGNoICh3b3Jkc1sxICsgKm9mZnNldF0pCisgICAgeworICAgIGNhc2UgMDoKKyAgICAgIC8qIEJhY2tzbGFzaCBpcyBsYXN0IGNoYXJhY3RlciBvZiBpbnB1dCB3b3JkcyAqLworICAgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisgICAgY2FzZSAnXG4nOgorICAgICAgKysoKm9mZnNldCk7CisgICAgICBicmVhazsKKworICAgIGNhc2UgJyQnOgorICAgIGNhc2UgJ2AnOgorICAgIGNhc2UgJyInOgorICAgIGNhc2UgJ1xcJzoKKyAgICAgICp3b3JkID0gd19hZGRjaGFyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsIHdvcmRzWzEgKyAqb2Zmc2V0XSk7CisgICAgICBpZiAoKndvcmQgPT0gTlVMTCkKKwlyZXR1cm4gV1JERV9OT1NQQUNFOworCisgICAgICArKygqb2Zmc2V0KTsKKyAgICAgIGJyZWFrOworCisgICAgZGVmYXVsdDoKKyAgICAgICp3b3JkID0gd19hZGRjaGFyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsIHdvcmRzWypvZmZzZXRdKTsKKyAgICAgIGlmICgqd29yZCAhPSBOVUxMKQorCSp3b3JkID0gd19hZGRjaGFyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsIHdvcmRzWzEgKyAqb2Zmc2V0XSk7CisKKyAgICAgIGlmICgqd29yZCA9PSBOVUxMKQorCXJldHVybiBXUkRFX05PU1BBQ0U7CisKKyAgICAgICsrKCpvZmZzZXQpOworICAgICAgYnJlYWs7CisgIC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B7CisJICAgICAgcXVvdGVkID0gMTsKKwkgICAgICBjb250aW51ZTsKKwkgICAgfQorCSAgZWxzZSBpZiAocXVvdGVkID09IDEpCisJICAgIHsKKwkgICAgICBxdW90ZWQgPSAwOworCSAgICAgIGNvbnRpbnVlOworCSAgICB9CisJfQorICAgICAgZWxzZSBpZiAod29yZHNbKm9mZnNldF0gPT0gJyInKQorCXsKKwkgIGlmIChxdW90ZWQgPT0gMCkKKwkgICAgeworCSAgICAgIHF1b3RlZCA9IDI7CisJICAgICAgY29udGludWU7CisJICAgIH0KKwkgIGVsc2UgaWYgKHF1b3RlZCA9PSAyKQorCSAgICB7CisJICAgICAgcXVvdGVkID0gMDsKKwkgICAgICBjb250aW51ZTsKKwkgICAgfQorCX0KKworICAgICAgLyogU29ydCBvdXQgb3RoZXIgc3BlY2lhbCBjaGFyYWN0ZXJzICovCisgICAgICBpZiAocXVvdGVkICE9IDEgJiYgd29yZHNbKm9mZnNldF0gPT0gJyQnKQorCXsKKwkgIGVycm9yID0gcGFyc2VfZG9sbGFycyAod29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsIHdvcmRzLAorCQkJCSBvZmZzZXQsIGZsYWdzLCAmZ2xvYl9saXN0LCBpZnMsIGlmc193aGl0ZSwKKwkJCQkgcXVvdGVkID09IDIpOworCSAgaWYgKGVycm9yKQorCSAgICBnb3RvIHRpZHlfdXA7CisKKwkgIGNvbnRpbnVlOworCX0KKyAgICAgIGVsc2UgaWYgKHdvcmRzWypvZmZzZXRdID09ICdcXCcpCisJeworCSAgaWYgKHF1b3RlZCkKKwkgICAgZXJyb3IgPSBwYXJzZV9xdGRfYmFja3NsYXNoICh3b3JkLCB3b3JkX2xlbmd0aCwgbWF4X2xlbmd0aCwKKwkJCQkJIHdvcmRzLCBvZmZzZXQpOworCSAgZWxzZQorCSAgICBlcnJvciA9IHBhcnNlX2JhY2tzbGFzaCAod29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsCisJCQkJICA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0ZXIgYSBzaW5nbGUgcXVvdGUgKi8KKyAgZm9yICg7IHdvcmRzWypvZmZzZXRdOyArKygqb2Zmc2V0KSkKKyAgICB7CisgICAgICBpZiAod29yZHNbKm9mZnNldF0gIT0gJ1wnJykKKwl7CisJICAqd29yZCA9IHdfYWRkY2hhciAoKndvcmQsIHdvcmRfbGVuZ3RoLCBtYXhfbGVuZ3RoLCB3b3Jkc1sqb2Zmc2V0XSk7CisJICBpZiAoKndvcmQgPT0gTlVMTCkKKwkgICAgcmV0dXJuIFdSREVfTk9TUEFDRTsKKwl9CisgICAgICBlbHNlIHJldHVybiAwOworICAgIH0KKworICAvKiBVbnRlcm1pbmF0ZWQgc3RyaW5nICovCisgIHJldHVybiBXUkRFX1NZTlRBWDsKK30KKworLyogRnVuY3Rpb25zIHRvIGV2YWx1YXRlIGFuIGFyaXRobWV0aWMgZXhwcmVzc2lvbiAqLworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK2V2YWxfZXhwcl92YWwgKGNoYXIgKipleHByLCBsb25nIGludCAqcmVzdWx0KQoreworICBjaGFyICpkaWdpdDsKKworICAvKiBTa2lwIHdoaXRlIHNwYWNlICovCisgIGZvciAoZGlnaXQgPSAqZXhwcjsgZGlnaXQgJiYgKmRpZ2l0ICYmIGlzc3BhY2UgKCpkaWdpdCk7ICsrZGlnaXQpOworCisgIGlmICgqZGlnaXQgPT0gJygnKQorICAgIHsKKyAgICAgIC8qIFNjYW4gZm9yIGNsb3NpbmcgcGFyZW4gKi8KKyAgICAgIGZvciAoKytkaWdpdDsgKipleHByICYmICoqZXhwciAhPSAnKSc7ICsrKCpleHByKSk7CisKKyAgICAgIC8qIElzIHRoZXJlIG9uZT8gKi8KKyAgICAgIGlmICghKipleHByKQorCXJldHVybiBXUkRFX1NZTlRBWDsKKworICAgICAgKigqZXhwcikrKyA9IDA7CisKKyAgICAgIGlmIChldmFsX2V4cHIgKGRpZ2l0LCByZXN1bHQpKQorCXJldHVybiBXUkRFX1NZTlRBWDsKKworICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgIC8qIFBPU0lYIHJlcXVpcmVzIHRoYXQgZGVjaW1hbCwgb2N0YWwsIGFuZCBoZXhhZGVjaW1hbCBjb25zdGFudHMgYXJlCisgICAgIHJlY29nbml6ZWQuICBUaGVyZWZvcmUgd2UgcGFzcyAwIGFzIHRoZSB0aGlyZCBwYXJhbWV0ZXIgdG8gc3RydG9sLiAgKi8KKyAgKnJlc3VsdCA9IHN0cnRvbCAoZGlnaXQsIGV4cHIsIDApOworICBpZiAoZGlnaXQgPT0gKmV4cHIpCisgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50CitpbnRlcm5hbF9mdW5jdGlvbgorZXZhbF9leHByX211bHRkaXYgKGNoYXIgKipleHByLCBsb25nIGludCAqcmVzdWx0KQoreworICBsb25nIGludCBhcmc7CisKKyAgLyogUmVhZCBhIFZhbHVlICovCisgIGlmIChldmFsX2V4cHJfdmFsIChleHByLCByZXN1bHQpICE9IDApCisgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisgIHdoaWxlICgqKmV4cHIpCisgICAgeworICAgICAgLyogU2tpcCB3aGl0ZSBzcGFjZSAqLworICAgICAgZm9yICg7ICpleHByICYmICoqZXhwciAmJiBpc3NwYWNlICgqKmV4cHIpOyArKygqZXhwcikpOworCisgICAgICBpZiAoKipleHByID09ICcqJykKKwl7CisJICArKygqZXhwcik7CisJICBpZiAoZXZhbF9leHByX3ZhbCAoZXhwciwgJmFyZykgIT0gMCkKKwkgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisJICAqcmVzdWx0ICo9IGFyZzsKKwl9CisgICAgICBlbHNlIGlmICgqKmV4cHIgPT0gJy8nKQorCXsKKwkgICsrKCpleHByKTsKKwkgIGlmIChldmFsX2V4cHJfdmFsIChleHByLCAmYXJnKSAhPSAwKQorCSAgICByZXR1cm4gV1JERV9TWU5UQVg7CisKKwkgIC8qIERpdmlzaW9uIGJ5IHplcm8gb3IgaW50ZWdlciBvdmVyZmxvdy4gICovCisJICBpZiAoYXJnID09IDAgfHwgKGFyZyA9PSAtMSAmJiAqcmVzdWx0ID09IExPTkdfTUlOKSkKKwkgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisJICAqcmVzdWx0IC89IGFyZzsKKwl9CisgICAgICBlbHNlIGJyZWFrOworICAgIH0KKworICByZXR1cm4gMDsKK30KKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK2V2YWxfZXhwciAoY2hhciAqZXhwciwgbG9uZyBpbnQgKnJlc3VsdCkKK3sKKyAgbG9uZyBpbnQgYXJnOworCisgIC8qIFJlYWQgYSBNdWx0ZGl2ICovCisgIGlmIChldmFsX2V4cHJfbXVsdGRpdiAoJmV4cHIsIHJlc3VsdCkgIT0gMCkKKyAgICByZXR1cm4gV1JERV9TWU5UQVg7CisKKyAgd2hpbGUgKCpleHByKQorICAgIHsKKyAgICAgIC8qIFNraXAgd2hpdGUgc3BhY2UgKi8KKyAgICAgIGZvciAoOyBleHByICYmICpleHByICYmIGlzc3BhY2UgKCpleHByKTsgKytleHByKTsKKworICAgICAgaWYgKCpleHByID09ICcrJykKKwl7CisJICArK2V4cHI7CisJICBpZiAoZXZhbF9leHByX211bHRkaXYgKCZleHByLCAmYXJnKSAhPSAwKQorCSAgICByZXR1cm4gV1JERV9TWU5UQVg7CisKKwkgICpyZXN1bHQgKz0gYXJnOworCX0KKyAgICAgIGVsc2UgaWYgKCpleHByID09ICctJykKKwl7CisJICArK2V4cHI7CisJICBpZiAoZXZhbF9leHByX211bHRkaXYgKCZleHByLCAmYXJnKSAhPSAwKQorCSAgICByZXR1cm4gV1JERV9TWU5UQVg7CisKKwkgICpyZXN1bHQgLT0gYXJnOworCX0KKyAgICAgIGVsc2UgYnJlYWs7CisgICAgfQorCisgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50CitpbnRlcm5hbF9mdW5jdGlvbgorcGFyc2Vf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VTEwsIE5VTEwsIE5VTEwpOworCSAgLyogVGhlIGZpcnN0IE5VTEwgaGVyZSBpcyB0byB0ZWxsIHBhcnNlX2JhY2t0aWNrIG5vdCB0bworCSAgICogc3BsaXQgdGhlIGZpZWxkcy4KKwkgICAqLworCSAgaWYgKGVycm9yKQorCSAgICB7CisJICAgICAgZnJlZSAoZXhwcik7CisJICAgICAgcmV0dXJuIGVycm9yOworCSAgICB9CisJICBicmVhazsKKworCWNhc2UgJ1xcJzoKKwkgIGVycm9yID0gcGFyc2VfcXRkX2JhY2tzbGFzaCAoJmV4cHIsICZleHByX2xlbmd0aCwgJmV4cHJfbWF4bGVuLAorCQkJCSAgICAgICB3b3Jkcywgb2Zmc2V0KTsKKwkgIGlmIChlcnJvcikKKwkgICAgeworCSAgICAgIGZyZWUgKGV4cHIpOworCSAgICAgIHJldHVybiBlcnJvcjsKKwkgICAgfQorCSAgLyogSSB0aGluayB0aGF0IGEgYmFja3NsYXNoIHdpdGhpbiBhbgorCSAgICogYXJpdGhtZXRpYyBleHBhbnNpb24gaXMgYm91bmQgdG8KKwkgICAqIGNhdXNlIGFuIGVycm9yIHNvb25lciBvciBsYXRlciBhbnl3YXkgdGhvdWdoLgorCSAgICovCisJICBicmVhazsKKworCWNhc2UgJyknOgorCSAgaWYgKC0tcGFyZW5fZGVwdGggPT0gMCkKKwkgICAgeworCSAgICAgIGNoYXIgcmVzdWx0WzIxXTsJLyogMjEgPSBjZWlsKGxvZzEwKDJeNjQpKSArIDEgKi8KKwkgICAgICBsb25nIGludCBudW1yZXN1bHQgPSAwOworCSAgICAgIGxvbmcgbG9uZyBpbnQgY29udmVydG1lOworCisJICAgICAgaWYgKGJyYWNrZXQgfHwgd29yZHNbMSArICpvZmZzZXRdICE9ICcpJykKKwkJeworCQkgIGZyZWUgKGV4cHIpOworCQkgIHJldHVybiBXUkRFX1NZTlRBWDsKKwkJfQorCisJICAgICAgKysoKm9mZnNldCk7CisKKwkgICAgICAvKiBHbyAtIGV2YWx1YXRlLiAqLworCSAgICAgIGlmICgqZXhwciAmJiBldmFsX2V4cHIgKGV4cHIsICZudW1yZXN1bHQpICE9IDApCisJCXsKKwkJICBmcmVlIChleHByKTsKKwkJICByZXR1cm4gV1JERV9TWU5UQVg7CisJCX0KKworCSAgICAgIGlmIChudW1yZXN1bHQgPCAwKQorCQl7CisJCSAgY29udmVydG1lID0gLW51bXJlc3VsdDsKKwkJICAqd29yZCA9IHdfYWRkY2hhciAoKndvcmQsIHdvcmRfbGVuZ3RoLCBtYXhfbGVuZ3RoLCAnLScpOworCQkgIGlmICghKndvcmQpCisJCSAgICB7CisJCSAgICAgIGZyZWUgKGV4cHIpOworCQkgICAgICByZXR1cm4gV1JERV9OT1NQQUNFOworCQkgICAgfQorCQl9CisJICAgICAgZWxzZQorCQljb252ZXJ0bWUgPSBudW1yZXN1bHQ7CisKKwkgICAgICByZXN1bHRbMjBdID0gJ1wwJzsKKwkgICAgICAqd29yZCA9IHdfYWRkc3RyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsCisJCQkJX2l0b2EgKGNvbnZlcnRtZSwgJnJlc3VsdFsyMF0sIDEwLCAwKSk7CisJICAgICAgZnJlZSAoZXhwcik7CisJICAgICAgcmV0dXJuICp3b3JkID8gMCA6IFdSREVfTk9TUEFDRTsKKwkgICAgfQorCSAgZXhwciA9IHdfYWRkY2hhciAoZXhwciwgJmV4cHJfbGVuZ3RoLCAmZXhwcl9tYXhsZW4sIHdvcmRzWypvZmZzZXRdKTsKKwkgIGlmIChleHByID09IE5VTEwpCisJICAgIHJldHVybiBXUkRFX05PU1BBQ0U7CisKKwkgIGJyZWFrOworCisJY2FzZSAnXSc6CisJICBpZiAoYnJhY2tldCAmJiBwYXJlbl9kZXB0aCA9PSAxKQorCSAgICB7CisJICAgICAgY2hhciByZXN1bHRbMjFdOwkvKiAyMSA9IGNlaWwobG9nMTAoMl42NCkpICsgMSAqLworCSAgICAgIGxvbmcgaW50IG51bXJlc3VsdCA9IDA7CisKKwkgICAgICAvKiBHbyAtIGV2YWx1YXRlLiAqLworCSAgICAgIGlmICgqZXhwciAmJiBldmFsX2V4cHIgKGV4cHIsICZudW1yZXN1bHQpICE9IDApCisJCXsKKwkJICBmcmVlIChleHByKTsKKwkJICByZXR1cm4gV1JERV9TWU5UQVg7CisJCX0KKworCSAgICAgIHJlc3VsdFsyMF0gPSAnXDAnOworCSAgICAgICp3b3JkID0gd19hZGRzdHIgKCp3b3JkLCB3b3JkX2xlbmd0aCwgbWF4X2xlbmd0aCwKKwkJCQlfaXRvYV93b3JkIChudW1yZXN1bHQsICZyZXN1bHRbMjBdLCAxMCwgMCkpOworCSAgICAgIGZyZWUgKGV4cHIpOworCSAgICAgIHJldHVybiAqd29yZCA/IDAgOiBXUkRFX05PU1BBQ0U7CisJICAgIH0KKworCSAgZnJlZSAoZXhwcik7CisJICByZXR1cm4gV1JERV9TWU5UQVg7CisKKwljYXNlICdcbic6CisJY2FzZSAnOyc6CisJY2FzZSAneyc6CisJY2FzZSAnfSc6CisJICBmcmVlIChleHByKTsKKwkgIHJldHVybiBXUkRFX0JBRENIQVI7CisKKwljYXNlICcoJzoKKwkgICsrcGFyZW5fZGVwdGg7CisJZGVmYXVsdDoKKwkgIGV4cHIgPSB3X2FkZGNoYXIgKGV4cHIsICZleHByX2xlbmd0aCwgJmV4cHJfbWF4bGVuLCB3b3Jkc1sqb2Zmc2V0XSk7CisJICBpZiAoZXhwciA9PSBOVUxMKQorCSAgICByZXR1cm4gV1JERV9OT1NQQUNFOworCX0KKyAgICB9CisKKyAgLyogUHJlbWF0dXJlIGVuZCAqLworICBmcmVlIChleHByKTsKKyAgcmV0dXJuIFdSREVfU1lOVEFYOworfQorCisvKiBGdW5jdGlvbiBjYWxsZWQgYnkgY2hpbGQgcHJvY2VzcyBpbiBleGVjX2NvbW0oKSAqLworc3RhdGljIGlubGluZSB2b2lkCitpbnRlcm5hbF9mdW5jdGlvbiBfX2F0dHJpYnV0ZV9fICgoYWx3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ICAgIGlmIChfX2hhdmVfcGlwZTIgPT0gMCkKKwlfX2hhdmVfcGlwZTIgPSByICE9IC0xIHx8IGVycm5vICE9IEVOT1NZUyA/IDEgOiAtMTsKKworICAgICAgaWYgKF9faGF2ZV9waXBlMiA+IDApCisjIGVuZGlmCisJaWYgKHIgPCAwKQorCSAgLyogQmFkICovCisJICByZXR1cm4gV1JERV9OT1NQQUNFOworICAgIH0KKyNlbmRpZgorI2lmbmRlZiBfX0FTU1VNRV9QSVBFMgorIyBpZmRlZiBPX0NMT0VYRUMKKyAgaWYgKF9faGF2ZV9waXBlMiA8IDApCisjIGVuZGlmCisgICAgaWYgKF9fcGlwZSAoZmlsZGVzKSA8IDApCisgICAgICAvKiBCYWQgKi8KKyAgICAgIHJldHVybiBXUkRFX05PU1BBQ0U7CisjZW5kaWYKKworIGFnYWluOgorICBpZiAoKHBpZCA9IF9fZm9yayAoKSkgPCAwKQorICAgIHsKKyAgICAgIC8qIEJhZCAqLworICAgICAgX19jbG9zZSAoZmlsZGVzWzBdKTsKKyAgICAgIF9fY2xvc2UgKGZpbGRlc1sxXSk7CisgICAgICByZXR1cm4gV1JERV9OT1NQQUNFOworICAgIH0KKworICBpZiAocGlkID09IDApCisgICAgZXhlY19jb21tX2NoaWxkIChjb21tLCBmaWxkZXMsIG5vZXhlYyA/IDAgOiBmbGFncyAmIFdSREVfU0hPV0VSUiwgbm9leGVjKTsKKworICAvKiBQYXJlbnQgKi8KKworICAvKiBJZiB3ZSBhcmUganVzdCB0ZXN0aW5nIHRoZSBzeW50YXgsIG9ubHkgd2FpdC4gICovCisgIGlmIChub2V4ZWMpCisgICAgcmV0dXJuIChURU1QX0ZBSUxVUkVfUkVUUlkgKF9fd2FpdHBpZCAocGlkLCAmc3RhdHVzLCAwKSkgPT0gcGlkCisJICAgICYmIHN0YXR1cyAhPSAwKSA/IFdSREVfU1lOVEFYIDogMDsKKworICBfX2Nsb3NlIChmaWxkZXNbMV0pOworICBmaWxkZXNbMV0gPSAtM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JykKKyAgICB7CisgICAgICAoKndvcmQpWy0tKndvcmRfbGVuZ3RoXSA9ICdcMCc7CisKKyAgICAgIC8qIElmIHRoZSBsYXN0IHdvcmQgd2FzIGVudGlyZWx5IG5ld2xpbmVzLCB0dXJuIGl0IGludG8gYSBuZXcgd29yZAorICAgICAgICogd2hpY2ggY2FuIGJlIGlnbm9yZWQgaWYgdGhlcmUncyBub3RoaW5nIGZvbGxvd2luZyBpdC4gKi8KKyAgICAgIGlmICgqd29yZF9sZW5ndGggPT0gMCkKKwl7CisJICBmcmVlICgqd29yZCk7CisJICAqd29yZCA9IHdfbmV3d29yZCAod29yZF9sZW5ndGgsIG1heF9sZW5ndGgpOworCSAgYnJlYWs7CisJfQorICAgIH0KKworICBfX2Nsb3NlIChmaWxkZXNbMF0pOworICBmaWxkZXNbMF0gPSAtMTsKKworICAvKiBDaGVjayBmb3Igc3ludGF4IGVycm9yIChyZS1leGVjdXRlIGJ1dCB3aXRoICItbiIgZmxhZykgKi8KKyAgaWYgKGJ1ZmxlbiA8IDEgJiYgc3RhdHVzICE9IDApCisgICAgeworICAgICAgbm9leGVjID0gMTsKKyAgICAgIGdvdG8gYWdhaW47CisgICAgfQorCisgIHJldHVybiAwOworCitub19zcGFjZToKKyAgX19raWxsIChwaWQsIFNJR0tJTEwpOworICBURU1QX0ZBSUxVUkVfUkVUUlkgKF9fd2FpdHBpZCAocGlkLCBOVUxMLCAwKSk7CisgIF9fY2xvc2UgKGZpbGRlc1swXSk7CisgIHJldHVybiBXUkRFX05PU1BBQ0U7Cit9CisKK3N0YXRpYyBpbnQKK2ludGVybmFsX2Z1bmN0aW9uCitwYXJzZV9jb21tIChjaGFyICoqd29yZCwgc2l6ZV90ICp3b3JkX2xlbmd0aCwgc2l6ZV90ICptYXhfbGVuZ3RoLAorCSAgICBjb25zdCBjaGFyICp3b3Jkcywgc2l6ZV90ICpvZmZzZXQsIGludCBmbGFncywgd29yZGV4cF90ICpwd29yZGV4cCwKKwkgICAgY29uc3QgY2hhciAqaWZzLCBjb25zdCBjaGFyICppZnNfd2hpdGUpCit7CisgIC8qIFdlIGFyZSBwb2lzZWQganVzdCBhZnRlciAiJCgiICovCisgIGludCBwYXJlbl9kZXB0aCA9IDE7CisgIGludCBlcnJvciA9IDA7CisgIGludCBxdW90ZWQgPSAwOyAvKiAxIGZvciBzaW5nbHktcXVvdGVkLCAyIGZvciBkb3VibHktcXVvdGVkICovCisgIHNpemVfdCBjb21tX2xlbmd0aDsKKyAgc2l6ZV90IGNvbW1fbWF4bGVuOworICBjaGFyICpjb21tID0gd19uZXd3b3JkICgmY29tbV9sZW5ndGgsICZjb21tX21heGxlbik7CisKKyAgZm9yICg7IHdvcmRzWypvZmZzZXRdOyArKygqb2Zmc2V0KSkKKyAgICB7CisgICAgICBzd2l0Y2ggKHdvcmRzWypvZmZzZXRdKQorCXsKKwljYXNlICdcJyc6CisJICBpZiAocXVvdGVkID09IDApCisJICAgIHF1b3RlZCA9IDE7CisJICBlbHNlIGlmIChxdW90ZWQgPT0gMSkKKwkgICAgcXVvdGVkID0gMDsKKworCSAgYnJlYWs7CisKKwljYXNlICciJzoKKwkgIGlmIChxdW90ZWQgPT0gMCkKKwkgICAgcXVvdGVkID0gMjsKKwkgIGVsc2UgaWYgKHF1b3RlZCA9PSAyKQorCSAgICBxdW90ZWQgPSAwOworCisJICBicmVhazsKKworCWNhc2UgJyknOgorCSAgaWYgKCFxdW90ZWQgJiYgLS1wYXJlbl9kZXB0aCA9PSAwKQorCSAgICB7CisJICAgICAgLyogR28gLS0gZ2l2ZSBzY3JpcHQgdG8gdGhlIHNoZWxsICovCisJICAgICAgaWYgKGNvbW0pCisJCXsKKyNpZmRlZiBfX2xpYmNfcHRmX2NhbGwKKwkJICAvKiBXZSBkbyBub3Qgd2FudCB0aGUgZXhlY19jb21tIGNhbGwgdG8gYmUgY3V0IHNob3J0CisJCSAgICAgYnkgYSB0aHJlYWQgY2FuY2VsbGF0aW9uIHNpbmNlIGNsZWFudXAgaXMg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IHdvcmRzWypvZmZzZXRdKTsKKwkgIGlmIChlbnYgPT0gTlVMTCkKKwkgICAgZ290byBub19zcGFjZTsKKwl9CisgICAgICB3aGlsZSAoaXNhbG51bSAod29yZHNbKysqb2Zmc2V0XSkgfHwgd29yZHNbKm9mZnNldF0gPT0gJ18nKTsKKyAgICB9CisgIGVsc2UgaWYgKGlzZGlnaXQgKHdvcmRzWypvZmZzZXRdKSkKKyAgICB7CisgICAgICAvKiBOdW1lcmljIHBhcmFtZXRlciBuYW1lLiAqLworICAgICAgc3BlY2lhbCA9IDE7CisgICAgICBkbworCXsKKwkgIGVudiA9IHdfYWRkY2hhciAoZW52LCAmZW52X2xlbmd0aCwgJmVudl9tYXhsZW4sCisJCQkgICB3b3Jkc1sqb2Zmc2V0XSk7CisJICBpZiAoZW52ID09IE5VTEwpCisJICAgIGdvdG8gbm9fc3BhY2U7CisJICBpZiAoIWJyYWNlKQorCSAgICBnb3RvIGVudnN1YnN0OworCX0KKyAgICAgIHdoaWxlIChpc2RpZ2l0KHdvcmRzWysrKm9mZnNldF0pKTsKKyAgICB9CisgIGVsc2UgaWYgKENIQVJfSU5fU0VUICh3b3Jkc1sqb2Zmc2V0XSwgIipAJCIpKQorICAgIHsKKyAgICAgIC8qIFNwZWNpYWwgcGFyYW1ldGVyLiAqLworICAgICAgc3BlY2lhbCA9IDE7CisgICAgICBlbnYgPSB3X2FkZGNoYXIgKGVudiwgJmVudl9sZW5ndGgsICZlbnZfbWF4bGVuLAorCQkgICAgICAgd29yZHNbKm9mZnNldF0pOworICAgICAgaWYgKGVudiA9PSBOVUxMKQorCWdvdG8gbm9fc3BhY2U7CisgICAgICArKypvZmZzZXQ7CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaWYgKGJyYWNlKQorCWdvdG8gc3ludGF4OworICAgIH0KKworICBpZiAoYnJhY2UpCisgICAgeworICAgICAgLyogQ2hlY2sgZm9yIHNwZWNpYWwgYWN0aW9uIHRvIGJlIGFwcGxpZWQgdG8gdGhlIHZhbHVlLiAqLworICAgICAgc3dpdGNoICh3b3Jkc1sqb2Zmc2V0XSkKKwl7CisJY2FzZSAnfSc6CisJICAvKiBFdmFsdWF0ZS4gKi8KKwkgIGdvdG8gZW52c3Vic3Q7CisKKwljYXNlICcjJzoKKwkgIGFjdGlvbiA9IEFDVF9SUF9TSE9SVF9MRUZUOworCSAgaWYgKHdvcmRzWzEgKyAqb2Zmc2V0XSA9PSAnIycpCisJICAgIHsKKwkgICAgICArKypvZmZzZXQ7CisJICAgICAgYWN0aW9uID0gQUNUX1JQX0xPTkdfTEVGVDsKKwkgICAgfQorCSAgYnJlYWs7CisKKwljYXNlICclJzoKKwkgIGFjdGlvbiA9IEFDVF9SUF9TSE9SVF9SSUdIVDsKKwkgIGlmICh3b3Jkc1sxICsgKm9mZnNldF0gPT0gJyUnKQorCSAgICB7CisJICAgICAgKysqb2Zmc2V0OworCSAgICAgIGFjdGlvbiA9IEFDVF9SUF9MT05HX1JJR0hUOworCSAgICB9CisJICBicmVhazsKKworCWNhc2UgJzonOgorCSAgaWYgKCFDSEFSX0lOX1NFVCAod29yZHNbMSArICpvZmZzZXRdLCAiLT0/KyIpKQorCSAgICBnb3RvIHN5bnRheDsKKworCSAgY29sb25fc2VlbiA9IDE7CisJICBhY3Rpb24gPSB3b3Jkc1srKypvZmZzZXRdOworCSAgYnJlYWs7CisKKwljYXNlICctJzoKKwljYXNlICc9JzoKKwljYXNlICc/JzoKKwljYXNlICcrJzoKKwkgIGFjdGlvbiA9IHdvcmRzWypvZmZzZXRdOworCSAgYnJlYWs7CisKKwlkZWZhdWx0OgorCSAgZ290byBzeW50YXg7CisJfQorCisgICAgICAvKiBOb3cgY29sbGVjdCB0aGUgcGF0dGVybiwgYnV0IGRvbid0IGV4cGFuZCBpdCB5ZXQuICovCisgICAgICArKypvZmZzZXQ7CisgICAgICBmb3IgKDsgd29yZHNbKm9mZnNldF07ICsrKCpvZmZzZXQpKQorCXsKKwkgIHN3aXRjaCAod29yZHNb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vdGVkID09IDEpCisJCSAgICBxdW90ZWQgPSAwOworCQkgIGVsc2UgaWYgKHF1b3RlZCA9PSAwKQorCQkgICAgcXVvdGVkID0gMTsKKwkJICBlbHNlIGJyZWFrOworCisJCSAgY29udGludWU7CisKKwkJY2FzZSAnKic6CisJCWNhc2UgJz8nOgorCQkgIGlmIChxdW90ZWQpCisJCSAgICB7CisJCSAgICAgIC8qIENvbnZlcnQgcXVvdGVkIHdpbGRjaGFyIHRvIGVzY2FwZWQgd2lsZGNoYXIuICovCisJCSAgICAgIGV4cGFuZGVkID0gd19hZGRjaGFyIChleHBhbmRlZCwgJmV4cF9sZW4sCisJCQkJCSAgICAmZXhwX21heGwsICdcXCcpOworCisJCSAgICAgIGlmIChleHBhbmRlZCA9PSBOVUxMKQorCQkJZ290byBub19zcGFjZTsKKwkJICAgIH0KKwkJICBicmVhazsKKworCQljYXNlICckJzoKKwkJICBvZmZzZXQgPSAwOworCQkgIGVycm9yID0gcGFyc2VfZG9sbGFycyAoJmV4cGFuZGVkLCAmZXhwX2xlbiwgJmV4cF9tYXhsLCBwLAorCQkJCQkgJm9mZnNldCwgZmxhZ3MsIE5VTEwsIE5VTEwsIE5VTEwsIDEpOworCQkgIGlmIChlcnJvcikKKwkJICAgIHsKKwkJICAgICAgaWYgKGZyZWVfdmFsdWUpCisJCQlmcmVlICh2YWx1ZSk7CisKKwkJICAgICAgZnJlZSAoZXhwYW5kZWQpOworCisJCSAgICAgIGdvdG8gZG9fZXJyb3I7CisJCSAgICB9CisKKwkJICBwICs9IG9mZnNldDsKKwkJICBjb250aW51ZTsKKworCQljYXNlICd+JzoKKwkJICBpZiAocXVvdGVkIHx8IGV4cF9sZW4pCisJCSAgICBicmVhazsKKworCQkgIG9mZnNldCA9IDA7CisJCSAgZXJyb3IgPSBwYXJzZV90aWxkZSAoJmV4cGFuZGVkLCAmZXhwX2xlbiwgJmV4cF9tYXhsLCBwLAorCQkJCSAgICAgICAmb2Zmc2V0LCAwKTsKKwkJICBp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AoZnJlZV92YWx1ZSkKKwkJZnJlZSAodmFsdWUpOworCSAgICAgIGdvdG8gc3VjY2VzczsKKwkgICAgfQorCisJICBpZiAoZnJlZV92YWx1ZSkKKwkgICAgZnJlZSAodmFsdWUpOworCisJICB2YWx1ZSA9IHBhdHRlcm4gPyBfX3N0cmR1cCAocGF0dGVybikgOiBwYXR0ZXJuOworCSAgZnJlZV92YWx1ZSA9IDE7CisKKwkgIGlmIChwYXR0ZXJuICYmICF2YWx1ZSkKKwkgICAgZ290byBub19zcGFjZTsKKworCSAgX19zZXRlbnYgKGVudiwgdmFsdWUgPzogIiIsIDEpOworCSAgYnJlYWs7CisKKwlkZWZhdWx0OgorCSAgYXNzZXJ0ICghICJVbnJlY29nbmlzZWQgYWN0aW9uISIpOworCX0KKyAgICB9CisKKyAgZnJlZSAoZW52KTsKKyAgZW52ID0gTlVMTDsKKyAgZnJlZSAocGF0dGVybik7CisgIHBhdHRlcm4gPSBOVUxMOworCisgIGlmIChzZWVuX2hhc2gpCisgICAgeworICAgICAgY2hhciBwYXJhbV9sZW5ndGhbMjFdOworICAgICAgcGFyYW1fbGVuZ3RoWzIwXSA9ICdcMCc7CisgICAgICAqd29yZCA9IHdfYWRkc3RyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsCisJCQlfaXRvYV93b3JkICh2YWx1ZSA/IHN0cmxlbiAodmFsdWUpIDogMCwKKwkJCQkgICAgJnBhcmFtX2xlbmd0aFsyMF0sIDEwLCAwKSk7CisgICAgICBpZiAoZnJlZV92YWx1ZSkKKwl7CisJICBhc3NlcnQgKHZhbHVlICE9IE5VTEwpOworCSAgZnJlZSAodmFsdWUpOworCX0KKworICAgICAgcmV0dXJuICp3b3JkID8gMCA6IFdSREVfTk9TUEFDRTsKKyAgICB9CisKKyAgaWYgKHZhbHVlID09IE5VTEwpCisgICAgcmV0dXJuIDA7CisKKyAgaWYgKHF1b3RlZCB8fCAhcHdvcmRleHApCisgICAgeworICAgICAgLyogUX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PSBOVUxMICYmICpmaWVsZF9iZWdpbiAhPSAnXDAnKQorCSAgICB7CisJICAgICAgZnJlZSAodmFsdWVfY29weSk7CisJICAgICAgZ290byBub19zcGFjZTsKKwkgICAgfQorCisJICBmaWVsZF9iZWdpbiA9IG5leHRfZmllbGQ7CisJfQorICAgICAgd2hpbGUgKHNlZW5fbm9ud3NfaWZzIHx8ICpmaWVsZF9iZWdpbik7CisKKyAgICAgIGZyZWUgKHZhbHVlX2NvcHkpOworICAgIH0KKworICByZXR1cm4gMDsKKworc3VjY2VzczoKKyAgZXJyb3IgPSAwOworICBnb3RvIGRvX2Vycm9yOworCitub19zcGFjZToKKyAgZXJyb3IgPSBXUkRFX05PU1BBQ0U7CisgIGdvdG8gZG9fZXJyb3I7CisKK3N5bnRheDoKKyAgZXJyb3IgPSBXUkRFX1NZTlRBWDsKKworZG9fZXJyb3I6CisgIGZyZWUgKGVudik7CisKKyAgZnJlZSAocGF0dGVybik7CisKKyAgcmV0dXJuIGVycm9yOworfQorCisjdW5kZWYgQ0hBUl9JTl9TRVQKKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK3BhcnNlX2RvbGxhcnMgKGNoYXIgKip3b3JkLCBzaXplX3QgKndvcmRfbGVuZ3RoLCBzaXplX3QgKm1heF9sZW5ndGgsCisJICAgICAgIGNvbnN0IGNoYXIgKndvcmRzLCBzaXplX3QgKm9mZnNldCwgaW50IGZsYWdzLAorCSAgICAgICB3b3JkZXhwX3QgKnB3b3JkZXhwLCBjb25zdCBjaGFyICppZnMsIGNvbnN0IGNoYXIgKmlmc193aGl0ZSwKKwkgICAgICAgaW50IHF1b3RlZCkKK3sKKyAgLyogV2UgYXJlIHBvaXNlZCBfYXRfICIkIiAqLworICBzd2l0Y2ggKHdvcmRzWzEgKyAqb2Zmc2V0XSkKKyAgICB7CisgICAgY2FzZSAnIic6CisgICAgY2FzZSAnXCcnOgorICAgIGNhc2UgMDoKKyAgICAgICp3b3JkID0gd19hZGRjaGFyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsICckJyk7CisgICAgICByZXR1cm4gKndvcmQgPyAwIDogV1JERV9OT1NQQUNFOworCisgICAgY2FzZSAnKCc6CisgICAgICBpZiAod29yZHNbMiArICpvZmZzZXRdID09ICcoJykKKwl7CisJICAvKiBEaWZmZXJlbnRpYXRlIGJldHdlZW4gJCgoMSszKSkgYW5kICQoKGVjaG8pOyhscykpICovCisJICBpbnQgaSA9IDMgKyAqb2Zmc2V0OworCSAgaW50IGRlcHRoID0gMDsKKwkgIHdoaWxlICh3b3Jkc1tpXSAmJiAhKGRlcHRoID09IDAgJiYgd29yZHNbaV0gPT0gJyknKSkKKwkgICAgeworCSAgICAgIGlmICh3b3Jkc1tpXSA9PSAnKCcpCisJCSsrZGVwdGg7CisJICAgICAgZWxzZSBpZiAod29yZHNbaV0gPT0gJyknKQorCQktLWRlcHRoOworCisJICAgICAgKytpOworCSAgICB9CisKKwkgIGlmICh3b3Jkc1tpXSA9PSAnKScgJiYgd29yZHNbaSArIDFdID09ICcpJykKKwkgICAgeworCSAgICAgICgqb2Zmc2V0KSArPSAzOworCSAgICAgIC8qIENhbGwgcGFyc2VfYXJpdGggLS0gMCBpcyBmb3IgIm5vIGJyYWNrZXRzIiAqLworCSAgICAgIHJldHVybiBwYXJzZV9hcml0aCAod29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsIHdvcmRzLCBvZmZzZXQsCisJCQkJICBmbGFncywgMCk7CisJICAgIH0KKwl9CisKKyAgICAgICgqb2Zmc2V0KSArPSAyOworICAgICAgcmV0dXJuIHBhcnNlX2NvbW0gKHdvcmQsIHdvcmRfbGVuZ3RoLCBtYXhfbGVuZ3RoLCB3b3Jkcywgb2Zmc2V0LCBmbGFncywKKwkJCSBxdW90ZWQ/IE5VTEwgOiBwd29yZGV4cCwgaWZzLCBpZnNfd2hpdGUpOworCisgICAgY2FzZSAnWyc6CisgICAgICAoKm9mZnNldCkgKz0gMjsKK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ICp3b3JkdjsgKyt3b3JkdikKKwlmcmVlICgqd29yZHYpOworCisgICAgICBmcmVlIChwd29yZGV4cC0+d2Vfd29yZHYpOworICAgICAgcHdvcmRleHAtPndlX3dvcmR2ID0gTlVMTDsKKyAgICB9Cit9CitsaWJjX2hpZGRlbl9kZWYgKHdvcmRmcmVlKQorCisvKgorICogd29yZGV4cCgpCisgKi8KKworaW50Cit3b3JkZXhwIChjb25zdCBjaGFyICp3b3Jkcywgd29yZGV4cF90ICpwd29yZGV4cCwgaW50IGZsYWdzKQoreworICBzaXplX3Qgd29yZHNfb2Zmc2V0OworICBzaXplX3Qgd29yZF9sZW5ndGg7CisgIHNpemVfdCBtYXhfbGVuZ3RoOworICBjaGFyICp3b3JkID0gd19uZXd3b3JkICgmd29yZF9sZW5ndGgsICZtYXhfbGVuZ3RoKTsKKyAgaW50IGVycm9yOworICBjaGFyICppZnM7CisgIGNoYXIgaWZzX3doaXRlWzRdOworICB3b3JkZXhwX3Qgb2xkX3dvcmQgPSAqcHdvcmRleHA7CisKKyAgaWYgKGZsYWdzICYgV1JERV9SRVVTRSkKKyAgICB7CisgICAgICAvKiBNaW5pbWFsIGltcGxlbWVudGF0aW9uIG9mIFdSREVfUkVVU0UgZm9yIG5vdyAqLworICAgICAgd29yZGZyZWUgKHB3b3JkZXhwKTsKKyAgICAgIG9sZF93b3JkLndlX3dvcmR2ID0gTlVMTDsKKyAgICB9CisKKyAgaWYgKChmbGFncyAmIFdSREVfQVBQRU5EKSA9PSAwKQorICAgIHsKKyAgICAgIHB3b3JkZXhwLT53ZV93b3JkYyA9IDA7CisKKyAgICAgIGlmIChmbGFncyAmIFdSREVfRE9PRkZTKQorCXsKKwkgIHB3b3JkZXhwLT53ZV93b3JkdiA9IGNhbGxvYyAoMSArIHB3b3JkZXhwLT53ZV9vZmZzLCBzaXplb2YgKGNoYXIgKikpOworCSAgaWYgKHB3b3JkZXhwLT53ZV93b3JkdiA9PSBOVUxMKQorCSAgICB7CisJICAgICAgZX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mJiAqcnVucCAhPSAqaWZzY2gpCisJCSsrcnVucDsKKworCSAgICAgIGlmIChydW5wID09IHdoY2gpCisJCSp3aGNoKysgPSAqaWZzY2g7CisJICAgIH0KKworCSAgKytpZnNjaDsKKwl9CisgICAgICAqd2hjaCA9ICdcMCc7CisgICAgfQorCisgIGZvciAod29yZHNfb2Zmc2V0ID0gMCA7IHdvcmRzW3dvcmRzX29mZnNldF0gOyArK3dvcmRzX29mZnNldCkKKyAgICBzd2l0Y2ggKHdvcmRzW3dvcmRzX29mZnNldF0pCisgICAgICB7CisgICAgICBjYXNlICdcXCc6CisJZXJyb3IgPSBwYXJzZV9iYWNrc2xhc2ggKCZ3b3JkLCAmd29yZF9sZW5ndGgsICZtYXhfbGVuZ3RoLCB3b3JkcywKKwkJCQkgJndvcmRzX29mZnNldCk7CisKKwlpZiAoZXJyb3IpCisJICBnb3RvIGRvX2Vycm9yOworCisJYnJlYWs7CisKKyAgICAgIGNhc2UgJyQnOgorCWVycm9yID0gcGFyc2VfZG9sbGFycyAoJndvcmQsICZ3b3JkX2xlbmd0aCwgJm1heF9sZW5ndGgsIHdvcmRzLAorCQkJICAgICAgICZ3b3Jkc19vZmZzZXQsIGZsYWdzLCBwd29yZGV4cCwgaWZzLCBpZnNfd2hpdGUsCisJCQkgICAgICAgMCk7CisKKwlpZiAoZXJyb3IpCisJICBnb3RvIGRvX2Vycm9yOworCisJYnJlYWs7CisKKyAgICAgIGNhc2UgJ2AnOgorCSsrd29yZHNfb2Zmc2V0OworCWVycm9yID0gcGFyc2VfYmFja3RpY2sgKCZ3b3JkLCAmd29yZF9sZW5ndGgsICZtYXhfbGVuZ3RoLCB3b3JkcywKKwkJCQkmd29yZHNfb2Zmc2V0LCBmbGFncywgcHdvcmRleHAsIGlmcywKKwkJCQlpZnNfd2hpdGUpOworCisJaWYgKGVycm9yKQorCSAgZ290byBkb19lcnJvcjsKKworCWJyZWFrOworCisgICAgICBjYXNlICciJzoKKwkrK3dvcmRzX29mZnNldD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