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IC0xIC0xCithYi57Miw1fXh5IGFiX3h5IC0xIC0xCisKKzsgYWdhaW4gYnV0IHdpdGggc2xvd2VyIGFsZ29yaXRobSB2YXJpYW50OgorLSBtYXRjaF9kZWZhdWx0IFJFR19FWFRFTkRFRAorOyBub3cgYWdhaW4gZm9yIHNpbmdsZSBjaGFyYWN0ZXIgcmVwZWF0czoKKworYWJfKnh5IGFieHlfIDAgNAorYWJfKnh5IGFiX3h5XyAwIDUKK2FiXyp4eSBhYnh5IDAgNAorYWJfKnh5IGFiX3h5IDAgNQorYWJfKiBhYiAwIDIKK2FiXyogYWJfXyAwIDQKKworYWJfezIsNX14eSBhYl9feHlfIDAgNgorYWJfezIsNX14eSBhYl9fX194eV8gMCA4CithYl97Miw1fXh5IGFiX19fX194eV8gMCA5CithYl97Miw1fXh5IGFiX194eSAwIDYKK2FiX3syLDV9eHkgYWJfX19fX3h5IDAgOQorYWJfezIsNX0gYWJfXyAwIDQKK2FiX3syLDV9IGFiX19fX19fXyAwIDcKK2FiX3syLDV9eHkgYWJfX19fX194eSAtMSAtMQorYWJfezIsNX14eSBhYl94eSAtMSAtMQorCithYl8qP3h5IGFieHlfIDAgNAorYWJfKj94eSBhYl94eV8gMCA1CithYl8qP3h5IGFieHkgMCA0CithYl8qP3h5IGFiX3h5IDAgNQorYWJfKj8gYWIgMCAyCithYl8qPyBhYl9fIDAgNAorCithYl97Miw1fT94eSBhYl9feHlfIDAgNgorYWJfezIsNX0/eHkgYWJfX19feHlfIDAgOAorYWJfezIsNX0/eHkgYWJfX19fX3h5XyAwIDkKK2FiX3syLDV9P3h5IGFiX194eSAwIDYKK2FiX3syLDV9P3h5IGFiX19fX194eSAwIDkKK2FiX3syLDV9PyBhYl9fIDAgNAorYWJfezIsNX0/IGFiX19fX19fXyAwIDcKK2FiX3syLDV9P3h5IGFiX19fX19feHkgLTEgLTEKK2FiX3syLDV9eHkgYWJfeHkgLTEgLTEKKworOyBhbmQgYWdhaW4gZm9yIHNldHM6CithYltfLDtdKnh5IGFieHlfIDAgNAorYWJbXyw7XSp4eSBhYl94eV8gMCA1CithYltfLDtdKnh5IGFieHkgMCA0CithYltfLDtdKnh5IGFiX3h5IDAgNQorYWJbXyw7XSogYWIgMCAyCithYltfLDtdKiBhYl9fIDAgNAorCithYltfLDtdezIsNX14eSBhYl9feHlfIDAgNgorYWJbXyw7XXsyLDV9eHkgYWJfX19feHlfIDAgOAorYWJbXyw7XXsyLDV9eHkgYWJfX19fX3h5XyAwIDkKK2FiW18sO117Miw1fXh5IGFiX194eSAwIDYKK2FiW18sO117Miw1fXh5IGFiX19fX194eSAwIDkKK2FiW18sO117Miw1fSBhYl9fIDAgNAorYWJbXyw7XXsyLDV9IGFiX19fX19fXyAwIDcKK2FiW18sO117Miw1fXh5IGFiX19fX19feHkgLTEgLTEKK2FiW18sO117Miw1fXh5IGFiX3h5IC0xIC0xCisKK2FiW18sO10qP3h5IGFieHlfIDAgNAorYWJbXyw7XSo/eHkgYWJfeHlfIDAgNQorYWJbXyw7XSo/eHkgYWJ4eSAwIDQKK2FiW18sO10qP3h5IGFiX3h5IDAgNQorYWJbXyw7XSo/IGFiIDAgMgorYWJbXyw7XSo/IGFiX18gMCA0CisKK2FiW18sO117Miw1fT94eSBhYl9feHlfIDAgNgorYWJbXyw7XXsyLDV9P3h5IGFiX19fX3h5XyAwIDgKK2FiW18sO117Miw1fT94eSBhYl9fX19feHlfIDAgOQorYWJbXyw7XXsyLDV9P3h5IGFiX194eSAwIDYKK2FiW18sO117Miw1fT94eSBhYl9fX19feHkgMCA5CithYltfLDtdezIsNX0/IGFiX18gMCA0CithYltfLDtdezIsNX0/IGFiX19fX19fXyAwIDcKK2FiW18sO117Miw1fT94eSBhYl9fX19fX3h5IC0xIC0xCithYltfLDtdezIsNX14eSBhYl94eSAtMSAtMQorCis7IGFuZCBhZ2FpbiBmb3IgdHJpY2t5IHNldHMgd2l0aCBkaWdyYXBoczoKKzthYltfWy5hZS5dXSp4eSBhYnh5XyAwIDQKKz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5eXlwcUF6egorTm8gbWF0Y2gKKyAgICBhYWFiY3h5enBxcnJyYWJieHl5eXlwcXFxcXFxcUF6egorTm8gbWF0Y2gKKworL14oYWJjKXsxLDJ9enovCisgICAgYWJjenoKKyAwOiBhYmN6egorIDE6IGFiYworICAgIGFiY2FiY3p6CisgMDogYWJjYWJjenoKKyAxOiBhYmMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICB6egorTm8gbWF0Y2gKKyAgICBhYmNhYmNhYmN6egorTm8gbWF0Y2gKKyAgICA+PmFiY3p6CitObyBtYXRjaAorCisvXihiK3xhKXsxLDJ9Yy8KKyAgICBiYworIDA6IGJjCisgMTogYgorICAgIGJiYworIDA6IGJiYworIDE6IGJiCisgICAgYmJiYworIDA6IGJiYmMKKyAxOiBiYmIKKyAgICBiYWMKKyAwOiBiYWMKKyAxOiBhCisgICAgYmJhYworIDA6IGJiYWMKKyAxOiBhCisgICAgYWFjCisgMDogYWFjCisgMTogYQorICAgIGFiYmJiYmJiYmJiYmMKKyAwOiBhYmJiYmJiYmJiYmJjCisgMTogYmJiYmJiYmJiYmIKKyAgICBiYmJiYmJiYmJiYmFjCisgMDogYmJiYmJiYmJiYmJhYworIDE6IGEKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYWFjCitObyBtYXRjaAorICAgIGFiYmJiYmJiYmJiYmFjCitObyBtYXRjaAorCisvXltdY2RlXS8KKyAgICBddGhpbmcKKyAwOiBdCisgICAgY3RoaW5nCisgMDogYworICAgIGR0aGluZworIDA6IGQKKyAgICBldGhpbmcKKyAwOiBlCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYXRoaW5nCitObyBtYXRjaAorICAgIGZ0aGluZworTm8gbWF0Y2gKKworL15bXl1jZGVdLworICAgIGF0aGluZworIDA6IGEKKyAgICBmdGhpbmcKKyAwOiBmCisgICAgKioqIEZhaWxlcnMKKyAwOiAqCisgICAgXXRoaW5nCitObyBtYXRjaAorICAgIGN0aGluZworTm8gbWF0Y2gKKyAgICBkdGhpbmcKK05vIG1hdGNoCisgICAgZXRoaW5nCitObyBtYXRjaAorCisvXlswLTldKyQvCisgICAgMAorIDA6IDAKKyAgICAxCisgMDogMQorICAgIDIKKyAwOiAyCisgICAgMworIDA6IDMKKyAgICA0CisgMDogNAorICAgIDUKKyAwOiA1CisgICAgNgorIDA6IDYKKyAgICA3CisgMDogNworICAgIDgKKyAwOiA4CisgICAgOQorIDA6IDkKKyAgICAxMAorIDA6IDEwCisgICAgMTAwCisgMDogMTAwCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWJjCitObyBtYXRjaAorCisvXi4qbnRlci8KKyAgICBlbnRlcgorIDA6IGVudGVyCisgICAgaW50ZXIKKyAwOiBpbnRlcgorICAgIHVwb250ZXIKKyAwOiB1cG9udGVyCisKKy9eeHh4WzAtOV0rJC8KKyAgICB4eHgwCisgMDogeHh4MAorICAgIHh4eDEyMzQKKyAwOiB4eHgxMjM0CisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgeHh4CitObyBtYXRjaAorCisvXi4rWzAtOV1bMC05XVswLTldJC8KKyAgICB4MTIzCisgMDogeDEyMworICAgIHh4MTIzCisgMDogeHgxMjMKKyAgICAxMjM0NTYKKyAwOiAxMjM0NTYKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICAxMjMKK05vIG1hdGNoCisgICAgeDEyMzQKKyAwOiB4MTIzNAorCisvXihbXiFdKykhKC4rKT1hcHF1eHpcLml4clwuenp6XC5hY1wudWskLworICAgIGFiYyFwcXI9YXBxdXh6Lml4ci56enouYWMudWsKKyAwOiBhYmMhcHFyPWFwcXV4ei5peHIuenp6LmFjLnVrCisgMTogYWJjCisgMjogcHFyCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgIXBxcj1hcHF1eHouaXhyLnp6ei5hYy51aworTm8gbWF0Y2gKKyAgICBhYmMhPWFwcXV4ei5peHIuenp6LmFjLnVrCitObyBtYXRjaAorICAgIGFiYyFwcXI9YXBxdXh6Oml4ci56enouYWMudWsKK05vIG1hdGNoCisgICAgYWJjIXBxcj1hcHF1eHouaXhyLnp6ei5hYy51a2sKK05vIG1hdGNoCisKKy86LworICAgIFdlbGwsIHdlIG5lZWQgYSBjb2xvbjogc29tZXdoZXJlCisgMDogOgorICAgICoqKiBGYWlsIGlmIHdlIGRvbid0CitObyBtYXRjaAorCisvKFswLTlhLWY6XSspJC9pCisgICAgMGFiYworIDA6IDBhYmMKKyAxOiAwYWJjCisgICAgYWJjCisgMDogYWJjCisgMTogYWJjCisgICAgZmVkCisgMDogZmVkCisgMTogZmVkCisgICAgRQorIDA6IEUKKyAxOiBFCisgICAgOjoKKyAwOiA6OgorIDE6IDo6CisgICAgNWYwMzoxMkMwOjo5MzJlCisgMDogNWYwMzoxMkMwOjo5MzJlCisgMTogNWYwMzoxMkMwOjo5MzJlCisgICAgZmVkIGRlZgorIDA6IGRlZgorIDE6IGRlZgorICAgIEFueSBvbGQgc3R1ZmYKKyAwOiBmZgorIDE6IGZmCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgMHp6egorTm8gbWF0Y2gKKyAgICBnenp6CitObyBtYXRjaAorICAgIEFueSBvbGQgcnViYmlzaAorTm8gbWF0Y2gKKworL14uKlwuKFswLTldezEsM30pXC4oWzAtOV17MSwzfSlcLihbMC05XXsxLDN9KSQvCisgICAgLjEuMi4zCisgMDogLjEuMi4zCisgMTogMQorIDI6IDIKKyAzOiAzCisgICAgQS4xMi4xMjMuMAorIDA6IEEuMTIuMTIzLjAKKyAxOiAxMgorIDI6IDEyMworIDM6IDAKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICAuMS4yLjMzMzMKK05vIG1hdGNoCisgICAgMS4yLjMKK05vIG1hdGNoCisgICAgMTIzNC4yLjMKK05vIG1hdGNoCisKKy9eKFswLTldKylccytJTlxzK1NPQVxzKyhcUyspXHMrKFxTKylccypcKFxzKiQvCisgICAgMSBJTiBTT0Egbm9uLXNwMSBub24tc3AyKAorIDA6IDEgSU4gU09BIG5vbi1zcDEgbm9uLXNwMigKKyAxOiAxCisgMjogbm9uLXNwMQorIDM6IG5vbi1zcDIKKyAgICAxICAgIElOICAgIFNPQSAgICBub24tc3AxICAgIG5vbi1zcDIgICAoCisgMDogMSAgICBJTiAgICBTT0EgICAgbm9uLXNwMSAgICBub24tc3AyICAgKAorIDE6IDEKKyAyOiBub24tc3AxCisgMzogbm9uLXNwMgorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIDFJTiBTT0Egbm9uLXNwMSBub24tc3AyKAorTm8gbWF0Y2gKKworL15bYS16QS1aMC05XVthLXpBLVowLTktXSooXC5bYS16QS1aMC05XVthLXpBLXowLTktXSopKlwuJC8KKyAgICBhLgorIDA6IGEuCisgICAgWi4KKyAwOiBaLgorICAgIDIuCisgMDogMi4KKyAgICBhYi1jLnBxLXIuCisgMDogYWItYy5wcS1yLgorIDE6IC5wcS1yCisgICAgc3hrLnp6ei5hYy51ay4KKyAwOiBzeGsuenp6LmFjLnVrLgorIDE6IC51aworICAgIHgtLnktLgorIDA6IHgtLnktLgorIDE6IC55LQorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIC1hYmMucGVxLgorTm8gbWF0Y2gKKworL15cKlwuW2Etel0oW2EtejAtOS1dKlthLXowLTldKyk/KFwuW2Etel0oW2EtejAtOS1dKlthLXowLTldKyk/KSokLworICAgICouYQorIDA6ICouYQorICAgICouYjAtYQorIDA6ICouYjAtYQorIDE6IDAtYQorICAgICouYzMtYi5jCisgMDogKi5jMy1iLmMKKyAxOiAzLWIKKyAyOiAuYworICAgICouYy1hLmItYworIDA6ICouYy1hLmItYworIDE6IC1hCisgMjogLmItYworIDM6IC1jCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgKi4wCitObyBtYXRjaAorICAgICouYS0KK05vIG1hdGNoCisgICAgKi5hLWIuYy0KK05vIG1hdGNoCisgICAgKi5jLWEuMC1jCitObyBtYXRjaAorCisvXlswLTlhLWZdKFwuWzAtOWEtZl0pKiQvaQorICAgIGEuYi5jLmQKKyAwOiBhLmIuYy5kCisgMTogLmQKKyAgICBBLkIuQy5ECisgMDogQS5CLkMuRAorIDE6IC5ECisgICAgYS5iLmMuMS4yLjMuQworIDA6IGEuYi5jLjEuMi4zLkMKKyAxOiAuQworCisvXiIuKiJccyooOy4qKT8kLworICAgICIxMjM0IgorIDA6ICIxMjM0IgorICAgICJhYmNkIiA7CisgMDogImFiY2QiIDsKKyAxOiA7CisgICAgIiIgOyByaHViYXJiCisgMDogIiIgOyByaHViYXJiCisgMTogOyByaHViYXJiCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgIjEyMzQiIDogdGhpbmdzCitObyBtYXRjaAorCisvXihhKGIoYykpKShkKGUoZikpKShoKGkoaikpKShrKGwobSkpKSQvCisgICAgYWJjZGVmaGlqa2xtCisgMDogYWJjZGVmaGlqa2xtCisgMTogYWJjCisgMjogYmMKKyAzOiBjCisgNDogZGVmCisgNTogZWYKKyA2OiBmCisgNzogaGlqCisgODogaWoKKyA5OiBqCisxMDoga2xtCisxMTogbG0KKzEyOiBtCisKKy9eYSpcdy8KKyAgICB6CisgMDogegorICAgIGF6CisgMDogYXoKKyAgICBhYWF6CisgMDogYWFhegorICAgIGEKKyAwOiBhCisgICAgYWEKKyAwOiBhYQorICAgIGFhYWEKKyAwOiBhYWFhCisgICAgYSsKKyAwOiBhCisgICAgYWErCisgMDogYWEKKworL15hK1x3LworICAgIGF6CisgMDogYXoKKyAgICBhYWF6CisgMDogYWFhegorICAgIGFhCisgMDogYWEKKyAgICBhYWFhCisgMDogYWFhYQorICAgIGFhKworIDA6IGFhCisKKy9eWzAtOV17OH1cd3syLH0vCisgICAgMTIzNDU2Nzg5MAorIDA6IDEyMzQ1Njc4OTAKKyAgICAxMjM0NTY3OGFiCisgMDogMTIzNDU2NzhhYgorICAgIDEyM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bYS16QS1aXVthLXpBLVpdW2EtekEtWl0gK1swLTldP1swLTldICtbMC05XVswLTldOlswLTldWzAtOV0vCisgICAgRnJvbSBhYmNkICBNb24gU2VwIDAxIDEyOjMzOjAyIDE5OTcKKyAwOiBGcm9tIGFiY2QgIE1vbiBTZXAgMDEgMTI6MzMKKyAxOiBhYmNkCisKKy9eRnJvbVxzK1xTK1xzKyhbYS16QS1aXXszfVxzKyl7Mn1bMC05XXsxLDJ9XHMrWzAtOV1bMC05XTpbMC05XVswLTldLworICAgIEZyb20gYWJjZCAgTW9uIFNlcCAwMSAxMjozMzowMiAxOTk3CisgMDogRnJvbSBhYmNkICBNb24gU2VwIDAxIDEyOjMzCisgMTogU2VwIAorICAgIEZyb20gYWJjZCAgTW9uIFNlcCAgMSAxMjozMzowMiAxOTk3CisgMDogRnJvbSBhYmNkICBNb24gU2VwICAxIDEyOjMzCisgMTogU2VwICAKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBGcm9tIGFiY2QgIFNlcCAwMSAxMjozMzowMiAxOTk3CitObyBtYXRjaAorCisvXihhKVwxezIsM30oLikvCisgICAgYWFhYgorIDA6IGFhYWIKKyAxOiBhCisgMjogYgorICAgIGFhYWFiCisgMDogYWFhYWIKKyAxOiBhCisgMjogYgorICAgIGFhYWFhYgorIDA6IGFhYWFhCisgMTogYQorIDI6IGEKKyAgICBhYWFhYWFiCisgMDogYWFhYWEKKyAxOiBhCisgMjogYQorCisvXlthYl17MSwzfShhYip8YikvCisgICAgYWFiYmJiYgorIDA6IGFhYmJiYmIKKyAxOiBhYmJiYmIKKworL14oY293fClcMShiZWxsKS8KKyAgICBjb3djb3diZWxsCisgMDogY293Y293YmVsbAorIDE6IGNvdworIDI6IGJlbGwKKyAgICBiZWxsCisgMDogYmVsbAorIDE6IAorIDI6IGJlbGwKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBjb3diZWxsCitObyBtYXRjaAorCisvXihhfClcMStiLworICAgIGFhYgorIDA6IGFhYgorIDE6IGEKKyAgICBhYWFhYgorIDA6IGFhYWFiCisgMTogYQorICAgIGIKKyAwOiBiCisgMTogCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWIKK05vIG1hdGNoCisKKy9eKGF8KVwxezJ9Yi8KKyAgICBhYWFiCisgMDogYWFhYgorIDE6IGEKKyAgICBiCisgMDogYgorIDE6IAorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiCitObyBtYXRjaAorICAgIGFhYgorTm8gbWF0Y2gKKyAgICBhYWFhYgorTm8gbWF0Y2gKKworL14oYXwpXDF7MiwzfWIvCisgICAgYWFhYgorIDA6IGFhYWIKKyAxOiBhCisgICAgYWFhYWIKKyAwOiBhYWFhYgorIDE6IGEKKyAgICBiCisgMDogYgorIDE6IAorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiCitObyBtYXRjaAorICAgIGFhYgorTm8gbWF0Y2gKKyAgICBhYWFhYWIKK05vIG1hdGNoCisKKy9hYnsxLDN9YmMvCisgICAgYWJiYmJjCisgMDogYWJiYmJjCisgICAgYWJiYmMKKyAwOiBhYmJiYworICAgIGFiYmMKKyAwOiBhYmJjCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWJjCitObyBtYXRjaAorICAgIGFiYmJiYmMKK05vIG1hdGNoCisKKy8oW14uXSopXC4oW146XSopOltUIF0rKC4qKS8KKyAgICB0cmFjazEudGl0bGU6VEJsYWggYmxhaCBibGFoCisgMDogdHJhY2sxLnRpdGxlOlRCbGFoIGJsYWggYmxhaAorIDE6IHRyYWNrMQorIDI6IHRpdGxlCisgMzogQmxhaCBibGFoIGJsYWgKKworLyhbXi5dKilcLihbXjpdKik6W1QgXSsoLiopL2kKKyAgICB0cmFjazEudGl0bGU6VEJsYWggYmxhaCBibGFoCisgMDogdHJhY2sxLnRpdGxlOlRCbGFoIGJsYWggYmxhaAorIDE6IHRyYWNrMQorIDI6IHRpdGxlCisgMzogQmxhaCBibGFoIGJsYWgKKworLyhbXi5dKilcLihbXjpdKik6W3QgXSsoLiopL2kKKyAgICB0cmFjazEudGl0bGU6VEJsYWggYmxhaCBibGFoCisgMDogdHJhY2sxLnRpdGxlOlRCbGFoIGJsYWggYmxhaAorIDE6IHRyYWNrMQorIDI6IHRpdGxlCisgMzogQmxhaCBibGFoIGJsYWgKKworL15hYmMkLworICAgIGFiYworIDA6IGFiYworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorCisvWy1hel0rLworICAgIGF6LQorIDA6IGF6LQorICAgICoqKiBGYWlsZXJzCisgMDogYQorICAgIGIKK05vIG1hdGNoCisKKy9bYXotXSsvCisgICAgemEtCisgMDogemEtCisgICAgKioqIEZhaWxlcnMKKyAwOiBhCisgICAgYgorTm8gbWF0Y2gKKworL1thLXpdKy8KKyAgICBhYmNkeHl6CisgMDogYWJjZHh5egorCisvWzAtOS1dKy8KKyAgICAxMi0zNAorIDA6IDEyLTM0CisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWFhCitObyBtYXRjaAorCisvKGFiYylcMS9pCisgICAgYWJjYWJjCisgMDogYWJjYWJjCisgMTogYWJjCisgICAgQUJDYWJjCisgMDogQUJDYWJjCisgMTogQUJDCisgICAgYWJjQUJDCisgMDogYWJjQUJDCisgMTogYWJjCisKKy9hezB9YmMvCisgICAgYmMKKyAwOiBiYworCisvXihbXmFdKShbXmJdKShbXmNdKikoW15kXXszLDR9KS8KKyAgICBiYU5PVGNjY2NkCisgMDogYmFOT1RjY2NjCisgMTogYgorIDI6IGEKKyAzOiBOT1QKKyA0OiBjY2NjCisgICAgYmFOT1RjY2NkCisgMDogYmFOT1RjY2MKKyAxOiBiCisgMjogYQorIDM6IE5PVAorIDQ6IGNjYworICAgIGJhTk9UY2NkCisgMDogYmFOT1RjYworIDE6IGIKKyAyOiBhCisgMzogTk8KKyA0OiBUY2MKKyAgICBiYWNjY2QKKyAwOiBiYWNjYworIDE6IGIKKyAyOiBhCisgMzogCisgNDogY2NjCisgICAgKioqIEZhaWxlcnMKKyAwOiAqKiogRmFpbGVycworIDE6ICoKKyAyOiAqCisgMzogKiBGYWlsCisgNDogZXJzCisgICAgYW55dGhpbmcKK05vIG1hdGNoCisgICAgYmFjY2QKK05vIG1hdGNoCisKKy9bXmFdLworICAgIEFiYworIDA6IEEKKworL1teYV0vaQorICAgIEFiYyAKKyAwOiBiCisKKy9bXmFdKy8KKyAgICBBQUFhQWJjCisgMDogQUFBCisKKy9bXmFdKy9pCisgICAgQUFBYUFiYworIDA6IGJjCisKKy9bXmtdJC8KKyAgICBhYmMKKyAwOiBjCisgICAgKioqIEZhaWxlcnMKKyAwOiBzCisgICAgYWJrCitObyBtYXRjaAorCisvW15rXXsyLDN9JC8KKyAgICBhYmMKKyAwOiBhYmMKKyAgICBrYmMKKyAwOiBiYworICAgIGthYmMKKyAwOiBhYmMKKyAgICAqKiogRmFpbGVycworIDA6IGVycworICAgIGFiaworTm8gbWF0Y2gKKyAgICBha2IKK05vIG1hdGNoCisgICAgYWtrIAorTm8gbWF0Y2gKKworL15bMC05XXs4LH1ALitbXmtdJC8KKyAgICAxMjM0NTY3OEBhLmIuYy5kCisgMDogMTIzNDU2NzhAYS5iLmMuZAorICAgIDEyMzQ1Njc4OUB4LnkuegorIDA6IDEyMzQ1Njc4OUB4LnkuegorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIDEyMzQ1Njc4QHgueS51aworTm8gbWF0Y2gKKyAgICAxMjM0NTY3QGEuYi5jLmQgICAgICAgCitObyBtYXRjaAorCisvKGEpXDF7OCx9LworICAgIGFhYWFhYWFhYQorIDA6IGFhYWFhYWFhYQorIDE6IGEKKyAgICBhYWFhYWFhYWFhCisgMDogYWFhYWFhYWFhYQorIDE6IGEKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYWFhYWFhICAgCitObyBtYXRjaAorCisvW15hXS8KKyAgICBhYWFhYmNkCisgMDogYgorICAgIGFhQWFiY2QgCisgMDogQQorCisvW15hXS9pCisgICAgYWFhYWJjZAorIDA6IGIKKyAgICBhYUFhYmNkIAorIDA6IGIKKworL1teYXpdLworICAgIGFhYWFiY2QKKyAwOiBiCisgICAgYWFBYWJjZCAKKyAwOiBBCisKKy9bXmF6XS9pCisgICAgYWFhYWJjZAorIDA6IGIKKyAgICBhYUFhYmNkIAorIDA6IGIKKworL1BbXipdVEFJUkVbXipdezEsNn1MTC8KKyAgICB4eHh4eHh4eHh4eFBTVEFJUkVJU0xMeHh4eHh4eHh4CisgMDogUFNUQUlSRUlTTEwKKworL1BbXipdVEFJUkVbXipdezEsfUxMLworICAgIHh4eHh4eHh4eHh4UFNUQUlSRUlTTEx4eHh4eHh4eHgKKyAwOiBQU1RBSVJFSVNMTAorCisvKFwuWzAtOV1bMC05XVsxLTldPylbMC05XSsvCisgICAgMS4yMzAwMDM5MzgKKyAwOiAuMjMwMDAzOTM4CisgMTogLjIzCisgICAgMS44NzUwMDAyODIgICAKKyAwOiAuODc1MDAwMjgyCisgMTogLjg3NQorICAgIDEuMjM1ICAKKyAwOiAuMjM1CisgMTogLjIzCisgICAgICAgICAgICAgICAgICAKKy9cYihmb28pXHMrKFx3KykvaQorICAgIEZvb2QgaXMgb24gdGhlIGZvbyB0YWJsZQorIDA6IGZvbyB0YWJsZQorIDE6IGZvbworIDI6IHRhYmxlCisgICAgCisvZm9vKC4qKWJhci8KKyAgICBUaGUgZm9vZCBpcyB1bmRlciB0aGUgYmFyIGluIHRoZSBiYXJuLgorIDA6IGZvb2QgaXMgdW5kZXIgdGhlIGJhciBpbiB0aGUgYmFyCisgMTogZCBpcyB1bmRlciB0aGUgYmFyIGluIHRoZSAKKyAgICAKKy8oLiopKFswLTldKikvCisgICAgSSBoYXZlIDIgbnVtYmVyczogNTMxNDcKKyAwOiBJIGhhdmUgMiBudW1iZXJzOiA1MzE0NworIDE6IEkgaGF2ZSAyIG51bWJlcnM6IDUzMTQ3CisgMjogCisgICAgCisvKC4qKShbMC05XSspLworICAgIEkgaGF2ZSAyIG51bWJlcnM6IDUzMTQ3CisgMDogSSBoYXZlIDIgbnVtYmVyczogNTMxNDcKKyAxOiBJIGhhdmUgMiBudW1iZXJzOiA1MzE0CisgMjogNworCisvKC4qKShbMC05XSspJC8KKyAgICBJIGhhdmUgMiBudW1iZXJzOiA1MzE0NworIDA6IEkgaGF2ZSAyIG51bWJlcnM6IDUzMTQ3CisgMTogSSBoYXZlIDIgbnVtYmVyczogNTMxNAorIDI6IDcKKworLyguKilcYihbMC05XSspJC8KKyAgICBJIGhhdmUgMiBudW1iZXJzOiA1MzE0NworIDA6IEkgaGF2ZSAyIG51bWJlcnM6IDUzMTQ3CisgMTogSSBoYXZlIDIgbnVtYmVyczogCisgMjogNTMxNDcKKworLyguKlteMC05XSkoWzAtOV0rKSQvCisgICAgSSBoYXZlIDIgbnVtYmVyczogNTMxNDcKKyAwOiBJIGhhdmUgMiBudW1iZXJzOiA1MzE0NworIDE6IEkgaGF2ZSAyIG51bWJlcnM6IAorIDI6IDUzMTQ3CisKKy9bWzpkaWdpdDpdXVtbOmRpZ2l0Ol1dXC9bWzpkaWdpdDpdXVtbOmRpZ2l0Ol1dXC9bWzpkaWdpdDpdXVtbOmRpZ2l0Ol1dW1s6ZGlnaXQ6XV1bWzpkaWdpdDpdXS8KKyAgICAwMS8wMS8yMDAwCisgMDogMDEvMDEvMjAwMAorCisvXihhKXswLDB9LworICAgIGJjZAorIDA6IAorICAgIGFiYworIDA6IAorICAgIGFhYiAgICAgCisgMDogCisKKy9eKGEpezAsMX0vCisgICAgYmNkCisgMDogCisgICAgYWJjCisgMDogYQorIDE6IGEKKyAgICBhYWIgIAorIDA6IGEKKyAxOiBhCisKKy9eKGEpezAsMn0vCisgICAgYmNkCisgMDogCisgICAgYWJjCisgMDogYQorIDE6IGEKKyAgICBhYWIgIAorIDA6IGFhCisgMTogYQorCisvXihhKXswLDN9LworICAgIGJjZAorIDA6IAorICAgIGFiYworIDA6IGEKKyAxOiBhCisgICAgYWFiCisgMDogYWEKKyAxOiBhCisgICAgYWFhICAgCisgMDogYWFhCisgMTogYQorCisvXihhKXswLH0vCisgICAgYmNkCisgMDogCisgICAgYWJjCisgMDogYQorIDE6IGEKKyAgICBhYWIKKyAwOiBhYQorIDE6IGEKKyAgICBhYWEKKyAwOiBhYWEKKyAxOiBhCisgICAgYWFhYWFhYWEgICAgCisgMDogYWFhYWFhYWEKKyAxOiBhCisKKy9eKGEpezEsMX0vCisgICAgYmNkCitObyBtYXRjaAorICAgIGFiYworIDA6IGEKKyAxOiBhCisgICAgYWFiICAKKyAwOiBhCisgMTogYQorCisvXihhKXsxLDJ9LworICAgIGJjZAorTm8gbWF0Y2gKKyAgICBhYmMKKyAwOiBhCisgMTogYQorICAgIGFhYiAgCisgMDogYWEKKyAxOiBhCisKKy9eKGEpezEsM30vCisgICAgYmNkCitObyBtYXRjaAorICAgIGFiYworIDA6IGEKKyAxOiBhCisgICAgYWFiCisgMDogYWEKKyAxOiBhCisgICAgYWFhICAgCisgMDogYWFhCisgMTogYQorCisvXihhKXsxLH0vCisgICAgYmNkCitObyBtYXRjaAorICAgIGFiYworIDA6IGEKKyAxOiBhCisgICAgYWFiCisgMDogYWEKKyAxOiBhCisgICAgYWFhCisgMDogYWFhCisgMTogYQorICAgIGFhYWFhYWFhICAgIAorIDA6IGFhYWFhYWFhCisgMTogYQorCisvXlswLTldWzAtOV1bMC05XVswLTldWzAtOV1bMC05XVswLTldWzAtOV1bMC05XVswLTldWzAtOV1bMC05XS8KKyAgICAxMjM0NTY2NTQzMjEKKyAwOiAxMjM0NTY2NTQzMjEKKworL15bWzpkaWdpdDpdXVtbOmRpZ2l0Ol1dW1s6ZGlnaXQ6XV1bWzpkaWdpdDpdXVtbOmRpZ2l0Ol1dW1s6ZGlnaXQ6XV1bWzpkaWdpdDpdXVtbOmRpZ2l0Ol1dW1s6ZGlnaXQ6XV1bWzpkaWdpdDpdXVtbOmRpZ2l0Ol1dW1s6ZGlnaXQ6XV0vCisgICAgMTIzNDU2NjU0MzIxIAorIDA6IDEyMzQ1NjY1NDMyMQorCisvXlthYmNdezEyfS8KKyAgICBhYmNhYmNhYmNhYmMKKyAwOiBhYmNhYmNhYmNhYmMKKyAgICAKKy9eW2EtY117MTJ9LworICAgIGFiY2FiY2FiY2FiYworIDA6IGFiY2FiY2FiY2FiYworICAgIAorL14oYXxifGMpezEyfS8KKyAgICBhYmNhYmNhYmNhYmMgCisgMDogYWJjYWJjYWJjYWJjCisgMTogYworCisvXlthYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5MDEyMzQ1Njc4OV0vCisgICAgbgorIDA6IG4KKyAgICAqKiogRmFpbGVycyAKK05vIG1hdGNoCisgICAgeiAKK05vIG1hdGNoCisKKy9hYmNkZXswLDB9LworICAgIGFiY2QKKyAwOiBhYmNkCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWJjZSAgCitObyBtYXRjaAorCisvYWJbY2RdezAsMH1lLworICAgIGFiZQorIDA6IGFiZQorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiY2RlIAorTm8gbWF0Y2gKKyAgICAKKy9hYihjKXswLDB9ZC8KKyAgICBhYmQKKyAwOiBhYmQKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYmNkICAgCitObyBtYXRjaAorCisvYShiKikvCisgICAgYQorIDA6IGEKKyAxOiAKKyAgICBhYgorIDA6IGFiCisgMTogYgorICAgIGFiYmJiCisgMDogYWJiYmIKKyAxOiBiYmJiCisgICAgKioqIEZhaWxlcnMKKyAwOiBhCisgMTogCisgICAgYmJiYmIgICAgCitObyBtYXRjaAorICAgIAorL2FiWzAtOV17MH1lLworICAgIGFiZQorIDA6IGFiZQorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiMWUgICAKK05vIG1hdGNoCisgICAgCisvKEF8QikqQ0QvCisgICAgQ0QgCisgMDogQ0QKKworLyhBQikqXDEvCisgICAgQUJBQkFCCisgMDogQUJBQkFCCisgMTogQUIKKyAgICAKKy8oWzAtOV0rKShcdykvCisgICAgMTIzNDVhCisgMDogMTIzNDVhCisgMTogMTIzNDUKKyAyOiBhCisgICAgMTIzNDUrIAorIDA6IDEyMzQ1CisgMTogMTIzNAorIDI6IDUKKworLyhhYmN8KSsvCisgICAgYWJjCisgMDogYWJjCisgMTogYWJjCisgICAgYWJjYWJjCisgMDogYWJjYWJjCisgMTogYWJjCisgICAgYWJjYWJjYWJjCisgMDogYWJjYWJjYWJjCisgMTogYWJjCisgICAgeHl6ICAgICAgCisgMDogCisgMTogCisKKy8oW2FdKikqLworICAgIGEKKyAwOiBhCisgMTogYQorICAgIGFhYWFhIAorIDA6IGFhYWFhCisgMTogYWFhYWEKKworLyhbYWJdKikqLworICAgIGEKKyAwOiBhCisgMTogYQorICAgIGIKKyAwOiBiCisgMTogYgorICAgIGFiYWJhYgorIDA6IGFiYWJhYgorIDE6IGFiYWJhYgorICAgIGFhYWFiY2RlCisgMDogYWFhYWIKKyAxOiBhYWFhYgorICAgIGJiYmIgICAgCisgMDogYmJiYgorIDE6IGJiYmIKKworLyhbXmFdKikqLworICAgIGIKKyAwOiBiCisgMTogYgorICAgIGJiYmIKKyAwOiBiYmJiCisgMTogYmJiYgorICAgIGFhYSAgIAorIDA6IAorCisvKFteYWJdKikqLworICAgIGNjY2MKKyAwOiBjY2NjCisgMTogY2NjYworICAgIGFiYWIgIAorIDA6IAorCisvYWJjLworICAgIGFiYworIDA6IGFiYworICAgIHhhYmN5CisgMDogYWJjCisgICAgYWJhYmMKKyAwOiBhYmMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICB4YmMKK05vIG1hdGNoCisgICAgYXhjCitObyBtYXRjaAorICAgIGFieAorTm8gbWF0Y2gKKworL2FiKmMvCisgICAgYWJjCisgMDogYWJjCisKKy9hYipiYy8KKyAgICBhYmMKKyAwOiBhYmMKKyAgICBhYmJjCisgMDogYWJiYworICAgIGFiYmJiYworIDA6IGFiYmJiYworCisvLnsxfS8KKyAgICBhYmJiYmMKKyAwOiBhCisKKy8uezMsNH0vCisgICAgYWJiYmJjCisgMDogYWJiYgorCisvYWJ7MCx9YmMvCisgICAgYWJiYmJjCisgMDogYWJiYmJjCisKKy9hYitiYy8KKyAgICBhYmJjCisgMDogYWJiYworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiYworTm8gbWF0Y2gKKyAgICBhYnEKK05vIG1hdGNoCisKKy9hYitiYy8KKyAgICBhYmJiYmMKKyAwOiBhYmJiYmMKKworL2FiezEsfWJjLworICAgIGFiYmJiYworIDA6IGFiYmJiYworCisvYWJ7MSwzfWJjLworICAgIGFiYmJiYworIDA6IGFiYmJiYworCisvYWJ7Myw0fWJjLworICAgIGFiYmJiYworIDA6IGFiYmJiYworCisvYWJ7NCw1fWJjLworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFicQorTm8gbWF0Y2gKKyAgICBhYmJiYmMKK05vIG1hdGNoCisKKy9hYj9iYy8KKyAgICBhYmJjCisgMDogYWJiYworICAgIGFiYworIDA6IGFiYworCisvYWJ7MCwxfWJjLworICAgIGFiYworIDA6IGFiYworCisvYWI/Yy8KKyAgICBhYmMKKyAwOiBhYmMKKworL2FiezAsMX1jLworICAgIGFiYworIDA6IGFiYworCisvXmFiYyQvCisgICAgYWJjCisgMDogYWJjCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWJiYmJjCitObyBtYXRjaAorICAgIGFiY2MKK05vIG1hdGNoCisKKy9eYWJjLworICAgIGFiY2MKKyAwOiBhYmMKKworL2FiYyQvCisgICAgYWFiYworIDA6IGFiYworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFhYmMKKyAwOiBhYmMKKyAgICBhYWJjZAorTm8gbWF0Y2gKKworL14vCisgICAgYWJjCisgMDogCisKKy8kLworICAgIGFiYworIDA6IAorCisvYS5jLworICAgIGFiYworIDA6IGFiYworICAgIGF4YworIDA6IGF4YworCisvYS4qYy8KKyAgICBheHl6YworIDA6IGF4eXpjCisKKy9hW2JjXWQvCisgICAgYWJkCisgMDogYWJkCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYXh5emQKK05vIG1hdGNoCisgICAgYWJjCitObyBtYXRjaAorCisvYVtiLWRdZS8KKyAgICBhY2UKKyAwOiBhY2UKKworL2FbYi1kXS8KKyAgICBhYWMKKyAwOiBhYworCisvYVstYl0vCisgICAgYS0KKyAwOiBhLQorCisvYVtiLV0vCisgICAgYS0KKyAwOiBhLQorCisvYVtdXWIvCisgICAgYV1iCisgMDogYV1iCisKKy9hW15iY11kLworICAgIGFlZAorIDA6IGFlZAorICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFiZAorTm8gbWF0Y2gKKyAgICBhYmQKK05vIG1hdGNoCisKKy9hW14tYl1jLworICAgIGFkYworIDA6IGFkYworCisvYVteXWJdYy8KKyAgICBhZGMKKyAwOiBhZGMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhLWMKKyAwOiBhLWMKKyAgICBhXWMKK05vIG1hdGNoCisKKy9cYmFcYi8KKyAgICBhLQorIDA6IGEKKyAgICAtYQorIDA6IGEKKyAgICAtYS0KKyAwOiBhCisKKy9cYnlcYi8KKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICB4eQorTm8gbWF0Y2gKKyAgICB5egorTm8gbWF0Y2gKKyAgICB4eXoKK05vIG1hdGNoCisKKy9cQmFcQi8KKyAgICAqKiogRmFpbGVycworIDA6IGEKKyAgICBhLQorTm8gbWF0Y2gKKyAgICAtYQorTm8gbWF0Y2gKKyAgICAtYS0KK05vIG1hdGNoCisKKy9cQnlcYi8KKyAgICB4eQorIDA6IHkKKworL1xieVxCLworICAgIHl6CisgMDogeQorCisvXEJ5XEIvCisgICAgeHl6CisgMDogeQorCisvXHcvCisgICAgYQorIDA6IGEKKworL1xXLworICAgIC0KKyAwOiAtCisgICAgKioqIEZhaWxlcnMKKyAwOiAqCisgICAgLQorIDA6IC0KKyAgICBhCitObyBtYXRjaAorCisvYVxzYi8KKyAgICBhIGIKKyAwOiBhIGIKKworL2FcU2IvCisgICAgYS1iCisgMDogYS1iCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYS1iCisgMDogYS1iCisgICAgYSBiCitObyBtYXRjaAorCisvWzAtOV0vCisgICAgMQorIDA6IDEKKworL1teMC05XS8KKyAgICAtCisgMDogLQorICAgICoqKiBGYWlsZXJzCisgMDogKgorICAgIC0KKyAwOiAtCisgICAgMQorTm8gbWF0Y2gKKworL2FifGNkLworICAgIGFiYworIDA6IGFiCisgICAgYWJjZAorIDA6IGFiCisKKy8oKWVmLworICAgIGRlZgorIDA6IGVmCisgMTogCisKKy9hXChiLworICAgIGEoYgorIDA6IGEoYgorCisvYVwoKmIvCisgICAgYWIKKyAwOiBhYgorICAgIGEoKGIKKyAwOiBhKChiCisKKy8oKGEpKS8KKyAgICBhYmMKKyAwOiBhCisgMTogYQorIDI6IGEKKworLyhhKWIoYykvCisgICAgYWJjCisgMDogYWJjCisgMTogYQorIDI6IGMKKworL2ErYitjLworICAgIGFhYmJhYmMKKyAwOiBhYmMKKworL2F7MSx9YnsxLH1jLworICAgIGFhYmJhYmMKKyAwOiBhYmMKKworLyhhK3xiKSovCisgICAgYWIKKyAwOiBhYgorIDE6IGIKKworLyhhK3xiKXswLH0vCisgICAgYWIKKyAwOiBhYgorIDE6IGIKKworLyhhK3xiKSsvCisgICAgYWIKKyAwOiBhYgorIDE6IGIKKworLyhhK3xiKXsxLH0vCisgICAgYWIKKyAwOiBhYgorIDE6IGIKKworLyhhK3xiKT8vCisgICAgYWIKKyAwOiBhCisgMTogYQorCisvKGErfGIpezAsMX0vCisgICAgYWIKKyAwOiBhCisgMTogYQorCisvW15hYl0qLworICAgIGNkZQorIDA6IGNkZQorCisvYWJjLworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGIKK05vIG1hdGNoCisgICAgCisKKy9hKi8KKyAgICAKKworLyhbYWJjXSkqZC8KKyAgICBhYmJiY2QKKyAwOiBhYmJiY2QKKyAxOiBjCisKKy8oW2FiY10pKmJjZC8KKyAgICBhYmNkCisgMDogYWJjZAorIDE6IGEKKworL2F8YnxjfGR8ZS8KKyAgICBlCisgMDogZQorCisvKGF8YnxjfGR8ZSlmLworICAgIGVmCisgMDogZWYKKyAxOiBlCisKKy9hYmNkKmVmZy8KKyAgICBhYmNkZWZnCisgMDogYWJjZGVmZworCisvYWIqLworICAgIHhhYnlhYmJiegorIDA6IGFiCisgICAgeGF5YWJiYnoKKyAwOiBhCisKKy8oYWJ8Y2QpZS8KKyAgICBhYmNkZQorIDA6IGNkZQorIDE6IGNkCisKKy9bYWJoZ2VmZGNdaWovCisgICAgaGlqCisgMDogaGlqCisKKy8oYWJjfCllZi8KKyAgICBhYmNkZWYKKyAwOiBlZgorIDE6IAorCisvKGF8YiljKmQvCisgICAgYWJjZAorIDA6IGJjZAorIDE6IGIKKworLyhhYnxhYiopYmMvCisgICAgYWJjCisgMDogYWJjCisgMTogYQorCisvYShbYmNdKiljKi8KKyAgICBhYmMKKyAwOiBhYmMKKyAxOiBiYworCisvYShbYmNdKikoYypkKS8KKyAgICBhYmNkCisgMDogYWJjZAorIDE6IGJjCisgMjogZAorCisvYShbYmNdKykoYypkKS8KKyAgICBhYmNkCisgMDogYWJjZAorIDE6IGJjCisgMjogZAorCisvYShbYmNdKikoYytkKS8KKyAgICBhYmNkCisgMDogYWJjZAorIDE6IGIKKyAyOiBjZAorCisvYVtiY2RdKmRjZGNkZS8KKyAgICBhZGNkY2RlCisgMDogYWRjZGNkZQorCisvYVtiY2RdK2RjZGNkZS8KKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBhYmNkZQorTm8gbWF0Y2gKKyAgICBhZGNkY2RlCitObyBtYXRjaAorCisvKGFifGEpYipjLworICAgIGFiYworIDA6IGFiYworIDE6IGFiCisKKy8oKGEpKGIpYykoZCkvCisgICAgYWJjZAorIDA6IGFiY2QKKyAxOiBhYmMKKyAyOiBhCisgMzogYgorIDQ6IGQKKworL1thLXpBLVpfXVthLXpBLVowLTlfXSovCisgICAgYWxwaGEKKyAwOiBhbHBoYQorCisvXmEoYmMrfGJbZWhdKWd8LmgkLworICAgIGFiaAorIDA6IGJoCisKKy8oYmMrZCR8ZWYqZy58aD9pKGp8aykpLworICAgIGVmZmd6CisgMDogZWZmZ3oKKyAxOiBlZmZnegorICAgIGlqCisgMDogaWoKKyAxOiBpagorIDI6IGoKKyAgICByZWZmZ3oKKyAwOiBlZmZnegorIDE6IGVmZmd6CisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgZWZmZworTm8gbWF0Y2gKKyAgICBiY2RkCitObyBtYXRjaAorCisvKCgoKCgoKCgoKGEpKSkpKSkpKSkpLworICAgIGEKKyAwOiBhCisgMTogYQorIDI6IGEKKyAzOiBhCisgNDogYQorIDU6IGEKKyA2OiBhCisgNzogYQorIDg6IGEKKyA5OiBhCisxMDogYQorCisvKCgoKCgoKCgoKGEpKSkpKSkpKSkpXDkvCisgICAgYWEKKyAwOiBhYQorIDE6IGEKKyAyOiBhCisgMzogYQorIDQ6IGEKKyA1OiBhCisgNjogYQorIDc6IGEKKyA4OiBhCisgOTogYQorMTA6IGEKKworLygoKCgoKCgoKGEpKSkpKSkpKSkvCisgICAgYQorIDA6IGEKKyAxOiBhCisgMjogYQorIDM6IGEKKyA0OiBhCisgNTogYQorIDY6IGEKKyA3OiBhCisgODogYQorIDk6IGEKKworL211bHRpcGxlIHdvcmRzIG9mIHRleHQvCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgYWEKK05vIG1hdGNoCisgICAgdWgtdWgKK05vIG1hdGNoCisKKy9tdWx0aXBsZSB3b3Jkcy8KKyAgICBtdWx0aXBsZSB3b3JkcywgeWVhaAorIDA6IG11bHRpcGxlIHdvcmRzCisKKy8oLiopYyguKikvCisgICAgYWJjZGUKKyAwOiBhYmNkZQorIDE6IGFiCisgMjogZGUKKworL1woKC4qKSwgKC4qKVwpLworICAgIChhLCBiKQorIDA6IChhLCBiKQorIDE6IGEKKyAyOiBiCisKKy9hYmNkLworICAgIGFiY2QKKyAwOiBhYmNkCisKKy9hKGJjKWQvCisgICAgYWJjZAorIDA6IGFiY2QKKyAxOiBiYworCisvYVstXT9jLworICAgIGFjCisgMDogYWMKKworLyhhYmMpXDEvCisgICAgYWJjYWJjCisgMDogYWJjYWJjCisgMTogYWJjCisKKy8oW2EtY10qKVwxLworICAgIGFiY2FiYworIDA6IGFiY2FiYworIDE6IGFiYworCisvKGEpfFwxLworICAgIGEKKyAwOiBhCisgMTogYQorICAgICoqKiBGYWlsZXJzCisgMDogYQorIDE6IGEKKyAgICBhYgorIDA6IGEKKyAxOiBhCisgICAgeAorTm8gbWF0Y2gKKworL2FiYy9pCisgICAgQUJDCisgMDogQUJDCisgICAgWEFCQ1kKKyAwOiBBQkMKKyAgICBBQkFCQworIDA6IEFCQworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIGFheGFieGJheGJieAorTm8gbWF0Y2gKKyAgICBYQkMKK05vIG1hdGNoCisgICAgQVhDCitObyBtYXRjaAorICAgIEFCWAorTm8gbWF0Y2gKKworL2FiKmMvaQorICAgIEFCQworIDA6IEFCQworCisvYWIqYmMvaQorICAgIEFCQworIDA6IEFCQworICAgIEFCQkMKKyAwOiBBQkJDCisKKy9hYitiYy9pCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgQUJDCitObyBtYXRjaAorICAgIEFCUQorTm8gbWF0Y2gKKworL2FiK2JjL2kKKyAgICBBQkJCQkMKKyAwOiBBQkJCQkMKKworL15hYmMkL2kKKyAgICBBQkMKKyAwOiBBQkMKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBBQkJCQkMKK05vIG1hdGNoCisgICAgQUJDQworTm8gbWF0Y2gKKworL15hYmMvaQorICAgIEFCQ0MKKyAwOiBBQkMKKworL2FiYyQvaQorICAgIEFBQkMKKyAwOiBBQkMKKworL14vaQorICAgIEFCQworIDA6IAorCisvJC9pCisgICAgQUJDCisgMDogCisKKy9hLmMvaQorICAgIEFCQworIDA6IEFCQworICAgIEFYQworIDA6IEFYQworCisvYS4qYy9pCisgICAgKioqIEZhaWxlcnMKK05vIG1hdGNoCisgICAgQUFCQworIDA6IEFBQkMKKyAgICBBWFlaRAorTm8gbWF0Y2gKKworL2FbYmNdZC9pCisgICAgQUJECisgMDogQUJECisKKy9hW2ItZF1lL2kKKyAgICBBQ0UKKyAwOiBBQ0UKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBBQkMKK05vIG1hdGNoCisgICAgQUJECitObyBtYXRjaAorCisvYVtiLWRdL2kKKyAgICBBQUMKKyAwOiBBQworCisvYVstYl0vaQorICAgIEEtCisgMDogQS0KKworL2FbYi1dL2kKKyAgICBBLQorIDA6IEEtCisKKy9hW11dYi9pCisgICAgQV1CCisgMDogQV1CCisKKy9hW15iY11kL2kKKyAgICBBRUQKKyAwOiBBRUQKKworL2FbXi1iXWMvaQorICAgIEFEQworIDA6IEFEQworICAgICoqKiBGYWlsZXJzCitObyBtYXRjaAorICAgIEFCRAorTm8gbWF0Y2gKKyAgICBBLUMKK05vIG1hdGNoCisKKy9hW15dYl1jL2kKKyAgICBBREMKKyAwOiBBREMKKworL2FifGNkL2kKKyAgICBBQkMKKyAwOiBBQgorICAgIEFCQ0QKKyAwOiBBQgorCisvKCllZi9pCisgICAgREVGCisgMDogRUYKKyAxOiAKKworLyRiL2kKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBBXUMKK05vIG1hdGNoCisgICAgQgorTm8gbWF0Y2gKKworL2FcKGIvaQorICAgIEEoQgorIDA6IEEoQgorCisvYVwoKmIvaQorICAgIEFCCisgMDogQUIKKyAgICBBKChCCisgMDogQSgoQgorCisvKChhKSkvaQorICAgIEFCQworIDA6IEEKKyAxOiBBCisgMjogQQorCisvKGEpYihjKS9pCisgICAgQUJDCisgMDogQUJDCisgMTogQQorIDI6IEMKKworL2ErYitjL2kKKyAgICBBQUJCQUJDCisgMDogQUJDCisKKy9hezEsfWJ7MSx9Yy9pCisgICAgQUFCQkFCQworIDA6IEFCQworCisvKGErfGIpKi9pCisgICAgQUIKKyAwOiBBQgorIDE6IEIKKworLyhhK3xiKXswLH0vaQorICAgIEFCCisgMDogQUIKKyAxOiBCCisKKy8oYSt8YikrL2kKKyAgICBBQgorIDA6IEFCCisgMTogQgorCisvKGErfGIpezEsfS9pCisgICAgQUIKKyAwOiBBQgorIDE6IEIKKworLyhhK3xiKT8vaQorICAgIEFCCisgMDogQQorIDE6IEEKKworLyhhK3xiKXswLDF9L2kKKyAgICBBQgorIDA6IEEKKyAxOiBBCisKKy9bXmFiXSovaQorICAgIENERQorIDA6IENERQorCisvKFthYmNdKSpkL2kKKyAgICBBQkJCQ0QKKyAwOiBBQkJCQ0QKKyAxOiBDCisKKy8oW2FiY10pKmJjZC9pCisgICAgQUJDRAorIDA6IEFCQ0QKKyAxOiBBCisKKy9hfGJ8Y3xkfGUvaQorICAgIEUKKyAwOiBFCisKKy8oYXxifGN8ZHxlKWYvaQorICAgIEVGCisgMDogRUYKKyAxOiBFCisKKy9hYmNkKmVmZy9pCisgICAgQUJDREVGRworIDA6IEFCQ0RFRkcKKworL2FiKi9pCisgICAgWEFCWUFCQkJaCisgMDogQUIKKyAgICBYQVlBQkJCWgorIDA6IEEKKworLyhhYnxjZCllL2kKKyAgICBBQkNERQorIDA6IENERQorIDE6IENECisKKy9bYWJoZ2VmZGNdaWovaQorICAgIEhJSgorIDA6IEhJSgorCisvXihhYnxjZCllL2kKKyAgICBBQkNERQorTm8gbWF0Y2gKKworLyhhYmN8KWVmL2kKKyAgICBBQkNERUYKKyAwOiBFRgorIDE6IAorCisvKGF8YiljKmQvaQorICAgIEFCQ0QKKyAwOiBCQ0QKKyAxOiBCCisKKy8oYWJ8YWIqKWJjL2kKKyAgICBBQkMKKyAwOiBBQkMKKyAxOiBBCisKKy9hKFtiY10qKWMqL2kKKyAgICBBQkMKKyAwOiBBQkMKKyAxOiBCQworCisvYShbYmNdKikoYypkKS9pCisgICAgQUJDRAorIDA6IEFCQ0QKKyAxOiBCQworIDI6IEQKKworL2EoW2JjXSspKGMqZCkvaQorICAgIEFCQ0QKKyAwOiBBQkNECisgMTogQkMKKyAyOiBECisKKy9hKFtiY10qKShjK2QpL2kKKyAgICBBQkNECisgMDogQUJDRAorIDE6IEIKKyAyOiBDRAorCisvYVtiY2RdKmRjZGNkZS9pCisgICAgQURDRENERQorIDA6IEFEQ0RDREUKKworL2FbYmNkXStkY2RjZGUvaQorCisvKGFifGEpYipjL2kKKyAgICBBQkMKKyAwOiBBQkMKKyAxOiBBQgorCisvKChhKShiKWMpKGQpL2kKKyAgICBBQkNECisgMDogQUJDRAorIDE6IEFCQworIDI6IEEKKyAzOiBCCisgNDogRAorCisvW2EtekEtWl9dW2EtekEtWjAtOV9dKi9pCisgICAgQUxQSEEKKyAwOiBBTFBIQQorCisvXmEoYmMrfGJbZWhdKWd8LmgkL2kKKyAgICBBQkgKKyAwOiBCSAorCisvKGJjK2QkfGVmKmcufGg/aShqfGspKS9pCisgICAgRUZGR1oKKyAwOiBFRkZHWgorIDE6IEVGRkdaCisgICAgSUoKKyAwOiBJSgorIDE6IElKCisgMjogSgorICAgIFJFRkZHWgorIDA6IEVGRkdaCisgMTogRUZGR1oKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBBRENEQ0RFCitObyBtYXRjaAorICAgIEVGRkcKK05vIG1hdGNoCisgICAgQkNERAorTm8gbWF0Y2gKKworLygoKCgoKCgoKChhKSkpKSkpKSkpKS9pCisgICAgQQorIDA6IEEKKyAxOiBBCisgMjogQQorIDM6IEEKKyA0OiBBCisgNTogQQorIDY6IEEKKyA3OiBBCisgODogQQorIDk6IEEKKzEwOiBBCisKKy8oKCgoKCgoKCgoYSkpKSkpKSkpKSlcOS9pCisgICAgQUEKKyAwOiBBQQorIDE6IEEKKyAyOiBBCisgMzogQQorIDQ6IEEKKyA1OiBBCisgNjogQQorIDc6IEEKKyA4OiBBCisgOTogQQorMTA6IEEKKworLygoKCgoKCgoKGEpKSkpKSkpKSkvaQorICAgIEEKKyAwOiBBCisgMTogQQorIDI6IEEKKyAzOiBBCisgNDogQQorIDU6IEEKKyA2OiBBCisgNzogQQorIDg6IEEKKyA5OiBBCisKKy9tdWx0aXBsZSB3b3JkcyBvZiB0ZXh0L2kKKyAgICAqKiogRmFpbGVycworTm8gbWF0Y2gKKyAgICBBQQorTm8gbWF0Y2gKKyAgICBVSC1VSAorTm8gbWF0Y2gKKworL211bHRpcGxlIHdvcmRzL2kKKyAgICBNVUxUSVBMRSBXT1JEUywgWUVBSAorIDA6IE1VTFRJUExFIFdPUkRTCisKKy8oLiopYyguKikvaQorICAgIEFCQ0RFCisgMDogQUJDREUKKyAxOiBBQgorIDI6IERFCisKKy9cKCguKiksICguKilcKS9pCisgICAgKEEsIEIpCisgMDogKEEsIEIpCisgMTogQQorIDI6IEIKKworL2FiY2QvaQorICAgIEFCQ0QKKyAwOiBBQkNECisKKy9hKGJjKWQvaQorICAgIEFCQ0QKKyAwOiBBQkNECisgMTogQkMKKworL2FbLV0/Yy9pCisgICAgQUMKKyAwOiBBQworCisvKGFiYylcMS9pCisgICAgQUJDQUJDCisgMDogQUJDQUJDCisgMTogQUJDCisKKy8oW2EtY10qKVwxL2kKKyAgICBBQkNBQkMKKyAwOiBBQkNBQkMKKyAxOiBBQkMKKworLygoZm9vKXwoYmFyKSkqLworICAgIGZvb2JhcgorIDA6IGZvb2JhcgorIDE6IGJhcgorIDI6IGZvbworIDM6IGJhcgorCisvXiguKyk/Qi8KKyAgICBBQgorIDA6IEFCCisgMTogQQorCisvXihbXmEtel0pfChcXikkLworICAgIC4KKyAwOiAuCisgMTogLgorCisvXls8Pl0mLworICAgIDwmT1VUCisgMDogPCYKKworL14oKXszLDV9LworICAgIGFiYworIDA6IAorIDE6IAorCisvXihhKykqYXgvCisgICAgYWF4CisgMDogYWF4CisgMTogYQorCisvXigoYXxiKSspKmF4LworICAgIGFheAorIDA6IGFheAorIDE6IGEKKyAyOiBhCisKKy9eKChhfGJjKSspKmF4LworICAgIGFheAorIDA6IGFheAorIDE6IGEKKyAyOiBhCisKKy8oYXx4KSphYi8KKyAgICBjYWIKKyAwOiBhYgorCisvKGEpKmFiLworICAgIGNhYgorIDA6IGFiCisKKy8oYWIpWzAtOV1cMS9pCisgICAgQWI0YWIKKyAwOiBBYjRhYgorIDE6IEFiCisgICAgYWI0QWIKKyAwOiBhYjRBYgorIDE6IGFiCisKKy9mb29cdypbMC05XXs0fWJhei8KKyAgICBmb29iYXIxMjM0YmF6CisgMDogZm9vYmFyMTIzNGJhegorCisvKFx3KzopKy8KKyAgICBvbmU6CisgMDogb25lOgorIDE6IG9uZToKKworLygoXHd8OikrOjopPyhcdyspJC8KKyAgICBhYmNkCisgMDogYWJjZAorIDE6IDx1bnNldD4KKyAyOiA8dW5zZXQ+CisgMzogYWJjZAorICAgIHh5Ono6OjphYmNkCisgMDogeHk6ejo6OmFiY2QKKyAxOiB4eTp6Ojo6CisgMjogOgorIDM6IGFiY2QKKworL15bXmJjZF0qKGMrKS8KKyAgICBhZXh5Y2QKKyAwOiBhZXh5YworIDE6IGMKKworLyhhKiliKy8KKyAgICBjYWFiCisgMDogYWFiCisgMTogYWEKKworLygoXHd8OikrOjopPyhcdyspJC8KKyAgICBhYmNkCisgMDogYWJjZAorIDE6IDx1bnNldD4KKyAyOiA8dW5zZXQ+CisgMzogYWJjZAorICAgIHh5Ono6OjphYmNkCisgMDogeHk6ejo6OmFiY2QKKyAxOiB4eTp6Ojo6CisgMjogOgorIDM6IGFiY2QKKyAgICAqKiogRmFpbGVycworIDA6IEZhaWxlcnMKKyAxOiA8dW5zZXQ+CisgMjogPHVuc2V0PgorIDM6IEZhaWxlcnMKKyAgICBhYmN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jOmFiYworMDphLmM6YXhjCiswOmEuKmM6YXh5emMKKzE6YS4qYzpheHl6ZAorMTphW2JjXWQ6YWJjCiswOmFbYmNdZDphYmQKKzE6YVtiLWRdZTphYmQKKzA6YVtiLWRdZTphY2UKKzA6YVtiLWRdOmFhYworMDphWy1iXTphLQorMDphW2ItXTphLQorMjphW2ItYV06LQorMjphW11iOi0KKzI6YVs6LQorMDphXTphXQorMDphW11dYjphXWIKKzA6YVteYmNdZDphZWQKKzE6YVteYmNdZDphYmQKKzA6YVteLWJdYzphZGMKKzE6YVteLWJdYzphLWMKKzE6YVteXWJdYzphXWMKKzA6YVteXWJdYzphZGMKKzA6YWJ8Y2Q6YWJjCiswOmFifGNkOmFiY2QKKzA6KCllZjpkZWYKKzA6KCkqOi0KKzI6KmE6LQorMjpeKjotCisyOiQqOi0KKzI6KCopYjotCisxOiRiOmIKKzI6YVw6LQorMDphXChiOmEoYgorMDphXCgqYjphYgorMDphXCgqYjphKChiCisxOmFceDphXHgKKzE6YWJjKTotCisyOihhYmM6LQorMDooKGEpKTphYmMKKzA6KGEpYihjKTphYmMKKzA6YStiK2M6YWFiYmFiYworMDphKio6LQorMDphKj86LQorMDooYSopKjotCiswOihhKikrOi0KKzA6KGF8KSo6LQorMDooYSp8YikqOi0KKzA6KGErfGIpKjphYgorMDooYSt8YikrOmFiCiswOihhK3xiKT86YWIKKzA6W15hYl0qOmNkZQorMDooXikqOi0KKzA6KGFifCkqOi0KKzI6KSg6LQorMTphYmM6CisxOmFiYzoKKzA6YSo6CiswOihbYWJjXSkqZDphYmJiY2QKKzA6KFthYmNdKSpiY2Q6YWJjZAorMDphfGJ8Y3xkfGU6ZQorMDooYXxifGN8ZHxlKWY6ZWYKKzA6KChhKnxiKSkqOi0KKzA6YWJjZCplZmc6YWJjZGVmZworMDphYio6eGFieWFiYmJ6CiswOmFiKjp4YXlhYmJiegorMDooYWJ8Y2QpZTphYmNkZQorMDpbYWJoZ2VmZGNdaWo6aGlqCisxOl4oYWJ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ciAqY29uc3QgbG9jYWxlX3N5bXNbXSA9Cit7CisgICJMQ19BTEwiLCAiTENfQ09MTEFURSIsICJMQ19DVFlQRSIsICJMQ19NT05FVEFSWSIsICJMQ19OVU1FUklDIiwKKyAgIkxDX1RJTUUiLCAiTlVMTCIKK307CitzdGF0aWMgY29uc3QgY2hhciAqY29uc3QgbG9jYWxlX21heWJlW10gPQoreworICAiTENfKiIsICJsb2NhbGVjb252IiwgInNldGxvY2FsZSIKK307CisKKy8qIDxtYXRoLmg+LiAgKi8KK3N0YXRpYyBjb25zdCBjaGFyICpjb25zdCBtYXRoX3N5bXNbXSA9Cit7CisgICJIVUdFX1ZBTCIKK307CitzdGF0aWMgY29uc3QgY2hhciAqY29uc3QgbWF0aF9tYXliZVtdID0KK3sKKyAgImFjb3MiLCAiYXNpbiIsICJhdGFuMiIsICJhdGFuIiwgImNlaWwiLCAiY29zIiwgImNvc2giLCAiZXhwIiwKKyAgImZhYnMiLCAiZmxvb3IiLCAiZm1vZCIsICJmcmV4cCIsICJsZGV4cCIsICJsb2cxMCIsICJsb2ciLCAibW9kZiIsCisgICJwb3ciLCAic2luIiwgInNpbmgiLCAic3FydCIsICJ0YW4iLCAidGFuaCIsCisgICJhY29zZiIsICJhc2luZiIsICJhdGFuMmYiLCAiYXRhbmYiLCAiY2VpbGYiLCAiY29zZiIsICJjb3NoZiIsICJleHBmIiwKKyAgImZhYnNmIiwgImZsb29yZiIsICJmbW9kZiIsICJmcmV4cGYiLCAibGRleHBmIiwgImxvZzEwZiIsICJsb2dmIiwgIm1vZGZmIiwKKyAgInBvd2YiLCAic2luZiIsICJzaW5oZiIsICJzcXJ0ZiIsICJ0YW5mIiwgInRhbmhmIiwKKyAgImFjb3NsIiwgImFzaW5sIiwgImF0YW4ybCIsICJhdGFubCIsICJjZWlsbCIsICJjb3NsIiwgImNvc2hsIiwgImV4cGwiLAorICAiZmFic2wiLCAiZmxvb3JsIiwgImZtb2RsIiwgImZyZXhwbCIsICJsZGV4cGwi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NFTSIsICJTX1RZUEVJU1NITSIKK307CitzdGF0aWMgY29uc3QgY2hhciAqY29uc3Qgc3RhdF9tYXliZVtdID0KK3sKKyAgImNobW9kIiwgImZjaG1vZCIsICJmc3RhdCIsICJta2RpciIsICJta2ZpZm8iLCAic3RhdCIsICJ1bWFzayIKK307CisKKy8qIDxzeXMvdGltZXMuaD4uICAqLworc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IHRpbWVzX3N5bXNbXSA9Cit7Cit9Oworc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IHRpbWVzX21heWJlW10gPQoreworICAidGltZXMiCit9OworCisvKiA8c3lzL3R5cGVzLmg+LiAgKi8KK3N0YXRpYyBjb25zdCBjaGFyICpjb25zdCB0eXBlc19zeW1zW10gPQoreworfTsKK3N0YXRpYyBjb25zdCBjaGFyICpjb25zdCB0eXBlc19tYXliZVtdID0KK3sKK307CisKKy8qIDxzeXMvdXRzbmFtZS5oPi4gICovCitzdGF0aWMgY29uc3QgY2hhciAqY29uc3QgdXRzbmFtZV9zeW1zW10gPQoreworfTsKK3N0YXRpYyBjb25zdCBjaGFyICpjb25zdCB1dHNuYW1lX21heWJlW10gPQoreworICAidW5hbWUiCit9OworCisvKiA8c3lzL3dhaXQuaD4uICAqLworc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IHdhaXRfc3ltc1tdID0KK3sKKyAgIldFWElUU1RBVFVTIiwgIldJRkVYSVRFRCIsICJXSUZTSUdOQUxFRCIsICJXSUZTVE9QUEVEIiwgIldOT0hBTkciLAorICAiV1NUT1BTSUciLCAiV1RFUk1TSUciLCAiV1VOVFJBQ0VEIgorfTsKK3N0YXRpYyBjb25zdCBjaGFyICpjb25zdCB3YWl0X21heWJlW10gPQoreworICAid2FpdCIsICJ3YWl0cGlkIgorfTsKKworLyogPHRlcm1pb3MuaD4uICAqLworc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IHRlcm1pb3Nfc3ltc1tdID0KK3sKKyAgIkIwI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aXplb2YgKG4jI19tYXliZVswXSksIHMgfQorI2RlZmluZSBIcyhuKSBcCisgIHsgInN5cy8iICNuICIuaCIsIG4jI19zeW1zLCBzaXplb2YgKG4jI19zeW1zKSAvIHNpemVvZiAobiMjX3N5bXNbMF0pLCBcCisgICAgbiMjX21heWJlLCBzaXplb2YgKG4jI19tYXliZSkgLyBzaXplb2YgKG4jI19tYXliZVswXSksIE5VTEwgfQorICBIKGFpbyksCisgIEgoYXNzZXJ0KSwKKyAgSChjdHlwZSksCisgIEgoZGlyZW50KSwKKyAgSChlcnJubyksCisgIEgoZmNudGwpLAorICBIKGZsb2F0KSwKKyAgSChncnApLAorICBIKGxpbWl0cyksCisgIEgobG9jYWxlKSwKKyAgSChtYXRoKSwKKyAgSGMobXF1ZXVlLCAiX1BPU0lYX01FU1NBR0VfUEFTU0lORyIpLAorICBIKHB0aHJlYWQpLAorICBIKHB3ZCksCisgIEgoc2NoZWQpLAorICBIKHNlbWFwaG9yZSksCisgIEgoc2V0am1wKSwKKyAgSChzaWduYWwpLAorICBIKHN0ZGFyZyksCisgIEgoc3RkZGVmKSwKKyAgSChzdGRpbyksCisgIEgoc3RkbGliKSwKKyAgSChzdHJpbmcpLAorICBIcyhtbWFuKSwKKyAgSHMoc3RhdCksCisgIEhzKHRpbWVzKSwKKyAgSHModHlwZXMpLAorICBIcyh1dHNuYW1lKSwKKyAgSHMod2FpdCksCisgIEgodGVybWlvcyksCisgIEgodGltZSksCisgIEgodW5pc3RkKSwKKyAgSCh1dGltZSkKK307CisKKyNkZWZpbmUgTlVNQkVSX09GX0hFQURFUlMgICAgICAgICAgICAgIChzaXplb2YgaGVhZGVycyAvIHNpemVvZiAqaGVhZGVycykKKworCisvKiBGb3JtYXQgc3RyaW5nIHRvIGJ1aWxkIGNvbW1hbmQgdG8gaW52b2tlIGNvbXBpbGVyLiAgKi8KK3N0YXRpYyBjb25zdCBjaGFyIGZtdFtdID0gIlwKK2VjaG8gXCIjaW5jbHVkZSA8JXM+XC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lIG1lbW9yeS4iKTsKKyAgICAgIGV4aXQgKDEpOworICAgIH0KKworICBzcHJpbnRmIChjb21tYW5kLCBmbXQsICIvZGV2L251bGwiLCBDQywgSU5DLCBDQywgbWFjcm9maWxlKTsKKworICBpZiAoeHN5c3RlbSAoY29tbWFuZCkpCisgICAgeworICAgICAgcHV0cyAoInN5c3RlbSgpIHJldHVybmVkIG5vbnplcm8iKTsKKyAgICAgIHJldHVybiBOVUxMOworICAgIH0KKyAgZnJlZSAoY29tbWFuZCk7CisgIGlucHV0ID0gZm9wZW4gKG1hY3JvZmlsZSwgInIiKTsKKworICBpZiAoaW5wdXQgPT0gTlVMTCkKKyAgICB7CisgICAgICBwcmludGYgKCJDb3VsZCBub3QgcmVhZCAlczogIiwgbWFjcm9maWxlKTsKKyAgICAgIHBlcnJvciAoTlVMTCk7CisgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgd2hpbGUgKGZnZXRzIChsaW5lLCBzaXplb2YgbGluZSwgaW5wdXQpICE9IE5VTEwpCisgICAgeworICAgICAgY2hhciAqc3RhcnQ7CisgICAgICBpZiAoc3RybGVuIChsaW5lKSA8IDkgfHwgbGluZVs3XSAhPSAnICcpCisJeyAvKiAiI2RlZmluZSBBIiAqLworCSAgcHJpbnRmICgiTWFsZm9ybWVkIGlucHV0LCBleHBlY3RlZCAnI2RlZmluZSBNQUNSTydcbmdvdCAnJXMnXG4iLAorCQkgIGxpbmUpOworCSAgY29udGludWU7CisJfQorICAgICAgaWYgKGxpbmVbOF0gPT0gJ18nKQorCS8qIEl0J3MgYSBzYWZlIGlkZW50aWZpZXIuICAqLworCWNvbnRpbnVlOworICAgICAgaWYgKHJlc3VsdF9sZW4gPT0gcmVzdWx0X21heCkKKwl7CisJICByZXN1bHRfbWF4ICs9IDEwOworCSAgcmVzdWx0ID0gcmVhbGxvYyAocmVzdWx0LCByZXN1bHRfbWF4ICogc2l6ZW9mIChjaGFyICoqKSk7CisJICBpZiAocmVzdWx0ID09IE5V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Pm5hbWUpCisJCQkgICAgICsgMiAqIHN0cmxlbiAoQ0MpCisJCQkgICAgICsgc3RybGVuIChJTkMpICsgc3RybGVuIChtYWNyb2ZpbGUpXTsKKyAgRklMRSAqaW5wdXQ7CisgIGludCByZXN1bHQgPSAwOworICBpbnQgZm91bmRbaGVhZGVyLT5uc3ltc107CisgIGludCBpOworCisgIG1lbXNldCAoZm91bmQsICdcMCcsIGhlYWRlci0+bnN5bXMgKiBzaXplb2YgKGludCkpOworCisgIHByaW50ZiAoIj09PSAlcyA9PT1cbiIsIGhlYWRlci0+bmFtZSk7CisgIHNwcmludGYgKGNvbW1hbmQsIGZtdCwgaGVhZGVyLT5uYW1lLCBDQywgSU5DLCBDQywgbWFjcm9maWxlKTsKKworICAvKiBGaXJzdCBzZWUgd2hldGhlciB0aGlzIHN1YnNldCBpcyBzdXBwb3J0ZWQgYXQgYWxsLiAgKi8KKyAgaWYgKGhlYWRlci0+c3Vic2V0ICE9IE5VTEwpCisgICAgeworICAgICAgc3ByaW50ZiAobGluZSwgdGVzdGZtdCwgaGVhZGVyLT5zdWJzZXQsIGhlYWRlci0+c3Vic2V0LCBDQywgSU5DLCBDQywKKwkgICAgICAgbWFjcm9maWxlKTsKKyAgICAgIGlmICh4c3lzdGVtIChsaW5lKSkKKwl7CisJICBwcmludGYgKCIhISBub3QgYXZhaWxhYmxlXG4iKTsKKwkgIHJldHVybiAwOworCX0KKyAgICB9CisKKyAgaWYgKHhzeXN0ZW0gKGNvbW1hbmQpKQorICAgIHsKKyAgICAgIHB1dHMgKCJzeXN0ZW0oKSByZXR1cm5lZCBub256ZXJvIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKyAgaW5wdXQgPSBmb3BlbiAobWFjcm9maWxlLCAiciIpOworCisgIGlmIChpbnB1dCA9PSBOVUxMKQorICAgIHsKKyAgICAgIHByaW50ZiAoIkNvdWxkIG5vdCByZWFkICVzOiAiLCBtYWNyb2ZpbGUpOworICAgICAgcGVycm9yIChOVUxMK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QgX19idWYsIHNpemVfdCBfX2xlbiwKKwkJCQlzaXplX3QgX19idWZsZW4pLCBfX3JlYWRsaW5rYXRfY2hrKQorICAgICBfX25vbm51bGwgKCgyLCAzKSkgX193dXIgX193YXJuYXR0ciAoInJlYWRsaW5rYXQgY2FsbGVkIHdpdGggYmlnZ2VyICIKKwkJCQkJICAibGVuZ3RoIHRoYW4gc2l6ZSBvZiBkZXN0aW5hdGlvbiAiCisJCQkJCSAgImJ1ZmZlciIpOworCitfX2ZvcnRpZnlfZnVuY3Rpb24gX19ub25udWxsICgoMiwgMykpIF9fd3VyIHNzaXplX3QKK19fTlRIIChyZWFkbGlua2F0IChpbnQgX19mZCwgY29uc3QgY2hhciAqX19yZXN0cmljdCBfX3BhdGgsCisJCSAgIGNoYXIgKl9fcmVzdHJpY3QgX19idWYsIHNpemVfdCBfX2xlbikpCit7CisgIGlmIChfX2JvcyAoX19idWYpICE9IChzaXplX3QpIC0xKQorICAgIHsKKyAgICAgIGlmICghX19idWlsdGluX2NvbnN0YW50X3AgKF9fbGVuKSkKKwlyZXR1cm4gX19yZWFkbGlua2F0X2NoayAoX19mZCwgX19wYXRoLCBfX2J1ZiwgX19sZW4sIF9fYm9zIChfX2J1ZikpOworCisgICAgICBpZiAoX19sZW4gPiBfX2JvcyAoX19idWYpKQorCXJldHVybiBfX3JlYWRsaW5rYXRfY2hrX3dhcm4gKF9fZmQsIF9fcGF0aCwgX19idWYsIF9fbGVuLAorCQkJCSAgICAgIF9fYm9zIChfX2J1ZikpOworICAgIH0KKyAgcmV0dXJuIF9fcmVhZGxpbmthdF9hbGlhcyAoX19mZCwgX19wYXRoLCBfX2J1ZiwgX19sZW4pOworfQorI2VuZGlmCisKK2V4dGVybiBjaGFyICpfX2dldGN3ZF9jaGsgKGNoYXIgKl9fYnVmLCBzaXplX3QgX19zaXplLCBzaXplX3QgX19idWZsZW4pCisgICAgIF9fVEhST1cgX193dXI7CitleHRlcm4gY2hhciAqX19SRURJUkVDVF9OVEggKF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Rlc3RpbmF0aW9uICIKKwkJICJidWZmZXIiKTsKKworX19mb3J0aWZ5X2Z1bmN0aW9uIHNpemVfdAorX19OVEggKGNvbmZzdHIgKGludCBfX25hbWUsIGNoYXIgKl9fYnVmLCBzaXplX3QgX19sZW4pKQoreworICBpZiAoX19ib3MgKF9fYnVmKSAhPSAoc2l6ZV90KSAtMSkKKyAgICB7CisgICAgICBpZiAoIV9fYnVpbHRpbl9jb25zdGFudF9wIChfX2xlbikpCisJcmV0dXJuIF9fY29uZnN0cl9jaGsgKF9fbmFtZSwgX19idWYsIF9fbGVuLCBfX2JvcyAoX19idWYpKTsKKworICAgICAgaWYgKF9fYm9zIChfX2J1ZikgPCBfX2xlbikKKwlyZXR1cm4gX19jb25mc3RyX2Noa193YXJuIChfX25hbWUsIF9fYnVmLCBfX2xlbiwgX19ib3MgKF9fYnVmKSk7CisgICAgfQorICByZXR1cm4gX19jb25mc3RyX2FsaWFzIChfX25hbWUsIF9fYnVmLCBfX2xlbik7Cit9CisKKworZXh0ZXJuIGludCBfX2dldGdyb3Vwc19jaGsgKGludCBfX3NpemUsIF9fZ2lkX3QgX19saXN0W10sIHNpemVfdCBfX2xpc3RsZW4pCisgICAgIF9fVEhST1cgX193dXI7CitleHRlcm4gaW50IF9fUkVESVJFQ1RfTlRIIChfX2dldGdyb3Vwc19hbGlhcywgKGludCBfX3NpemUsIF9fZ2lkX3QgX19saXN0W10pLAorCQkJICAgZ2V0Z3JvdXBzKSBfX3d1cjsKK2V4dGVybiBpbnQgX19SRURJUkVDVF9OVEggKF9fZ2V0Z3JvdXBzX2Noa193YXJuLAorCQkJICAgKGludCBfX3NpemUsIF9fZ2lkX3QgX19saXN0W10sIHNpemVfdCBfX2xpc3RsZW4pLAorCQkJICAgX19nZXRncm91cHNfY2hrKQorICAgICBfX3d1ciBfX3dhcm5hdHRyICgiZ2V0Z3JvdXBzIGNhbGxlZCB3aXRoIGJpZ2dlciBncm91cCBjb3VudCB0aGFuIHdoYXQgIgorCQkgICAgICAgImNhbiBmaXQgaW50byBkZXN0aW5hdGlvbiBidWZmZXIiKTsKKworX19mb3J0aWZ5X2Z1bmN0aW9uIGludAorX19OVEggKGdldGdyb3VwcyAoaW50IF9fc2l6ZSwgX19naWRfdCBfX2xpc3RbXSkpCit7CisgIGlmIChfX2JvcyAoX19saXN0KSAhPSAoc2l6ZV90KSAtMSkKKyAgICB7CisgICAgICBpZiAoIV9fYnVpbHRpbl9jb25zdGFudF9wIChfX3NpemUpIHx8IF9fc2l6ZSA8IDApCisJcmV0dXJuIF9fZ2V0Z3JvdXBzX2NoayAoX19zaXplLCBfX2xpc3QsIF9fYm9zIChfX2xpc3QpKTsKKworICAgICAgaWYgKF9fc2l6ZSAqIHNpemVvZiAoX19naWRfdCkgPiBfX2JvcyAoX19saXN0KSkKKwlyZXR1cm4gX19nZXRncm91cHNfY2hrX3dhcm4gKF9fc2l6ZSwgX19saXN0LCBfX2JvcyAoX19saXN0KSk7CisgICAgfQorICByZXR1cm4gX19nZXRncm91cHNfYWxpYXMgKF9fc2l6ZSwgX19saXN0KTsKK30KKworCitleHRlcm4gaW50IF9fdHR5bmFtZV9yX2NoayAoaW50IF9fZmQsIGNoYXIgKl9fYnVmLCBzaXplX3QgX19idWZsZW4sCisJCQkgICAgc2l6ZV90IF9fbnJlYWwpIF9fVEhST1cgX19ub25udWxsICgoMikpOworZXh0ZXJuIGludCBfX1JFRElSRUNUX05USCAoX190dHluYW1lX3JfYWxpYXMsIChpbnQgX19mZCwgY2hhciAqX19idWYsCisJCQkJCSAgICAgICBzaXplX3QgX19idWZsZW4pLCB0dHluYW1lX3IpCisgICAgIF9fbm9ubnVsbCAoKDIpKTsKK2V4dGVybiBpbnQgX19SRURJUkVDVF9OVEggKF9fdHR5bmFtZV9yX2Noa193YXJuLAorCQkJICAgKGludCBfX2ZkLCBjaGFyICpfX2J1Ziwgc2l6ZV90IF9fYnVmbGVuLAorCQkJICAgIHNpemVfdCBfX25yZWFsKSwgX190dHluYW1lX3J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gRU5PRU5UOworCSAgcmV0dXJuIC0xOworCX0KKworICAgICAgaWYgKCplbmRwID09ICdcMCcpCisJcmV0dXJuIGlkeCArIDE7CisKKyAgICAgIGlmIChmaWxlc3lzdGVtW2lkeF0udHlwZSAhPSBEVF9ESVIKKwkgICYmIChpZHggKyAxID49IG5maWxlcworCSAgICAgIHx8IGZpbGVzeXN0ZW1baWR4XS5sZXZlbCA+PSBmaWxlc3lzdGVtW2lkeCArIDFdLmxldmVsKSkKKwl7CisJICBlcnJubyA9IEVOT1RESVI7CisJICByZXR1cm4gLTE7CisJfQorCisgICAgICArK2lkeDsKKworICAgICAgcyA9IGVuZHAgKyAxOworICAgICAgKytsZXZlbDsKKyAgICB9CisKKyAgZXJybm8gPSBFTk9FTlQ7CisgIHJldHVybiAtMTsKK30KKworCitzdGF0aWMgdm9pZCAqCitteV9vcGVuZGlyIChjb25zdCBjaGFyICpzKQoreworICBsb25nIGludCBpZHggPSBmaW5kX2ZpbGUgKHMpOworICBteV9ESVIgKmRpcjsKKworICBpZiAoaWR4ID09IC0xKQorICAgIHsKKyAgICAgIFBSSU5URiAoIm15X29wZW5kaXIoXCIlc1wiKSA9PSBOVUxMICglbSlcbiIsIHMpOworICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgIGlmICgoZmlsZXN5c3RlbVtpZHhdLm1vZGUgJiAwNDAwKSA9PSAwKQorICAgIHsKKyAgICAgIGVycm5vID0gRUFDQ0VTOworICAgICAgUFJJTlRGICgibXlfb3BlbmRpcihcIiVzXCIpID09IE5VTEwgKCVtKVxuIiwgcyk7CisgICAgICByZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgZGlyID0gKG15X0RJUiAqKSBtYWxsb2MgKHNpemVvZiAobXlfRElSKSk7CisgIGlmIChkaXIgPT0gTlVMTCkKKyAgICB7CisgICAgICBwcmludGYgKCJjYW5ub3QgYWxsb2NhdGUgZGlyZWN0b3J5IGhhbmRsZTogJW1cbiIpOworICAgICAgZXhpdCAoRVhJ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0dGVybltqXTsgKytqKQorCWlmIChzdHJjaHIgKHJlcGwsIHRlc3QtPnBhdHRlcm5bal0pKQorCSAgcCA9IHJlcGxhY2UgKHAsIHRlc3QtPnBhdHRlcm5bal0pOworCWVsc2UgaWYgKHRlc3QtPnBhdHRlcm5bal0gPT0gJ1xcJyAmJiB0ZXN0LT5wYXR0ZXJuW2ogKyAxXSkKKwkgIHsKKwkgICAgKnArKyA9IHRlc3QtPnBhdHRlcm5baisrXTsKKwkgICAgKnArKyA9IHRlc3QtPnBhdHRlcm5bal07CisJICB9CisJZWxzZQorCSAgKnArKyA9IHRlc3QtPnBhdHRlcm5bal07CisgICAgICAqcCA9ICdcMCc7CisKKyAgICAgIHQuc3RhcnQgPSB0ZXN0LT5zdGFydDsKKyAgICAgIHQucmVzID0gdGVzdC0+cmVzOworCisgICAgICBmb3IgKGogPSAwLCBwID0gc3RyaW5nOyB0ZXN0LT5zdHJpbmdbal07ICsraikKKwlpZiAoc3RyY2hyIChyZXBsLCB0ZXN0LT5zdHJpbmdbal0pKQorCSAgeworCSAgICBjaGFyICpkID0gcmVwbGFjZSAocCwgdGVzdC0+c3RyaW5nW2pdKTsKKwkgICAgaWYgKHRlc3QtPnN0YXJ0ID4gaikKKwkgICAgICB0LnN0YXJ0ICs9IGQgLSBwIC0gMTsKKwkgICAgaWYgKHRlc3QtPnJlcyA+IGopCisJICAgICAgdC5yZXMgKz0gZCAtIHAgLSAxOworCSAgICBwID0gZDsKKwkgIH0KKwllbHNlCisJICAqcCsrID0gdGVzdC0+c3RyaW5nW2pdOworICAgICAgKnAgPSAnXDAnOworCisgICAgICBwID0gc3RwY3B5IChmYWlsICsgc3RybGVuICgiVVRGLTggIiksIHJlcGwpOworICAgICAgKnArKyA9ICcgJzsKKyAgICAgICpwID0gJ1wwJzsKKworICAgICAgaWYgKGRvX29uZV90ZXN0ICgmdCwgZmFpbCkpCisJcmV0dXJuIDE7CisgICAgfQorICByZXR1cm4gMDsKK30KKworaW50CittYWluICh2b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AsMCArMSw2MCBAQAorI2luY2x1ZGUgPHJlZ2V4Lmg+CisjaW5jbHVkZSA8c3RkaW8uaD4KKyNpbmNsdWRlIDxzdHJpbmcuaD4KKworI2RlZmluZSBzdHIgImNpdmljIgorCisjZGVmaW5lIE4gMTAKK3N0YXRpYyBjb25zdCBjaGFyICpleHBlY3RlZFtOXSA9CisgIHsKKyAgICBzdHIsICJjIiwgImkiLCAiIiwgIiIsICIiLCAiIiwgIiIsICIiLCAiIgorICB9OworCitzdGF0aWMgaW50Citkb190ZXN0ICh2b2lkKQoreworICByZWdleF90IHJidWY7CisgIHN0YXRpYyBjb25zdCBjaGFyIHBhdFtdID0gIlwKK14oLj8pKC4/KSguPykoLj8pKC4/KSguPykoLj8pKC4/KSguPykuP1xcOVxcOFxcN1xcNlxcNVxcNFxcM1xcMlxcMSQiOworCisgIGludCBlcnIgPSByZWdjb21wICgmcmJ1ZiwgcGF0LCBSRUdfRVhURU5ERUQpOworICBpZiAoZXJyICE9IDApCisgICAgeworICAgICAgY2hhciBlcnJzdHJbMzAwXTsKKyAgICAgIHJlZ2Vycm9yIChlcnIsICZyYnVmLCBlcnJzdHIsIHNpemVvZiAoZXJyc3RyKSk7CisgICAgICBwdXRzIChlcnJzdHIpOworICAgICAgcmV0dXJuIGVycjsKKyAgICB9CisKKyAgcmVnbWF0Y2hfdCBtW05dOworICBlcnIgPSByZWdleGVjICgmcmJ1Ziwgc3RyLCBOLCBtLCAwKTsKKyAgaWYgKGVyciAhPSAwKQorICAgIHsKKyAgICAgIHB1dHMgKCJyZWdleGVjIGZhaWxlZCIpOworICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgIGludCByZXN1bHQgPSAwOworICBmb3IgKGludCBpID0gMDsgaSA8IE47ICsraSkKKyAgICBpZiAobVtpXS5ybV9zbyA9PSAtMSkKKyAgICAgIHsKKwlwcmludGYgKCJtWyVkXSB1bnVzZWRcbiIsIGkpOworCXJlc3VsdCA9IDE7CisgICAgICB9CisgICAgZWxzZQ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iLCBjYSk7CisKKyAgdS5zdHJpbmcgPSBubF9sYW5naW5mbyAoX05MX0NPTExBVEVfTlJVTEVTKTsKKyAgbnJ1bGVzID0gdS53b3JkOworICBpZiAobnJ1bGVzID09IDApCisgICAgeworICAgICAgcHJpbnRmKCJObyBydWxlXG4iKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICB1LnN0cmluZyA9IG5sX2xhbmdpbmZvIChfTkxfQ09MTEFURV9TWU1CX0hBU0hfU0laRU1CKTsKKyAgdGFibGVfc2l6ZSA9IHUud29yZDsKKyAgc3ltYl90YWJsZSA9IChjb25zdCBpbnQzMl90ICopIG5sX2xhbmdpbmZvIChfTkxfQ09MTEFURV9TWU1CX1RBQkxFTUIpOworICBleHRyYSA9IChjb25zdCB1bnNpZ25lZCBjaGFyICopIG5sX2xhbmdpbmZvIChfTkxfQ09MTEFURV9TWU1CX0VYVFJBTUIpOworCisgIGZvdW5kID0gMDsKKyAgZm9yIChpID0gMDsgaSA8IHRhYmxlX3NpemU7ICsraSkKKyAgICB7CisgICAgICBpZiAoc3ltYl90YWJsZVsyICogaV0gIT0gMCkKKwl7CisJICBjaGFyIGVsZW1bMjU2XTsKKwkgIGlkeCA9IHN5bWJfdGFibGVbMiAqIGkgKyAxXTsKKwkgIHN0cm5jcHkgKGVsZW0sIChjb25zdCBjaGFyICopIChleHRyYSArIGlkeCArIDEpLCBleHRyYVtpZHhdKTsKKwkgIGVsZW1bZXh0cmFbaWR4XV0gPSAnXDAnOworCSAgcHJpbnRmICgiRm91bmQgYSBjb2xsYXRpbmcgZWxlbWVudDogJXNcbiIsIGVsZW0pOworCSAgKytmb3VuZDsKKwl9CisgICAgfQorICBpZiAoZm91bmQgPT0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJObyBjb2xsYXRpbmcgZWxlbWVudCFcbiIpOworICAgICAgcmV0dXJuIDE7CisgICAgfQorICBlbHNlIGlmIChmb3VuZCAhPSA0KQorICAgIHsKKyAgICAgIHByaW50ZiAoIm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gY2hhciAqYXJnLCAuLi4pCit7CisjZGVmaW5lIElOSVRJQUxfQVJHVl9NQVggMTAyNAorICBzaXplX3QgYXJndl9tYXggPSBJTklUSUFMX0FSR1ZfTUFYOworICBjb25zdCBjaGFyICppbml0aWFsX2FyZ3ZbSU5JVElBTF9BUkdWX01BWF07CisgIGNvbnN0IGNoYXIgKiphcmd2ID0gaW5pdGlhbF9hcmd2OworICB2YV9saXN0IGFyZ3M7CisKKyAgYXJndlswXSA9IGFyZzsKKworICB2YV9zdGFydCAoYXJncywgYXJnKTsKKyAgdW5zaWduZWQgaW50IGkgPSAwOworICB3aGlsZSAoYXJndltpKytdICE9IE5VTEwpCisgICAgeworICAgICAgaWYgKGkgPT0gYXJndl9tYXgpCisJeworCSAgYXJndl9tYXggKj0gMjsKKwkgIGNvbnN0IGNoYXIgKipucHRyID0gcmVhbGxvYyAoYXJndiA9PSBpbml0aWFsX2FyZ3YgPyBOVUxMIDogYXJndiwKKwkJCQkgICAgICAgYXJndl9tYXggKiBzaXplb2YgKGNvbnN0IGNoYXIgKikpOworCSAgaWYgKG5wdHIgPT0gTlVMTCkKKwkgICAgeworCSAgICAgIGlmIChhcmd2ICE9IGluaXRpYWxfYXJndikKKwkJZnJlZSAoYXJndik7CisJICAgICAgcmV0dXJuIC0xOworCSAgICB9CisJICBpZiAoYXJndiA9PSBpbml0aWFsX2FyZ3YpCisJICAgIC8qIFdlIGhhdmUgdG8gY29weSB0aGUgYWxyZWFkeSBmaWxsZWQtaW4gZGF0YSBvdXJzZWx2ZXMuICAqLworCSAgICBtZW1jcHkgKG5wdHIsIGFyZ3YsIGkgKiBzaXplb2YgKGNvbnN0IGNoYXIgKikpOworCisJICBhcmd2ID0gbnB0cjsKKwl9CisKKyAgICAgIGFyZ3ZbaV0gPSB2YV9hcmcgKGFyZ3MsIGNvbnN0IGNoYXIgKik7CisgICAgfQorICB2YV9lbmQgKGFyZ3MpOworCisgIGludCByZXQgPSBleGVjdnAgKGZpbGUsIChjaGFy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BjaGFyICoqbmV3X2FyZ3YpCit7CisgIC8qIENvbnN0cnVjdCBhbiBhcmd1bWVudCBsaXN0IGZvciB0aGUgc2hlbGwuICAqLworICBuZXdfYXJndlswXSA9IChjaGFyICopIF9QQVRIX0JTSEVMTDsKKyAgbmV3X2FyZ3ZbMV0gPSAoY2hhciAqKSBmaWxlOworICB3aGlsZSAoYXJnYyA+IDEpCisgICAgeworICAgICAgbmV3X2FyZ3ZbYXJnY10gPSBhcmd2W2FyZ2MgLSAxXTsKKyAgICAgIC0tYXJnYzsKKyAgICB9Cit9CisKKworLyogRXhlY3V0ZSBGSUxFLCBzZWFyY2hpbmcgaW4gdGhlIGBQQVRIJyBlbnZpcm9ubWVudCB2YXJpYWJsZSBpZiBpdCBjb250YWlucworICAgbm8gc2xhc2hlcywgd2l0aCBhcmd1bWVudHMgQVJHViBhbmQgZW52aXJvbm1lbnQgZnJvbSBFTlZQLiAgKi8KK2ludAorX19leGVjdnBlIChmaWxlLCBhcmd2LCBlbnZwKQorICAgICBjb25zdCBjaGFyICpmaWxlOworICAgICBjaGFyICpjb25zdCBhcmd2W107CisgICAgIGNoYXIgKmNvbnN0IGVudnBbXTsKK3sKKyAgaWYgKCpmaWxlID09ICdcMCcpCisgICAgeworICAgICAgLyogV2UgY2hlY2sgdGhlIHNpbXBsZSBjYXNlIGZpcnN0LiAqLworICAgICAgX19zZXRfZXJybm8gKEVOT0VOVCk7CisgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgIGlmIChzdHJjaHIgKGZpbGUsICcvJykgIT0gTlVMTCkKKyAgICB7CisgICAgICAvKiBEb24ndCBzZWFyY2ggd2hlbiBpdCBjb250YWlucyBhIHNsYXNoLiAgKi8KKyAgICAgIF9fZXhlY3ZlIChmaWxlLCBhcmd2LCBlbnZwKTsKKworICAgICAgaWYgKGVycm5vID09IEVOT0VYRUMpCisJeworCSAgLyogQ291bnQgdGhlIGFyZ3VtZW50cy4gICovCisJICBpbnQgYXJnYyA9IDA7CisJICB3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csICJ1cHBlciIpCQkJICAgICAgXAorICAgIHx8IFNUUkVRIChzdHJpbmcsICJsb3dlciIpIHx8IFNUUkVRIChzdHJpbmcsICJkaWdpdCIpCQkgICAgICBcCisgICAgfHwgU1RSRVEgKHN0cmluZywgImFsbnVtIikgfHwgU1RSRVEgKHN0cmluZywgInhkaWdpdCIpCQkgICAgICBcCisgICAgfHwgU1RSRVEgKHN0cmluZywgInNwYWNlIikgfHwgU1RSRVEgKHN0cmluZywgInByaW50IikJCSAgICAgIFwKKyAgICB8fCBTVFJFUSAoc3RyaW5nLCAicHVuY3QiKSB8fCBTVFJFUSAoc3RyaW5nLCAiZ3JhcGgiKQkJICAgICAgXAorICAgIHx8IFNUUkVRIChzdHJpbmcsICJjbnRybCIpIHx8IFNUUkVRIChzdHJpbmcsICJibGFuayIpKQorIyBlbmRpZgorCisvKiBBdm9pZCBkZXBlbmRpbmcgb24gbGlicmFyeSBmdW5jdGlvbnMgb3IgZmlsZXMKKyAgIHdob3NlIG5hbWVzIGFyZSBpbmNvbnNpc3RlbnQuICAqLworCisjIGlmICFkZWZpbmVkIF9MSUJDICYmICFkZWZpbmVkIGdldGVudgorZXh0ZXJuIGNoYXIgKmdldGVudiAoKTsKKyMgZW5kaWYKKworIyBpZm5kZWYgZXJybm8KK2V4dGVybiBpbnQgZXJybm87CisjIGVuZGlmCisKKy8qIEdsb2JhbCB2YXJpYWJsZS4gICovCitzdGF0aWMgaW50IHBvc2l4bHlfY29ycmVjdDsKKworLyogVGhpcyBmdW5jdGlvbiBkb2Vzbid0IGV4aXN0IG9uIG1vc3Qgc3lzdGVtcy4gICovCisKKyMgaWYgIWRlZmluZWQgSEFWRV9fX1NUUkNIUk5VTCAmJiAhZGVmaW5lZCBfTElCQworc3RhdGljIGNoYXIgKgorX19zdHJjaHJudWwgKHMsIGMpCisgICAgIGNvbnN0IGNoYXIgKnM7CisgICAgIGludCBjOworeworICBjaGFyICpyZXN1bHQgPSBzdHJjaHIgKHMsIGMpOworICBp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gIHdjaGFyX3QgKndwYXR0ZXJuX21hbGxvYyA9IE5VTEw7CisgICAgICB3Y2hhcl90ICp3cGF0dGVybjsKKyAgICAgIHdjaGFyX3QgKndzdHJpbmdfbWFsbG9jID0gTlVMTDsKKyAgICAgIHdjaGFyX3QgKndzdHJpbmc7CisgICAgICBzaXplX3QgYWxsb2NhX3VzZWQgPSAwOworCisgICAgICAvKiBDb252ZXJ0IHRoZSBzdHJpbmdzIGludG8gd2lkZSBjaGFyYWN0ZXJzLiAgKi8KKyAgICAgIG1lbXNldCAoJnBzLCAnXDAnLCBzaXplb2YgKHBzKSk7CisgICAgICBwID0gcGF0dGVybjsKKyNpZmRlZiBfTElCQworICAgICAgbiA9IF9fc3RybmxlbiAocGF0dGVybiwgMTAyNCk7CisjZWxzZQorICAgICAgbiA9IHN0cmxlbiAocGF0dGVybik7CisjZW5kaWYKKyAgICAgIGlmIChfX2dsaWJjX2xpa2VseSAobiA8IDEwMjQpKQorCXsKKwkgIHdwYXR0ZXJuID0gKHdjaGFyX3QgKikgYWxsb2NhX2FjY291bnQgKChuICsgMSkgKiBzaXplb2YgKHdjaGFyX3QpLAorCQkJCQkJIGFsbG9jYV91c2VkKTsKKwkgIG4gPSBtYnNydG93Y3MgKHdwYXR0ZXJuLCAmcCwgbiArIDEsICZwcyk7CisJICBpZiAoX19nbGliY191bmxpa2VseSAobiA9PSAoc2l6ZV90KSAtMSkpCisJICAgIC8qIFNvbWV0aGluZyB3cm9uZy4KKwkgICAgICAgWFhYIERvIHdlIGhhdmUgdG8gc2V0IGBlcnJubycgdG8gc29tZXRoaW5nIHdoaWNoIG1ic3J0b3dzIGhhc24ndAorCSAgICAgICBhbHJlYWR5IGRvbmU/ICAqLworCSAgICByZXR1cm4gLTE7CisJICBpZiAocCkKKwkgICAgeworCSAgICAgIG1lbXNldCAoJnBzLCAnXDAnLCBzaXplb2YgKHBzKSk7CisJICAgICAgZ290byBwcmVwYXJlX3dwYXR0ZXJuOworCSAgICB9CisJfQorICAgICAgZWxzZQorCXsKKwlwcmVwYXJlX3dwYXR0ZXJuOgorCSAgbiA9IG1ic3J0b3djcyAoTlVMTCwgJnBhdHRlcm4sIDAsICZwcyk7CisJICBpZiAoX19nbGliY191bmxpa2VseSAobiA9PSAoc2l6ZV90KSAtMSkpCisJICAgIC8qIFNvbWV0aGluZyB3cm9uZy4KKwkgICAgICAgWFhYIERvIHdlIGhhdmUgdG8gc2V0IGBlcnJubycgdG8gc29tZXRoaW5nIHdoaWNoIG1ic3J0b3dzIGhhc24ndAorCSAgICAgICBhbHJlYWR5IGRvbmU/ICAqLworCSAgICByZXR1cm4gLTE7CisJICBpZiAoX19nbGliY191bmxpa2VseSAobiA+PSAoc2l6ZV90KSAtMSAvIHNpemVvZiAod2NoYXJfdCkpKQorCSAgICB7CisJICAgICAgX19zZXRfZXJybm8gKEVOT01FTSk7CisJICAgICAgcmV0dXJuIC0yOworCSAgICB9CisJICB3cGF0dGVybl9tYWxsb2MgPSB3cGF0dGVybgorCSAgICA9ICh3Y2hhcl90ICopIG1hbGxvYyAoKG4gKyAxKSAqIHNpemVvZiAod2NoYXJfdCkpOworCSAgYXNzZXJ0IChtYnNpbml0ICgmcHMpKTsKKwkgIGlmICh3cGF0dGVybiA9PSBOVUxMKQorCSAgICByZXR1cm4gLTI7CisJICAodm9pZCkgbWJzcnRvd2NzICh3cGF0dGVybiwgJnBhdHRlcm4sIG4gKyAxLCAmcHMpOworCX0KKworICAgICAgYXNzZXJ0IChtYnNpbml0ICgmcHMpKTsKKyNpZmRlZiBfTElCQworICAgICAgbiA9IF9fc3RybmxlbiAoc3RyaW5nLCAxMDI0KTsKKyNlbHNlCisgICAgICBuID0gc3RybGVuIChzdHJpbmcpOworI2VuZGlmCisgICAgICBwID0gc3RyaW5nOworICAgICAgaWYgKF9fZ2xpYmNfbGlrZWx5IChuIDwgMTAyNCkpCisJeworCSAgd3N0cmluZyA9ICh3Y2hhcl90ICopIGFsbG9jYV9hY2NvdW50ICgobiArIDEpICog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IHRoZSBwYXR0ZXJuLgorCSAgICAgICBJZiB0aGUgbmFtZSBpcyBhIGZpbGUgbmFtZSBhbmQgY29udGFpbnMgYW5vdGhlciBzbGFzaAorCSAgICAgICB0aGlzIG1lYW5zIGl0IGNhbm5vdCBtYXRjaCwgdW5sZXNzIHRoZSBGTk1fTEVBRElOR19ESVIKKwkgICAgICAgZmxhZyBpcyBzZXQuICAqLworCSAgICB7CisJICAgICAgaW50IHJlc3VsdCA9IChmbGFncyAmIEZOTV9GSUxFX05BTUUpID09IDAgPyAwIDogRk5NX05PTUFUQ0g7CisKKwkgICAgICBpZiAoZmxhZ3MgJiBGTk1fRklMRV9OQU1FKQorCQl7CisJCSAgaWYgKGZsYWdzICYgRk5NX0xFQURJTkdfRElSKQorCQkgICAgcmVzdWx0ID0gMDsKKwkJICBlbHNlCisJCSAgICB7CisJCSAgICAgIGlmIChNRU1DSFIgKG4sIEwoJy8nKSwgc3RyaW5nX2VuZCAtIG4pID09IE5VTEwpCisJCQlyZXN1bHQgPSAwOworCQkgICAgfQorCQl9CisKKwkgICAgICByZXR1cm4gcmVzdWx0OworCSAgICB9CisJICBlbHNlCisJICAgIHsKKwkgICAgICBjb25zdCBDSEFSICplbmRwOworCSAgICAgIHN0cnVjdCBTVFJVQ1QgZW5kOworCisJICAgICAgZW5kLnBhdHRlcm4gPSBOVUxMOworCSAgICAgIGVuZHAgPSBNRU1DSFIgKG4sIChmbGFncyAmIEZOTV9GSUxFX05BTUUpID8gTCgnLycpIDogTCgnXDAnKSwKKwkJCSAgICAgc3RyaW5nX2VuZCAtIG4pOworCSAgICAgIGlmIChlbmRwID09IE5VTEwpCisJCWVuZHAgPSBzdHJpbmdfZW5kOworCisJICAgICAgaWYgKGMgPT0gTCgnWycpCisJCSAgfHwgKF9fYnVpbHRpbl9leHBlY3QgKGZsYWdzICYgRk5NX0VYVE1BVENILCAwKSAhPSAwCisJCSAgICAgICYmIChjID09IEwoJ0AnKSB8fCBjID09IEwoJysnKSB8fCBj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kJICAgIGlmIChGT0xEICgoVUNIQVIpICpuKSA9PSBjCisJCQkmJiAoRkNUIChwLCBuLCBzdHJpbmdfZW5kLCBub19sZWFkaW5nX3BlcmlvZCwgZmxhZ3MyLAorCQkJCSAmZW5kLCBhbGxvY2FfdXNlZCkgPT0gMCkpCisJCSAgICAgIHsKKwkJICAgICAgZm91bmQ6CisJCQlpZiAoZW5kLnBhdHRlcm4gPT0gTlVMTCkKKwkJCSAgcmV0dXJuIDA7CisJCQlicmVhazsKKwkJICAgICAgfQorCQkgIGlmIChlbmQucGF0dGVybiAhPSBOVUxMKQorCQkgICAgeworCQkgICAgICBwID0gZW5kLnBhdHRlcm47CisJCSAgICAgIG4gPSBlbmQuc3RyaW5nOworCQkgICAgICBub19sZWFkaW5nX3BlcmlvZCA9IGVuZC5ub19sZWFkaW5nX3BlcmlvZDsKKwkJICAgICAgY29udGludWU7CisJCSAgICB9CisJCX0KKwkgICAgfQorCisJICAvKiBJZiB3ZSBjb21lIGhlcmUgbm8gbWF0Y2ggaXMgcG9zc2libGUgd2l0aCB0aGUgd2lsZGNhcmQuICAqLworCSAgcmV0dXJuIEZOTV9OT01BVENIOworCisJY2FzZSBMKCdbJyk6CisJICB7CisJICAgIC8qIE5vbnplcm8gaWYgdGhlIHNlbnNlIG9mIHRoZSBjaGFyYWN0ZXIgY2xhc3MgaXMgaW52ZXJ0ZWQuICAqLworCSAgICBjb25zdCBDSEFSICpwX2luaXQgPSBwOworCSAgICBjb25zdCBDSEFSICpuX2luaXQgPSBuOworCSAgICBpbnQgbm90OworCSAgICBDSEFSIGNvbGQ7CisJICAgIFVDSEFSIGZuOworCisJICAgIGlmIChwb3NpeGx5X2NvcnJlY3QgPT0gMCkKKwkgICAgICBwb3NpeGx5X2NvcnJlY3QgPSBnZXRlbnYgKCJQT1NJWExZX0NPUlJFQ1QiKSAhPSBOVUxMID8gMSA6IC0xOworCisJICAgIGlmIChuID09IHN0cmluZ19lbmQpCisJICAgICAgcmV0dXJuIEZOTV9OT01BVENIOworCisJICAgIGlmICgqbiA9PSBMKCcuJykgJiYgbm9fbGVhZGluZ19wZXJpb2QpCisJICAgICAgcmV0dXJuIEZOTV9OT01BVENIOworCisJICAgIGlmICgqbiA9PSBMKCcvJykgJiYgKGZsYWdzICYgRk5NX0ZJTEVfTkFNRSkpCisJICAgICAgLyogYC8nIGNhbm5vdCBiZSBtYXRjaGVkLiAgKi8KKwkgICAgICByZXR1cm4gRk5NX05PTUFUQ0g7CisKKwkgICAgbm90ID0gKCpwID09IEwoJyEnKSB8fCAocG9zaXhseV9jb3JyZWN0IDwgMCAmJiAqcCA9PSBMKCdeJykpKTsKKwkgICAgaWYgKG5vdCkKKwkgICAgICArK3A7CisKKwkgICAgZm4gPSBGT0xEICgoVUNIQVIpICpuKTsKKworCSAgICBjID0gKnArKzsKKwkgICAgZm9yICg7OykKKwkgICAgICB7CisJCWlmICghKGZsYWdzICYgRk5NX05PRVNDQVBFKSAmJiBjID09IEwoJ1xcJykpCisJCSAgeworCQkgICAgaWYgKCpwID09IEwoJ1wwJykpCisJCSAgICAgIHJldHVybiBGTk1fTk9NQVRDSDsKKwkJICAgIGMgPSBGT0xEICgoVUNIQVIpICpwKTsKKwkJICAgICsrcDsKKworCQkgICAgZ290byBub3JtYWxfYnJhY2tldDsKKwkJICB9CisJCWVsc2UgaWYgKGMgPT0gTCgnWycpICYmICpwID09IEwoJzonKSkKKwkJICB7CisJCSAgICAvKiBMZWF2ZSByb29tIGZvciB0aGUgbnVsbC4gICovCisJCSAgICBDSEFSIHN0cltDSEFSX0NMQVNTX01BWF9MRU5HVEggKyAxXTsKKwkJICAgIHNpemVfdCBjMSA9IDA7CisjaWYgZGVmaW5lZCBfTElCQyB8fCAoZGVmaW5lZCBIQVZFX1dDVFlQRV9IICYmIGRlZmluZWQgSEFWRV9XQ0hBUl9IKQorCQkgICAgd2N0eXBlX3Qgd3Q7CisjZW5kaWYKKwkJICAgIGNvbnN0IENIQVIgKnN0YXJ0cCA9IHA7Cis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bWJfdGFibGU7CisjIGlmIFdJREVfQ0hBUl9WRVJTSU9OCisJCQkgICAgY2hhciBzdHJbYzFdOworCQkJICAgIHVuc2lnbmVkIGludCBzdHJjbnQ7CisjIGVsc2UKKyMgIGRlZmluZSBzdHIgKHN0YXJ0cCArIDEpCisjIGVuZGlmCisJCQkgICAgY29uc3QgdW5zaWduZWQgY2hhciAqZXh0cmE7CisJCQkgICAgaW50MzJfdCBpZHg7CisJCQkgICAgaW50MzJfdCBlbGVtOworCQkJICAgIGludDMyX3Qgc2Vjb25kOworCQkJICAgIGludDMyX3QgaGFzaDsKKworIyBpZiBXSURFX0NIQVJfVkVSU0lPTgorCQkJICAgIC8qIFdlIGhhdmUgdG8gY29udmVydCB0aGUgbmFtZSB0byBhIHNpbmdsZS1ieXRlCisJCQkgICAgICAgc3RyaW5nLiAgVGhpcyBpcyBwb3NzaWJsZSBzaW5jZSB0aGUgbmFtZXMKKwkJCSAgICAgICBjb25zaXN0IG9mIEFTQ0lJIGNoYXJhY3RlcnMgYW5kIHRoZSBpbnRlcm5hbAorCQkJICAgICAgIHJlcHJlc2VudGF0aW9uIGlzIFVDUzQuICAqLworCQkJICAgIGZvciAoc3RyY250ID0gMDsgc3RyY250IDwgYzE7ICsrc3RyY250KQorCQkJICAgICAgc3RyW3N0cmNudF0gPSBzdGFydHBbMSArIHN0cmNudF07CisjZW5kaWYKKworCQkJICAgIHRhYmxlX3NpemUgPQorCQkJICAgICAgX05MX0NVUlJFTlRfV09SRCAoTENfQ09MTEFURSwKKwkJCQkJCV9OTF9DT0xMQVRFX1NZTUJfSEFTSF9TSVpFTUIpOworCQkJICAgIHN5bWJfdGFibGUgPSAoY29uc3QgaW50MzJfdCAqKQorCQkJICAgICAgX05MX0NVUlJFTlQgKExDX0NPTExBVEUsCisJCQkJCSAgIF9OTF9DT0xMQVRFX1NZTUJfVEFCTEVNQik7CisJCQkgICAgZXh0cmEgPSAoY29uc3QgdW5zaWduZWQgY2hhciAqKQorCQkJICAgICA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CQkgICAgLyogWFhYIDEwMDMuMmQxMSBpcyB1bmNsZWFyIGlmIHRoaXMgaXMgcmlnaHQuICAqLworCQkgICAgKytwOworCQkgIH0KKwkJZWxzZSBpZiAoYyA9PSBMKCdbJykgJiYgKnAgPT0gTCgnOicpKQorCQkgIHsKKwkJICAgIGludCBjMSA9IDA7CisJCSAgICBjb25zdCBDSEFSICpzdGFydHAgPSBwOworCisJCSAgICB3aGlsZSAoMSkKKwkJICAgICAgeworCQkJYyA9ICorK3A7CisJCQlpZiAoKytjMSA9PSBDSEFSX0NMQVNTX01BWF9MRU5HVEgpCisJCQkgIHJldHVybiBGTk1fTk9NQVRDSDsKKworCQkJaWYgKCpwID09IEwoJzonKSAmJiBwWzFdID09IEwoJ10nKSkKKwkJCSAgYnJlYWs7CisKKwkJCWlmIChjIDwgTCgnYScpIHx8IGMgPj0gTCgneicpKQorCQkJICB7CisJCQkgICAgcCA9IHN0YXJ0cCAtIDI7CisJCQkgICAgYnJlYWs7CisJCQkgIH0KKwkJICAgICAgfQorCQkgICAgcCArPSAyOworCQkgIH0KKwkJZWxzZSBpZiAoYyA9PSBMKCdbJykgJiYgKnAgPT0gTCgnPScpKQorCQkgIHsKKwkJICAgIGMgPSAqKytwOworCQkgICAgaWYgKGMgPT0gTCgnXDAnKSkKKwkJICAgICAgcmV0dXJuIEZOTV9OT01BVENIOworCQkgICAgYyA9ICorK3A7CisJCSAgICBpZiAoYyAhPSBMKCc9JykgfHwgcFsxXSAhPSBMKCddJykpCisJCSAgICAgIHJldHVybiBGTk1fTk9NQVRDSDsKKwkJICAgIHAgKz0gMjsKKwkJICB9CisJCWVsc2UgaWYgKGMgPT0gTCgnWycpICYmICpwID09IEwoJy4nKSkKKwkJICB7CisJCSAgICB3aGlsZSAoMSkKKwkJICAgICAgeworCQkJYyA9ICorK3A7CisJCQlpZiAoYyA9PSBMKCdcMCcpKQorCQkJICByZXR1cm4gRk5NX05PTUFUQ0g7CisKKwkJCWlmIChjID09IEwoJy4nKSAmJiBwWzFdID09IEwoJ10nKSkKKwkJCSAgYnJlYWs7CisJCSAgICAgIH0KKwkJICAgIHAgKz0gMjsKKwkJICB9CisJICAgICAgfQorCSAgICBpZiAobm90KQorCSAgICAgIHJldHVybiBGTk1fTk9NQVRDSDsKKwkgIH0KKwkgIGJyZWFrOworCisJY2FzZSBMKCcrJyk6CisJY2FzZSBMKCdAJyk6CisJY2FzZSBMKCchJyk6CisJICBpZiAoX19idWlsdGluX2V4cGVjdCAoZmxhZ3MgJiBGTk1fRVhUTUFUQ0gsIDApICYmICpwID09ICcoJykKKwkgICAgeworCSAgICAgIGludCByZXMgPSBFWFQgKGMsIHAsIG4sIHN0cmluZ19lbmQsIG5vX2xlYWRpbmdfcGVyaW9kLCBmbGFncywKKwkJCSAgICAgYWxsb2NhX3VzZWQpOworCSAgICAgIGlmIChyZXMgIT0gLTEpCisJCXJldHVybiByZXM7CisJICAgIH0KKwkgIGdvdG8gbm9ybWFsX21hdGNoOworCisJY2FzZSBMKCcvJyk6CisJICBpZiAoTk9fTEVBRElOR19QRVJJT0QgKGZsYWdzKSkKKwkgICAgeworCSAgICAgIGlmIChuID09IHN0cmluZ19lbmQgfHwgYyAhPSAoVUNIQVIpICpuKQorCQlyZXR1cm4gRk5NX05PTUFUQ0g7CisKKwkgICAgICBuZXdfbm9fbGVhZGluZ19wZXJpb2QgPSAxOworCSAgICAgIGJyZWFrOworCSAgICB9CisJICAvKiBGQUxMVEhST1VHSCAqLworCWRlZmF1bHQ6CisJbm9ybWFsX21hdGNoOgorCSAgaWYgKG4gPT0gc3RyaW5nX2VuZCB8fCBjICE9IEZPTEQgKChVQ0hBUikgKm4pKQorCSAgICByZXR1cm4gRk5NX05PTUFUQ0g7CisJfQorCisgICAgICBub19sZWFkaW5nX3BlcmlvZCA9IG5ld19ub19sZWFkaW5nX3BlcmlvZDsKKyAgICAgICsrbjsKKyAgICB9CisKKyAgaWYgKG4gPT0gc3RyaW5nX2VuZCkKKyAgICByZXR1cm4gMDsKKworICBpZiAoKGZsYWdzICYgRk5NX0xFQURJTkdfRElSKSAmJiBuICE9IHN0cmluZ19lbmQgJiYgKm4gPT0gTCgnLycpKQorICAgIC8qIFRoZSBGTk1fTEVBRElOR19ESVIgZmxhZyBzYXlzIHRoYXQgImZvbyoiIG1hdGNoZXMgImZvb2Jhci9mcm9ib3p6Ii4gICovCisgICAgcmV0dXJuIDA7CisKKyAgcmV0dXJuIEZOTV9OT01BVENIOworfQorCisKK3N0YXRpYyBjb25zdCBDSEFSICoKK2ludGVybmFsX2Z1bmN0aW9uCitFTkQgKGNvbnN0IENIQVIgKnBhdHRlcm4pCit7CisgIGNvbnN0IENIQVIgKnAgPSBwYXR0ZXJuOworCisgIHdoaWxlICgxKQorICAgIGlmICgqKytwID09IEwoJ1wwJykpCisgICAgICAvKiBUaGlzIGlzIGFuIGludmFsaWQgcGF0dGVybi4gICovCisgICAgICByZXR1cm4gcGF0dGVybjsKKyAgICBlbHNlIGlmICgqcCA9PSBMKCdbJykpCisgICAgICB7CisJLyogSGFuZGxlIGJyYWNrZXRzIHNwZWNpYWwuICAqLworCWlmIChwb3NpeGx5X2NvcnJlY3QgPT0gMCkKKwkgIHBvc2l4bHlfY29ycmVjdCA9IGdldGVudiAoIlBPU0lYTFlfQ09SUkVDVCIpICE9IE5VTEwgPyAxIDogLTE7CisKKwkvKiBTa2lwIHRoZSBub3Qgc2lnbi4gIFdlIGhhdmUgdG8gcmVjb2duaXplIGl0IGJlY2F1c2Ugb2YgYSBwb3NzaWJseQorCSAgIGZvbGxvd2luZyAnXScuICAqLworCWlmICgqKytwID09IEwoJyEnKSB8fCAocG9zaXhseV9jb3JyZWN0IDwgMCAmJiAqcCA9PSBMKCdeJykpKQorCSAgKytwOworCS8qIEEgbGVhZGluZyAnXScgaXMgcmVjb2duaXplZCBhcyBzdWNoLiAgKi8KKwlpZiAoKnAgPT0gTCgnXScpKQorCSAgKytwOworCS8qIFNraXAgb3ZlciBhbGwgY2hhcmFjdGVycyBv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J1wwJykpCisJICAgIHsKKwkgICAgICAvKiBUaGlzIGlzIG5vIHZhbGlkIHBhdHRlcm4uICAqLworCSAgICAgIHJldHZhbCA9IC0xOworCSAgICAgIGdvdG8gb3V0OworCSAgICB9CisgICAgICB9CisgICAgZWxzZSBpZiAoKCpwID09IEwoJz8nKSB8fCAqcCA9PSBMKCcqJykgfHwgKnAgPT0gTCgnKycpIHx8ICpwID09IEwoJ0AnKQorCSAgICAgIHx8ICpwID09IEwoJyEnKSkgJiYgcFsxXSA9PSBMKCcoJykpCisgICAgICAvKiBSZW1lbWJlciB0aGUgbmVzdGluZyBsZXZlbC4gICovCisgICAgICArK2xldmVsOworICAgIGVsc2UgaWYgKCpwID09IEwoJyknKSkKKyAgICAgIHsKKwlpZiAobGV2ZWwtLSA9PSAwKQorCSAgeworCSAgICAvKiBUaGlzIG1lYW5zIHdlIGZvdW5kIHRoZSBlbmQgb2YgdGhlIHBhdHRlcm4uICAqLworI2RlZmluZSBORVdfUEFUVEVSTiBcCisJICAgIHN0cnVjdCBwYXR0ZXJubGlzdCAqbmV3cDsJCQkJCSAgICAgIFwKKwkgICAgc2l6ZV90IHNsZW4gPSAob3B0ID09IEwoJz8nKSB8fCBvcHQgPT0gTCgnQCcpCQkgICAgICBcCisJCQkgICA/IHBhdHRlcm5fbGVuIDogKHAgLSBzdGFydHAgKyAxKSk7CQkgICAgICBcCisJICAgIHNsZW4gPSBzaXplb2YgKHN0cnVjdCBwYXR0ZXJubGlzdCkgKyAoc2xlbiAqIHNpemVvZiAoQ0hBUikpOyAgICAgIFwKKwkgICAgaW50IG1hbGxvY2VkID0gISBfX2xpYmNfdXNlX2FsbG9jYSAoYWxsb2NhX3VzZWQgKyBzbGVuKTsJICAgICAgXAorCSAgICBpZiAoX19idWlsdGluX2V4cGVjdCAobWFsbG9jZWQsIDApKQkJCQkgICAgICBcCisJICAgICAgewkJCQkJCQkJICAgICAgXAorCQluZXdwID0gbWFsbG9jIChzbGVuKTsJCQkJCSAgICA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1YmxpYworICAgTGljZW5zZSBhbG9uZyB3aXRoIHRoZSBHTlUgQyBMaWJyYXJ5OyBpZiBub3QsIHNlZQorICAgPGh0dHA6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KKworI2luY2x1ZGUgPGVycm5vLmg+CisjaW5jbHVkZSA8c3RkZGVmLmg+CisjaW5jbHVkZSA8dW5pc3RkLmg+CisKKworLyogR2V0IGZpbGUtc3BlY2lmaWMgaW5mb3JtYXRpb24gYWJvdXQgZGVzY3JpcHRvciBGRC4gICovCitsb25nIGludAorX19mcGF0aGNvbmYgKGZkLCBuYW1lKQorICAgICBpbnQgZmQ7CisgICAgIGludCBuYW1lOworeworICBpZiAoZmQgPCAwKQorICAgIHsKKyAgICAgIF9fc2V0X2Vycm5vIChFQkFERik7CisgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgIHN3aXRjaCAobmFtZSkKKyAgICB7CisgICAgZGVmYXVsdDoKKyAgICAgIF9fc2V0X2Vycm5vIChFSU5WQUwpOworICAgICAgcmV0dXJuIC0xOworCisgICAgY2FzZSBfUENfTElOS19NQVg6CisgICAgY2FzZSBfUENfTUFYX0NBTk9OOgorICAgIGNhc2UgX1BDX01BWF9JTlBVVDoKKyAgICBjYXNlIF9QQ19OQU1FX01BWDoKKyAgICBjYXNlIF9QQ19QQVRIX01BWDoKKyAgICBjYXNlIF9QQ19QSVBFX0JVRjoKKyAgICBjYXNlIF9QQ19TT0NLX01BWEJVRjoKKyAgICBjYXNlIF9QQ19DSE9XTl9SRVNUUklDVEVEOgorICAgIGNhc2UgX1BDX05PX1RSVU5DOgorICAgIGNhc2UgX1BDX1ZESVNBQkxFOgorICAgICAgYnJlYWs7CisgICAgfQorCisgIF9fc2V0X2Vycm5vIChFTk9TWVMpOworICByZXR1cm4gLTE7Cit9CisKK3dlYWtfYWxpYXMgKF9fZnBhdGhjb25mLCBmcGF0aGNvbmYpCisKK3N0dWJfd2FybmluZyAoZnBhdGhjb25mKQpkaWZmI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AKKwkgICAgJiYgc3RyY21wIChjLT5uYW1lICsgNywgYXJndlthaV0pID09IDApKQorICAgICAgeworCWxvbmcgaW50IHZhbHVlOworCXNpemVfdCBjbGVuOworCWNoYXIgKmN2YWx1ZTsKKwlzd2l0Y2ggKGMtPmNhbGwpCisJICB7CisJICBjYXNlIFBBVEhDT05GOgorCSAgICBpZiAoYXJnYyAtIGFpIDwgMikKKwkgICAgICB1c2FnZSAoKTsKKwkgICAgZXJybm8gPSAwOworCSAgICB2YWx1ZSA9IHBhdGhjb25mIChhcmd2W2FpICsgMV0sIGMtPmNhbGxfbmFtZSk7CisJICAgIGlmICh2YWx1ZSA9PSAtMSkKKwkgICAgICB7CisJCWlmIChlcnJubykKKwkJICBlcnJvciAoMywgZXJybm8sICJwYXRoY29uZjogJXMiLCBhcmd2W2FpICsgMV0pOworCQllbHNlCisJCSAgcHV0cyAoXygidW5kZWZpbmVkIikpOworCSAgICAgIH0KKwkgICAgZWxzZQorCSAgICAgIHByaW50ZiAoIiVsZFxuIiwgdmFsdWUpOworCSAgICBleGl0ICgwKTsKKworCSAgY2FzZSBTWVNDT05GOgorCSAgICBpZiAoYXJnYyAtIGFpID4gMSkKKwkgICAgICB1c2FnZSAoKTsKKwkgICAgdmFsdWUgPSBzeXNjb25mIChjLT5jYWxsX25hbWUpOworCSAgICBpZiAodmFsdWUgPT0gLTFsKQorCSAgICAgIHsKKwkJaWYgKGMtPmNhbGxfbmFtZSA9PSBfU0NfVUlOVF9NQVgKKwkJICAgIHx8IGMtPmNhbGxfbmFtZSA9PSBfU0NfVUxPTkdfTUFYKQorCQkgIHByaW50ZiAoIiVsdVxuIiwgdmFsdWUpOworCQllbHNlCisJCSAgcHV0cyAoXygidW5kZWZpbmVkIikpOworCSAgICAgIH0KKwkgICAgZWxzZQorCSAgICAgIHByaW50ZiAoIiVsZFxuIiwgdmFsdWUpOworCSAgICBleGl0ICgwKTsKKworCSAgY2FzZSBDT05GU1RSOgorCSAgICBpZiAoYXJnYyAt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dGhlIG9yZGVyaW5nIG9mIG9wdGlvbnMgYW5kIG5vbm9wdGlvbnMuICAqLworCisgIGlmIChvcHRzdHJpbmdbMF0gPT0gJy0nKQorICAgIHsKKyAgICAgIGQtPl9fb3JkZXJpbmcgPSBSRVRVUk5fSU5fT1JERVI7CisgICAgICArK29wdHN0cmluZzsKKyAgICB9CisgIGVsc2UgaWYgKG9wdHN0cmluZ1swXSA9PSAnKycpCisgICAgeworICAgICAgZC0+X19vcmRlcmluZyA9IFJFUVVJUkVfT1JERVI7CisgICAgICArK29wdHN0cmluZzsKKyAgICB9CisgIGVsc2UgaWYgKGQtPl9fcG9zaXhseV9jb3JyZWN0KQorICAgIGQtPl9fb3JkZXJpbmcgPSBSRVFVSVJFX09SREVSOworICBlbHNlCisgICAgZC0+X19vcmRlcmluZyA9IFBFUk1VVEU7CisKKyNpZiBkZWZpbmVkIF9MSUJDICYmIGRlZmluZWQgVVNFX05PTk9QVElPTl9GTEFHUworICBpZiAoIWQtPl9fcG9zaXhseV9jb3JyZWN0CisgICAgICAmJiBhcmdjID09IF9fbGliY19hcmdjICYmIGFyZ3YgPT0gX19saWJjX2FyZ3YpCisgICAgeworICAgICAgaWYgKGQtPl9fbm9ub3B0aW9uX2ZsYWdzX21heF9sZW4gPT0gMCkKKwl7CisJICBpZiAoX19nZXRvcHRfbm9ub3B0aW9uX2ZsYWdzID09IE5VTEwKKwkgICAgICB8fCBfX2dldG9wdF9ub25vcHRpb25fZmxhZ3NbMF0gPT0gJ1wwJykKKwkgICAgZC0+X19ub25vcHRpb25fZmxhZ3NfbWF4X2xlbiA9IC0xOworCSAgZWxzZQorCSAgICB7CisJICAgICAgY29uc3QgY2hhciAqb3JpZ19zdHIgPSBfX2dldG9wdF9ub25vcHRpb25fZmxhZ3M7CisJICAgICAgaW50IGxlbiA9IGQtPl9fbm9ub3B0aW9uX2ZsYWdzX21heF9sZW4gPSBzdHJsZW4gKG9yaWdfc3RyKTsKKwkgICAgICBpZiAoZC0+X19ub25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mKTsKKwkJCSAgfQorI2Vsc2UKKwkJCWZwcmludGYgKHN0ZGVyciwgXygiXAorJXM6IG9wdGlvbiAnLVcgJXMnIHJlcXVpcmVzIGFuIGFyZ3VtZW50XG4iKSwKKwkJCQkgYXJndlswXSwgcGZvdW5kLT5uYW1lKTsKKyNlbmRpZgorCQkgICAgICB9CisJCSAgICBkLT5fX25leHRjaGFyICs9IHN0cmxlbiAoZC0+X19uZXh0Y2hhcik7CisJCSAgICByZXR1cm4gb3B0c3RyaW5nWzBdID09ICc6JyA/ICc6JyA6ICc/JzsKKwkJICB9CisJICAgICAgfQorCSAgICBlbHNlCisJICAgICAgZC0+b3B0YXJnID0gTlVMTDsKKwkgICAgZC0+X19uZXh0Y2hhciArPSBzdHJsZW4gKGQtPl9fbmV4dGNoYXIpOworCSAgICBpZiAobG9uZ2luZCAhPSBOVUxMKQorCSAgICAgICpsb25naW5kID0gb3B0aW9uX2luZGV4OworCSAgICBpZiAocGZvdW5kLT5mbGFnKQorCSAgICAgIHsKKwkJKihwZm91bmQtPmZsYWcpID0gcGZvdW5kLT52YWw7CisJCXJldHVybiAwOworCSAgICAgIH0KKwkgICAgcmV0dXJuIHBmb3VuZC0+dmFsOworCSAgfQorCisgICAgICBub19sb25nczoKKwlkLT5fX25leHRjaGFyID0gTlVMTDsKKwlyZXR1cm4gJ1cnOwkvKiBMZXQgdGhlIGFwcGxpY2F0aW9uIGhhbmRsZSBpdC4gICAqLworICAgICAgfQorICAgIGlmICh0ZW1wWzFdID09ICc6JykKKyAgICAgIHsKKwlpZiAodGVtcFsyXSA9PSAnOicpCisJICB7CisJICAgIC8qIFRoaXMgaXMgYW4gb3B0aW9uIHRoYXQgYWNjZXB0cyBhbiBhcmd1bWVudCBvcHRpb25hbGx5LiAgKi8KKwkgICAgaWYgKCpkLT5fX25leHRjaGFyICE9ICdcMCcpCisJICAgICAgeworCQlkLT5vcHRhcmcgPSBkLT5fX25leHRjaGFyOworCQlkLT5vcHRpbmQrKzsKKwkg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29ubHksICZnZXRvcHRfZGF0YSwKKwkJCSAgICAgICBwb3NpeGx5X2NvcnJlY3QpOworCisgIG9wdGluZCA9IGdldG9wdF9kYXRhLm9wdGluZDsKKyAgb3B0YXJnID0gZ2V0b3B0X2RhdGEub3B0YXJnOworICBvcHRvcHQgPSBnZXRvcHRfZGF0YS5vcHRvcHQ7CisKKyAgcmV0dXJuIHJlc3VsdDsKK30KKworaW50CitnZXRvcHQgKGludCBhcmdjLCBjaGFyICpjb25zdCAqYXJndiwgY29uc3QgY2hhciAqb3B0c3RyaW5nKQoreworICByZXR1cm4gX2dldG9wdF9pbnRlcm5hbCAoYXJnYywgYXJndiwgb3B0c3RyaW5nLAorCQkJICAgKGNvbnN0IHN0cnVjdCBvcHRpb24gKikgMCwKKwkJCSAgIChpbnQgKikgMCwKKwkJCSAgIDAsIDApOworfQorCisjaWZkZWYgX0xJQkMKK2ludAorX19wb3NpeF9nZXRvcHQgKGludCBhcmdjLCBjaGFyICpjb25zdCAqYXJndiwgY29uc3QgY2hhciAqb3B0c3RyaW5nKQoreworICByZXR1cm4gX2dldG9wdF9pbnRlcm5hbCAoYXJnYywgYXJndiwgb3B0c3RyaW5nLAorCQkJICAgKGNvbnN0IHN0cnVjdCBvcHRpb24gKikgMCwKKwkJCSAgIChpbnQgKikgMCwKKwkJCSAgIDAsIDEpOworfQorI2VuZGlmCisKKyNlbmRpZgkvKiBOb3QgRUxJREVfQ09ERS4gICovCisMCisjaWZkZWYgVEVTVAorCisvKiBDb21waWxlIHdpdGggLURURVNUIHRvIG1ha2UgYW4gZXhlY3V0YWJsZSBmb3IgdXNlIGluIHRlc3RpbmcKKyAgIHRoZSBhYm92ZSBkZWZpbml0aW9uIG9mIGBnZXRvcHQnLiAgKi8KKworaW50CittYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCit7CisgIGludCBjOworICBpbnQgZGlnaXRfb3B0aW5kID0gMDsKKworICB3aGlsZSAoMSkKKyAgICB7CisgICAgICBpbnQgdGhpc19vcHRpb25fb3B0aW5kID0gb3B0aW5kID8gb3B0aW5kIDogMTsKKworICAgICAgYyA9IGdldG9wdCAoYXJnYywgYXJndiwgImFiYzpkOjAxMjM0NTY3ODkiKTsKKyAgICAgIGlmIChjID09IC0xKQorCWJyZWFrOworCisgICAgICBzd2l0Y2ggKGMpCisJeworCWNhc2UgJzAnOgorCWNhc2UgJzEnOgorCWNhc2UgJzInOgorCWNhc2UgJzMnOgorCWNhc2UgJzQnOgorCWNhc2UgJzUnOgorCWNhc2UgJzYnOgorCWNhc2UgJzcnOgorCWNhc2UgJzgnOgorCWNhc2UgJzknOgorCSAgaWYgKGRpZ2l0X29wdGluZCAhPSAwICYmIGRpZ2l0X29wdGluZCAhPSB0aGlzX29wdGlvbl9vcHRpbmQpCisJICAgIHByaW50ZiAoImRpZ2l0cyBvY2N1ciBpbiB0d28gZGlmZmVyZW50IGFyZ3YtZWxlbWVudHMuXG4iKTsKKwkgIGRpZ2l0X29wdGluZCA9IHRoaXNfb3B0aW9uX29wdGluZDsKKwkgIHByaW50ZiAoIm9wdGlvbiAlY1xuIiwgYyk7CisJICBicmVhazsKKworCWNhc2UgJ2EnOgorCSAgcHJpbnRmICgib3B0aW9uIGFcbiIpOworCSAgYnJlYWs7CisKKwljYXNlICdiJzoKKwkgIHByaW50ZiAoIm9wdGlvbiBiXG4iKTsKKwkgIGJyZWFrOworCisJY2FzZSAnYyc6CisJICBwcmludGYgKCJvcHRpb24gYyB3aXRoIHZhbHVlICclcydcbiIsIG9wdGFyZyk7CisJICBicmVhazsKKworCWNhc2UgJz8nOgorCSAgYnJlYWs7CisKKwlkZWZhdWx0OgorCSAgcHJpbnRmICgiPz8gZ2V0b3B0IHJldHVybmVkIGNoYXJhY3RlciBjb2RlIDAlbyA/P1xuIiwgYyk7CisJfQorICAgIH0KKworICBpZiAob3B0aW5kIDwgYXJnYykKKyAgICB7CisgICAgICBwcmludGYgKCJub24tb3B0aW9uIEFSR1YtZWxlbWVudHM6ICIpOworICA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CQkgIGlmICghKGZsYWdzICYgR0xPQl9BUFBFTkQpKQorCQkgICAgeworCQkgICAgICBnbG9iZnJlZSAocGdsb2IpOworCQkgICAgICBwZ2xvYi0+Z2xfcGF0aGMgPSAwOworCQkgICAgfQorCQkgIHJldHVybiByZXN1bHQ7CisJCX0KKworCSAgICAgIGlmICgqbmV4dCA9PSAnfScpCisJCS8qIFdlIHNhdyB0aGUgbGFzdCBlbnRyeS4gICovCisJCWJyZWFrOworCisJICAgICAgcCA9IG5leHQgKyAxOworCSAgICAgIG5leHQgPSBuZXh0X2JyYWNlX3N1YiAocCwgZmxhZ3MpOworCSAgICAgIGFzc2VydCAobmV4dCAhPSBOVUxMKTsKKwkgICAgfQorCisjaWZkZWYgX0xJQkMKKwkgIGlmIChfX2dsaWJjX3VubGlrZWx5ICghYWxsb2NhX29uZWFsdCkpCisjZW5kaWYKKwkgICAgZnJlZSAob25lYWx0KTsKKworCSAgaWYgKHBnbG9iLT5nbF9wYXRoYyAhPSBmaXJzdGMpCisJICAgIC8qIFdlIGZvdW5kIHNvbWUgZW50cmllcy4gICovCisJICAgIHJldHVybiAwOworCSAgZWxzZSBpZiAoIShmbGFncyAmIChHTE9CX05PQ0hFQ0t8R0xPQl9OT01BR0lDKSkpCisJICAgIHJldHVybiBHTE9CX05PTUFUQ0g7CisJfQorICAgIH0KKworICBpZiAoIShmbGFncyAmIEdMT0JfQVBQRU5EKSkKKyAgICB7CisgICAgICBwZ2xvYi0+Z2xfcGF0aGMgPSAwOworICAgICAgaWYgKCEoZmxhZ3MgJiBHTE9CX0RPT0ZGUykpCisJcGdsb2ItPmdsX3BhdGh2ID0gTlVMTDsKKyAgICAgIGVsc2UKKwl7CisJICBzaXplX3QgaTsKKworCSAgaWYgKHBnbG9iLT5nbF9vZmZzID49IH4oKHNpemVfdCkgMCkgLyBzaXplb2YgKGNoYXIgKikpCisJICAgIHJldHVybiBHTE9CX05PU1BBQ0U7CisKKwkgIHBnbG9iLT5nbF9wYXRodiA9ICh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worCSAgICB9CisjICBlbmRpZiAvKiBXSU5ET1dTMzIgKi8KKyMgZW5kaWYKKwkgIC8qIE5vdyBjb25zdHJ1Y3QgdGhlIGZ1bGwgZGlyZWN0b3J5LiAgKi8KKwkgIGlmIChkaXJuYW1lWzFdID09ICdcMCcpCisJICAgIHsKKwkgICAgICBpZiAoX19nbGliY191bmxpa2VseSAobWFsbG9jX2Rpcm5hbWUpKQorCQlmcmVlIChkaXJuYW1lKTsKKworCSAgICAgIGRpcm5hbWUgPSBob21lX2RpcjsKKwkgICAgICBkaXJsZW4gPSBzdHJsZW4gKGRpcm5hbWUpOworCSAgICAgIG1hbGxvY19kaXJuYW1lID0gbWFsbG9jX2hvbWVfZGlyOworCSAgICB9CisJICBlbHNlCisJICAgIHsKKwkgICAgICBjaGFyICpuZXdwOworCSAgICAgIHNpemVfdCBob21lX2xlbiA9IHN0cmxlbiAoaG9tZV9kaXIpOworCSAgICAgIGludCB1c2VfYWxsb2NhID0gX19saWJjX3VzZV9hbGxvY2EgKGFsbG9jYV91c2VkCisJCQkJCQkgICsgaG9tZV9sZW4gKyBkaXJsZW4pOworCSAgICAgIGlmICh1c2VfYWxsb2NhKQorCQluZXdwID0gYWxsb2NhX2FjY291bnQgKGhvbWVfbGVuICsgZGlybGVuLCBhbGxvY2FfdXNlZCk7CisJICAgICAgZWxzZQorCQl7CisJCSAgbmV3cCA9IG1hbGxvYyAoaG9tZV9sZW4gKyBkaXJsZW4pOworCQkgIGlmIChuZXdwID09IE5VTEwpCisJCSAgICB7CisJCSAgICAgIGlmIChfX2dsaWJjX3VubGlrZWx5IChtYWxsb2NfaG9tZV9kaXIpKQorCQkJZnJlZSAoaG9tZV9kaXIpOworCQkgICAgICByZXR2YWwgPSBHTE9CX05PU1BBQ0U7CisJCSAgICAgIGdvdG8gb3V0OworCQkgICAgfQorCQl9CisKKwkgICAgICBtZW1wY3B5IChtZW1wY3B5IChuZXdwLCBob21lX2RpciwgaG9tZV9sZW4pLAorCQkgICAgICAg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sKKyAgICAgIGlmIChuZXcgPT0gTlVMTCkKKwl7CisJICB3aGlsZSAoaSA+IDApCisJICAgIGZyZWUgKGFycmF5Wy0taV0pOworCSAgcmV0dXJuIDE7CisJfQorCisgICAgICB7CisJY2hhciAqZW5kcCA9IG1lbXBjcHkgKG5ldywgZGlybmFtZSwgZGlybGVuKTsKKwkqZW5kcCsrID0gRElSU0VQX0NIQVI7CisJbWVtcGNweSAoZW5kcCwgYXJyYXlbaV0sIGVsdGxlbik7CisgICAgICB9CisgICAgICBmcmVlIChhcnJheVtpXSk7CisgICAgICBhcnJheVtpXSA9IG5ldzsKKyAgICB9CisKKyAgcmV0dXJuIDA7Cit9CisKKworLyogV2UgbXVzdCBub3QgY29tcGlsZSB0aGlzIGZ1bmN0aW9uIHR3aWNlLiAgKi8KKyNpZiAhZGVmaW5lZCBfTElCQyB8fCAhZGVmaW5lZCBOT19HTE9CX1BBVFRFUk5fUAoraW50CitfX2dsb2JfcGF0dGVybl90eXBlIChwYXR0ZXJuLCBxdW90ZSkKKyAgICAgY29uc3QgY2hhciAqcGF0dGVybjsKKyAgICAgaW50IHF1b3RlOworeworICBjb25zdCBjaGFyICpwOworICBpbnQgcmV0ID0gMDsKKworICBmb3IgKHAgPSBwYXR0ZXJuOyAqcCAhPSAnXDAnOyArK3ApCisgICAgc3dpdGNoICgqcCkKKyAgICAgIHsKKyAgICAgIGNhc2UgJz8nOgorICAgICAgY2FzZSAnKic6CisJcmV0dXJuIDE7CisKKyAgICAgIGNhc2UgJ1xcJzoKKwlpZiAocXVvdGUpCisJICB7CisJICAgIGlmIChwWzFdICE9ICdcMCcpCisJICAgICAgKytwOworCSAgICByZXQgfD0gMjsKKwkgIH0KKwlicmVhazsKKworICAgICAgY2FzZSAnWyc6CisJcmV0IHw9IDQ7CisJYnJlYWs7CisKKyAgICAgIGNhc2UgJ10nOgorCWlmIChyZXQgJiA0KQorCSAgcmV0dXJuIDE7CisJYnJlYWs7CisgICAgICB9CisKKyAgcmV0dXJ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T0ZGNjQKKyAgVjZfTFBCSUdfT0ZGQklHCisgIFY3X0lMUDMyX09GRjMyCisgIFY3X0lMUDMyX09GRkJJRworICBWN19MUDY0X09GRjY0CisgIFY3X0xQQklHX09GRkJJRworfQorCitTWVNDT05GIFBPU0lYIHsKKyAgQURWSVNPUllfSU5GTworICBBUkdfTUFYCisgIEFTWU5DSFJPTk9VU19JTworICBCQVJSSUVSUworICBCQVNFCisgIENISUxEX01BWAorICBDX0xBTkdfU1VQUE9SVAorICBDX0xBTkdfU1VQUE9SVF9SCisgIENMT0NLX1NFTEVDVElPTgorICBDUFVUSU1FCisgIERFVklDRV9JTworICBERVZJQ0VfU1BFQ0lGSUMKKyAgREVWSUNFX1NQRUNJRklDX1IKKyAgRkRfTUdNVAorICBGSUZPCisgIEZJTEVfQVRUUklCVVRFUworICBGSUxFX0xPQ0tJTkcKKyAgRklMRV9TWVNURU0KKyAgRlNZTkMKKyAgSk9CX0NPTlRST0wKKyAgTUFQUEVEX0ZJTEVTCisgIE1FTUxPQ0sKKyAgTUVNTE9DS19SQU5HRQorICBNRU1PUllfUFJPVEVDVElPTgorICBNRVNTQUdFX1BBU1NJTkcKKyAgTU9OT1RPTklDX0NMT0NLCisgIE1VTFRJX1BST0NFU1MKKyAgTkVUV09SS0lORworICBOR1JPVVBTX01BWAorICBPUEVOX01BWAorICBQSUkKKyAgUElJX0lOVEVSTkVUCisgIFBJSV9JTlRFUk5FVF9ER1JBTQorICBQSUlfSU5URVJORVRfU1RSRUFNCisgIFBJSV9PU0kKKyAgUElJX09TSV9DTFRTCisgIFBJSV9PU0lfQ09UUworICBQSUlfT1NJX00KKyAgUElJX1NPQ0tFVAorICBQSUlfWFRJCisgIFBJUEUKKyAgUE9MTAorICBQUklPUklUSVpFRF9JTworICBQUklPUklUWV9TQ0hFRFVMSU5HCisgIFJFQURFUl9XUklURVJfTE9DS1MKKyAgUkVBTFRJTUVfU0lHTkFMUworICBSRUdFWFAKKyAgU0FWRURfSURTCisgIFNFT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QgKmlucHV0LCByZV90b2tlbl90ICp0b2tlbiwKKwkJCSByZWdfc3ludGF4X3Qgc3ludGF4KTsKK3N0YXRpYyBpbnQgcGVla190b2tlbiAocmVfdG9rZW5fdCAqdG9rZW4sIHJlX3N0cmluZ190ICppbnB1dCwKKwkJCXJlZ19zeW50YXhfdCBzeW50YXgpIGludGVybmFsX2Z1bmN0aW9uOworc3RhdGljIGJpbl90cmVlX3QgKnBhcnNlIChyZV9zdHJpbmdfdCAqcmVnZXhwLCByZWdleF90ICpwcmVnLAorCQkJICByZWdfc3ludGF4X3Qgc3ludGF4LCByZWdfZXJyY29kZV90ICplcnIpOworc3RhdGljIGJpbl90cmVlX3QgKnBhcnNlX3JlZ19leHAgKHJlX3N0cmluZ190ICpyZWdleHAsIHJlZ2V4X3QgKnByZWcsCisJCQkJICByZV90b2tlbl90ICp0b2tlbiwgcmVnX3N5bnRheF90IHN5bnRheCwKKwkJCQkgIGludCBuZXN0LCByZWdfZXJyY29kZV90ICplcnIpOworc3RhdGljIGJpbl90cmVlX3QgKnBhcnNlX2JyYW5jaCAocmVfc3RyaW5nX3QgKnJlZ2V4cCwgcmVnZXhfdCAqcHJlZywKKwkJCQkgcmVfdG9rZW5fdCAqdG9rZW4sIHJlZ19zeW50YXhfdCBzeW50YXgsCisJCQkJIGludCBuZXN0LCByZWdfZXJyY29kZV90ICplcnIpOworc3RhdGljIGJpbl90cmVlX3QgKnBhcnNlX2V4cHJlc3Npb24gKHJlX3N0cmluZ190ICpyZWdleHAsIHJlZ2V4X3QgKnByZWcsCisJCQkJICAgICByZV90b2tlbl90ICp0b2tlbiwgcmVnX3N5bnRheF90IHN5bnRheCwKKwkJCQkgICAgIGludCBuZXN0LCByZWdfZXJyY29kZV90ICplcnIpOworc3RhdGljIGJpbl90cmVlX3QgKnBhcnNlX3N1Yl9leHAgKHJlX3N0cmluZ190ICpyZWdleHAsIHJlZ2V4X3QgKnByZWcsCisJCQkJICByZV90b2tlbl90ICp0b2tlbiwgcmV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uICAqLworc3RhdGljIHN0cnVjdCByZV9wYXR0ZXJuX2J1ZmZlciByZV9jb21wX2J1ZjsKKworY2hhciAqCisjIGlmZGVmIF9MSUJDCisvKiBNYWtlIHRoZXNlIGRlZmluaXRpb25zIHdlYWsgaW4gbGliYywgc28gUE9TSVggcHJvZ3JhbXMgY2FuIHJlZGVmaW5lCisgICB0aGVzZSBuYW1lcyBpZiB0aGV5IGRvbid0IHVzZSBvdXIgZnVuY3Rpb25zLCBhbmQgc3RpbGwgdXNlCisgICByZWdjb21wL3JlZ2V4ZWMgYWJvdmUgd2l0aG91dCBsaW5rIGVycm9ycy4gICovCit3ZWFrX2Z1bmN0aW9uCisjIGVuZGlmCityZV9jb21wIChzKQorICAgICBjb25zdCBjaGFyICpzOworeworICByZWdfZXJyY29kZV90IHJldDsKKyAgY2hhciAqZmFzdG1hcDsKKworICBpZiAoIXMpCisgICAgeworICAgICAgaWYgKCFyZV9jb21wX2J1Zi5idWZmZXIpCisJcmV0dXJuIGdldHRleHQgKCJObyBwcmV2aW91cyByZWd1bGFyIGV4cHJlc3Npb24iKTsKKyAgICAgIHJldHVybiAwOworICAgIH0KKworICBpZiAocmVfY29tcF9idWYuYnVmZmVyKQorICAgIHsKKyAgICAgIGZhc3RtYXAgPSByZV9jb21wX2J1Zi5mYXN0bWFwOworICAgICAgcmVfY29tcF9idWYuZmFzdG1hcCA9IE5VTEw7CisgICAgICBfX3JlZ2ZyZWUgKCZyZV9jb21wX2J1Zik7CisgICAgICBtZW1zZXQgKCZyZV9jb21wX2J1ZiwgJ1wwJywgc2l6ZW9mIChyZV9jb21wX2J1ZikpOworICAgICAgcmVfY29tcF9idWYuZmFzdG1hcCA9IGZhc3RtYXA7CisgICAgfQorCisgIGlmIChyZV9jb21wX2J1Zi5mYXN0bWFwID09IE5VTEwpCisgICAgeworICAgICAgcmVfY29tcF9idWYuZmFzdG1hcCA9IChjaGFyICopIG1hbGxvYyAoU0JDX01BWCk7CisgICAgICBpZiAocmVfY29tc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JICB2b2lkICpleHRyYSkKK3sKKyAgYmluX3RyZWVfdCAqbm9kZTsKKworICBmb3IgKG5vZGUgPSByb290OyA7ICkKKyAgICB7CisgICAgICByZWdfZXJyY29kZV90IGVyciA9IGZuIChleHRyYSwgbm9kZSk7CisgICAgICBpZiAoQkUgKGVyciAhPSBSRUdfTk9FUlJPUiwgMCkpCisJcmV0dXJuIGVycjsKKworICAgICAgLyogR28gdG8gdGhlIGxlZnQgbm9kZSwgb3IgdXAgYW5kIHRvIHRoZSByaWdodC4gICovCisgICAgICBpZiAobm9kZS0+bGVmdCkKKwlub2RlID0gbm9kZS0+bGVmdDsKKyAgICAgIGVsc2UKKwl7CisJICBiaW5fdHJlZV90ICpwcmV2ID0gTlVMTDsKKwkgIHdoaWxlIChub2RlLT5yaWdodCA9PSBwcmV2IHx8IG5vZGUtPnJpZ2h0ID09IE5VTEwpCisJICAgIHsKKwkgICAgICBwcmV2ID0gbm9kZTsKKwkgICAgICBub2RlID0gbm9kZS0+cGFyZW50OworCSAgICAgIGlmICghbm9kZSkKKwkJcmV0dXJuIFJFR19OT0VSUk9SOworCSAgICB9CisJICBub2RlID0gbm9kZS0+cmlnaHQ7CisJfQorICAgIH0KK30KKworLyogT3B0aW1pemF0aW9uIHBhc3M6IGlmIGEgU1VCRVhQIGlzIGVudGlyZWx5IGNvbnRhaW5lZCwgc3RyaXAgaXQgYW5kIHRlbGwKKyAgIHJlX3NlYXJjaF9pbnRlcm5hbCB0byBtYXAgdGhlIGlubmVyIG9uZSdzIG9wci5pZHggdG8gdGhpcyBvbmUncy4gIEFkanVzdAorICAgYmFja3JlZmVyZW5jZXMgYXMgd2VsbC4gIFJlcXVpcmVzIGEgcHJlb3JkZXIgdmlzaXQuICAqLworc3RhdGljIHJlZ19lcnJjb2RlX3QKK29wdGltaXplX3N1YmV4cHMgKHZvaWQgKmV4dHJhLCBiaW5fdHJlZV90ICpub2RlKQoreworICByZV9kZmFfdCAqZGZhID0gKHJlX2RmYV90ICopIGV4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NyY10ubmVsZW07ICsraWR4KQorCXsKKwkgIHJldCA9IHJlX25vZGVfc2V0X2luc2VydF9sYXN0IChkZmEtPmludmVjbG9zdXJlcyArIGVsZW1zW2lkeF0sIHNyYyk7CisJICBpZiAoQkUgKHJldCA9PSAtMSwgMCkpCisJICAgIHJldHVybiBSRUdfRVNQQUNFOworCX0KKyAgICB9CisKKyAgcmV0dXJuIFJFR19OT0VSUk9SOworfQorCisvKiBDYWxjdWxhdGUgImVjbG9zdXJlIiBmb3IgYWxsIHRoZSBub2RlIGluIERGQS4gICovCisKK3N0YXRpYyByZWdfZXJyY29kZV90CitjYWxjX2VjbG9zdXJlIChyZV9kZmFfdCAqZGZhKQoreworICBpbnQgbm9kZV9pZHgsIGluY29tcGxldGU7CisjaWZkZWYgREVCVUcKKyAgYXNzZXJ0IChkZmEtPm5vZGVzX2xlbiA+IDApOworI2VuZGlmCisgIGluY29tcGxldGUgPSAwOworICAvKiBGb3IgZWFjaCBub2RlcywgY2FsY3VsYXRlIGVwc2lsb24gY2xvc3VyZS4gICovCisgIGZvciAobm9kZV9pZHggPSAwOyA7ICsrbm9kZV9pZHgpCisgICAgeworICAgICAgcmVnX2VycmNvZGVfdCBlcnI7CisgICAgICByZV9ub2RlX3NldCBlY2xvc3VyZV9lbGVtOworICAgICAgaWYgKG5vZGVfaWR4ID09IGRmYS0+bm9kZXNfbGVuKQorCXsKKwkgIGlmICghaW5jb21wbGV0ZSkKKwkgICAgYnJlYWs7CisJICBpbmNvbXBsZXRlID0gMDsKKwkgIG5vZGVfaWR4ID0gMDsKKwl9CisKKyNpZmRlZiBERUJVRworICAgICAgYXNzZXJ0IChkZmEtPmVjbG9zdXJlc1tub2RlX2lkeF0ubmVsZW0gIT0gLTEpOworI2VuZGlmCisKKyAgICAgIC8qIElmIHdlIGhhdmUgYWxyZWFkeSBjYWxjdWxhdGVkLCBza2lwIGl0LiAgKi8KKyAgICAgIGlmIChkZmEtPmVjbG9zdXJlc1tub2RlX2lkeF0ubm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0gV09SRF9MQVNUOworCSAgICB9CisJICBicmVhazsKKwljYXNlICdiJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0dOVV9PUFMpKQorCSAgICB7CisJICAgICAgdG9rZW4tPnR5cGUgPSBBTkNIT1I7CisJICAgICAgdG9rZW4tPm9wci5jdHhfdHlwZSA9IFdPUkRfREVMSU07CisJICAgIH0KKwkgIGJyZWFrOworCWNhc2UgJ0InOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHsKKwkgICAgICB0b2tlbi0+dHlwZSA9IEFOQ0hPUjsKKwkgICAgICB0b2tlbi0+b3ByLmN0eF90eXBlID0gTk9UX1dPUkRfREVMSU07CisJICAgIH0KKwkgIGJyZWFrOworCWNhc2UgJ3cnOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfV09SRDsKKwkgIGJyZWFrOworCWNhc2UgJ1cnOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfTk9UV09SRDsKKwkgIGJyZWFrOworCWNhc2UgJ3MnOgorCSAgaWYgKCEoc3ludGF4ICYgUkVfTk9fR05VX09QUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfU1BBQ0U7CisJICBicmVhazsKKwljYXNlICdTJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0dOVV9PUFMpKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX05PVFNQQUNFOworCSAgYnJlYWs7CisJY2FzZSAnYCc6CisJICBpZiAoIShzeW50YXggJiBSRV9OT19HTlVfT1BTKSkKKwkgICAgeworCSAgICAgIHRva2VuLT50eXBlID0gQU5DSE9SOworCSAgICAgIHRva2VuLT5vcHIuY3R4X3R5cGUgPSBCVUZfRklSU1Q7CisJICAgIH0KKwkgIGJyZWFrOworCWNhc2UgJ1wnJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0dOVV9PUFMpKQorCSAgICB7CisJICAgICAgdG9rZW4tPnR5cGUgPSBBTkNIT1I7CisJICAgICAgdG9rZW4tPm9wci5jdHhfdHlwZSA9IEJVRl9MQVNUOworCSAgICB9CisJICBicmVhazsKKwljYXNlICcoJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0JLX1BBUkVOUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfT1BFTl9TVUJFWFA7CisJICBicmVhazsKKwljYXNlICcpJzoKKwkgIGlmICghKHN5bnRheCAmIFJFX05PX0JLX1BBUkVOUykpCisJICAgIHRva2VuLT50eXBlID0gT1BfQ0xPU0VfU1VCRVhQOworCSAgYnJlYWs7CisJY2FzZSAnKyc6CisJICBpZiAoIShzeW50YXggJiBSRV9MSU1JVEVEX09QUykgJiYgKHN5bnRheCAmIFJFX0JLX1BMVVNfUU0pKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX0RVUF9QTFVTOworCSAgYnJlYWs7CisJY2FzZSAnPyc6CisJICBpZiAoIShzeW50YXggJiBSRV9MSU1JVEVEX09QUykgJiYgKHN5bnRheCAmIFJFX0JLX1BMVVNfUU0pKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX0RVUF9RVUVTVElPTjsKKwkgIGJyZWFrOworCWNhc2UgJ3snOgorCSAgaWYgKChzeW50YXggJiBSRV9JTlRFUlZBTFMpICYmICghKHN5bnRheCAmIFJFX05PX0JLX0JSQUNFUykpKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX09QRU5fRFVQX05VTTsKKwkgIGJyZWFrOworCWNhc2UgJ30nOgorCSAgaWYgKChzeW50YXggJiBSRV9JTlRFUlZBTFMpICYmICghKHN5bnRheCAmIFJFX05PX0JLX0JSQUNFUykpKQorCSAgICB0b2tlbi0+dHlwZSA9IE9QX0NMT1NFX0RVUF9OVU07CisJICBicmVhazsKKwlkZWZhdWx0OgorCSAgYnJlYWs7CisJfQorICAgICAgcmV0dXJuIDI7CisgICAgfQorCisgIHRva2VuLT50eXBlID0gQ0hBUkFDVEVSOworI2lmZGVmIFJFX0VOQUJMRV9JMThOCisgIGlmIChpbnB1dC0+bWJfY3VyX21heCA+IDEpCisgICAgeworICAgICAgd2ludF90IHdjID0gcmVfc3RyaW5nX3djaGFyX2F0IChpbnB1dCwgcmVfc3RyaW5nX2N1cl9pZHggKGlucHV0KSk7CisgICAgICB0b2tlbi0+d29yZF9jaGFyID0gSVNfV0lERV9XT1JEX0NIQVIgKHdjKSAhPSAwOworICAgIH0KKyAgZWxzZQorI2VuZGlmCisgICAgdG9rZW4tPndvcmRfY2hhciA9IElTX1dPUkRfQ0hBUiAodG9rZW4tPm9wci5jKTsKKworICBzd2l0Y2ggKGMpCisgICAgeworICAgIGNhc2UgJ1xuJzoKKyAgICAgIGlmIChzeW50YXggJiBSRV9ORVdMSU5FX0FMVCkKKwl0b2tlbi0+dHlwZSA9IE9QX0FMVDsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJ3wnOgorICAgICAgaWYgKCEoc3ludGF4ICYgUkVfTElNSVRFRF9PUFMpICYmIChzeW50YXggJiBSRV9OT19CS19WQkFSKSkKKwl0b2tlbi0+dHlwZSA9IE9QX0FMVDsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJyonOgorICAgICAgdG9rZW4tPnR5cGUgPSBPUF9EVVBfQVNURVJJU0s7CisgICAgICBicmVhazsKKyAgICBjYXNlICcrJzoKKyAgICAgIGlmICghKHN5bnRheCAmIFJFX0xJTUlURURfT1BTKSAmJiAhKHN5bnRheCAmIFJFX0JLX1BMVVNfUU0pKQorCXRva2VuLT50eXBlID0gT1BfRFVQX1BMVVM7CisgICAgICBicmVhazsKKyAgICBjYXNlICc/JzoKKyAgICAgIGlmICghKHN5bnRheCAmIFJFX0xJTUlURURfT1BTKSAmJiAhKHN5bnRheCAmIFJFX0JLX1BMVVNfUU0pKQorCXRva2VuLT50eXBlID0gT1BfRFVQX1FVRVNUSU9OOworICAgICAgYnJlYW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3RyaW5nX2VvaSAoaW5wdXQpKQorICAgIHsKKyAgICAgIHRva2VuLT50eXBlID0gRU5EX09GX1JFOworICAgICAgcmV0dXJuIDA7CisgICAgfQorICBjID0gcmVfc3RyaW5nX3BlZWtfYnl0ZSAoaW5wdXQsIDApOworICB0b2tlbi0+b3ByLmMgPSBjOworCisjaWZkZWYgUkVfRU5BQkxFX0kxOE4KKyAgaWYgKGlucHV0LT5tYl9jdXJfbWF4ID4gMSAmJgorICAgICAgIXJlX3N0cmluZ19maXJzdF9ieXRlIChpbnB1dCwgcmVfc3RyaW5nX2N1cl9pZHggKGlucHV0KSkpCisgICAgeworICAgICAgdG9rZW4tPnR5cGUgPSBDSEFSQUNURVI7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisjZW5kaWYgLyogUkVfRU5BQkxFX0kxOE4gKi8KKworICBpZiAoYyA9PSAnXFwnICYmIChzeW50YXggJiBSRV9CQUNLU0xBU0hfRVNDQVBFX0lOX0xJU1RTKQorICAgICAgJiYgcmVfc3RyaW5nX2N1cl9pZHggKGlucHV0KSArIDEgPCByZV9zdHJpbmdfbGVuZ3RoIChpbnB1dCkpCisgICAgeworICAgICAgLyogSW4gdGhpcyBjYXNlLCAnXCcgZXNjYXBlIGEgY2hhcmFjdGVyLiAgKi8KKyAgICAgIHVuc2lnbmVkIGNoYXIgYzI7CisgICAgICByZV9zdHJpbmdfc2tpcF9ieXRlcyAoaW5wdXQsIDEpOworICAgICAgYzIgPSByZV9zdHJpbmdfcGVla19ieXRlIChpbnB1dCwgMCk7CisgICAgICB0b2tlbi0+b3ByLmMgPSBjMjsKKyAgICAgIHRva2VuLT50eXBlID0gQ0hBUkFDVEVSOworICAgICAgcmV0dXJuIDE7CisgICAgfQorICBpZiAoYyA9PSAnWycpIC8qICdbJyBpcyBhIHNwZWNpYWwgY2hhciBpbiBhIGJyYWNrZXQgZXhwcy4gICovCisgICAgeworICAgICAgdW5zaWduZWQgY2hhciBjMjsKKyAgICAgIGludCB0b2tlbl9sZW47CisgICAgICBpZiAocmVfc3RyaW5nX2N1cl9pZHggKGlucHV0KSArIDEgPCByZV9zdHJpbmdfbGVuZ3RoIChpbnB1dCkpCisJYzIgPSByZV9zdHJpbmdfcGVla19ieXRlIChpbnB1dCwgMSk7CisgICAgICBlbHNlCisJYzIgPSAwOworICAgICAgdG9rZW4tPm9wci5jID0gYzI7CisgICAgICB0b2tlbl9sZW4gPSAyOworICAgICAgc3dpdGNoIChjMikKKwl7CisJY2FzZSAnLic6CisJICB0b2tlbi0+dHlwZSA9IE9QX09QRU5fQ09MTF9FTEVNOworCSAgYnJlYWs7CisJY2FzZSAnPSc6CisJICB0b2tlbi0+dHlwZSA9IE9QX09QRU5fRVFVSVZfQ0xBU1M7CisJICBicmVhazsKKwljYXNlICc6JzoKKwkgIGlmIChzeW50YXggJiBSRV9DSEFSX0NMQVNTRVMpCisJICAgIHsKKwkgICAgICB0b2tlbi0+dHlwZSA9IE9QX09QRU5fQ0hBUl9DTEFTUzsKKwkgICAgICBicmVhazsKKwkgICAgfQorCSAgLyogZWxzZSBmYWxsIHRocm91Z2guICAqLworCWRlZmF1bHQ6CisJICB0b2tlbi0+dHlwZSA9IENIQVJBQ1RFUjsKKwkgIHRva2VuLT5vcHIuYyA9IGM7CisJICB0b2tlbl9sZW4gPSAxOworCSAgYnJlYWs7CisJfQorICAgICAgcmV0dXJuIHRva2VuX2xlbjsKKyAgICB9CisgIHN3aXRjaCAoYykKKyAgICB7CisgICAgY2FzZSAnLSc6CisgICAgICB0b2tlbi0+dHlwZSA9IE9QX0NIQVJTRVRfUkFOR0U7CisgICAgICBicmVhazsKKyAgICBjYXNlICddJzoKKyAgICAgIHRva2VuLT50eXBlID0gT1BfQ0xPU0VfQlJBQ0tFVDsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJ14nOgorICAgICAgdG9rZW4tPnR5cGUgPSBPUF9OT05fTUFUQ0hfTElTVDsKKyAgICAgIGJyZWFrOworICAgIGRlZmF1bHQ6CisgICAgIC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XhwIChyZWdleHAsIGRmYSwgdG9rZW4sIHN5bnRheCwgZXJyKTsKKyAgICAgIGlmIChCRSAoKmVyciAhPSBSRUdfTk9FUlJPUiAmJiB0cmVlID09IE5VTEwsIDApKQorCXJldHVybiBOVUxMOworICAgICAgYnJlYWs7CisgICAgY2FzZSBPUF9CQUNLX1JFRjoKKyAgICAgIGlmICghQkUgKGRmYS0+Y29tcGxldGVkX2JrcmVmX21hcCAmICgxIDw8IHRva2VuLT5vcHIuaWR4KSwgMSkpCisJeworCSAgKmVyciA9IFJFR19FU1VCUkVHOworCSAgcmV0dXJuIE5VTEw7CisJfQorICAgICAgZGZhLT51c2VkX2JrcmVmX21hcCB8PSAxIDw8IHRva2VuLT5vcHIuaWR4OworICAgICAgdHJlZSA9IGNyZWF0ZV90b2tlbl90cmVlIChkZmEsIE5VTEwsIE5VTEwsIHRva2VuKTsKKyAgICAgIGlmIChCRSAodHJlZSA9PSBOVUxMLCAwKSkKKwl7CisJICAqZXJyID0gUkVHX0VTUEFDRTsKKwkgIHJldHVybiBOVUxMOworCX0KKyAgICAgICsrZGZhLT5uYmFja3JlZjsKKyAgICAgIGRmYS0+aGFzX21iX25vZGUgPSAxOworICAgICAgYnJlYWs7CisgICAgY2FzZSBPUF9PUEVOX0RVUF9OVU06CisgICAgICBpZiAoc3ludGF4ICYgUkVfQ09OVEVYVF9JTlZBTElEX0RVUCkKKwl7CisJICAqZXJyID0gUkVHX0JBRFJQVDsKKwkgIHJldHVybiBOVUxMOworCX0KKyAgICAgIC8qIEZBTExUSFJPVUdIICovCisgICAgY2FzZSBPUF9EVVBfQVNURVJJU0s6CisgICAgY2FzZSBPUF9EVVBfUExVUzoKKyAgICBjYXNlIE9QX0RVUF9RVUVTVElPTjoKKyAgICAgIGlmIChzeW50YXggJiBSRV9DT05URVhUX0lOVkFMSURfT1BTKQorCXsKKwkgICplcnIgPSBSRUdfQkFEUlBUOworCSAgcmV0dXJuIE5VTEw7CisJfQorICAgICAgZWxzZSBpZi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NlCisJICAgIHsKKwkgICAgICAqZXJyID0gUkVHX0JBREJSOyAvKiA8cmU+e30gaXMgaW52YWxpZC4gICovCisJICAgICAgcmV0dXJuIE5VTEw7CisJICAgIH0KKwl9CisgICAgICBpZiAoQkUgKHN0YXJ0ICE9IC0yLCAxKSkKKwl7CisJICAvKiBXZSB0cmVhdCAie259IiBhcyAie24sbn0iLiAgKi8KKwkgIGVuZCA9ICgodG9rZW4tPnR5cGUgPT0gT1BfQ0xPU0VfRFVQX05VTSkgPyBzdGFydAorCQkgOiAoKHRva2VuLT50eXBlID09IENIQVJBQ1RFUiAmJiB0b2tlbi0+b3ByLmMgPT0gJywnKQorCQkgICAgPyBmZXRjaF9udW1iZXIgKHJlZ2V4cCwgdG9rZW4sIHN5bnRheCkgOiAtMikpOworCX0KKyAgICAgIGlmIChCRSAoc3RhcnQgPT0gLTIgfHwgZW5kID09IC0yLCAwKSkKKwl7CisJICAvKiBJbnZhbGlkIHNlcXVlbmNlLiAgKi8KKwkgIGlmIChCRSAoIShzeW50YXggJiBSRV9JTlZBTElEX0lOVEVSVkFMX09SRCksIDApKQorCSAgICB7CisJICAgICAgaWYgKHRva2VuLT50eXBlID09IEVORF9PRl9SRSkKKwkJKmVyciA9IFJFR19FQlJBQ0U7CisJICAgICAgZWxzZQorCQkqZXJyID0gUkVHX0JBREJSOworCisJICAgICAgcmV0dXJuIE5VTEw7CisJICAgIH0KKworCSAgLyogSWYgdGhlIHN5bnRheCBiaXQgaXMgc2V0LCByb2xsYmFjay4gICovCisJICByZV9zdHJpbmdfc2V0X2luZGV4IChyZWdleHAsIHN0YXJ0X2lkeCk7CisJICAqdG9rZW4gPSBzdGFydF90b2tlbjsKKwkgIHRva2VuLT50eXBlID0gQ0hBUkFDVEVSOworCSAgLyogbWJfcGFydGlhbCBhbmQgd29yZF9jaGFyIGJpdHMgc2hvdWxkIGJlIGFscmVhZHkgaW5pdGlhbGl6ZWQgYnkKKwkgICAgIHBlZWtfdG9rZW4uICAqLworCS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lnbmVkIGNoYXIgKm5hbWUsIHNpemVfdCBuYW1lX2xlbikKKyAgICB7CisgICAgICBpbnQzMl90IGVsZW07CisKKyAgICAgIGZvciAoZWxlbSA9IDA7IGVsZW0gPCB0YWJsZV9zaXplOyBlbGVtKyspCisJaWYgKHN5bWJfdGFibGVbMiAqIGVsZW1dICE9IDApCisJICB7CisJICAgIGludDMyX3QgaWR4ID0gc3ltYl90YWJsZVsyICogZWxlbSArIDFdOworCSAgICAvKiBTa2lwIHRoZSBuYW1lIG9mIGNvbGxhdGluZyBlbGVtZW50IG5hbWUuICAqLworCSAgICBpZHggKz0gMSArIGV4dHJhW2lkeF07CisJICAgIGlmICgvKiBDb21wYXJlIHRoZSBsZW5ndGggb2YgdGhlIG5hbWUuICAqLworCQluYW1lX2xlbiA9PSBleHRyYVtpZHhdCisJCS8qIENvbXBhcmUgdGhlIG5hbWUuICAqLworCQkmJiBtZW1jbXAgKG5hbWUsICZleHRyYVtpZHggKyAxXSwgbmFtZV9sZW4pID09IDApCisJICAgICAgLyogWWVwLCB0aGlzIGlzIHRoZSBlbnRyeS4gICovCisJICAgICAgcmV0dXJuIGVsZW07CisJICB9CisgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgIC8qIExvY2FsIGZ1bmN0aW9uIGZvciBwYXJzZV9icmFja2V0X2V4cCB1c2VkIGluIF9MSUJDIGVudmlyb25tZW50LgorICAgICBMb29rIHVwIHRoZSBjb2xsYXRpb24gc2VxdWVuY2UgdmFsdWUgb2YgQlJfRUxFTS4KKyAgICAgUmV0dXJuIHRoZSB2YWx1ZSBpZiBzdWNjZWVkZWQsIFVJTlRfTUFYIG90aGVyd2lzZS4gICovCisKKyAgYXV0byBpbmxpbmUgdW5zaWduZWQgaW50CisgIF9fYXR0cmlidXRlX18gKChhbHdheXNfaW5saW5lKSkKKyAgbG9va3VwX2NvbGxhdGlvbl9zZXF1ZW5jZV92YWx1ZSAoYnJhY2tldF9lbGVtX3QgKmJyX2VsZW0pCisgICAgewor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gMDsgaSA8IHBzdHItPm1iX2N1cl9tYXggJiYgaSA8IHJlbWFpbl9sZW47ICsraSkKKwkgICAgICB7CisJCWNoID0gcHN0ci0+cmF3X21icyBbcHN0ci0+cmF3X21ic19pZHggKyBzcmNfaWR4ICsgaV07CisJCWJ1ZltpXSA9IHBzdHItPnRyYW5zW2NoXTsKKwkgICAgICB9CisJICAgIHAgPSAoY29uc3QgY2hhciAqKSBidWY7CisJICB9CisJZWxzZQorCSAgcCA9IChjb25zdCBjaGFyICopIHBzdHItPnJhd19tYnMgKyBwc3RyLT5yYXdfbWJzX2lkeCArIHNyY19pZHg7CisJbWJjbGVuID0gX19tYnJ0b3djICgmd2MsIHAsIHJlbWFpbl9sZW4sICZwc3RyLT5jdXJfc3RhdGUpOworCWlmIChCRSAobWJjbGVuICsgMiA+IDIsIDEpKQorCSAgeworCSAgICB3Y2hhcl90IHdjdSA9IHdjOworCSAgICBpZiAoX19pc3dsb3dlciAod2MpKQorCSAgICAgIHsKKwkJc2l6ZV90IG1iY2RsZW47CisKKwkJd2N1ID0gX190b3d1cHBlciAod2MpOworCQltYmNkbGVuID0gX193Y3J0b21iICgoY2hhciAqKSBidWYsIHdjdSwgJnByZXZfc3QpOworCQlpZiAoQkUgKG1iY2xlbiA9PSBtYmNkbGVuLCAxKSkKKwkJICBtZW1jcHkgKHBzdHItPm1icyArIGJ5dGVfaWR4LCBidWYsIG1iY2xlbik7CisJCWVsc2UgaWYgKG1iY2RsZW4gIT0gKHNpemVfdCkgLTEpCisJCSAgeworCQkgICAgc2l6ZV90IGk7CisKKwkJICAgIGlmIChieXRlX2lkeCArIG1iY2RsZW4gPiBwc3RyLT5idWZzX2xlbikKKwkJICAgICAgeworCQkJcHN0ci0+Y3VyX3N0YXRlID0gcHJldl9zdDsKKwkJCWJyZWFrOworCQkgICAgICB9CisKKwkJICAgIGlmIChwc3RyLT5vZmZzZXRzID09IE5VTEwpCisJCSAgICAgIHsKKwkJCXBzdHItPm9mZnNldHMgPSByZV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EQlVGKTsKKyNpZmRlZiBSRV9FTkFCTEVfSTE4TgorICBpZiAoaW5wdXQtPm1iX2N1cl9tYXggPiAxKQorICAgIHsKKyAgICAgIHdpbnRfdCB3YzsKKyAgICAgIGludCB3Y19pZHggPSBpZHg7CisgICAgICB3aGlsZShpbnB1dC0+d2NzW3djX2lkeF0gPT0gV0VPRikKKwl7CisjaWYgZGVmaW5lZCBERUJVRyAmJiBERUJVRworCSAgLyogSXQgbXVzdCBub3QgaGFwcGVuLiAgKi8KKwkgIGFzc2VydCAod2NfaWR4ID49IDApOworI2VuZGlmCisJICAtLXdjX2lkeDsKKwkgIGlmICh3Y19pZHggPCAwKQorCSAgICByZXR1cm4gaW5wdXQtPnRpcF9jb250ZXh0OworCX0KKyAgICAgIHdjID0gaW5wdXQtPndjc1t3Y19pZHhdOworICAgICAgaWYgKEJFIChpbnB1dC0+d29yZF9vcHNfdXNlZCAhPSAwLCAwKSAmJiBJU19XSURFX1dPUkRfQ0hBUiAod2MpKQorCXJldHVybiBDT05URVhUX1dPUkQ7CisgICAgICByZXR1cm4gKElTX1dJREVfTkVXTElORSAod2MpICYmIGlucHV0LT5uZXdsaW5lX2FuY2hvcgorCSAgICAgID8gQ09OVEVYVF9ORVdMSU5FIDogMCk7CisgICAgfQorICBlbHNlCisjZW5kaWYKKyAgICB7CisgICAgICBjID0gcmVfc3RyaW5nX2J5dGVfYXQgKGlucHV0LCBpZHgpOworICAgICAgaWYgKGJpdHNldF9jb250YWluIChpbnB1dC0+d29yZF9jaGFyLCBjKSkKKwlyZXR1cm4gQ09OVEVYVF9XT1JEOworICAgICAgcmV0dXJuIElTX05FV0xJTkUgKGMpICYmIGlucHV0LT5uZXdsaW5lX2FuY2hvciA/IENPTlRFWFRfTkVXTElORSA6IDA7CisgICAgfQorfQorDAorLyogRnVuY3Rpb25zIGZvciBzZXQgb3BlcmF0aW9uLiAgKi8KKworc3RhdGljIHJlZ19lcnJjb2RlX3QKK2ludGVybmFsX2Z1bmN0aW9u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CBlbGVtKQoreworICAvKiBSZWFsbG9jIGlmIHdlIG5lZWQuICAqLworICBpZiAoc2V0LT5hbGxvYyA9PSBzZXQtPm5lbGVtKQorICAgIHsKKyAgICAgIGludCAqbmV3X2VsZW1zOworICAgICAgc2V0LT5hbGxvYyA9IChzZXQtPmFsbG9jICsgMSkgKiAyOworICAgICAgbmV3X2VsZW1zID0gcmVfcmVhbGxvYyAoc2V0LT5lbGVtcywgaW50LCBzZXQtPmFsbG9jKTsKKyAgICAgIGlmIChCRSAobmV3X2VsZW1zID09IE5VTEwsIDApKQorCXJldHVybiAtMTsKKyAgICAgIHNldC0+ZWxlbXMgPSBuZXdfZWxlbXM7CisgICAgfQorCisgIC8qIEluc2VydCB0aGUgbmV3IGVsZW1lbnQuICAqLworICBzZXQtPmVsZW1zW3NldC0+bmVsZW0rK10gPSBlbGVtOworICByZXR1cm4gMTsKK30KKworLyogQ29tcGFyZSB0d28gbm9kZSBzZXRzIFNFVDEgYW5kIFNFVDIuCisgICByZXR1cm4gMSBpZiBTRVQxIGFuZCBTRVQyIGFyZSBlcXVpdmFsZW50LCByZXR1cm4gMCBvdGhlcndpc2UuICAqLworCitzdGF0aWMgaW50CitpbnRlcm5hbF9mdW5jdGlvbiBfX2F0dHJpYnV0ZSAoKHB1cmUpKQorcmVfbm9kZV9zZXRfY29tcGFyZSAoY29uc3QgcmVfbm9kZV9zZXQgKnNldDEsIGNvbnN0IHJlX25vZGVfc2V0ICpzZXQyKQoreworICBpbnQgaTsKKyAgaWYgKHNldDEgPT0gTlVMTCB8fCBzZXQyID09IE5VTEwgfHwgc2V0MS0+bmVsZW0gIT0gc2V0Mi0+bmVsZW0pCisgICAgcmV0dXJuIDA7CisgIGZvciAoaSA9IHNldDEtPm5lbGVtIDsgLS1pID49IDAgOyApCisgICAgaWYgKHNldDEtPmVsZW1zW2ldICE9IHNldDItPmVsZW1zW2ldKQorICAgICAgcmV0dXJuIDA7CisgIHJldHVybiAxOworfQorCisvKiBSZXR1cm4g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IGIvYXAvbGliYy9nbGliYy9nbGliYy0yLjIyL3Bvc2l4L3JlZ2V4YnVnMS5jCkBAIC0wLDAgKzEsNTEgQEAKKyNpbmNsdWRlIDxlcnJvci5oPgorI2luY2x1ZGUgPHN5cy90eXBlcy5oPgorI2luY2x1ZGUgPHJlZ2V4Lmg+CisjaW5jbHVkZSA8c3RkaW8uaD4KKyNpbmNsdWRlIDxzdGRsaWIuaD4KKworaW50CittYWluICh2b2lkKQoreworICByZWdleF90IHJlOworICByZWdtYXRjaF90IG1hWzJdOworICBpbnQgcmVlcnI7CisgIGludCByZXMgPSAwOworCisgIHJlX3NldF9zeW50YXggKFJFX0RFQlVHKTsKKyAgcmVlcnIgPSByZWdjb21wICgmcmUsICIwKlswLTldWzAtOV0iLCAwKTsKKyAgaWYgKHJlZXJyICE9IDApCisgICAgeworICAgICAgY2hhciBidWZbMTAwXTsKKyAgICAgIHJlZ2Vycm9yIChyZWVyciwgJnJlLCBidWYsIHNpemVvZiBidWYpOworICAgICAgZXJyb3IgKEVYSVRfRkFJTFVSRSwgMCwgIiVzIiwgYnVmKTsKKyAgICB9CisKKyAgaWYgKHJlZ2V4ZWMgKCZyZSwgIjAwMiIsIDIsIG1hLCAwKSAhPSAwKQorICAgIHsKKyAgICAgIGVycm9yICgwLCAwLCAiXCIwKlswLTldWzAtOV1cIiBkb2VzIG5vdCBtYXRjaCBcIjAwMlwiIik7CisgICAgICByZXMgPSAxOworICAgIH0KKyAgcHV0cyAoIlN1Y2Nlc2Z1bCBtYXRjaCB3aXRoIFwiMCpbMC05XVswLTldXCIiKTsKKworICByZWdmcmVlICgmcmUpOworCisgIHJlZXJyID0gcmVnY29tcCAoJnJlLCAiWzBhXSpbMC05XVswLTldIiwgMCk7CisgIGlmIChyZWVyciAhPSAwKQorICAgIHsKKyAgICAgIGNoYXIgYnVmWzEwMF07CisgICAgICByZWdlcnJvciAocmVlcnIsICZyZSwgYnVmLCBzaXplb2YgYnVmKTsKKyAgICAgIGVycm9yICh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m9kZSkKKwkJICAgIHsKKwkJICAgICAgaWYgKGJvdW5kYXJpZXMgJiAxKQorCQkJcmV0dXJuIC0xOworCQkgICAgICBlbHNlIC8qIGlmIChib3VuZGFyaWVzICYgMikgKi8KKwkJCXJldHVybiAwOworCQkgICAgfQorCisJCSAgY3BvcyA9CisJCSAgICBjaGVja19kc3RfbGltaXRzX2NhbGNfcG9zXzEgKG1jdHgsIGJvdW5kYXJpZXMsIHN1YmV4cF9pZHgsCisJCQkJCQkgZHN0LCBia3JlZl9pZHgpOworCQkgIGlmIChjcG9zID09IC0xIC8qICYmIChib3VuZGFyaWVzICYgMSkgKi8pCisJCSAgICByZXR1cm4gLTE7CisJCSAgaWYgKGNwb3MgPT0gMCAmJiAoYm91bmRhcmllcyAmIDIpKQorCQkgICAgcmV0dXJuIDA7CisKKwkJICBpZiAoc3ViZXhwX2lkeCA8IEJJVFNFVF9XT1JEX0JJVFMpCisJCSAgICBlbnQtPmVwc19yZWFjaGFibGVfc3ViZXhwc19tYXAKKwkJICAgICAgJj0gfigoYml0c2V0X3dvcmRfdCkgMSA8PCBzdWJleHBfaWR4KTsKKwkJfQorCSAgICAgIHdoaWxlIChlbnQrKy0+bW9yZSk7CisJICAgIH0KKwkgIGJyZWFrOworCisJY2FzZSBPUF9PUEVOX1NVQkVYUDoKKwkgIGlmICgoYm91bmRhcmllcyAmIDEpICYmIHN1YmV4cF9pZHggPT0gZGZhLT5ub2Rlc1tub2RlXS5vcHIuaWR4KQorCSAgICByZXR1cm4gLTE7CisJICBicmVhazsKKworCWNhc2UgT1BfQ0xPU0VfU1VCRVhQOgorCSAgaWYgKChib3VuZGFyaWVzICYgMikgJiYgc3ViZXhwX2lkeCA9PSBkZmEtPm5vZGVzW25vZGVdLm9wci5pZHgpCisJICAgIHJldHVybiAwOworCSAgYnJlYWs7CisKKwlkZWZhdWx0OgorCSAgICBicmVhazsKKwl9CisgICAgfQorCisgIHJldHVybiAoYm91bmRhcmllcyAmIDIpID8gMSA6IDA7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worCisgIGZvciAobm9kZV9pZHggPSAwOyBub2RlX2lkeCA8IGNhbmRpZGF0ZXMtPm5lbGVtOyArK25vZGVfaWR4KQorICAgIHsKKyAgICAgIGludCBlbmFibGVkX2lkeDsKKyAgICAgIHJlX3Rva2VuX3R5cGVfdCB0eXBlOworICAgICAgc3RydWN0IHJlX2JhY2tyZWZfY2FjaGVfZW50cnkgKmVudHJ5OworICAgICAgbm9kZSA9IGNhbmRpZGF0ZXMtPmVsZW1zW25vZGVfaWR4XTsKKyAgICAgIHR5cGUgPSBkZmEtPm5vZGVzW25vZGVdLnR5cGU7CisgICAgICAvKiBBdm9pZCBpbmZpbml0ZSBsb29wIGZvciB0aGUgUkVzIGxpa2UgIigpXDErIi4gICovCisgICAgICBpZiAobm9kZSA9PSBzY3R4LT5sYXN0X25vZGUgJiYgc3RyX2lkeCA9PSBzY3R4LT5sYXN0X3N0cl9pZHgpCisJY29udGludWU7CisgICAgICBpZiAodHlwZSAhPSBPUF9CQUNLX1JFRikKKwljb250aW51ZTsKKworICAgICAgZW50cnkgPSBtY3R4LT5ia3JlZl9lbnRzICsgZmlyc3RfaWR4OworICAgICAgZW5hYmxlZF9pZHggPSBmaXJzdF9pZHg7CisgICAgICBkbworCXsKKwkgIGludCBzdWJleHBfbGVuOworCSAgaW50IHRvX2lkeDsKKwkgIGludCBkc3Rfbm9kZTsKKwkgIGludCByZXQ7CisJICByZV9kZmFzdGF0ZV90ICpjdXJfc3RhdGU7CisKKwkgIGlmIChlbnRyeS0+bm9kZSAhPSBub2RlKQorCSAgICBjb250aW51ZTsKKwkgIHN1YmV4cF9sZW4gPSBlbnRyeS0+c3ViZXhwX3RvIC0gZW50cnktPnN1YmV4cF9mcm9tOworCSAgdG9faWR4ID0gc3RyX2lkeCArIHN1YmV4cF9sZW47CisJICBkc3Rfbm9kZSA9IChzdWJleHBfbGVuID8gZGZhLT5uZXh0c1tub2RlXQorCQkgICAgICA6IGRmYS0+ZWRlc3RzW25vZGVdLmVsZW1zW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UX05PVFdPUkRfQ09OU1RSQUlOVCkKKwkgICAgeworCSAgICAgIGJpdHNldF93b3JkX3QgYW55X3NldCA9IDA7CisJICAgICAgaWYgKHR5cGUgPT0gQ0hBUkFDVEVSICYmIG5vZGUtPndvcmRfY2hhcikKKwkJeworCQkgIGJpdHNldF9lbXB0eSAoYWNjZXB0cyk7CisJCSAgY29udGludWU7CisJCX0KKyNpZmRlZiBSRV9FTkFCTEVfSTE4TgorCSAgICAgIGlmIChkZmEtPm1iX2N1cl9tYXggPiAxKQorCQlmb3IgKGogPSAwOyBqIDwgQklUU0VUX1dPUkRTOyArK2opCisJCSAgYW55X3NldCB8PSAoYWNjZXB0c1tqXSAmPSB+KGRmYS0+d29yZF9jaGFyW2pdICYgZGZhLT5zYl9jaGFyW2pdKSk7CisJICAgICAgZWxzZQorI2VuZGlmCisJCWZvciAoaiA9IDA7IGogPCBCSVRTRVRfV09SRFM7ICsraikKKwkJICBhbnlfc2V0IHw9IChhY2NlcHRzW2pdICY9IH5kZmEtPndvcmRfY2hhcltqXSk7CisJICAgICAgaWYgKCFhbnlfc2V0KQorCQljb250aW51ZTsKKwkgICAgfQorCX0KKworICAgICAgLyogVGhlbiBkaXZpZGUgYGFjY2VwdHMnIGludG8gREZBIHN0YXRlcywgb3IgY3JlYXRlIGEgbmV3CisJIHN0YXRlLiAgQWJvdmUsIHdlIG1ha2Ugc3VyZSB0aGF0IGFjY2VwdHMgaXMgbm90IGVtcHR5LiAgKi8KKyAgICAgIGZvciAoaiA9IDA7IGogPCBuZGVzdHM7ICsraikKKwl7CisJICBiaXRzZXRfdCBpbnRlcnNlYzsgLyogSW50ZXJzZWN0aW9uIHNldHMsIHNlZSBiZWxvdy4gICovCisJICBiaXRzZXRfdCByZW1haW5zOworCSAgLyogRmxhZ3MsIHNlZSBiZWxvdy4gICovCisJICBiaXRzZXRfd29yZF90IGhhc19pbnRlcnNlYywgbm90X3N1YnNldCwgbm90X2NvbnN1bWVkOworCisJICAvKiBPcHRpbW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V9sZW47CisgIGludCBpOworCisgIGlmIChCRSAobm9kZS0+dHlwZSA9PSBPUF9VVEY4X1BFUklPRCwgMCkpCisgICAgeworICAgICAgdW5zaWduZWQgY2hhciBjID0gcmVfc3RyaW5nX2J5dGVfYXQgKGlucHV0LCBzdHJfaWR4KSwgZDsKKyAgICAgIGlmIChCRSAoYyA8IDB4YzIsIDEpKQorCXJldHVybiAwOworCisgICAgICBpZiAoc3RyX2lkeCArIDIgPiBpbnB1dC0+bGVuKQorCXJldHVybiAwOworCisgICAgICBkID0gcmVfc3RyaW5nX2J5dGVfYXQgKGlucHV0LCBzdHJfaWR4ICsgMSk7CisgICAgICBpZiAoYyA8IDB4ZTApCisJcmV0dXJuIChkIDwgMHg4MCB8fCBkID4gMHhiZikgPyAwIDogMjsKKyAgICAgIGVsc2UgaWYgKGMgPCAweGYwKQorCXsKKwkgIGNoYXJfbGVuID0gMzsKKwkgIGlmIChjID09IDB4ZTAgJiYgZCA8IDB4YTApCisJICAgIHJldHVybiAwOworCX0KKyAgICAgIGVsc2UgaWYgKGMgPCAweGY4KQorCXsKKwkgIGNoYXJfbGVuID0gNDsKKwkgIGlmIChjID09IDB4ZjAgJiYgZCA8IDB4OTApCisJICAgIHJldHVybiAwOworCX0KKyAgICAgIGVsc2UgaWYgKGMgPCAweGZjKQorCXsKKwkgIGNoYXJfbGVuID0gNTsKKwkgIGlmIChjID09IDB4ZjggJiYgZCA8IDB4ODgpCisJICAgIHJldHVybiAwOworCX0KKyAgICAgIGVsc2UgaWYgKGMgPCAweGZlKQorCXsKKwkgIGNoYXJfbGVuID0gNjsKKwkgIGlmIChjID09IDB4ZmMgJiYgZCA8IDB4ODQpCisJICAgIHJldHVybiAwOworCX0KKyAgICAgIGVsc2UKKwlyZXR1cm4gMDsKKworICAgICAgaWYgKHN0cl9pZHggKyBjaGFyX2xlbiA+IGlucHV0LT5sZW4pCisJcmV0dXJuIDA7CisKKyAgICAgIGZvciAoaSA9IDE7IGkgPCBjaGFyX2xl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JpZ2h0IHNpemUuICAqLworICAgICAgcmVfZGZhc3RhdGVfdCAqKm5ld19hcnJheSA9IHJlX3JlYWxsb2MgKG1jdHgtPnN0YXRlX2xvZywgcmVfZGZhc3RhdGVfdCAqLAorCQkJCQkgICAgICBwc3RyLT5idWZzX2xlbiArIDEpOworICAgICAgaWYgKEJFIChuZXdfYXJyYXkgPT0gTlVMTCwgMCkpCisJcmV0dXJuIFJFR19FU1BBQ0U7CisgICAgICBtY3R4LT5zdGF0ZV9sb2cgPSBuZXdfYXJyYXk7CisgICAgfQorCisgIC8qIFRoZW4gcmVjb25zdHJ1Y3QgdGhlIGJ1ZmZlcnMuICAqLworICBpZiAocHN0ci0+aWNhc2UpCisgICAgeworI2lmZGVmIFJFX0VOQUJMRV9JMThOCisgICAgICBpZiAocHN0ci0+bWJfY3VyX21heCA+IDEpCisJeworCSAgcmV0ID0gYnVpbGRfd2NzX3VwcGVyX2J1ZmZlciAocHN0cik7CisJICBpZiAoQkUgKHJldCAhPSBSRUdfTk9FUlJPUiwgMCkpCisJICAgIHJldHVybiByZXQ7CisJfQorICAgICAgZWxzZQorI2VuZGlmIC8qIFJFX0VOQUJMRV9JMThOICAqLworCWJ1aWxkX3VwcGVyX2J1ZmZlciAocHN0cik7CisgICAgfQorICBlbHNlCisgICAgeworI2lmZGVmIFJFX0VOQUJMRV9JMThOCisgICAgICBpZiAocHN0ci0+bWJfY3VyX21heCA+IDEpCisJYnVpbGRfd2NzX2J1ZmZlciAocHN0cik7CisgICAgICBlbHNlCisjZW5kaWYgLyogUkVfRU5BQkxFX0kxOE4gICovCisJeworCSAgaWYgKHBzdHItPnRyYW5zICE9IE5VTEwpCisJICAgIHJlX3N0cmluZ190cmFuc2xhdGVfYnVmZmVyIChwc3RyKTsKKwl9CisgICAgfQorICByZXR1cm4gUkVHX05PRVJST1I7Cit9CisKKwwKKy8qIEZ1bmN0aW9ucyBmb3IgbWF0Y2hpbmcgY29udGV4dC4gICovCisKKy8qIEluaXRpYWxpem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IGludCBlcnJvcnMgPSAwOworCisgIGZvciAoY250ID0gMDsgY250IDwgc2l6ZW9mICh0ZXN0cykgLyBzaXplb2YgKHRlc3RzWzBdKTsgKytjbnQpCisgICAgaWYgKHRlc3RzW2NudF0uc3RyID09IE5VTEwpCisgICAgICB7CisJcHJpbnRmICgiXG4lc1xuJS4qc1xuIiwgdGVzdHNbY250XS5yZWcsCisJCShpbnQpIHN0cmxlbiAodGVzdHNbY250XS5yZWcpLAorCQkiLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0iKTsKKyAgICAgIH0KKyAgICBlbHNlIGlmICh0ZXN0c1tjbnRdLnJlZyA9PSBOVUxMKQorCXByaW50ZiAoIiEhISAlc1xuIiwgdGVzdHNbY250XS5zdHIpOworICAgIGVsc2UKKyAgICAgIHsKKwlyZWdleF90IHJlOworCXJlZ21hdGNoX3QgbWF0Y2hbMjBdOworCWludCBlcnI7CisKKwlwcmludGYgKCJyZWdleHA6IFwiJXNcIiwgc3RyaW5nOiBcIiVzXCIgLT4gIiwgdGVzdHNbY250XS5yZWcsCisJCXRlc3RzW2NudF0uc3RyKTsKKworCS8qIENvbXBpbGUgdGhlIGV4cHJlc3Npb24uICAqLworCWVyciA9IHJlZ2NvbXAgKCZyZSwgdGVzdHNbY250XS5yZWcsIHRlc3RzW2NudF0ub3B0aW9ucyk7CisJaWYgKGVyciAhPSAwKQorCSAgeworCSAgICBpZiAodGVzdHNbY250XS5zdGFydCA9PSAtMikKKwkgICAgICBwdXRzICgiY29tcGlsaW5nIGZhaWxlZCwgT0siKTsKKwkgICAgZWxzZQorCSAgICAgIHsKKwkJY2hhciBidWZbMTAwXTsKKwkJcmVnZXJyb3IgKGVyciwgJnJlLCBidWYsIHNpemVvZiAoYnVmKSk7CisJCXByaW50ZiAoIkZBSUw6ICVzXG4iLCBidWYpOworCQkrK2Vycm9yczsKKwkgICAgICB9CisKKwkgICAgY29udGludWU7CisJICB9CisJZWxzZSBpZiAodGVzdHNbY250XS5zdGFydCA9PSAtMikKKwkgIHsKKwkgICAgcHV0cyAoImNvbXBpbGluZyBzdWNlZWRzLCBGQUlMIik7CisJICAgIGVycm9ycysrOworCSAgICBjb250aW51ZTsKKwkgIH0KKworCS8qIFJ1biB0aGUgYWN0dWFsIHRlc3QuICAqLworCWVyciA9IHJlZ2V4ZWMgKCZyZSwgdGVzdHNbY250XS5zdHIsIDIwLCBtYXRjaCwgMCk7CisKKwlpZiAoZXJyICE9IDApCisJICB7CisJICAgIGlmICh0ZXN0c1tjbnRdLnN0YXJ0ID09IC0xKQorCSAgICAgIHB1dHMgKCJubyBtYXRjaCwgT0siKTsKKwkgICAgZWxzZQorCSAgICAgIHsKKwkJcHV0cyAoIm5vIG1hdGNoLCBGQUlMIik7CisJCSsrZXJyb3JzOworCSAgICAgIH0KKwkgIH0KKwllbHNlCisJICB7CisJICAgIGlmIChtYXRjaFswXS5ybV9zbyA9PSAwICYmIHRlc3RzW2NudF0uc3RhcnQgPT0gMAorCQkmJiBtYXRjaFswXS5ybV9lbyA9PSAwICYmIHRlc3RzW2NudF0uZW5kID09IDApCisJICAgICAgcHV0cyAoIm1hdGNoLCBPSyIpOworCSAgICBlbHNlIGlmIChtYXRjaFswXS5ybV9zbyArIDEgPT0gdGVzdHNbY250XS5zdGFydAorCQkgICAgICYmIG1hdGNoWzBdLnJtX2VvID09IHRlc3RzW2NudF0uZW5kKQorCSAgICAgIHB1dHMgKCJtYXRjaCwgT0siKTsKKwkgICAgZWxzZQorCSAgICAgIHsKKwkJcHJpbnRmICgid3JvbmcgbWF0Y2ggKCVkIHRvICVkKTogRkFJTFxuIiwKKwkJCW1hdGNoWzBdLnJtX3NvLCBtYXRjaFswXS5ybV9lbyk7CisJCSsrZXJyb3JzOworCSAgICAgIH0KKwkgIH0KKworCS8qIEZyZWUgYWxsIHJlc291cmNlcy4gICovCisJcmVnZnJlZSAoJnJlKTsKKyAgICAgIH0KKworICBwc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1bGwgY29tcGlsYXRpb24gbm90IGV4cGVjdGVkXG4iLAorCQkgIHQtPnBhdHRlcm4pOworCSAgcmV0dXJuIDE7CisJfQorICAgIH0KKworICBlcnIgPSByZWdleGVjICgmciwgdC0+ZGF0YSwgMTAsIHJlZ3MsIDApOworCisgIGlmIChlcnIgIT0gdC0+ZXhwZWN0ZWQpCisgICAgeworICAgICAgcHJpbnRmICgidGVzdCAlZFxuIiwgaWQpOworICAgICAgcHJpbnRmICgicGF0dGVybiBcIiVzXCIgZGF0YSBcIiVzXCIgd2FudGVkICVkIGdvdCAlZFxuIiwKKwkgICAgICB0LT5wYXR0ZXJuLCB0LT5kYXRhLCB0LT5leHBlY3RlZCwgZXJyKTsKKyAgICAgIGZvciAoeCA9IDA7IHggPCAxMDsgKyt4KQorCXByaW50ZiAoInJlZyAlZCA9PSAoJWQsICVkKSAlLipzXG4iLAorCQl4LAorCQlyZWdzW3hdLnJtX3NvLAorCQlyZWdzW3hdLnJtX2VvLAorCQlyZWdzW3hdLnJtX2VvIC0gcmVnc1t4XS5ybV9zbywKKwkJdC0+ZGF0YSArIHJlZ3NbeF0ucm1fc28pOworICAgICAgcmV0dXJuIDE7CisgICAgfQorICBwdXRzICgiIE9LLiIpOworICByZXR1cm4gMDsKK30KKworDAorCitpbnQKK21haW4gKGludCBhcmdjLCBjaGFyICogYXJndltdKQoreworICBpbnQgeDsKKyAgaW50IGxvOworICBpbnQgaGk7CisgIGludCByZXMgPSAwOworCisgIGxvID0gMDsKKyAgaGkgPSAoc2l6ZW9mICh0aGVfdGVzdHMpIC8gc2l6ZW9mICh0aGVfdGVzdHNbMF0pKSAtIDE7CisKKyAgaWYgKGFyZ2MgPiAxKQorICAgIHsKKyAgICAgIGxvID0gYXRvaSAoYXJndlsxXSk7CisgICAgICBoaSA9IGxvICsgMTsKKworICAgICAgaWYgKGFyZ2MgPiAyKQorCWhpID0gYXRvaSAoYXJndlsyXSk7CisgICAgfQorCisgIGZvciAoeCA9IGxvOyB4ID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ltcGxpZWQgd2FycmFudHkgb2YKKyAgIE1FUkNIQU5UQUJJTElUWSBvciBGSVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUgR05VCisgICBMZXNzZXIgR2VuZXJhbCBQdWJsaWMgTGljZW5zZSBmb3IgbW9yZSBkZXRhaWxzLgorCisgICBZb3Ugc2hvdWxkIGhhdmUgcmVjZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgTGVzc2VyIEdlbmVyYWwgUHVibGljCisgICBMaWNlbnNlIGFsb25nIHdpdGggdGhlIEdOVSBDIExpYnJhcnk7IGlmIG5vdCwgc2VlCisgICA8aHR0cDovL3d3dy5nbnUub3JnL2xpY2Vuc2VzLz4uICAqLworCisjaW5jbHVkZSA8bGltaXRzLmg+CisjaW5jbHVkZSA8c2NoZWQuaD4KKworCitpbnQKK19fc2NoZWRfY3B1Y291bnQgKHNpemVfdCBzZXRzaXplLCBjb25zdCBjcHVfc2V0X3QgKnNldHApCit7CisgIGludCBzID0gMDsKKyAgY29uc3QgX19jcHVfbWFzayAqcCA9IHNldHAtPl9fYml0czsKKyAgY29uc3QgX19jcHVfbWFzayAqZW5kID0gJnNldHAtPl9fYml0c1tzZXRzaXplIC8gc2l6ZW9mIChfX2NwdV9tYXNrKV07CisKKyAgd2hpbGUgKHAgPCBlbmQpCisgICAgeworICAgICAgX19jcHVfbWFzayBsID0gKnArKzsKKworI2lmZGVmIFBPUENOVAorICAgICAgcyArPSBQT1BDTlQgKGwpOworI2Vsc2UKKyAgICAgIGlmIChsID09IDApCisJY29udGludWU7CisKKyMgaWYgTE9OR19CSVQgPiAzMgorICAgICAgbCA9IChsICYgMHg1NTU1NTU1NTU1NTU1NTU1dWwpICsgKChsID4+IDEpICYgMHg1NTU1NTU1NTU1NTU1NTU1dWwpOworICAgICAgbCA9IChsICYgMHgzMzMzMzMzMzMzMzMzMzMzdWwpICsgKChsID4+IDIpICYgMHgzMzMzMzMzMzMzMzMzMzM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KworICAgIGNhc2UgX1NDX05QUk9DRVNTT1JTX09OTE46CisgICAgICByZXR1cm4gX19nZXRfbnByb2NzICgpOworCisgICAgY2FzZSBfU0NfUEhZU19QQUdFUzoKKyAgICAgIHJldHVybiBfX2dldF9waHlzX3BhZ2VzICgpOworCisgICAgY2FzZSBfU0NfQVZQSFlTX1BBR0VTOgorICAgICAgcmV0dXJuIF9fZ2V0X2F2cGh5c19wYWdlcyAoKTsKKworICAgIGNhc2UgX1NDX0FURVhJVF9NQVg6CisgICAgICAvKiBXZSBoYXZlIG5vIGxpbWl0IHNpbmNlIHdlIHVzZSBsaXN0cy4gICovCisgICAgICByZXR1cm4gSU5UX01BWDsKKworICAgIGNhc2UgX1NDX1BBU1NfTUFYOgorICAgICAgLyogV2UgaGF2ZSBubyBsaW1pdCBidXQgc2luY2UgdGhlIHJldHVybiB2YWx1ZSBtaWdodCBiZSB1c2VkIHRvCisJIGFsbG9jYXRlIGEgYnVmZmVyIHdlIHJlc3RyaWN0IHRoZSB2YWx1ZS4gICovCisgICAgICByZXR1cm4gQlVGU0laOworCisgICAgY2FzZSBfU0NfQ0hBUl9CSVQ6CisgICAgICByZXR1cm4gQ0hBUl9CSVQ7CisKKyAgICBjYXNlIF9TQ19DSEFSX01BWDoKKyAgICAgIHJldHVybiBDSEFSX01BWDsKKworICAgIGNhc2UgX1NDX0NIQVJfTUlOOgorICAgICAgcmV0dXJuIENIQVJfTUlOOworCisgICAgY2FzZSBfU0NfSU5UX01BWDoKKyAgICAgIHJldHVybiBJTlRfTUFYOworCisgICAgY2FzZSBfU0NfSU5UX01JTjoKKyAgICAgIHJldHVybiBJTlRfTUlOOworCisgICAgY2FzZSBfU0NfTE9OR19CSVQ6CisgICAgICByZXR1cm4gc2l6ZW9mIChsb25nIGludCkgKiBDSEFSX0JJVDsKKworICAgIGNhc2UgX1NDX1dPUkRfQklUOgorICAgICAgcmV0dXJuIHNpemVvZiAoaW50KSAqIENIQVJfQklUOworCisgICAgY2FzZSBfU0NfTUJfTEVOX01BWDoKKyAgICAgIHJldHVybiBNQl9MRU5fTUFYOworCisgICAgY2FzZSBfU0NfTlpFUk86CisgICAgICByZXR1cm4gTlpFUk87CisKKyAgICBjYXNlIF9TQ19TU0laRV9NQVg6CisgICAgICByZXR1cm4gX1BPU0lYX1NTSVpFX01BWDsKKworICAgIGNhc2UgX1NDX1NDSEFSX01BWDoKKyAgICAgIHJldHVybiBTQ0hBUl9NQVg7CisKKyAgICBjYXNlIF9TQ19TQ0hBUl9NSU46CisgICAgICByZXR1cm4gU0NIQVJfTUlOOworCisgICAgY2FzZSBfU0NfU0hSVF9NQVg6CisgICAgICByZXR1cm4gU0hSVF9NQVg7CisKKyAgICBjYXNlIF9TQ19TSFJUX01JTjoKKyAgICAgIHJldHVybiBTSFJUX01JTjsKKworICAgIGNhc2UgX1NDX1VDSEFSX01BWDoKKyAgICAgIHJldHVybiBVQ0hBUl9NQVg7CisKKyAgICBjYXNlIF9TQ19VSU5UX01BWDoKKyAgICAgIHJldHVybiBVSU5UX01BWDsKKworICAgIGNhc2UgX1NDX1VMT05HX01BWDoKKyAgICAgIHJldHVybiBVTE9OR19NQVg7CisKKyAgICBjYXNlIF9TQ19VU0hSVF9NQVg6CisgICAgICByZXR1cm4gVVNIUlRfTUFYOworCisgICAgY2FzZSBfU0NfR0VUR1JfUl9TSVpFX01BWDoKKyAgICAgIHJldHVybiBOU1NfQlVGTEVOX0dST1VQOworCisgICAgY2FzZSBfU0NfR0VUUFdfUl9TSVpFX01BWDoKKyAgICAgIHJldHVybiBOU1NfQlVGTEVOX1BBU1NXRDsKKworICAgIGNhc2UgX1NDX0FSR19NQVg6CisgICAgY2FzZSBfU0NfQ0hJTERfTUFYOgorICAgIGNhc2UgX1NDX0NMS19UQ0s6CisgICAgY2FzZSBfU0NfTkdST1VQU19NQVg6CisgICAgY2FzZSBfU0NfT1BFTl9NQVg6CisgICAgY2FzZSBfU0NfU1RSRUFNX01BWDoKKyAgICBjYXNlIF9TQ19KT0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7MSwgImFiP2JjIiwgImFiYmJiYyJ9LAorICB7MCwgImFiP2MiLCAiYWJjIn0sCisgIHswLCAiXmFiYyQiLCAiYWJjIn0sCisgIHsxLCAiXmFiYyQiLCAiYWJjYyJ9LAorICB7MCwgIl5hYmMiLCAiYWJjYyJ9LAorICB7MSwgIl5hYmMkIiwgImFhYmMifSwKKyAgezAsICJhYmMkIiwgImFhYmMifSwKKyAgezAsICJeIiwgImFiYyJ9LAorICB7MCwgIiQiLCAiYWJjIn0sCisgIHswLCAiYS5jIiwgImFiYyJ9LAorICB7MCwgImEuYyIsICJheGMifSwKKyAgezAsICJhLipjIiwgImF4eXpjIn0sCisgIHsxLCAiYS4qYyIsICJheHl6ZCJ9LAorICB7MSwgImFbYmNdZCIsICJhYmMifSwKKyAgezAsICJhW2JjXWQiLCAiYWJkIn0sCisgIHsxLCAiYVtiLWRdZSIsICJhYmQifSwKKyAgezAsICJhW2ItZF1lIiwgImFjZSJ9LAorICB7MCwgImFbYi1kXSIsICJhYWMifSwKKyAgezAsICJhWy1iXSIsICJhLSJ9LAorICB7MCwgImFbYi1dIiwgImEtIn0sCisgIHsyLCAiYVtiLWFdIiwgIi0ifSwKKyAgezIsICJhW11iIiwgIi0ifSwKKyAgezIsICJhWyIsICItIn0sCisgIHswLCAiYV0iLCAiYV0ifSwKKyAgezAsICJhW11dYiIsICJhXWIifSwKKyAgezAsICJhW15iY11kIiwgImFlZCJ9LAorICB7MSwgImFbXmJjXWQiLCAiYWJkIn0sCisgIHswLCAiYVteLWJdYyIsICJhZGMifSwKKyAgezEsICJhW14tYl1jIiwgImEtYyJ9LAorICB7MSwgImFbXl1iXWMiLCAiYV1jIn0sCisgIHswLCAiYVteXWJdYyIsICJhZGMifSwKKyAgezAsICJhYnxjZCIsICJhYmMifSwKKyAgezAsICJhYnxjZCIsICJhYmNkIn0sCisgIHswLCAiKCllZiIsICJkZWYifSwKKyAgezAsICIoKSoiLCAiLSJ9LAorICB7MiwgIiphIiwgIi0ifSwKKyAgezIsICJeKiIsICItIn0sCisgIHsyLCAiJCoiLCAiLSJ9LAorICB7MiwgIigqKWIiLCAiLSJ9LAorICB7MSwgIiRiIiwgImIifSwKKyAgezIsICJhXFwiLCAiLSJ9LAorICB7MCwgImFcXChiIiwgImEoYiJ9LAorICB7MCwgImFcXCgqYiIsICJhYiJ9LAorICB7MCwgImFcXCgqYiIsICJhKChiIn0sCisgIHsxLCAiYVxceCIsICJhXFx4In0sCisgIHsxLCAiYWJjKSIsICItIn0sCisgIHsyLCAiKGFiYyIsICItIn0sCisgIHswLCAiKChhKSkiLCAiYWJjIn0sCisgIHswLCAiKGEpYihjKSIsICJhYmMifSwKKyAgezAsICJhK2IrYyIsICJhYWJiYWJjIn0sCisgIHswLCAiYSoqIiwgIi0ifSwKKyAgezAsICJhKj8iLCAiLSJ9LAorICB7MCwgIihhKikqIiwgIi0ifSwKKyAgezAsICIoYSopKyIsICItIn0sCisgIHswLCAiKGF8KSoiLCAiLSJ9LAorICB7MCwgIihhKnxiKSoiLCAiLSJ9LAorICB7MCwgIihhK3xiKSoiLCAiYWIifSwKKyAgezAsICIoYSt8YikrIiwgImFiIn0sCisgIHswLCAiKGErfGIpPyIsICJhYiJ9LAorICB7MCwgIlteYWJdKiIsICJjZGUifSwKKyAgezAsICIoXikqIiwgIi0ifSwKKyAgezAsICIoYWJ8KSoiLCAiLSJ9LAorICB7MiwgIikoIiwgIi0ifSwKKyAgezEsICJhYmMiLCAiIn0sCisgIHsxLCAiYWJjIiwgIiJ9LAorICB7MCwgImEqIiwgIiJ9LAorICB7MCwgIihbYWJjXSkqZCIsICJhYmJiY2QifSwKKyAgezAsICIoW2FiY10pKmJjZCIsICJhYmNkIn0sCisgIHswLCAiYXxifGN8ZHxlIiwgImUifSwKKyAgezAsICIoYXxifGN8ZHxlKWYiLCAiZWYifSwKKyAgezAsICIoKGEqfGIpKSoiLCAiLSJ9LAorICB7MCwgImFiY2QqZWZnIiwgImFiY2RlZmcifSwKKyAgezAsICJhYioiLCAieGFieWFiYmJ6In0sCisgIHswLCAiYWIqIiwgInhheWFiYmJ6In0sCisgIHswLCAiKGFifGNkKWUiLCAiYWJjZGUifSwKKyAgezAsICJbYWJoZ2VmZGNdaWoiLCAiaGlqIn0sCisgIHsxLCAiXihhYnxjZCllIiwgImFiY2RlIn0sCisgIHswLCAiKGFiY3wpZWYiLCAiYWJjZGVmIn0sCisgIHswLCAiKGF8YiljKmQiLCAiYWJjZCJ9LAorICB7MCwgIihhYnxhYiopYmMiLCAiYWJjIn0sCisgIHswLCAiYShbYmNdKiljKiIsICJhYmMifSwKKyAgezAsICJhKFtiY10qKShjKmQpIiwgImFiY2QifSwKKyAgezAsICJhKFtiY10rKShjKmQpIiwgImFiY2QifSwKKyAgezAsICJhKFtiY10qKShjK2QpIiwgImFiY2QifSwKKyAgezAsICJhW2JjZF0qZGNkY2RlIiwgImFkY2RjZGUifSwKKyAgezEsICJhW2JjZF0rZGNkY2RlIiwgImFkY2RjZGUifSwKKyAgezAsICIoYWJ8YSliKmMiLCAiYWJjIn0sCisgIHswLCAiKChhKShiKWMpKGQpIiwgImFiY2QifSwKKyAgezAsICJbQS1aYS16X11bQS1aYS16MC05X10qIiwgImFscGhhIn0sCisgIHswLCAiXmEoYmMrfGJbZWhdKWd8LmgkIiwgImFiaCJ9LAorICB7MCwgIihiYytkJHxlZipnLnxoP2koanxrKSkiLCAiZWZmZ3oifSwKKyAgezAsICIoYmMrZCR8ZWYqZy58aD9pKGp8aykpIiwgImlqIn0sCisgIHsxLCAiKGJjK2QkfGVmKmcufGg/aShqfGspKSIsICJlZmZnIn0sCisgIHsxLCAiKGJjK2QkfGVmKmcufGg/aShqfGspKSIsICJiY2RkIn0sCisgIHswLCAiKGJjK2QkfGVmKmcufGg/aShqfGspKSIsICJyZWZmZ3oifSwKKyAgezEsICIoKCgoKCgoKCgoYSkpKSkpKSkpKSkiLCAiLSJ9LAorICB7MCwgIigoKCgoKCgoKGEpKSkpKSkpKSkiLCAiYSJ9LA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1wwMDMnLCAnXDAwNCcsICdcMDA1JywgJ1wwMDYnLCAnXDAwNycsCisgICdcMDEwJywgJ1wwMTEnLCAnXDAxMicsICdcMDEzJywgJ1wwMTQnLCAnXDAxNScsICdcMDE2JywgJ1wwMTcnLAorICAnXDAyMCcsICdcMDIxJywgJ1wwMjInLCAnXDAyMycsICdcMDI0JywgJ1wwMjUnLCAnXDAyNicsICdcMDI3JywKKyAgJ1wwMzAnLCAnXDAzMScsICdcMDMyJywgJ1wwMzMnLCAnXDAzNCcsICdcMDM1JywgJ1wwMzYnLCAnXDAzNycsCisgIC8qICcgJyAgICAgJyEnICAgICAnIicgICAgICcjJyAgICAgJyQnICAgICAnJScgICAgICcmJyAgICAgJycnICovCisgICdcMDQwJywgJ1wwNDEnLCAnXDA0MicsICdcMDQzJywgJ1wwNDQnLCAnXDA0NScsICdcMDQ2JywgJ1wwNDcnLAorICAvKiAnKCcgICAgICcpJyAgICAgJyonICAgICAnKycgICAgICcsJyAgICAgJy0nICAgICAnLicgICAgICcvJyAqLworICAnXDA1MCcsICdcMDUxJywgJ1wwNTInLCAnXDA1MycsICdcMDU0JywgJ1wwNTUnLCAnXDA1NicsICdcMDU3JywKKyAgLyogJzAnICAgICAnMScgICAgICcyJyAgICAgJzMnICAgICAnNCcgICAgICc1JyAgICAgJzYnICAgICAnNycgKi8KKyAgJ1wwNjAnLCAnXDA2MScsICdcMDYyJywgJ1wwNjMnLCAnXDA2NCcsICdcMDY1JywgJ1wwNjYnLCAnXDA2NycsCisgIC8qICc4JyAgICAgJzknICAgICAnOicgICAgICc7JyAgICAgJzwnICAgICAnPScgICAgICc+JyAgICAgJz8nICovCisgICdcMDcwJywgJ1wwNzEnLCAnXDA3MicsICdcMDczJywgJ1wwNzQnLCAnXDA3NScsICdcMDc2JywgJ1wwNzcnLAorICAvKiAnQCcgICAgICdBJyAgICAgJ0InICAgICAnQycgICAgICdEJyAgICAgJ0UnICAgICAnRicgICAgICdHJyAqLworICAnXDEwMCcsICdcMTQxJywgJ1wxNDInLCAnXDE0MycsICdcMTQ0JywgJ1wxNDUnLCAnXDE0NicsICdcMTQ3JywKKyAgLyogJ0gnICAgICAnSScgICAgICdKJyAgICAgJ0snICAgICAnTCcgICAgICdNJyAgICAgJ04nICAgICAnTycgKi8KKyAgJ1wxNTAnLCAnXDE1MScsICdcMTUyJywgJ1wxNTMnLCAnXDE1NCcsICdcMTU1JywgJ1wxNTYnLCAnXDE1NycsCisgIC8qICdQJyAgICAgJ1EnICAgICAnUicgICAgICdTJyAgICAgJ1QnICAgICAnVScgICAgICdWJyAgICAgJ1cnICovCisgICdcMTYwJywgJ1wxNjEnLCAnXDE2MicsICdcMTYzJywgJ1wxNjQnLCAnXDE2NScsICdcMTY2JywgJ1wxNjcnLAorICAvKiAnWCcgICAgICdZJyAgICAgJ1onICAgICAnWycgICAgICdcJyAgICAgJ10nICAgICAnXicgICAgICdfJyAqLworICAnXDE3MCcsICdcMTcxJywgJ1wxNzInLCAnXDEzMycsICdcMTM0JywgJ1wxMzUnLCAnXDEzNicsICdcMTM3JywKKyAgLyogJ2AnICAgICAnYScgICAgICdiJyAgICAgJ2MnICAgICAnZCcgICAgICdlJyAgICAgJ2YnICAgICAnZycgKi8KKyAgJ1wxNDAnLCAnXDE0MScsICdcMTQyJywgJ1wxNDMnLCAnXDE0NCcsICdcMTQ1JywgJ1wxNDYnLCAnXDE0NycsCisgIC8qICdoJyAgICAgJ2knICAgICAnaicgICAgICdrJyAgICAgJ2wnICAgICAnbScgICAgICduJyAgICAgJ28nICovCisgICdcMTUwJywgJ1wxNTEnLCAnXDE1MicsICdcMTUzJywgJ1wxNTQnLCAnXDE1NScsICdcMTU2JywgJ1wxNTcnLAorICAvKiAncCcgICAgICdxJyAgICAgJ3InICAgICAncycgICAgICd0JyAgICAgJ3UnICAgICAndicgICAgICd3JyAqLworICAnXDE2MCcsICdcMTYxJywgJ1wxNjInLCAnXDE2MycsICdcMTY0JywgJ1wxNjUnLCAnXDE2NicsICdcMTY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zoKKwkgICAgY2FzZSAneyc6CisJICAgIGNhc2UgJ3wnOgorCSAgICBjYXNlICd9JzoKKwkgICAgICBpZiAoIXBhdHRlcm4pCisJCXsKKwkJICBzcmMrKzsKKwkJICAqZHN0ID0gKnNyYzsKKwkJICBjb250aW51ZTsKKwkJfQorCSAgICAgIGJyZWFrOworCSAgICB9CisJfQorICAgICAgaWYgKHNyYyAhPSBkc3QpCisJKmRzdCA9ICpzcmM7CisgICAgfQorICAqZHN0ID0gJ1wwJzsKK30KKworaW50CittYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCit7CisgIGludCByZXQgPSAwLCBuOworICBjaGFyICpsaW5lID0gTlVMTDsKKyAgc2l6ZV90IGxpbmVfbGVuID0gMDsKKyAgc3NpemVfdCBsZW47CisgIEZJTEUgKmY7CisgIGNoYXIgKnBhdHRlcm4sICpzdHJpbmc7CisgIGludCBmbGFncyA9IFJFR19FWFRFTkRFRDsKKyAgaW50IGVmbGFncyA9IDA7CisgIHJlZ2V4X3QgcmU7CisgIHJlZ21hdGNoX3Qgcm1bMjBdOworCisgIG10cmFjZSAoKTsKKworICBpZiAoYXJnYyA8IDIpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiTWlzc2luZyB0ZXN0IGZpbGVuYW1lXG4iKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICBmID0gZm9wZW4gKGFyZ3ZbMV0sICJyIik7CisgIGlmIChmID09IE5VTEwpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiQ291bGRuJ3Qgb3BlbiAlc1xuIiwgYXJndlsxXSk7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgd2hpbGUgKChsZW4gPSBnZXRsaW5lICgmbGluZSwgJmxpbmVfbGVuLCBmKSkgPiAwKQorICAgIHsKKyAgICAgIGNoYXIgKnAsICpxOworICAgICAgaW50IGk7CisKKyAgICAgIGlmIChsaW5lW2xlbiAtIDFdID09ICdcbicpCisJbGluZVstLWxlbl0gPSAnXDAnOworCisgICAgICBwdXRzIChsaW5lKTsKKworICAgICAgaWYgKGxpbmVbMF0gPT0gJzsnKQorCWNvbnRpbnVlOworCisgICAgICBpZiAobGluZVswXSA9PSAnXDAnKQorCWNvbnRpbnVlOworCisgICAgICBpZiAobGluZVswXSA9PSAnLScpCisJeworCSAgaWYgKHN0cnN0ciAobGluZSwgIlJFR19CQVNJQyIpKQorCSAgICBmbGFncyA9IDA7CisJICBlbHNlCisJICAgIGZsYWdzID0gUkVHX0VYVEVOREVEOworCSAgaWYgKHN0cnN0ciAobGluZSwgIlJFR19JQ0FTRSIpKQorCSAgICBmbGFncyB8PSBSRUdfSUNBU0U7CisJICBpZiAoc3Ryc3RyIChsaW5lLCAiUkVHX05FV0xJTkUiKSkKKwkgICAgZmxhZ3MgfD0gUkVHX05FV0xJTkU7CisJICBlZmxhZ3MgPSAwOworCSAgaWYgKHN0cnN0ciAobGluZSwgIlJFR19OT1RCT0wiKSkKKwkgICAgZWZsYWdzIHw9IFJFR19OT1RCT0w7CisJICBpZiAoc3Ryc3RyIChsaW5lLCAiUkVHX05PVEVPTCIpKQorCSAgICBlZmxhZ3MgfD0gUkVHX05PVEVPTDsKKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgcGF0dGVybiA9IGxpbmUgKyBzdHJzcG4gKGxpbmUsICIgXHQiKTsKKyAgICAgIGlmICgqcGF0dGVybiA9PSAnXDAnKQorCWNvbnRpbnVlOworICAgICAgcCA9IHBhdHRlcm4gKyBzdHJjc3BuIChwYXR0ZXJuLCAiIFx0Iik7CisgICAgICBpZiAoKnAgPT0gJ1wwJykKKwljb250aW51ZTsKKyAgICAgICpwKysgPSAnXDAnOworCisgICAgICBzdHJpbmcgPSBwICsgc3Ryc3BuIChwLCAiIFx0Iik7CisgICAgICBpZiAoKnN0cmluZyA9PSAnXDAnKQorCWNvbnRpbnVlOworICAgICAgaWYgKCpzdHJpbmcgPT0gJyInKQorCXsKKwkgIHN0cmluZysrOworCSAgcCA9IHN0cmNociAoc3RyaW5nLCAnIicpOworCSAgaWYgKHAgPT0gTlVMTCkKKwkgICAgY29udGludWU7CisJICAqcCsrID0gJ1wwJzsKKwl9CisgICAgICBlbHNlCisJeworCSAgcCA9IHN0cmluZyArIHN0cmNzcG4gKHN0cmluZywgIiBcdCIpOworCSAgaWYgKCpzdHJpbmcgPT0gJyEnKQorCSAgICBzdHJpbmcgPSBOVUxMOworCSAgZWxzZSBpZiAoKnAgPT0gJ1wwJykKKwkgICAgY29udGludWU7CisJICBlbHNlCisJICAgICpwKysgPSAnXDAnOworCX0KKworICAgICAgZnJvYl9lc2NhcGVzIChwYXR0ZXJuLCAxKTsKKyAgICAgIGlmIChzdHJpbmcgIT0gTlVMTCkKKwlmcm9iX2VzY2FwZXMgKHN0cmluZywgMCk7CisKKyAgICAgIG4gPSByZWdjb21wICgmcmUsIHBhdHRlcm4sIGZsYWdzKTsKKyAgICAgIGlmIChuICE9IDApCisJeworCSAgaWYgKHN0cmluZyAhPSBOVUxMKQorCSAgICB7CisJICAgICAgY2hhciBidWZbNTAwXTsKKwkgICAgICByZWdlcnJvciAobiwgJnJlLCBidWYsIHNpemVvZiAoYnVmKSk7CisJICAgICAgcHJpbnRmICgiRkFJTCByZWdjb21wIHVuZXhwZWN0ZWRseSBmYWlsZWQ6ICVzXG4iLAorCQkgICAgICBidWYpOworCSAgICAgIHJldCA9IDE7CisJICAgIH0KKwkgIGNvbnRpbnVlOworCX0KKyAgICAgIGVsc2UgaWYgKHN0cmluZyA9PSBOVUxMKQorCXsKKwkgIHJlZ2ZyZWUgKCZyZSk7CisJICBwdXRzICgiRkFJTCByZWdjb21wIHVucGV4cGVjdGVkbHkgc3VjY2VlZGVkIik7CisJICByZXQgPSAxOworCSAgY29udGludWU7CisJfQorCisgICAgICBpZiAocmVnZXhlYyAoJnJlLCBzdHJpbmcsIDIwLCBybSwgZWZsYWdzKSkKKwl7CisJICBmb3IgKGkgPSAwOyBpIDwgMjA7ICsraSkKKwkg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KKyAgICB7CisgICAgICBwcmludGYgKCJjYW5ub3QgY2hhbmdlIG1vZGUgb2YgdGVzdCBkaXJlY3RvcnkgdG8gMDYwMDogJW1cbiIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICAgIGdvdG8gZmFpbDsKKyAgICB9CisKKyAgZmQgPSBjcmVhdCAodGVzdGZpbGUsIDApOworICBpZiAoZmQgIT0gLTEpCisgICAgeworICAgICAgaWYgKGdldHVpZCAoKSAhPSAwKQorCXsKKwkgIHB1dHMgKCJtYW5hZ2VkIHRvIGNyZWF0ZSB0ZXN0IGZpbGUgaW4gbm8teCBwcm90ZWN0ZWQgZGlyZWN0b3J5Iik7CisJICByZXN1bHQgPSAxOworCX0KKyAgICAgIGNsb3NlIChmZCk7CisgICAgfQorICBlbHNlIGlmIChlcnJubyAhPSBFQUNDRVMpCisgICAgeworICAgICAgcHV0cyAoImNyZWF0IGRpZG4ndCBnZW5lcmF0ZSBjb3JyZWN0IGVycm5vIHZhbHVlIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICAvKiBDaGFuZ2UgdGhlIGRpcmVjdG9yeSBtb2RlIGJhY2sgdG8gYWxsb3cgY3JlYXRpbmcgYSBmaWxlLiAgVGhpcworICAgICB0aW1lIHdpdGggZmNobW9kLiAgKi8KKyAgZGlyID0gb3BlbmRpciAodGVzdGRpcik7CisgIGlmIChkaXIgIT0gTlVMTCkKKyAgICB7CisgICAgICBpZiAoZmNobW9kIChkaXJmZCAoZGlyKSwgMDcwMCkgIT0gMCkKKwl7CisJICBwcmludGYgKCJjYW5ub3QgY2hhbmdlIG1vZGUgb2YgdGVzdCBkaXJlY3RvcnkgdG8gMDcwMDogJW1cbiIpOworCSAgcmVzdWx0ID0gMTsKKwkgIGNsb3NlZGlyIChkaXIpOworCSAgZ290byBmYWlsOworCX0KKworICAgICAgY2xvc2VkaXIgKGRpcik7CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgcHJpbnRmICgiY2Fubm90IG9wZW4gZG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lQgKCZzMykgIT0gMSkKKyAgICB7CisgICAgICBwdXRzICgicmVzdWx0IG9mIENQVV9YT1Igd3JvbmciKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGNwdV9zZXRfdCAqdnMxID0gQ1BVX0FMTE9DICgyMDQ4KTsKKyAgY3B1X3NldF90ICp2czIgPSBDUFVfQUxMT0MgKDIwNDgpOworICBjcHVfc2V0X3QgKnZzMyA9IENQVV9BTExPQyAoMjA0OCk7CisgIHNpemVfdCB2c3NpemUgPSBDUFVfQUxMT0NfU0laRSAoMjA0OCk7CisKKyAgQ1BVX1pFUk9fUyAodnNzaXplLCB2czEpOworICBDUFVfU0VUX1MgKDAsIHZzc2l6ZSwgdnMxKTsKKworICBDUFVfWkVST19TICh2c3NpemUsIHZzMik7CisgIENQVV9TRVRfUyAoMCwgdnNzaXplLCB2czIpOworICBDUFVfU0VUX1MgKDIwNDcsIHZzc2l6ZSwgdnMyKTsKKworICBDUFVfQU5EX1MgKHZzc2l6ZSwgdnMzLCB2czEsIHZzMik7CisgIGlmICghIENQVV9FUVVBTF9TICh2c3NpemUsIHZzMywgdnMxKSkKKyAgICB7CisgICAgICBwdXRzICgicmVzdWx0IG9mIENQVV9BTkRfUyB3cm9uZyIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgQ1BVX09SX1MgKHZzc2l6ZSwgdnMzLCB2czEsIHZzMik7CisgIGlmICghIENQVV9FUVVBTF9TICh2c3NpemUsIHZzMywgdnMyKSkKKyAgICB7CisgICAgICBwdXRzICgicmVzdWx0IG9mIENQVV9PUl9TIHdyb25nIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBDUFVfWE9SX1MgKHZzc2l6ZSwgdnMzLCB2czEsIHZzMik7CisgIGlmIChDUFVfQ09VTlRfUyAodnNzaXplLCB2czMpICE9IDEpCisgICAgeworICAgICAgcHV0cyAoInJlc3VsdCBvZiBDUFVfWE9SX1Mgd3JvbmciKTsKKyAgICAg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aXRoIHBhdGgKKyovCitpbnQKK21haW4gKGludCBhcmdjLCBjaGFyICphcmd2W10pCit7CisgIGNvbnN0IGNoYXIgKnNyY2RpcjsKKyAgY29uc3QgY2hhciAqb2JqZGlyOworICBjb25zdCBjaGFyICpjb21tb25fb2JqZGlyOworICBjb25zdCBjaGFyICpwcm9ncGF0aDsKKyAgc3RydWN0IHN0YXQ2NCBzdDE7CisgIHN0cnVjdCBzdGF0NjQgc3QyOworICBzdHJ1Y3Qgc3RhdDY0IHN0MzsKKyAgRElSICpkaXIxOworICBESVIgKmRpcjI7CisgIGludCByZXN1bHQgPSAwOworICBzdHJ1Y3QgZGlyZW50NjQgKmQ7CisgIHVuaW9uCisgICAgeworICAgICAgc3RydWN0IGRpcmVudDY0IGQ7CisgICAgICBjaGFyIHJvb20gW29mZnNldG9mIChzdHJ1Y3QgZGlyZW50NjQsIGRfbmFtZVswXSkgKyBOQU1FX01BWCArIDFdOworICAgIH0KKyAgICBkaXJlbnRidWY7CisgIGNoYXIgKm9iamRpcl9jb3B5MTsKKyAgY2hhciAqb2JqZGlyX2NvcHkyOworICBjaGFyICpidWY7CisgIGludCBmZDsKKworICBtdHJhY2UgKCk7CisKKyAgaWYgKGFyZ2MgPCA1KQorICAgIHsKKyAgICAgIHB1dHMgKCJub3QgZW5vdWdoIHBhcmFtZXRlcnMiKTsKKyAgICAgIGV4aXQgKDEpOworICAgIH0KKworICAvKiBNYWtlIHBhcmFtZXRlcnMgYXZhaWxhYmxlIHdpdGggbmljZXIgbmFtZXMuICAqLworICBzcmNkaXIgPSBhcmd2WzFdOworICBvYmpkaXIgPSBhcmd2WzJdOworICBjb21tb25fb2JqZGlyID0gYXJndlszXTsKKyAgcHJvZ3BhdGggPSBhcmd2WzRdOworCisgIC8qIEZpcnN0IHRlc3QgdGhlIGN1cnJlbnQgc291cmNlIGRpci4gIFdlIGNhbm5vdCByZWFsbHkgY29tcGFyZSB0aGUKKyAgICAgcmVzdWx0IG9mIGBnZXRwd2QnIH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aWYgKG1rZGlyICgiYW5vdGhlci1kaXIiLCAwNzc3KSA8IDApCisgICAgeworICAgICAgcHJpbnRmICgiY2Fubm90IGNyZWF0ZSBcImFub3RoZXItZGlyXCI6ICVtXG4iKTsKKyAgICAgIGV4aXQgKDEpOworICAgIH0KKyAgZmQgPSBvcGVuICgiYW5kLWEtZmlsZSIsIE9fUkRXUiB8IE9fQ1JFQVQgfCBPX0VYQ0wsIDA2NjYpOworICBpZiAoZmQgPT0gLTEpCisgICAgeworICAgICAgcHJpbnRmICgiY2Fubm90IGNyZWF0ZSBcImFuZC1hLWZpbGVcIjogJW1cbiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBjbG9zZSAoZmQpOworCisgIC8qIFNvbWUgdGVzdHMgYWJvdXQgZXJyb3IgcmVwb3J0aW5nLiAgKi8KKyAgZXJybm8gPSAwOworICBpZiAoY2hkaXIgKCJhbmQtYS1maWxlIikgPj0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFuZC1hLWZpbGVcIiBzdWNjZWVkZWRcbiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoZXJybm8gIT0gRU5PVERJUikKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFuZC1hLWZpbGVcIiBkaWRuJ3Qgc2V0IGNvcnJlY3QgZXJyb3JcbiIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgZXJybm8gPSAwOworICBpZiAoY2hkaXIgKCJhbmQtYS1maWxlLy4uIikgPj0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFuZC1hLWZpbGUvLi5cIiBzdWNjZWVkZWRcbiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoZXJybm8gIT0gRU5PVERJUikKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFuZC1hLWZpbGUvLi5cIiBkaWRuJ3Qgc2V0IGNvcnJlY3QgZXJyb3JcbiIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgZXJybm8gPSAwOworICBpZiAoY2hkaXIgKCJhbm90aGVyLWRpci8uLi9hbmQtYS1maWxlIikgPj0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFub3RoZXItZGlyLy4uL2FuZC1hLWZpbGVcIiBzdWNjZWVkZWRcbiIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoZXJybm8gIT0gRU5PVERJUikKKyAgICB7CisgICAgICBwcmludGYgKCJjaGRpciB0byBcImFub3RoZXItZGlyLy4uL2FuZC1hLWZpbGVcIiBkaWRuJ3Qgc2V0IGNvcnJlY3QgZXJyb3JcbiIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgLyogV2Ugbm93IHNob3VsZCBoYXZlIGEgZGlyZWN0b3J5IGFuZCBhIGZpbGUgaW4gdGhlIG5ldyBkaXJlY3RvcnkuICAqLworICByZXdpbmRkaXIgKGRpcjIpOworICB3aGlsZSAocmVhZGRpcjY0X3IgKGRpcjIsICZkaXJlbnRidWYuZCwgJmQpID09IDAgJiYgZCAhPSBOVUxMKQorICAgIHsKKyAgICAgIGlmIChzdHJjbXAgKGQtPmRfbmFtZSwgIi4iKSA9PSAwCisJICB8fCBzdHJjbXAgKGQtPmRfbmFtZSwgIi4uIikgPT0gMAorCSAgfHwgc3RyY21wIChkLT5kX25hbWUsICJhbm90aGVyLWRpciIpID09IDApCisJeworI2lmZGVmIF9ESVJFTlRfSEFWRV9EX1RZUEUKKwkgIGlmIChkLT5kX3R5cGUgIT0gRFRfVU5LTk9XTiAmJiBkLT5kX3R5cGUgIT0gRFRfRElSKQorCSAgICB7CisJICAgICAgcHJpbnRmICgiZF90eXBlIGZvciBcIiVzXCIgaXMgd3JvbmdcbiIsIGQtPmRfbmFtZSk7CisJICAgICAgcmVzdWx0ID0gMTsKKwkgICAgfQorI2VuZGlmCisJICBpZiAoc3RhdDY0IChkLT5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biIsIGQtPmRfbmFtZSk7CisJICByZXN1bHQgPSAxOworCX0KKyAgICB9CisKKyAgaWYgKHN0YXQ2NCAoImRvZXMtbm90LWV4aXN0IiwgJnN0MSkgPj0gMCkKKyAgICB7CisgICAgICBwdXRzICgic3RhdCBmb3IgdW5leGlzdGluZyBmaWxlIGRpZCBub3QgZmFpbCIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgLyogRnJlZSBhbGwgcmVzb3VyY2VzLiAgKi8KKworICBpZiAoY2xvc2VkaXIgKGRpcjEpIDwgMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjbG9zaW5nIGRpcjEgZmFpbGVkOiAlbVxuIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKyAgaWYgKGNsb3NlZGlyIChkaXIyKSA8IDApCisgICAgeworICAgICAgcHJpbnRmICgic2Vjb25kIGNsb3NpbmcgZGlyMiBmYWlsZWQ6ICVtXG4iKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGlmIChybWRpciAoImFub3RoZXItZGlyIikgPCAwKQorICAgIHsKKyAgICAgIHByaW50ZiAoImNhbm5vdCByZW1vdmUgXCJhbm90aGVyLWRpclwiOiAlbVxuIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBpZiAodW5saW5rICgiYW5kLWEtZmlsZSIpIDwgMCkKKyAgICB7CisgICAgICBwcmludGYgKCJjYW5ub3QgcmVtb3ZlIFwiYW5kLWEtZmlsZVwiOiAlbVxuIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICAvKiBPbmUgbW9yZSB0ZXN0IGJlZm9yZSB3ZSBsZWF2ZTogbWtkaXIoKSBpcyBzdXBwb3NlZCB0byBmYWlsIHdpdGgKKyAgICAgRUVYSVNUIGlmIHRoZSBuYW1lZCBmaWxlIGlzIGEgc3ltbGluay4gICovCisgIGlmIChzeW1saW5rICgiYS1zeW1saW5rIiwgImEtc3ltbGluayIpICE9IDApCisgICAgeworICA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mNsdWRlICIuLi90ZXN0LXNrZWxldG9uLmMiCisKKworc3RhdGljIGNoYXIgKmNvcHk7CisKK3N0YXRpYyB2b2lkCitwcmVwYXJlIChpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworICBjaGFyICpidWY7CisgIGludCBvZmY7CisgIGFzcHJpbnRmICgmYnVmLCAiY3AgJXMgJW4lcy1jb3B5IiwgYXJndlswXSwgJm9mZiwgYXJndlswXSk7CisgIGlmIChidWYgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiYXNwcmludGYgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoc3lzdGVtIChidWYpICE9IDApCisgICAgeworICAgICAgcHV0cyAoInN5c3RlbSAgZmFpbGVkIik7CisgICAgICBleGl0ICgxKTsKKyAgICB9CisKKyAgLyogTWFrZSBpdCBub3QgZXhlY3V0YWJsZS4gICovCisgIGNvcHkgPSBidWYgKyBvZmY7CisgIGlmIChjaG1vZCAoY29weSwgMDY2NikgIT0gMCkKKyAgICB7CisgICAgICBwdXRzICgiY2htb2QgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIGFkZF90ZW1wX2ZpbGUgKGNvcHkpOworfQorCisKK3N0YXRpYyBpbnQKK2RvX3Rlc3QgKHZvaWQpCit7CisgIGVycm5vID0gMDsKKyAgZXhlY2wgKGNvcHksIGNvcHksIE5VTEwpOworCisgIGlmIChlcnJubyAhPSBFQUNDRVMpCisgICAgeworICAgICAgcHJpbnRmICgiZXJybm8gPSAlZCAoJW0pLCBleHBlY3RlZCBFQUNDRVNcbiIsIGVycm5vKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICByZXR1cm4gMDsKK30KZGlmZiAtLWdpdCBhL2FwL2xpYmMvZ2xpYmMvZ2xpYmMtMi4yMi9wb3NpeC90c3QtZXhlY2xlMS5jIGIvYXAvbGliYy9nbGliYy9nbGliYy0yLjIyL3Bvc2l4L3RzdC1leGVjbG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PGVycm5vLmg+CisjaW5jbHVkZSA8c3RkaW8uaD4KKyNpbmNsdWRlIDx1bmlzdGQuaD4KKyNpbmNsdWRlIDxzeXMvc3RhdC5oPgorCisKK3N0YXRpYyB2b2lkIHByZXBhcmUgKGludCBhcmdjLCBjaGFyICphcmd2W10pOworc3RhdGljIGludCBkb190ZXN0ICh2b2lkKTsKKyNkZWZpbmUgUFJFUEFSRShhcmdjLCBhcmd2KSBwcmVwYXJlIChhcmdjLCBhcmd2KQorI2RlZmluZSBURVNUX0ZVTkNUSU9OIGRvX3Rlc3QgKCkKKyNpbmNsdWRlICIuLi90ZXN0LXNrZWxldG9uLmMiCisKKworc3RhdGljIGNoYXIgKmNvcHk7CisKK3N0YXRpYyB2b2lkCitwcmVwYXJlIChpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworICBjaGFyICpidWY7CisgIGludCBvZmY7CisgIGFzcHJpbnRmICgmYnVmLCAiY3AgJXMgJW4lcy1jb3B5IiwgYXJndlswXSwgJm9mZiwgYXJndlswXSk7CisgIGlmIChidWYgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiYXNwcmludGYgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoc3lzdGVtIChidWYpICE9IDApCisgICAgeworICAgICAgcHV0cyAoInN5c3RlbSAgZmFpbGVkIik7CisgICAgICBleGl0ICgxKTsKKyAgICB9CisKKyAgLyogTWFrZSBpdCBub3QgZXhlY3V0YWJsZS4gICovCisgIGNvcHkgPSBidWYgKyBvZmY7CisgIGlmIChjaG1vZCAoY29weSwgMDY2NikgIT0gMCkKKyAgICB7CisgICAgICBwdXRzICgiY2htb2QgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIGFkZF90ZW1wX2ZpbGUgKGNvcHkpOworfQorCisKK3N0YXRpYyBpbnQKK2RvX3Rlc3QgKHZvaWQpCit7CisgIGNvbnN0IGNoYXIgKmVudltdID0geyJGT089QkFSIi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CkKKyNpbmNsdWRlICIuLi90ZXN0LXNrZWxldG9uLmMiCisKKworc3RhdGljIGNoYXIgKmNvcHk7CisKK3N0YXRpYyB2b2lkCitwcmVwYXJlIChpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworICBjaGFyICpidWY7CisgIGludCBvZmY7CisgIGFzcHJpbnRmICgmYnVmLCAiY3AgJXMgJW4lcy1jb3B5IiwgYXJndlswXSwgJm9mZiwgYXJndlswXSk7CisgIGlmIChidWYgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiYXNwcmludGYgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoc3lzdGVtIChidWYpICE9IDApCisgICAgeworICAgICAgcHV0cyAoInN5c3RlbSAgZmFpbGVkIik7CisgICAgICBleGl0ICgxKTsKKyAgICB9CisKKyAgLyogTWFrZSBpdCBub3QgZXhlY3V0YWJsZS4gICovCisgIGNvcHkgPSBidWYgKyBvZmY7CisgIGlmIChjaG1vZCAoY29weSwgMDY2NikgIT0gMCkKKyAgICB7CisgICAgICBwdXRzICgiY2htb2QgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIGFkZF90ZW1wX2ZpbGUgKGNvcHkpOworfQorCisKK3N0YXRpYyBpbnQKK2RvX3Rlc3QgKHZvaWQpCit7CisgIC8qIE1ha2Ugc3VyZSB3ZSBkbyBub3QgZmluZCBhIGJpbmFyeSB3aXRoIHRoZSBuYW1lIHdlIGFyZSBnb2luZyB0bworICAgICB1c2UuICAqLworICBjaGFyICpiaW5kaXIgPSBzdHJkdXBhIChjb3B5KTsKKyAgYmluZGlyID0gY2Fub25pY2FsaXplX2ZpbGVfbmFtZSAoZGlybmFtZSAoYmluZGlyKSk7CisgIGlmIChiaW5kaXIgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiY2Fub25pY2FsaXplX2ZpbGVfbmFtZSBmYWlsZWQiKTsKKyAgICAgIHJldHVybiAxOworICAg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ZXBhcmUgKGludCBhcmdjLCBjaGFyICphcmd2W10pOworc3RhdGljIGludCBkb190ZXN0ICh2b2lkKTsKKyNkZWZpbmUgUFJFUEFSRShhcmdjLCBhcmd2KSBwcmVwYXJlIChhcmdjLCBhcmd2KQorI2RlZmluZSBURVNUX0ZVTkNUSU9OIGRvX3Rlc3QgKCkKKyNpbmNsdWRlICIuLi90ZXN0LXNrZWxldG9uLmMiCisKKworc3RhdGljIGNoYXIgKmNvcHk7CisKK3N0YXRpYyB2b2lkCitwcmVwYXJlIChpbnQgYXJnYywgY2hhciAqYXJndltdKQoreworICBjaGFyICpidWY7CisgIGludCBvZmY7CisgIGFzcHJpbnRmICgmYnVmLCAiY3AgJXMgJW4lcy1jb3B5IiwgYXJndlswXSwgJm9mZiwgYXJndlswXSk7CisgIGlmIChidWYgPT0gTlVMTCkKKyAgICB7CisgICAgICBwdXRzICgiYXNwcmludGYgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorICBpZiAoc3lzdGVtIChidWYpICE9IDApCisgICAgeworICAgICAgcHV0cyAoInN5c3RlbSAgZmFpbGVkIik7CisgICAgICBleGl0ICgxKTsKKyAgICB9CisKKyAgLyogTWFrZSBpdCBub3QgZXhlY3V0YWJsZS4gICovCisgIGNvcHkgPSBidWYgKyBvZmY7CisgIGlmIChjaG1vZCAoY29weSwgMDY2NikgIT0gMCkKKyAgICB7CisgICAgICBwdXRzICgiY2htb2QgIGZhaWxlZCIpOworICAgICAgZXhpdCAoMSk7CisgICAgfQorCisgIGFkZF90ZW1wX2ZpbGUgKGNvcHkpOworfQorCisKK3N0YXRpYyBpbnQKK2RvX3Rlc3QgKHZvaWQpCit7CisgIGNoYXIgKmFyZ3ZbXSA9IHsgY29weSwgTlVMTCB9OworICBjaGFyICplbnZwW10gPSB7IChjaGFyICopICJGT089QkFSIiwgTlVMTCB9OworCisgIGVycm5vID0gMDsKKyAgZXhlY3ZlIChjb3B5LCBhcmd2LCBlbnZwKTsKKworICB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Chsb2NhbGUgPT0gTlVMTCkKKwljb250aW51ZTsKKworICAgICAgaW5wdXQgPSBuZXh0X2lucHV0ICgmY3AsIDAsIDApOworICAgICAgaWYgKGlucHV0ID09IE5VTEwpCisJY29udGludWU7CisKKyAgICAgIHBhdHRlcm4gPSBuZXh0X2lucHV0ICgmY3AsIDAsIDApOworICAgICAgaWYgKHBhdHRlcm4gPT0gTlVMTCkKKwljb250aW51ZTsKKworICAgICAgcmVzdWx0X3N0ciA9IG5leHRfaW5wdXQgKCZjcCwgMCwgMCk7CisgICAgICBpZiAocmVzdWx0X3N0ciA9PSBOVUxMKQorCWNvbnRpbnVlOworCisgICAgICBpZiAoc3RyY21wIChyZXN1bHRfc3RyLCAiMCIpID09IDApCisJcmVzdWx0ID0gMDsKKyAgICAgIGVsc2UgaWYgIChzdHJjYXNlY21wIChyZXN1bHRfc3RyLCAiTk9NQVRDSCIpID09IDApCisJcmVzdWx0ID0gRk5NX05PTUFUQ0g7CisgICAgICBlbHNlCisJeworCSAgY2hhciAqZW5kcDsKKwkgIHJlc3VsdCA9IHN0cnRvbCAocmVzdWx0X3N0ciwgJmVuZHAsIDApOworCSAgaWYgKCplbmRwICE9ICdcMCcpCisJICAgIGNvbnRpbnVlOworCX0KKworICAgICAgZmxhZ3MgPSBuZXh0X2lucHV0ICgmY3AsIDAsIDEpOworICAgICAgaWYgKGZsYWdzID09IE5VTEwpCisJLyogV2UgYWxsb3cgdGhlIGZsYWdzIG1pc3NpbmcuICAqLworCWZsYWdzID0gIiI7CisKKyAgICAgIC8qIENvbnZlcnQgdGhlIHRleHQgZGVzY3JpYmluZyB0aGUgZmxhZ3MgaW4gYSBudW1lcmljIHZhbHVlLiAgKi8KKyAgICAgIGZsYWdzX3ZhbCA9IGNvbnZlcnRfZmxhZ3MgKGZsYWdzKTsKKyAgICAgIGlmIChmbGFnc192YWwgPT0gLTEpCisJLyogU29tZXRoaW5nIHdlbnQgd3JvbmcuICAqLworCWNvbnRpbnVlOworCisgICAgICAvKiBOb3cgcnVuIHRoZSBhY3R1YWwgdGVzdC4gICovCisgICAgICArK250ZXN0czsKKworICAgICAgaWYgKHNldGxvY2FsZSAoTENfQ09MTEFURSwgbG9jYWxlKSA9PSBOVUxMCisJICB8fCBzZXRsb2NhbGUgKExDX0NUWVBFLCBsb2NhbGUpID09IE5VTEwpCisJeworCSAgcHV0cyAoIioqKiBDYW5ub3Qgc2V0IGxvY2FsZSIpOworCSAgKytuZmFpbGVkOworCSAgY29udGludWU7CisJfQorCisgICAgICBmbm1yZXMgPSBmbm1hdGNoIChwYXR0ZXJuLCBpbnB1dCwgZmxhZ3NfdmFsKTsKKworICAgICAgcHJpbnRmICgiJTNkOiBmbm1hdGNoIChcIiVzXCIsIFwiJXNcIiwgJXMpID0gJXMlYyIsCisJICAgICAgKytuciwKKwkgICAgICBlc2NhcGUgKHBhdHRlcm4sICZlc2NwYXR0ZXJubGVuLCAmZXNjcGF0dGVybiksCisJICAgICAgZXNjYXBlIChpbnB1dCwgJmVzY2lucHV0bGVuLCAmZXNjaW5wdXQpLAorCSAgICAgIGZsYWdfb3V0cHV0IChmbGFnc192YWwpLAorCSAgICAgIChmbm1yZXMgPT0gMAorCSAgICAgICA/ICIwIiA6IChmbm1yZXMgPT0gRk5NX05PTUFUQ0gKKwkJCT8gIkZOTV9OT01BVENIIgorCQkJOiAoc3ByaW50ZiAobnVtYnVmLCAiJWQiLCBmbm1yZXMpLCBudW1idWYpKSksCisJICAgICAgKGZubXJlcyAhPSAwKSAhPSAocmVzdWx0ICE9IDApID8gJyAnIDogJ1xuJyk7CisKKyAgICAgIGlmICgoZm5tcmVzICE9IDApICE9IChyZXN1bHQgIT0gMCkpCisJeworCSAgcHJpbnRmICgiKEZBSUwsIGV4cGVjdGVkICVzKSAqKipcbiIsCisJCSAgcmVzdWx0ID09IDAKKwkJICA/ICIwIiA6IChyZXN1bHQgPT0gRk5NX05PTUFUQ0gKKwkJCSAgID8gIkZOTV9OT01BVENIIgorCQkJICAgOiAoc3ByaW50ZiAobnVtYnVmLCAiJWQiLCByZXN1bHQpLCBudW1idWYpKSk7CisJICArK25mYWlsZWQ7CisJfQorICAgIH0KKworICBwcmludGYgKCI9PT09PT09PT09PT09PT09PT09PT1cbiUzZCB0ZXN0cywgJTNkIGZhaWxlZFxuIiwgbnRlc3RzLCBuZmFpbGVkKTsKKworICBmcmVlIChlc2NwYXR0ZXJuKTsKKyAgZnJlZSAoZXNjaW5wdXQpOworICBmcmVlIChsaW5lYnVmKTsKKworICByZXR1cm4gbmZhaWxlZCAhPSAwOworfQorCisKK3N0YXRpYyBjaGFyICoKK25leHRfaW5wdXQgKGNoYXIgKipsaW5lLCBpbnQgZmlyc3QsIGludCBsYXN0KQoreworICBjaGFyICpjcCA9ICpsaW5lOworICBjaGFyICpyZXN1bHQ7CisKKyAgd2hpbGUgKCpjcCA9PSAnICcgfHwgKmNwID09ICdcdCcpCisgICAgKytjcDsKKworICAvKiBXZSBhbGxvdyBjb21tZW50IGxpbmVzIHN0YXJ0aW5nIHdpdGggJyMnLiAgKi8KKyAgaWYgKGZpcnN0ICYmICpjcCA9PSAnIycpCisgICAgcmV0dXJuIE5VTEw7CisKKyAgaWYgKCpjcCA9PSAnIicpCisgICAgeworICAgICAgY2hhciAqd3A7CisKKyAgICAgIHJlc3VsdCA9ICsrY3A7CisgICAgICB3cCA9IGNwOworCisgICAgICB3aGlsZSAoKmNwICE9ICciJyAmJiAqY3AgIT0gJ1wwJyAmJiAqY3AgIT0gJ1xuJykKKwlpZiAoKmNwID09ICdcXCcpCisJICB7CisJICAgIGlmIChjcFsxXSA9PSAnXG4nIHx8IGNwWzFdID09ICdcMCcpCisJICAgICAgcmV0dXJuIE5VTEw7CisKKwkgICAgKytjcDsKKwkgICAgaWYgKCpjcCA9PSAndCcpCisJICAgICAgKndwKysgPSAnXHQnOworCSAgICBlbHNlIGlmICgqY3AgPT0gJ24nKQorCSAgICAgICp3cCsrID0gJ1xuJzsKKwkgICAgZWxzZQorCSAgICAgICp3cCsrID0gKmNwOworCisJICAgICsrY3A7CisJICB9CisJZWxzZQorCSAgKndwKysgPSAqY3ArKzsKKworICAgICAgaWYgKCpjcCAhPSAnIicpCisJcmV0dXJuIE5VTEw7CisKKyAgICAgIGlmICh3cCAhPSBjcCkKKwkqd3AgPSAnXDAnOworICAgIH0KKyAgZWxzZQorICAgIHsKKyAgICAgIHJlc3VsdCA9IGNwOworICAgICAgd2hpbGUgKCpjcCAhPSAnXDAnICYmICpjcCAhPSAnXG4nICYmICpjcCAhPSAnICcgJiYgKmNwICE9ICdcdCcpCisJKytjcDsKKworICAgICAgaWYgKGNwID09IHJlc3VsdCAmJiAhIGxhc3QpCisJLyogUHJlbWF0dXJlIGVuZCBvZiBsaW5lLiAgKi8KKwlyZXR1cm4gTlVMTDsKKyAgICB9CisKKyAgLyogVGVybWluYXRlIGFuZCBza2lwIG92ZXIgdGhlIG5leHQgd2hpdGUgc3BhY2VzLiAgKi8KKyAgKmNwKysgPSAnXDAnOworCisgICpsaW5lID0gY3A7CisgIHJldHVybiByZXN1bHQ7Cit9CisKKworc3RhdGljIGludAorY29udmVydF9mbGFncyAoY29uc3QgY2hhciAqc3RyKQoreworICBpbnQgcmVzdWx0ID0gMDsKKworICB3aGlsZSAoKnN0ciAhPSAnXDAnKQorICAgIHsKKyAgICAgIGludCBsZW47CisKKyAgICAgIGlmIChzdHJuY2FzZWNtcCAoc3RyLCAiUEFUSE5BTUUiLCA4KSA9PSAwCisJICAmJiAoc3RyWzhdID09ICd8JyB8fCBzdHJbOF0gPT0gJ1wwJykpCisJeworCSAgcmVzdWx0IHw9IEZOTV9QQVRITkFNRTsKKwkgIGxlbiA9IDg7CisJfQorICAgICAgZWxzZSBpZiAoc3RybmNhc2VjbXAgKHN0ciwgIk5PRVNDQVBFIiwgOCkgPT0gMAorCSAgICAgICAmJiAoc3RyWzhdID09ICd8JyB8fCBzdHJbOF0gPT0gJ1wwJykpCisJeworCSAgcmVzdWx0IHw9IEZOTV9OT0VTQ0FQRTsKKwkgIGxlbiA9IDg7CisJfQorICAgICAgZWxzZSBpZiAoc3RybmNhc2VjbXAgKHN0ciwgIlBFUklPRCIsIDYpID09IDAKKwkgICAgICAgJiYgKHN0cls2XSA9PSAnfCcgfHwgc3RyWzZdID09ICdcMCcpKQorCXsKKwkgIHJlc3VsdCB8PSBGTk1fUEVSSU9EOworCSAgbGVuID0gNjsKKwl9CisgICAgICBlbHNlIGlmIChzdHJuY2FzZWNtcCAoc3RyLCAiTEVBRElOR19ESVIiLCAxMSkgPT0gMAorCSAgICAgICAmJiAoc3RyWzExXSA9PSAnfCcgfHwgc3RyWzExXSA9PSAnXDAnKSkKKwl7CisJICByZXN1bHQgfD0gRk5NX0xFQURJTkdfRElSOworCSAgbGVuID0gMTE7CisJfQorICAgICAgZWxzZSBpZiAoc3RybmNhc2VjbXAgKHN0ciwgIkNBU0VGT0xEIiwgOCkgPT0gMAorCSAgICAgICAmJiAoc3RyWzhdID09ICd8JyB8fCBzdHJbOF0gPT0gJ1wwJykpCisJeworCSAgcmVzdWx0IHw9IEZOTV9DQVNFRk9MRDsKKwkgIGxlbiA9IDg7CisJfQorICAgICAgZWxzZSBpZiAoc3RybmNhc2VjbXAgKHN0ciwgIkVYVE1BVENIIiwgOCkgPT0gMAorCSAgICAgICAmJiAoc3RyWzhdID09ICd8JyB8fCBzdHJbOF0gPT0gJ1wwJykpCisJeworCSAgcmVzdWx0IHw9IEZOTV9FWFRNQVRDSDsKKwkgIGxlbiA9IDg7CisJfQorICAgICAgZWxzZQorCXJldHVybiAtMTsKKworICAgICAgc3RyICs9IGxlbjsKKyAgICAgIGlmICgqc3RyICE9ICdcMCcpCisJKytzdHI7CisgICAgfQorCisgIHJldHVybiByZXN1bHQ7Cit9CisKKworc3RhdGljIGNoYXIgKgorZmxhZ19vdXRwdXQgKGludCBmbGFncykKK3sKKyAgc3RhdGljIGNoYXIgYnVmWzEwMF07CisgIGludCBmaXJzdCA9IDE7CisgIGNoYXIgKmNwID0gYnVmOwor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AgcmV0dXJuIGJ1ZjsKK30KKworCitzdGF0aWMgY2hhciAqCitlc2NhcGUgKGNvbnN0IGNoYXIgKnN0ciwgc2l6ZV90ICpyZXNsZW5wLCBjaGFyICoqcmVzYnVmcCkKK3sKKyAgc2l6ZV90IHJlc2xlbiA9ICpyZXNsZW5wOworICBjaGFyICpyZXNidWYgPSAqcmVzYnVmcDsKKyAgc2l6ZV90IGxlbiA9IHN0cmxlbiAoc3RyKTsKKyAgY2hhciAqd3A7CisKKyAgaWYgKDIgKiBsZW4gKyAxID4gcmVzbGVuKQorICAgIHsKKyAgICAgIHJlc2J1ZiA9IChjaGFyICopIHJlYWxsb2MgKHJlc2J1ZiwgMiAqIGxlbiArIDEpOworICAgICAgaWYgKHJlc2J1ZiA9PSBOVUxMKQorCWVycm9yIChFWElUX0ZBSUxVUkUsIGVycm5vLCAid2hpbGUgYWxsb2NhdGluZyBidWZmZXIgZm9yIHByaW50aW5nIik7CisgICAgICAqcmVzbGVucCA9IDIgKiBsZW4gKyAxOworICAgICAgKnJlc2J1ZnAgPSByZXNidWY7CisgICAgfQorCisgIHdwID0gcmVzYnVmOworICB3aGlsZSAoKnN0ciAhPSAnXDAnKQorICAgIGlmICgqc3RyID09ICdcdCcpCisgICAgICB7CisJKndwKysgPSAnXFwnOworCSp3cCsrID0gJ3QnOworCSsrc3RyOworICAgICAgfQorICAgIGVsc2UgaWYgKCpzdHIgPT0gJ1xuJykKKyAgICAgIHsKKwkqd3ArKyA9ICdcXCc7CisJKndwKysgPSAnbic7CisJKytzdHI7CisgICAgICB9CisgICAgZWxzZSBpZiAoKnN0ciA9PSAnIicpCisgICAgICB7CisJKndwKysgPSAnXFwnOworCSp3cCsrID0gJyInOworCSsrc3RyOworICAgICAgfQorICAgIGVsc2UgaWYgKCpzdHIgPT0gJ1xcJykKKyAgICAgIHsKKwkqd3ArKyA9ICdcXCc7CisJKndwKysgPSAnXFwnOworCSsrc3RyOworICAgICAgfQorICAgIGVsc2UKKyAgICAgICp3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JCQkiW1s9YT1dWy5iLl1dIgkgICAgICAgMAorQwkJICJhIgkJCSJbWz1hPV1bOmRpZ2l0Ol1dIiAgICAgMAorCisjIEIuNiAwMTYoQykKK0MJCSAiPSIJCQkiW1s9YT1dYl0iCSAgICAgICBOT01BVENICitDCQkgIl0iCQkJIltbPWE9XWJdIgkgICAgICAgTk9NQVRDSAorQwkJICJhIgkJCSJbWz1iPV1bPWM9XV0iCSAgICAgICBOT01BVENICitDCQkgImEiCQkJIltbPWI9XVsuXS5dXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYSIJCQkiW1s9Yj1dWzpkaWdpdDpdXSIgICAgIE5PTUFUQ0gKKworIyBCLjYgMDE3KEMpCitDCQkgImEiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJhIgkJCSJbIVs6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIi0iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJhXWEiCQkJIltbOmFsbnVtOl1dYSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiLSIJCQkiW1s6YWxudW06XS1dIgkgICAgICAgMAorQwkJICJhYSIJCQkiW1s6YWxudW06XV1hIgkgICAgICAgMAorQwkJICItIgkJCSJbIVs6YWxudW06XV0iCSAgICAgICAwCitDCQkgIl0iCQkJIlshXVs6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIlsiCQkJIlshWzphbG51bTpdW10iCSAgICAgICBOT01BVENICitDCQkgImEiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJiIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiYyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgImQiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJlIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiZiIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgImciCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJoIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiaSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgImoiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJrIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAibCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIm0iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJuIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAibyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgInAiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJxIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiciIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgInMiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJ0IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAidSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgInYiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJ3IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAieCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgInkiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJ6IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiQSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIkIiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJDIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiRCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIkUiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJGIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiRyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIkgiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJJIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiSiIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIksiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJMIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiTSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIk4iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJPIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiUCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIlEiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJSIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiUyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIlQiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJVIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiViIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIlciCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICJYIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiWSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIloiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICIwIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiMSIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIjIiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICIzIgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiNCIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIjUiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICI2IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiNyIJCQkiW1s6YWxudW06XV0iCSAgICAgICAwCitDCQkgIjgiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgMAorQwkJICI5IgkJCSJbWzphbG51bTpdXSIJICAgICAgIDAKK0MJCSAiISIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIiMiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICIlIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiKyIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIiwiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICItIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiLiIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIi8iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICI6IgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiOyIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIj0iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJAIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiWyIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIlxcIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiXSIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIl4iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJfIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAieyIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIn0iCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJ+IgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiXCIiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICIkIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiJiIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIiciCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICIoIgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiKSIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIioiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICI/IgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYCIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgInwiCQkJIltbOmFsbnVtOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICI8IgkJCSJbWzphbG51bTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiPiIJCQkiW1s6YWxudW06XV0iCSAgICAgICBOT01BVENICitDCQkgIlx0IgkJCSJbWzpjbnRybDpdXSIJICAgICAgIDAKK0MJCSAidCIJCQkiW1s6Y250cmw6XV0iCSAgICAgICBOT01BVENICitDCQkgInQiCQkJIltbOmxvd2VyOl1dIgkgICAgICAgMAorQwkJICJcdCIJCQkiW1s6bG93ZXI6XV0iCSAgICAgICBOT01BVENICitDCQkgIlQiCQkJIltbOmxvd2VyOl1dIgkgICAgICAgTk9NQVRDSAorQwkJICJcdCIJCQkiW1s6c3BhY2U6XV0iCSAgICAgICAwCitDCQkgInQiCQkJIltbOnNwYWNlOl1dIgkgICAgICAgTk9N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6XV0iCSAgICAgICBOT01BVENICitDCQkgImEiCQkJIltbYWxwaGFdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYSIJCQkiW1thbHBoYTpdXSIJICAgICAgIE5PTUFUQ0gKK0MJCSAiYV0iCQkJIltbYWxwaGFdXSIJICAgICAgIDAKK0MJCSAiYV0iCQkJIltbYWxwaGE6XV0iCSAgICAgICAwCitDCQkgImEiCQkJIltbOmFscGhhOl1bLmIuXV0iICAgICAwCitDCQkgImEiCQkJIltbOmFscGhhOl1bPWI9XV0iICAgICAwCitDCQkgImEiCQkJIltbOmFscGhhOl1bOmRpZ2l0Ol1dIiAwCitDCQkgImEiCQkJIltbOmRpZ2l0Ol1bOmFscGhhOl1dIiAwCisKKyMgQi42IDAxOChDKQorQwkJICJhIgkJCSJbYS1jXSIJCSAgICAgICAwCitDCQkgImIiCQkJIlthLWNdIgkJICAgICAgIDAKK0MJCSAiYyIJCQkiW2EtY10iCQkgICAgICAgMAorQwkJICJhIgkJCSJbYi1jXSIJCSAgICAgICBOT01BVENICitDCQkgImQiCQkJIltiLWNdIgkJICAgICAgIE5PTUFUQ0gKK0MJCSAiQiIJCQkiW2EtY10iCQkgICAgICAgTk9NQVRDSAorQwkJICJiIgkJCSJbQS1DXSIJCSAgICAgICBOT01BVENICitDCQkgIiIJCQkiW2EtY10iCQkgICAgICAgTk9NQVRDSAorQwkJICJhcyIJCQkiW2EtY2Etel0iCSAgICAgICBOT01BVENICitDCQkgImEiCQkJIltbLmEuXS1jXSIJICAgICAgIDAKK0MJCSAiYSIJCQkiW2EtWy5jLl1dIgkgICAgICAgMAorQwkJICJhIgkJCSJbWy5hLl0tWy5jLl1dIgkgICAgICAgMAorQwkJICJiIgkJCSJbWy5hLl0tY10iCSAgICAgICAwCitDCQkgImIiCQkJIlthLVsuYy5dXSIJICAgICAgIDAKK0MJCSAiYiIJCQkiW1suYS5dLVsuYy5dXSIJICAgICAgIDAKK0MJCSAiYyIJCQkiW1suYS5dLWNdIgkgIC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0MJCSAiYToiCQkJImFbMC05LWFdIgkgICAgICAgTk9NQVRDSAorQwkJICJhOiIJCQkiYVswOS1hXSIJICAgICAgIDAKKworIyBCLjYgMDI0KEMpCitDCQkgIiIJCQkiKiIJCSAgICAgICAwCitDCQkgImFzZC9zZGYiCQkiKiIJCSAgICAgICAwCisKKyMgQi42IDAyNShDKQorQwkJICJhcyIJCQkiW2EtY11bYS16XSIJICAgICAgIDAKK0MJCSAiYXMiCQkJIj8/IgkJICAgICAgIDAKKworIyBCLjYgMDI2KEMpCitDCQkgImFzZC9zZGYiCQkiYXMqZGYiCQkgICAgICAgMAorQwkJICJhc2Qvc2RmIgkJImFzKiIJCSAgICAgICAwCitDCQkgImFzZC9zZGYiCQkiKmRmIgkJICAgICAgIDAKK0MJCSAiYXNkL3NkZiIJCSJhcypkZyIJCSAgICAgICBOT01BVENICitDCQkgImFzZGYiCQkJImFzKmRmIgkJICAgICAgIDAKK0MJCSAiYXNkZiIJCQkiYXMqZGY/IgkgICAgICAgTk9NQVRDSAorQwkJICJhc2RmIgkJCSJhcyo/PyIJCSAgICAgICAwCitDCQkgImFzZGYiCQkJImEqPz8/IgkJICAgICAgIDAKK0MJCSAiYXNkZiIJCQkiKj8/Pz8iCQkgICAgICAgMAorQwkJICJhc2RmIgkJCSI/Pz8/KiIJCSAgICAgICAwCitDCQkgImFzZGYiCQkJIj8/Kj8iCQkgICAgICAgMAorCisjIEIuNiAwMjcoQykKK0MJCSAiLyIJCQkiLyIJCSAgICAgICAwCitDCQkgIi8iCQkJIi8qIgkJICAgICAgIDAKK0MJCSAiLyIJCQkiKi8iCQkgICAgICAgMAorQwkJICIvIgkJCSIvPyIJCSAgICAgICBOT01BVENICitDCQkgIi8iCQkJIj8vIgkJICAgICAgIE5PTUFUQ0gKK0MJCSAiLyIJCQkiPyIJCSAgICAgICAwCitDCQkgIi4iCQkJIj8iCQkgICAgICAgMAorQwkJICIvLiIJCQkiPz8iCQkgICAgICAgMAorQwkJICIvIgkJCSJbIWEtY10iCSAgICAgICAwCitDCQkgIi4iCQkJIlshYS1jXSIJICAgICAgIDAKKworIyBCLjYgMDI5KEMpCitDCQkgIi8iCQkJIi8iCQkgICAgICAgMCAgICAgICBQQVRITkFNRQorQwkJICIvLyIJCQkiLy8iCQkgICAgICAgMCAgICAgICBQQVRITkFNRQorQwkJICIvLmEiCQkJIi8qIgkJICAgICAgIDAgICAgICAgUEFUSE5BTUUKK0MJCSAiLy5hIgkJCSIvP2EiCQkgICAgICAgMCAgICAgICBQQVRITkFNRQorQwkJICIvLmEiCQkJIi9bIWEtel1hIgkgICAgICAgMCAgICAgICBQQVRITkFNRQorQwkJICIvLmEvLmIiCQkiLyovP2IiCQkgICAgICAgMCAgICAgICBQQVRITkFNRQorCisjIEIuNiAwMzAoQykKK0MJCSAiLyIJCQkiPyIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FCitDCQkgIi8iCQkJIioiCQkgICAgICAgTk9NQVRDSCBQQVRITkFNRQorQwkJICJhL2IiCQkJImE/YiIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FCitDCQkgIi8uYS8uYiIJCSIvKmIiCQkgICAgICAgTk9NQVRDSCBQQVRITkFNRQorCisjIEIuNiAwMzEoQykKK0MJCSAiLyQiCQkJIlxcL1xcJCIJICAgICAgIDAKK0MJCSAiL1siCQkJIlxcL1xcWyIJICAgICAgIDAKK0MJCSAiL1siCQkJIlxcL1siCQkgICAgICAgMAorQwkJICIvW10iCQkJIlxcL1xcW10iCSAgICAgICAwCisKKyMgQi42IDAzMihDKQorQwkJICIvJCIJCQkiXFwvXFwkIgkgICAgICAgTk9NQVRDSCBOT0VTQ0FQRQorQwkJICIvXFwkIgkJCSJcXC9cXCQiCSAgICAgICBOT01BVENIIE5PRVNDQVBFCitDCQkgIlxcL1xcJCIJCSJcXC9cXCQiCSAgICAgICAwICAgICAgIE5PRVNDQVBFCisKKyMgQi42IDAzMyhDKQorQwkJICIuYXNkIgkJCSIuKiIJCSAgICAgICAwICAgICA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vYmFyIgkJImZvbypbYWJjXXoiCSAgICAgICBOT01BVENICitDCQkiZm9vYmF6IgkJImZvbypbYWJjXVt4eXpdIiAgICAgICAwCitDCQkiZm9vYmF6IgkJImZvbz8qW2FiY11beHl6XSIgICAgICAwCitDCQkiZm9vYmF6IgkJImZvbz8qW2FiY11beC95el0iICAgICAwCitDCQkiZm9vYmF6IgkJImZvbz8qW2FiY10vW3h5el0iICAgICBOT01BVENIIFBBVEhOQU1FCitDCQkiYSIJCQkiYS8iICAgICAgICAgICAgICAgICAgIE5PTUFUQ0ggUEFUSE5BTUUKK0MJCSJhLyIJCQkiYSIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FCitDCQkiLy9hIgkJCSIvYSIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FCitDCQkiL2EiCQkJIi8vYSIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FCitDCQkiYXoiCQkJIlthLV16IgkJICAgICAgIDAKK0MJCSJieiIJCQkiW2FiLV16IgkgICAgICAgMAorQwkJImN6IgkJCSJbYWItXXoiCSAgICAgICBOT01BVENICitDCQkiLXoiCQkJIlthYi1deiIJICAgICAgIDAKK0MJCSJheiIJCQkiWy1hXXoiCQkgICAgICAgMAorQwkJImJ6IgkJCSJbLWFiXXoiCSAgICAgICAwCitDCQkiY3oiCQkJIlstYWJdeiIJICAgICAgIE5PTUFUQ0gKK0MJCSIteiIJCQkiWy1hYl16IgkgICAgICAgMAorQwkJIlxcIgkJCSJbXFxcXC1hXSIJICAgICAgIDAKK0MJCSJfIgkJCSJbXFxcXC1hXSIJICAgICAgIDAKK0MJCSJhIgkJCSJbXFxcXC1hXSIJICAgICAgIDAKK0MJCSItIgkJCSJbXFxcXC1hXSIJICAgICAgIE5PTUFUQ0gKK0MJCSJcXCIJCQkiW1xcXS1hXSIJICAgICAgIE5PTUFUQ0gKK0MJCSJfIgkJCSJbXFxdLWFdIgkgICAgICAgMAorQwkJImEiCQkJIltcXF0tYV0iCSAgICAgICAwCitDCQ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JCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJ6IgkJCSJbYS16XSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLkIgkJCSJbYS16XSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICL2IgkJCSJbYS16XSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICL8IgkJCSJbYS16XSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJBIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJaIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLEIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLWIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLcIgkJCSJbYS16XSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJhIgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJ6IgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICLkIgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICL2IgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICL8IgkJCSJbQS1aXSIJCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJBIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJaIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLEIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLWIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLcIgkJCSJbQS1aXSIJCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0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GVfREUuSVNPLTg4NTktMSAixCIJCQkiW1s6dXBwZXI6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLWIgkJCSJbWzp1cHBlcjpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgItwiCQkJIltbOnVwcGVyOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiYSIJCQkiW1s6YWxwaGE6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJ6IgkJCSJbWzphbHBoYTpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuQiCQkJIltbOmFscGhhOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi9iIJCQkiW1s6YWxwaGE6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICL8IgkJCSJbWzphbHBoYTpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIkEiCQkJIltbOmFscGhhOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiWiIJCQkiW1s6YWxwaGE6XV0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLEIgkJCSJbWzphbHBoYTpdXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgItYiCQkJIltbOmFscGhhOl1dIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi3CIJCQkiW1s6YWxwaGE6XV0iCSAgICAgICAwCisKK2RlX0RFLklTTy04ODU5LTEgImEiCQkJIltbPWE9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4iIJCQkiW1s9YT1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLgIgkJCSJbWz1hPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuEiCQkJIltbPWE9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi5CIJCQkiW1s9YT1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJiIgkJCSJbWz1hPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImMiCQkJIltbPWE9XWJdIgkgICAgICAgTk9NQVRDSAorZGVfREUuSVNPLTg4NTktMSAiYSIJCQkiW1s94j1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLiIgkJCSJbWz3iPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuAiCQkJIltbPeI9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4SIJCQkiW1s94j1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLkIgkJCSJbWz3iPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImIiCQkJIltbPeI9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiYyIJCQkiW1s94j1dYl0iCSAgICAgICBOT01BVENICitkZV9ERS5JU08tODg1OS0xICJhIgkJCSJbWz3gPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuIiCQkJIltbPeA9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4CIJCQkiW1s94D1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLhIgkJCSJbWz3gPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuQiCQkJIltbPeA9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiYiIJCQkiW1s94D1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJjIgkJCSJbWz3gPV1iXSIJICAgICAgIE5PTUFUQ0gKK2RlX0RFLklTTy04ODU5LTEgImEiCQkJIltbPeE9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4iIJCQkiW1s94T1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLgIgkJCSJbWz3hPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuEiCQkJIltbPeE9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi5CIJCQkiW1s94T1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICJiIgkJCSJbWz3hPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImMiCQkJIltbPeE9XWJdIgkgICAgICAgTk9NQVRDSAorZGVfREUuSVNPLTg4NTktMSAiYSIJCQkiW1s95D1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLiIgkJCSJbWz3kPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgIuAiCQkJIltbPeQ9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAi4SIJCQkiW1s95D1dYl0iCSAgICAgICAwCitkZV9ERS5JU08tODg1OS0xICLkIgkJCSJbWz3kPV1iXSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImIiCQkJIltbPeQ9XWJdIgkgICAgICAgMAorZGVfREUuSVNPLTg4NTktMSAiYyIJCQkiW1s95D1dYl0iCSAgICAgICBOT01BVENICisKK2RlX0RFLklTTy04ODU5LTEgImFhIgkJCSJbWy5hLl1dYSIJICAgICAgIDAKK2RlX0RFLklTTy04ODU5LTEgImJhIgkJCSJbWy5hLl1dYSIJICAgICAgIE5PTUFUQ0gKKworCisjIEFuZCB3aXRoIGEgbXVsdGlieXRlIGNoYXJhY3RlciBzZXQuCitkZV9ERS5VVEYtOAkgImEiCQkJIlthLXpdIgkJICAgICAgIDAKK2RlX0RFLlVURi04CSAieiIJCQkiW2Etel0iCQkgICAgICAgMAorZGVfREUuVVRGLTgJICLDpCIJCQkiW2Etel0iCQkgICAgICAgMAorZGVfREUuVVRGLTgJICLDtiIJCQkiW2Etel0iCQkgICAgICAgMAorZGVfREUuVVRGLTgJICLDvCIJCQkiW2Etel0iCQkgICAgICAgMAorZGVfREUuVVRGLTgJICJBIgkJCSJbYS16XSIJCSAgICAgICBOT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WJdIgkgICAgICAgMAorZGVfREUuVVRGLTgJICJiIgkJCSJbWz3DpD1dYl0iCSAgICAgICAwCitkZV9ERS5VVEYtOAkgImMiCQkJIltbPcOkPV1iXSIJICAgICAgIE5PTUFUQ0gKKworZGVfREUuVVRGLTgJICJhYSIJCQkiW1suYS5dXWEiCSAgICAgICAwCitkZV9ERS5VVEYtOAkgImJhIgkJCSJbWy5hLl1dYSIJICAgICAgIE5PTUFUQ0gKKworCisjIFRlc3Qgb2YgR05VIGV4dGVuc2lvbnMuCitDCQkgIngiCQkJIngiCQkgICAgICAgMCAgICAgICBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4L3kiCQkJIngiCQkgICAgICAgMCAgICAgICBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4L3kveiIJCSJ4IgkJICAgICAgIDAgICAgICAgUEFUSE5BTUV8TEVBRElOR19ESVIKK0MJCSAieCIJCQkiKiIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveSIJCQkiKiIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveS96IgkJIioiCQkgICAgICAgMCAgICAgICBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4IgkJCSIqeCIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveSIJCQkiKngiCQkgICAgICAgMCAgICAgICBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4L3kveiIJCSIqeCIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngiCQkJIngqIgkJICAgICAgIDAgICAgICAgUEFUSE5BTUV8TEVBRElOR19ESVIKK0MJCSAieC95IgkJCSJ4KiIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveS96IgkJIngqIgkJICAgICAgIDAgICAgICAgUEFUSE5BTUV8TEVBRElOR19ESVIKK0MJCSAieCIJCQkiYSIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveSIJCQkiYSIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveS96IgkJImEiCQkgICAgICAgTk9NQVRDSCBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4IgkJCSJ4L3kiCQkgICAgICAgTk9NQVRDSCBQQVRITkFNRXxMRUFESU5HX0RJUgorQwkJICJ4L3kiCQkJIngveSIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveS96IgkJIngveSIJCSAgICAgICAwICAgICAgIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngiCQkJIng/eSIJCSAgICAgICBOT01BVENIIFBBVEhOQU1FfExFQURJTkdfRElSCitDCQkgIngveSIJCQkieD95IgkJICAgICAgIE5PTUFUQ0ggUEFUSE5BTUV8TEVBRElOR19ESVIKK0MJCSAieC95L3oiCQkieD95IgkJICAgICAgIE5PTUFUQ0ggUEFUSE5BTUV8TEVBRElOR19ESVIKKworIyBrc2ggc3R5bGUgbWF0Y2hpbmcuCitDCQkiYWJjZCIJCQkiP0AoYXxiKSpAKGMpZCIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSIvZGV2L3VkcC8xMjkuMjIuOC4xMDIvNDUiICIvZGV2L0AodGNwfHVkcCkvKi8qIiAwICAgICBQQVRITkFNRXxFWFRNQVRDSAorQwkJIjEyIgkJCSJbMS05XSooWzAtOV0pIiAgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIjEyYWJjIgkJCSJbMS05XSooWzAtOV0pIiAgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJIjEiCQkJIlsxLTldKihbMC05XSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiMDciCQkJIisoWzAtN10pIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQ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RVhUTUFUQ0gKK0MJCSJWTVMuRklMRTsxMzkiCQkiKlw7WzEtOV0qKFswLTldKSIgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJWTVMuRklMRTsxTiIJCSIqXDtbMS05XSooWzAtOV0pIiAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImFiY2ZlZmciCQkiYWIqKihlfGYpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImFiY2ZlZmciCQkiYWIqKihlfGYpZyIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJhYiIJCQkiYWIqKyhlfGYpIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImFiZWYiCQkJImFiKioqZWYiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiYWJlZiIJCQkiYWIqKiIJCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9mbyIJCQkiKihmKihvKSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZmZvIgkJCSIqKGYqKG8pKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmb29vb2ZvIgkJIiooZioobykpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZvb29vZm9mIgkJIiooZioobykpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZvb29mb29mb2Zvb28iCQkiKihmKihvKSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vb29mb2YiCQkiKihmKyhvKSkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkieGZvb29vZm9mIgkJIiooZioobykpIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImZvb29vZm9meCIJCSIqKGYqKG8pKSIJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJvZnhvb2Z4byIJCSIqKCoob2YqKG8peClvKSIgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIm9mb29vZm9vZm9mb29vIgkiKihmKihvKSkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiZm9vb3hmb294Zm94Zm9vb3giCSIqKGYqKG8peCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vb3hmb294b2ZveGZvb294IgkiKihmKihvKXgpIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImZvb294Zm9veGZ4Zm9vb3giCSIqKGYqKG8peCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkib2Z4b29meG8iCQkiKigqKG9mKihvKXgpbykiICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJvZm9vb3hvb2Z4byIJCSIqKCoob2YqKG8peClvKSIgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJIm9mb29veG9vZnhvb2Zvb294b29meG8iICIqKCoob2YqKG8peClvKSIgICAgICAwICAgICAgIEVYVE1BVENICitDCQkib2Zvb294b29meG9vZm9vb3hvb2Z4b28iICIqKCoob2YqKG8peClvKSIgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJvZm9vb3hvb2Z4b29mb29veG9vZnhvZm8iICIqKCoob2YqKG8peClvKSIgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJIm9mb29veG9vZnhvb2Zvb294b29meG9vb2Z4b2Z4byIgIiooKihvZioobyl4KW8pIiAwICAgIEVYVE1BVENICitDCQkiYWFjIgkJCSIqKEAoYSkpYUAoYykiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiYWMiCQkJIiooQChhKSlhQChjKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJjIgkJCSIqKEAoYSkpYUAoYykiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiYWFhYyIJCQkiKihAKGEpKWFAKGMpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImJhYWFjIgkJCSIqKEAoYSkpYUAoYykiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiYWJjZCIJCQkiP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2Zmb29mZmZvb29mZmYiICIqKCooZikqKG8pKSIgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9mb29mb29mb2ZvbyIJCSIqKGZvfGZvbykiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vIgkJCSIhKHgpIgkJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmb28iCQkJIiEoeCkqIgkJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmb28iCQkJIiEoZm9vKSIJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJmb28iCQkJIiEoZm9vKSoiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vYmFyIgkJIiEoZm9vKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmb29iYXIiCQkiIShmb28pKiIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJtb28uY293IgkJIiEoKi4qKS4hKCouKikiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkibWFkLm1vby5jb3ciCQkiISgqLiopLiEoKi4qKSIJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJtdWNjYS5wYXp6YSIJCSJtdSEoKihjKSk/LnBhISgqKHopKT8iIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJmZmYiCQkJIiEoZikiCQkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZmZiIJCQkiKighKGYpKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmZmYiCQkJIisoIShmKSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkib29vIgkJCSIhKGYpIgkJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJvb28iCQkJIiooIShmKSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkib29vIgkJCSIrKCEoZikpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZvbyIJCQkiIShmKSIJCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vIgkJCSIqKCEoZikpIgkgICAgICAgMCAgICAgICBFWFRNQVRDSAorQwkJImZvbyIJCQkiKyghKGYpKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmIgkJCSIhKGYpIgkJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJmIgkJCSIqKCEoZikpIgkgICAgICAgTk9NQVRDSCBFWFRNQVRDSAorQwkJImYiCQkJIisoIShmKSkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiZm9vdCIJCQkiQCghKHoqKXwqeCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiem9vdCIJCQkiQCghKHoqKXwqeCkiCSAgICAgICBOT01BVENIIEVYVE1BVENICitDCQkiZm9veCIJCQkiQCghKHoqKXwqeCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiem9veCIJCQkiQCghKHoqKXwqeCkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiZm9vIgkJCSIqKCEoZm9vKSkJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJmb29iIgkJCSIhKGZvbyliKiIJICAgICAgIE5PTUFUQ0ggRVhUTUFUQ0gKK0MJCSJmb29iYiIJCQkiIShmb28pYioiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiWyIJCQkiKihbYVtdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJdIgkJCSIqKFtdYVtdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJhIgkJCSIqKFtdYVtdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJiIgkJCSIqKFshXWFbXSkiCSAgICAgICAwICAgICAgIEVYVE1BVENICitDCQkiWyIJCQkiKihbIV1hW118W1tdKSIJICAgICAgIDAgICAgICAgRVhUTUFUQ0gKK0MJCSJdIgkJCSIqKFshXWFbXXxbXV0pIg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J0ID0gYXRvaSAocG9ydHN0cik7CisgIHN0cnVjdCBhZGRyaW5mbyBoaW50cywgKmFpcmVzLCAqcGFpOworICBpbnQgcnY7CisgIGludCByZXMgPSAxOworCisgIG1lbXNldCAoJmhpbnRzLCAwLCBzaXplb2YgKGhpbnRzKSk7CisgIGhpbnRzLmFpX2ZhbWlseSA9IEFGX0lORVQ7CisgIHJ2ID0gZ2V0YWRkcmluZm8gKE5VTEwsIHBvcnRzdHIsICZoaW50cywgJmFpcmVzKTsKKyAgaWYgKHJ2ID09IDApCisgICAgeworICAgICAgc3RydWN0IHNvY2thZGRyX2luICpwc2luID0gMDsKKyAgICAgIGludCBnb3RfdGNwLCBnb3RfdWRwOworICAgICAgaW50IGVyciA9IDA7CisKKyAgICAgIGdvdF90Y3AgPSBnb3RfdWRwID0gMDsKKyAgICAgIGZvciAocGFpID0gYWlyZXM7IHBhaTsgcGFpID0gcGFpLT5haV9uZXh0KQorICAgICAgICB7CisgICAgICAgICAgcHJpbnRmICgiYWlfZmFtaWx5PSVkLCBhaV9hZGRybGVuPSVkLCBhaV9zb2NrdHlwZT0lZCIsCisgICAgICAgICAgICAgICAgICAoaW50KSBwYWktPmFpX2ZhbWlseSwgKGludCkgcGFpLT5haV9hZGRybGVuLAorICAgICAgICAgICAgICAgICAgKGludCkgcGFpLT5haV9zb2NrdHlwZSk7CisgICAgICAgICAgaWYgKHBhaS0+YWlfZmFtaWx5ID09IEFGX0lORVQpCisgICAgICAgICAgICBwcmludGYgKCIsIHBvcnQ9JWQiLAorICAgICAgICAgICAgICAgICAgICBudG9ocyAoKChzdHJ1Y3Qgc29ja2FkZHJfaW4gKikgcGFpLT5haV9hZGRyKS0+c2luX3BvcnQpKTsKKyAgICAgICAgICBwdXRzICgiIik7CisKKyAgICAgICAgICBlcnIgfD0gcGFpLT5haV9mYW1pbHkgIT0gQUZfSU5FVDsKKyAgICAgICAgICBlcnIgfD0gcGFpLT5haV9hZGRybGVuICE9IHNpemVvZiAoc3RydWN0IHNvY2thZGRyX2luKTsKKyAgICAgICAgICBlcnIgfD0gcGFpLT5haV9hZGRyID09IDA7CisgICAgICAgICAgaWYgKHBhaS0+YWlfZmFtaWx5ID09IEFGX0lORVQpCisgICAgICAgICAgICBlcnIgfD0KKyAgICAgICAgICAgICAgbnRvaHMgKCgoc3RydWN0IHNvY2thZGRyX2luICopIHBhaS0+YWlfYWRkciktPnNpbl9wb3J0KSAhPSBwb3J0OworICAgICAgICAgIGdvdF90Y3AgfD0gcGFpLT5haV9zb2NrdHlwZSA9PSBTT0NLX1NUUkVBTTsKKyAgICAgICAgICBnb3RfdWRwIHw9IHBhaS0+YWlfc29ja3R5cGUgPT0gU09DS19ER1JBTTsKKyAgICAgICAgICBpZiAoZXJyKQorICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgIGlmIChlcnIpCisgICAgICAgIHsKKyAgICAgICAgICBwcmludGYgKCJGQUlMIGdldGFkZHJpbmZvIElQdjQgc29ja3R5cGUgMCw1MTM6ICIKKyAgICAgICAgICAgICAgICAgICJmYW0gJWQgYWxlbiAlZCBhZGRyICVwIGFkZHIvZmFtICVkICIKKyAgICAgICAgICAgICAgICAgICJhZGRyL3BvcnQgJWQgSFslZF1cbiIsCisgICAgICAgICAgICAgICAgICBwYWktPmFpX2ZhbWlseSwgcGFpLT5haV9hZGRybGVuLCBwc2luLAorICAgICAgICAgICAgICAgICAgcHNpbiA/IHBzaW4tPnNpbl9mYW1pbHkgOiAwLAorICAgICAgICAgICAgICAgICAgcHNpbiA/IHBzaW4tPnNpbl9wb3J0IDogMCwKKyAgICAgICAgICAgICAgICAgIHBzaW4gPyBodG9ucyAocHNpbi0+c2luX3BvcnQpIDogMCk7CisgICAgICAgIH0KKyAgICAgIGVsc2UgaWYgKGdvdF90Y3AgJiYgZ290X3VkcCkKKyAgICAgICAgeworICAgICAgICAgIHByaW50ZiAoIlNVQ0NFU1MgZ2V0YWRkcmluZm8gSVB2NCBzb2NrdHlwZSAwLDUxM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cGVjdGVkICVkXG4iLAkgICAgICBcCisJICAgICAgbm8sIGFpX3Jlcy0+YWlfZmFtaWx5LCBmYW0pOwkJCQkgICAgICBcCisgICAgICByZXN1bHQgPSAxOwkJCQkJCQkgICAgICBcCisgICAgfQkJCQkJCQkJCSAgICAgIFwKKyAgZWxzZSBpZiAoZmFtID09IEFGX0lORVQpCQkJCQkJICAgICAgXAorICAgIHsJCQkJCQkJCQkgICAgICBcCisgICAgICBpZiAoYWlfcmVzLT5haV9hZGRybGVuICE9IHNpemVvZiAoc3RydWN0IHNvY2thZGRyX2luKSkJCSAgICAgIFwKKwl7CQkJCQkJCQkgICAgICBcCisJICBwcmludGYgKCJnZXRhZGRyaW5mbyB0ZXN0ICVkOiBhZGRyZXNzIHNpemUgJXp1LCBleHBlY3RlZCAlenVcbiIsICAgIFwKKwkJICBubywgKHNpemVfdCkgYWlfcmVzLT5haV9hZGRybGVuLAkJCSAgICAgIFwKKwkJICBzaXplb2YgKHN0cnVjdCBzb2NrYWRkcl9pbikpOwkJCQkgICAgICBcCisJICByZXN1bHQgPSAxOwkJCQkJCQkgICAgICBcCisJfQkJCQkJCQkJICAgICAgXAorICAgICAgZWxzZSBpZiAoc3RyY21wIChjb3JhZGRyLCBcCisJCSAgICAgICBpbmV0X250b2EgKCgoc3RydWN0IHNvY2thZGRyX2luICopIGFpX3Jlcy0+YWlfYWRkciktPnNpbl9hZGRyKSlcCisJICAgICAgICE9IDApCQkJCQkJCSAgICAgIFwKKwl7CQkJCQkJCQkgICAgICBcCisJICBwcmludGYgKCJnZXRhZGRyaW5mbyB0ZXN0ICVkOiBnb3QgdmFsdWUgJXMsIGV4cGVjdGVkICVzXG4iLAkgICAgICBcCisJCSAgbm8sCQkJCQkJCSAgICAgIFwKKwkJICBpbmV0X250b2EgKCgoc3RydWN0IHNvY2thZGRyX2luICopIGFpX3Jlcy0+YWlfYWRkciktPnNpbl9hZGRyKSwgXAorCQkgIGNvcmFkZHIpOwkJCQkJCSAgICAgIFwK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VHIH0KK307CisjZGVmaW5lIG5maWxlcyAoc2l6ZW9mIChmaWxlc3lzdGVtKSAvIHNpemVvZiAoZmlsZXN5c3RlbVswXSkpCisKKwordHlwZWRlZiBzdHJ1Y3QKK3sKKyAgaW50IGxldmVsOworICBpbnQgaWR4OworICBzdHJ1Y3QgZGlyZW50IGQ7CisgIGNoYXIgcm9vbV9mb3JfZGlyZW50W05BTUVfTUFYXTsKK30gbXlfRElSOworCisKK3N0YXRpYyBsb25nIGludAorZmluZF9maWxlIChjb25zdCBjaGFyICpzKQoreworICBpbnQgbGV2ZWwgPSAxOworICBsb25nIGludCBpZHggPSAwOworCisgIHdoaWxlIChzWzBdID09ICcvJykKKyAgICB7CisgICAgICBpZiAoc1sxXSA9PSAnXDAnKQorCXsKKwkgIHMgPSAiLiI7CisJICBicmVhazsKKwl9CisgICAgICArK3M7CisgICAgfQorCisgIGlmIChzdHJjbXAgKHMsICIuIikgPT0gMCkKKyAgICByZXR1cm4gMDsKKworICBpZiAoc1swXSA9PSAnLicgJiYgc1sxXSA9PSAnLycpCisgICAgcyArPSAyOworCisgIHdoaWxlICgqcyAhPSAnXDAnKQorICAgIHsKKyAgICAgIGNoYXIgKmVuZHAgPSBzdHJjaHJudWwgKHMsICcvJyk7CisKKyAgICAgIFBSSU5URiAoImxvb2tpbmcgZm9yICUuKnMsIGxldmVsICVkXG4iLCAoaW50KSAoZW5kcCAtIHMpLCBzLCBsZXZlbCk7CisKKyAgICAgIHdoaWxlIChpZHggPCBuZmlsZXMgJiYgZmlsZXN5c3RlbVtpZHhdLmxldmVsID49IGxldmVsKQorCXsKKwkgIGlmIChmaWxlc3lzdGVtW2lkeF0ubGV2ZWwgPT0gbGV2ZWwKKwkgICAgICAmJiBtZW1jbXAgKHMsIGZpbGVzeXN0ZW1baWR4XS5uYW1lLCBlbmRwIC0gcykgPT0gMAorCSAgICAgICYmIGZpbGVzeXN0ZW1baWR4XS5uYW1lW2VuZHAgLSBzXSA9PSAnXDAnKQorCSAgICBicmVhazsKKwkgICsraWR4OworCX0KKworICAgICAgaWYgKGlkeCA9PSBuZmlsZXMgfHwgZmlsZXN5c3RlbVtpZHhdLmxldmVsIDwgbGV2ZWwpCisJeworCSAgZXJybm8gPSBFTk9FTlQ7CisJICByZXR1cm4gLTE7CisJfQorCisgICAgICBpZiAoKmVuZHAgPT0gJ1wwJykKKwlyZXR1cm4gaWR4ICsgMTsKKworICAgICAgaWYgKGZpbGVzeXN0ZW1baWR4XS50eXBlICE9IERUX0RJUgorCSAgJiYgKGlkeCArIDEgPj0gbmZpbGVzCisJICAgICAgfHwgZmlsZXN5c3RlbVtpZHhdLmxldmVsID49IGZpbGVzeXN0ZW1baWR4ICsgMV0ubGV2ZWwpKQorCXsKKwkgIGVycm5vID0gRU5PVERJUjsKKwkgIHJldHVybiAtMTsKKwl9CisKKyAgICAgICsraWR4OworCisgICAgICBzID0gZW5kcCArIDE7CisgICAgICArK2xldmVsOworICAgIH0KKworICBlcnJubyA9IEVOT0VOVDsKKyAgcmV0dXJuIC0xOworfQorCisKK3N0YXRpYyB2b2lkICoKK215X29wZW5kaXIgKGNvbnN0IGNoYXIgKnMpCit7CisgIGxvbmcgaW50IGlkeCA9IGZpbmRfZmlsZSAocyk7CisgIG15X0RJUiAqZGlyOworCisKKyAgaWYgKGlkeCA9PSAtMSB8fCBmaWxlc3lzdGVtW2lkeF0udHlwZSAhPSBEVF9ESVIpCisgICAgeworICAgICAgUFJJTlRGICgibXlfb3BlbmRpcihcIiVzXCIpID09IE5VTExcbiIsIHMpOworICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgIGRpciA9IChteV9ESVIgKikgbWFsbG9jIChzaXplb2YgKG15X0RJUikpOworICBpZiAoZGlyID09IE5VTEwpCisgICAgZXJyb3IgKEVYSVRfRkFJTFVSRSwgZXJybm8sICJjYW5ub3QgYWxsb2NhdGUgZGlyZWN0b3J5IGhhbmRsZSIpOworCisgIGRpci0+bGV2ZWwgPSBmaWxlc3lzdGVtW2l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xPQl9OT0NIRUNLIiwKKyAgICAiR0xPQl9BUFBFTkQiLCAiR0xPQl9OT0VTQ0FQRSIsICJHTE9CX1BFUklPRCIsICJHTE9CX01BR0NIQVIiLAorICAgICJHTE9CX0FMVERJUkZVTkMiLCAiR0xPQl9CUkFDRSIsICJHTE9CX05PTUFHSUMiLCAiR0xPQl9USUxERSIsCisgICAgIkdMT0JfT05MWURJUiIsICJHTE9CX1RJTERFQ0hFQ0siCisgIH07CisjZGVmaW5lIG5zdHJzIChzaXplb2YgKHN0cnMpIC8gc2l6ZW9mIChzdHJzWzBdKSkKKyAgc3RhdGljIGNoYXIgYnVmWzEwMF07CisgIGNoYXIgKmNwID0gYnVmOworICBpbnQgY250OworCisgIGZvciAoY250ID0gMDsgY250IDwgbnN0cnM7ICsrY250KQorICAgIGlmIChmbGFncyAmICgxIDw8IGNudCkpCisgICAgICB7CisJZmxhZ3MgJj0gfigxIDw8IGNudCk7CisJaWYgKGNwICE9IGJ1ZikKKwkgICpjcCsrID0gJ3wnOworCWNwID0gc3RwY3B5IChjcCwgc3Ryc1tjbnRdKTsKKyAgICAgIH0KKworICBpZiAoZmxhZ3MgIT0gMCkKKyAgICB7CisgICAgICBpZiAoY3AgIT0gYnVmKQorCSpjcCsrID0gJ3wnOworICAgICAgc3ByaW50ZiAoY3AsICIlI3giLCBmbGFncyk7CisgICAgfQorCisgIHJldHVybiBidWY7CisjdW5kZWYgbnN0cnMKK30KKworCitzdGF0aWMgY29uc3QgY2hhciAqCitlcnJzdHIgKGludCB2YWwpCit7CisgIHN0YXRpYyBjb25zdCBjaGFyICpjb25zdCBzdHJzW10gPQorICAgIHsKKyAgICAgIFtHTE9CX05PU1BBQ0VdID0gIkdMT0JfTk9TUEFDRSIsCisgICAgICBbR0xPQl9BQk9SVEVEXSA9ICJHTE9CX0FCT1JURUQiLAorICAgICAgW0dMT0JfTk9NQVRDSF0gPSAiR0xPQl9OT01BVENIIiwKKyAgICAgIFtHTE9CX05PU1lTXSA9ICJH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CBfUENfUElQRV9CVUYpOworCisgIGlmIChkaXJfcGF0aGNvbmYgPCAwKQorICAgIHsKKyAgICAgIHByaW50ZiAoInBhdGhjb25mIG9uIGRpcmVjdG9yeSBmYWlsZWQ6ICVzXG4iLCBzdHJlcnJvciAoZXJybm8pKTsKKyAgICAgIHJldCA9IDE7CisgICAgICBnb3RvIG91dF9ub2ZpZm87CisgICAgfQorCisgIGxvbmcgZmlmb19wYXRoY29uZiA9IHBhdGhjb25mIChmaWxlbmFtZSwgX1BDX1BJUEVfQlVGKTsKKworICBpZiAoZmlmb19wYXRoY29uZiA8IDApCisgICAgeworICAgICAgcHJpbnRmICgicGF0aGNvbmYgb24gZmlsZSBmYWlsZWQ6ICVzXG4iLCBzdHJlcnJvciAoZXJybm8pKTsKKyAgICAgIHJldCA9IDE7CisgICAgICBnb3RvIG91dF9ub2ZpZm87CisgICAgfQorCisgIGludCBmaWZvID0gb3BlbiAoZmlsZW5hbWUsIE9fUkRPTkxZIHwgT19OT05CTE9DSyk7CisKKyAgaWYgKGZpZm8gPCAwKQorICAgIHsKKyAgICAgIHByaW50ZiAoImZpZm8gb3BlbiBmYWlsZWQgKCVzKVxuIiwgc3RyZXJyb3IgKGVycm5vKSk7CisgICAgICByZXQgPSAxOworICAgICAgZ290byBvdXRfbm9maWZvOworICAgIH0KKworICBsb25nIGRpcl9mcGF0aGNvbmYgPSBmcGF0aGNvbmYgKGRpcl9mZCwgX1BDX1BJUEVfQlVGKTsKKworICBpZiAoZGlyX2ZwYXRoY29uZiA8IDApCisgICAgeworICAgICAgcHJpbnRmICgiZnBhdGhjb25mIG9uIGRpcmVjdG9yeSBmYWlsZWQ6ICVzXG4iLCBzdHJlcnJvciAoZXJybm8pKTsKKyAgICAgIHJldCA9IDE7CisgICAgICBnb3RvIG91dDsKKyAgICB9CisKKyAgbG9uZyBmaWZvX2ZwYXRoY29uZiA9IGZwYXRoY29uZiAoZmlmbywgX1BDX1BJUEVfQlVGKTsKKworICBpZiAoZmlmb19mcGF0aGNvbmYgPCAwKQorICAgIHsKKyAgICAgIHByaW50ZiAoImZwYXRoY29uZiBvbiBmaWxlIGZhaWxlZDogJXNcbiIsIHN0cmVycm9yIChlcnJubykpOworICAgICAgcmV0ID0gMTsKKyAgICAgIGdvdG8gb3V0OworICAgIH0KKworICBpZiAoZmlmb19wYXRoY29uZiAhPSBmaWZvX2ZwYXRoY29uZikKKyAgICB7CisgICAgICBwcmludGYgKCJmaWZvIHBhdGhjb25mICglbGQpICE9IGZpZm8gZnBhdGhjb25mICglbGQpXG4iLCBmaWZvX3BhdGhjb25mLAorCSAgICAgIGZpZm9fZnBhdGhjb25mKTsKKyAgICAgIHJldCA9IDE7CisgICAgICBnb3RvIG91dDsKKyAgICB9CisKKyAgaWYgKGRpcl9wYXRoY29uZiAhPSBmaWZvX3BhdGhjb25mKQorICAgIHsKKyAgICAgIHByaW50ZiAoImRpcmVjdG9yeSBwYXRoY29uZiAoJWxkKSAhPSBmaWZvIHBhdGhjb25mICglbGQpXG4iLAorCSAgICAgIGRpcl9wYXRoY29uZiwgZmlmb19wYXRoY29uZik7CisgICAgICByZXQgPSAxOworICAgICAgZ290byBvdXQ7CisgICAgfQorCisgIGlmIChkaXJfZnBhdGhjb25mICE9IGZpZm9fZnBhdGhjb25mKQorICAgIHsKKyAgICAgIHByaW50ZiAoImRpcmVjdG9yeSBmcGF0aGNvbmYgKCVsZCkgIT0gZmlmbyBmcGF0aGNvbmYgKCVsZClcbiIsCisJICAgICAgZGlyX2ZwYXRoY29uZiwgZmlmb19mcGF0aGNvbmYpOworICAgICAgcmV0ID0gMTsKKyAgICAgIGdvdG8gb3V0OworICAgIH0KKworb3V0OgorICBjbG9zZSAoZmlmbyk7CitvdXRfbm9maWZvOgorICBjbG9zZSAoZGlyX2ZkKTsKKworICBpZiAodW5saW5rIChmaWxlbmFtZSkgIT0gMCkKKyAgICB7CisgICAgICBwcmludGYgKCJDb3VsZCBub3QgcmVtb3ZlIGZpZm8gKCVzKVxuIiwg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gcm1bMjBdOworICBzaXplX3QgcGF0dGVybl9hbGxvY2VkID0gMCwgc3RyaW5nX2FsbG9jZWQgPSAwOworICBpbnQgaWdub3JlY2FzZSA9IDA7CisgIGludCBwYXR0ZXJuX3ZhbGlkID0gMCwgcm1fdmFsaWQgPSAwOworICBzaXplX3QgbGluZW51bTsKKworICBtdHJhY2UgKCk7CisKKyAgaWYgKGFyZ2MgPCAyKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIk1pc3NpbmcgdGVzdCBmaWxlbmFtZVxuIik7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgZiA9IGZvcGVuIChhcmd2WzFdLCAiciIpOworICBpZiAoZiA9PSBOVUxMKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIkNvdWxkbid0IG9wZW4gJXNcbiIsIGFyZ3ZbMV0pOworICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgIGlmICgobGVuID0gZ2V0bGluZSAoJmxpbmUsICZsaW5lX2xlbiwgZikpIDw9IDAKKyAgICAgIHx8IHN0cm5jbXAgKGxpbmUsICIjIFBDUkUiLCA2KSAhPSAwKQorICAgIHsKKyAgICAgIGZwcmludGYgKHN0ZGVyciwgIk5vdCBhIFBDUkUgdGVzdCBmaWxlXG4iKTsKKyAgICAgIGZjbG9zZSAoZik7CisgICAgICBmcmVlIChsaW5lKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICBsaW5lbnVtID0gMTsKKworICB3aGlsZSAoKGxlbiA9IGdldGxpbmUgKCZsaW5lLCAmbGluZV9sZW4sIGYpKSA+IDApCisgICAgeworICAgICAgY2hhciAqcDsKKyAgICAgIHVuc2lnbmVkIGxvbmcgbnVtOworCisgICAgICArK2xpbmVudW07CisKKyAgICAgIGlmIChsaW5lW2xlbiAtIDFdID09ICdcbicpCisJbGluZVstLWxlbl0gPSAnXDAnOworCisgICAgICBpZiAobGluZVswXSA9PSAnIycpCisJY29udGludWU7CisKKyAgICAg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dGVybl9hbGxvY2VkID0gcCAtIGxpbmU7CisJICAgIH0KKworCSAgbWVtY3B5IChwYXR0ZXJuLCBsaW5lICsgMSwgcCAtIGxpbmUgLSAxKTsKKwkgIHBhdHRlcm5bcCAtIGxpbmUgLSAxXSA9ICdcMCc7CisJICBwYXR0ZXJuX3ZhbGlkID0gMTsKKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgaWYgKHN0cm5jbXAgKGxpbmUsICIgICAgIiwgNCkgPT0gMCkKKwl7CisJICByZWdleF90IHJlOworCSAgaW50IG47CisKKwkgIGlmICghcGF0dGVybl92YWxpZCkKKwkgICAgeworCSAgICAgIHByaW50ZiAoIiV6ZDogTm8gcHJldmlvdXMgdmFsaWQgcGF0dGVybiAlc1xuIiwgbGluZW51bSwgbGluZSk7CisJICAgICAgY29udGludWU7CisJICAgIH0KKworCSAgaWYgKHN0cmluZ19hbGxvY2VkIDwgKHNpemVfdCkgKGxlbiAtIDMpKQorCSAgICB7CisJICAgICAgc3RyaW5nID0gcmVhbGxvYyAoc3RyaW5nLCBsZW4gLSAzKTsKKwkgICAgICBpZiAoc3RyaW5nID09IE5VTEwpCisJCXsKKwkJICBwcmludGYgKCIlemQ6IENhbm5vdCByZWNvcmQgc2VhcmNoIHN0cmluZzogJW1cbiIsIGxpbmVudW0pOworCQkgIHJldCA9IDE7CisJCSAgYnJlYWs7CisJCX0KKwkgICAgICBzdHJpbmdfYWxsb2NlZCA9IGxlbiAtIDM7CisJICAgIH0KKworCSAgbWVtY3B5IChzdHJpbmcsIGxpbmUgKyA0LCBsZW4gLSAzKTsKKworCSAgbiA9IHJlZ2NvbXAgKCZyZSwgcGF0dGVybiwKKwkJICAgICAgIFJFR19FWFRFTkRFRCB8IChpZ25vcmVjYXNlID8gUkVHX0lDQVNFIDogMCkpOworCSAgaWYgKG4gIT0gMCkKKwkgICAgeworCSAgICAgIGNoYXIgYnVmWzUwMF07CisJICAgICAgcmVnZXJyb3IgKG4sICZyZSwgYnVmLCBzaXplb2YgKGJ1ZikpOworCSAgICAgIHByaW50ZiAoIiV6ZDogcmVnY29tcCBmYWlsZWQgZm9yICVzOiAlc1xuIiwKKwkJICAgICAgbGluZW51bSwgcGF0dGVybiwgYnVmKTsKKwkgICAgICByZXQgPSAxOworCSAgICAgIGNvbnRpbnVlOworCSAgICB9CisKKwkgIGlmIChyZWdleGVjICgmcmUsIHN0cmluZywgMjAsIHJtLCAwKSkKKwkgICAgeworCSAgICAgIHJtWzBdLnJtX3NvID0gLTE7CisJICAgICAgcm1bMF0ucm1fZW8gPSAtMTsKKwkgICAgfQorCisJICByZWdmcmVlICgmcmUpOworCSAgcm1fdmFsaWQgPSAxOworCSAgY29udGludWU7CisJfQorCisgICAgICBpZiAoIXJtX3ZhbGlkKQorCXsKKwkgIHByaW50ZiAoIiV6ZDogTm8gcHJlY2VlZGluZyBwYXR0ZXJuIG9yIHNlYXJjaCBzdHJpbmdcbiIsIGxpbmVudW0pOworCSAgcmV0ID0gMTsKKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgaWYgKHN0cmNtcCAobGluZSwgIk5vIG1hdGNoIikgPT0gMCkKKwl7CisJICBpZiAocm1bMF0ucm1fc28gIT0gLTEgfHwgcm1bMF0ucm1fZW8gIT0gLTEpCisJICAgIHsKKwkgICAgICBwcmludGYgKCIlemQ6IC8lcy8gb24gJXMgdW5leHBlY3RlZGx5IG1hdGNoZWQgJWQuLiVkXG4iLAorCQkgICAgICBsaW5lbnVtLCBwYXR0ZXJuLCBzdHJpbmcsIHJtWzBdLnJtX3NvLCBybVswXS5ybV9lbyk7CisJICAgICAgcmV0ID0gMTsKKwkgICAgfQorCisJICBjb250aW51ZTsKKwl9CisKKyAgICAgIHAgPSBsaW5lOworICAgICAgaWYgKCpwID09ICcgJykKKyAgICAgICAgKytwOworCisgICAgICBudW0gPSBzdHJ0b3VsIChwLCAmcCwgMTApOworICAgICAgaWYgKG51bSA+PSAyMCB8fCAqcCAhPSAnOicgfHwgcFsxXSAhPSAnICcpCisJeworCSAgcHJpbnRmICgiJXpkOiBJbnZhbGlkIGxpbmUgJXNcbiIsIGxpbmVudW0sIGxpbmUpOworCSAgcmV0ID0gMTsKKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgaWYgKHJtW251bV0ucm1fc28gPT0gLTEgfHwgcm1bbnVtXS5ybV9lbyA9PSAtMSkKKwl7CisJICBpZiAoc3RyY21wIChwICsgMiwgIjx1bnNldD4iKSAhPSAwKQorCSAgICB7CisJICAgICAgcHJpbnRmICgiJXpkOiAvJXMvIG9uICVzIHVuZXhwZWN0ZWRseSBmYWlsZWQgdG8gbWF0Y2ggcmVnaXN0ZXIgJWxkICVkLi4lZFxuIiwKKwkJICAgICAgbGluZW51bSwgcGF0dGVybiwgc3RyaW5nLCBudW0sCisJCSAgICAgIHJtW251bV0ucm1fc28sIHJtW251bV0ucm1fZW8pOworCSAgICAgIHJldCA9IDE7CisJICAgIH0KKwkgIGNvbnRpbnVlOworCX0KKworICAgICAgaWYgKHJtW251bV0ucm1fZW8gPCBybVtudW1dLnJtX3NvCisJICB8fCBybVtudW1dLnJtX2VvIC0gcm1bbnVtXS5ybV9zbyAhPSBsZW4gLSAocCArIDIgLSBsaW5lKQorCSAgfHwgc3RybmNtcCAocCArIDIsIHN0cmluZyArIHJtW251bV0ucm1fc28sCisJCSAgICAgIHJtW251bV0ucm1fZW8gLSBybVtudW1dLnJtX3NvKSAhPSAwKQorCXsKKwkgIHByaW50ZiAoIiV6ZDogLyVzLyBvbiAlcyB1bmV4cGVjdGVkbHkgZmFpbGVkIHRvIG1hdGNoICVzIGZvciByZWdpc3RlciAlbGQgJWQuLiVkXG4iLAorCQkgIGxpbmVudW0sIHBhdHRlcm4sIHN0cmluZywgcCArIDIsIG51bSwKKwkJICBybVtudW1dLnJtX3NvLCBybVtudW1dLnJtX2VvKTsKKwkgIHJldCA9IDE7CisJICBjb250aW51ZTsKKwl9CisgICAgfQorCisgIGZyZWUgKHBhdHRlcm4pOworICBmcmVlIChzdHJp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KGVyciwgJnJlLCBidWYsIHNpemVvZiBidWYpOworICAgICAgZXJyb3IgKEVYSVRfRkFJTFVSRSwgMCwgImNhbm5vdCBjb21waWxlIGV4cHJlc3Npb246ICVzIiwgYnVmKTsKKyAgICB9CisKKyAgY250ID0gMDsKKyAgb2Zmc2V0ID0gMDsKKyAgYXNzZXJ0IChtZW1bbWVtbGVuXSA9PSAnXDAnKTsKKyAgd2hpbGUgKG9mZnNldCA8IG1lbWxlbikKKyAgICB7CisgICAgICByZWdtYXRjaF90IG1hWzFdOworICAgICAgY29uc3QgY2hhciAqc3A7CisgICAgICBjb25zdCBjaGFyICplcDsKKworICAgICAgZXJyID0gcmVnZXhlYyAoJnJlLCBtZW0gKyBvZmZzZXQsIDEsIG1hLCAwKTsKKyAgICAgIGlmIChlcnIgPT0gUkVHX05PTUFUQ0gpCisJYnJlYWs7CisKKyAgICAgIGlmIChlcnIgIT0gUkVHX05PRVJST1IpCisJeworCSAgY2hhciBidWZbMjAwXTsKKwkgIHJlZ2Vycm9yIChlcnIsICZyZSwgYnVmLCBzaXplb2YgYnVmKTsKKwkgIGVycm9yIChFWElUX0ZBSUxVUkUsIDAsICJjYW5ub3QgdXNlIGV4cHJlc3Npb246ICVzIiwgYnVmKTsKKwl9CisKKyAgICAgIGFzc2VydCAobWFbMF0ucm1fc28gPj0gMCk7CisgICAgICBzcCA9IG1lbSArIG9mZnNldCArIG1hWzBdLnJtX3NvOworICAgICAgd2hpbGUgKHNwID4gbWVtICYmIHNwWy0xXSAhPSAnXG4nKQorCS0tc3A7CisKKyAgICAgIGVwID0gbWVtICsgb2Zmc2V0ICsgbWFbMF0ucm1fc287CisgICAgICB3aGlsZSAoKmVwICE9ICdcMCcgJiYgKmVwICE9ICdcbicpCisJKytlcDsKKworICAgICAgcHJpbnRmICgibWF0Y2ggJWQ6IFwiJS4qc1wiXG4iLCArK2NudCwgKGludCkgKGVwIC0gc3ApLCBzcCk7CisKKyAgICAgIG9mZnNldCA9IGVwICsgMSAtIG1lbTsKKyAgICB9CisKKyAgcmVnZnJlZSAoJnJlKTsKKworI2lmIGRlZmluZWQgX1BPU0lYX0NQVVRJTUUgJiYgX1BPU0lYX0NQVVRJTUUgPj0gMAorICBpZiAodXNlX2Nsb2NrICYmICF0aW1pbmcpCisgICAgeworICAgICAgdXNlX2Nsb2NrID0gY2xvY2tfZ2V0dGltZSAoY2wsICZmaW5pc2gpID09IDA7CisgICAgICBpZiAodXNlX2Nsb2NrKQorCXsKKwkgIGlmIChmaW5pc2gudHZfbnNlYyA8IHN0YXJ0LnR2X25zZWMpCisJICAgIHsKKwkgICAgICBmaW5pc2gudHZfbnNlYyAtPSBzdGFydC50dl9uc2VjIC0gMTAwMDAwMDAwMDsKKwkgICAgICBmaW5pc2gudHZfc2VjIC09IDEgKyBzdGFydC50dl9zZWM7CisJICAgIH0KKwkgIGVsc2UKKwkgICAgeworCSAgICAgIGZpbmlzaC50dl9uc2VjIC09IHN0YXJ0LnR2X25zZWM7CisJICAgICAgZmluaXNoLnR2X3NlYyAtPSBzdGFydC50dl9zZWM7CisJICAgIH0KKworCSAgcHJpbnRmICgiZWxhcHNlZCB0aW1lOiAlamQuJTA5amQgc2VjXG4iLAorCQkgIChpbnRtYXhfdCkgZmluaXNoLnR2X3NlYywgKGludG1heF90KSBmaW5pc2gudHZfbnNlYyk7CisJfQorICAgIH0KKworICBpZiAodXNlX2Nsb2NrICYmIHRpbWluZykKKyAgICB7CisgICAgICBzdHJ1Y3QgdGltZXNwZWMgbWludGltZSA9IHsgLnR2X3NlYyA9IDI0ICogNjAgKiA2MCB9OworCisgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDEwOyArK2kpCisJeworCSAgb2Zmc2V0ID0gMDsKKwkgIHVzZV9jbG9jayA9IGNsb2NrX2dldHRpbWUgKGNsLCAmc3RhcnQpID09IDA7CisKKwkgIGlmICghdXNlX2Nsb2NrKQorCSAgICBjb250aW51ZTsKKworCSAgZXJyID0gcmVnY29tcCAoJnJlLCBleHByLC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wkrK2VwOworCisgICAgICBwcmludGYgKCJtYXRjaCAlZDogXCIlLipzXCJcbiIsICsrY250LCAoaW50KSAoZXAgLSBzcCksIHNwKTsKKworICAgICAgb2Zmc2V0ID0gc3AgLSAxIC0gbWVtOworICAgIH0KKworICByZWdmcmVlICgmcmUpOworCisjaWYgZGVmaW5lZCBfUE9TSVhfQ1BVVElNRSAmJiBfUE9TSVhfQ1BVVElNRSA+PSAwCisgIGlmICh1c2VfY2xvY2sgJiYgIXRpbWluZykKKyAgICB7CisgICAgICB1c2VfY2xvY2sgPSBjbG9ja19nZXR0aW1lIChjbCwgJmZpbmlzaCkgPT0gMDsKKyAgICAgIGlmICh1c2VfY2xvY2spCisJeworCSAgaWYgKGZpbmlzaC50dl9uc2VjIDwgc3RhcnQudHZfbnNlYykKKwkgICAgeworCSAgICAgIGZpbmlzaC50dl9uc2VjIC09IHN0YXJ0LnR2X25zZWMgLSAxMDAwMDAwMDAwOworCSAgICAgIGZpbmlzaC50dl9zZWMgLT0gMSArIHN0YXJ0LnR2X3NlYzsKKwkgICAgfQorCSAgZWxzZQorCSAgICB7CisJICAgICAgZmluaXNoLnR2X25zZWMgLT0gc3RhcnQudHZfbnNlYzsKKwkgICAgICBmaW5pc2gudHZfc2VjIC09IHN0YXJ0LnR2X3NlYzsKKwkgICAgfQorCisJICBwcmludGYgKCJlbGFwc2VkIHRpbWU6ICVqZC4lMDlqZCBzZWNcbiIsCisJCSAgKGludG1heF90KSBmaW5pc2gudHZfc2VjLCAoaW50bWF4X3QpIGZpbmlzaC50dl9uc2VjKTsKKwl9CisgICAgfQorCisgIGlmICh1c2VfY2xvY2sgJiYgdGltaW5nKQorICAgIHsKKyAgICAgIHN0cnVjdCB0aW1lc3BlYyBtaW50aW1lID0geyAudHZfc2VjID0gMjQgKiA2MCAqIDYwIH07CisKKyAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMTA7ICsraSkKKwl7CisJICBvZmZzZXQgPSBtZW1sZW47CisJICB1c2VfY2xvY2sgPSBjbG9ja19nZXR0aW1lIChjbCwgJnN0YXJ0KSA9PSAwOworCisJICBpZiAoIXVzZV9jbG9jaykKKwkgICAgY29udGludWU7CisKKwkgIG1lbXNldCAoJnJlLCAwLCBzaXplb2YgKHJlKSk7CisJICByZS5mYXN0bWFwID0gbWFsbG9jICgyNTYpOworCSAgaWYgKHJlLmZhc3RtYXAgPT0gTlVMTCkKKwkgICAgY29udGludWU7CisKKwkgIGVyciA9IHJlX2NvbXBpbGVfcGF0dGVybiAoZXhwciwgc3RybGVuIChleHByKSwgJnJlKTsKKwkgIGlmIChlcnIgIT0gTlVMTCkKKwkgICAgY29udGludWU7CisKKwkgIGlmIChyZV9jb21waWxlX2Zhc3RtYXAgKCZyZSkpCisJICAgIHsKKwkgICAgICByZWdmcmVlICgmcmUpOworCSAgICAgIGNvbnRpbnVlOworCSAgICB9CisKKwkgIHdoaWxlIChvZmZzZXQgPD0gbWVtbGVuKQorCSAgICB7CisJICAgICAgaW50IHN0YXJ0OworCSAgICAgIGNvbnN0IGNoYXIgKnNwOworCisJICAgICAgc3RhcnQgPSByZV9zZWFyY2ggKCZyZSwgbWVtLCBtZW1sZW4sIG9mZnNldCwgLW9mZnNldCwgTlVMTCk7CisJICAgICAgaWYgKHN0YXJ0IDwgLTEpCisJCWJyZWFrOworCisJICAgICAgc3AgPSBtZW0gKyBzdGFydDsKKwkgICAgICB3aGlsZSAoc3AgPiBtZW0gJiYgc3BbLTFdICE9ICdcbicpCisJCS0tc3A7CisKKwkgICAgICBvZmZzZXQgPSBzcCAtIDEgLSBtZW07CisJICAgIH0KKworCSAgcmVnZnJlZSAoJnJlKTsKKworCSAgdXNlX2Nsb2NrID0gY2xvY2tfZ2V0dGltZSAoY2wsICZmaW5pc2gpID09IDA7CisJICBpZiAodXNlX2Nsb2NrKQorCSAgICB7CisJICAgICAgaWYgKGZpbmlzaC50dl9uc2VjIDwgc3RhcnQudHZfbnNlYykKKwkJeworCQkgIGZpbmlzaC50dl9uc2V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wgcmVncy5lbmRbcmVncy5udW1fcmVncyAtIDFdICE9IC0xKQorCQl7CisJCSAgcHV0cyAoIlxuaW5jb3JyZWN0IHJlZ3Mue3N0YXJ0LGVuZH1bbnVtX3JlZ3MgLSAxXSIpOworCQkgIHJldHVybiAxOworCQl9CisKKwkgICAgICBpZiAoaSA+IDApCisJCWZvciAoaW50IGogPSAwLCBsID0gMTsgaiA8IDc7ICsraikKKwkJICBmb3IgKGludCBrID0gMDsgayA8IChpID09IDEgPyAxIDogMTApOyArK2ssICsrbCkKKwkJICAgIGlmIChyZWdzLnN0YXJ0W2xdICE9IG1hdGNoICsgagorCQkJfHwgcmVncy5lbmRbbF0gIT0gcmVncy5zdGFydFtsXSArIDEpCisJCSAgICAgIHsKKwkJCXByaW50ZiAoIlxucmVncy57c3RhcnQsZW5kfVslZF0gaW5jb3JyZWN0XG4iLCBsKTsKKwkJCXJldHVybiAxOworCQkgICAgICB9CisJICAgIH0KKwl9CisKKyNpZiBkZWZpbmVkIF9QT1NJWF9DUFVUSU1FICYmIF9QT1NJWF9DUFVUSU1FID49IDAKKyAgICAgIGlmICh1c2VfY2xvY2spCisJdXNlX2Nsb2NrID0gY2xvY2tfZ2V0dGltZSAoY2wsICZzdG9wKSA9PSAwOworICAgICAgaWYgKHVzZV9jbG9jaykKKwl7CisJICBzdG9wLnR2X3NlYyAtPSBzdGFydC50dl9zZWM7CisJICBpZiAoc3RvcC50dl9uc2VjIDwgc3RhcnQudHZfbnNlYykKKwkgICAgeworCSAgICAgIHN0b3AudHZfc2VjLS07CisJICAgICAgc3RvcC50dl9uc2VjICs9IDEwMDAwMDAwMDAgLSBzdGFydC50dl9uc2VjOworCSAgICB9CisJICBlbHNlCisJICAgIHN0b3AudHZfbnNlYyAtPSBzdGFydC50dl9uc2VjOworCSAgcHJpbnRmICgiOiAlbGQuJTA5bGRzXG4iLCAobG9uZykgc3RvcC50dl9zZWMsIChsb25nKSBzdG9wLnR2X25zZWMpOworCX0KKyAgICAgIGVsc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YXRpYyBjaGFyICoKK21iX3JlcGxhY2UgKGNoYXIgKmRzdCwgY29uc3QgY2hhciBjKQoreworICBzd2l0Y2ggKGMpCisgICAgeworICAgIC8qIFJlcGxhY2UgYSB3aXRoIFwnYSBhbmQgQSB3aXRoIFwnQS4gICovCisgICAgY2FzZSAnYSc6CisgICAgICAqZHN0KysgPSAnXHhjMyc7CisgICAgICAqZHN0KysgPSAnXHhhMSc7CisgICAgICBicmVhazsKKyAgICBjYXNlICdBJzoKKyAgICAgICpkc3QrKyA9ICdceGMzJzsKKyAgICAgICpkc3QrKyA9ICdceDgxJzsKKyAgICAgIGJyZWFrOworICAgIC8qIFJlcGxhY2UgYiB3aXRoIFx2e2N9IGFuZCBCIHdpdGggXHZ7Q30uICAqLworICAgIGNhc2UgJ2InOgorICAgICAgKmRzdCsrID0gJ1x4YzQnOworICAgICAgKmRzdCsrID0gJ1x4OGQnOworICAgICAgYnJlYWs7CisgICAgY2FzZSAnQic6CisgICAgICAqZHN0KysgPSAnXHhjNCc7CisgICAgICAqZHN0KysgPSAnXHg4Yyc7CisgICAgICBicmVhazsKKyAgICAvKiBSZXBsYWNlIGMgd2l0aCBcdntkfSBhbmQgQyB3aXRoIFx2e0R9LiAgKi8KKyAgICBjYXNlICdjJzoKKyAgICAgICpkc3QrKyA9ICdceGM0JzsKKyAgICAgICpkc3QrKyA9ICdceDhmJzsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJ0MnOgorICAgICAgKmRzdCsrID0gJ1x4YzQnOworICAgICAgKmRzdCsrID0gJ1x4OGUnOworICAgICAgYnJlYWs7CisgICAgLyogUmVwbGFjZSBkIHdpdGggXCdlIGFuZCBEIHdpdGggXCdFLiAgKi8KKyAgICBjYXNlICdkJzoKKyAgICAgICpkc3QrKyA9ICdceGMzJzsKKyAgICAgICpkc3QrKyA9ICdceGE5JzsKKyAgICAgIGJyZWFrOworICAgIGNhc2UgJ0QnOgorICAgICAgKmRzdCsrID0gJ1x4YzMnOworICAgICAgKm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cikgKyAxKTsKKyAgaWYgKHJldCA9PSBOVUxMKQorICAgIHJldHVybiBOVUxMOworCisgIGZvciAoc3JjID0gc3RyLCBkc3QgPSByZXQ7ICpzcmM7ICsrc3JjKQorICAgIGlmICgqc3JjID09ICdcXCcpCisgICAgICB7CisJZXNjYXBlZCBePSAxOworCSpkc3QrKyA9ICpzcmM7CisgICAgICB9CisgICAgZWxzZSBpZiAoZXNjYXBlZCkKKyAgICAgIHsKKwllc2NhcGVkID0gMDsKKwkqZHN0KysgPSAqc3JjOworCWNvbnRpbnVlOworICAgICAgfQorICAgIGVsc2UgaWYgKCFpbl9jbGFzcyAmJiBzdHJjaHIgKGxldHRlcnMsICpzcmMpKQorICAgICAgZHN0ID0gbWJfcmVwbGFjZSAoZHN0LCAqc3JjKTsKKyAgICBlbHNlCisgICAgICB7CisJaWYgKCFpbl9jbGFzcyAmJiAqc3JjID09ICdbJyAmJiBzdHJjaHIgKCI6Lj0iLCBzcmNbMV0pKQorCSAgaW5fY2xhc3MgPSAxOworCWVsc2UgaWYgKGluX2NsYXNzICYmICpzcmMgPT0gJ10nICYmIHN0cmNociAoIjouPSIsIHNyY1stMV0pKQorCSAgaW5fY2xhc3MgPSAwOworCSpkc3QrKyA9ICpzcmM7CisgICAgICB9CisgICpkc3QgPSAnXDAnOworICByZXR1cm4gcmV0OworfQorCitzdGF0aWMgaW50CitjaGVja19tYXRjaCAocmVnbWF0Y2hfdCAqcm0sIGludCBpZHgsIGNvbnN0IGNoYXIgKnN0cmluZywKKwkgICAgIGNvbnN0IGNoYXIgKm1hdGNoLCBjb25zdCBjaGFyICpmYWlsKQoreworICBpZiAobWF0Y2hbMF0gPT0gJy0nICYmIG1hdGNoWzFdID09ICdcMCcpCisgICAgeworICAgICAgaWYgKHJtW2lkeF0ucm1fc28gPT0gLTEgJiYgcm1baWR4XS5ybV9lbyA9PSAtMSkKKwlyZXR1cm4gMDsKKyAgICAgIHByaW50ZiAoIiVzIHJtWyVkXSB1bmV4cGVjdG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pbCk7CisgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgcmVnZnJlZSAoJnJlKTsKKworICBpZiAoZXhwZWN0ID09IE5VTEwpCisgICAgeworICAgICAgcHJpbnRmICgiJXMgcmVnZXhlYyB1bmV4cGVjdGVkbHkgc3VjY2VlZGVkXG4iLCBmYWlsKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICBpZiAoY2ZsYWdzICYgUkVHX05PU1VCKQorICAgIHJldHVybiAwOworCisgIHJldCA9IGNoZWNrX21hdGNoIChybSwgMCwgc3RyaW5nLCBleHBlY3QsIGZhaWwpOworICBpZiAobWF0Y2hlcyA9PSBOVUxMKQorICAgIHJldHVybiByZXQ7CisKKyAgZm9yIChuID0gMTsgcmV0ID09IDAgJiYgbiA8IDEwOyArK24pCisgICAgeworICAgICAgY2hhciAqcCA9IE5VTEw7CisKKyAgICAgIGlmIChtYXRjaGVzKQorCXsKKwkgIHAgPSBzdHJjaHIgKG1hdGNoZXMsICcsJyk7CisJICBpZiAocCAhPSBOVUxMKQorCSAgICAqcCA9ICdcMCc7CisJfQorICAgICAgcmV0ID0gY2hlY2tfbWF0Y2ggKHJtLCBuLCBzdHJpbmcsIG1hdGNoZXMgPzogIi0iLCBmYWlsKTsKKyAgICAgIGlmIChwKQorCXsKKwkgICpwID0gJywnOworCSAgbWF0Y2hlcyA9IHAgKyAxOworCX0KKyAgICAgIGVsc2UKKwltYXRjaGVzID0gTlVMTDsKKyAgICB9CisKKyAgcmV0dXJuIHJldDsKK30KKworc3RhdGljIGludAorbWJfdGVzdCAoY29uc3QgY2hhciAqcGF0dGVybiwgaW50IGNmbGFncywgY29uc3QgY2hhciAqc3RyaW5nLCBpbnQgZWZsYWdzLAorCSBjaGFyICpleHBlY3QsIGNvbnN0IGNoYXIgKm1hdGNoZXMsIGNvbnN0IGNoYXIgKmxldHRlcnMsCisJIGNvbnN0IGNoYXIgKmZhaWwpCit7CisgIGNoYXIgKnBhdHRlcm5fbWIgPSBtYl9mc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pbFsyMF07CisKKyAgLyogVGhlIHRlc3RzIGFyZW4ndCBzdXBwb3NlZCB0byB3b3JrIHdpdGggeGRpZ2l0LCBzaW5jZSBhLWRBLUQgYXJlCisgICAgIGhleCBkaWdpdHMgd2hpbGUgXCdhIFwnQSBcdntjfVx2e0N9XHZ7ZH1cdntEfVwnZSBcJ0UgYXJlIG5vdC4gICovCisgIGlmIChzdHJzdHIgKHBhdHRlcm4sICJbOnhkaWdpdDpdIikpCisgICAgcmV0dXJuIDA7CisKKyAgLyogWFhYOiByZWdleCBBVE0gaGFuZGxlcyBvbmx5IHNpbmdsZSBieXRlIGVxdWl2YWxlbmNlIGNsYXNzZXMuICAqLworICBpZiAoc3Ryc3RyIChwYXR0ZXJuLCAiW1s9Yj1dXSIpKQorICAgIHJldHVybiAwOworCisgIGZvciAoaSA9IDE7IGkgPCAxNjsgKytpKQorICAgIHsKKyAgICAgIGNoYXIgKnAgPSBsZXR0ZXJzOworICAgICAgaWYgKGkgJiAxKQorCXsKKwkgIGlmICghc3RyY2hyIChwYXR0ZXJuLCAnYScpICYmICFzdHJjaHIgKHN0cmluZywgJ2EnKQorCSAgICAgICYmICFzdHJjaHIgKHBhdHRlcm4sICdBJykgJiYgIXN0cmNociAoc3RyaW5nLCAnQScpKQorCSAgICBjb250aW51ZTsKKwkgICpwKysgPSAnYScsICpwKysgPSAnQSc7CisJfQorICAgICAgaWYgKGkgJiAyKQorCXsKKwkgIGlmICghc3RyY2hyIChwYXR0ZXJuLCAnYicpICYmICFzdHJjaHIgKHN0cmluZywgJ2InKQorCSAgICAgICYmICFzdHJjaHIgKHBhdHRlcm4sICdCJykgJiYgIXN0cmNociAoc3RyaW5nLCAnQicpKQorCSAgICBjb250aW51ZTsKKwkgICpwKysgPSAnYicsICpwKysgPSAnQic7CisJfQorICAgICAgaWYgKGkgJiA0KQorCXsKKwkgIGlmICghc3RyY2hyIChwYXR0ZXJuLCAnYycpICYmICFzdHJjaHIgKHN0cmluZywgJ2MnKQorCSAgICAgICYmICFzdHJjaHIgKHBhdHRlcm4sICdDJykgJiYgIXN0cmNociAoc3RyaW5nLCAnQycpKQorCSAgICBjb250aW51ZTsKKwkgICpwKysgPSAnYycsICpwKysgPSAnQyc7CisJfQorICAgICAgaWYgKGkgJiA4KQorCXsKKwkgIGlmICghc3RyY2hyIChwYXR0ZXJuLCAnZCcpICYmICFzdHJjaHIgKHN0cmluZywgJ2QnKQorCSAgICAgICYmICFzdHJjaHIgKHBhdHRlcm4sICdEJykgJiYgIXN0cmNociAoc3RyaW5nLCAnRCcpKQorCSAgICBjb250aW51ZTsKKwkgICpwKysgPSAnZCcsICpwKysgPSAnRCc7CisJfQorICAgICAgKnArKyA9ICdcMCc7CisgICAgICBzcHJpbnRmIChmYWlsLCAiVVRGLTggJXMgRkFJTCIsIGxldHRlcnMpOworICAgICAgcmV0IHw9IG1iX3Rlc3QgKHBhdHRlcm4sIGNmbGFncywgc3RyaW5nLCBlZmxhZ3MsIGV4cGVjdCwgbWF0Y2hlcywKKwkJICAgICAgbGV0dGVycywgZmFpbCk7CisgICAgfQorICByZXR1cm4gcmV0OworfQorCitpbnQKK21haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKK3sKKyAgaW50IHJldCA9IDA7CisgIGNoYXIgKmxpbmUgPSBOVUxMOworICBzaXplX3QgbGluZV9sZW4gPSAwOworICBzc2l6ZV90IGxlbjsKKyAgRklMRSAqZjsKKyAgc3RhdGljIGludCB0ZXN0X3V0ZjggPSAwOworICBzdGF0aWMgY29uc3Qgc3RydWN0IG9wdGlvbiBvcHRpb25zW10gPQorICAgIHsKKyAgICAgIHsidXRmOCIsCW5vX2FyZ3VtZW50LAkmdGVzdF91dGY4LAkxfSwKKyAgICAgIHtOVUxMLAkwLAkJTlVMTCwJCTAgfQorICAgIH07CisKKyAgbXRyYWNlICgpOworCisgIHdoaWxlIChnZXRvcHRfbG9uZyAoYXJnYywgYXJndiwgIiIsIG9wdGlvbnMsIE5VTEwpID49IDApOworCisgIGlmIChvcHRpbmQgKyAxICE9IGFyZ2MpCisgICAgeworICAgICAgZnByaW50ZiAoc3RkZXJyLCAiTWlzc2luZyB0ZXN0IGZpbGVuYW1lXG4iKTsKKyAgICAgIHJldHVybiAxOworICAgIH0KKworICBmID0gZm9wZW4gKGFyZ3Zbb3B0aW5kXSwgInIiKTsKKyAgaWYgKGYgPT0gTlVMTCkKKyAgICB7CisgICAgICBmcHJpbnRmIChzdGRlcnIsICJDb3VsZG4ndCBvcGVuICVzXG4iLCBhcmd2W29wdGluZF0pOworICAgICAgcmV0dXJuIDE7CisgICAgfQorCisgIHdoaWxlICgobGVuID0gZ2V0bGluZSAoJmxpbmUsICZsaW5lX2xlbiwgZikpID4gMCkKKyAgICB7CisgICAgICBjaGFyICpwYXR0ZXJuLCAqZmxhZ3N0ciwgKnN0cmluZywgKmV4cGVjdCwgKm1hdGNoZXMsICpwOworICAgICAgaW50IGNmbGFncyA9IFJFR19FWFRFTkRFRCwgZWZsYWdzID0gMCwgdHJ5X2JyZV9lcmUgPSAwOworCisgICAgICBpZiAobGluZVtsZW4gLSAxXSA9PSAnXG4nKQorICAgICAgICBsaW5lW2xlbiAtIDFdID0gJ1wwJzsKKworICAgICAgLyogU2tpcCBjb21tZW50cyBhbmQgZW1wdHkgbGluZXMuICAqLworICAgICAgaWYgKCpsaW5lID09ICcjJyB8fCAqbGluZSA9PSAnXDAnKQorCWNvbnRpbnVlOworCisgICAgICBwdXRzIChsaW5lKTsKKyAgICAgIGZmbHVzaCAoc3Rkb3V0KTsKKworICAgICAgcGF0dGVybiA9IHN0cnRvayAobGluZSwgIlx0Iik7CisgICAgICBpZiAocGF0dGVybiA9PSBOVUxMKQorICAgICAgICBjb250aW51ZTsKKworICAgICAgaWYgKHN0cmNtcCAocGF0dGVybiwgIlwiXCIiKSA9PSAwKQorCXBhdHRlcm4gKz0gMjsKKworICAgICAgZmxhZ3N0ciA9IHN0cnRvayAoTlVMTCwgIlx0Iik7CisgICAgICBpZiAoZmxhZ3N0ciA9PSBOVUxMKQorICAgICAgICBjb250aW51ZTsKKworICAgICAgc3RyaW5nID0gc3RydG9rIChOVUxMLCAiXHQiKTsKKyAgICAgIGlmIChzdHJpbmcgPT0gTlVMTCkKKyAgICAgICAgY29udGludWU7CisKKyAgICAgIGlmIChzdHJjbXAgKHN0cmluZywgIlwiXCIiKSA9PSAwKQorCXN0cmluZyArPSAyOworCisgICAgICBmb3IgKHAgPSBmbGFnc3RyOyAqcDsgKytwKQorCXN3aXRjaCAoKnApCisJICB7CisJICBjYXNlICctJzoKKwkgICAgYnJlYWs7CisJICBjYXNlICdiJzoKKwkgICAgY2ZsYWdzICY9IH5SRUdfRVhURU5ERUQ7CisJICAgIGJyZWFrOworCSAgY2FzZSAnJic6CisJICAgIHRyeV9icmVfZXJlID0gMTsKKwkgICAgYnJlYWs7CisJICBjYXNlICdDJzoKKwkgICAgZWZsYWdzID0gLTE7CisJICAgIGJyZWFrOworCSAgY2FzZSAnaSc6CisJICAgIGNmbGFncyB8PSBSRUdfSUNBU0U7CisJICAgIGJyZWFrOworCSAgY2FzZSAncyc6CisJICAgIGNmbGFncyB8PSBSRUdfTk9TVUI7CisJICAgIGJyZWFrOworCSAgY2FzZSAnbic6CisJICAgIGNmbGFncyB8PSBSRUdfTkVXTElORTsKKwkgICAgYnJlYWs7CisJICBjYXNlICdeJzoKKwkgICAgZWZsYWdzIHw9IFJFR19OT1RCT0w7CisJICAgIGJyZWFrOworCSAgY2FzZSAnJCc6CisJICAgIGVmbGFncyB8PSBSRUdfTk9URU9MOworCSAgICBicmVhazsKKwkgIGNhc2UgJ20nOgorCSAgY2FzZSAncCc6CisJICBjYXNlICcjJzoKKwkgICAgLyogTm90IHN1cHBvcnRlZC4gICovCisJICAgIGZsYWdzdHIgPSBOVUxMOworCSAgICBicmVhazsKKwkgIH0KKworICAgICAgaWYgKGZsYWdzdHIgPT0gTlVMTCkKKwljb250aW51ZTsKKworICAgICAgcmVwbGFjZV9zcGVjaWFsX2NoYXJzICh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RwaWQgZmFpbGVkIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKyAgZWxzZSBpZiAociAhPSAwKQorICAgIHsKKyAgICAgIHB1dHMgKCJ3cml0ZSBpbiAybmQgY2hpbGQgZmFpbGVkIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICAvKiBBbmQgZ2V0cGlkIGluIHRoZSBtYWluIHByb2Nlc3MgYWdhaW4uICAqLworICBwaWRfdCBwNSA9IGdldHBpZCAoKTsKKworICAvKiBBbmFseXNpcyBvZiB0aGUgcmVzdWx0cy4gICovCisgIGlmIChwMCAhPSBwNSkKKyAgICB7CisgICAgICBwcmludGYgKCJwMCglbGQpICE9IHA1KCVsZClcbiIsIChsb25nIGludCkgcDAsIChsb25nIGludCkgcDUpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgaWYgKHAwID09IHAxKQorICAgIHsKKyAgICAgIHByaW50ZiAoInAwKCVsZCkgPT0gcDEoJWxkKVxuIiwgKGxvbmcgaW50KSBwMCwgKGxvbmcgaW50KSBwMSk7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBpZiAocDEgIT0gcDIpCisgICAgeworICAgICAgcHJpbnRmICgicDEoJWxkKSAhPSBwMiglbGQpXG4iLCAobG9uZyBpbnQpIHAxLCAobG9uZyBpbnQpIHAyKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGlmIChwMCA9PSBwMykKKyAgICB7CisgICAgICBwcmludGYgKCJwMCglbGQpID09IHAzKCVsZClcbiIsIChsb25nIGludCkgcDAsIChsb25nIGludCkgcDMpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgaWYgKHAzICE9IHA0KQorICAgIHsKKyAgICAgIHByaW50ZiAoInAzKCVsZCkgIT0gcDQoJWxkKVxuIiwgKGxvbmcgaW50KSBwMywgKGxvbmcgaW50KSBwNCk7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBjbG9zZSAoZmRbMF0p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ApCisgICAgeworICAgICAgcGlkX3QgcCA9IGdldHBpZCAoKTsKKworICAgICAgc3RydWN0IHRpbWVzcGVjIHRzOworICAgICAgdHMudHZfc2VjID0gMTsKKyAgICAgIHRzLnR2X25zZWMgPSAwOworICAgICAgVEVNUF9GQUlMVVJFX1JFVFJZIChuYW5vc2xlZXAgKCZ0cywgJnRzKSk7CisgICAgICBfZXhpdCAoVEVNUF9GQUlMVVJFX1JFVFJZICh3cml0ZSAoZmRbMV0sICZwLCBzaXplb2YgKHApKSkgIT0gc2l6ZW9mIChwKSk7CisgICAgfQorICBlbHNlIGlmIChwMSA9PSAtMSkKKyAgICB7CisgICAgICBwdXRzICgiMXN0IHZmb3JrIGZhaWxlZCIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgbWVtc2V0ICgmaXQsIDAsIHNpemVvZiAoaXQpKTsKKyAgc2V0aXRpbWVyIChJVElNRVJfUkVBTCwgJml0LCBOVUxMKTsKKworICBwaWRfdCBwMiA9IDA7CisgIGlmIChURU1QX0ZBSUxVUkVfUkVUUlkgKHJlYWQgKGZkWzBdLCAmcDIsIHNpemVvZiAocGlkX3QpKSkgIT0gc2l6ZW9mIChwaWRfdCkpCisgICAgeworICAgICAgcHV0cyAoIjFzdCByZWFkIGZhaWxlZCIpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisgIGludCByOworICBpZiAoVEVNUF9GQUlMVVJFX1JFVFJZICh3YWl0cGlkIChwMSwgJnIsIDApKSAhPSBwMSkKKyAgICB7CisgICAgICBwdXRzICgiMXN0IHdhaXRwaWQgZmFpbGVkIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKyAgZWxzZSBpZiAociAhPSAwKQorICAgIHsKKyAgICAgIHB1dHMgKCJ3cml0ZSBpbiAxc3QgY2hpbGQgZmFpbGVkIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICAvKiBNYWluIHByb2Nlc3MnIElELiAgKi8KKyAgcGlkX3QgcDAgPSB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UpCisgICAgeworICAgICAgcHJpbnRmICgicDAoJWxkKSAhPSBwNSglbGQpXG4iLCAobG9uZyBpbnQpIHAwLCAobG9uZyBpbnQpIHA1KTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGlmIChwMCA9PSBwMSkKKyAgICB7CisgICAgICBwcmludGYgKCJwMCglbGQpID09IHAxKCVsZClcbiIsIChsb25nIGludCkgcDAsIChsb25nIGludCkgcDEpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgaWYgKHAxICE9IHAyKQorICAgIHsKKyAgICAgIHByaW50ZiAoInAxKCVsZCkgIT0gcDIoJWxkKVxuIiwgKGxvbmcgaW50KSBwMSwgKGxvbmcgaW50KSBwMik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBpZiAocDAgPT0gcDMpCisgICAgeworICAgICAgcHJpbnRmICgicDAoJWxkKSA9PSBwMyglbGQpXG4iLCAobG9uZyBpbnQpIHAwLCAobG9uZyBpbnQpIHAzKTsKKyAgICAgIHJlc3VsdCA9IDE7CisgICAgfQorCisgIGlmIChwMyAhPSBwNCkKKyAgICB7CisgICAgICBwcmludGYgKCJwMyglbGQpICE9IHA0KCVsZClcbiIsIChsb25nIGludCkgcDMsIChsb25nIGludCkgcDQpOworICAgICAgcmVzdWx0ID0gMTsKKyAgICB9CisKKyAgY2xvc2UgKGZkWzBdKTsKKyAgY2xvc2UgKGZkWzFdKTsKKworICBpZiAocmFpc2VfZmFpbCkKKyAgICB7CisgICAgICBwdXRzICgicmFpc2UgZmFpbGVkIik7CisgICAgICByZXN1bHQgPSAxOworICAgIH0KKworICBpZiAocmVzdWx0ID09IDApCisgICAgcHV0cyAoIkFsbCBPSyIpOworCisgIHJldHVybiByZXN1bHQ7Cit9CisKKyNkZWZpbmUgVEVTVF9GVU5DVElPTiBkb190ZXN0ICgpCisjaW5jbHVkZSAiLi4vdGVzdC1za2VsZXRvbi5jIgpkaWZmIC0tZ2l0IGEvYXAvbGliYy9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N0YXR1cykpOworCSAgcmV0dXJuIDE7CisJfQorICAgIH0KKworICBhcmd2WzBdID0gKGNoYXIgKikgInNjcmlwdDIuc2giOworICBhcmd2WzFdID0gKGNoYXIgKikgIjIiOworICBmb3IgKGkgPSAwOyBpIDwgNTsgaSsrKQorICAgIHsKKyAgICAgIHBpZF90IHBpZCA9IHZmb3JrICgpOworICAgICAgaWYgKHBpZCA8IDApCisJeworCSAgcHJpbnRmICgidmZvcmsgZmFpbGVkOiAlbVxuIik7CisJICByZXR1cm4gMTsKKwl9CisgICAgICBlbHNlIGlmIChwaWQgPT0gMCkKKwl7CisJICBleGVjdnAgKCJzY3JpcHQyLnNoIiwgYXJndik7CisJICBfZXhpdCAoZXJybm8pOworCX0KKyAgICAgIGludCBzdGF0dXM7CisgICAgICBpZiAoVEVNUF9GQUlMVVJFX1JFVFJZICh3YWl0cGlkIChwaWQsICZzdGF0dXMsIDApKSAhPSBwaWQpCisJeworCSAgcHV0cyAoIndhaXRwaWQgZmFpbGVkIik7CisJICByZXR1cm4gMTsKKwl9CisgICAgICBlbHNlIGlmIChzdGF0dXMgIT0gMCkKKwl7CisJICBwcmludGYgKCJzY3JpcHQyLnNoIGZhaWxlZCB3aXRoIHN0YXR1cyAlZFxuIiwgc3RhdHVzKTsKKwkgIHJldHVybiAxOworCX0KKyAgICB9CisKKyAgZm9yIChpID0gMDsgaSA8IDU7IGkrKykKKyAgICB7CisgICAgICBwaWRfdCBwaWQgPSB2Zm9yayAoKTsKKyAgICAgIGlmIChwaWQgPCAwKQorCXsKKwkgIHByaW50ZiAoInZmb3JrIGZhaWxlZDogJW1cbiIpOworCSAgcmV0dXJuIDE7CisJfQorICAgICAgZWxzZSBpZiAocGlkID09IDApCisJeworCSAgZXhlY2xwICgic2NyaXB0Mi5zaCIsICJzY3JpcHQyLnNoIiwgIjMiLCBOVUxMKTsKKwkgIF9leGl0IChlcnJubyk7CisJfQorICAgICAgaW50IHN0YXR1czsKKyAgICAgIGlmIChURU1QX0Z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gICAgICB7InJlcXVpcmVkIiwgcmVxdWlyZWRfYXJndW1lbnQsIE5VTEwsICdyJ30sCisgICAgICB7Im9wdGlvbmFsIiwgb3B0aW9uYWxfYXJndW1lbnQsIE5VTEwsICdvJ30sCisgICAgICB7Im5vbmUiLCAgICAgbm9fYXJndW1lbnQsICAgICAgIE5VTEwsICduJ30sCisgICAgICB7ImNvbG9yIiwgICAgbm9fYXJndW1lbnQsICAgICAgIE5VTEwsICdDJ30sCisgICAgICB7ImNvbG91ciIsICAgbm9fYXJndW1lbnQsICAgICAgIE5VTEwsICdDJ30sCisgICAgICB7TlVMTCwgICAgICAgMCwgICAgICAgICAgICAgICAgIE5VTEwsIDAgfQorICAgIH07CisKKyAgaW50IGFmbGFnID0gMDsKKyAgaW50IGJmbGFnID0gMDsKKyAgY2hhciAqY3ZhbHVlID0gTlVMTDsKKyAgaW50IENmbGFnID0gMDsKKyAgaW50IG5mbGFnID0gMDsKKyAgaW50IGluZGV4OworICBpbnQgYzsKKyAgaW50IHJlc3VsdCA9IDA7CisKKyAgd2hpbGUgKChjID0gZ2V0b3B0X2xvbmcgKGFyZ2MsIGFyZ3YsICJhYmM6Iiwgb3B0aW9ucywgTlVMTCkpID49IDApCisgICAgc3dpdGNoIChjKQorICAgICAgeworICAgICAgY2FzZSAnYSc6CisJYWZsYWcgPSAxOworCWJyZWFrOworICAgICAgY2FzZSAnYic6CisJYmZsYWcgPSAxOworCWJyZWFrOworICAgICAgY2FzZSAnYyc6CisJY3ZhbHVlID0gb3B0YXJnOworCWJyZWFrOworICAgICAgY2FzZSAnQyc6CisJKytDZmxhZzsKKwlicmVhazsKKyAgICAgIGNhc2UgJz8nOgorCWZwdXRzICgiVW5rbm93biBvcHRpb24uXG4iLCBzdGRlcnIpOworCXJldHVybiAxOworICAgICAgZGVmYXVsdDoKKwlmcHJpbnRmIChzdGRlcnIsICJUaGlzIHNob3VsZCBuZXZlciBoYXBwZW4hXG4iKTsKKwlyZXR1cm4gMTsKKworICAgICA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8qIExpa2Ugc3ltbGluayBidXQgYSByZWxhdGl2ZSBwYXRoIGluIFRPIGlzIGludGVycHJldGVkIHJlbGF0aXZlIHRvIFRPRkQuICAqLworZXh0ZXJuIGludCBzeW1saW5rYXQgKGNvbnN0IGNoYXIgKl9fZnJvbSwgaW50IF9fdG9mZCwKKwkJICAgICAgY29uc3QgY2hhciAqX190bykgX19USFJPVyBfX25vbm51bGwgKCgxLCAzKSkgX193dXI7CisKKy8qIExpa2UgcmVhZGxpbmsgYnV0IGEgcmVsYXRpdmUgUEFUSCBpcyBpbnRlcnByZXRlZCByZWxhdGl2ZSB0byBGRC4gICovCitleHRlcm4gc3NpemVfdCByZWFkbGlua2F0IChpbnQgX19mZCwgY29uc3QgY2hhciAqX19yZXN0cmljdCBfX3BhdGgsCisJCQkgICBjaGFyICpfX3Jlc3RyaWN0IF9fYnVmLCBzaXplX3QgX19sZW4pCisgICAgIF9fVEhST1cgX19ub25udWxsICgoMiwgMykpIF9fd3VyOworI2VuZGlmCisKKy8qIFJlbW92ZSB0aGUgbGluayBOQU1FLiAgKi8KK2V4dGVybiBpbnQgdW5saW5rIChjb25zdCBjaGFyICpfX25hbWUpIF9fVEhST1cgX19ub25udWxsICgoMSkpOworCisjaWZkZWYgX19VU0VfQVRGSUxFCisvKiBSZW1vdmUgdGhlIGxpbmsgTkFNRSByZWxhdGl2ZSB0byBGRC4gICovCitleHRlcm4gaW50IHVubGlua2F0IChpbnQgX19mZCwgY29uc3QgY2hhciAqX19uYW1lLCBpbnQgX19mbGFnKQorICAgICBfX1RIUk9XIF9fbm9ubnVsbCAoKDIpKTsKKyNlbmRpZgorCisvKiBSZW1vdmUgdGhlIGRpcmVjdG9yeSBQQVRILiAgKi8KK2V4dGVybiBpbnQgcm1kaXIgKGNvbnN0IGNoYXIgKl9fcGF0aCkgX19USFJPVyBfX25vbm51bGwgKCgxKSk7CisKKworLyogUmV0dXJuIHRoZSBmb3JlZ3JvdW5kIHByb2Nlc3MgZ3JvdXAgSU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2b2lkICgqKSAodm9pZCksIHZvaWQgKCopICh2b2lkKSwgdm9pZCAqKTsKKworc3RhdGljIGludCBfX2FwcF9yZWdpc3Rlcl9hdGZvcmsgKHZvaWQgKCpwcmVwYXJlKSAodm9pZCksIHZvaWQgKCpwYXJlbnQpICh2b2lkKSwgdm9pZCAoKmNoaWxkKSAodm9pZCkpCit7CisgIHJldHVybiBfX3JlZ2lzdGVyX2F0Zm9yayAocHJlcGFyZSwgcGFyZW50LCBjaGlsZCwKKwkJCSAgICAmX19kc29faGFuZGxlID09IE5VTEwgPyBOVUxMIDogX19kc29faGFuZGxlKTsKK30KKworLyogTnVtYmVyIG9mIGZvcmtzIHNlZW4uICAqLworc3RhdGljIGludCByZWdpc3RlcmVkX2ZvcmtzOworCisvKiBGb3IgZWFjaCBmb3JrIGluY3JlbWVudCB0aGUgZm9yayBjb3VudC4gICovCitzdGF0aWMgdm9pZAorcmVnaXN0ZXJfZm9yayAodm9pZCkKK3sKKyAgcmVnaXN0ZXJlZF9mb3JrcysrOworfQorCitzdHJ1Y3QgdGVzdF9jYXNlX3N0cnVjdAoreworICBpbnQgcmV0dmFsOworICBjb25zdCBjaGFyICplbnY7CisgIGNvbnN0IGNoYXIgKndvcmRzOworICBpbnQgZmxhZ3M7CisgIHNpemVfdCB3b3JkYzsKKyAgY29uc3QgY2hhciAqd29yZHZbMTBdOworICBjb25zdCBjaGFyICppZnM7Cit9IHRlc3RfY2FzZVtdID0KKyAgeworICAgIC8qIFNpbXBsZSB3b3JkLSBhbmQgZmllbGQtc3BsaXR0aW5nICovCisgICAgeyAwLCBOVUxMLCAib25lIiwgMCwgMSwgeyAib25lIiwgfSwgSUZTIH0sCisgICAgeyAwLCBOVUxMLCAib25lIHR3byIsIDAsIDIsIHsgIm9uZSIsICJ0d28iLCB9LCBJRlMgfSwKKyAgICB7IDAsIE5VTEwsICJvbmUgdHdvIHRocmVlIiwgMCwgMywgeyAib25lIiwgInR3byIsICJ0aHJlZSIsIH0sIElGUyB9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AgICAgdHMud29yZGMgPSAxOworICAgICAgdHMud29yZHZbMF0gPSBwdy0+cHdfZGlyOworICAgICAgdHMuaWZzID0gSUZTOworCisgICAgICBpZiAodGVzdGl0ICgmdHMpKQorCSsrZmFpbDsKKworICAgICAgdHMucmV0dmFsID0gMDsKKyAgICAgIHRzLmVudiA9IHB3LT5wd19kaXI7CisgICAgICB0cy53b3JkcyA9ICIke3ZhciN+cm9vdH14IjsKKyAgICAgIHRzLmZsYWdzID0gMDsKKyAgICAgIHRzLndvcmRjID0gMTsKKyAgICAgIHRzLndvcmR2WzBdID0gIngiOworICAgICAgdHMuaWZzID0gSUZTOworCisgICAgICBpZiAodGVzdGl0ICgmdHMpKQorCSsrZmFpbDsKKyAgICB9CisKKyAgLyogIn4iIGV4cGFuZHMgdG8gdmFsdWUgb2YgJEhPTUUgd2hlbiBIT01FIGlzIHNldCAqLworCisgIHNldGVudiAoIkhPTUUiLCAiL2R1bW15L2hvbWUiLCAxKTsKKyAgdHMucmV0dmFsID0gMDsKKyAgdHMuZW52ID0gTlVMTDsKKyAgdHMud29yZHMgPSAifiB+L2ZvbyI7CisgIHRzLmZsYWdzID0gMDsKKyAgdHMud29yZGMgPSAyOworICB0cy53b3JkdlswXSA9ICIvZHVtbXkvaG9tZSI7CisgIHRzLndvcmR2WzFdID0gIi9kdW1teS9ob21lL2ZvbyI7CisgIHRzLmlmcyA9IElGUzsKKworICBpZiAodGVzdGl0ICgmdHMpKQorICAgICsrZmFpbDsKKworICAvKiAifiIgZXhwYW5kcyB0byBob21lIGRpciBmcm9tIHBhc3N3ZCBmaWxlIGlmIEhPTUUgaXMgbm90IHNldCAqLworCisgIHB3ID0gZ2V0cHd1aWQgKGdldHVpZCAoKSk7CisgIGlmIChwdyAhPSBOVUxMKQorICAgIHsKKyAgICAgIHVuc2V0ZW52ICgiSE9NRSIpOworICAgICAgdHMucmV0dmFsID0gMDsKKyAgICAgIHRzLmVudiA9IE5VTEw7CisgICAgICB0cy53b3JkcyA9IC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KyAgICAgIGJ1ZmZlclsqYWN0bGVuXSA9IGNoOworICAgICAgYnVmZmVyWysrKCphY3RsZW4pXSA9ICdcMCc7CisgICAgfQorCisgIHJldHVybiBidWZmZXI7Cit9CisKK3N0YXRpYyBjaGFyICoKK2ludGVybmFsX2Z1bmN0aW9uCit3X2FkZG1lbSAoY2hhciAqYnVmZmVyLCBzaXplX3QgKmFjdGxlbiwgc2l6ZV90ICptYXhsZW4sIGNvbnN0IGNoYXIgKnN0ciwKKwkgIHNpemVfdCBsZW4pCit7CisgIC8qIEFkZCBhIHN0cmluZyB0byB0aGUgYnVmZmVyLCBhbGxvY2F0aW5nIHJvb20gZm9yIGl0IGlmIG5lZWRlZC4KKyAgICovCisgIGlmICgqYWN0bGVuICsgbGVuID4gKm1heGxlbikKKyAgICB7CisgICAgICBjaGFyICpvbGRfYnVmZmVyID0gYnVmZmVyOworICAgICAgYXNzZXJ0IChidWZmZXIgPT0gTlVMTCB8fCAqbWF4bGVuICE9IDApOworICAgICAgKm1heGxlbiArPSBNQVggKDIgKiBsZW4sIFdfQ0hVTkspOworICAgICAgYnVmZmVyID0gcmVhbGxvYyAob2xkX2J1ZmZlciwgMSArICptYXhsZW4pOworCisgICAgICBpZiAoYnVmZmVyID09IE5VTEwpCisJZnJlZSAob2xkX2J1ZmZlcik7CisgICAgfQorCisgIGlmIChidWZmZXIgIT0gTlVMTCkKKyAgICB7CisgICAgICAqKChjaGFyICopIF9fbWVtcGNweSAoJmJ1ZmZlclsqYWN0bGVuXSwgc3RyLCBsZW4pKSA9ICdcMCc7CisgICAgICAqYWN0bGVuICs9IGxlbjsKKyAgICB9CisKKyAgcmV0dXJuIGJ1ZmZlcjsKK30KKworc3RhdGljIGNoYXIgKgoraW50ZXJuYWxfZnVuY3Rpb24KK3dfYWRkc3RyIChjaGFyICpidWZmZXIsIHNpemVfdCAqYWN0bGVuLCBzaXplX3QgKm1heGxlbiwgY29uc3QgY2hhciAqc3RyKQorICAgICAvKiAobGVuZ3RocyBleGNsdWRlIHRyYWlsaW5nIHplcm8pICovCit7CisgIC8qIEFkZCBhIHN0cmluZyB0byB0aGUgYnVmZmVyLCBhbGxvY2F0aW5nIHJvb20gZm9yIGl0IGlmIG5lZWRlZC4KKyAgICovCisgIHNpemVfdCBsZW47CisKKyAgYXNzZXJ0IChzdHIgIT0gTlVMTCk7IC8qIHdfYWRkc3RyIG9ubHkgY2FsbGVkIGZyb20gdGhpcyBmaWxlICovCisgIGxlbiA9IHN0cmxlbiAoc3RyKTsKKworICByZXR1cm4gd19hZGRtZW0gKGJ1ZmZlciwgYWN0bGVuLCBtYXhsZW4sIHN0ciwgbGVuKTsKK30KKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK3dfYWRkd29yZCAod29yZGV4cF90ICpwd29yZGV4cCwgY2hhciAqd29yZCkKK3sKKyAgLyogQWRkIGEgd29yZCB0byB0aGUgd29yZGxpc3QgKi8KKyAgc2l6ZV90IG51bV9wOworICBjaGFyICoqbmV3X3dvcmR2OworICBib29sIGFsbG9jYXRlZCA9IGZhbHNlOworCisgIC8qIEludGVybmFsbHksIE5VTEwgYWN0cyBsaWtlICIiLiAgQ29udmVydCBOVUxMcyB0byAiIiBiZWZvcmUKKyAgICogdGhlIGNhbGxlciBzZWVzIHRoZW0uCisgICAqLworICBpZiAod29yZCA9PSBOVUxMKQorICAgIHsKKyAgICAgIHdvcmQgPSBfX3N0cmR1cCAoIiIpOworICAgICAgaWYgKHdvcmQgPT0gTlVMTCkKKwlnb3RvIG5vX3NwYWNlOworICAgICAgYWxsb2NhdGVkID0gdHJ1ZTsKKyAgICB9CisKKyAgbnVtX3AgPSAyICsgcHdvcmRleHAtPndlX3dvcmRjICsgcHdvcmRleHAtPndlX29mZnM7CisgIG5ld193b3JkdiA9IHJlYWxsb2MgKHB3b3JkZXhwLT53ZV93b3Jkdiwgc2l6ZW9mIChjaGFyICopICogbnVtX3ApOworICBpZiAobmV3X3dvcmR2ICE9IE5VTEwpCisgICAgeworICAgICAgcHdvcmRleHAtPndlX3dvcmR2ID0gbmV3X3dvcmR2OworICAgICAgcHdvcmRleHAtPndlX3dvcmR2W3B3b3JkZXhwLT53ZV9vZmZzICsgcHdvcmRleHAtPndlX3dvcmRjKytdID0gd29yZDsKKyAgICAgIHB3b3JkZXhwLT53ZV93b3Jkdltwd29yZGV4cC0+d2Vfb2ZmcyArIHB3b3JkZXhwLT53ZV93b3JkY10gPSBOVUxMOworICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgIGlmIChhbGxvY2F0ZWQpCisgICAgZnJlZSAod29yZCk7CisKK25vX3NwYWNlOgorICByZXR1cm4gV1JERV9OT1NQQUNFOworfQorCisvKiBUaGUgcGFyc2VfKigpIGZ1bmN0aW9ucyBzaG91bGQgbGVhdmUgKm9mZnNldCBiZWluZyB0aGUgb2Zmc2V0IGluICd3b3JkcycKKyAqIHRvIHRoZSBsYXN0IGNoYXJhY3RlciBwcm9jZXNzZWQuCisgKi8KKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK3BhcnNlX2JhY2tzbGFzaCAoY2hhciAqKndvcmQsIHNpemVfdCAqd29yZF9sZW5ndGgsIHNpemVfdCAqbWF4X2xlbmd0aCwKKwkJIGNvbnN0IGNoYXIgKndvcmRzLCBzaXplX3QgKm9mZnNldCkKK3sKKyAgLyogV2UgYXJlIHBvaXNlZCBfYXRfIGEgYmFja3NsYXNoLCBub3QgaW4gcXVvdGVzICovCisKKyAgc3dpdGNoICh3b3Jkc1sxICsgKm9mZnNldF0pCisgICAgeworICAgIGNhc2UgMDoKKyAgICAgIC8qIEJhY2tzbGFzaCBpcyBsYXN0IGNoYXJhY3RlciBvZiBpbnB1dCB3b3JkcyAqLworICAgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisgICAgY2FzZSAnXG4nOgorICAgICAgKysoKm9mZnNldCk7CisgICAgICBicmVhazsKKworICAgIGRlZmF1bHQ6CisgICAgICAqd29yZCA9IHdfYWRkY2hhciAoKndvcmQsIHdvcmRfbGVuZ3RoLCBtYXhfbGVuZ3RoLCB3b3Jkc1sxICsgKm9mZnNldF0pOworICAgICAgaWYgKCp3b3JkID09IE5VTEwpCisJcmV0dXJuIFdSREVfTk9TUEFDRTsKKworICAgICAgKysoKm9mZnNldCk7CisgICAgICBicmVhazsKKyAgICB9CisKKyAgcmV0dXJuIDA7Cit9CisKK3N0YXRpYyBpbnQKK2ludGVybmFsX2Z1bmN0aW9uCitwYXJzZV9xdGRfYmFja3NsYXNoIChjaGFyICoqd29yZCwgc2l6ZV90ICp3b3JkX2xlbmd0aCwgc2l6ZV90ICptYXhfbGVuZ3RoLAorCQkgICAgIGNvbnN0IGNoYXIgKndvcmRzLCBzaXplX3QgKm9mZnNldCkKK3sKKyAgLyogV2UgYXJlIHBvaXNlZCBfYXRfIGEgYmFja3NsYXNoLCBpbnNpZGUgcXVvdGVzICovCisKKyAgc3dpdGNoICh3b3Jkc1sxICsgKm9mZnNldF0pCisgICAgeworICAgIGNhc2UgMDoKKyAgICAgIC8qIEJhY2tzbGFzaCBpcyBsYXN0IGNoYXJhY3RlciBvZiBpbnB1dCB3b3JkcyAqLworICAgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisgICAgY2FzZSAnXG4nOgorICAgICAgKysoKm9mZnNldCk7CisgICAgICBicmVhazsKKworICAgIGNhc2UgJyQnOgorICAgIGNhc2UgJ2AnOgorICAgIGNhc2UgJyInOgorICAgIGNhc2UgJ1xcJzoKKyAgICAgICp3b3JkID0gd19hZGRjaGFyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsIHdvcmRzWzEgKyAqb2Zmc2V0XSk7CisgICAgICBpZiAoKndvcmQgPT0gTlVMTCkKKwlyZXR1cm4gV1JERV9OT1NQQUNFOworCisgICAgICArKygqb2Zmc2V0KTsKKyAgICAgIGJyZWFrOworCisgICAgZGVmYXVsdDoKKyAgICAgICp3b3JkID0gd19hZGRjaGFyICgqd29yZCwgd29yZF9sZW5ndGgs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Bmb3IgKDsgd29yZHNbKm9mZnNldF0gIT0gJ1wwJzsgKysqb2Zmc2V0KQorICAgIHsKKyAgICAgIGlmIChzdHJjaHIgKGlmcywgd29yZHNbKm9mZnNldF0pICE9IE5VTEwpCisJLyogUmVhY2hlZCBJRlMgKi8KKwlicmVhazsKKworICAgICAgLyogU29ydCBvdXQgcXVvdGluZyAqLworICAgICAgaWYgKHdvcmRzWypvZmZzZXRdID09ICdcJycpCisJeworCSAgaWYgKHF1b3RlZCA9PSAwKQorCSAgICB7CisJICAgICAgcXVvdGVkID0gMTsKKwkgICAgICBjb250aW51ZTsKKwkgICAgfQorCSAgZWxzZSBpZiAocXVvdGVkID09IDEpCisJICAgIHsKKwkgICAgICBxdW90ZWQgPSAwOworCSAgICAgIGNvbnRpbnVlOworCSAgICB9CisJfQorICAgICAgZWxzZSBpZiAod29yZHNbKm9mZnNldF0gPT0gJyInKQorCXsKKwkgIGlmIChxdW90ZWQgPT0gMCkKKwkgICAgeworCSAgICAgIHF1b3RlZCA9IDI7CisJICAgICAgY29udGludWU7CisJICAgIH0KKwkgIGVsc2UgaWYgKHF1b3RlZCA9PSAyKQorCSAgICB7CisJICAgICAgcXVvdGVkID0gMDsKKwkgICAgICBjb250aW51ZTsKKwkgICAgfQorCX0KKworICAgICAgLyogU29ydCBvdXQgb3RoZXIgc3BlY2lhbCBjaGFyYWN0ZXJzICovCisgICAgICBpZiAocXVvdGVkICE9IDEgJiYgd29yZHNbKm9mZnNldF0gPT0gJyQnKQorCXsKKwkgIGVycm9yID0gcGFyc2VfZG9sbGFycyAod29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsIHdvcmRzLAorCQkJCSBvZmZzZXQsIGZsYWdzLCAmZ2xvYl9saXN0LCBpZnMsIGlmc193aGl0ZSwKKwkJCQkgcXVvdGVkID09IDIpOworCSAgaWYgKGVycm9yKQorCSAgICBnb3RvIHRpZHlfdXA7CisKKwkgIGNvbnRpbnVlOworCX0KKyAgICAgIGVsc2Ug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yIGNsb3NpbmcgcGFyZW4gKi8KKyAgICAgIGZvciAoKytkaWdpdDsgKipleHByICYmICoqZXhwciAhPSAnKSc7ICsrKCpleHByKSk7CisKKyAgICAgIC8qIElzIHRoZXJlIG9uZT8gKi8KKyAgICAgIGlmICghKipleHByKQorCXJldHVybiBXUkRFX1NZTlRBWDsKKworICAgICAgKigqZXhwcikrKyA9IDA7CisKKyAgICAgIGlmIChldmFsX2V4cHIgKGRpZ2l0LCByZXN1bHQpKQorCXJldHVybiBXUkRFX1NZTlRBWDsKKworICAgICAgcmV0dXJuIDA7CisgICAgfQorCisgIC8qIFBPU0lYIHJlcXVpcmVzIHRoYXQgZGVjaW1hbCwgb2N0YWwsIGFuZCBoZXhhZGVjaW1hbCBjb25zdGFudHMgYXJlCisgICAgIHJlY29nbml6ZWQuICBUaGVyZWZvcmUgd2UgcGFzcyAwIGFzIHRoZSB0aGlyZCBwYXJhbWV0ZXIgdG8gc3RydG9sLiAgKi8KKyAgKnJlc3VsdCA9IHN0cnRvbCAoZGlnaXQsIGV4cHIsIDApOworICBpZiAoZGlnaXQgPT0gKmV4cHIpCisgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisgIHJldHVybiAwOworfQorCitzdGF0aWMgaW50CitpbnRlcm5hbF9mdW5jdGlvbgorZXZhbF9leHByX211bHRkaXYgKGNoYXIgKipleHByLCBsb25nIGludCAqcmVzdWx0KQoreworICBsb25nIGludCBhcmc7CisKKyAgLyogUmVhZCBhIFZhbHVlICovCisgIGlmIChldmFsX2V4cHJfdmFsIChleHByLCByZXN1bHQpICE9IDApCisgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisgIHdoaWxlICgqKmV4cHIpCisgICAgeworICAgICAgLyogU2tpcCB3aGl0ZSBzcGFjZSAqLworICAgICAgZm9yICg7ICpleHByICYmICoqZXhwciAmJiBpc3NwYWNlICgqKmV4cHIpOyArKygqZXhwcikpOworCisgICAgICBpZiAoKipleHByID09ICcqJykKKwl7CisJICArKygqZXhwcik7CisJICBpZiAoZXZhbF9leHByX3ZhbCAoZXhwciwgJmFyZykgIT0gMCkKKwkgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisJICAqcmVzdWx0ICo9IGFyZzsKKwl9CisgICAgICBlbHNlIGlmICgqKmV4cHIgPT0gJy8nKQorCXsKKwkgICsrKCpleHByKTsKKwkgIGlmIChldmFsX2V4cHJfdmFsIChleHByLCAmYXJnKSAhPSAwKQorCSAgICByZXR1cm4gV1JERV9TWU5UQVg7CisKKwkgIC8qIERpdmlzaW9uIGJ5IHplcm8gb3IgaW50ZWdlciBvdmVyZmxvdy4gICovCisJICBpZiAoYXJnID09IDAgfHwgKGFyZyA9PSAtMSAmJiAqcmVzdWx0ID09IExPTkdfTUlOKSkKKwkgICAgcmV0dXJuIFdSREVfU1lOVEFYOworCisJICAqcmVzdWx0IC89IGFyZzsKKwl9CisgICAgICBlbHNlIGJyZWFrOworICAgIH0KKworICByZXR1cm4gMDsKK30KKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK2V2YWxfZXhwciAoY2hhciAqZXhwciwgbG9uZyBpbnQgKnJlc3VsdCkKK3sKKyAgbG9uZyBpbnQgYXJnOworCisgIC8qIFJlYWQgYSBNdWx0ZGl2ICovCisgIGlmIChldmFsX2V4cHJfbXVsdGRpdiAoJmV4cHIsIHJlc3VsdCkgIT0gMCkKKyAgICByZXR1cm4gV1JERV9TWU5UQVg7CisKKyAgd2hpbGUgKCpleHByKQorICAgIHsKKyAgICAgIC8qIFNraXAgd2hpdGUgc3BhY2UgKi8KKyAgICAgIGZvciAoOyBleHByICYmICpleHByICYmIGlzc3BhY2UgKCpleHByKTsgKytleHByKTsKKworICAgICAgaWYgKCpleHByID09ICcrJykKKwl7CisJICArK2V4cHI7CisJICBpZiAoZXZhbF9leHByX211bHRkaXYgKCZleHByLCAmYXJnKSAhPSAwKQorCSAgICByZXR1cm4gV1JERV9TWU5UQVg7CisKKwkgICpyZXN1bHQgKz0gYXJnOworC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HMuCisJICAgKi8KKwkgIGlmIChlcnJvcikKKwkgICAgeworCSAgICAgIGZyZWUgKGV4cHIpOworCSAgICAgIHJldHVybiBlcnJvcjsKKwkgICAgfQorCSAgYnJlYWs7CisKKwljYXNlICdgJzoKKwkgICgqb2Zmc2V0KSsrOworCSAgZXJyb3IgPSBwYXJzZV9iYWNrdGljayAoJmV4cHIsICZleHByX2xlbmd0aCwgJmV4cHJfbWF4bGVuLAorCQkJCSAgd29yZHMsIG9mZnNldCwgZmxhZ3MsIE5VTEwsIE5VTEwsIE5VTEwpOworCSAgLyogVGhlIGZpcnN0IE5VTEwgaGVyZSBpcyB0byB0ZWxsIHBhcnNlX2JhY2t0aWNrIG5vdCB0bworCSAgICogc3BsaXQgdGhlIGZpZWxkcy4KKwkgICAqLworCSAgaWYgKGVycm9yKQorCSAgICB7CisJICAgICAgZnJlZSAoZXhwcik7CisJICAgICAgcmV0dXJuIGVycm9yOworCSAgICB9CisJICBicmVhazsKKworCWNhc2UgJ1xcJzoKKwkgIGVycm9yID0gcGFyc2VfcXRkX2JhY2tzbGFzaCAoJmV4cHIsICZleHByX2xlbmd0aCwgJmV4cHJfbWF4bGVuLAorCQkJCSAgICAgICB3b3Jkcywgb2Zmc2V0KTsKKwkgIGlmIChlcnJvcikKKwkgICAgeworCSAgICAgIGZyZWUgKGV4cHIpOworCSAgICAgIHJldHVybiBlcnJvcjsKKwkgICAgfQorCSAgLyogSSB0aGluayB0aGF0IGEgYmFja3NsYXNoIHdpdGhpbiBhbgorCSAgICogYXJpdGhtZXRpYyBleHBhbnNpb24gaXMgYm91bmQgdG8KKwkgICAqIGNhdXNlIGFuIGVycm9yIHNvb25lciBvciBsYXRlciBhbnl3YXkgdGhvdWdoLgorCSAgICovCisJICBicmVhazsKKworCWNhc2UgJyknOgorCSAgaWYgKC0tcGFyZW5fZGVwdGggPT0gMCkKKwkgICAgeworCSAgICAgIGNoYXIgcmVzdWx0WzIxXTsJLyogMjEgPSBjZWlsKGxvZzEwKDJeNjQpKSArIDEgKi8KKwkgICAgICBsb25nIGludCBudW1yZXN1bHQgPSAwOworCSAgICAgIGxvbmcgbG9uZyBpbnQgY29udmVydG1lOworCisJICAgICAgaWYgKGJyYWNrZXQgfHwgd29yZHNbMSArICpvZmZzZXRdICE9ICcpJykKKwkJeworCQkgIGZyZWUgKGV4cHIpOworCQkgIHJldHVybiBXUkRFX1NZTlRBWDsKKwkJfQorCisJICAgICAgKysoKm9mZnNldCk7CisKKwkgICAgICAvKiBHbyAtIGV2YWx1YXRlLiAqLworCSAgICAgIGlmICgqZXhwciAmJiBldmFsX2V4cHIgKGV4cHIsICZudW1yZXN1bHQpICE9IDApCisJCXsKKwkJICBmcmVlIChleHByKTsKKwkJICByZXR1cm4gV1JERV9TWU5UQVg7CisJCX0KKworCSAgICAgIGlmIChudW1yZXN1bHQgPCAwKQorCQl7CisJCSAgY29udmVydG1lID0gLW51bXJlc3VsdDsKKwkJICAqd29yZCA9IHdfYWRkY2hhciAoKndvcmQsIHdvcmRfbGVuZ3RoLCBtYXhfbGVuZ3RoLCAnLScpOworCQkgIGlmICghKndvcmQpCisJCSAgICB7CisJCSAgICAgIGZyZWUgKGV4cHIpOworCQkgICAgICByZXR1cm4gV1JERV9OT1NQQUNFOworCQkgICAgfQorCQl9CisJICAgICAgZWxzZQorCQljb252ZXJ0bWUgPSBudW1yZXN1bHQ7CisKKwkgICAgICByZXN1bHRbMjBdID0gJ1wwJzsKKwkgICAgICAqd29yZCA9IHdfYWRkc3RyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsCisJCQkJX2l0b2EgKGNvbnZlcnRtZSwgJnJlc3VsdFsyMF0sIDEwLCAwKSk7CisJICAgICAgZnJlZSAoZXhwcik7CisJICAgICAgcmV0dXJuICp3b3JkID8gMCA6IFdSREVfTk9TUEFDRTsKKwkgICAgfQorCSAgZXhwciA9IHdfYWRkY2hhciAoZXhwciwgJmV4cHJfbGVuZ3RoLCAmZXhwcl9tYXhsZW4sIHdvcmRzWypvZmZzZXRdKTsKKwkgIGlmIChleHByID09IE5VTEwpCisJICAgIHJldHVybiBXUkRFX05PU1BBQ0U7CisKKwkgIGJyZWFrOworCisJY2FzZSAnXSc6CisJICBpZiAoYnJhY2tldCAmJiBwYXJlbl9kZXB0aCA9PSAxKQorCSAgICB7CisJICAgICAgY2hhciByZXN1bHRbMjFdOwkvKiAyMSA9IGNlaWwobG9nMTAoMl42NCkpICsgMSAqLworCSAgICAgIGxvbmcgaW50IG51bXJlc3VsdCA9IDA7CisKKwkgICAgICAvKiBHbyAtIGV2YWx1YXRlLiAqLworCSAgICAgIGlmICgqZXhwciAmJiBldmFsX2V4cHIgKGV4cHIsICZudW1yZXN1bHQpICE9IDApCisJCXsKKwkJICBmcmVlIChleHByKTsKKwkJICByZXR1cm4gV1JERV9TWU5UQVg7CisJCX0KKworCSAgICAgIHJlc3VsdFsyMF0gPSAnXDAnOworCSAgICAgICp3b3JkID0gd19hZGRzdHIgKCp3b3JkLCB3b3JkX2xlbmd0aCwgbWF4X2xlbmd0aCwKKwkJCQlfaXRvYV93b3JkIChudW1yZXN1bHQsICZyZXN1bHRbMjBdLCAxMCwgMCkpOworCSAgICAgIGZyZWUgKGV4cHIpOworCSAgICAgIHJldHVybiAqd29yZCA/IDAgOiBXUkRFX05PU1BBQ0U7CisJICAgIH0KKworCSAgZnJlZSAoZXhwcik7CisJICByZXR1cm4gV1JERV9TWU5UQVg7CisKKwljYXNlICdcbic6CisJY2FzZSAnOyc6CisJY2FzZSAneyc6CisJY2FzZSAnfSc6CisJICBmcmVlIChleHByKTsKKwkgIHJldHVybiBXUkRFX0JBRENIQVI7CisKKwljYXNlICcoJzoKKwkgICsrcGFyZW5fZGVwdGg7CisJZGVmYXVsdDoKKwkgIGV4cHIgPSB3X2FkZGNoYXIgKGV4cHIsICZleHByX2xlbmd0aCwgJmV4cHJfbWF4bGVuLCB3b3Jkc1sqb2Zmc2V0XSk7CisJICBpZiAoZXhwciA9PSBOVUxMKQ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IHVubGVzcyBuZWNlc3NhcnkgKi8KKyAgaWYgKCFjb21tIHx8ICEqY29tbSkKKyAgICByZXR1cm4gMDsKKworI2lmZGVmIE9fQ0xPRVhFQworIyBpZm5kZWYgX19BU1NVTUVfUElQRTIKKyAgaWYgKF9faGF2ZV9waXBlMiA+PSAwKQorIyBlbmRpZgorICAgIHsKKyAgICAgIGludCByID0gX19waXBlMiAoZmlsZGVzLCBPX0NMT0VYRUMpOworIyBpZm5kZWYgX19BU1NVTUVfUElQRTIKKyAgICAgIGlmIChfX2hhdmVfcGlwZTIgPT0gMCkKKwlfX2hhdmVfcGlwZTIgPSByICE9IC0xIHx8IGVycm5vICE9IEVOT1NZUyA/IDEgOiAtMTsKKworICAgICAgaWYgKF9faGF2ZV9waXBlMiA+IDApCisjIGVuZGlmCisJaWYgKHIgPCAwKQorCSAgLyogQmFkICovCisJICByZXR1cm4gV1JERV9OT1NQQUNFOworICAgIH0KKyNlbmRpZgorI2lmbmRlZiBfX0FTU1VNRV9QSVBFMgorIyBpZmRlZiBPX0NMT0VYRUMKKyAgaWYgKF9faGF2ZV9waXBlMiA8IDApCisjIGVuZGlmCisgICAgaWYgKF9fcGlwZSAoZmlsZGVzKSA8IDApCisgICAgICAvKiBCYWQgKi8KKyAgICAgIHJldHVybiBXUkRFX05PU1BBQ0U7CisjZW5kaWYKKworIGFnYWluOgorICBpZiAoKHBpZCA9IF9fZm9yayAoKSkgPCAwKQorICAgIHsKKyAgICAgIC8qIEJhZCAqLworICAgICAgX19jbG9zZSAoZmlsZGVzWzBdKTsKKyAgICAgIF9fY2xvc2UgKGZpbGRlc1sxXSk7CisgICAgICByZXR1cm4gV1JERV9OT1NQQUNFOworICAgIH0KKworICBpZiAocGlkID09IDApCisgICAgZXhlY19jb21tX2NoaWxkIChjb21tLCBmaWxkZXMsIG5vZXhlYyA/IDAgOiBmbGFncyAmIFdSREVfU0hPV0VSUiwgbm9leGVjKTsKKworICAvKiBQYXJlbnQgKi8KKworICAvKiBJZi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sICZzdGF0dXMsCisJCQkJCQkgYnVmbGVuID09IDAgPyAwIDogV05PSEFORykpCisJCSAgPT0gMCkKKwkJY29udGludWU7CisJICAgICAgaWYgKChidWZsZW4gPSBURU1QX0ZBSUxVUkVfUkVUUlkgKF9fcmVhZCAoZmlsZGVzWzBdLCBidWZmZXIsCisJCQkJCQkJYnVmc2l6ZSkpKSA8IDEpCisJCWJyZWFrOworCSAgICB9CisKKwkgIGZvciAoaSA9IDA7IGkgPCBidWZsZW47ICsraSkKKwkgICAgeworCSAgICAgIGlmIChzdHJjaHIgKGlmcywgYnVmZmVyW2ldKSAhPSBOVUxMKQorCQl7CisJCSAgLyogQ3VycmVudCBjaGFyYWN0ZXIgaXMgSUZTICovCisJCSAgaWYgKHN0cmNociAoaWZzX3doaXRlLCBidWZmZXJbaV0pID09IE5VTEwpCisJCSAgICB7CisJCSAgICAgIC8qIEN1cnJlbnQgY2hhcmFjdGVyIGlzIElGUyBidXQgbm90IHdoaXRlc3BhY2UgKi8KKwkJICAgICAgaWYgKGNvcHlpbmcgPT0gMikKKwkJCXsKKwkJCSAgLyogICAgICAgICAgICBjdXJyZW50IGNoYXJhY3RlcgorCQkJICAgKiAgICAgICAgICAgICAgICAgICB8CisJCQkgICAqICAgICAgICAgICAgICAgICAgIFYKKwkJCSAgICogZWc6IHRleHQ8c3BhY2U+PGNvbW1hPjxzcGFjZT5tb3JldGV4dAorCQkJICAgKgorCQkJICAgKiBTbywgc3RyaXAgd2hpdGVzcGFjZSBJRlMgKGxpa2UgYXQgdGhlIHN0YXJ0KQorCQkJICAgKi8KKwkJCSAgY29weWluZyA9IDA7CisJCQkgIGNvbnRpbnVlOworCQkJfQorCisJCSAgICAgIGNvcHlpbmcgPSAwOworCQkgICAgICAvKiBmYWxsIHRocm91Z2ggYW5kIGRlbGltaXQgZmllbGQuLiAqLworCQkgICAgfQorCQkgIGVsc2UKKwkJICAgIHsKKwkJICAgICAgaWYgKGJ1ZmZlcltpXSA9PSAnXG4nKQorC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c1swXSk7CisgIHJldHVybiBXUkRFX05PU1BBQ0U7Cit9CisKK3N0YXRpYyBpbnQKK2ludGVybmFsX2Z1bmN0aW9uCitwYXJzZV9jb21tIChjaGFyICoqd29yZCwgc2l6ZV90ICp3b3JkX2xlbmd0aCwgc2l6ZV90ICptYXhfbGVuZ3RoLAorCSAgICBjb25zdCBjaGFyICp3b3Jkcywgc2l6ZV90ICpvZmZzZXQsIGludCBmbGFncywgd29yZGV4cF90ICpwd29yZGV4cCwKKwkgICAgY29uc3QgY2hhciAqaWZzLCBjb25zdCBjaGFyICppZnNfd2hpdGUpCit7CisgIC8qIFdlIGFyZSBwb2lzZWQganVzdCBhZnRlciAiJCgiICovCisgIGludCBwYXJlbl9kZXB0aCA9IDE7CisgIGludCBlcnJvciA9IDA7CisgIGludCBxdW90ZWQgPSAwOyAvKiAxIGZvciBzaW5nbHktcXVvdGVkLCAyIGZvciBkb3VibHktcXVvdGVkICovCisgIHNpemVfdCBjb21tX2xlbmd0aDsKKyAgc2l6ZV90IGNvbW1fbWF4bGVuOworICBjaGFyICpjb21tID0gd19uZXd3b3JkICgmY29tbV9sZW5ndGgsICZjb21tX21heGxlbik7CisKKyAgZm9yICg7IHdvcmRzWypvZmZzZXRdOyArKygqb2Zmc2V0KSkKKyAgICB7CisgICAgICBzd2l0Y2ggKHdvcmRzWypvZmZzZXRdKQorCXsKKwljYXNlICdcJyc6CisJICBpZiAocXVvdGVkID09IDApCisJICAgIHF1b3RlZCA9IDE7CisJICBlbHNlIGlmIChxdW90ZWQgPT0gMSkKKwkgICAgcXVvdGVkID0gMDsKKworCSAgYnJlYWs7CisKKwljYXNlICciJzoKKwkgIGlmIChxdW90ZWQgPT0gMCkKKwkgICAgcXVvdGVkID0gMjsKKwkgIGVsc2UgaWYgKHF1b3RlZCA9PSAyKQorCSAgICBxdW90ZWQgPSAwOworCisJICBicmVhazsKKworCWNhc2UgJyknOgorCSAgaWYgKCFxdW90ZWQgJiYgLS1wYXJlbl9kZXB0aC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nZfbWF4bGVuLAorCQkgICAgICAgd29yZHNbKm9mZnNldF0pOworICAgICAgaWYgKGVudiA9PSBOVUxMKQorCWdvdG8gbm9fc3BhY2U7CisgICAgICArKypvZmZzZXQ7CisgICAgfQorICBlbHNlCisgICAgeworICAgICAgaWYgKGJyYWNlKQorCWdvdG8gc3ludGF4OworICAgIH0KKworICBpZiAoYnJhY2UpCisgICAgeworICAgICAgLyogQ2hlY2sgZm9yIHNwZWNpYWwgYWN0aW9uIHRvIGJlIGFwcGxpZWQgdG8gdGhlIHZhbHVlLiAqLworICAgICAgc3dpdGNoICh3b3Jkc1sqb2Zmc2V0XSkKKwl7CisJY2FzZSAnfSc6CisJICAvKiBFdmFsdWF0ZS4gKi8KKwkgIGdvdG8gZW52c3Vic3Q7CisKKwljYXNlICcjJzoKKwkgIGFjdGlvbiA9IEFDVF9SUF9TSE9SVF9MRUZUOworCSAgaWYgKHdvcmRzWzEgKyAqb2Zmc2V0XSA9PSAnIycpCisJICAgIHsKKwkgICAgICArKypvZmZzZXQ7CisJICAgICAgYWN0aW9uID0gQUNUX1JQX0xPTkdfTEVGVDsKKwkgICAgfQorCSAgYnJlYWs7CisKKwljYXNlICclJzoKKwkgIGFjdGlvbiA9IEFDVF9SUF9TSE9SVF9SSUdIVDsKKwkgIGlmICh3b3Jkc1sxICsgKm9mZnNldF0gPT0gJyUnKQorCSAgICB7CisJICAgICAgKysqb2Zmc2V0OworCSAgICAgIGFjdGlvbiA9IEFDVF9SUF9MT05HX1JJR0hUOworCSAgICB9CisJICBicmVhazsKKworCWNhc2UgJzonOgorCSAgaWYgKCFDSEFSX0lOX1NFVCAod29yZHNbMSArICpvZmZzZXRdLCAiLT0/KyIpKQorCSAgICBnb3RvIHN5bnRheDsKKworCSAgY29sb25fc2VlbiA9IDE7CisJICBhY3Rpb24gPSB3b3Jkc1srKypvZmZzZXRdOworCSAgYnJlYWs7CisKKwljYXNlICctJzoKKwljYXNlICc9JzoKKwljYXNlICc/JzoKKwljYXNlICcrJzoKKwkgIGFjdGlvbiA9IHdvcmRzWypvZmZzZXRdOworCSAgYnJlYWs7CisKKwlkZWZhdWx0OgorCSAgZ290byBzeW50YXg7CisJfQorCisgICAgICAvKiBOb3cgY29sbGVjdCB0aGUgcGF0dGVybiwgYnV0IGRvbid0IGV4cGFuZCBpdCB5ZXQuICovCisgICAgICArKypvZmZzZXQ7CisgICAgICBmb3IgKDsgd29yZHNbKm9mZnNldF07ICsrKCpvZmZzZXQpKQorCXsKKwkgIHN3aXRjaCAod29yZHNbKm9mZnNldF0pCisJICAgIHsKKwkgICAgY2FzZSAneyc6CisJICAgICAgaWYgKCFwYXR0ZXJuX2lzX3F1b3RlZCkKKwkJKytkZXB0aDsKKwkgICAgICBicmVhazsKKworCSAgICBjYXNlICd9JzoKKwkgICAgICBpZiAoIXBhdHRlcm5faXNfcXVvdGVkKQorCQl7CisJCSAgaWYgKGRlcHRoID09IDApCisJCSAgICBnb3RvIGVudnN1YnN0OworCQkgIC0tZGVwdGg7CisJCX0KKwkgICAgICBicmVhazsKKworCSAgICBjYXNlICdcXCc6CisJICAgICAgaWYgKHBhdHRlcm5faXNfcXVvdGVkKQorCQkvKiBRdW90ZWQ7IHRyZWF0IGFzIG5vcm1hbCBjaGFyYWN0ZXIuICovCisJCWJyZWFrOworCisJICAgICAgLyogT3RoZXJ3aXNlLCBpdCdzIGFuIGVzY2FwZTogbmV4dCBjaGFyYWN0ZXIgaXMgbGl0ZXJhbC4gKi8KKwkgICAgICBpZiAod29yZHNbKysqb2Zmc2V0XSA9PSAnXDAnKQorCQlnb3RvIHN5bnRheDsKKworCSAgICAgIHBhdHRlcm4gPSB3X2FkZGNoYXIgKHBhdHRlcm4sICZwYXRfbGVuZ3RoLCAmcGF0X21heGxlbiwgJ1xcJyk7CisJICAgICAgaWYgKHBhdHRlcm4gPT0gTlVMTCkKKwkJZ290byBub19zcGFjZTsKKworCSAgICAgIGJyZWFrOworCisJICAgIGNhc2UgJ1wnJzoKKwkgICAgICBp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hcmdjID4gMCA/IF9fbGliY19hcmdjIC0gMSA6IDAsCisJCQkgICAgICAmYnVmZmVyWzIwXSwgMTAsIDApOworCSAgKndvcmQgPSB3X2FkZHN0ciAoKndvcmQsIHdvcmRfbGVuZ3RoLCBtYXhfbGVuZ3RoLCB2YWx1ZSk7CisJICBmcmVlIChlbnYpOworCSAgZnJlZSAocGF0dGVybik7CisJICByZXR1cm4gKndvcmQgPyAwIDogV1JERV9OT1NQQUNFOworCX0KKyAgICAgIC8qIElzIGl0IGAkKicgb3IgYCRAJyAodW5xdW90ZWQpID8gKi8KKyAgICAgIGVsc2UgaWYgKCplbnYgPT0gJyonIHx8ICgqZW52ID09ICdAJyAmJiAhcXVvdGVkKSkKKwl7CisJICBzaXplX3QgcGxpc3RfbGVuID0gMDsKKwkgIGludCBwOworCSAgY2hhciAqZW5kOworCisJICAvKiBCdWlsZCB1cCB2YWx1ZSBwYXJhbWV0ZXIgYnkgcGFyYW1ldGVyIChjb3B5IHRoZW0pICovCisJICBmb3IgKHAgPSAxOyBfX2xpYmNfYXJndltwXTsgKytwKQorCSAgICBwbGlzdF9sZW4gKz0gc3RybGVuIChfX2xpYmNfYXJndltwXSkgKyAxOyAvKiBmb3Igc3BhY2UgKi8KKwkgIHZhbHVlID0gbWFsbG9jIChwbGlzdF9sZW4pOworCSAgaWYgKHZhbHVlID09IE5VTEwpCisJICAgIGdvdG8gbm9fc3BhY2U7CisJICBlbmQgPSB2YWx1ZTsKKwkgICplbmQgPSAwOworCSAgZm9yIChwID0gMTsgX19saWJjX2FyZ3ZbcF07ICsrcCkKKwkgICAgeworCSAgICAgIGlmIChwID4gMSkKKwkJKmVuZCsrID0gJyAnOworCSAgICAgIGVuZCA9IF9fc3RwY3B5IChlbmQsIF9fbGliY19hcmd2W3BdKTsKKwkgICAgfQorCisJICBmcmVlX3ZhbHVlID0gMTsKKwl9CisgICAgICBlbHNlCisJeworCSAgLyogTXVzdCBiZSBhIHF1b3RlZCBgJEAnICovCisJICBhc3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sgcCsrKQorCSAgICB7CisJICAgICAgc2l6ZV90IG9mZnNldDsKKworCSAgICAgIHN3aXRjaCAoKnApCisJCXsKKwkJY2FzZSAnIic6CisJCSAgaWYgKHF1b3RlZCA9PSAyKQorCQkgICAgcXVvdGVkID0gMDsKKwkJICBlbHNlIGlmIChxdW90ZWQgPT0gMCkKKwkJICAgIHF1b3RlZCA9IDI7CisJCSAgZWxzZSBicmVhazsKKworCQkgIGNvbnRpbnVlOworCisJCWNhc2UgJ1wnJzoKKwkJICBpZiAocXVvdGVkID09IDEpCisJCSAgICBxdW90ZWQgPSAwOworCQkgIGVsc2UgaWYgKHF1b3RlZCA9PSAwKQorCQkgICAgcXVvdGVkID0gMTsKKwkJICBlbHNlIGJyZWFrOworCisJCSAgY29udGludWU7CisKKwkJY2FzZSAnKic6CisJCWNhc2UgJz8nOgorCQkgIGlmIChxdW90ZWQpCisJCSAgICB7CisJCSAgICAgIC8qIENvbnZlcnQgcXVvdGVkIHdpbGRjaGFyIHRvIGVzY2FwZWQgd2lsZGNoYXIuICovCisJCSAgICAgIGV4cGFuZGVkID0gd19hZGRjaGFyIChleHBhbmRlZCwgJmV4cF9sZW4sCisJCQkJCSAgICAmZXhwX21heGwsICdcXCcpOworCisJCSAgICAgIGlmIChleHBhbmRlZCA9PSBOVUxMKQorCQkJZ290byBub19zcGFjZTsKKwkJICAgIH0KKwkJICBicmVhazsKKworCQljYXNlICckJzoKKwkJICBvZmZzZXQgPSAwOworCQkgIGVycm9yID0gcGFyc2VfZG9sbGFycyAoJmV4cGFuZGVkLCAmZXhwX2xlbiwgJmV4cF9tYXhsLCBwLAorCQkJCQkgJm9mZnNldCwgZmxhZ3MsIE5VTEwsIE5VTEwsIE5VTEwsIDEpOworCQkgIGlmIChlcnJvcikKKwkJICAgIHsKKwkJICAgICAgaWYgKGZyZWVfdmFsdWUpCisJCQlmcmVlICh2YWx1ZSk7CisKKwkJICAgICAgZnJlZSAoZXhwYW5kZWQpOworCisJCSAgICAgIGdvdG8gZG9fZXJyb3I7CisJCSAgICB9CisKKwkJICBwICs9IG9mZnNldDsKKwkJICBjb250aW51ZTsKKworCQljYXNlICd+JzoKKwkJICBpZiAocXVvdGVkIHx8IGV4cF9sZW4pCisJCSAgICBicmVhazsKKworCQkgIG9mZnNldCA9IDA7CisJCSAgZXJyb3IgPSBwYXJzZV90aWxkZSAoJmV4cGFuZGVkLCAmZXhwX2xlbiwgJmV4cF9tYXhsLCBwLAorCQkJCSAgICAgICAmb2Zmc2V0LCAwKTsKKwkJICBpZiAoZXJyb3IpCisJCSAgICB7CisJCSAgICAgIGlmIChmcmVlX3ZhbHVlKQorCQkJZnJlZSAodmFsdWUpOworCisJCSAgICAgIGZyZWUgKGV4cGFuZGVkKTsKKworCQkgICAgICBnb3RvIGRvX2Vycm9yOworCQkgICAgfQorCisJCSAgcCArPSBvZmZzZXQ7CisJCSAgY29udGludWU7CisKKwkJY2FzZSAnXFwnOgorCQkgIGV4cGFuZGVkID0gd19hZGRjaGFyIChleHBhbmRlZCwgJmV4cF9sZW4sICZleHBfbWF4bCwgJ1xcJyk7CisJCSAgKytwOworCQkgIGFzc2VydCAoKnApOyAvKiBjaGVja2VkIHdoZW4gZXh0cmFjdGVkIGluaXRpYWxseSAqLworCQkgIGlmIChleHBhbmRlZCA9PSBOVUxMKQorCQkgICAgZ290byBub19zcGFjZTsKKwkJfQorCisJICAgICAgZXhwYW5kZWQgPSB3X2FkZGNoYXIgKGV4cGFuZGVkLCAmZXhwX2xlbiwgJmV4cF9tYXhsLCAqcCk7CisKKwkgICAgICBpZiAoZXhwYW5kZWQgPT0gTlVMTCkKKwkJZ290byBub19zcGFjZTsKKwkgICAgfQorCisJICBmcmVlIChwYXR0ZXJuKTsKKworCSAgcGF0dGVybiA9IGV4cGFuZGVkOworCX0KKworICAgICAgc3dpdGNoIChhY3Rpb24pCisJeworCWNhc2UgQUNUX1JQX1NIT1JUX0xFRlQ6CisJY2FzZSBBQ1RfUlBfTE9OR19MRUZUOgorCW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09ICdcMCcpCisJCXN0ciA9IF8oInBhcmFtZXRlciBudWxsIG9yIG5vdCBzZXQiKTsKKworCSAgICAgIF9fZnhwcmludGYgKE5VTEwsICIlczogJXNcbiIsIGVudiwgc3RyKTsKKwkgICAgfQorCisJICBpZiAoZnJlZV92YWx1ZSkKKwkgICAgZnJlZSAodmFsdWUpOworCSAgZ290byBkb19lcnJvcjsKKworCWNhc2UgQUNUX05VTExfU1VCU1Q6CisJICBpZiAodmFsdWUgJiYgKnZhbHVlKQorCSAgICAvKiBTdWJzdGl0dXRlIHBhcmFtZXRlciAqLworCSAgICBicmVhazsKKworCSAgaWYgKGZyZWVfdmFsdWUpCisJICAgIGZyZWUgKHZhbHVlKTsKKworCSAgaWYgKCFjb2xvbl9zZWVuICYmIHZhbHVlKQorCSAgICAvKiBTdWJzdGl0dXRlIE5VTEwgKi8KKwkgICAgZ290byBzdWNjZXNzOworCisJICB2YWx1ZSA9IHBhdHRlcm4gPyBfX3N0cmR1cCAocGF0dGVybikgOiBwYXR0ZXJuOworCSAgZnJlZV92YWx1ZSA9IDE7CisKKwkgIGlmIChwYXR0ZXJuICYmICF2YWx1ZSkKKwkgICAgZ290byBub19zcGFjZTsKKworCSAgYnJlYWs7CisKKwljYXNlIEFDVF9OT05OVUxMX1NVQlNUOgorCSAgaWYgKHZhbHVlICYmICgqdmFsdWUgfHwgIWNvbG9uX3NlZW4pKQorCSAgICB7CisJICAgICAgaWYgKGZyZWVfdmFsdWUpCisJCWZyZWUgKHZhbHVlKTsKKworCSAgICAgIHZhbHVlID0gcGF0dGVybiA/IF9fc3RyZHVwIChwYXR0ZXJuKSA6IHBhdHRlcm47CisJICAgICAgZnJlZV92YWx1ZSA9IDE7CisKKwkgICAgICBpZiAocGF0dGVybiAmJiAhdmFsdWUpCisJCWdvdG8gbm9fc3BhY2U7CisKKwkgICAgICBicmVhazsKKwkgICAgfQorCisJICAvKiBTdWJzdGl0dXRlIE5VTEwgKi8KKwkgIGlmIChmcmVlX3Zhb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NfaWZzID0gMTsKKwkgICAgICBuZXh0X2ZpZWxkKys7CisJICAgIH0KKworCSAgLyogTnVsbC10ZXJtaW5hdGUgaXQgKi8KKwkgICpmaWVsZF9lbmQgPSAwOworCisJICAvKiBUYWcgYSBjb3B5IG9udG8gdGhlIGN1cnJlbnQgd29yZCAqLworCSAgKndvcmQgPSB3X2FkZHN0ciAoKndvcmQsIHdvcmRfbGVuZ3RoLCBtYXhfbGVuZ3RoLCBmaWVsZF9iZWdpbik7CisKKwkgIGlmICgqd29yZCA9PSBOVUxMICYmICpmaWVsZF9iZWdpbiAhPSAnXDAnKQorCSAgICB7CisJICAgICAgZnJlZSAodmFsdWVfY29weSk7CisJICAgICAgZ290byBub19zcGFjZTsKKwkgICAgfQorCisJICBmaWVsZF9iZWdpbiA9IG5leHRfZmllbGQ7CisJfQorICAgICAgd2hpbGUgKHNlZW5fbm9ud3NfaWZzIHx8ICpmaWVsZF9iZWdpbik7CisKKyAgICAgIGZyZWUgKHZhbHVlX2NvcHkpOworICAgIH0KKworICByZXR1cm4gMDsKKworc3VjY2VzczoKKyAgZXJyb3IgPSAwOworICBnb3RvIGRvX2Vycm9yOworCitub19zcGFjZToKKyAgZXJyb3IgPSBXUkRFX05PU1BBQ0U7CisgIGdvdG8gZG9fZXJyb3I7CisKK3N5bnRheDoKKyAgZXJyb3IgPSBXUkRFX1NZTlRBWDsKKworZG9fZXJyb3I6CisgIGZyZWUgKGVudik7CisKKyAgZnJlZSAocGF0dGVybik7CisKKyAgcmV0dXJuIGVycm9yOworfQorCisjdW5kZWYgQ0hBUl9JTl9TRVQKKworc3RhdGljIGludAoraW50ZXJuYWxfZnVuY3Rpb24KK3BhcnNlX2RvbGxhcnMgKGNoYXIgKip3b3JkLCBzaXplX3QgKndvcmRfbGVuZ3RoLCBzaXplX3QgKm1heF9sZW5ndGgsCisJICAgICAgIGNvbnN0IGNoYXIgKndvcmRzLCBzaXplX3QgKm9mZnNldCwgaW50IGZsYWdzLAorCSAgICAgICB3b3JkZXhwX3QgKnB3b3JkZXhwLCBjb25zdCBjaGFyICppZnMsIGNvbnN0IGNoYXIgKmlmc193aGl0ZSwKKwkgICAgICAgaW50IHF1b3RlZCkKK3sKKyAgLyogV2UgYXJlIHBvaXNlZCBfYXRfICIkIiAqLworICBzd2l0Y2ggKHdvcmRzWzEgKyAqb2Zmc2V0XSkKKyAgICB7CisgICAgY2FzZSAnIic6CisgICAgY2FzZSAnXCcnOgorICAgIGNhc2UgMDoKKyAgICAgICp3b3JkID0gd19hZGRjaGFyICgqd29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsICckJyk7CisgICAgICByZXR1cm4gKndvcmQgPyAwIDogV1JERV9OT1NQQUNFOworCisgICAgY2FzZSAnKCc6CisgICAgICBpZiAod29yZHNbMiArICpvZmZzZXRdID09ICcoJykKKwl7CisJICAvKiBEaWZmZXJlbnRpYXRlIGJldHdlZW4gJCgoMSszKSkgYW5kICQoKGVjaG8pOyhscykpICovCisJICBpbnQgaSA9IDMgKyAqb2Zmc2V0OworCSAgaW50IGRlcHRoID0gMDsKKwkgIHdoaWxlICh3b3Jkc1tpXSAmJiAhKGRlcHRoID09IDAgJiYgd29yZHNbaV0gPT0gJyknKSkKKwkgICAgeworCSAgICAgIGlmICh3b3Jkc1tpXSA9PSAnKCcpCisJCSsrZGVwdGg7CisJICAgICAgZWxzZSBpZiAod29yZHNbaV0gPT0gJyknKQorCQktLWRlcHRoOworCisJICAgICAgKytpOworCSAgICB9CisKKwkgIGlmICh3b3Jkc1tpXSA9PSAnKScgJiYgd29yZHNbaSArIDFdID09ICcpJykKKwkgICAgeworCSAgICAgICgqb2Zmc2V0KSArPSAzOworCSAgICAgIC8qIENhbGwgcGFyc2VfYXJpdGggLS0gMCBpcyBmb3IgIm5vIGJyYWNrZXRzIiAqLworCSAgICAgIHJldHVybiBwYXJzZV9hcml0aCAod29yZCwgd29yZF9sZW5ndGgsIG1heF9sZW5ndGgsIHdvcmRzLCBvZmZzZXQsCisJC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lIHBvaXNlZCBqdXN0IGFmdGVyICJgIiAqLworICBpbnQgZXJyb3I7CisgIGludCBzcXVvdGluZyA9IDA7CisgIHNpemVfdCBjb21tX2xlbmd0aDsKKyAgc2l6ZV90IGNvbW1fbWF4bGVuOworICBjaGFyICpjb21tID0gd19uZXd3b3JkICgmY29tbV9sZW5ndGgsICZjb21tX21heGxlbik7CisKKyAgZm9yICg7IHdvcmRzWypvZmZzZXRdOyArKygqb2Zmc2V0KSkKKyAgICB7CisgICAgICBzd2l0Y2ggKHdvcmRzWypvZmZzZXRdKQorCXsKKwljYXNlICdgJzoKKwkgIC8qIEdvIC0tIGdpdmUgdGhlIHNjcmlwdCB0byB0aGUgc2hlbGwgKi8KKwkgIGVycm9yID0gZXhlY19jb21tIChjb21tLCB3b3JkLCB3b3JkX2xlbmd0aCwgbWF4X2xlbmd0aCwgZmxhZ3MsCisJCQkgICAgIHB3b3JkZXhwLCBpZnMsIGlmc193aGl0ZSk7CisJICBmcmVlIChjb21tKTsKKwkgIHJldHVybiBlcnJvcjsKKworCWNhc2UgJ1xcJzoKKwkgIGlmIChzcXVvdGluZykKKwkgICAgeworCSAgICAgIGVycm9yID0gcGFyc2VfcXRkX2JhY2tzbGFzaCAoJmNvbW0sICZjb21tX2xlbmd0aCwgJmNvbW1fbWF4bGVuLAorCQkJCQkgICB3b3Jkcywgb2Zmc2V0KTsKKworCSAgICAgIGlmIChlcnJvcikKKwkJeworCQkgIGZyZWUgKGNvbW0pOworCQkgIHJldHVybiBlcnJvcjsKKwkJfQorCisJICAgICAgYnJlYWs7CisJICAgIH0KKworCSAgZXJyb3IgPSBwYXJzZV9iYWNrc2xhc2ggKCZjb21tLCAmY29tbV9sZW5ndGgsICZjb21tX21heGxlbiwgd29yZHMsCisJCQkJICAgb2Zmc2V0KTsKKworCSAgaWYgKGVycm9yKQorCSAgICB7CisJICAgICAgZnJlZSAoY29tbSk7CisJICAgICAgcmV0dXJuIGVycm9yOworCSAgICB9CisKKwkgIGJyZWF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IHdpdGguCisgKi8KKwordm9pZAord29yZGZyZWUgKHdvcmRleHBfdCAqcHdvcmRleHApCit7CisKKyAgLyogd29yZGV4cCBjYW4gc2V0IHB3b3JkZXhwIHRvIE5VTEwgKi8KKyAgaWYgKHB3b3JkZXhwICYmIHB3b3JkZXhwLT53ZV93b3JkdikKKyAgICB7CisgICAgICBjaGFyICoqd29yZHYgPSBwd29yZGV4cC0+d2Vfd29yZHY7CisKKyAgICAgIGZvciAod29yZHYgKz0gcHdvcmRleHAtPndlX29mZnM7ICp3b3JkdjsgKyt3b3JkdikKKwlmcmVlICgqd29yZHYpOworCisgICAgICBmcmVlIChwd29yZGV4cC0+d2Vfd29yZHYpOworICAgICAgcHdvcmRleHAtPndlX3dvcmR2ID0gTlVMTDsKKyAgICB9Cit9CitsaWJjX2hpZGRlbl9kZWYgKHdvcmRmcmVlKQorCisvKgorICogd29yZGV4cCgpCisgKi8KKworaW50Cit3b3JkZXhwIChjb25zdCBjaGFyICp3b3Jkcywgd29yZGV4cF90ICpwd29yZGV4cCwgaW50IGZsYWdzKQoreworICBzaXplX3Qgd29yZHNfb2Zmc2V0OworICBzaXplX3Qgd29yZF9sZW5ndGg7CisgIHNpemVfdCBtYXhfbGVuZ3RoOworICBjaGFyICp3b3JkID0gd19uZXd3b3JkICgmd29yZF9sZW5ndGgsICZtYXhfbGVuZ3RoKTsKKyAgaW50IGVycm9yOworICBjaGFyICppZnM7CisgIGNoYXIgaWZzX3doaXRlWzRdOworICB3b3JkZXhwX3Qgb2xkX3dvcmQgPSAqcHdvcmRleHA7CisKKyAgaWYgKGZsYWdzICYgV1JERV9SRVVTRSkKKyAgICB7CisgICAgICAvKiBNaW5pbWFsIGltcGxlbWVudGF0aW9uIG9mIFdSREVfUkVVU0UgZm9yIG5vdyAqLworICAgICAgd29yZGZyZWUgKHB3b3JkZXhwKTsKKyAgICAgIG9sZF93b3JkLndlX3dvcmR2ID0gTlVMTDsKKyAgICB9CisKKyAgaWYgKChmbGFncyAmIF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wkgICAgICB7CisJCWVycm9yID0gV1JERV9OT1NQQUNFOworCQlnb3RvIGRvX2Vycm9yOworCSAgICAgIH0KKworCSAgICBicmVhazsKKwkgIH0KKworCS8qIElmIGEgd29yZCBoYXMgYmVlbiBkZWxpbWl0ZWQsIGFkZCBpdCB0byB0aGUgbGlzdC4gKi8KKwlpZiAod29yZCAhPSBOVUxMKQorCSAgeworCSAgICBlcnJvciA9IHdfYWRkd29yZCAocHdvcmRleHAsIHdvcmQpOworCSAgICBpZiAoZXJyb3IpCisJICAgICAgZ290byBkb19lcnJvcjsKKwkgIH0KKworCXdvcmQgPSB3X25ld3dvcmQgKCZ3b3JkX2xlbmd0aCwgJm1heF9sZW5ndGgpOworICAgICAgfQorCisgIC8qIEVuZCBvZiBzdHJpbmcgKi8KKworICAvKiBUaGVyZSB3YXMgYSB3b3JkIHNlcGFyYXRvciBhdCB0aGUgZW5kICovCisgIGlmICh3b3JkID09IE5VTEwpIC8qIGkuZS4gd19uZXd3b3JkICovCisgICAgcmV0dXJuIDA7CisKKyAgLyogVGhlcmUgd2FzIG5vIGZpZWxkIHNlcGFyYXRvciBhdCB0aGUgZW5kICovCisgIHJldHVybiB3X2FkZHdvcmQgKHB3b3JkZXhwLCB3b3JkKTsKKworZG9fZXJyb3I6CisgIC8qIEVycm9yOgorICAgKglmcmVlIG1lbW9yeSB1c2VkICh1bmxlc3MgZXJyb3IgaXMgV1JERV9OT1NQQUNFKSwgYW5kCisgICAqCXNldCBwd29yZGV4cCBtZW1iZXJzIGJhY2sgdG8gd2hhdCB0aGV5IHdlcmUuCisgICAqLworCisgIGZyZWUgKHdvcmQpOworCisgIGlmIChlcnJvciA9PSBXUkRFX05PU1BBQ0UpCisgICAgcmV0dXJuIFdSREVfTk9TUEFDRTsKKworICBpZiAoKGZsYWdzICYgV1JERV9BUFBFTkQpID09IDApCisgICAgd29yZGZyZWUgKHB3b3JkZXhwKTsKKworICAqcHdvcmRleHAgPSBvbGRfd29yZDsKKyAgcmV0dX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